Skip to content

Commit 8704ec7

Browse files
committed
refactor(move): extract the daemon server into @agent-device/daemon
Atomic move of `src/daemon/` to `packages/daemon/src/` with every mechanical path rewrite, generated by the 11b codemod (/tmp/11b-move.mjs, kept off-tree by plan): - git mv of all 713 files (contents preserved; only specifiers and repo-path literals change) - 331 inbound import sites outside the package retargeted to `@agent-device/daemon/<subpath>` specifiers across src/, test/, scripts/ (84 distinct exported subpaths) - the package manifest, composite tsconfig, root/examples project references, root manifest dependency, and lockfile - remaining repo-path literals (rule tables, wire-compat ledger, layer manifest, coverage declarations, baseline keys) retargeted to the new prefix Production code keeps zero edges from the package into non-package src/; the remaining package->root edges are 11a-2's runtime/provider and command-surface cleanup targets.
1 parent e51dff5 commit 8704ec7

936 files changed

Lines changed: 1887 additions & 1369 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.

‎examples/sdk/tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
{ "path": "../../packages/capture-kit" },
4040
{ "path": "../../packages/command-registry" },
4141
{ "path": "../../packages/contracts" },
42+
{ "path": "../../packages/daemon" },
4243
{ "path": "../../packages/daemon-contracts" },
4344
{ "path": "../../packages/device-selection" },
4445
{ "path": "../../packages/host-kit" },

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293
"@agent-device/capture-kit": "workspace:*",
294294
"@agent-device/command-registry": "workspace:*",
295295
"@agent-device/contracts": "workspace:*",
296+
"@agent-device/daemon": "workspace:*",
296297
"@agent-device/daemon-contracts": "workspace:*",
297298
"@agent-device/device-selection": "workspace:*",
298299
"@agent-device/host-kit": "workspace:*",

‎packages/ad-replay/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* review, "typed façade replaces the zero-type rule"): a package a root
1818
* consumer must integrate against through hand-derived `Parameters<...>`/
1919
* `ReturnType<...>` gymnastics in a SINGLE allowed root module
20-
* (`src/daemon/ad-replay-facade-types.ts`, since deleted) is a shim tax, not
20+
* (`packages/daemon/src/ad-replay-facade-types.ts`, since deleted) is a shim tax, not
2121
* an isolation win — every derived name still had to be re-exported from that
2222
* one file for every other root module to use, and every daemon-side type
2323
* that shadowed an engine type by hand (`TargetVerificationEntry`,

‎packages/ad-replay/src/internal/__tests__/step-loop.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { TargetAnnotationV1 } from '@agent-device/contracts/replay';
1414
* `packages/replay-port/src/daemon-port/native-command.ts` (`runReplayCommand`) does. The equivalent
1515
* daemon-level assertions (full `SessionStore`/`runReplayCommand` round
1616
* trip, including the `--keep-session` live-session postcondition) live in
17-
* `src/daemon/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts`
17+
* `packages/daemon/src/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts`
1818
* (renamed from `session-replay-terminal-lifecycle.test.ts` by the #1555
1919
* structural-quality review — see that file's own header for the rationale);
2020
* this file covers the SAME suppression decision at the cheaper,

‎packages/ad-script/src/internal/open-script.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
* (or falls back to) that accumulation. Two independent daemon/package call
1515
* sites needed exactly this scan and, before this move, each carried its own
1616
* copy: `packages/ad-replay/src/internal/inspect.ts`'s plan-digest platform
17-
* precedence, and `src/daemon/replay-device-selection.ts`'s
17+
* precedence, and `packages/daemon/src/replay-device-selection.ts`'s
1818
* `readScriptReplaySelection` (fused into its own single pass alongside an
1919
* app-target scan). A `src/` root file cannot become a façade dependency
2020
* (R11), and a workspace package may not reach back into root `src/` either

‎packages/capture-kit/src/mobile-snapshot-semantics.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ test('mobile presentation does not let contradictory scroll indicator add hidden
644644
});
645645

646646
// #1542: isConfirmedOnScreenProbe is the pure geometry boundary the off-screen
647-
// refusal double-check's direct probe (src/daemon/offscreen-target-probe.ts)
647+
// refusal double-check's direct probe (packages/daemon/src/offscreen-target-probe.ts)
648648
// reduces its confirm/don't-confirm decision to, once it has a fresh,
649649
// tree-independent read of the target. Each branch below is proved with a
650650
// counterfactual per docs/agents/testing.md — see the comment on each test

‎packages/capture-kit/src/mobile-snapshot-semantics.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function analyzeMobileSnapshotVisibility(nodes: SnapshotNode[]): {
8484

8585
/**
8686
* #1542: the pure geometry boundary the off-screen refusal double-check's
87-
* direct probe (`src/daemon/offscreen-target-probe.ts`) reduces its decision
87+
* direct probe (`packages/daemon/src/offscreen-target-probe.ts`) reduces its decision
8888
* to, once it has a fresh, tree-independent read of one element. A probe
8989
* confirms the element genuinely on-screen only when BOTH hold: XCTest's own
9090
* live hit-test says `hittable`, AND the tap point sits inside the root

‎packages/capture-kit/src/snapshot-chrome.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export function collectSettleChromeRefs(
333333
* only excludes nodes whose OWN type is `keyboard` still leaks every key and
334334
* assistant control as "discriminating" evidence.
335335
*
336-
* Used by `src/daemon/interaction-surface-signature.ts`'s post-gesture
336+
* Used by `packages/daemon/src/interaction-surface-signature.ts`'s post-gesture
337337
* baseline-distrust discriminating-overlap classification (#1542 defect 2,
338338
* #1563 review): that comparison operates on flat signature entries with no
339339
* ref-selection budget of its own, so it needs the ref set directly rather

‎packages/command-registry/src/registry.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export type DescriptorCatalogRecord<Group extends CommandCatalogGroup> = {
136136

137137
/**
138138
* The literal union of every command whose `daemon.route` is `'session'`.
139-
* Drives `SESSION_COMMAND_HANDLER_IMPLS` in `src/daemon/handlers/session.ts`: adding a
139+
* Drives `SESSION_COMMAND_HANDLER_IMPLS` in `packages/daemon/src/handlers/session.ts`: adding a
140140
* session-routed descriptor without a matching handler table entry is a compile error rather
141141
* than a runtime routing gap caught only by `expectHandlerResponse`.
142142
*/
@@ -165,7 +165,7 @@ export type DescriptorDaemonRouteCommandName =
165165

166166
// ---------------------------------------------------------------------------
167167
// Daemon request-policy trait bundles — copied VERBATIM from
168-
// src/daemon/daemon-command-registry.ts (DAEMON_COMMAND_DESCRIPTORS).
168+
// packages/daemon/src/daemon-command-registry.ts (DAEMON_COMMAND_DESCRIPTORS).
169169
// ---------------------------------------------------------------------------
170170

171171
const ADMISSION_AND_LOCK_EXEMPT = {
@@ -508,7 +508,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
508508
{
509509
name: 'human_control',
510510
deviceClaimPolicy: 'none',
511-
...(ownerFilesEnabled ? { ownerFiles: ['src/daemon/handlers/human-control.ts'] as const } : {}),
511+
...(ownerFilesEnabled ? { ownerFiles: ['packages/daemon/src/handlers/human-control.ts'] as const } : {}),
512512
catalog: { group: 'internal', key: 'humanControl' },
513513
recordsSessionAction: false,
514514
daemon: {
@@ -526,7 +526,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
526526
{
527527
name: 'lease_allocate',
528528
deviceClaimPolicy: 'none',
529-
...(ownerFilesEnabled ? { ownerFiles: ['src/daemon/handlers/lease.ts'] as const } : {}),
529+
...(ownerFilesEnabled ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } : {}),
530530
catalog: { group: 'internal', key: 'leaseAllocate' },
531531
recordsSessionAction: false,
532532
daemon: {
@@ -541,7 +541,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
541541
{
542542
name: 'lease_heartbeat',
543543
deviceClaimPolicy: 'none',
544-
...(ownerFilesEnabled ? { ownerFiles: ['src/daemon/handlers/lease.ts'] as const } : {}),
544+
...(ownerFilesEnabled ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } : {}),
545545
catalog: { group: 'internal', key: 'leaseHeartbeat' },
546546
recordsSessionAction: false,
547547
daemon: {
@@ -557,7 +557,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
557557
{
558558
name: 'lease_release',
559559
deviceClaimPolicy: 'none',
560-
...(ownerFilesEnabled ? { ownerFiles: ['src/daemon/handlers/lease.ts'] as const } : {}),
560+
...(ownerFilesEnabled ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } : {}),
561561
catalog: { group: 'internal', key: 'leaseRelease' },
562562
recordsSessionAction: false,
563563
daemon: {
@@ -592,7 +592,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
592592
name: 'session_list',
593593
deviceClaimPolicy: 'none',
594594
...(ownerFilesEnabled
595-
? { ownerFiles: ['src/daemon/session-lifecycle/internal/inventory.ts'] as const }
595+
? { ownerFiles: ['packages/daemon/src/session-lifecycle/internal/inventory.ts'] as const }
596596
: {}),
597597
catalog: { group: 'internal', key: 'sessionList' },
598598
recordsSessionAction: false,
@@ -610,7 +610,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
610610
name: 'session_save_script',
611611
deviceClaimPolicy: 'none',
612612
...(ownerFilesEnabled
613-
? { ownerFiles: ['src/daemon/handlers/session-script-publication.ts'] as const }
613+
? { ownerFiles: ['packages/daemon/src/handlers/session-script-publication.ts'] as const }
614614
: {}),
615615
catalog: { group: 'internal', key: 'sessionSaveScript' },
616616
recordsSessionAction: false,
@@ -887,8 +887,8 @@ export const RAW_COMMAND_DESCRIPTORS = [
887887
...(ownerFilesEnabled
888888
? {
889889
ownerFiles: [
890-
'src/daemon/handlers/session-runtime-command.ts',
891-
'src/daemon/handlers/session-runtime-port-reverse.ts',
890+
'packages/daemon/src/handlers/session-runtime-command.ts',
891+
'packages/daemon/src/handlers/session-runtime-port-reverse.ts',
892892
] as const,
893893
}
894894
: {}),
@@ -953,7 +953,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
953953
name: 'install_source',
954954
deviceClaimPolicy: 'transient-exclusive',
955955
...(ownerFilesEnabled
956-
? { ownerFiles: ['src/daemon/handlers/session-app-source-deployment.ts'] as const }
956+
? { ownerFiles: ['packages/daemon/src/handlers/session-app-source-deployment.ts'] as const }
957957
: {}),
958958
catalog: {
959959
group: 'internal',
@@ -971,7 +971,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
971971
name: 'release_materialized_paths',
972972
deviceClaimPolicy: 'none',
973973
...(ownerFilesEnabled
974-
? { ownerFiles: ['src/daemon/handlers/session-app-source-deployment.ts'] as const }
974+
? { ownerFiles: ['packages/daemon/src/handlers/session-app-source-deployment.ts'] as const }
975975
: {}),
976976
catalog: { group: 'internal', key: 'releaseMaterializedPaths' },
977977
recordsSessionAction: false,
@@ -1502,7 +1502,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
15021502
},
15031503
{
15041504
name: 'scroll',
1505-
...(ownerFilesEnabled ? { ownerFiles: ['src/daemon/scroll-runtime.ts'] as const } : {}),
1505+
...(ownerFilesEnabled ? { ownerFiles: ['packages/daemon/src/scroll-runtime.ts'] as const } : {}),
15061506
catalog: { group: 'public' },
15071507
frameworkTier: 'core',
15081508
// R53 retires this command's capability bucket and its `dispatch` leaf together: admission is
@@ -1551,7 +1551,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
15511551
? {
15521552
ownerFiles: [
15531553
'src/commands/capture/screenshot.ts',
1554-
'src/daemon/screenshot-runtime.ts',
1554+
'packages/daemon/src/screenshot-runtime.ts',
15551555
] as const,
15561556
}
15571557
: {}),

‎packages/command-registry/src/timeout-policy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CommandTimeoutBudget, CommandTimeoutPolicy } from './types.ts';
22

3-
// Request-envelope constants, relocated from src/daemon/request-timeouts.ts when
3+
// Request-envelope constants, relocated from packages/daemon/src/request-timeouts.ts when
44
// timeout policy joined the descriptor registry (ADR 0008): the envelopes are now
55
// declared per command on the descriptors, so their values live beside them.
66

0 commit comments

Comments
 (0)