* feat: add runtime admin and orchestration commands * feat: add runtime diagnostics commands * refactor: clean up runtime router surface * refactor: remove runtime cleanup dead weight * fix: clean up admin install temp inputs on resolve failure
7.8 KiB
Command Ownership Inventory
This inventory keeps the public boundary stable while command semantics move into the runtime layer. New integrations should prefer the runtime, backend, and IO interfaces over helper subpaths.
Portable Command Runtime
These commands describe device, app, capture, selector, or interaction behavior.
Their semantics should live in agent-device/commands as they migrate.
alertapp-switcherappsappstatebackclickclipboardclosedifffillfindfocusgethomeiskeyboardlongpressopenpinchpresspushrotatescreenshotscrollsettingssnapshotswipetrigger-app-eventtypewait
Runtime Migration Status
screenshot: runtime command implemented; daemon screenshot dispatch calls the runtime.diff screenshot: runtime command implemented; CLI screenshot diff dispatch calls the runtime.snapshot: runtime command implemented; daemon snapshot dispatch calls the runtime.diff snapshot: runtime command implemented; daemon snapshot diff dispatch calls the runtime.find: read-only runtime actions implemented forexists,wait,get text, andget attrs; mutating find actions remain on the existing interaction path.get: runtime command implemented; daemon get dispatch calls the runtime.is: runtime command implemented; daemon is dispatch calls the runtime.wait: runtime command implemented for sleep, text, ref, and selector waits; daemon wait dispatch calls the runtime.click: runtime command implemented for point, ref, and selector targets; the daemon click dispatch calls the runtime.press: runtime command implemented for point, ref, and selector targets; the daemon press dispatch calls the runtime.fill: runtime command implemented for point, ref, and selector targets; the daemon fill dispatch calls the runtime.type: runtime command implemented; daemon type dispatch calls the runtime.open: runtimeapps.openimplemented for typed app, bundle/package, activity, URL, and relaunch targets.close: runtimeapps.closeimplemented for optional app targets.apps: runtimeapps.listimplemented with typed app list filters.appstate: runtimeapps.stateimplemented against backend state primitives.push: runtimeapps.pushimplemented with JSON and artifact/file inputs; local file inputs remain command-policy gated.trigger-app-event: runtimeapps.triggerEventimplemented with event name and JSON payload validation.back: runtimesystem.backimplemented with typed in-app/system modes.home: runtimesystem.homeimplemented.rotate: runtimesystem.rotateimplemented with explicit orientation validation.keyboard: runtimesystem.keyboardimplemented with explicit status/get and dismiss result shapes.clipboard: runtimesystem.clipboardimplemented with read/write result unions.settings: runtimesystem.settingsimplemented as a typed settings-open primitive.alert: runtimesystem.alertimplemented with explicit status, handled, and wait result unions.app-switcher: runtimesystem.appSwitcherimplemented.focus: runtimeinteractions.focusimplemented for point, ref, and selector targets.longpress: runtimeinteractions.longPressimplemented for point, ref, and selector targets.swipe: runtimeinteractions.swipeimplemented with point, ref, selector, and viewport-derived directional starts.scroll: runtimeinteractions.scrollimplemented with viewport, point, ref, and selector targets.pinch: runtimeinteractions.pinchimplemented behind the typed backend primitive.devices: runtimeadmin.devicesimplemented through typed backend inventory primitives.boot: runtimeadmin.bootimplemented through a typed backend boot primitive.ensure-simulator: runtimeadmin.ensureSimulatorimplemented with typed simulator options and result shape.install: runtimeadmin.installimplemented with structured install sources and local path policy enforcement.reinstall: runtimeadmin.reinstallimplemented with structured install sources and local path policy enforcement.install-from-source: runtimeadmin.installFromSourceimplemented with the same structured source resolver used by install/reinstall.batch: runtime router command implemented; nested steps are dispatched throughcreateCommandRouter()so policy and error formatting run per step.record: runtimerecordrouter/API command implemented with typed record start/stop result unions.trace: runtimetracerouter/API command implemented with typed trace start/stop result unions.logs: runtimediagnostics.logsimplemented with bounded, paginated, best-effort redacted log entries.network: runtimediagnostics.networkimplemented with bounded, structured, best-effort redacted network entries.perf: runtimediagnostics.perfimplemented with typed metric entries.replay: still daemon/CLI owned; runtime router migration is deferred until it can reuse the real.adparser and healing semantics.test: still daemon/CLI owned; runtime router migration is deferred until it can share daemon replay-suite semantics end to end.
Boundary Requirements
- Public command APIs expose only implemented commands. Planned commands belong
in
commandCatalog, not as methods that throw at runtime. - Runtime services default to
restrictedCommandPolicy(). Local input and output paths require an explicit local policy or adapter decision. - File inputs and outputs cross the runtime boundary through
agent-device/iorefs and artifact descriptors; command implementations should not accept ad-hoc path strings for new file contracts. - Image-producing or image-reading commands must preserve
maxImagePixelsenforcement before decoding or comparing untrusted images. - Backend escape hatches must be named capabilities with a policy gate. Do not add a freeform backend command bag.
- Command options should carry
session,requestId,signal, andmetadatathroughCommandContextso hosted adapters can enforce request scope, cancellation, and audit correlation consistently. - Runtime command modules should depend on shared
src/utils/*helpers, not daemon-only modules. Keep daemon paths as compatibility shims when older handlers still import them. - New backend adapters should run
agent-device/testing/conformancesuites for the command families they claim to support.
Backend And Admin Capabilities
These commands manage devices or app installation. Keep them explicit backend capabilities so hosted adapters can decide what is supported.
bootdevicesensure-simulatorinstallinstall-from-sourcereinstall
Transport And Session Orchestration
These are daemon, CLI, or transport concerns. They can construct or call the runtime, but they are not portable command semantics.
session- lease allocation, heartbeat, and release daemon commands
Environment Preparation
These prepare local or remote development environment state. Keep them outside the portable command runtime.
connectconnectiondisconnectmetro
Later Capability-Gated Runtime Commands
All currently identified capability-gated diagnostics have runtime command
contracts. New diagnostics should follow the diagnostics.* namespace with
bounded result windows and backend-specific support.
Compatibility Helper Subpaths
These subpaths remain available during migration, but they should not be the primary boundary for new command behavior:
agent-device/contractsagent-device/selectorsagent-device/findersagent-device/install-sourceagent-device/android-appsagent-device/artifactsagent-device/metroagent-device/remote-config