Remote command workflow action
The reviewed remote workflow implementation at 85397c3559740694dd04515d6f36f1215825c4f5 connects the CRM automation builder, REST automation routes and five automation MCP tools to a strict remote_command action. The current main integration is included by merge commit 6206eb63e6148f7c044b1bf1bf4eb7f911861608; generic engine/schema/registration source remains parent-owned. The generic engine, schema, REST and automation MCP integration are present in the application, including automations/remote-steps.ts. The original adapter admitted native screenshot and click; the expanded contract also admits the bounded browser and desktop commands listed below. It selects an existing machine and an existing delegated grant. There is no script, shell or arbitrary command input.
Example action:
{
"kind": "remote_command",
"machineId": "<existing machine UUID>",
"grantId": "<existing delegated grant UUID>",
"command": { "kind": "click", "args": { "x": 120, "y": 80 } }
}
A browser session can edit a stopped draft. Live enable must be approved by the revision creator using their actual current delegated organization API key with crm, machines and write scopes and the explicitly selected live grant. Ordinary standard user-custody org keys are supported; token-derived, personal/scoped, runner and service-custody credentials are refused. No key, grant, consent or privilege is created by enabling a workflow. Dry run records planned steps and submits zero commands.
Approval atomically stores a content-free audit binding to the organization, workflow, revision/input digests, creator ceiling, key/persona and selected principal/machine/grant. It stores no bearer secret. Current creator permissions, key state, role ceilings, persona, organization policy, machine state and consent are resolved again at dispatch and before continuation. References and the triggering event never supply machine authority.
The workflow transaction commits one waiting step and continuation before admission. The existing once-a-minute automation-wait sweep claims it and calls the canonical machine command producer with a deterministic operation identity. No SQL lock is held while waiting for a device. Exact command/principal/payload readback recovers a command committed before a lost workflow receipt. A dispatch claim with no readable command becomes unknown and never resends automatically.
If the admission response itself is lost, exact readback permits queued-only recall while the run remains failed with an unknown outcome. Sent work stays in flight. A delayed admission receipt cannot overwrite an already terminal failure, including a competing sweep's readback outage.
Queued, awaiting approval, sent and running remain waiting. Only canonical acknowledged ok with valid current authority, lease/approval and an in-time completion can resume the same run. Screenshot success also requires a referenced canonical nonempty screenshot artifact. Artifact bytes remain behind the existing authorized artifact-content endpoint; workflow history stores references and structured state. Failed, cancelled, missing, expired and unknown outcomes block later actions.
Stop, disable and edits fence continuation and attempt canonical queued/awaiting-approval recall. Sent or running work may already have acted and cannot be recalled. History exposes command/artifact IDs and cannot_recall_in_flight; a late acknowledgement never revives the stopped run. Stop does not pause machines or revoke unrelated grants.
The capability catalog derives the action schema from the same runtime schema. Official generated documentation remains parent-owned. Recording-device tests do not establish physical desktop reliability. Physical pilot testing, agentic judgement, key brokerage and the broader agentic workflow remain separate work.
Browser/desktop completion adapter
machines/workflow-contract.ts now owns the typed action. It derives strict arguments from the canonical command catalogue for native screenshot/click/type/key/scroll/tree/wait and browser open/navigation/click/type/read/screenshot/record. Scripts, profile mutation, arbitrary evaluation and caller-supplied consent stamps remain excluded. Chrome uses canonical browser_create_tab/browser_snapshot; desktop uses the existing desktop_visible or desktop_hidden surface.
A browser workflow needs the selected grant linked to a real current remote session. Its audit binding includes a digest of the canonical consent receipt, including generation, selected sites and desktop consent permissions. A foreign machine/profile/grant or a generation change requires fresh revision approval. Current browser policy, principal, grants and Stop are checked through the existing services. No owner/admin bypass or consent creation was added. Personal-key/owner-request workflows remain unsupported by this delegated adapter.
Desktop screenshot and recording evidence uses the driver's bounded inline PNG results; Chrome's maintained driver returns JPEG and screenshot_sequence. Native screenshots retain canonical artifact IDs and authorized artifact-content readback. These formats are validated before continuation verification, and image bytes remain untrusted device data.
The maintained Electron journey exercises a disposable profile, actual local consent UI, production browser poller, canonical HTTP queue, real Chromium actions and screenshot/recording output. An independent local HTTP service reads back the typed value, outside the actor renderer. Handoff returns the same tab; Stop, disconnect/reconnect and restart require fresh consent. The device IPC fixture is synthetic: this does not certify physical OS input, recording on a physical device or external signed-in accounts.
The generic remote workflow implementation is mounted through the canonical automation routes and MCP group. Stop-one-run is available through the run inspector, REST and automation_run_cancel; it fences continuation and attempts queued-only recall without stopping other runs. The device journey above remains separate evidence for the browser/desktop adapter, rather than proof of physical device reliability.
The composed journey uses ordinary REST workflow creation and enable, a real event and the maintained wait sweep. The same workflow run dispatches browser type, read, screenshot and a two-frame recording through the production Electron poller. Each canonical acknowledgment and PNG is checked before the sweep can create exactly one later task. Independent HTTP readback verifies the persisted typed value. A separate typed-only case makes no capture claim; Stop during capture checks that bytes and continuation stay fenced. See docs/ops/remote-desktop-browser-journey/ACCEPTANCE.md for qualification results and remaining live prerequisites. No migrations or global registration edits were made by this fix round.