diff --git a/.fallowrc.json b/.fallowrc.json index 3301417867..123e50f85c 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -246,7 +246,7 @@ }, { "comment": "Type-level `AssertTrue<...>` registry-totality guards. Exported only so `noUnusedLocals` keeps them alive; a consumer would defeat the point.", - "file": "{src/core/command-descriptor/registry.ts,src/core/interactors/register-builtins.ts,src/core/platform-descriptor/registry.ts,src/daemon/request-platform-providers.ts}", + "file": "{packages/command-registry/src/registry.ts,src/core/interactors/register-builtins.ts,src/core/platform-descriptor/registry.ts,src/daemon/request-platform-providers.ts}", "exports": [ "CommandOwnerFileClaimsAreComplete", "BuiltinPluginsCoverAllPlatforms", diff --git a/AGENTS.md b/AGENTS.md index f5fde67594..8e30ddc8cc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,12 +45,12 @@ normal app-driving startup follows the skill's routing card. Read the declaration rather than maintaining a prose copy: - commands and their surface, runtime-use, batch, and timeout traits: - `src/core/command-descriptor/registry.ts` + `packages/command-registry/src/registry.ts` - daemon route ownership and request-policy traits: `src/daemon/daemon-command-registry.ts` - interaction paths and guarantees: `packages/contracts/src/interaction-guarantees.ts` -- canonical command names: `src/command-catalog.ts` +- canonical command names: `packages/command-registry/src/catalog.ts` - device runtime-use declarations and fact admission: - `src/core/command-descriptor/registry.ts`, `src/daemon/runtime-admission.ts`, and + `packages/command-registry/src/registry.ts`, `src/daemon/runtime-admission.ts`, and `src/platform-runtime-gateway.ts` - common command input fields, and which surface may write an input key (model, operator, retired): `src/commands/common-input-fields.ts` and `src/commands/input-audience.ts` diff --git a/examples/sdk/tsconfig.json b/examples/sdk/tsconfig.json index e10566e8f9..c38f5fa7ab 100644 --- a/examples/sdk/tsconfig.json +++ b/examples/sdk/tsconfig.json @@ -21,5 +21,5 @@ // prior build, workspace link, or publish step. Running an example for real // still resolves `agent-device` as a self-referencing package (needs // `pnpm build`), matching how a real consumer would import it. - "include": [".", "../../src/global.d.ts"] + "include": [".", "../../packages/command-registry/src/global.d.ts"] } diff --git a/package.json b/package.json index d50d0166a8..2533eaa41a 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "check:unit": "pnpm test:unit && pnpm check:tmpdir-leaks && pnpm test:smoke", "check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit", "prepack": "pnpm check:mcp-metadata && pnpm package:npm", - "typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/host-kit packages/capture-kit packages/managed-allocation packages/provision-kit packages/platform-apple packages/platform-android packages/platform-harmonyos packages/platform-vega packages/platform-linux packages/platform-web packages/ad-script packages/selectors packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json", + "typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/host-kit packages/capture-kit packages/managed-allocation packages/provision-kit packages/platform-apple packages/platform-android packages/platform-harmonyos packages/platform-vega packages/platform-linux packages/platform-web packages/ad-script packages/selectors packages/command-registry packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json", "test-app:install": "pnpm install --dir examples/test-app", "test-app:start": "pnpm --dir examples/test-app start", "test-app:ios": "pnpm --dir examples/test-app ios", @@ -277,6 +277,7 @@ "@agent-device/ad-replay": "workspace:*", "@agent-device/ad-script": "workspace:*", "@agent-device/capture-kit": "workspace:*", + "@agent-device/command-registry": "workspace:*", "@agent-device/contracts": "workspace:*", "@agent-device/host-kit": "workspace:*", "@agent-device/kernel": "workspace:*", diff --git a/packages/command-registry/package.json b/packages/command-registry/package.json new file mode 100644 index 0000000000..916fc1856f --- /dev/null +++ b/packages/command-registry/package.json @@ -0,0 +1,62 @@ +{ + "name": "@agent-device/command-registry", + "version": "0.0.0", + "private": true, + "sideEffects": false, + "type": "module", + "description": "The command descriptor registry: the single declaration of every command's surface, runtime-use, batch, timeout, and platform-execution traits, plus the catalogs and projections derived from it.", + "dependencies": { + "@agent-device/contracts": "workspace:*", + "@agent-device/selectors": "workspace:*" + }, + "exports": { + "./registry": { + "types": "./src/registry.ts", + "default": "./src/registry.ts" + }, + "./catalog": { + "types": "./src/catalog.ts", + "default": "./src/catalog.ts" + }, + "./types": { + "types": "./src/types.ts", + "default": "./src/types.ts" + }, + "./timeout-policy": { + "types": "./src/timeout-policy.ts", + "default": "./src/timeout-policy.ts" + }, + "./command-result": { + "types": "./src/command-result.ts", + "default": "./src/command-result.ts" + }, + "./daemon-command-descriptor": { + "types": "./src/daemon-command-descriptor.ts", + "default": "./src/daemon-command-descriptor.ts" + }, + "./derive": { + "types": "./src/derive.ts", + "default": "./src/derive.ts" + }, + "./owner-files": { + "types": "./src/owner-files.ts", + "default": "./src/owner-files.ts" + }, + "./platform-execution-entry": { + "types": "./src/platform-execution-entry.ts", + "default": "./src/platform-execution-entry.ts" + }, + "./post-action-observation": { + "types": "./src/post-action-observation.ts", + "default": "./src/post-action-observation.ts" + }, + "./parse-timeout": { + "types": "./src/parse-timeout.ts", + "default": "./src/parse-timeout.ts" + }, + "./wait-positionals": { + "types": "./src/wait-positionals.ts", + "default": "./src/wait-positionals.ts" + } + } +} diff --git a/src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts b/packages/command-registry/src/__tests__/application-lifecycle-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/application-lifecycle-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts b/packages/command-registry/src/__tests__/apps-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/apps-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts b/packages/command-registry/src/__tests__/appstate-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/appstate-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts b/packages/command-registry/src/__tests__/boot-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/boot-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/click-runtime-execution.test.ts b/packages/command-registry/src/__tests__/click-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/click-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/click-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/command-result.test.ts b/packages/command-registry/src/__tests__/command-result.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/command-result.test.ts rename to packages/command-registry/src/__tests__/command-result.test.ts diff --git a/src/core/command-descriptor/__tests__/device-claim-policy.test.ts b/packages/command-registry/src/__tests__/device-claim-policy.test.ts similarity index 98% rename from src/core/command-descriptor/__tests__/device-claim-policy.test.ts rename to packages/command-registry/src/__tests__/device-claim-policy.test.ts index 74ed323918..97a40dc68f 100644 --- a/src/core/command-descriptor/__tests__/device-claim-policy.test.ts +++ b/packages/command-registry/src/__tests__/device-claim-policy.test.ts @@ -1,6 +1,6 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '../catalog.ts'; import { commandDescriptors, resolveCommandDeviceClaimPolicy } from '../registry.ts'; import type { DeviceClaimPolicy } from '../types.ts'; diff --git a/src/core/command-descriptor/__tests__/find-runtime-execution.test.ts b/packages/command-registry/src/__tests__/find-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/find-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/find-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts b/packages/command-registry/src/__tests__/focus-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/focus-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/gesture-runtime-execution.test.ts b/packages/command-registry/src/__tests__/gesture-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/gesture-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/gesture-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts b/packages/command-registry/src/__tests__/logs-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/logs-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/network-runtime-execution.test.ts b/packages/command-registry/src/__tests__/network-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/network-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/network-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/owner-files.test.ts b/packages/command-registry/src/__tests__/owner-files.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/owner-files.test.ts rename to packages/command-registry/src/__tests__/owner-files.test.ts diff --git a/src/core/command-descriptor/__tests__/platform-execution-entry.test.ts b/packages/command-registry/src/__tests__/platform-execution-entry.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/platform-execution-entry.test.ts rename to packages/command-registry/src/__tests__/platform-execution-entry.test.ts diff --git a/src/core/command-descriptor/__tests__/platform-execution-host-and-replay-routes.test.ts b/packages/command-registry/src/__tests__/platform-execution-host-and-replay-routes.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/platform-execution-host-and-replay-routes.test.ts rename to packages/command-registry/src/__tests__/platform-execution-host-and-replay-routes.test.ts diff --git a/src/core/command-descriptor/__tests__/platform-execution.test.ts b/packages/command-registry/src/__tests__/platform-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/platform-execution.test.ts rename to packages/command-registry/src/__tests__/platform-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/record-runtime-execution.test.ts b/packages/command-registry/src/__tests__/record-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/record-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/record-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts b/packages/command-registry/src/__tests__/screenshot-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/screenshot-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts b/packages/command-registry/src/__tests__/snapshot-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/snapshot-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/trace-runtime-execution.test.ts b/packages/command-registry/src/__tests__/trace-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/trace-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/trace-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/type-runtime-execution.test.ts b/packages/command-registry/src/__tests__/type-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/type-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/type-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts b/packages/command-registry/src/__tests__/viewport-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/viewport-runtime-execution.test.ts diff --git a/src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts b/packages/command-registry/src/__tests__/wait-runtime-execution.test.ts similarity index 100% rename from src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts rename to packages/command-registry/src/__tests__/wait-runtime-execution.test.ts diff --git a/src/command-catalog.ts b/packages/command-registry/src/catalog.ts similarity index 92% rename from src/command-catalog.ts rename to packages/command-registry/src/catalog.ts index 6eec5081fe..c0b5a6f4b0 100644 --- a/src/command-catalog.ts +++ b/packages/command-registry/src/catalog.ts @@ -3,8 +3,8 @@ import { type DescriptorCatalogRecord, type DescriptorCliCommandName, type DescriptorCommandNameForCatalogGroup, -} from './core/command-descriptor/registry.ts'; -import type { CommandCatalogGroup } from './core/command-descriptor/types.ts'; +} from './registry.ts'; +import type { CommandCatalogGroup } from './types.ts'; export const PUBLIC_COMMANDS = deriveCommandCatalog('public'); export const INTERNAL_COMMANDS = deriveCommandCatalog('internal'); diff --git a/src/core/command-descriptor/command-result.ts b/packages/command-registry/src/command-result.ts similarity index 100% rename from src/core/command-descriptor/command-result.ts rename to packages/command-registry/src/command-result.ts diff --git a/src/core/command-descriptor/daemon-command-descriptor.ts b/packages/command-registry/src/daemon-command-descriptor.ts similarity index 100% rename from src/core/command-descriptor/daemon-command-descriptor.ts rename to packages/command-registry/src/daemon-command-descriptor.ts diff --git a/src/core/command-descriptor/derive.ts b/packages/command-registry/src/derive.ts similarity index 100% rename from src/core/command-descriptor/derive.ts rename to packages/command-registry/src/derive.ts diff --git a/src/global.d.ts b/packages/command-registry/src/global.d.ts similarity index 100% rename from src/global.d.ts rename to packages/command-registry/src/global.d.ts diff --git a/src/core/command-descriptor/owner-files.ts b/packages/command-registry/src/owner-files.ts similarity index 100% rename from src/core/command-descriptor/owner-files.ts rename to packages/command-registry/src/owner-files.ts diff --git a/src/core/parse-timeout.ts b/packages/command-registry/src/parse-timeout.ts similarity index 100% rename from src/core/parse-timeout.ts rename to packages/command-registry/src/parse-timeout.ts diff --git a/src/core/command-descriptor/platform-execution-entry.ts b/packages/command-registry/src/platform-execution-entry.ts similarity index 100% rename from src/core/command-descriptor/platform-execution-entry.ts rename to packages/command-registry/src/platform-execution-entry.ts diff --git a/src/core/command-descriptor/post-action-observation.ts b/packages/command-registry/src/post-action-observation.ts similarity index 100% rename from src/core/command-descriptor/post-action-observation.ts rename to packages/command-registry/src/post-action-observation.ts diff --git a/src/core/command-descriptor/registry.ts b/packages/command-registry/src/registry.ts similarity index 99% rename from src/core/command-descriptor/registry.ts rename to packages/command-registry/src/registry.ts index aa1354cd4e..bfc88d98ee 100644 --- a/src/core/command-descriptor/registry.ts +++ b/packages/command-registry/src/registry.ts @@ -3,7 +3,7 @@ import type { DispatchedCommand } from '@agent-device/contracts/command'; import type { RefFrameEffect } from '@agent-device/contracts/replay'; import { isReadOnlyFindAction, parseFindArgs } from '@agent-device/selectors'; -import { resolveWaitBudgetMs } from '../wait-positionals.ts'; +import { resolveWaitBudgetMs } from './wait-positionals.ts'; import { DEFAULT_TIMEOUT_POLICY, INSTALL_REQUEST_TIMEOUT_MS, diff --git a/src/core/command-descriptor/timeout-policy.ts b/packages/command-registry/src/timeout-policy.ts similarity index 100% rename from src/core/command-descriptor/timeout-policy.ts rename to packages/command-registry/src/timeout-policy.ts diff --git a/src/core/command-descriptor/types.ts b/packages/command-registry/src/types.ts similarity index 100% rename from src/core/command-descriptor/types.ts rename to packages/command-registry/src/types.ts diff --git a/src/core/wait-positionals.ts b/packages/command-registry/src/wait-positionals.ts similarity index 100% rename from src/core/wait-positionals.ts rename to packages/command-registry/src/wait-positionals.ts diff --git a/packages/command-registry/tsconfig.json b/packages/command-registry/tsconfig.json new file mode 100644 index 0000000000..935c871a4d --- /dev/null +++ b/packages/command-registry/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "composite": true, + "noEmit": false, + "emitDeclarationOnly": true, + "declaration": true, + "declarationDir": "./dist-types", + "rootDir": "./src" + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e67043ea33..d5a1e0d117 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: '@agent-device/capture-kit': specifier: workspace:* version: link:packages/capture-kit + '@agent-device/command-registry': + specifier: workspace:* + version: link:packages/command-registry '@agent-device/contracts': specifier: workspace:* version: link:packages/contracts @@ -220,6 +223,15 @@ importers: specifier: ^7.0.0 version: 7.0.0 + packages/command-registry: + dependencies: + '@agent-device/contracts': + specifier: workspace:* + version: link:../contracts + '@agent-device/selectors': + specifier: workspace:* + version: link:../selectors + packages/contracts: dependencies: '@agent-device/kernel': diff --git a/scripts/__tests__/eager-closure-budgets.ts b/scripts/__tests__/eager-closure-budgets.ts index f2d2488b03..2e44a0745d 100644 --- a/scripts/__tests__/eager-closure-budgets.ts +++ b/scripts/__tests__/eager-closure-budgets.ts @@ -102,8 +102,6 @@ export function discoverFacadeEntryFiles(repoRoot: string): string[] { export const HUB_ENTRY_FILES: readonly string[] = [ 'src/cli.ts', 'src/platform-runtime.ts', - 'src/core/command-descriptor/registry.ts', - 'src/core/command-descriptor/platform-execution-entry.ts', 'src/core/interactors/register-builtins.ts', 'src/daemon/session-teardown.ts', ]; diff --git a/scripts/check-bundle-owner-files.ts b/scripts/check-bundle-owner-files.ts index c83db92b16..eb8d8bfa29 100644 --- a/scripts/check-bundle-owner-files.ts +++ b/scripts/check-bundle-owner-files.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import { COMMAND_OWNER_FILES } from '../src/core/command-descriptor/owner-files.ts'; +import { COMMAND_OWNER_FILES } from '@agent-device/command-registry/owner-files'; import { getDaemonRouteOwnerFiles } from '../src/daemon/route-owner-files.ts'; import { walkFiles } from './lib/walk-files.ts'; diff --git a/scripts/depgraph/affected-run.ts b/scripts/depgraph/affected-run.ts index 25346fd657..885a256f98 100644 --- a/scripts/depgraph/affected-run.ts +++ b/scripts/depgraph/affected-run.ts @@ -18,7 +18,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { INTERACTION_DISPATCH_PATHS, type InteractionPathId, diff --git a/scripts/fuzz/generate.ts b/scripts/fuzz/generate.ts index 436befaa09..a09272ea70 100644 --- a/scripts/fuzz/generate.ts +++ b/scripts/fuzz/generate.ts @@ -76,7 +76,7 @@ export async function generateAndCheck( * The split is organizational only. It was first committed claiming it kept the CLI schema * registry out of corpus-replay's instrumented module graph; that claim was wrong. * `corpus-replay.test.ts` imports `targets.ts`, which imports `src/cli/parser/args.ts`, which - * already pulls `command-schema`, `option-schema`, and `command-catalog`, and coverage instruments + * already pulls `command-schema`, `option-schema`, and the command catalog, and coverage instruments * `src/**` only — the instrumented set is identical either way. What actually fixed the * coverage-instrumented startup was deriving the CLI surface lazily in `validation-arbitraries.ts`; * `validationSurfaceBuildCount()` is the guard against that regressing. diff --git a/scripts/fuzz/validation-arbitraries-cli.test.ts b/scripts/fuzz/validation-arbitraries-cli.test.ts index f4953f3b1b..b49f807115 100644 --- a/scripts/fuzz/validation-arbitraries-cli.test.ts +++ b/scripts/fuzz/validation-arbitraries-cli.test.ts @@ -8,7 +8,7 @@ import fc from 'fast-check'; import { describe, expect, it, vi } from 'vitest'; -import { listCliCommandNames } from '../../src/command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { getFlagDefinitions } from '../../src/cli-schema/command-schema.ts'; import { getFuzzTarget } from './registry.ts'; import { decodeValidationCase } from './validation-case.ts'; diff --git a/scripts/fuzz/validation-arbitraries-cli.ts b/scripts/fuzz/validation-arbitraries-cli.ts index 5dd45a13c2..bb787c7cca 100644 --- a/scripts/fuzz/validation-arbitraries-cli.ts +++ b/scripts/fuzz/validation-arbitraries-cli.ts @@ -8,7 +8,7 @@ // parser against it, which is what makes a silent acceptance (the #1433 class) reportable at all. import fc from 'fast-check'; -import { isKnownCliCommandName, listCliCommandNames } from '../../src/command-catalog.ts'; +import { isKnownCliCommandName, listCliCommandNames } from '@agent-device/command-registry/catalog'; import { getCliCommandSchema, getFlagDefinitions, diff --git a/scripts/integration-progress-model.ts b/scripts/integration-progress-model.ts index e3677f8e2d..611a7c134d 100644 --- a/scripts/integration-progress-model.ts +++ b/scripts/integration-progress-model.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { listCommandMetadata } from '../src/commands/command-metadata.ts'; import { getFlagDefinitions } from '../src/commands/cli-grammar/flag-registry.ts'; import { walkFiles } from './lib/walk-files.ts'; diff --git a/scripts/layering/model.test.ts b/scripts/layering/model.test.ts index c32594644a..9cfc88a047 100644 --- a/scripts/layering/model.test.ts +++ b/scripts/layering/model.test.ts @@ -278,7 +278,7 @@ test('every production zone is deliberately classified as ranked or unranked', ( test('listSourceFiles includes root-level src/*.ts production files', () => { const files = new Set(listSourceFiles()); - for (const rootFile of ['src/cli.ts', 'src/command-catalog.ts', 'src/backend.ts']) { + for (const rootFile of ['src/cli.ts', 'src/runtime.ts', 'src/backend.ts']) { assert.ok(files.has(rootFile), `expected ${rootFile} in analyzed source files`); } assert.ok(![...files].some((file) => file.endsWith('.test.ts'))); diff --git a/scripts/layering/model.ts b/scripts/layering/model.ts index 4860b322c9..f022be9e76 100644 --- a/scripts/layering/model.ts +++ b/scripts/layering/model.ts @@ -38,6 +38,7 @@ export type BackEdgeMap = Record; const TARGET_DAG_RANK = new Map([ ['ad-replay', 1], ['ad-script', 1], + ['command-registry', 1], ['contracts', 1], ['maestro', 1], ['recording', 1], diff --git a/scripts/layering/record-runtime-registry-policy.test.ts b/scripts/layering/record-runtime-registry-policy.test.ts index 947179abb0..2075dd3754 100644 --- a/scripts/layering/record-runtime-registry-policy.test.ts +++ b/scripts/layering/record-runtime-registry-policy.test.ts @@ -6,7 +6,7 @@ test('R16 requires the real registry normalization path to assert the record use assert.deepEqual( recordRuntimeRegistryJoinViolations([ { - path: 'src/core/command-descriptor/registry.ts', + path: 'packages/command-registry/src/registry.ts', source: ` import { assertRecordRuntimeExecution as assertRecord } from '@agent-device/contracts/platform'; if (descriptor.name === 'record') assertRecord(platformExecution); @@ -18,7 +18,7 @@ test('R16 requires the real registry normalization path to assert the record use assert.deepEqual( recordRuntimeRegistryJoinViolations([ { - path: 'src/core/command-descriptor/registry.ts', + path: 'packages/command-registry/src/registry.ts', source: ` // assertRecordRuntimeExecution(platformExecution) is only prose. const prose = 'record descriptor assertion'; @@ -26,6 +26,6 @@ test('R16 requires the real registry normalization path to assert the record use `, }, ]), - ['src/core/command-descriptor/registry.ts: missing record runtime descriptor join assertion'], + ['packages/command-registry/src/registry.ts: missing record runtime descriptor join assertion'], ); }); diff --git a/scripts/layering/record-runtime-registry-policy.ts b/scripts/layering/record-runtime-registry-policy.ts index 1e10e2d6db..bae0e62c57 100644 --- a/scripts/layering/record-runtime-registry-policy.ts +++ b/scripts/layering/record-runtime-registry-policy.ts @@ -1,4 +1,4 @@ -// Catches: src/core/command-descriptor/registry.ts's record command descriptor missing the +// Catches: packages/command-registry/src/registry.ts's record command descriptor missing the // runtime-descriptor join assertion — a wiring gap where record's registry entry silently // stops being checked against the request-bound runtime it must join, invisible to a type // check because the assertion's absence is not a type error, just a missing call. @@ -16,7 +16,7 @@ import { memberName, type ProductionSource, visitAst } from './layering-ast.ts'; export function recordRuntimeRegistryJoinViolations( sources: readonly ProductionSource[], ): string[] { - const file = sources.find(({ path }) => path === 'src/core/command-descriptor/registry.ts'); + const file = sources.find(({ path }) => path === 'packages/command-registry/src/registry.ts'); if (!file) return [missingRecordRuntimeRegistryJoin()]; const parsed = parseSync(file.path, file.source); const assertionName = importedRecordRuntimeAssertionName(parsed.program); @@ -35,7 +35,7 @@ export function recordRuntimeRegistryJoinViolations( } function missingRecordRuntimeRegistryJoin(): string { - return 'src/core/command-descriptor/registry.ts: missing record runtime descriptor join assertion'; + return 'packages/command-registry/src/registry.ts: missing record runtime descriptor join assertion'; } function importedRecordRuntimeAssertionName(node: unknown): string | undefined { diff --git a/scripts/layering/runtime-execution-policy.test.ts b/scripts/layering/runtime-execution-policy.test.ts index 138bd381d4..d530a46fb4 100644 --- a/scripts/layering/runtime-execution-policy.test.ts +++ b/scripts/layering/runtime-execution-policy.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import { test } from 'node:test'; import { runtimeExecutionIntegrityViolations } from './runtime-execution-policy.ts'; -const REGISTRY = 'src/core/command-descriptor/registry.ts'; +const REGISTRY = 'packages/command-registry/src/registry.ts'; const ADMISSION = 'src/daemon/runtime-admission.ts'; function sources(entries: readonly (readonly [string, string])[]): ReadonlyMap { diff --git a/scripts/layering/runtime-execution-policy.ts b/scripts/layering/runtime-execution-policy.ts index 2e67999a25..4c6573a384 100644 --- a/scripts/layering/runtime-execution-policy.ts +++ b/scripts/layering/runtime-execution-policy.ts @@ -18,7 +18,7 @@ type AstNode = Record; export const RUNTIME_EXECUTION_INTEGRITY_RULE = 'R66 runtime-execution-integrity'; -const COMMAND_DESCRIPTOR_MODULE = 'src/core/command-descriptor/registry.ts'; +const COMMAND_DESCRIPTOR_MODULE = 'packages/command-registry/src/registry.ts'; const RUNTIME_ADMISSION_MODULE = 'src/daemon/runtime-admission.ts'; const RUNTIME_PROOF_TYPES = new Set(['AdmittedRuntimePlan', 'BoundDeviceRuntime']); diff --git a/scripts/layering/tracked-sources.ts b/scripts/layering/tracked-sources.ts index eefebe21d7..b895d51462 100644 --- a/scripts/layering/tracked-sources.ts +++ b/scripts/layering/tracked-sources.ts @@ -20,7 +20,7 @@ import { execFileSync } from 'node:child_process'; // `src/**/*.ts` only matches NESTED files, so root-level `src/*.ts` (src/cli.ts, -// src/command-catalog.ts) needs its own pathspec or it silently drops out of every scan. +// src/backend.ts) needs its own pathspec or it silently drops out of every scan. // Workspace package sources are production files too (#1490 W0). const TRACKED_SOURCE_PATHSPECS = [ 'src/*.ts', diff --git a/src/__tests__/client.test.ts b/src/__tests__/client.test.ts index f1353ca722..18c7a11fb1 100644 --- a/src/__tests__/client.test.ts +++ b/src/__tests__/client.test.ts @@ -22,7 +22,7 @@ import { type WaitCommandResult, } from '../agent-device-client.ts'; import { runCommand } from '../commands/command-surface.ts'; -import type { CommandResult } from '../core/command-descriptor/command-result.ts'; +import type { CommandResult } from '@agent-device/command-registry/command-result'; import type { DaemonResponse, DaemonResponseData } from '@agent-device/kernel/contracts'; import { AppError } from '@agent-device/kernel/errors'; import fs from 'node:fs'; diff --git a/src/core/command-descriptor/__tests__/parity.test.ts b/src/__tests__/command-descriptor-parity.test.ts similarity index 97% rename from src/core/command-descriptor/__tests__/parity.test.ts rename to src/__tests__/command-descriptor-parity.test.ts index 151ad8d94b..339f07227d 100644 --- a/src/core/command-descriptor/__tests__/parity.test.ts +++ b/src/__tests__/command-descriptor-parity.test.ts @@ -1,18 +1,21 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { STRUCTURED_BATCH_COMMAND_NAMES } from '../../batch-policy.ts'; +import { STRUCTURED_BATCH_COMMAND_NAMES } from '../core/batch-policy.ts'; import { INTERNAL_COMMANDS, listCliCommandNames, PUBLIC_COMMANDS, -} from '../../../command-catalog.ts'; +} from '@agent-device/command-registry/catalog'; import { DAEMON_COMMAND_DESCRIPTORS, canRunReplayScopedAction, type DaemonCommandDescriptor, -} from '../../../daemon/daemon-command-registry.ts'; -import type { DaemonRequest } from '../../../daemon/types.ts'; -import { deriveDaemonCommandDescriptors, deriveStructuredBatchCommandNames } from '../derive.ts'; +} from '../daemon/daemon-command-registry.ts'; +import type { DaemonRequest } from '../daemon/types.ts'; +import { + deriveDaemonCommandDescriptors, + deriveStructuredBatchCommandNames, +} from '@agent-device/command-registry/derive'; import { commandDescriptors, listDescriptorCatalogCommandNames, @@ -22,7 +25,7 @@ import { resolveCommandRecordingEffect, resolveTargetIdentityVerification, RAW_COMMAND_DESCRIPTORS, -} from '../registry.ts'; +} from '@agent-device/command-registry/registry'; // Function-valued traits cannot be deep-equaled across re-authored closures, so // (mirroring daemon-command-registry.test.ts) they are compared by presence and diff --git a/src/core/command-descriptor/__tests__/platform-execution-cli-route.test.ts b/src/__tests__/command-descriptor-platform-execution-cli-route.test.ts similarity index 97% rename from src/core/command-descriptor/__tests__/platform-execution-cli-route.test.ts rename to src/__tests__/command-descriptor-platform-execution-cli-route.test.ts index 98b414881c..c1d0a2310b 100644 --- a/src/core/command-descriptor/__tests__/platform-execution-cli-route.test.ts +++ b/src/__tests__/command-descriptor-platform-execution-cli-route.test.ts @@ -6,8 +6,8 @@ import { describe, expect, test } from 'vitest'; import { CLI_INJECTED_DAEMON_DISPATCHES, type CliInjectedRoute, -} from '../../../cli/injected-daemon-dispatch.ts'; -import { commandDescriptors } from '../registry.ts'; +} from '../cli/injected-daemon-dispatch.ts'; +import { commandDescriptors } from '@agent-device/command-registry/registry'; /** * ADR 0019 §6 coherence gate for delegated platform execution. @@ -23,8 +23,8 @@ import { commandDescriptors } from '../registry.ts'; * second way to dispatch. */ -const CLI_ROOT = fileURLToPath(new URL('../../../cli.ts', import.meta.url)); -const CLI_DIR = fileURLToPath(new URL('../../../cli/', import.meta.url)); +const CLI_ROOT = fileURLToPath(new URL('../cli.ts', import.meta.url)); +const CLI_DIR = fileURLToPath(new URL('../cli', import.meta.url)); const SEAM_MODULE = path.join(CLI_DIR, 'injected-daemon-dispatch.ts'); const TRANSPORT = 'sendToDaemon'; @@ -292,7 +292,7 @@ describe('platform-execution coherence across CLI route delegation', () => { test('wiring the transport into a client transport factory stays allowed', () => { const wiring = ` - import { sendToDaemon } from '../daemon/client/daemon-client.ts'; + import { sendToDaemon } from '../core/command-descriptor/daemon/client/daemon-client.ts'; type CliDeps = { sendToDaemon: typeof sendToDaemon }; function build(deps: CliDeps) { return createCliDaemonTransport({ transport: deps.sendToDaemon }); diff --git a/src/core/command-descriptor/__tests__/post-action-observation.test.ts b/src/__tests__/command-descriptor-post-action-observation.test.ts similarity index 94% rename from src/core/command-descriptor/__tests__/post-action-observation.test.ts rename to src/__tests__/command-descriptor-post-action-observation.test.ts index 6e0afdce9a..966a08d0f6 100644 --- a/src/core/command-descriptor/__tests__/post-action-observation.test.ts +++ b/src/__tests__/command-descriptor-post-action-observation.test.ts @@ -2,24 +2,24 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import type { CliFlags } from '@agent-device/contracts/command'; import type { SessionAction } from '@agent-device/contracts/session'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; -import type { AgentDeviceClient } from '../../../agent-device-client.ts'; -import { findCommandMetadata, type CommandName } from '../../../commands/command-metadata.ts'; -import { readInputFromCli } from '../../../commands/cli-grammar/registry.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; +import type { AgentDeviceClient } from '../agent-device-client.ts'; +import { findCommandMetadata, type CommandName } from '../commands/command-metadata.ts'; +import { readInputFromCli } from '../commands/cli-grammar/registry.ts'; import { listCommandFamilyCliOutputFormatters, listCommandFamilyDefinitions, -} from '../../../commands/family/registry.ts'; -import type { SettleCapableClientOptionCommands } from '../../../commands/post-action-observation-client-options.ts'; -import { getCliCommandSchema } from '../../../cli-schema/command-schema.ts'; -import { buildActionDetails } from '../../../daemon/session-event-action.ts'; -import { COMMAND_OUTPUT_SCHEMAS } from '../../../mcp/command-output-schemas.ts'; +} from '../commands/family/registry.ts'; +import type { SettleCapableClientOptionCommands } from '../commands/post-action-observation-client-options.ts'; +import { getCliCommandSchema } from '../cli-schema/command-schema.ts'; +import { buildActionDetails } from '../daemon/session-event-action.ts'; +import { COMMAND_OUTPUT_SCHEMAS } from '../mcp/command-output-schemas.ts'; import { commandDescriptors, commandSupportsSettleObservation, commandSupportsVerifyEvidence, resolveCommandPostActionObservationSupport, -} from '../registry.ts'; +} from '@agent-device/command-registry/registry'; /** * The descriptor gate for the `--settle` / `--verify` surfaces (#1652). Every diff --git a/src/core/command-descriptor/__tests__/ref-frame-effect.test.ts b/src/__tests__/command-descriptor-ref-frame-effect.test.ts similarity index 96% rename from src/core/command-descriptor/__tests__/ref-frame-effect.test.ts rename to src/__tests__/command-descriptor-ref-frame-effect.test.ts index 95fbfa8fac..235177891a 100644 --- a/src/core/command-descriptor/__tests__/ref-frame-effect.test.ts +++ b/src/__tests__/command-descriptor-ref-frame-effect.test.ts @@ -1,12 +1,12 @@ import type { RefFrameEffect } from '@agent-device/contracts/replay'; import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { DAEMON_COMMAND_DESCRIPTORS, resolveRefFrameEffect, -} from '../../../daemon/daemon-command-registry.ts'; -import type { DaemonRequest } from '../../../daemon/types.ts'; +} from '../daemon/daemon-command-registry.ts'; +import type { DaemonRequest } from '../daemon/types.ts'; // ADR 0014 migration step 2: the ref-frame-effect classification is an // honesty/completeness guard. Every command that reaches a session-owning daemon diff --git a/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts b/src/__tests__/command-descriptor-shutdown-runtime-execution.test.ts similarity index 78% rename from src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts rename to src/__tests__/command-descriptor-shutdown-runtime-execution.test.ts index 52a67b08fc..33f086dfcb 100644 --- a/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts +++ b/src/__tests__/command-descriptor-shutdown-runtime-execution.test.ts @@ -1,34 +1,34 @@ import { readFileSync } from 'node:fs'; import { expect, test } from 'vitest'; import { shutdownTargetUse } from '@agent-device/contracts/platform-runtime-operations'; -import { commandDescriptors } from '../registry.ts'; +import { commandDescriptors } from '@agent-device/command-registry/registry'; const sessionStateSource = readFileSync( - new URL('../../../daemon/handlers/session-state.ts', import.meta.url), + new URL('../daemon/handlers/session-state.ts', import.meta.url), 'utf8', ); const sessionCloseSource = readFileSync( - new URL('../../../daemon/session-lifecycle/internal/session-close.ts', import.meta.url), + new URL('../daemon/session-lifecycle/internal/session-close.ts', import.meta.url), 'utf8', ); const appleLifecycleSource = readFileSync( - new URL('../../../../packages/platform-apple/src/lifecycle.ts', import.meta.url), + new URL('../../packages/platform-apple/src/lifecycle.ts', import.meta.url), 'utf8', ); const androidLifecycleSource = readFileSync( - new URL('../../../../packages/platform-android/src/lifecycle.ts', import.meta.url), + new URL('../../packages/platform-android/src/lifecycle.ts', import.meta.url), 'utf8', ); const sharedHostSource = readFileSync( - new URL('../../../platform-runtime-device-shutdown-host.ts', import.meta.url), + new URL('../platform-runtime-device-shutdown-host.ts', import.meta.url), 'utf8', ); const appleShutdownSource = readFileSync( - new URL('../../../../packages/platform-apple/src/shutdown/runtime.ts', import.meta.url), + new URL('../../packages/platform-apple/src/shutdown/runtime.ts', import.meta.url), 'utf8', ); const androidShutdownSource = readFileSync( - new URL('../../../../packages/platform-android/src/shutdown/runtime.ts', import.meta.url), + new URL('../../packages/platform-android/src/shutdown/runtime.ts', import.meta.url), 'utf8', ); diff --git a/src/core/command-descriptor/__tests__/timeout-policy.test.ts b/src/__tests__/command-descriptor-timeout-policy.test.ts similarity index 96% rename from src/core/command-descriptor/__tests__/timeout-policy.test.ts rename to src/__tests__/command-descriptor-timeout-policy.test.ts index 74b4426331..75a3ce975f 100644 --- a/src/core/command-descriptor/__tests__/timeout-policy.test.ts +++ b/src/__tests__/command-descriptor-timeout-policy.test.ts @@ -1,13 +1,16 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { commandDescriptors, resolveCommandPostActionObservationSupport, resolveCommandTimeoutPolicy, -} from '../registry.ts'; -import { DEFAULT_TIMEOUT_POLICY, resolveCommandRequestTimeoutMs } from '../timeout-policy.ts'; -import { DEFAULT_STABLE_TIMEOUT_MS } from '../../../commands/interaction/runtime/stable-capture.ts'; +} from '@agent-device/command-registry/registry'; +import { + DEFAULT_TIMEOUT_POLICY, + resolveCommandRequestTimeoutMs, +} from '@agent-device/command-registry/timeout-policy'; +import { DEFAULT_STABLE_TIMEOUT_MS } from '../commands/interaction/runtime/stable-capture.ts'; function settleObservationCommandNames(): string[] { return commandDescriptors diff --git a/src/__tests__/command-doc-coverage.test.ts b/src/__tests__/command-doc-coverage.test.ts index a518f9b579..b54c36a659 100644 --- a/src/__tests__/command-doc-coverage.test.ts +++ b/src/__tests__/command-doc-coverage.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import assert from 'node:assert/strict'; import { describe, test } from 'vitest'; -import { PUBLIC_COMMANDS, isKnownCliCommandName } from '../command-catalog.ts'; +import { PUBLIC_COMMANDS, isKnownCliCommandName } from '@agent-device/command-registry/catalog'; import { cliCommandAlias } from '../commands/cli-command-aliases.ts'; import { getCliCommandSchema } from '../cli-schema/command-schema.ts'; import { buildCommandUsage } from '../cli-schema/usage.ts'; diff --git a/src/__tests__/contracts-schema-public.test.ts b/src/__tests__/contracts-schema-public.test.ts index 25438d7e9c..04cb8f4b01 100644 --- a/src/__tests__/contracts-schema-public.test.ts +++ b/src/__tests__/contracts-schema-public.test.ts @@ -23,7 +23,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import type { CommandResult } from '../core/command-descriptor/command-result.ts'; +import type { CommandResult } from '@agent-device/command-registry/command-result'; import { centerOfRect, defaultHintForCode, diff --git a/src/__tests__/install-source.coverage.ts b/src/__tests__/install-source.coverage.ts index 66b8bf3502..f9c872816e 100644 --- a/src/__tests__/install-source.coverage.ts +++ b/src/__tests__/install-source.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; export const ANDROID_INSTALL_SOURCE_CONTRACT_EVIDENCE = { commands: [C.installFromSource], diff --git a/src/__tests__/test-utils/property-arbitraries.ts b/src/__tests__/test-utils/property-arbitraries.ts index fa194bb8be..c4e5da265f 100644 --- a/src/__tests__/test-utils/property-arbitraries.ts +++ b/src/__tests__/test-utils/property-arbitraries.ts @@ -11,7 +11,7 @@ import { type SnapshotNode, } from '@agent-device/kernel/snapshot'; import fc from 'fast-check'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; /** * Shared fast-check generators for the pure parse/print and geometry kernels @@ -466,7 +466,8 @@ function replayScriptLineArbs(): fc.Arbitrary[] { const plan: ReplayLinePlan | undefined = REPLAY_SCRIPT_LINE_PLANS[command]; if (plan === undefined) { throw new Error( - `replay command "${command}" from src/command-catalog.ts is unclassified: ` + + `replay command "${command}" from @agent-device/command-registry/catalog is ` + + 'unclassified: ' + 'add a line template or a waiver to REPLAY_SCRIPT_LINE_PLANS in ' + 'src/__tests__/test-utils/property-arbitraries.ts', ); diff --git a/src/core/wait-positionals.test.ts b/src/__tests__/wait-positionals.test.ts similarity index 97% rename from src/core/wait-positionals.test.ts rename to src/__tests__/wait-positionals.test.ts index 0967dcf230..9411fe0a65 100644 --- a/src/core/wait-positionals.test.ts +++ b/src/__tests__/wait-positionals.test.ts @@ -9,8 +9,11 @@ import assert from 'node:assert/strict'; import fc from 'fast-check'; import { test } from 'vitest'; import { isValidSelectorExpression, SELECTOR_KEY_NAMES } from '@agent-device/selectors'; -import { PROPERTY_RUNS } from '../__tests__/test-utils/property-arbitraries.ts'; -import { parseWaitPositionals, resolveWaitBudgetMs } from './wait-positionals.ts'; +import { PROPERTY_RUNS } from './test-utils/property-arbitraries.ts'; +import { + parseWaitPositionals, + resolveWaitBudgetMs, +} from '@agent-device/command-registry/wait-positionals'; function assertInvalid(args: string[], messageFragment: string) { const result = parseWaitPositionals(args); diff --git a/src/agent-device-client.ts b/src/agent-device-client.ts index 3ae0f6dc41..9f6784b094 100644 --- a/src/agent-device-client.ts +++ b/src/agent-device-client.ts @@ -55,13 +55,13 @@ import { resolveSessionName, } from './client/client-normalizers.ts'; import type { AgentDeviceClient, MetroPrepareResult } from './client/client-types.ts'; -import { INTERNAL_COMMANDS } from './command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { buildRequestFlags } from './commands/command-flags.ts'; import { prepareDaemonCommandRequest, type DaemonCommandName, } from './commands/command-projection.ts'; -import type { CommandResult } from './core/command-descriptor/command-result.ts'; +import type { CommandResult } from '@agent-device/command-registry/command-result'; import { sendToDaemon } from './daemon/client/daemon-client.ts'; import { resolveDaemonPaths } from './daemon/config.ts'; import { prepareMetroRuntime, reloadMetro } from './metro/client-metro.ts'; diff --git a/src/ai-sdk/index.ts b/src/ai-sdk/index.ts index 0e59950624..6082a1ed88 100644 --- a/src/ai-sdk/index.ts +++ b/src/ai-sdk/index.ts @@ -4,14 +4,14 @@ import { AppError, type NormalizedError } from '@agent-device/kernel/errors'; import { createAgentDeviceClient } from '../agent-device-client.ts'; import type { AgentDeviceClient } from '../client/client-types.ts'; import type { JsonSchema } from '../commands/command-contract.ts'; -import { resolveCommandFrameworkTier } from '../core/command-descriptor/registry.ts'; +import { resolveCommandFrameworkTier } from '@agent-device/command-registry/registry'; import { createCommandToolExecutor, listCommandTools } from '../mcp/command-tools.ts'; import { MCP_TOOL_CONFIG_KEYS } from '../mcp/tool-control-fields.ts'; import { formatToolErrorText } from '../mcp/tool-error.ts'; /** * `'core'` — the curated perceive/act loop (see the `frameworkTier` pinning - * test in `src/core/command-descriptor/__tests__/parity.test.ts`). `'all'` + * test in `src/__tests__/command-descriptor-parity.test.ts`). `'all'` * exposes every MCP-exposed command, same set the MCP server surfaces. */ export type AgentDeviceToolSet = 'core' | 'all'; diff --git a/src/cli-schema/cli-help-alias-fast-path.test.ts b/src/cli-schema/cli-help-alias-fast-path.test.ts index b723686488..50e489c857 100644 --- a/src/cli-schema/cli-help-alias-fast-path.test.ts +++ b/src/cli-schema/cli-help-alias-fast-path.test.ts @@ -2,7 +2,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { buildCommandUsageText, resolveHelpTargetUsageText } from './cli-help.ts'; import { cliAliasesForCommand } from '../commands/cli-command-aliases.ts'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; const ALIASES = listCliCommandNames().flatMap((command) => cliAliasesForCommand(command).map((entry) => [entry.alias, command] as const), diff --git a/src/cli-schema/cli-help-examples.test.ts b/src/cli-schema/cli-help-examples.test.ts index 7dc67824a1..24c0c399cc 100644 --- a/src/cli-schema/cli-help-examples.test.ts +++ b/src/cli-schema/cli-help-examples.test.ts @@ -4,7 +4,7 @@ import type { BatchStep } from '@agent-device/contracts/client'; import { parseArgs } from '../cli/parser/args.ts'; import { readCliBatchStepsJson } from '../cli/batch-steps.ts'; import { buildCommandUsageText, buildUsageText, helpTopicIds } from './cli-help.ts'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { readInputFromCli } from '../commands/cli-grammar.ts'; import { findCommandMetadata, isCommandName } from '../commands/command-metadata.ts'; import { readVersion } from '@agent-device/host-kit/version'; diff --git a/src/cli-schema/cli-help-overview.test.ts b/src/cli-schema/cli-help-overview.test.ts index 9fc10bd0fc..a468a987e4 100644 --- a/src/cli-schema/cli-help-overview.test.ts +++ b/src/cli-schema/cli-help-overview.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { usage, usageForCommand } from '../cli/parser/args.ts'; test('root help is a bounded first-success decision card', async () => { diff --git a/src/cli-schema/cli-help-overview.ts b/src/cli-schema/cli-help-overview.ts index 5838bc944e..83373a033a 100644 --- a/src/cli-schema/cli-help-overview.ts +++ b/src/cli-schema/cli-help-overview.ts @@ -1,5 +1,5 @@ import { SELECTOR_KEY_NAMES } from '@agent-device/selectors'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; /** * The root help is the no-skill agent's decision card, not the command reference. diff --git a/src/cli-schema/cli-help.ts b/src/cli-schema/cli-help.ts index da5d3c00b1..c585131e01 100644 --- a/src/cli-schema/cli-help.ts +++ b/src/cli-schema/cli-help.ts @@ -1,4 +1,4 @@ -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { formatMaestroCompatibilityReference, MAESTRO_COMPATIBILITY_ADR_URL, diff --git a/src/cli-schema/command-overrides.ts b/src/cli-schema/command-overrides.ts index 699c2a3e93..6756eb6db8 100644 --- a/src/cli-schema/command-overrides.ts +++ b/src/cli-schema/command-overrides.ts @@ -1,6 +1,6 @@ import type { CommandName } from '../commands/command-metadata.ts'; import { listCommandFamilyCliSchemas } from '../commands/family/registry.ts'; -import type { LocalCliCommandName } from '../command-catalog.ts'; +import type { LocalCliCommandName } from '@agent-device/command-registry/catalog'; import type { CommandSchema } from './types.ts'; import { COMMON_COMMAND_SUPPORTED_FLAG_KEYS, diff --git a/src/cli-schema/command-schema-guards.test.ts b/src/cli-schema/command-schema-guards.test.ts index b52711c8dd..bf94ad4e8a 100644 --- a/src/cli-schema/command-schema-guards.test.ts +++ b/src/cli-schema/command-schema-guards.test.ts @@ -9,11 +9,11 @@ import { isKnownCliCommandName, listCliCommandNames, SPECIAL_CLI_COMMANDS, -} from '../command-catalog.ts'; +} from '@agent-device/command-registry/catalog'; import { commandDescriptors, listRuntimeFactCommands, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { getCliCommandSchema } from './command-schema.ts'; test('every public runtime-fact command has a parser schema entry', () => { diff --git a/src/cli-schema/command-schema.ts b/src/cli-schema/command-schema.ts index 07cff4ccc1..ca2ed13fda 100644 --- a/src/cli-schema/command-schema.ts +++ b/src/cli-schema/command-schema.ts @@ -1,4 +1,4 @@ -import type { CliCommandName } from '../command-catalog.ts'; +import type { CliCommandName } from '@agent-device/command-registry/catalog'; import { listCommandMetadata } from '../commands/command-metadata.ts'; import type { CommandSchema } from './types.ts'; import { getCliCommandOverride, getSchemaOnlyCliCommandSchema } from './command-overrides.ts'; diff --git a/src/cli-schema/option-schema.ts b/src/cli-schema/option-schema.ts index 9f92cddb72..ba018c3d0e 100644 --- a/src/cli-schema/option-schema.ts +++ b/src/cli-schema/option-schema.ts @@ -1,5 +1,5 @@ import { buildPrimaryEnvVarName, parseSourceValue } from '@agent-device/kernel/source-value'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { getCliCommandSchema, getFlagDefinitions, diff --git a/src/cli.ts b/src/cli.ts index 3fad4d1749..1a35d3d0e7 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -45,7 +45,7 @@ import { resolveRemoteAuthForCli } from './cli/auth-session.ts'; import type { FlagKey } from './commands/cli-grammar/flag-types.ts'; import type { CliFlags } from '@agent-device/contracts/command'; import type { SessionRuntimeHints } from '@agent-device/kernel/contracts'; -import { INTERNAL_COMMANDS, isKnownCliCommandName } from './command-catalog.ts'; +import { INTERNAL_COMMANDS, isKnownCliCommandName } from '@agent-device/command-registry/catalog'; import { sendInjectedDaemonRequest } from './cli/injected-daemon-dispatch.ts'; type CliDeps = { diff --git a/src/cli/commands/__tests__/client-backed.test.ts b/src/cli/commands/__tests__/client-backed.test.ts index 31a4830540..1542c9815d 100644 --- a/src/cli/commands/__tests__/client-backed.test.ts +++ b/src/cli/commands/__tests__/client-backed.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { listCliCommandNames } from '../../../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { listExecutableCommandNames } from '../../../commands/command-surface.ts'; import { isClientBackedCliCommandName } from '../client-backed.ts'; diff --git a/src/cli/commands/connection-runtime.ts b/src/cli/commands/connection-runtime.ts index eb6cc6e812..59b620611f 100644 --- a/src/cli/commands/connection-runtime.ts +++ b/src/cli/commands/connection-runtime.ts @@ -32,7 +32,7 @@ import type { LeaseBackend, SessionRuntimeHints } from '@agent-device/kernel/con import type { CliFlags } from '@agent-device/contracts/command'; import type { AgentDeviceClient, Lease } from '../../agent-device-client.ts'; import type { CloudProviderSessionResult } from '@agent-device/contracts/observability'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { readMetroPrepareKind } from '../../commands/metro/prepare-kind.ts'; import { connectionProviderCapabilities } from '../connection/provider-policy.ts'; import { readCloudDeviceFeatureProfileFields } from '../connection/profile-fields.ts'; diff --git a/src/cli/commands/router-types.ts b/src/cli/commands/router-types.ts index 5c1bc282fb..af61f32087 100644 --- a/src/cli/commands/router-types.ts +++ b/src/cli/commands/router-types.ts @@ -1,6 +1,6 @@ import type { CliFlags } from '@agent-device/contracts/command'; import type { AgentDeviceClient } from '../../agent-device-client.ts'; -import type { CliCommandName } from '../../command-catalog.ts'; +import type { CliCommandName } from '@agent-device/command-registry/catalog'; import type { ReplayTestReporterRuntime } from '../replay-test/reporting.ts'; export type ClientCommandParams = { diff --git a/src/cli/entry.test.ts b/src/cli/entry.test.ts index eba5688fc1..085478702f 100644 --- a/src/cli/entry.test.ts +++ b/src/cli/entry.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; import * as cliHelp from '../cli-schema/cli-help.ts'; -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { cliAliasesForCommand } from '../commands/cli-command-aliases.ts'; import { runEntry, type EntryModules } from './entry.ts'; diff --git a/src/cli/injected-daemon-dispatch.ts b/src/cli/injected-daemon-dispatch.ts index 93ba411b0f..d7e2644ce6 100644 --- a/src/cli/injected-daemon-dispatch.ts +++ b/src/cli/injected-daemon-dispatch.ts @@ -1,9 +1,9 @@ import type { DaemonResponse, sendToDaemon } from '../daemon/client/daemon-client.ts'; -import { INTERNAL_COMMANDS } from '../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import type { DescriptorCliCommandName, DescriptorDaemonRouteCommandName, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; type CliDaemonTransport = typeof sendToDaemon; type CliDaemonRequest = Parameters[0]; diff --git a/src/cli/parser/__tests__/args-validation.test.ts b/src/cli/parser/__tests__/args-validation.test.ts index 6786f0995b..22ecfeb669 100644 --- a/src/cli/parser/__tests__/args-validation.test.ts +++ b/src/cli/parser/__tests__/args-validation.test.ts @@ -2,7 +2,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { parseArgs } from '../args.ts'; import { AppError } from '@agent-device/kernel/errors'; -import { listCliCommandNames } from '../../../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { getCliCommandSchema } from '../../../cli-schema/command-schema.ts'; test('parseArgs rejects test retries above the supported ceiling', () => { diff --git a/src/cli/parser/__tests__/command-suggestions.test.ts b/src/cli/parser/__tests__/command-suggestions.test.ts index 1e05e8fcf4..ee1a4777c2 100644 --- a/src/cli/parser/__tests__/command-suggestions.test.ts +++ b/src/cli/parser/__tests__/command-suggestions.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { isKnownCliCommandName } from '../../../command-catalog.ts'; +import { isKnownCliCommandName } from '@agent-device/command-registry/catalog'; import { keyboardCliReader } from '../../../commands/system/index.ts'; import { AppError } from '@agent-device/kernel/errors'; import { parseArgs } from '../args.ts'; diff --git a/src/cli/parser/args.ts b/src/cli/parser/args.ts index 812f9cf9d2..9d97103ec4 100644 --- a/src/cli/parser/args.ts +++ b/src/cli/parser/args.ts @@ -11,7 +11,7 @@ import { type FlagKey, } from '../../cli-schema/command-schema.ts'; import { isFlagSupportedForCommand } from '../../cli-schema/option-schema.ts'; -import { isKnownCliCommandName } from '../../command-catalog.ts'; +import { isKnownCliCommandName } from '@agent-device/command-registry/catalog'; import { cliCommandAlias, normalizeCliCommandAlias, diff --git a/src/cli/parser/command-suggestions.ts b/src/cli/parser/command-suggestions.ts index 5ed06293e9..c34c99e327 100644 --- a/src/cli/parser/command-suggestions.ts +++ b/src/cli/parser/command-suggestions.ts @@ -1,5 +1,5 @@ import { RETIRED_SCREENSHOT_MAX_SIZE } from '@agent-device/contracts/capture'; -import { listCliCommandNames } from '../../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; /** * Curated guess -> canonical command mapping for unknown CLI command names. diff --git a/src/client/client-types.ts b/src/client/client-types.ts index 2d80556de9..e2a6128551 100644 --- a/src/client/client-types.ts +++ b/src/client/client-types.ts @@ -146,7 +146,7 @@ import type { DebugSymbolsOptions, DebugSymbolsResult, } from '@agent-device/contracts/observability'; -import type { CommandResult } from '../core/command-descriptor/command-result.ts'; +import type { CommandResult } from '@agent-device/command-registry/command-result'; export type { DiffSnapshotCommandResult } from '@agent-device/contracts/capture'; export type { PrepareCommandResult, PushCommandResult } from '@agent-device/contracts/command'; diff --git a/src/client/lease-client.ts b/src/client/lease-client.ts index eb2eac8e1c..ebc9dee080 100644 --- a/src/client/lease-client.ts +++ b/src/client/lease-client.ts @@ -4,7 +4,7 @@ import type { Lease, } from '@agent-device/contracts/client'; import { AppError } from '@agent-device/kernel/errors'; -import { INTERNAL_COMMANDS } from '../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { isRecord } from '@agent-device/kernel/record'; import type { AgentDeviceClient } from './client-types.ts'; import { readOptionalString, readRequiredString } from './client-normalizers.ts'; diff --git a/src/commands/__tests__/command-explain.test.ts b/src/commands/__tests__/command-explain.test.ts index 97146005df..56445b0571 100644 --- a/src/commands/__tests__/command-explain.test.ts +++ b/src/commands/__tests__/command-explain.test.ts @@ -3,8 +3,8 @@ import fs from 'node:fs'; import path from 'node:path'; import { describe, expect, test } from 'vitest'; import { runExplainCommandCli } from '../../../scripts/explain-command.ts'; -import { commandDescriptors } from '../../core/command-descriptor/registry.ts'; -import { ownerFilesForCommand } from '../../core/command-descriptor/owner-files.ts'; +import { commandDescriptors } from '@agent-device/command-registry/registry'; +import { ownerFilesForCommand } from '@agent-device/command-registry/owner-files'; import { getDaemonRouteOwnerFiles } from '../../daemon/route-owner-files.ts'; import { explainCommand as explainCommandFromMetadata, @@ -92,7 +92,7 @@ describe('explainCommand', () => { catalog: { group: 'local-cli' }, cli: { usage: 'web setup | web doctor' }, files: expect.arrayContaining([ - 'src/core/command-descriptor/registry.ts', + 'packages/command-registry/src/registry.ts', 'src/cli-schema/command-overrides.ts', 'src/cli/commands/web.ts', ]), diff --git a/src/commands/__tests__/command-surface-metadata.test.ts b/src/commands/__tests__/command-surface-metadata.test.ts index e015ee48dc..d45514e947 100644 --- a/src/commands/__tests__/command-surface-metadata.test.ts +++ b/src/commands/__tests__/command-surface-metadata.test.ts @@ -1,10 +1,10 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { listCliCommandNames } from '../../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { listCommandResponseDataTransforms, listMcpExposedCommandNames, -} from '../../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { getSchemaOnlyCliCommandSchema } from '../../cli-schema/command-overrides.ts'; import { listCommandMetadata, diff --git a/src/commands/batch/projection.ts b/src/commands/batch/projection.ts index e0a8051212..69e542e650 100644 --- a/src/commands/batch/projection.ts +++ b/src/commands/batch/projection.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { STRUCTURED_BATCH_COMMAND_NAMES, readStructuredBatchCommandName, diff --git a/src/commands/capture/alert.ts b/src/commands/capture/alert.ts index e1385ac0a3..f07dc964a0 100644 --- a/src/commands/capture/alert.ts +++ b/src/commands/capture/alert.ts @@ -1,5 +1,5 @@ import { ALERT_ACTIONS, type AlertAction } from '@agent-device/contracts/alert-contract'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { AlertCommandOptions } from '@agent-device/contracts/client'; import { enumField, integerField } from '../command-input.ts'; import { compactRecord } from '../input-readers.ts'; diff --git a/src/commands/capture/diff.ts b/src/commands/capture/diff.ts index 371052942b..c3f20eefa4 100644 --- a/src/commands/capture/diff.ts +++ b/src/commands/capture/diff.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { SNAPSHOT_FLAGS } from '../cli-grammar/flag-groups.ts'; import { AppError } from '@agent-device/kernel/errors'; import { diff --git a/src/commands/capture/screenshot.ts b/src/commands/capture/screenshot.ts index e8263b44e7..67a86c38d3 100644 --- a/src/commands/capture/screenshot.ts +++ b/src/commands/capture/screenshot.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { CaptureScreenshotOptions } from '@agent-device/contracts/client'; import { SESSION_SURFACES } from '@agent-device/contracts/session'; import { diff --git a/src/commands/capture/settings.ts b/src/commands/capture/settings.ts index 60927ea0ed..1af9fe201e 100644 --- a/src/commands/capture/settings.ts +++ b/src/commands/capture/settings.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { SettingsUpdateOptions } from '@agent-device/contracts/client'; import { SETTINGS_USAGE_OVERRIDE } from '@agent-device/contracts/settings'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; diff --git a/src/commands/capture/snapshot.ts b/src/commands/capture/snapshot.ts index 97e3670c19..87ab6895c6 100644 --- a/src/commands/capture/snapshot.ts +++ b/src/commands/capture/snapshot.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { SNAPSHOT_BACKEND_CAPABILITIES } from '@agent-device/capture-kit/snapshot-quality-backend-capabilities'; import { SNAPSHOT_FLAGS } from '../cli-grammar/flag-groups.ts'; import { booleanField, integerField, stringField } from '../command-input.ts'; diff --git a/src/commands/capture/wait.ts b/src/commands/capture/wait.ts index a1adb1f51a..327d2473a5 100644 --- a/src/commands/capture/wait.ts +++ b/src/commands/capture/wait.ts @@ -1,8 +1,8 @@ import type { CliFlags } from '@agent-device/contracts/command'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { WaitCommandOptions } from '@agent-device/contracts/client'; -import { parseWaitPositionals } from '../../core/wait-positionals.ts'; -import type { WaitParsed } from '../../core/wait-positionals.ts'; +import { parseWaitPositionals } from '@agent-device/command-registry/wait-positionals'; +import type { WaitParsed } from '@agent-device/command-registry/wait-positionals'; import { SELECTOR_SNAPSHOT_FLAGS } from '../cli-grammar/flag-groups.ts'; import { AppError } from '@agent-device/kernel/errors'; import { isValidSelectorExpression } from '@agent-device/selectors'; diff --git a/src/commands/command-explain.ts b/src/commands/command-explain.ts index a65317c461..df63c68f72 100644 --- a/src/commands/command-explain.ts +++ b/src/commands/command-explain.ts @@ -1,10 +1,10 @@ -import { listCliCommandNames } from '../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { cliAliasesForCommand, normalizeCliCommandAlias } from './cli-command-aliases.ts'; import { buildCommandUsage } from '../cli-schema/usage.ts'; import type { DaemonCommandRoute } from '../daemon/daemon-command-registry.ts'; -import { commandDescriptors, type Command } from '../core/command-descriptor/registry.ts'; -import { ownerFilesForCommand } from '../core/command-descriptor/owner-files.ts'; -import type { CommandTimeoutPolicy } from '../core/command-descriptor/types.ts'; +import { commandDescriptors, type Command } from '@agent-device/command-registry/registry'; +import { ownerFilesForCommand } from '@agent-device/command-registry/owner-files'; +import type { CommandTimeoutPolicy } from '@agent-device/command-registry/types'; import { getCliCommandSchema, getFlagDefinitions, @@ -305,7 +305,7 @@ function commandFiles( fileExists: FileExists | undefined, daemonRouteOwnerFiles: Readonly>, ): string[] { - const derived = ['src/core/command-descriptor/registry.ts']; + const derived = ['packages/command-registry/src/registry.ts']; const opportunistic: string[] = []; if (family) { derived.push(`src/commands/${family}/index.ts`); diff --git a/src/commands/command-metadata.ts b/src/commands/command-metadata.ts index 0e4e7ec1ae..e7807096bf 100644 --- a/src/commands/command-metadata.ts +++ b/src/commands/command-metadata.ts @@ -1,4 +1,4 @@ -import { listMcpExposedCommandNames } from '../core/command-descriptor/registry.ts'; +import { listMcpExposedCommandNames } from '@agent-device/command-registry/registry'; import type { CommandMetadata } from './command-contract.ts'; import { listCommandFamilyMetadata, type CommandFamilyCommandName } from './family/registry.ts'; diff --git a/src/commands/interaction/gesture.ts b/src/commands/interaction/gesture.ts index 49a96efd72..8f4f9c575b 100644 --- a/src/commands/interaction/gesture.ts +++ b/src/commands/interaction/gesture.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { compactRecord } from '../input-readers.ts'; import type { CliFlags } from '@agent-device/contracts/command'; import { commonInputFromFlags, request } from '../cli-grammar/common.ts'; diff --git a/src/commands/interaction/interactions.ts b/src/commands/interaction/interactions.ts index 1543f6e4e7..332bbfd6c3 100644 --- a/src/commands/interaction/interactions.ts +++ b/src/commands/interaction/interactions.ts @@ -10,7 +10,7 @@ import { swipePayloadFromPositionals, } from '@agent-device/contracts/gesture-normalization'; import { AppError } from '@agent-device/kernel/errors'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { readFillTargetFromPositionals, readInteractionTargetFromPositionals, diff --git a/src/commands/interaction/selectors.ts b/src/commands/interaction/selectors.ts index 973f305bf6..5a881ea482 100644 --- a/src/commands/interaction/selectors.ts +++ b/src/commands/interaction/selectors.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { FindOptions, IsOptions } from '@agent-device/contracts/client'; import type { CliFlags } from '@agent-device/contracts/command'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/commands/management/app.ts b/src/commands/management/app.ts index a0eb3508b6..d877ce134d 100644 --- a/src/commands/management/app.ts +++ b/src/commands/management/app.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { AppCloseOptions, AppOpenOptions } from '@agent-device/contracts/client'; import { DEFAULT_APPS_FILTER } from '@agent-device/contracts/device'; import { SESSION_SURFACES } from '@agent-device/contracts/session'; diff --git a/src/commands/management/artifacts.ts b/src/commands/management/artifacts.ts index 315f011314..eefa2eed40 100644 --- a/src/commands/management/artifacts.ts +++ b/src/commands/management/artifacts.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; import { stringField } from '../command-input.ts'; import { commonInputFromFlags, direct } from '../cli-grammar/common.ts'; diff --git a/src/commands/management/device.ts b/src/commands/management/device.ts index 97d12db178..393751d291 100644 --- a/src/commands/management/device.ts +++ b/src/commands/management/device.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; import { booleanField } from '../command-input.ts'; import { commonInputFromFlags, direct } from '../cli-grammar/common.ts'; diff --git a/src/commands/management/doctor.ts b/src/commands/management/doctor.ts index 48a57fc500..b99c2455fe 100644 --- a/src/commands/management/doctor.ts +++ b/src/commands/management/doctor.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; import * as commandInput from '../command-input.ts'; import { commonInputFromFlags, direct } from '../cli-grammar/common.ts'; diff --git a/src/commands/management/install.ts b/src/commands/management/install.ts index fdd8d3c180..66b8ee06a5 100644 --- a/src/commands/management/install.ts +++ b/src/commands/management/install.ts @@ -1,4 +1,4 @@ -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { DaemonInstallSource } from '@agent-device/kernel/contracts'; import type { CliFlags } from '@agent-device/contracts/command'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; diff --git a/src/commands/management/prepare.ts b/src/commands/management/prepare.ts index 77f366d24e..c10cd88161 100644 --- a/src/commands/management/prepare.ts +++ b/src/commands/management/prepare.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; import { enumField, integerField, requiredField } from '../command-input.ts'; import { diff --git a/src/commands/management/push.ts b/src/commands/management/push.ts index a5c92f79e1..4b99bd8ef2 100644 --- a/src/commands/management/push.ts +++ b/src/commands/management/push.ts @@ -4,7 +4,7 @@ import type { JsonObject, } from '@agent-device/contracts/client'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { commonInputFromFlags, direct, diff --git a/src/commands/management/viewport.ts b/src/commands/management/viewport.ts index c483a1db9d..fc9614bad1 100644 --- a/src/commands/management/viewport.ts +++ b/src/commands/management/viewport.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { ViewportCommandOptions } from '@agent-device/contracts/client'; import { readViewportDimensions } from '@agent-device/contracts/capture'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; diff --git a/src/commands/post-action-observation-client-options.ts b/src/commands/post-action-observation-client-options.ts index 79932ebc88..7ca631c821 100644 --- a/src/commands/post-action-observation-client-options.ts +++ b/src/commands/post-action-observation-client-options.ts @@ -8,7 +8,7 @@ import type { ScrollOptions, SettleCommandOptions, } from '@agent-device/contracts/client'; -import type { PostActionObservationCommandName } from '../core/command-descriptor/post-action-observation.ts'; +import type { PostActionObservationCommandName } from '@agent-device/command-registry/post-action-observation'; /** * Compile-time completeness for the contracts half of the `--settle` surface diff --git a/src/commands/post-action-observation-grammar.ts b/src/commands/post-action-observation-grammar.ts index bb04d9130a..63cfbf4899 100644 --- a/src/commands/post-action-observation-grammar.ts +++ b/src/commands/post-action-observation-grammar.ts @@ -1,9 +1,9 @@ import type { CliFlags } from '@agent-device/contracts/command'; -import type { PostActionObservationSupportFor } from '../core/command-descriptor/post-action-observation.ts'; +import type { PostActionObservationSupportFor } from '@agent-device/command-registry/post-action-observation'; import { commandSupportsSettleObservation, commandSupportsVerifyEvidence, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { settleInputFromFlags } from './cli-grammar/common.ts'; import { SETTLE_FLAGS } from './cli-grammar/flag-groups.ts'; import type { FlagKey } from './cli-grammar/flag-types.ts'; diff --git a/src/commands/settle-output.ts b/src/commands/settle-output.ts index dbef600fcf..a9a2e583a1 100644 --- a/src/commands/settle-output.ts +++ b/src/commands/settle-output.ts @@ -1,4 +1,4 @@ -import { commandSupportsSettleObservation } from '../core/command-descriptor/registry.ts'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import type { CliOutput } from './command-contract.ts'; import { pinnedRefText, type CliOutputFormatter } from './output-common.ts'; diff --git a/src/commands/system/index.test.ts b/src/commands/system/index.test.ts index 863668d320..43c0aae5e3 100644 --- a/src/commands/system/index.test.ts +++ b/src/commands/system/index.test.ts @@ -7,7 +7,7 @@ import type { OrientationCommandOptions, TvRemoteCommandOptions, } from '../../client/client-types.ts'; -import type { CommandResult } from '../../core/command-descriptor/command-result.ts'; +import type { CommandResult } from '@agent-device/command-registry/command-result'; import { readInputFromCli } from '../cli-grammar/registry.ts'; import type { CliFlags } from '@agent-device/contracts/command'; import { diff --git a/src/core/__tests__/interaction-response-data-transform.test.ts b/src/core/__tests__/interaction-response-data-transform.test.ts index 9440364725..603300155a 100644 --- a/src/core/__tests__/interaction-response-data-transform.test.ts +++ b/src/core/__tests__/interaction-response-data-transform.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest'; -import { resolveCommandResponseDataTransform } from '../command-descriptor/registry.ts'; +import { resolveCommandResponseDataTransform } from '@agent-device/command-registry/registry'; import { transformInteractionResponseData } from '../interaction-response-data-transform.ts'; describe('interaction response data transform', () => { diff --git a/src/core/batch-policy.ts b/src/core/batch-policy.ts index a192792875..a52ecc2492 100644 --- a/src/core/batch-policy.ts +++ b/src/core/batch-policy.ts @@ -1,5 +1,5 @@ -import { deriveStructuredBatchCommandNames } from './command-descriptor/derive.ts'; -import { commandDescriptors } from './command-descriptor/registry.ts'; +import { deriveStructuredBatchCommandNames } from '@agent-device/command-registry/derive'; +import { commandDescriptors } from '@agent-device/command-registry/registry'; import { AppError } from '@agent-device/kernel/errors'; /** diff --git a/src/core/interaction-response-data-transform.ts b/src/core/interaction-response-data-transform.ts index 154658fc6c..556f945f79 100644 --- a/src/core/interaction-response-data-transform.ts +++ b/src/core/interaction-response-data-transform.ts @@ -1,8 +1,8 @@ import { listCommandResponseDataTransformFieldNames, resolveCommandResponseDataTransform, -} from './command-descriptor/registry.ts'; -import type { ResponseDataFieldTransform } from './command-descriptor/types.ts'; +} from '@agent-device/command-registry/registry'; +import type { ResponseDataFieldTransform } from '@agent-device/command-registry/types'; export type InteractionResponseDataTransformCommand = 'click' | 'press' | 'fill'; diff --git a/src/daemon/__tests__/daemon-command-registry.test.ts b/src/daemon/__tests__/daemon-command-registry.test.ts index ef297ce5e0..e73f7dcaa9 100644 --- a/src/daemon/__tests__/daemon-command-registry.test.ts +++ b/src/daemon/__tests__/daemon-command-registry.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { canOverrideLockPolicySelector, canRunReplayScopedAction, diff --git a/src/daemon/__tests__/device-claim-admission.test.ts b/src/daemon/__tests__/device-claim-admission.test.ts index 8429519a58..7829dde7bd 100644 --- a/src/daemon/__tests__/device-claim-admission.test.ts +++ b/src/daemon/__tests__/device-claim-admission.test.ts @@ -23,7 +23,7 @@ import { createRequestExecutionScope } from '../request-execution-scope.ts'; import { LeaseRegistry } from '../lease-registry.ts'; import { SessionStore } from '../session-store.ts'; import { unavailableDeviceRuntimeGateway } from './test-device-runtime-gateway.ts'; -import type { DeviceClaimPolicy } from '../../core/command-descriptor/types.ts'; +import type { DeviceClaimPolicy } from '@agent-device/command-registry/types'; const setup = isolatedDeviceClaimStores('agent-device-claim-admission-'); const localAndroid = localRuntimeOwner('android'); diff --git a/src/daemon/__tests__/generic-route-runtime-completeness.test.ts b/src/daemon/__tests__/generic-route-runtime-completeness.test.ts index 5be375696a..340652d8b4 100644 --- a/src/daemon/__tests__/generic-route-runtime-completeness.test.ts +++ b/src/daemon/__tests__/generic-route-runtime-completeness.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { commandDescriptors } from '../../core/command-descriptor/registry.ts'; +import { commandDescriptors } from '@agent-device/command-registry/registry'; import { resolveGenericRuntimeExecution } from '../generic-runtime-execution.ts'; /** diff --git a/src/daemon/__tests__/http-server-artifacts.coverage.ts b/src/daemon/__tests__/http-server-artifacts.coverage.ts index b0abf41f64..515850ee0d 100644 --- a/src/daemon/__tests__/http-server-artifacts.coverage.ts +++ b/src/daemon/__tests__/http-server-artifacts.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; export const ANDROID_ARTIFACTS_CONTRACT_EVIDENCE = { commands: [C.artifacts], diff --git a/src/daemon/__tests__/request-handler-catalog.test.ts b/src/daemon/__tests__/request-handler-catalog.test.ts index 98ef6af80b..3b77a4c831 100644 --- a/src/daemon/__tests__/request-handler-catalog.test.ts +++ b/src/daemon/__tests__/request-handler-catalog.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import { withTestDeviceInventoryProvider as withTargetDeviceResolutionScope } from '../../__tests__/test-utils/device-inventory-gateways.ts'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { isRequestCanceledError, type AppError } from '@agent-device/kernel/errors'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; import { getDaemonCommandRoute, type DaemonCommandRoute } from '../daemon-command-registry.ts'; diff --git a/src/daemon/__tests__/request-handler-chain-provider-scope.test.ts b/src/daemon/__tests__/request-handler-chain-provider-scope.test.ts index e878380d04..ee79733e70 100644 --- a/src/daemon/__tests__/request-handler-chain-provider-scope.test.ts +++ b/src/daemon/__tests__/request-handler-chain-provider-scope.test.ts @@ -8,7 +8,7 @@ vi.mock('../handlers/session.ts', () => ({ handleSessionCommands: handleSessionCommandsMock, })); -import { INTERNAL_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { LeaseRegistry } from '../lease-registry.ts'; import { runRequestHandlerChain } from '../request-handler-chain.ts'; import { makeIosSession } from '../../__tests__/test-utils/session-factories.ts'; diff --git a/src/daemon/__tests__/request-handler-chain.test.ts b/src/daemon/__tests__/request-handler-chain.test.ts index d8e64efe0d..0d25c737b2 100644 --- a/src/daemon/__tests__/request-handler-chain.test.ts +++ b/src/daemon/__tests__/request-handler-chain.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { INTERNAL_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { LeaseRegistry } from '../lease-registry.ts'; import { runRequestHandlerChain } from '../request-handler-chain.ts'; import { getDaemonRouteOwnerFiles } from '../route-owner-files.ts'; diff --git a/src/daemon/__tests__/runtime-binding-conformance-completeness.test.ts b/src/daemon/__tests__/runtime-binding-conformance-completeness.test.ts index 1ba59080f8..a996a6f9c5 100644 --- a/src/daemon/__tests__/runtime-binding-conformance-completeness.test.ts +++ b/src/daemon/__tests__/runtime-binding-conformance-completeness.test.ts @@ -2,7 +2,7 @@ import { expect, test } from 'vitest'; import { commandDescriptors, commandRuntimeUseRequirements, -} from '../../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { conformedRuntimeBindings, refusedRuntimeOperation, diff --git a/src/daemon/__tests__/runtime-binding-conformance.ts b/src/daemon/__tests__/runtime-binding-conformance.ts index 7116646179..8d6dcf7f9b 100644 --- a/src/daemon/__tests__/runtime-binding-conformance.ts +++ b/src/daemon/__tests__/runtime-binding-conformance.ts @@ -7,7 +7,7 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { commandRuntimeUseRequirements } from '../../core/command-descriptor/registry.ts'; +import { commandRuntimeUseRequirements } from '@agent-device/command-registry/registry'; import { createUnavailableRuntimeFactsForTest } from '../../__tests__/test-utils/runtime-operation-facts.ts'; import { makeSession } from '../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/client/__tests__/boundary-fault-transport.test.ts b/src/daemon/client/__tests__/boundary-fault-transport.test.ts index 867413af02..f1485dc312 100644 --- a/src/daemon/client/__tests__/boundary-fault-transport.test.ts +++ b/src/daemon/client/__tests__/boundary-fault-transport.test.ts @@ -3,7 +3,7 @@ import http from 'node:http'; import net from 'node:net'; import path from 'node:path'; import { afterEach, beforeEach, test, vi } from 'vitest'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { closeLoopbackServer, diff --git a/src/daemon/client/daemon-client-lifecycle.ts b/src/daemon/client/daemon-client-lifecycle.ts index ab5b0ac92d..daf57639cb 100644 --- a/src/daemon/client/daemon-client-lifecycle.ts +++ b/src/daemon/client/daemon-client-lifecycle.ts @@ -24,7 +24,7 @@ import { type DaemonTransportPreference, } from '../config.ts'; import { resolveDaemonLaunchSpec, resolveLocalDaemonCodeSignature } from './daemon-launch-spec.ts'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { cleanupFailedDaemonStartupMetadata, diff --git a/src/daemon/client/daemon-client-timeout.ts b/src/daemon/client/daemon-client-timeout.ts index c220baaec4..8dbf63cb6d 100644 --- a/src/daemon/client/daemon-client-timeout.ts +++ b/src/daemon/client/daemon-client-timeout.ts @@ -3,8 +3,8 @@ import { runCmdSync } from '@agent-device/host-kit/command'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { isAgentDeviceDaemonProcess } from '../daemon-process.ts'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; -import { resolveCommandTimeoutPolicy } from '../../core/command-descriptor/registry.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; +import { resolveCommandTimeoutPolicy } from '@agent-device/command-registry/registry'; import type { DaemonPaths } from '../config.ts'; import type { PlatformSelector } from '@agent-device/kernel/device'; import { diff --git a/src/daemon/client/daemon-client.ts b/src/daemon/client/daemon-client.ts index 233b835c23..7a8ab5d338 100644 --- a/src/daemon/client/daemon-client.ts +++ b/src/daemon/client/daemon-client.ts @@ -10,9 +10,9 @@ import { emitDiagnostic, withDiagnosticTimer, } from '@agent-device/host-kit/diagnostics'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; -import { resolveCommandTimeoutPolicy } from '../../core/command-descriptor/registry.ts'; -import { resolveCommandRequestTimeoutMs } from '../../core/command-descriptor/timeout-policy.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; +import { resolveCommandTimeoutPolicy } from '@agent-device/command-registry/registry'; +import { resolveCommandRequestTimeoutMs } from '@agent-device/command-registry/timeout-policy'; import { prepareRemoteRequestArtifacts } from '../../remote/daemon-artifacts.ts'; import { attachActiveSessionAddressHint, diff --git a/src/daemon/daemon-command-registry.ts b/src/daemon/daemon-command-registry.ts index 2b35ca049f..fc2b969146 100644 --- a/src/daemon/daemon-command-registry.ts +++ b/src/daemon/daemon-command-registry.ts @@ -3,13 +3,13 @@ import { type DaemonCommandRoute, type SessionlessLeaseAdmissionExemption, type SessionCommandKind, -} from '../core/command-descriptor/daemon-command-descriptor.ts'; -import { deriveDaemonCommandDescriptors } from '../core/command-descriptor/derive.ts'; +} from '@agent-device/command-registry/daemon-command-descriptor'; +import { deriveDaemonCommandDescriptors } from '@agent-device/command-registry/derive'; import { commandDescriptors, resolveCommandRecordingEffect, resolveCommandDeviceClaimPolicy, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import type { RefFrameEffect } from '@agent-device/contracts/replay'; import type { DaemonRequest } from './types.ts'; @@ -23,7 +23,7 @@ export type DaemonProviderDeviceResolutionIntent = // Built from the additive command-descriptor registry (ADR-0008, Phase 1 step 2). // The hand-authored literal that previously lived here was proven byte-equal to -// this derived value by `src/core/command-descriptor/__tests__/parity.test.ts` (#906) +// this derived value by `src/__tests__/command-descriptor-parity.test.ts` (#906) // and has been deleted; the daemon now derives its routes/traits from the single // source. export const DAEMON_COMMAND_DESCRIPTORS: readonly DaemonCommandDescriptor[] = diff --git a/src/daemon/device-claim-admission.ts b/src/daemon/device-claim-admission.ts index 54d121fe31..61358d4284 100644 --- a/src/daemon/device-claim-admission.ts +++ b/src/daemon/device-claim-admission.ts @@ -3,7 +3,7 @@ import type { DeviceBindingIntent, RuntimeOwnerRef, } from '@agent-device/contracts/platform-runtime'; -import type { DeviceClaimPolicy } from '../core/command-descriptor/types.ts'; +import type { DeviceClaimPolicy } from '@agent-device/command-registry/types'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { inspectAllocatorHeldDeviceClaim, diff --git a/src/daemon/generic-settle.ts b/src/daemon/generic-settle.ts index a880308a84..4c7ee816a1 100644 --- a/src/daemon/generic-settle.ts +++ b/src/daemon/generic-settle.ts @@ -1,7 +1,7 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SettleObservation, SettleParams } from '@agent-device/contracts/interaction'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { commandSupportsSettleObservation } from '../core/command-descriptor/registry.ts'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import { captureSnapshotForSession, createInteractionRuntime, diff --git a/src/daemon/handlers/__tests__/session-script-publication.test.ts b/src/daemon/handlers/__tests__/session-script-publication.test.ts index ac03004402..24c92514a8 100644 --- a/src/daemon/handlers/__tests__/session-script-publication.test.ts +++ b/src/daemon/handlers/__tests__/session-script-publication.test.ts @@ -2,7 +2,7 @@ import { isSessionRecording } from '../../session-script-publication-capability. import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, test } from 'vitest'; -import { INTERNAL_COMMANDS } from '../../../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { makeIosSession, makeAuthoringSession, diff --git a/src/daemon/handlers/__tests__/snapshot.test.ts b/src/daemon/handlers/__tests__/snapshot.test.ts index 34776c6787..9289edb0e4 100644 --- a/src/daemon/handlers/__tests__/snapshot.test.ts +++ b/src/daemon/handlers/__tests__/snapshot.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; -import { parseWaitPositionals as parseWaitArgs } from '../../../core/wait-positionals.ts'; -import { parseTimeout } from '../../../core/parse-timeout.ts'; +import { parseWaitPositionals as parseWaitArgs } from '@agent-device/command-registry/wait-positionals'; +import { parseTimeout } from '@agent-device/command-registry/parse-timeout'; // --- parseTimeout --- @@ -110,7 +110,7 @@ test('parseWaitArgs parses selector expression with timeout', () => { // #1800: this used to fall back to a literal-text wait for "foo=bar" — a caller typo (or a // straight-up unrecognized selector key) that can only ever time out, never match. It is now a // typed rejection instead. Full coverage of the rejection shapes lives in -// src/core/wait-positionals.test.ts, which mirrors this module's source topology. +// src/__tests__/wait-positionals.test.ts, beside the parser's other root-owned coverage. test('parseWaitArgs rejects an unrecognized selector-like key=value token instead of reading it as text', () => { const result = parseWaitArgs(['foo=bar', '5000']); assert.ok(result); diff --git a/src/daemon/handlers/lease.ts b/src/daemon/handlers/lease.ts index d1ebaca284..ac1917f3dd 100644 --- a/src/daemon/handlers/lease.ts +++ b/src/daemon/handlers/lease.ts @@ -3,7 +3,7 @@ import type { LeaseLifecycleContext, LeaseLifecycleProvider, } from '@agent-device/contracts/device'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { AgentArtifactsResult, CloudArtifactProvider, @@ -23,7 +23,7 @@ import { leaseScopeToReleaseRequest, } from '../../core/lease-scope.ts'; import { AppError, createRequestCanceledError, errorMessage } from '@agent-device/kernel/errors'; -import { LEASE_ALLOCATION_BUDGET_MS } from '../../core/command-descriptor/timeout-policy.ts'; +import { LEASE_ALLOCATION_BUDGET_MS } from '@agent-device/command-registry/timeout-policy'; import { getRequestSignal, isRequestCanceled } from '@agent-device/host-kit/request'; import { listDownloadableArtifacts } from '../artifact-tracking.ts'; import { providerSessionIdFromData } from '../provider-session-ownership.ts'; diff --git a/src/daemon/handlers/react-native.ts b/src/daemon/handlers/react-native.ts index 0f720336e5..1137452fb4 100644 --- a/src/daemon/handlers/react-native.ts +++ b/src/daemon/handlers/react-native.ts @@ -3,7 +3,7 @@ import { resolveBoundTouchRuntime, type BoundTouchRuntime, } from '../touch-runtime.ts'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { analyzeReactNativeOverlay, type ReactNativeOverlayDismissTarget, diff --git a/src/daemon/handlers/session-clipboard.ts b/src/daemon/handlers/session-clipboard.ts index c58aa65f61..4b7636da02 100644 --- a/src/daemon/handlers/session-clipboard.ts +++ b/src/daemon/handlers/session-clipboard.ts @@ -9,7 +9,7 @@ import { import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import { publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { contextFromFlags, type DaemonCommandContext } from '../context.ts'; import type { DaemonRequest, DaemonResponse } from '../types.ts'; import type { SessionStore } from '../session-store.ts'; diff --git a/src/daemon/handlers/session-doctor.ts b/src/daemon/handlers/session-doctor.ts index f14019e5af..6608d39260 100644 --- a/src/daemon/handlers/session-doctor.ts +++ b/src/daemon/handlers/session-doctor.ts @@ -1,5 +1,5 @@ import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { isIosFamily, publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { emitRequestProgress } from '@agent-device/host-kit/request'; diff --git a/src/daemon/handlers/session-prepare.ts b/src/daemon/handlers/session-prepare.ts index ac2688a9fe..6369de7b76 100644 --- a/src/daemon/handlers/session-prepare.ts +++ b/src/daemon/handlers/session-prepare.ts @@ -1,7 +1,7 @@ import { prepareAppleRunnerRuntimeUse } from '@agent-device/contracts/application-lifecycle-runtime-plan'; import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; -import { PREPARE_REQUEST_TIMEOUT_MS } from '../../core/command-descriptor/timeout-policy.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; +import { PREPARE_REQUEST_TIMEOUT_MS } from '@agent-device/command-registry/timeout-policy'; import { publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; import { resolveRunnerLogicalLeaseContext } from '../lease-context.ts'; import type { DaemonRequest, DaemonResponse } from '../types.ts'; diff --git a/src/daemon/handlers/session-script-publication.ts b/src/daemon/handlers/session-script-publication.ts index fea4d2549f..0cc4dde3ce 100644 --- a/src/daemon/handlers/session-script-publication.ts +++ b/src/daemon/handlers/session-script-publication.ts @@ -1,4 +1,4 @@ -import { INTERNAL_COMMANDS } from '../../command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { successText } from '@agent-device/kernel/success-text'; import { diff --git a/src/daemon/handlers/session-selector-dispatch.ts b/src/daemon/handlers/session-selector-dispatch.ts index ae2611bb74..fc31f82645 100644 --- a/src/daemon/handlers/session-selector-dispatch.ts +++ b/src/daemon/handlers/session-selector-dispatch.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts'; import type { SessionStore } from '../session-store.ts'; diff --git a/src/daemon/handlers/session.ts b/src/daemon/handlers/session.ts index eb787ed9be..4cadbcd964 100644 --- a/src/daemon/handlers/session.ts +++ b/src/daemon/handlers/session.ts @@ -27,7 +27,7 @@ import type { SessionOpenCommandInput, } from '../session-lifecycle/index.ts'; import type { SessionObservabilityCommandInput } from '../session-observability/index.ts'; -import type { DescriptorSessionRouteCommandName } from '../../core/command-descriptor/registry.ts'; +import type { DescriptorSessionRouteCommandName } from '@agent-device/command-registry/registry'; import { LeaseRegistry } from '../lease-registry.ts'; const handleSessionInventoryCommandGroup: SessionCommandHandler = ( diff --git a/src/daemon/handlers/snapshot-alert.ts b/src/daemon/handlers/snapshot-alert.ts index 265f717277..fd1396e13a 100644 --- a/src/daemon/handlers/snapshot-alert.ts +++ b/src/daemon/handlers/snapshot-alert.ts @@ -15,7 +15,7 @@ import { contextFromFlags } from '../context.ts'; import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts'; import { SessionStore } from '../session-store.ts'; import { recordIfSession } from '../snapshot-session.ts'; -import { parseTimeout } from '../../core/parse-timeout.ts'; +import { parseTimeout } from '@agent-device/command-registry/parse-timeout'; import { resolveRefFrameEffect } from '../daemon-command-registry.ts'; import { expireRefFrame } from '../ref-frame.ts'; import type { DaemonFailureResponse } from '../response.ts'; diff --git a/src/daemon/interaction/internal/interaction-touch-direct-ios-eligibility.ts b/src/daemon/interaction/internal/interaction-touch-direct-ios-eligibility.ts index b8844f2283..449b5ec198 100644 --- a/src/daemon/interaction/internal/interaction-touch-direct-ios-eligibility.ts +++ b/src/daemon/interaction/internal/interaction-touch-direct-ios-eligibility.ts @@ -3,7 +3,7 @@ import type { InteractionTarget } from '@agent-device/contracts/interaction'; import { commandSupportsSettleObservation, commandSupportsVerifyEvidence, -} from '../../../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { readSimpleIosSelectorTarget, type DirectIosSelectorTarget, diff --git a/src/daemon/interaction/internal/interaction.ts b/src/daemon/interaction/internal/interaction.ts index e294f55ebe..0872adb629 100644 --- a/src/daemon/interaction/internal/interaction.ts +++ b/src/daemon/interaction/internal/interaction.ts @@ -7,7 +7,7 @@ import { refSnapshotFlagGuardResponse } from '../../ref-snapshot-flag-policy.ts' import { dispatchGetViaRuntime, dispatchIsViaRuntime } from '../../selector-runtime.ts'; import { expireRefFrame } from '../../ref-frame.ts'; import { errorResponse, noActiveSessionError } from '../../response.ts'; -import { PUBLIC_COMMANDS } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { normalizeError } from '@agent-device/kernel/errors'; import { ensureAndroidBlockingSystemDialogReady, diff --git a/src/daemon/managed-device-allocation/command-horizon.ts b/src/daemon/managed-device-allocation/command-horizon.ts index db1c6034d1..d3c44803a3 100644 --- a/src/daemon/managed-device-allocation/command-horizon.ts +++ b/src/daemon/managed-device-allocation/command-horizon.ts @@ -1,7 +1,7 @@ import { Deadline } from '@agent-device/host-kit/retry'; import { AppError } from '@agent-device/kernel/errors'; -import { resolveCommandTimeoutPolicy } from '../../core/command-descriptor/registry.ts'; -import { resolveCommandRequestTimeoutMs } from '../../core/command-descriptor/timeout-policy.ts'; +import { resolveCommandTimeoutPolicy } from '@agent-device/command-registry/registry'; +import { resolveCommandRequestTimeoutMs } from '@agent-device/command-registry/timeout-policy'; import { DAEMON_SESSION_TEARDOWN_TIMEOUT_MS, SCREEN_RECORDING_SESSION_TEARDOWN_BUDGET_MS, diff --git a/src/daemon/replay/internal/session-replay-target-verification.ts b/src/daemon/replay/internal/session-replay-target-verification.ts index 9d1e34b581..3cfa9348a9 100644 --- a/src/daemon/replay/internal/session-replay-target-verification.ts +++ b/src/daemon/replay/internal/session-replay-target-verification.ts @@ -28,8 +28,8 @@ import { REPLAY_TARGET_GUARD_MISMATCH_REASON, WAIT_LANDMARK_MISMATCH_REASON, } from '@agent-device/contracts/replay'; -import { resolveTargetIdentityVerification } from '../../../core/command-descriptor/registry.ts'; -import { parseWaitPositionals } from '../../../core/wait-positionals.ts'; +import { resolveTargetIdentityVerification } from '@agent-device/command-registry/registry'; +import { parseWaitPositionals } from '@agent-device/command-registry/wait-positionals'; import type { DaemonResponse, SessionState } from '../../types.ts'; import type { ReplayResumeStamper } from '../../session-replay-coordinator.ts'; import type { InternalObservationEvidence } from '../../internal-observation.ts'; diff --git a/src/daemon/request-execution-scope.ts b/src/daemon/request-execution-scope.ts index 57f3a83bdc..e99a285f90 100644 --- a/src/daemon/request-execution-scope.ts +++ b/src/daemon/request-execution-scope.ts @@ -58,7 +58,7 @@ import { } from './request-runtime-binding.ts'; import { createDeviceClaimAdmission, type DeviceClaimAdmission } from './device-claim-admission.ts'; import { createOwnerScopedDeviceClaimReconciler } from './device-claim-owner-recovery.ts'; -import { resolveCommandDeviceClaimPolicy } from '../core/command-descriptor/registry.ts'; +import { resolveCommandDeviceClaimPolicy } from '@agent-device/command-registry/registry'; import type { PlatformResourceCleanup } from '@agent-device/contracts/platform-resource-cleanup'; // Production daemon wiring owns one LeaseRegistry per process; scoping locks by registry keeps diff --git a/src/daemon/request-generic-dispatch.ts b/src/daemon/request-generic-dispatch.ts index b31ee868fe..27dbd25b98 100644 --- a/src/daemon/request-generic-dispatch.ts +++ b/src/daemon/request-generic-dispatch.ts @@ -1,6 +1,6 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SettleObservation } from '@agent-device/contracts/interaction'; -import { commandSupportsSettleObservation } from '../core/command-descriptor/registry.ts'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import type { SessionStore } from './session-store.ts'; import type { DaemonCommandContext } from './context.ts'; import type { DaemonRequest, DaemonResponse, SessionState } from './types.ts'; diff --git a/src/daemon/request-handler-chain.ts b/src/daemon/request-handler-chain.ts index 9fc78cbac8..aa9e8a9f5f 100644 --- a/src/daemon/request-handler-chain.ts +++ b/src/daemon/request-handler-chain.ts @@ -1,7 +1,7 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { CloudArtifactProvider } from '@agent-device/contracts/observability'; import { AppError } from '@agent-device/kernel/errors'; -import type { DaemonCommandRoute } from '../core/command-descriptor/daemon-command-descriptor.ts'; +import type { DaemonCommandRoute } from '@agent-device/command-registry/daemon-command-descriptor'; import { getDaemonCommandRoute } from './daemon-command-registry.ts'; import * as genericRequestHandlerModule from './request-generic-dispatch.ts'; import type { DaemonCommandContext } from './context.ts'; diff --git a/src/daemon/route-owner-files.ts b/src/daemon/route-owner-files.ts index de005c0881..e8d7fc785d 100644 --- a/src/daemon/route-owner-files.ts +++ b/src/daemon/route-owner-files.ts @@ -8,7 +8,7 @@ import type { DaemonCommandRoute } from './request-handler-chain.ts'; * {@link DAEMON_ROUTE_HANDLERS}; the owner-file path is pure tooling metadata * that only `explain:command` consumes. Keeping it inline on the route object * shipped these strings in `dist/src/internal/daemon.js`, so — like the - * per-command claims in `command-descriptor/owner-files.ts` — they live here in + * per-command claims in `@agent-device/command-registry/owner-files` — they live here in * a module the production import graph never reaches, and the bundler drops them. * * `satisfies Record` keeps the map complete: adding diff --git a/src/daemon/session-event-action-presentation.ts b/src/daemon/session-event-action-presentation.ts index efe3dd69cf..8bb47d4670 100644 --- a/src/daemon/session-event-action-presentation.ts +++ b/src/daemon/session-event-action-presentation.ts @@ -2,7 +2,7 @@ import type { SessionAction } from '@agent-device/contracts/session'; import { DEVICE_ROTATIONS } from '@agent-device/contracts/device'; import { BACK_MODES } from '@agent-device/contracts/back-mode'; import { TV_REMOTE_BUTTONS } from '@agent-device/contracts/tv-remote'; -import { PUBLIC_COMMANDS } from '../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { isKeyboardAction } from '../core/keyboard-actions.ts'; import { compactSessionEventDetails as compactDetails, diff --git a/src/daemon/session-event-action.ts b/src/daemon/session-event-action.ts index 7be18d2a3c..14433fa85d 100644 --- a/src/daemon/session-event-action.ts +++ b/src/daemon/session-event-action.ts @@ -4,8 +4,8 @@ import { SWIPE_PATTERNS } from '@agent-device/contracts/scroll-gesture'; import { RECORDING_SCOPE_VALUES } from '@agent-device/contracts/recording'; import { SESSION_SURFACES, type SessionAction } from '@agent-device/contracts/session'; import { DEVICE_TARGETS, PLATFORM_SELECTORS, PUBLIC_PLATFORMS } from '@agent-device/kernel/device'; -import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../command-catalog.ts'; -import { commandSupportsSettleObservation } from '../core/command-descriptor/registry.ts'; +import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import { buildInstallActionSummary, buildStructuredActionDetails, diff --git a/src/daemon/session-event-log.ts b/src/daemon/session-event-log.ts index d81793c5d7..29638b3c45 100644 --- a/src/daemon/session-event-log.ts +++ b/src/daemon/session-event-log.ts @@ -1,7 +1,7 @@ import type { SessionAction } from '@agent-device/contracts/session'; import fs from 'node:fs'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { AppError } from '@agent-device/kernel/errors'; import { redactDiagnosticData } from '@agent-device/kernel/redaction'; import { emitDiagnostic, getDiagnosticsMeta } from '@agent-device/host-kit/diagnostics'; diff --git a/src/daemon/session-event-request.ts b/src/daemon/session-event-request.ts index f3c5b8be3c..5c36183117 100644 --- a/src/daemon/session-event-request.ts +++ b/src/daemon/session-event-request.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { isRecord } from '@agent-device/kernel/record'; import type { DaemonRequest, DaemonResponseData } from './types.ts'; diff --git a/src/daemon/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts b/src/daemon/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts index efe7891288..cd315879c4 100644 --- a/src/daemon/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts +++ b/src/daemon/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts @@ -1,7 +1,7 @@ import { expect, test } from 'vitest'; import os from 'node:os'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { makeAndroidSession } from '../../../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../../../__tests__/test-utils/store-factory.ts'; import type { diff --git a/src/daemon/session-lifecycle/internal/__tests__/session-capabilities.test.ts b/src/daemon/session-lifecycle/internal/__tests__/session-capabilities.test.ts index a5b9e3bb51..40929c4fd5 100644 --- a/src/daemon/session-lifecycle/internal/__tests__/session-capabilities.test.ts +++ b/src/daemon/session-lifecycle/internal/__tests__/session-capabilities.test.ts @@ -1,7 +1,7 @@ import { test, expect, vi } from 'vitest'; import path from 'node:path'; import os from 'node:os'; -import { PUBLIC_COMMANDS } from '../../../../command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { LINUX_DEVICE, WEB_DESKTOP_DEVICE, diff --git a/src/daemon/session-lifecycle/internal/inventory.ts b/src/daemon/session-lifecycle/internal/inventory.ts index 132c46b30b..b8f37729e6 100644 --- a/src/daemon/session-lifecycle/internal/inventory.ts +++ b/src/daemon/session-lifecycle/internal/inventory.ts @@ -1,7 +1,7 @@ import { commandRuntimeUseRequirements, listRuntimeFactCommands, -} from '../../../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { listDeviceInventory } from '../../../request/device-inventory-context.ts'; import { assertResolvedAppsFilter } from '@agent-device/contracts/device'; import { AppError, asAppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/session-observability/__tests__/session-audio.coverage.ts b/src/daemon/session-observability/__tests__/session-audio.coverage.ts index 16234316a1..5bbc3e24b1 100644 --- a/src/daemon/session-observability/__tests__/session-audio.coverage.ts +++ b/src/daemon/session-observability/__tests__/session-audio.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../../../command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; export const ANDROID_AUDIO_CONTRACT_EVIDENCE = { commands: [C.audio], diff --git a/src/daemon/session-script-active-publication.ts b/src/daemon/session-script-active-publication.ts index 303d457c68..25c3db23ff 100644 --- a/src/daemon/session-script-active-publication.ts +++ b/src/daemon/session-script-active-publication.ts @@ -1,6 +1,6 @@ import type { SessionAction } from '@agent-device/contracts/session'; -import { resolveCommandRecordingEffect } from '../core/command-descriptor/registry.ts'; -import { parseWaitPositionals } from '../core/wait-positionals.ts'; +import { resolveCommandRecordingEffect } from '@agent-device/command-registry/registry'; +import { parseWaitPositionals } from '@agent-device/command-registry/wait-positionals'; import { AppError } from '@agent-device/kernel/errors'; import { isTouchTargetCommand } from '@agent-device/ad-script'; import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/gesture-normalization'; diff --git a/src/daemon/wait-runtime.ts b/src/daemon/wait-runtime.ts index b017ef763a..f4809c58d0 100644 --- a/src/daemon/wait-runtime.ts +++ b/src/daemon/wait-runtime.ts @@ -2,8 +2,8 @@ import { waitObservesDevice } from '@agent-device/contracts/wait-runtime-plan'; import type { TargetAnnotationV1 } from '@agent-device/contracts/replay'; import { AppError } from '@agent-device/kernel/errors'; import { checkWaitText } from '@agent-device/selectors'; -import { parseWaitPositionals } from '../core/wait-positionals.ts'; -import type { WaitParsed } from '../core/wait-positionals.ts'; +import { parseWaitPositionals } from '@agent-device/command-registry/wait-positionals'; +import type { WaitParsed } from '@agent-device/command-registry/wait-positionals'; import { absenceCaptureOptionError } from '../core/absence-observation-errors.ts'; import { absenceCaptureOptionRefusal } from '../core/absence-observation.ts'; import { parseVersionedRefPositional } from './ref-positionals.ts'; diff --git a/src/mcp/__tests__/command-tools-navigation-schemas.test.ts b/src/mcp/__tests__/command-tools-navigation-schemas.test.ts index 99f4e6feda..bbcf8019c5 100644 --- a/src/mcp/__tests__/command-tools-navigation-schemas.test.ts +++ b/src/mcp/__tests__/command-tools-navigation-schemas.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { commandSupportsSettleObservation } from '../../core/command-descriptor/registry.ts'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import { COMMAND_OUTPUT_SCHEMAS } from '../command-output-schemas.ts'; // The closed dispatch shape each navigation command's runtime returns diff --git a/src/mcp/__tests__/command-tools-timeout-note.test.ts b/src/mcp/__tests__/command-tools-timeout-note.test.ts index 9448a2f559..228ae3309e 100644 --- a/src/mcp/__tests__/command-tools-timeout-note.test.ts +++ b/src/mcp/__tests__/command-tools-timeout-note.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { resolveCommandTimeoutPolicy } from '../../core/command-descriptor/registry.ts'; +import { resolveCommandTimeoutPolicy } from '@agent-device/command-registry/registry'; import { listCommandTools } from '../command-tools.ts'; // AS-011: the enforced client request envelopes (timeout-policy, ADR 0008) diff --git a/src/mcp/__tests__/command-tools.test.ts b/src/mcp/__tests__/command-tools.test.ts index bbe2d0796a..28915aa098 100644 --- a/src/mcp/__tests__/command-tools.test.ts +++ b/src/mcp/__tests__/command-tools.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; import type { AgentDeviceClient } from '../../client/client-types.ts'; import { createCommandToolExecutor, listCommandTools } from '../command-tools.ts'; -import { resolveCommandRecordsSessionAction } from '../../core/command-descriptor/registry.ts'; +import { resolveCommandRecordsSessionAction } from '@agent-device/command-registry/registry'; import { COMMAND_OUTPUT_SCHEMAS } from '../command-output-schemas.ts'; import { AppError } from '@agent-device/kernel/errors'; import { validateAgainstSchema } from './output-schema-validator.ts'; diff --git a/src/mcp/__tests__/router.test.ts b/src/mcp/__tests__/router.test.ts index 7b15fe7b43..0a1f406971 100644 --- a/src/mcp/__tests__/router.test.ts +++ b/src/mcp/__tests__/router.test.ts @@ -1,9 +1,9 @@ import assert from 'node:assert/strict'; import { setImmediate } from 'node:timers/promises'; import { test } from 'vitest'; -import { listCliCommandNames } from '../../command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; import { helpTopicIds } from '../../cli-schema/cli-help.ts'; -import { listMcpExposedCommandNames } from '../../core/command-descriptor/registry.ts'; +import { listMcpExposedCommandNames } from '@agent-device/command-registry/registry'; import { handleMcpMessage } from '../router.ts'; import { HELP_TOOL_NAME, diff --git a/src/mcp/command-output-schemas.ts b/src/mcp/command-output-schemas.ts index de49bc584f..2f1561cace 100644 --- a/src/mcp/command-output-schemas.ts +++ b/src/mcp/command-output-schemas.ts @@ -1,6 +1,6 @@ import type { JsonSchema } from '../commands/command-contract.ts'; -import type { CommandResultMap } from '../core/command-descriptor/command-result.ts'; -import { commandSupportsSettleObservation } from '../core/command-descriptor/registry.ts'; +import type { CommandResultMap } from '@agent-device/command-registry/command-result'; +import { commandSupportsSettleObservation } from '@agent-device/command-registry/registry'; import { booleanSchema, looseObjectSchema, stringSchema } from '../commands/command-input.ts'; import { BACK_MODES } from '@agent-device/contracts/back-mode'; import { DEVICE_ROTATIONS } from '@agent-device/contracts/device'; @@ -11,7 +11,7 @@ import { DEVICE_TARGETS, PUBLIC_PLATFORMS } from '@agent-device/kernel/device'; /** * Registry of per-command MCP `outputSchema`s, keyed by the daemon command * NAME. It is type-tied to the typed-result spine `CommandResultMap` - * (src/core/command-descriptor/command-result.ts) via + * (@agent-device/command-registry/command-result) via * `satisfies Record`, so the one-for-one * invariant is compiler-enforced: a new `CommandResultMap` entry without a schema * here is a missing-key error, and a typo'd/extra key is an excess-property error. diff --git a/src/mcp/command-tools.ts b/src/mcp/command-tools.ts index b6f680953f..3109caa96c 100644 --- a/src/mcp/command-tools.ts +++ b/src/mcp/command-tools.ts @@ -16,7 +16,7 @@ import { resolveStructuredBatchCommandName } from '../core/batch-policy.ts'; import { resolveCommandRecordsSessionAction, resolveCommandTimeoutPolicy, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { MCP_COMMAND_OUTPUT_SCHEMAS } from './mcp-output-schemas.ts'; import { COMMON_INPUT_AUDIENCE } from '../commands/common-input-fields.ts'; import { diff --git a/src/mcp/server-guide.ts b/src/mcp/server-guide.ts index 6db7eb21a2..de84ae789c 100644 --- a/src/mcp/server-guide.ts +++ b/src/mcp/server-guide.ts @@ -4,8 +4,8 @@ import { helpTopicIds, resolveHelpTargetUsageText, } from '../cli-schema/cli-help.ts'; -import { listCliCommandNames } from '../command-catalog.ts'; -import { listMcpExposedCommandNames } from '../core/command-descriptor/registry.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; +import { listMcpExposedCommandNames } from '@agent-device/command-registry/registry'; import type { ToolResult } from './command-tools.ts'; /** diff --git a/src/mcp/tool-ref-pins.ts b/src/mcp/tool-ref-pins.ts index 1a851e56de..cdf3b93525 100644 --- a/src/mcp/tool-ref-pins.ts +++ b/src/mcp/tool-ref-pins.ts @@ -6,7 +6,7 @@ import type { CommandExecutionResult } from '../commands/command-surface.ts'; import { commandDescriptors, commandSupportsSettleObservation, -} from '../core/command-descriptor/registry.ts'; +} from '@agent-device/command-registry/registry'; import { asOptionalRecord } from '@agent-device/kernel/record'; export type ToolRefPinStore = { diff --git a/test/integration/android-emulator-coverage-report.test.ts b/test/integration/android-emulator-coverage-report.test.ts index 090f093582..640d43fd38 100644 --- a/test/integration/android-emulator-coverage-report.test.ts +++ b/test/integration/android-emulator-coverage-report.test.ts @@ -4,7 +4,7 @@ import os from 'node:os'; import path from 'node:path'; import test from 'node:test'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY } from './android-emulator-e2e/coverage-manifest.ts'; import type { LiveContext } from './android-emulator-e2e/live-harness.ts'; import { writeCoverageReport } from './android-emulator-e2e/live-coverage-report.ts'; diff --git a/test/integration/android-emulator-e2e/contract-evidence.ts b/test/integration/android-emulator-e2e/contract-evidence.ts index 2a439ee081..32257b7452 100644 --- a/test/integration/android-emulator-e2e/contract-evidence.ts +++ b/test/integration/android-emulator-e2e/contract-evidence.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; export type AndroidContractCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS]; diff --git a/test/integration/android-emulator-e2e/coverage-manifest.ts b/test/integration/android-emulator-e2e/coverage-manifest.ts index cdd99c728e..7b25dfd224 100644 --- a/test/integration/android-emulator-e2e/coverage-manifest.ts +++ b/test/integration/android-emulator-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { ANDROID_AUDIO_CONTRACT_EVIDENCE } from '../../../src/daemon/session-observability/__tests__/session-audio.coverage.ts'; import { ANDROID_INSTALL_SOURCE_CONTRACT_EVIDENCE } from '../../../src/__tests__/install-source.coverage.ts'; import { ANDROID_LIFECYCLE_CONTRACT_EVIDENCE } from '../provider-scenarios/android-lifecycle.coverage.ts'; diff --git a/test/integration/android-emulator-e2e/live-assertions.ts b/test/integration/android-emulator-e2e/live-assertions.ts index 0ff29355b6..cb6ff84bc2 100644 --- a/test/integration/android-emulator-e2e/live-assertions.ts +++ b/test/integration/android-emulator-e2e/live-assertions.ts @@ -1,5 +1,5 @@ import assert from 'node:assert/strict'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { RawSnapshotNode } from '@agent-device/kernel/snapshot'; import type { SnapshotDiffLine } from '@agent-device/contracts/capture'; import { diff --git a/test/integration/android-emulator-e2e/live-automation-scenario.ts b/test/integration/android-emulator-e2e/live-automation-scenario.ts index 3bf45b69f4..0dddb2824e 100644 --- a/test/integration/android-emulator-e2e/live-automation-scenario.ts +++ b/test/integration/android-emulator-e2e/live-automation-scenario.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertElementText, assertDiffLine, diff --git a/test/integration/android-emulator-e2e/live-bootstrap.ts b/test/integration/android-emulator-e2e/live-bootstrap.ts index 8079406b22..79b4107d20 100644 --- a/test/integration/android-emulator-e2e/live-bootstrap.ts +++ b/test/integration/android-emulator-e2e/live-bootstrap.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { type LiveContext, runStep, verifyCommand } from './live-harness.ts'; export async function installCachedFixture(context: LiveContext): Promise { diff --git a/test/integration/android-emulator-e2e/live-capture-scenario.ts b/test/integration/android-emulator-e2e/live-capture-scenario.ts index f575d78ee7..850748d4d5 100644 --- a/test/integration/android-emulator-e2e/live-capture-scenario.ts +++ b/test/integration/android-emulator-e2e/live-capture-scenario.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertPngFile } from '../provider-scenarios/assertions.ts'; import { type LiveContext, runStep, verifyCommand } from './live-harness.ts'; diff --git a/test/integration/android-emulator-e2e/live-form-scenario.ts b/test/integration/android-emulator-e2e/live-form-scenario.ts index e273a54717..b578b10189 100644 --- a/test/integration/android-emulator-e2e/live-form-scenario.ts +++ b/test/integration/android-emulator-e2e/live-form-scenario.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { parseRect } from '@agent-device/kernel/record'; import type { CliJsonResult } from '../cli-json.ts'; import { diff --git a/test/integration/android-emulator-e2e/live-inventory-scenario.ts b/test/integration/android-emulator-e2e/live-inventory-scenario.ts index 64f87b27dd..86f06465cd 100644 --- a/test/integration/android-emulator-e2e/live-inventory-scenario.ts +++ b/test/integration/android-emulator-e2e/live-inventory-scenario.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertJsonContains } from './live-assertions.ts'; import { type LiveContext, runStep, verifyCommand } from './live-harness.ts'; diff --git a/test/integration/android-emulator-e2e/live-lifecycle-scenario.ts b/test/integration/android-emulator-e2e/live-lifecycle-scenario.ts index b8cf3f0ebf..0a5c7b351c 100644 --- a/test/integration/android-emulator-e2e/live-lifecycle-scenario.ts +++ b/test/integration/android-emulator-e2e/live-lifecycle-scenario.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertElementText, assertWaitText } from './live-assertions.ts'; import { ANDROID_TEST_IME_PACKAGE } from './live-form-scenario.ts'; import { type LiveContext, runStep, verifyBehavior, verifyCommand } from './live-harness.ts'; diff --git a/test/integration/android-emulator-e2e/live-observability-scenario.ts b/test/integration/android-emulator-e2e/live-observability-scenario.ts index 5f66971b2d..dbc876587d 100644 --- a/test/integration/android-emulator-e2e/live-observability-scenario.ts +++ b/test/integration/android-emulator-e2e/live-observability-scenario.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { readDaemonInfo } from '../../../src/daemon/client/daemon-client-metadata.ts'; import { resolveDaemonPaths } from '../../../src/daemon/config.ts'; import { diff --git a/test/integration/android-emulator-e2e/live-replay-scenarios.ts b/test/integration/android-emulator-e2e/live-replay-scenarios.ts index 9ce485c032..b40a6cbcd3 100644 --- a/test/integration/android-emulator-e2e/live-replay-scenarios.ts +++ b/test/integration/android-emulator-e2e/live-replay-scenarios.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { type LiveContext, runStep, diff --git a/test/integration/android-emulator-e2e/scenarios.ts b/test/integration/android-emulator-e2e/scenarios.ts index 02e22fe36a..ae44adc94c 100644 --- a/test/integration/android-emulator-e2e/scenarios.ts +++ b/test/integration/android-emulator-e2e/scenarios.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { AndroidEmulatorBehaviorId } from './behavior-coverage.ts'; import { assertAutomationSystem } from './live-automation-scenario.ts'; import { installCachedFixture } from './live-bootstrap.ts'; diff --git a/test/integration/client-api-doc-snippets.test.ts b/test/integration/client-api-doc-snippets.test.ts index 62657a3023..4fa6346460 100644 --- a/test/integration/client-api-doc-snippets.test.ts +++ b/test/integration/client-api-doc-snippets.test.ts @@ -87,10 +87,10 @@ function writeSnippetProgram(snippets: string[]): string { noUnusedParameters: false, paths: resolveExamplesSdkPaths(), }, - // src/global.d.ts declares build-time ambient globals (e.g. __OWNER_FILES__) - // that src/ files reference; examples/sdk/tsconfig.json includes it for the - // same reason. - include: ['*.ts', path.join(repoRoot, 'src/global.d.ts')], + // packages/command-registry/src/global.d.ts declares build-time ambient globals + // (e.g. __OWNER_FILES__) that the descriptor registry references; + // examples/sdk/tsconfig.json includes it for the same reason. + include: ['*.ts', path.join(repoRoot, 'packages/command-registry/src/global.d.ts')], }), ); snippets.forEach((code, index) => { diff --git a/test/integration/ios-simulator-e2e/coverage-manifest.ts b/test/integration/ios-simulator-e2e/coverage-manifest.ts index d76985012a..6944c48fdc 100644 --- a/test/integration/ios-simulator-e2e/coverage-manifest.ts +++ b/test/integration/ios-simulator-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; type PublicCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS]; diff --git a/test/integration/ios-simulator-e2e/live-assertions.ts b/test/integration/ios-simulator-e2e/live-assertions.ts index 0df1b882b9..0b9b22a3ec 100644 --- a/test/integration/ios-simulator-e2e/live-assertions.ts +++ b/test/integration/ios-simulator-e2e/live-assertions.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertFilesDiffer, assertJsonContains, diff --git a/test/integration/ios-simulator-e2e/live-automation-scenario.ts b/test/integration/ios-simulator-e2e/live-automation-scenario.ts index cf1c7ae3bb..e3ef8afd93 100644 --- a/test/integration/ios-simulator-e2e/live-automation-scenario.ts +++ b/test/integration/ios-simulator-e2e/live-automation-scenario.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { DEFAULT_ALERT_TIMEOUT_MS } from '@agent-device/contracts/alert-contract'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertElementText, assertElementTextAfterScrolling, diff --git a/test/integration/ios-simulator-e2e/live-device-lifecycle.ts b/test/integration/ios-simulator-e2e/live-device-lifecycle.ts index dfb607e5bd..76c27ff89a 100644 --- a/test/integration/ios-simulator-e2e/live-device-lifecycle.ts +++ b/test/integration/ios-simulator-e2e/live-device-lifecycle.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { requireDevice } from './live-assertions.ts'; import { type LiveContext, runStep, verifyCommand } from './live-harness.ts'; diff --git a/test/integration/ios-simulator-e2e/live-full-scenarios.ts b/test/integration/ios-simulator-e2e/live-full-scenarios.ts index d8a184024f..d8d978d7f6 100644 --- a/test/integration/ios-simulator-e2e/live-full-scenarios.ts +++ b/test/integration/ios-simulator-e2e/live-full-scenarios.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertElementText, assertElementTextAfterScrolling, diff --git a/test/integration/ios-simulator-e2e/live-replay-scenarios.ts b/test/integration/ios-simulator-e2e/live-replay-scenarios.ts index 58081c120c..f48ebb0b70 100644 --- a/test/integration/ios-simulator-e2e/live-replay-scenarios.ts +++ b/test/integration/ios-simulator-e2e/live-replay-scenarios.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { type LiveContext, runStep, diff --git a/test/integration/ios-simulator-e2e/live-runner.ts b/test/integration/ios-simulator-e2e/live-runner.ts index 035ad4986f..5140956194 100644 --- a/test/integration/ios-simulator-e2e/live-runner.ts +++ b/test/integration/ios-simulator-e2e/live-runner.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { pathToFileURL } from 'node:url'; import type { AgentDeviceDaemonTransport } from '@agent-device/contracts/client'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { sendToDaemon } from '../../../src/daemon/client/daemon-client.ts'; import { assertPngFile } from '../provider-scenarios/assertions.ts'; import { diff --git a/test/integration/linux-e2e/command-evidence.ts b/test/integration/linux-e2e/command-evidence.ts index 4bd717238c..e5f6eabc64 100644 --- a/test/integration/linux-e2e/command-evidence.ts +++ b/test/integration/linux-e2e/command-evidence.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; /** Commands exercised by the separate Linux/Xvfb command-evidence lane. */ export const LINUX_COMMAND_EVIDENCE_COMMANDS = [ diff --git a/test/integration/linux-e2e/coverage-manifest.ts b/test/integration/linux-e2e/coverage-manifest.ts index 94c6d70541..e00172c928 100644 --- a/test/integration/linux-e2e/coverage-manifest.ts +++ b/test/integration/linux-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { buildCoverageClassificationSummary } from '../support/coverage-classification.ts'; type PublicCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS]; diff --git a/test/integration/linux-e2e/live-runner.ts b/test/integration/linux-e2e/live-runner.ts index 7614581302..d8850e274e 100644 --- a/test/integration/linux-e2e/live-runner.ts +++ b/test/integration/linux-e2e/live-runner.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { runSourceCliJsonSync } from '../cli-json.ts'; import { assertJsonContains } from '../live-device-e2e/assertions.ts'; import { diff --git a/test/integration/macos-e2e/coverage-manifest.ts b/test/integration/macos-e2e/coverage-manifest.ts index 8222da455c..c335ade796 100644 --- a/test/integration/macos-e2e/coverage-manifest.ts +++ b/test/integration/macos-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { buildCoverageClassificationSummary } from '../support/coverage-classification.ts'; import { MACOS_LIVE_SCENARIOS, diff --git a/test/integration/nightly/concurrency-torture/bindings.ts b/test/integration/nightly/concurrency-torture/bindings.ts index 41a4b405b7..96e9eae8d3 100644 --- a/test/integration/nightly/concurrency-torture/bindings.ts +++ b/test/integration/nightly/concurrency-torture/bindings.ts @@ -24,7 +24,7 @@ import type { DaemonRequest } from '../../../../src/daemon/types.ts'; import type { SessionStore } from '../../../../src/daemon/session-store.ts'; import { resolveRequestExecutionLockKeys } from '../../../../src/daemon/request-binding.ts'; import { shouldLockSessionExecution } from '../../../../src/daemon/daemon-command-registry.ts'; -import { PUBLIC_COMMANDS } from '../../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { withTestDeviceInventoryProvider as withDeviceInventoryProvider } from '../../../../src/__tests__/test-utils/device-inventory-gateways.ts'; import type { LockKey } from './deterministic-scheduler.ts'; diff --git a/test/integration/provider-scenarios/active-session-script-publication.test.ts b/test/integration/provider-scenarios/active-session-script-publication.test.ts index 927bb060d8..a94a9fd789 100644 --- a/test/integration/provider-scenarios/active-session-script-publication.test.ts +++ b/test/integration/provider-scenarios/active-session-script-publication.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; -import { INTERNAL_COMMANDS } from '../../../src/command-catalog.ts'; +import { INTERNAL_COMMANDS } from '@agent-device/command-registry/catalog'; import { test } from 'vitest'; import { assertRpcError, assertRpcOk } from './assertions.ts'; import { androidSettingsXml, createAndroidSettingsWorld } from './android-world.ts'; diff --git a/test/integration/provider-scenarios/android-lifecycle.coverage.ts b/test/integration/provider-scenarios/android-lifecycle.coverage.ts index 73d081d31c..d01419cde6 100644 --- a/test/integration/provider-scenarios/android-lifecycle.coverage.ts +++ b/test/integration/provider-scenarios/android-lifecycle.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; import { defineAndroidContractEvidence } from '../android-emulator-e2e/contract-evidence.ts'; export const ANDROID_LIFECYCLE_CONTRACT_EVIDENCE = defineAndroidContractEvidence( diff --git a/test/integration/provider-scenarios/android-recording.coverage.ts b/test/integration/provider-scenarios/android-recording.coverage.ts index 44b595674c..5dc59a7e12 100644 --- a/test/integration/provider-scenarios/android-recording.coverage.ts +++ b/test/integration/provider-scenarios/android-recording.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; import { defineAndroidContractEvidence } from '../android-emulator-e2e/contract-evidence.ts'; export const ANDROID_RECORDING_CONTRACT_EVIDENCE = defineAndroidContractEvidence( diff --git a/test/integration/provider-scenarios/android-test-suite.coverage.ts b/test/integration/provider-scenarios/android-test-suite.coverage.ts index 4920895d08..2711034d0b 100644 --- a/test/integration/provider-scenarios/android-test-suite.coverage.ts +++ b/test/integration/provider-scenarios/android-test-suite.coverage.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS as C } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS as C } from '@agent-device/command-registry/catalog'; import { defineAndroidContractEvidence } from '../android-emulator-e2e/contract-evidence.ts'; export const ANDROID_TEST_SUITE_CONTRACT_EVIDENCE = defineAndroidContractEvidence( diff --git a/test/integration/provider-scenarios/apple-platform-output-guard.test.ts b/test/integration/provider-scenarios/apple-platform-output-guard.test.ts index d7d62d168a..313d6911a1 100644 --- a/test/integration/provider-scenarios/apple-platform-output-guard.test.ts +++ b/test/integration/provider-scenarios/apple-platform-output-guard.test.ts @@ -5,7 +5,7 @@ import path from 'node:path'; import { test } from 'vitest'; import type { AppleRunnerProvider } from '@agent-device/platform-apple/runner'; import type { AppleSimulatorScreenRecordingTransport } from '../../../src/platform-runtime-screen-recording-apple-transport.ts'; -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { PROVIDER_SCENARIO_IOS_SIMULATOR, PROVIDER_SCENARIO_MACOS } from './fixtures.ts'; import { createProviderIosSimulatorRecordingProcess, diff --git a/test/integration/smoke-android-emulator-coverage.test.ts b/test/integration/smoke-android-emulator-coverage.test.ts index 5df1942f15..21ed4616d8 100644 --- a/test/integration/smoke-android-emulator-coverage.test.ts +++ b/test/integration/smoke-android-emulator-coverage.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { ANDROID_EMULATOR_BEHAVIOR_COVERAGE } from './android-emulator-e2e/behavior-coverage.ts'; import { ANDROID_PERMISSION_PROMPT_COMMAND } from './android-emulator-e2e/live-lifecycle-scenario.ts'; import { diff --git a/test/integration/smoke-cli.test.ts b/test/integration/smoke-cli.test.ts index 7d4710cb05..aaa287ad22 100644 --- a/test/integration/smoke-cli.test.ts +++ b/test/integration/smoke-cli.test.ts @@ -2,7 +2,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import { runCmdSync } from '@agent-device/host-kit/command'; import { cliAliasesForCommand } from '../../src/commands/cli-command-aliases.ts'; -import { listCliCommandNames } from '../../src/command-catalog.ts'; +import { listCliCommandNames } from '@agent-device/command-registry/catalog'; function runCli(args: string[]): { status: number; stdout: string; stderr: string } { const result = runCmdSync( diff --git a/test/integration/smoke-ios-simulator-coverage.test.ts b/test/integration/smoke-ios-simulator-coverage.test.ts index 9f8b583f19..b316b0ae1f 100644 --- a/test/integration/smoke-ios-simulator-coverage.test.ts +++ b/test/integration/smoke-ios-simulator-coverage.test.ts @@ -10,7 +10,7 @@ import { normalizePublicSwipeMotion, swipePayloadFromPositionals, } from '@agent-device/contracts/gesture-normalization'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import { isValidSelectorExpression } from '@agent-device/selectors'; import { IOS_SIMULATOR_BEHAVIOR_COVERAGE } from './ios-simulator-e2e/behavior-coverage.ts'; diff --git a/test/integration/smoke-linux-coverage.test.ts b/test/integration/smoke-linux-coverage.test.ts index 835c642a5d..a8f4ad999e 100644 --- a/test/integration/smoke-linux-coverage.test.ts +++ b/test/integration/smoke-linux-coverage.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import test from 'node:test'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { LINUX_COVERAGE_GAP_ISSUE, LINUX_COMMAND_EVIDENCE, diff --git a/test/integration/smoke-macos-coverage.test.ts b/test/integration/smoke-macos-coverage.test.ts index dee02aa34f..0ab92a3389 100644 --- a/test/integration/smoke-macos-coverage.test.ts +++ b/test/integration/smoke-macos-coverage.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import test from 'node:test'; import { mkdtempForTest } from '../../src/__tests__/test-utils/tmp-dir.ts'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { MACOS_COVERAGE_GAP_ISSUE, MACOS_LIVE_SCENARIOS, diff --git a/test/integration/smoke-tvos-platform-coverage.test.ts b/test/integration/smoke-tvos-platform-coverage.test.ts index a77766270d..23cafacfd6 100644 --- a/test/integration/smoke-tvos-platform-coverage.test.ts +++ b/test/integration/smoke-tvos-platform-coverage.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import test from 'node:test'; import { TVOS_SIMULATOR } from '../../src/__tests__/test-utils/device-fixtures.ts'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { createPlatformRuntimeGateway } from '../../src/platform-runtime.ts'; import { gestureRefusalMessage } from '@agent-device/contracts/gesture-admission'; import { diff --git a/test/integration/smoke-web-platform-coverage.test.ts b/test/integration/smoke-web-platform-coverage.test.ts index f931e9dc11..cd14096df1 100644 --- a/test/integration/smoke-web-platform-coverage.test.ts +++ b/test/integration/smoke-web-platform-coverage.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import test from 'node:test'; import { mkdtempForTest } from '../../src/__tests__/test-utils/tmp-dir.ts'; -import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { WEB_COVERAGE_GAP_ISSUE, WEB_PLATFORM_COVERAGE, diff --git a/test/integration/tvos-e2e/coverage-manifest.ts b/test/integration/tvos-e2e/coverage-manifest.ts index d800566bb4..01a00c859e 100644 --- a/test/integration/tvos-e2e/coverage-manifest.ts +++ b/test/integration/tvos-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { buildCoverageClassificationSummary } from '../support/coverage-classification.ts'; type PublicCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS]; diff --git a/test/integration/web-e2e/coverage-manifest.ts b/test/integration/web-e2e/coverage-manifest.ts index d2c8605fd0..769852a112 100644 --- a/test/integration/web-e2e/coverage-manifest.ts +++ b/test/integration/web-e2e/coverage-manifest.ts @@ -1,4 +1,4 @@ -import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; +import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { buildCoverageClassificationSummary } from '../support/coverage-classification.ts'; type PublicCommand = (typeof PUBLIC_COMMANDS)[keyof typeof PUBLIC_COMMANDS]; diff --git a/test/output-economy/owner-files-no-leak.test.ts b/test/output-economy/owner-files-no-leak.test.ts index e7bf23ac46..d98a6fc43f 100644 --- a/test/output-economy/owner-files-no-leak.test.ts +++ b/test/output-economy/owner-files-no-leak.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from 'vitest'; import fs from 'node:fs'; import path from 'node:path'; import { runCmdSync } from '@agent-device/host-kit/command'; -import { COMMAND_OWNER_FILES } from '../../src/core/command-descriptor/owner-files.ts'; +import { COMMAND_OWNER_FILES } from '@agent-device/command-registry/owner-files'; import { getDaemonRouteOwnerFiles } from '../../src/daemon/route-owner-files.ts'; const repoRoot = path.resolve(import.meta.dirname, '../..'); diff --git a/tsconfig.json b/tsconfig.json index 991c1f8481..b77afe95cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,10 @@ "verbatimModuleSyntax": true, "types": ["node"] }, - "include": ["src", "test", "scripts/help-conformance-command-validator.ts"] + "include": [ + "src", + "test", + "scripts/help-conformance-command-validator.ts", + "packages/command-registry/src/global.d.ts" + ] }