Core Concepts
ProcessWireConsole separates HTTP/Inertia routing from operational logic inside Totoglu\WireConsole\ConsoleRuntime, composed from nine focused subsystem traits.
Guarded Action & Telemetry Architecture
Section titled “Guarded Action & Telemetry Architecture”flowchart TD
A["Admin opens Setup -> Console (9 RBAC sections)"] --> B["ProcessWireConsole builds RBAC-filtered Inertia props"]
B --> C["User triggers workspace action (POST ./action/)"]
C --> D["Validate CSRF + JSON bounds (64 KB / depth 16 / 256 elements)"]
D --> E["ConsoleRuntime::executeWorkspaceAction() -> guardAndRun()"]
E --> F["Check section permission + superuser + demo mode + confirmation + cooldown"]
F --> G["Execute subsystem trait (Migrations / Queues / Backup / Boost / Logs)"]
G --> H["Write secret-redacted JSON entry to wire-console-audit"]
1. Nine Workspace Sections & Traits
Section titled “1. Nine Workspace Sections & Traits”ConsoleRuntime composes nine dedicated traits backing the 9 sections of Setup -> Console:
HandlesWorkspaceActions(central dispatcher for all 34 guarded actions +inspectFile)InteractsWithMigrations(wire_migrationstable, run, rollback, reset/refresh/fresh)InteractsWithQueues(queue_jobs&failed_jobs, bounded worker batches, dispatch, retry, purge)InteractsWithSeedingAndScheduling(site/seeders/with Faker detection +site/schedule/cron tasks)InteractsWithBackups(site/assets/backups/database/*.sql, safety backups, purge, restore, download)InteractsWithTesting(Pest & Playwright E2E discovery, argument sanitization, execution)InteractsWithBoost(.agents/sync, configuration, remote skill install, read-only MCP tool runner)InteractsWithScaffolding(identifier validation, stub scaffolding, safeinspectProjectFile())InteractsWithSystemAndLogs(version matrix, maintenance mode, cache flush, log channels)
2. Guarded Action Pipeline (guardAndRun)
Section titled “2. Guarded Action Pipeline (guardAndRun)”Every state-changing POST to ./action/ must pass:
- ProcessWire
$session->CSRF->validate()and strict payload limits (MAX_JSON_BODY_BYTES = 65536,MAX_JSON_DEPTH = 16,MAX_JSON_ELEMENTS = 256). - Section-level permission check (
userCanView()) plus superuser checks on high-risk operations (such as backup restore/download or migration reset). $config->demoguard (isDemoMode()).- Per-session cooldown throttling (
checkRateLimit()). - Structured audit logging (
audit()) towire-console-auditwith recursive secret redaction.