Skip to content

Commit 2ec4e91

Browse files
thymikeeclaude
andauthored
refactor(core): move the command descriptor registry into its own workspace package (#2348)
* refactor(core): move the command descriptor registry into its own package `src/core/command-descriptor/`, `src/command-catalog.ts`, `src/core/wait-positionals.ts` and `src/core/parse-timeout.ts` move as git renames into a new private package `@agent-device/command-registry` (deps: contracts, selectors). One subpath per module points straight at the moved file; no `index.ts`, no re-export at the old path. Every consumer switches to the owning specifier. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz * test(host-kit): pin the command-registry package inside the daemon code graph The daemon reaches the registry and its catalog only by workspace specifier. A walk that stopped at the package boundary would report an unchanged signature after a descriptor edit, and the client would keep reusing a daemon running the superseded policy. The manifest is asserted beside the sources because its `exports` map is what chose them. The cache doc comment quoting the old ~800-module graph is corrected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz * chore(gates): point the descriptor-registry gates at the package path R66's `COMMAND_DESCRIPTOR_MODULE`, R16's record-runtime join subject and the Fallow `AssertTrue` totality-guard key follow the registry to its package. The two descriptor hubs leave `HUB_ENTRY_FILES` because the package manifest now publishes them, so the eager-closure gate discovers them as facades and one entry gets one rule; this also flips `denyPlatformImplementations` from false (hub) to true (package entry) for both, which is intentional and stricter. `command-registry` joins the ranked spine at rank 1. No `APPROVED_OVER_CEILING` row: rename detection carries every moved entry's merge-base baseline, so all twelve fall under the no-growth rule rather than a ceiling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqfa11D8QsCMuL17SsLvDz --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 89c7536 commit 2ec4e91

219 files changed

Lines changed: 390 additions & 263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fallowrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
},
247247
{
248248
"comment": "Type-level `AssertTrue<...>` registry-totality guards. Exported only so `noUnusedLocals` keeps them alive; a consumer would defeat the point.",
249-
"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}",
249+
"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}",
250250
"exports": [
251251
"CommandOwnerFileClaimsAreComplete",
252252
"BuiltinPluginsCoverAllPlatforms",

AGENTS.md

Lines changed: 3 additions & 3 deletions

examples/sdk/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
// prior build, workspace link, or publish step. Running an example for real
2222
// still resolves `agent-device` as a self-referencing package (needs
2323
// `pnpm build`), matching how a real consumer would import it.
24-
"include": [".", "../../src/global.d.ts"]
24+
"include": [".", "../../packages/command-registry/src/global.d.ts"]
2525
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"check:unit": "pnpm test:unit && pnpm check:tmpdir-leaks && pnpm test:smoke",
168168
"check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit",
169169
"prepack": "pnpm check:mcp-metadata && pnpm package:npm",
170-
"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",
170+
"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",
171171
"test-app:install": "pnpm install --dir examples/test-app",
172172
"test-app:start": "pnpm --dir examples/test-app start",
173173
"test-app:ios": "pnpm --dir examples/test-app ios",
@@ -277,6 +277,7 @@
277277
"@agent-device/ad-replay": "workspace:*",
278278
"@agent-device/ad-script": "workspace:*",
279279
"@agent-device/capture-kit": "workspace:*",
280+
"@agent-device/command-registry": "workspace:*",
280281
"@agent-device/contracts": "workspace:*",
281282
"@agent-device/host-kit": "workspace:*",
282283
"@agent-device/kernel": "workspace:*",
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "@agent-device/command-registry",
3+
"version": "0.0.0",
4+
"private": true,
5+
"sideEffects": false,
6+
"type": "module",
7+
"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.",
8+
"dependencies": {
9+
"@agent-device/contracts": "workspace:*",
10+
"@agent-device/selectors": "workspace:*"
11+
},
12+
"exports": {
13+
"./registry": {
14+
"types": "./src/registry.ts",
15+
"default": "./src/registry.ts"
16+
},
17+
"./catalog": {
18+
"types": "./src/catalog.ts",
19+
"default": "./src/catalog.ts"
20+
},
21+
"./types": {
22+
"types": "./src/types.ts",
23+
"default": "./src/types.ts"
24+
},
25+
"./timeout-policy": {
26+
"types": "./src/timeout-policy.ts",
27+
"default": "./src/timeout-policy.ts"
28+
},
29+
"./command-result": {
30+
"types": "./src/command-result.ts",
31+
"default": "./src/command-result.ts"
32+
},
33+
"./daemon-command-descriptor": {
34+
"types": "./src/daemon-command-descriptor.ts",
35+
"default": "./src/daemon-command-descriptor.ts"
36+
},
37+
"./derive": {
38+
"types": "./src/derive.ts",
39+
"default": "./src/derive.ts"
40+
},
41+
"./owner-files": {
42+
"types": "./src/owner-files.ts",
43+
"default": "./src/owner-files.ts"
44+
},
45+
"./platform-execution-entry": {
46+
"types": "./src/platform-execution-entry.ts",
47+
"default": "./src/platform-execution-entry.ts"
48+
},
49+
"./post-action-observation": {
50+
"types": "./src/post-action-observation.ts",
51+
"default": "./src/post-action-observation.ts"
52+
},
53+
"./parse-timeout": {
54+
"types": "./src/parse-timeout.ts",
55+
"default": "./src/parse-timeout.ts"
56+
},
57+
"./wait-positionals": {
58+
"types": "./src/wait-positionals.ts",
59+
"default": "./src/wait-positionals.ts"
60+
}
61+
}
62+
}

src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts renamed to packages/command-registry/src/__tests__/application-lifecycle-runtime-execution.test.ts

File renamed without changes.

src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts renamed to packages/command-registry/src/__tests__/apps-runtime-execution.test.ts

File renamed without changes.

src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts renamed to packages/command-registry/src/__tests__/appstate-runtime-execution.test.ts

File renamed without changes.

src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts renamed to packages/command-registry/src/__tests__/boot-runtime-execution.test.ts

File renamed without changes.

src/core/command-descriptor/__tests__/click-runtime-execution.test.ts renamed to packages/command-registry/src/__tests__/click-runtime-execution.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)