Files
Michał Pierzchała 2ec4e91b11 refactor(core): move the command descriptor registry into its own workspace package (#2348)
* refactor(core): move the command descriptor registry into its own package

`src/core/command-descriptor/`, `src/command-catalog.ts`, `src/core/wait-positionals.ts`
and `src/core/parse-timeout.ts` move as git renames into a new private package
`@agent-device/command-registry` (deps: contracts, selectors). One subpath per module
points straight at the moved file; no `index.ts`, no re-export at the old path. Every
consumer switches to the owning specifier.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz

* test(host-kit): pin the command-registry package inside the daemon code graph

The daemon reaches the registry and its catalog only by workspace specifier. A walk
that stopped at the package boundary would report an unchanged signature after a
descriptor edit, and the client would keep reusing a daemon running the superseded
policy. The manifest is asserted beside the sources because its `exports` map is what
chose them. The cache doc comment quoting the old ~800-module graph is corrected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz

* chore(gates): point the descriptor-registry gates at the package path

R66's `COMMAND_DESCRIPTOR_MODULE`, R16's record-runtime join subject and the Fallow
`AssertTrue` totality-guard key follow the registry to its package. The two descriptor
hubs leave `HUB_ENTRY_FILES` because the package manifest now publishes them, so the
eager-closure gate discovers them as facades and one entry gets one rule; this also
flips `denyPlatformImplementations` from false (hub) to true (package entry) for both,
which is intentional and stricter. `command-registry` joins the ranked spine at rank 1.

No `APPROVED_OVER_CEILING` row: rename detection carries every moved entry's merge-base
baseline, so all twelve fall under the no-growth rule rather than a ceiling.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-06 12:55:14 +02:00
..

Examples

Runnable, typechecked Node.js examples for the agent-device SDK surface exposed to Node consumers. Source of truth for the API itself is Node.js API. Two guards keep these files in sync with that doc: src/__tests__/client-api-examples-drift.test.ts checks the doc's subpath API manifest against what these examples import, and test/integration/client-api-doc-snippets.test.ts compiles every fenced TypeScript code block in the doc itself against the real agent-device/* sources.

sdk/

Standalone scripts under sdk/ exercise the published agent-device export map — agent-device, agent-device/metro, agent-device/contracts, agent-device/batch, and agent-device/ai-sdk — the same way a Node consumer or the agent-device-cloud bridge would. Each file:

  • has a top comment stating what it demonstrates and its prerequisites (daemon running, device/simulator available);
  • typechecks without live hardware — pnpm typecheck resolves the agent-device/... imports against src/sdk/ via examples/sdk/tsconfig.json's paths, so CI checks them without a build or publish step;
  • imports the package by name (agent-device/...), not a relative src/ path, so it exercises the same surface a real consumer sees;
  • is runnable on its own with node --experimental-strip-types (repo Node is >=22.12) once the package is built (pnpm build) — running for real resolves agent-device as a self-referencing package, the same way an installed consumer would.
Example Subpath Demonstrates
client-session.ts agent-device createAgentDeviceClient → open → snapshot/tap → close, with typed error handling
metro-runtime.ts agent-device/metro normalizeBaseUrl, resolveRuntimeTransport
contracts-result.ts agent-device/contracts typed result consumption via centerOfRect
batch-orchestration.ts agent-device/batch runBatch for a custom transport
ai-sdk-tools.ts agent-device/ai-sdk createAgentDeviceTools driven by a ToolLoopAgent

test-app/

test-app/ is the Expo dogfood fixture used for agent-device experiments (see its own README) — it is a test fixture, not an SDK usage example.