From 75736ae1ecaa1a4b9bf97e3747cae098805ce4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 14 Oct 2026 05:24:41 +0200 Subject: [PATCH 01/14] refactor(move): move every daemon file into its layer folder Codemod-only: 662 renames of packages/daemon/src files under the five layer folders (core, resources, execution, sessions, server), with every relative specifier, path mention, and package-manifest entry retargeted by the same pass. The map is the layer-manifest claim plus deterministic owner-layer rules for tests and support files; two support-only tests fall to core, and the one fixture a testing pattern consumes across layer folders follows its pattern's members so ./testing/interaction/internal/__tests__/* keeps a single target. The former transport folder does not fold onto its layer's name: the map places it at server/http/, so the package never carries a server/server path. The narrowed facade keeps every export KEY and rewrites only TARGETS: 107 named entries follow their file, and the four ./testing//* pattern folders follow the folder their consumed members move into. Importers outside the package are untouched. Generated with assistance. --- .device-evidence/CHECKLIST.md | 4 +- .fallowrc.json | 6 +- AGENTS.md | 6 +- docs/adr/0003-daemon-command-registry.md | 4 +- .../adr/0004-ios-snapshot-backend-strategy.md | 4 +- docs/adr/0008-command-descriptor-registry.md | 2 +- docs/adr/0012-interactive-replay.md | 30 +- docs/adr/0014-session-ref-frame-lifetime.md | 2 +- .../0016-active-session-script-publication.md | 4 +- docs/adr/0018-unified-event-journal.md | 6 +- .../0019-request-bound-platform-runtime.md | 4 +- .../0022-daemon-platform-runtime-coupling.md | 4 +- docs/adr/0023-end-state-hop-trace.md | 82 ++-- docs/adr/0033-collocation-decision-table.md | 2 +- docs/agents/cli-flags.md | 2 +- docs/agents/testing.md | 2 +- fallow-baselines/health.json | 20 +- oxlint.config.ts | 4 +- .../src/internal/__tests__/step-loop.test.ts | 2 +- .../ad-script/src/internal/open-script.ts | 2 +- .../src/mobile-snapshot-semantics.test.ts | 2 +- .../src/mobile-snapshot-semantics.ts | 2 +- packages/capture-kit/src/snapshot-chrome.ts | 2 +- packages/command-registry/src/registry.ts | 28 +- packages/contracts/src/app-state.ts | 2 +- packages/contracts/src/clipboard.ts | 2 +- packages/contracts/src/device.ts | 4 +- .../src/dispatch-disclosure.fixtures.ts | 2 +- .../contracts/src/interaction-guarantees.ts | 14 +- packages/contracts/src/interaction.ts | 2 +- packages/contracts/src/keyboard.ts | 2 +- .../src/daemon-policy-file.ts | 2 +- .../daemon-contracts/src/daemon-resolution.ts | 2 +- packages/daemon/package.json | 444 +++++++++--------- .../android-observation-fixture.ts | 0 .../application-lifecycle-runtime-fixture.ts | 0 .../application-lifecycle-runtime-harness.ts | 2 +- .../__tests__/support/device-claim-store.ts | 2 +- .../{ => support}/device-selection-stub.ts | 0 .../handlers}/session-command-harness.ts | 8 +- .../support/handlers}/session-test-harness.ts | 22 +- .../handlers}/snapshot-handler.fixtures.ts | 14 +- .../{ => support}/human-control-fixtures.ts | 4 +- .../human-control-router-fixture.ts | 16 +- .../legacy-snapshot-capture-fixture.ts | 2 +- .../platform-resource-cleanup-fixture.ts | 2 +- .../platform-services-fixture.ts | 6 +- .../provider-device-admission-fixture.ts | 2 +- .../request-router-dispatch-mocks.ts | 0 .../runtime-binding-conformance.ts | 30 +- .../support/screen-recording-live-handle.ts | 2 +- .../screenshot-runtime-fixture.ts | 4 +- .../{ => support}/selector-capture-fixture.ts | 6 +- .../__tests__/support/session-factories.ts | 4 +- .../internal}/network-runtime-harness.ts | 2 +- .../session-teardown.fixtures.ts | 4 +- .../{ => support}/snapshot-runtime-fixture.ts | 10 +- .../src/__tests__/support/store-factory.ts | 4 +- .../test-device-runtime-gateway.ts | 12 +- .../unavailable-device-runtime-gateway.ts | 2 +- .../audio-probe-resource-recovery.test.ts | 0 ...pture-disclosure-target-activation-fact.ts | 0 ...pture-disclosure-target-activation.test.ts | 0 .../src/{ => core}/__tests__/config.test.ts | 0 .../src/{ => core}/__tests__/context.test.ts | 0 .../__tests__/daemon-command-registry.test.ts | 0 .../__tests__/daemon-policy.test.ts | 14 +- .../__tests__/daemon-request-wire.test.ts | 0 .../deferred-interaction-outcome.test.ts | 0 .../__tests__/direct-ios-selector.test.ts | 0 .../__tests__/execution-plan.test.ts | 2 +- .../interaction-surface-signature.test.ts | 2 +- .../__tests__/interactor-resolution.test.ts | 0 .../__tests__/ios-comparison-key-fixture.ts | 0 .../__tests__/is-predicates.test.ts | 0 .../__tests__/lease-context.test.ts | 0 .../managed-session-artifact-path.test.ts | 0 .../__tests__/moving-target-baseline.test.ts | 0 .../post-gesture-no-effect-claim.test.ts | 0 .../post-gesture-stabilization-fixtures.ts | 0 ...post-gesture-stabilization-verdict.test.ts | 0 .../post-gesture-stabilization.test.ts | 0 .../provider-device-admission.test.ts | 0 .../__tests__/recording-gestures.test.ts | 4 +- .../__tests__/recording-timing.test.ts | 0 .../{ => core}/__tests__/ref-frame.test.ts | 0 .../__tests__/request-dispatch-ledger.test.ts | 0 .../request-runtime-binding-router.test.ts | 8 +- .../__tests__/request-runtime-binding.test.ts | 2 +- .../runtime-operation-effects.test.ts | 0 .../__tests__/runtime-session.test.ts | 4 +- ...screen-recording-resource-recovery.test.ts | 2 +- .../selector-operation-binding.test.ts | 0 .../selector-recording-find-data.test.ts | 0 .../__tests__/selector-recording.test.ts | 2 +- .../__tests__/session-action-recorder.test.ts | 2 +- .../__tests__/session-artifact-paths.test.ts | 0 .../__tests__/session-capture-binding.test.ts | 4 +- .../session-runtime-admission.test.ts | 2 +- .../session-script-active-publication.test.ts | 0 .../session-script-publication-state.test.ts | 0 .../__tests__/session-script-writer.test.ts | 2 +- .../__tests__/session-selector.test.ts | 2 +- .../session-snapshot-freshness.test.ts | 0 .../__tests__/session-store-lifetime.test.ts | 4 +- .../__tests__/session-store.test.ts | 4 +- .../settle-observation-capture.test.ts | 6 +- .../__tests__/snapshot-capture.test.ts | 4 +- .../snapshot-interactor-capture.test.ts | 0 .../snapshot-runtime-binding.test.ts | 10 +- .../__tests__/tenant-owned-entry.test.ts | 0 .../src/{ => core}/capture-disclosure.ts | 0 packages/daemon/src/{ => core}/config.ts | 0 packages/daemon/src/{ => core}/context.ts | 0 .../src/{ => core}/daemon-command-registry.ts | 0 .../daemon/src/{ => core}/daemon-policy.ts | 0 .../daemon/src/{ => core}/daemon-request.ts | 0 .../deferred-interaction-outcome.ts | 0 .../src/{ => core}/device/device-ready.ts | 0 .../device/device-selector-intent.ts | 0 .../src/{ => core}/direct-ios-selector.ts | 0 .../daemon/src/{ => core}/dispatch-context.ts | 0 .../daemon/src/{ => core}/execution-plan.ts | 0 .../{ => core}/fill-backend-result.test.ts | 0 .../src/{ => core}/fill-backend-result.ts | 0 .../src/{ => core}/generic-leaf-execution.ts | 0 .../daemon/src/{ => core}/gesture-runtime.ts | 0 .../interaction-surface-signature.ts | 0 ...nteraction-touch-direct-ios-eligibility.ts | 0 .../{ => core}/interaction/internal/types.ts | 0 .../src/{ => core}/interactor-resolution.ts | 0 .../{ => core}/ios-app-session-hint.test.ts | 2 +- .../src/{ => core}/ios-app-session-hint.ts | 0 .../daemon/src/{ => core}/lease-context.ts | 0 .../managed-session-artifact-path.ts | 0 .../{ => core}/platform-owner-lifecycle.ts | 0 .../{ => core}/platform-resource-cleanup.ts | 0 .../src/{ => core}/platform-services.ts | 0 .../{ => core}/provider-device-admission.ts | 0 .../{ => core}/recording-gesture-events.ts | 0 .../src/{ => core}/recording-gestures.ts | 0 .../daemon/src/{ => core}/recording-timing.ts | 0 .../daemon/src/{ => core}/recording-values.ts | 0 .../daemon/src/{ => core}/ref-frame-slot.ts | 0 packages/daemon/src/{ => core}/ref-frame.ts | 0 .../src/{ => core}/request-dispatch-ledger.ts | 0 .../src/{ => core}/request-runtime-binding.ts | 0 .../src/{ => core}/runtime-admission.ts | 0 .../{ => core}/runtime-operation-effects.ts | 0 .../daemon/src/{ => core}/runtime-session.ts | 0 .../{ => core}/selector-operation-binding.ts | 0 .../src/{ => core}/selector-recording.ts | 0 .../src/{ => core}/session-action-recorder.ts | 0 .../src/{ => core}/session-artifact-paths.ts | 0 .../src/{ => core}/session-capture-binding.ts | 0 .../{ => core}/session-idle-tombstone.test.ts | 0 .../src/{ => core}/session-idle-tombstone.ts | 0 .../{ => core}/session-recovery-hints.test.ts | 2 +- .../src/{ => core}/session-recovery-hints.ts | 0 .../{ => core}/session-replay-transaction.ts | 0 .../{ => core}/session-runtime-admission.ts | 0 .../session-script-active-publication.ts | 0 .../session-script-publication-capability.ts | 0 .../session-script-publication-state.ts | 0 .../src/{ => core}/session-script-writer.ts | 0 .../daemon/src/{ => core}/session-selector.ts | 0 .../{ => core}/session-snapshot-freshness.ts | 0 .../daemon/src/{ => core}/session-state.ts | 4 +- .../daemon/src/{ => core}/session-store.ts | 0 .../src/{ => core}/session-tenant-scope.ts | 0 .../{ => core}/settle-observation-capture.ts | 0 .../daemon/src/{ => core}/snapshot-capture.ts | 0 .../{ => core}/snapshot-interactor-capture.ts | 0 .../{ => core}/snapshot-runtime-binding.ts | 0 .../snapshot-runtime-capture-input.ts | 0 .../daemon/src/{ => core}/snapshot-session.ts | 0 .../src/{ => core}/tenant-owned-entry.ts | 0 .../daemon/src/{ => core}/touch-runtime.ts | 0 .../__tests__/android-owner-seam.test.ts | 6 +- .../android-system-dialog-occlusion.test.ts | 6 +- .../android-system-dialog-ref-frame.test.ts | 8 +- .../__tests__/android-system-dialog.test.ts | 6 +- .../__tests__/back-runtime.test.ts | 20 +- .../__tests__/focus-runtime.test.ts | 20 +- .../__tests__/fold-runtime.test.ts | 12 +- ...generic-route-runtime-completeness.test.ts | 0 .../interaction-get-runtime-fixture.ts | 10 +- ...eraction-surface-baseline-evidence.test.ts | 2 +- .../__tests__/internal-observation.test.ts | 6 +- .../__tests__/keyboard-runtime.test.ts | 4 +- .../__tests__/offscreen-target-probe.test.ts | 2 +- .../__tests__/orientation-runtime.test.ts | 22 +- .../ref-snapshot-flag-policy.test.ts | 0 .../__tests__/runtime-policy.test.ts | 0 .../__tests__/screenshot-crop-target.test.ts | 0 .../__tests__/screenshot-crop.test.ts | 6 +- .../__tests__/scroll-movement.test.ts | 4 +- .../__tests__/scroll-runtime.test.ts | 16 +- .../selector-capture-binding.test.ts | 10 +- .../selector-capture-runtime.test.ts | 8 +- .../__tests__/selector-text-runtime.test.ts | 0 .../__tests__/session-snapshot.test.ts | 6 +- .../__tests__/system-button-runtime.test.ts | 20 +- .../__tests__/tv-remote-runtime.test.ts | 20 +- .../__tests__/type-text-runtime.test.ts | 6 +- .../__tests__/viewport-runtime.test.ts | 20 +- .../android-foreground-surface.ts | 4 +- .../android-snapshot-timeout-evidence.ts | 8 +- .../{ => execution}/android-system-dialog.ts | 6 +- .../src/{ => execution}/app-event-runtime.ts | 6 +- .../src/{ => execution}/app-events.test.ts | 0 .../daemon/src/{ => execution}/app-events.ts | 0 .../src/{ => execution}/apps-runtime.ts | 0 .../src/{ => execution}/back-runtime.ts | 8 +- .../src/{ => execution}/focus-runtime.ts | 8 +- .../src/{ => execution}/fold-runtime.ts | 4 +- .../generic-runtime-execution.ts | 8 +- .../src/{ => execution}/generic-settle.ts | 14 +- .../handlers/__tests__/react-native.test.ts | 12 +- .../__tests__/session-clipboard.test.ts | 6 +- .../session-selector-dispatch.test.ts | 16 +- .../handlers/__tests__/snapshot-alert.test.ts | 10 +- .../snapshot-settings-handler.test.ts | 26 +- .../{ => execution}/handlers/react-native.ts | 8 +- .../handlers/session-clipboard.ts | 18 +- .../handlers/session-selector-dispatch.ts | 22 +- .../handlers/snapshot-alert.ts | 22 +- .../handlers/snapshot-settings.ts | 20 +- .../src/{ => execution}/interaction/index.ts | 12 +- .../__tests__/find-handler-fixture.ts | 6 +- .../__tests__/find-match-ranking.test.ts | 0 .../__tests__/find-single-bind.test.ts | 12 +- .../find-target-activation-disclosure.test.ts | 16 +- .../__tests__/find-touch-runtime-fixture.ts | 10 +- .../internal/__tests__/find.test.ts | 8 +- .../gesture-runtime-bindings.fixtures.ts | 2 +- .../interaction-gesture-response.test.ts | 0 .../interaction-ios-tap-outcome-fixtures.ts | 0 .../interaction-recorded-input.test.ts | 0 .../__tests__/interaction-ref-policy.test.ts | 2 +- ...action-response-construction-guard.test.ts | 0 ...nteraction-response-data-transform.test.ts | 0 .../__tests__/interaction-runtime.test.ts | 2 +- .../interaction-snapshot-scope.test.ts | 8 +- .../__tests__/interaction-touch-fixtures.ts | 8 +- .../interaction-touch-reference-frame.test.ts | 8 +- .../interaction-touch-response.test.ts | 10 +- .../interaction-touch-targets.test.ts | 0 ...interaction-type-android-readiness.test.ts | 8 +- .../internal/find-match-ranking.ts | 0 .../internal/find-match-resolution.ts | 4 +- .../internal/find-target-capture.ts | 8 +- .../interaction/internal/find.ts | 22 +- .../internal/interaction-android-escape.ts | 2 +- .../internal/interaction-common.ts | 6 +- .../interaction/internal/interaction-flags.ts | 2 +- .../internal/interaction-gesture-response.ts | 0 .../internal/interaction-gesture.ts | 12 +- .../internal/interaction-ios-tap-outcome.ts | 10 +- .../internal/interaction-recorded-input.ts | 0 .../internal/interaction-ref-policy.ts | 4 +- .../interaction-response-data-transform.ts | 0 .../internal/interaction-response.ts | 2 +- .../internal/interaction-runtime.ts | 30 +- .../internal/interaction-session.ts | 4 +- .../internal/interaction-snapshot.ts | 4 +- .../internal/interaction-targeting.ts | 0 .../interaction-touch-android-freshness.ts | 6 +- .../interaction-touch-android-readiness.ts | 6 +- .../internal/interaction-touch-direct-ios.ts | 12 +- .../internal/interaction-touch-fill.ts | 14 +- .../internal/interaction-touch-payload.ts | 0 .../internal/interaction-touch-policy.ts | 4 +- .../internal/interaction-touch-prepare.ts | 10 +- .../interaction-touch-press-admission.ts | 8 +- .../internal/interaction-touch-press.ts | 4 +- .../interaction-touch-reference-frame.ts | 8 +- .../internal/interaction-touch-response.ts | 4 +- .../internal/interaction-touch-runtime.ts | 12 +- .../internal/interaction-touch-targets.ts | 2 +- .../interaction/internal/interaction.ts | 10 +- .../{ => execution}/internal-observation.ts | 8 +- .../src/{ => execution}/keyboard-runtime.ts | 6 +- .../{ => execution}/offscreen-target-probe.ts | 4 +- .../{ => execution}/orientation-runtime.ts | 8 +- .../src/{ => execution}/ref-positionals.ts | 2 +- .../ref-snapshot-flag-policy.ts | 2 +- .../request-dispatch-disclosure.ts | 4 +- .../request-generic-dispatch.ts | 24 +- .../src/{ => execution}/runtime-artifacts.ts | 0 .../src/{ => execution}/runtime-policy.ts | 0 .../{ => execution}/screenshot-crop-target.ts | 0 .../src/{ => execution}/screenshot-crop.ts | 8 +- .../screenshot-runtime-binding.ts | 8 +- .../src/{ => execution}/screenshot-runtime.ts | 14 +- .../src/{ => execution}/scroll-movement.ts | 8 +- .../src/{ => execution}/scroll-runtime.ts | 10 +- .../src/{ => execution}/scroll-until.test.ts | 0 .../src/{ => execution}/scroll-until.ts | 0 .../selector-capture-binding.ts | 10 +- .../selector-capture-runtime.ts | 20 +- .../{ => execution}/selector-match-errors.ts | 2 +- .../selector-runtime-backend.ts | 22 +- .../src/{ => execution}/selector-runtime.ts | 10 +- .../{ => execution}/selector-text-runtime.ts | 4 +- .../src/{ => execution}/session-snapshot.ts | 8 +- .../snapshot-timeout-evidence.test.ts | 0 .../snapshot-timeout-evidence.ts | 0 .../sparse-fallback-screenshot.ts | 6 +- .../{ => execution}/system-button-runtime.ts | 8 +- .../src/{ => execution}/tv-remote-runtime.ts | 8 +- .../{ => execution}/type-target-warning.ts | 0 .../src/{ => execution}/type-text-runtime.ts | 6 +- .../src/{ => execution}/viewport-runtime.ts | 4 +- .../wait-current-surface.test.ts | 2 +- .../{ => execution}/wait-current-surface.ts | 12 +- .../src/{ => execution}/wait-runtime.ts | 12 +- .../app-log-admission-ledger.test.ts | 2 +- .../__tests__/app-log-files.test.ts | 0 .../app-log-resource-recovery.test.ts | 0 .../__tests__/app-log-resource-store.test.ts | 0 .../app-log-session-resource.test.ts | 6 +- .../__tests__/app-log-start-preflight.test.ts | 2 +- .../{ => resources}/__tests__/app-log.test.ts | 0 .../filesystem-boundary-faults.test.ts | 8 +- .../__tests__/lease-in-flight-work.test.ts | 0 .../__tests__/lease-registry-scope.test.ts | 2 +- .../__tests__/lease-registry.test.ts | 2 +- .../__tests__/macos-app-lease.test.ts | 6 +- .../session-device-resolution.test.ts | 12 +- .../app-log-admission-ledger.ts | 0 .../src/{ => resources}/app-log-files.ts | 0 .../app-log-resource-recovery.ts | 0 .../{ => resources}/app-log-resource-store.ts | 0 .../app-log-session-resource.ts | 6 +- .../app-log-start-preflight.ts | 0 .../daemon/src/{ => resources}/app-log.ts | 0 .../src/{ => resources}/artifact-tracking.ts | 2 +- .../__tests__/device-claim-admission.test.ts | 10 +- .../__tests__/device-claim-conflict.test.ts | 0 .../__tests__/device-claim-prune.test.ts | 0 .../__tests__/device-claim-reboot.test.ts | 0 .../__tests__/device-claim-record.test.ts | 0 .../__tests__/device-claim-rule.test.ts | 0 .../__tests__/device-claim-settlement.test.ts | 0 .../device/__tests__/device-claims.test.ts | 0 .../__tests__/device-mutation-drain.test.ts | 2 +- .../device/claim-recovery-gateway.ts | 0 .../device/device-claim-admission.ts | 0 .../device/device-claim-conflict.ts | 2 +- .../device/device-claim-inspection.ts | 0 .../device/device-claim-paths.ts | 0 .../device/device-claim-reboot.ts | 0 .../device/device-claim-record.ts | 0 .../device/device-claim-rule.ts | 0 .../device/device-claim-settlement.ts | 0 .../device/device-claim-store.ts | 0 .../{ => resources}/device/device-claims.ts | 0 .../device/device-mutation-drain.ts | 0 .../{ => resources}/human-control-contract.ts | 0 .../{ => resources}/lease-in-flight-work.ts | 0 .../{ => resources}/lease-registry-scope.ts | 2 +- .../src/{ => resources}/lease-registry.ts | 0 .../src/{ => resources}/macos-app-lease.ts | 6 +- .../provider-session-ownership.ts | 0 .../session-device-resolution.ts | 12 +- .../application-lifecycle-recovery.test.ts | 2 +- .../__tests__/artifact-archive.test.ts | 0 .../atomic-publish-ownership.test.ts | 0 .../__tests__/daemon-runtime-app-log.test.ts | 14 +- .../__tests__/daemon-stop.test.ts | 0 .../__tests__/host-lease-http.test.ts | 4 +- .../http-server-artifacts.coverage.ts | 0 .../__tests__/http-server-artifacts.test.ts | 6 +- .../http-server-rpc-admission.test.ts | 2 +- .../http-server-rpc-handler-failure.test.ts | 0 .../http-server-rpc-invalid-body.test.ts | 2 +- .../http-server-rpc-lifetime.test.ts | 2 +- .../http-server-rpc-unowned-failure.test.ts | 2 +- .../http-server-rpc-validation.test.ts | 8 +- .../__tests__/http-server-rpc.fixtures.ts | 4 +- .../http-server-tenant-trust.test.ts | 6 +- .../__tests__/human-control-http.test.ts | 10 +- .../__tests__/provider-lease-expiry.test.ts | 2 +- .../__tests__/replay-device-selection.test.ts | 0 .../request-diagnostics-http.test.ts | 8 +- .../__tests__/request-execution-locks.test.ts | 0 ...quest-execution-scope-lease-expiry.test.ts | 10 +- ...st-execution-scope-macos-app-lease.test.ts | 10 +- ...t-execution-scope-open-device-wait.test.ts | 12 +- .../__tests__/request-execution-scope.test.ts | 18 +- .../__tests__/request-finalization.test.ts | 4 +- .../__tests__/request-lease-work.test.ts | 6 +- .../request-lock-identity-policy.test.ts | 6 +- .../__tests__/request-lock-policy.test.ts | 4 +- .../request-router-apps-admission.test.ts | 10 +- .../request-router-artifacts-web.test.ts | 12 +- .../__tests__/request-router-cost.test.ts | 14 +- ...request-router-custom-action-flags.test.ts | 8 +- .../request-router-developer-dir.test.ts | 8 +- .../request-router-error-redaction.test.ts | 12 +- .../__tests__/request-router-events.test.ts | 10 +- .../request-router-idle-expired.test.ts | 10 +- .../request-router-open-claim.test.ts | 20 +- .../__tests__/request-router-open-harness.ts | 2 +- .../__tests__/request-router-open.test.ts | 24 +- .../request-router-record-flags.test.ts | 8 +- .../request-router-repair-expired.test.ts | 20 +- .../request-router-replay-env.test.ts | 8 +- .../request-router-response-level.test.ts | 14 +- .../request-router-session-address.test.ts | 20 +- .../request-router-typed-error.test.ts | 20 +- .../request-save-script-policy.test.ts | 4 +- .../request-save-script-transports.test.ts | 24 +- .../__tests__/response-views.test.ts | 2 +- .../__tests__/resumable-upload-range.test.ts | 0 .../__tests__/resumable-upload.test.ts | 0 .../__tests__/server-shutdown.test.ts | 4 +- .../__tests__/session-idle-expiry-harness.ts | 14 +- .../__tests__/session-idle-expiry.test.ts | 6 +- .../src/{ => server}/__tests__/upload.test.ts | 0 .../application-lifecycle-recovery.ts | 4 +- .../src/{ => server}/artifact-archive.ts | 0 .../src/{ => server}/artifact-download.ts | 0 .../daemon/src/{ => server}/daemon-stop.ts | 0 .../device-claim-owner-recovery.test.ts | 2 +- .../device/device-claim-owner-recovery.ts | 8 +- .../downloadable-artifact-http.ts | 4 +- .../src/{ => server}/host-lease-http.ts | 6 +- .../daemon/src/{ => server}/http-errors.ts | 0 .../src/{ => server}/http-request-target.ts | 0 .../{ => http}/daemon-lease-finalizer.test.ts | 2 +- .../{ => http}/daemon-lease-finalizer.ts | 4 +- .../{ => http}/daemon-metadata-loss.test.ts | 0 .../server/{ => http}/daemon-metadata-loss.ts | 0 .../daemon-runtime-device-claims.test.ts | 12 +- .../src/server/{ => http}/daemon-runtime.ts | 44 +- ...mon-session-idle-expiry-scheduling.test.ts | 2 +- .../daemon-session-idle-expiry.test.ts | 6 +- .../{ => http}/daemon-session-idle-expiry.ts | 6 +- .../{ => http}/daemon-shutdown-claims.test.ts | 10 +- .../{ => http}/daemon-shutdown-claims.ts | 4 +- .../{ => http}/http-authorization.test.ts | 2 +- .../server/{ => http}/http-authorization.ts | 10 +- .../http-instance-precondition.test.ts | 0 .../{ => http}/http-instance-precondition.ts | 0 .../server/{ => http}/http-rpc-envelope.ts | 0 .../src/server/{ => http}/http-rpc-methods.ts | 2 +- .../src/server/{ => http}/http-server.ts | 4 +- .../src/server/{ => http}/server-lifecycle.ts | 0 .../src/server/{ => http}/server-shutdown.ts | 0 .../src/server/{ => http}/tenant-trust.ts | 0 .../daemon/src/server/{ => http}/transport.ts | 2 +- .../src/{ => server}/human-control-http.ts | 4 +- .../{ => server}/platform-request-scope.ts | 2 +- .../src/{ => server}/provider-lease-expiry.ts | 2 +- .../{ => server}/replay-device-selection.ts | 2 +- .../src/{ => server}/request-binding.ts | 8 +- .../{ => server}/request-diagnostics-http.ts | 4 +- .../{ => server}/request-execution-locks.ts | 0 .../{ => server}/request-execution-scope.ts | 48 +- .../src/{ => server}/request-finalization.ts | 4 +- .../src/{ => server}/request-lease-work.ts | 6 +- .../src/{ => server}/request-lock-policy.ts | 12 +- .../request-platform-provider-context.ts | 8 +- .../daemon/src/{ => server}/request-router.ts | 38 +- .../request-save-script-policy.ts | 4 +- .../daemon/src/{ => server}/response-views.ts | 2 +- .../{ => server}/resumable-upload-range.ts | 0 .../{ => server}/resumable-upload-transfer.ts | 0 .../src/{ => server}/resumable-upload.ts | 2 +- .../src/{ => server}/session-idle-expiry.ts | 6 +- .../daemon/src/{ => server}/upload-http.ts | 4 +- packages/daemon/src/{ => server}/upload.ts | 0 .../install-source-resolution.test.ts | 4 +- .../__tests__/lease-lifecycle.test.ts | 8 +- .../materialized-path-registry.test.ts | 0 .../open-device-contention-wait.test.ts | 8 +- .../replay-session-fixture.ts | 2 +- ...eplay-divergence-android-occlusion.test.ts | 10 +- ...n-replay-divergence-capture-policy.test.ts | 10 +- ...on-replay-divergence-chrome-filter.test.ts | 10 +- ...sion-replay-divergence-observation.test.ts | 10 +- .../session-replay-divergence-overlay.test.ts | 12 +- ...sion-replay-divergence-publication.test.ts | 14 +- ...sion-replay-divergence-suggestions.test.ts | 10 +- ...on-replay-maestro-error-projection.test.ts | 6 +- .../session-replay-maestro-failure.test.ts | 12 +- ...n-replay-maestro-remote-evalscript.test.ts | 16 +- ...ion-replay-maestro-session-address.test.ts | 6 +- ...on-replay-runtime-maestro-dispatch.test.ts | 6 +- ...on-replay-runtime-maestro-keyboard.test.ts | 0 ...on-replay-runtime-maestro-run-flow.test.ts | 0 ...-replay-runtime-maestro-run-script.test.ts | 0 ...ay-runtime-maestro-shell-artifacts.test.ts | 2 +- ...ssion-replay-runtime-maestro-swipe.test.ts | 0 ...n-replay-runtime-maestro-targeting.test.ts | 0 ...session-replay-runtime-maestro.fixtures.ts | 10 +- .../session-replay-repair-acceptance.test.ts | 16 +- .../session-replay-repair-empty-tail.test.ts | 16 +- .../session-replay-repair-loop.test.ts | 22 +- ...ion-replay-repair-record-exclusion.test.ts | 20 +- ...-repair-transaction-close-ordering.test.ts | 16 +- ...on-replay-repair-transaction-force.test.ts | 24 +- ...sion-replay-repair-transaction.fixtures.ts | 10 +- .../session-replay-repair-transaction.test.ts | 16 +- .../session-replay-repair.fixtures.test.ts | 4 +- .../session-replay-repair.fixtures.ts | 14 +- .../replay-runtime/application.test.ts | 12 +- .../replay-runtime/replay-command-fixture.ts | 4 +- .../session-replay-action-runtime.test.ts | 6 +- .../session-replay-resume.test.ts | 4 +- ...ion-replay-runtime-artifact-ledger.test.ts | 4 +- .../session-replay-runtime-binding.test.ts | 10 +- ...on-replay-runtime-failure-response.test.ts | 10 +- .../session-replay-runtime-failure.test.ts | 12 +- ...ession-replay-runtime-keep-session.test.ts | 6 +- .../session-replay-runtime-plan.test.ts | 10 +- .../session-replay-runtime.fixtures.ts | 6 +- .../session-replay-runtime.test.ts | 14 +- .../session-replay-script-source.test.ts | 10 +- .../session-test-command-trust.test.ts | 4 +- .../session-test-fail-fast.test.ts | 8 +- .../replay-suite/session-test-runner.test.ts | 10 +- .../session-test-source-discovery.test.ts | 0 ...on-test-suite-command-cancellation.test.ts | 0 ...on-test-suite-command-nested-flags.test.ts | 0 ...est-suite-command-remote-artifacts.test.ts | 2 +- .../session-test-suite-command-video.test.ts | 10 +- .../session-test-suite-infrastructure.test.ts | 10 +- .../session-test-suite.fixtures.ts | 4 +- .../replay-suite/session-test-suite.test.ts | 14 +- ...sion-replay-dispatch-selector-miss.test.ts | 12 +- .../session-replay-scenario.fixtures.ts | 6 +- .../session-replay-selector-routes.test.ts | 10 +- ...replay-target-verification-runtime.test.ts | 6 +- .../__tests__/request-admission.test.ts | 6 +- .../__tests__/request-handler-catalog.test.ts | 18 +- ...quest-handler-chain-provider-scope.test.ts | 14 +- .../request-recording-health.test.ts | 12 +- ...e-binding-conformance-completeness.test.ts | 2 +- .../__tests__/session-idle-activity.test.ts | 14 +- .../__tests__/session-routing.test.ts | 6 +- .../__tests__/session-runtime.test.ts | 0 .../__tests__/session-teardown-budget.test.ts | 6 +- ...shot-custom-actions-platform-guard.test.ts | 12 +- .../__tests__/snapshot-diff.test.ts | 0 .../snapshot-publication-membership.test.ts | 0 .../__tests__/snapshot-scope-ref.test.ts | 4 +- .../application-lifecycle-execution.ts | 6 +- .../device-claim-reconciliation.test.ts | 4 +- .../device/device-claim-reconciliation.ts | 8 +- .../{ => sessions}/device/device-targets.ts | 0 .../{ => sessions}/dispatch-payload.test.ts | 0 .../src/{ => sessions}/dispatch-payload.ts | 0 .../handlers/__tests__/human-control.test.ts | 8 +- .../handlers/__tests__/install-source.test.ts | 10 +- .../__tests__/lease-artifacts.test.ts | 6 +- .../handlers/__tests__/lease.test.ts | 8 +- .../__tests__/record-runtime-request.test.ts | 0 .../__tests__/record-runtime-response.test.ts | 0 .../__tests__/record-runtime-start.test.ts | 0 .../record-runtime-stop-recovery.test.ts | 0 .../__tests__/record-runtime.fixtures.ts | 10 +- .../session-appstate-device-runtime.test.ts | 6 +- .../__tests__/session-appstate-input.test.ts | 14 +- .../__tests__/session-appstate.test.ts | 6 +- ...ession-boot-shutdown-device-claims.test.ts | 20 +- .../__tests__/session-boot-warmup.test.ts | 8 +- .../handlers/__tests__/session-boot.test.ts | 10 +- .../__tests__/session-command-replay.test.ts | 10 +- .../__tests__/session-device-claims.test.ts | 26 +- .../session-device-status-response.test.ts | 0 .../session-doctor-app-runtime.test.ts | 6 +- .../__tests__/session-doctor-device.test.ts | 2 +- .../__tests__/session-doctor-metro.test.ts | 0 .../__tests__/session-doctor-options.test.ts | 4 +- .../session-install-source-ref-frame.test.ts | 16 +- .../__tests__/session-prepare.test.ts | 6 +- .../__tests__/session-push-ref-frame.test.ts | 16 +- .../handlers/__tests__/session-push.test.ts | 12 +- .../__tests__/session-reinstall.test.ts | 16 +- .../__tests__/session-relaunch-guards.test.ts | 10 +- .../__tests__/session-replay-command.test.ts | 12 +- .../__tests__/session-runtime-command.test.ts | 16 +- .../session-runtime-port-reverse.test.ts | 4 +- .../session-script-publication.test.ts | 12 +- .../__tests__/session-shutdown.test.ts | 10 +- .../__tests__/session-trigger.test.ts | 10 +- .../handlers/__tests__/session.test.ts | 10 +- .../handlers/__tests__/snapshot.test.ts | 0 .../handlers/__tests__/trace-runtime.test.ts | 6 +- .../{ => sessions}/handlers/human-control.ts | 6 +- .../src/{ => sessions}/handlers/lease.ts | 14 +- .../handlers/record-runtime-request.ts | 2 +- .../handlers/record-runtime-response.ts | 2 +- .../{ => sessions}/handlers/record-runtime.ts | 16 +- .../{ => sessions}/handlers/record-trace.ts | 8 +- .../handlers/session-app-deployment-route.ts | 8 +- .../handlers/session-app-deployment.ts | 20 +- .../handlers/session-app-source-deployment.ts | 18 +- .../session-appstate-apple-session.ts | 6 +- .../session-appstate-device-runtime.ts | 6 +- .../handlers/session-appstate.ts | 6 +- .../{ => sessions}/handlers/session-batch.ts | 2 +- .../{ => sessions}/handlers/session-boot.ts | 8 +- .../handlers/session-command-input.ts | 16 +- .../session-device-status-response.ts | 2 +- .../handlers/session-doctor-app.ts | 2 +- .../handlers/session-doctor-device.ts | 4 +- .../handlers/session-doctor-metro.ts | 0 .../handlers/session-doctor-options.ts | 6 +- .../handlers/session-doctor-output.ts | 0 .../handlers/session-doctor-types.ts | 0 .../{ => sessions}/handlers/session-doctor.ts | 12 +- .../handlers/session-prepare.ts | 14 +- .../handlers/session-replay-command.ts | 20 +- .../handlers/session-replay-video-owner.ts | 8 +- .../handlers/session-runtime-command.ts | 18 +- .../handlers/session-runtime-port-reverse.ts | 12 +- .../handlers/session-script-publication.ts | 10 +- .../handlers/session-shutdown.ts | 6 +- .../src/{ => sessions}/handlers/session.ts | 10 +- .../handlers/snapshot-runtime-route.test.ts | 8 +- .../src/{ => sessions}/handlers/snapshot.ts | 18 +- .../{ => sessions}/handlers/trace-runtime.ts | 8 +- .../install-source-resolution.ts | 4 +- .../src/{ => sessions}/lease-lifecycle.ts | 14 +- .../materialized-path-registry.ts | 2 +- .../open-device-contention-wait.ts | 6 +- .../src/{ => sessions}/payload-input.ts | 0 .../src/{ => sessions}/request-admission.ts | 18 +- .../{ => sessions}/request-handler-chain.ts | 36 +- .../request-recording-health.ts | 6 +- .../src/{ => sessions}/route-owner-files.ts | 18 +- .../server/daemon-idle-reap.test.ts | 8 +- .../{ => sessions}/server/daemon-idle-reap.ts | 6 +- .../__tests__/application.test.ts | 8 +- .../{ => sessions}/session-lifecycle/index.ts | 0 ...on-capabilities-install-projection.test.ts | 12 +- .../session-capabilities.fixtures.ts | 2 +- .../__tests__/session-capabilities.test.ts | 12 +- ...session-close-cwd-scoped-resources.test.ts | 6 +- .../session-close-error-precedence.test.ts | 4 +- .../session-close-lifecycle-runtime.test.ts | 18 +- .../session-close-resource-cleanup.test.ts | 6 +- .../session-close-save-script.test.ts | 4 +- .../__tests__/session-close-script.test.ts | 6 +- .../session-close-shutdown-platform.test.ts | 4 +- .../session-close-shutdown.fixtures.ts | 20 +- .../session-devices-batch-runtime.test.ts | 12 +- .../session-inventory-appleos.test.ts | 6 +- .../session-inventory-apps-runtime.test.ts | 8 +- .../session-inventory-harmonyos.test.ts | 8 +- .../session-inventory-scoped-paths.test.ts | 10 +- .../session-open-device-in-use.test.ts | 6 +- .../session-open-execution-runtime.test.ts | 14 +- .../__tests__/session-open-existing.test.ts | 10 +- .../__tests__/session-open-foreground.test.ts | 6 +- .../session-open-runtime.fixtures.ts | 6 +- .../__tests__/session-open-runtime.test.ts | 14 +- .../__tests__/session-open-state.test.ts | 4 +- .../__tests__/session-open-surface.test.ts | 0 .../__tests__/session-open-warnings.test.ts | 0 .../session-teardown-resources.test.ts | 2 +- .../session-lifecycle/internal/inventory.ts | 26 +- .../session-close-lifecycle-teardown.ts | 8 +- .../session-close-runtime-admission.ts | 8 +- .../internal/session-close-script.ts | 12 +- .../internal/session-close.ts | 24 +- .../internal/session-open-execution.ts | 24 +- .../internal/session-open-foreground.ts | 10 +- .../internal/session-open-prepare.ts | 10 +- .../internal/session-open-state.ts | 10 +- .../internal/session-open-surface.ts | 2 +- .../internal/session-open-warnings.ts | 0 .../internal/session-open.ts | 20 +- .../internal/session-startup-metrics.ts | 0 .../__tests__/application.test.ts | 8 +- .../__tests__/session-audio.coverage.ts | 0 .../session-observability/index.ts | 0 .../internal/__tests__/session-audio.test.ts | 8 +- .../internal/__tests__/session-logs.test.ts | 16 +- ...session-network-runtime-parity-fixtures.ts | 0 .../session-network-runtime-parity.test.ts | 12 +- .../__tests__/session-network.test.ts | 10 +- .../__tests__/session-observability.test.ts | 8 +- .../__tests__/session-perf-runtime.test.ts | 8 +- .../internal/session-audio.ts | 12 +- .../internal/session-network.ts | 8 +- .../internal/session-observability.ts | 20 +- .../internal/session-perf-runtime.ts | 14 +- .../session-replay-coordinator.ts | 8 +- .../src/{ => sessions}/session-routing.ts | 8 +- .../src/{ => sessions}/session-runtime.ts | 4 +- .../{ => sessions}/session-teardown-budget.ts | 2 +- .../src/{ => sessions}/session-teardown.ts | 10 +- .../snapshot-command-runtime.ts | 24 +- .../{ => sessions}/snapshot-diff-runtime.ts | 4 +- .../{ => sessions}/snapshot-quality-latch.ts | 4 +- .../src/{ => sessions}/snapshot-runtime.ts | 12 +- .../src/{ => sessions}/startup-deadline.ts | 0 .../src/{ => sessions}/web-session-names.ts | 4 +- packages/host-kit/src/code-signature.ts | 2 +- .../src/daemon-port/test-command.ts | 2 +- .../__tests__/session-test-runtime.test.ts | 2 +- .../__tests__/journal-request-input.test.ts | 2 +- .../test-kit/src/boundary-fault-matrix.ts | 4 +- scripts/__tests__/eager-closure-budgets.ts | 2 +- scripts/check-affected/device-lanes.test.ts | 6 +- scripts/check-affected/device-lanes.ts | 4 +- .../fallow-health-report.fixture.json | 2 +- scripts/depgraph/README.md | 6 +- scripts/depgraph/affected-run.ts | 4 +- scripts/depgraph/affected.test.ts | 14 +- scripts/depgraph/affected.ts | 2 +- scripts/depgraph/import-graph.ts | 2 +- scripts/depgraph/model.test.ts | 26 +- scripts/help-conformance-sample-outputs.mjs | 6 +- scripts/layering/architecture-ownership.ts | 14 +- scripts/layering/check.ts | 2 +- scripts/layering/daemon-client-entry.test.ts | 10 +- scripts/layering/daemon-client-entry.ts | 16 +- scripts/layering/daemon-modularity.test.ts | 84 ++-- scripts/layering/daemon-modularity.ts | 6 +- .../layering/daemon-platform-boundary.test.ts | 8 +- scripts/layering/daemon-platform-boundary.ts | 6 +- .../daemon-platform-runtime-inventory.test.ts | 2 +- scripts/layering/model.test.ts | 36 +- .../layering/platform-package-policy.test.ts | 12 +- scripts/layering/ratchet-reference.test.ts | 10 +- .../record-runtime-mechanics-policy.test.ts | 12 +- .../layering/runtime-execution-policy.test.ts | 2 +- scripts/layering/runtime-execution-policy.ts | 2 +- .../session-authority-overlay.test.ts | 20 +- scripts/layering/session-authority-overlay.ts | 6 +- .../session-resource-ownership.test.ts | 6 +- .../layering/session-resource-ownership.ts | 20 +- scripts/layering/session-state.test.ts | 14 +- scripts/layering/session-state.ts | 70 +-- .../snapshot-assembly-presentation-policy.ts | 2 +- scripts/mutation/modules.test.ts | 6 +- scripts/mutation/modules.ts | 4 +- scripts/mutation/ownership.test.ts | 6 +- scripts/mutation/test-scope.test.ts | 2 +- scripts/wire-compat/model.test.ts | 4 +- ...criptor-shutdown-runtime-execution.test.ts | 4 +- .../replay-coordinator-ownership.test.ts | 8 +- .../request-handler-chain.test.ts | 10 +- .../daemon-runtime-metadata-ownership.test.ts | 4 +- .../kernel/errors-code-policy.test.ts | 2 +- src/__tests__/kernel/errors-metadata.test.ts | 2 +- src/cli/__tests__/command-explain.test.ts | 16 +- src/daemon-composition.ts | 2 +- stryker.config.json | 2 +- .../command-coverage/declarations.ts | 30 +- test/integration/command-coverage/evidence.ts | 2 +- .../nightly/concurrency-torture/bindings.ts | 2 +- .../concurrency-torture/claim-registry.ts | 2 +- .../scroll-movement-observation.test.ts | 4 +- test/wire-compat/closure-policy.ts | 6 +- test/wire-compat/ledger.json | 150 +++--- test/wire-compat/surface.ts | 24 +- test/wire-compat/wire-mutations.test.ts | 20 +- 764 files changed, 2722 insertions(+), 2722 deletions(-) rename packages/daemon/src/__tests__/{ => support}/android-observation-fixture.ts (100%) rename packages/daemon/src/__tests__/{ => support}/application-lifecycle-runtime-fixture.ts (100%) rename packages/daemon/src/__tests__/{ => support}/application-lifecycle-runtime-harness.ts (99%) rename packages/daemon/src/__tests__/{ => support}/device-selection-stub.ts (100%) rename packages/daemon/src/{handlers/__tests__ => __tests__/support/handlers}/session-command-harness.ts (97%) rename packages/daemon/src/{handlers/__tests__ => __tests__/support/handlers}/session-test-harness.ts (92%) rename packages/daemon/src/{handlers/__tests__ => __tests__/support/handlers}/snapshot-handler.fixtures.ts (93%) rename packages/daemon/src/__tests__/{ => support}/human-control-fixtures.ts (92%) rename packages/daemon/src/__tests__/{ => support}/human-control-router-fixture.ts (73%) rename packages/daemon/src/__tests__/{ => support}/legacy-snapshot-capture-fixture.ts (96%) rename packages/daemon/src/__tests__/{ => support}/platform-services-fixture.ts (94%) rename packages/daemon/src/__tests__/{ => support}/request-router-dispatch-mocks.ts (100%) rename packages/daemon/src/__tests__/{ => support}/runtime-binding-conformance.ts (89%) rename packages/daemon/src/__tests__/{ => support}/screenshot-runtime-fixture.ts (97%) rename packages/daemon/src/__tests__/{ => support}/selector-capture-fixture.ts (94%) rename packages/daemon/src/{session-observability/internal/__tests__ => __tests__/support/session-observability/internal}/network-runtime-harness.ts (97%) rename packages/daemon/src/__tests__/{ => support}/session-teardown.fixtures.ts (94%) rename packages/daemon/src/__tests__/{ => support}/snapshot-runtime-fixture.ts (96%) rename packages/daemon/src/__tests__/{ => support}/test-device-runtime-gateway.ts (95%) rename packages/daemon/src/{ => core}/__tests__/audio-probe-resource-recovery.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/capture-disclosure-target-activation-fact.ts (100%) rename packages/daemon/src/{ => core}/__tests__/capture-disclosure-target-activation.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/config.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/context.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/daemon-command-registry.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/daemon-policy.test.ts (95%) rename packages/daemon/src/{ => core}/__tests__/daemon-request-wire.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/deferred-interaction-outcome.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/direct-ios-selector.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/execution-plan.test.ts (95%) rename packages/daemon/src/{ => core}/__tests__/interaction-surface-signature.test.ts (99%) rename packages/daemon/src/{ => core}/__tests__/interactor-resolution.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/ios-comparison-key-fixture.ts (100%) rename packages/daemon/src/{ => core}/__tests__/is-predicates.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/lease-context.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/managed-session-artifact-path.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/moving-target-baseline.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/post-gesture-no-effect-claim.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/post-gesture-stabilization-fixtures.ts (100%) rename packages/daemon/src/{ => core}/__tests__/post-gesture-stabilization-verdict.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/post-gesture-stabilization.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/provider-device-admission.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/recording-gestures.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/recording-timing.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/ref-frame.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/request-dispatch-ledger.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/request-runtime-binding-router.test.ts (95%) rename packages/daemon/src/{ => core}/__tests__/request-runtime-binding.test.ts (99%) rename packages/daemon/src/{ => core}/__tests__/runtime-operation-effects.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/runtime-session.test.ts (95%) rename packages/daemon/src/{ => core}/__tests__/screen-recording-resource-recovery.test.ts (97%) rename packages/daemon/src/{ => core}/__tests__/selector-operation-binding.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/selector-recording-find-data.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/selector-recording.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/session-action-recorder.test.ts (99%) rename packages/daemon/src/{ => core}/__tests__/session-artifact-paths.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/session-capture-binding.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/session-runtime-admission.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/session-script-active-publication.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/session-script-publication-state.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/session-script-writer.test.ts (99%) rename packages/daemon/src/{ => core}/__tests__/session-selector.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/session-snapshot-freshness.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/session-store-lifetime.test.ts (98%) rename packages/daemon/src/{ => core}/__tests__/session-store.test.ts (99%) rename packages/daemon/src/{ => core}/__tests__/settle-observation-capture.test.ts (95%) rename packages/daemon/src/{ => core}/__tests__/snapshot-capture.test.ts (97%) rename packages/daemon/src/{ => core}/__tests__/snapshot-interactor-capture.test.ts (100%) rename packages/daemon/src/{ => core}/__tests__/snapshot-runtime-binding.test.ts (87%) rename packages/daemon/src/{ => core}/__tests__/tenant-owned-entry.test.ts (100%) rename packages/daemon/src/{ => core}/capture-disclosure.ts (100%) rename packages/daemon/src/{ => core}/config.ts (100%) rename packages/daemon/src/{ => core}/context.ts (100%) rename packages/daemon/src/{ => core}/daemon-command-registry.ts (100%) rename packages/daemon/src/{ => core}/daemon-policy.ts (100%) rename packages/daemon/src/{ => core}/daemon-request.ts (100%) rename packages/daemon/src/{ => core}/deferred-interaction-outcome.ts (100%) rename packages/daemon/src/{ => core}/device/device-ready.ts (100%) rename packages/daemon/src/{ => core}/device/device-selector-intent.ts (100%) rename packages/daemon/src/{ => core}/direct-ios-selector.ts (100%) rename packages/daemon/src/{ => core}/dispatch-context.ts (100%) rename packages/daemon/src/{ => core}/execution-plan.ts (100%) rename packages/daemon/src/{ => core}/fill-backend-result.test.ts (100%) rename packages/daemon/src/{ => core}/fill-backend-result.ts (100%) rename packages/daemon/src/{ => core}/generic-leaf-execution.ts (100%) rename packages/daemon/src/{ => core}/gesture-runtime.ts (100%) rename packages/daemon/src/{ => core}/interaction-surface-signature.ts (100%) rename packages/daemon/src/{ => core}/interaction/internal/interaction-touch-direct-ios-eligibility.ts (100%) rename packages/daemon/src/{ => core}/interaction/internal/types.ts (100%) rename packages/daemon/src/{ => core}/interactor-resolution.ts (100%) rename packages/daemon/src/{ => core}/ios-app-session-hint.test.ts (97%) rename packages/daemon/src/{ => core}/ios-app-session-hint.ts (100%) rename packages/daemon/src/{ => core}/lease-context.ts (100%) rename packages/daemon/src/{ => core}/managed-session-artifact-path.ts (100%) rename packages/daemon/src/{ => core}/platform-owner-lifecycle.ts (100%) rename packages/daemon/src/{ => core}/platform-resource-cleanup.ts (100%) rename packages/daemon/src/{ => core}/platform-services.ts (100%) rename packages/daemon/src/{ => core}/provider-device-admission.ts (100%) rename packages/daemon/src/{ => core}/recording-gesture-events.ts (100%) rename packages/daemon/src/{ => core}/recording-gestures.ts (100%) rename packages/daemon/src/{ => core}/recording-timing.ts (100%) rename packages/daemon/src/{ => core}/recording-values.ts (100%) rename packages/daemon/src/{ => core}/ref-frame-slot.ts (100%) rename packages/daemon/src/{ => core}/ref-frame.ts (100%) rename packages/daemon/src/{ => core}/request-dispatch-ledger.ts (100%) rename packages/daemon/src/{ => core}/request-runtime-binding.ts (100%) rename packages/daemon/src/{ => core}/runtime-admission.ts (100%) rename packages/daemon/src/{ => core}/runtime-operation-effects.ts (100%) rename packages/daemon/src/{ => core}/runtime-session.ts (100%) rename packages/daemon/src/{ => core}/selector-operation-binding.ts (100%) rename packages/daemon/src/{ => core}/selector-recording.ts (100%) rename packages/daemon/src/{ => core}/session-action-recorder.ts (100%) rename packages/daemon/src/{ => core}/session-artifact-paths.ts (100%) rename packages/daemon/src/{ => core}/session-capture-binding.ts (100%) rename packages/daemon/src/{ => core}/session-idle-tombstone.test.ts (100%) rename packages/daemon/src/{ => core}/session-idle-tombstone.ts (100%) rename packages/daemon/src/{ => core}/session-recovery-hints.test.ts (97%) rename packages/daemon/src/{ => core}/session-recovery-hints.ts (100%) rename packages/daemon/src/{ => core}/session-replay-transaction.ts (100%) rename packages/daemon/src/{ => core}/session-runtime-admission.ts (100%) rename packages/daemon/src/{ => core}/session-script-active-publication.ts (100%) rename packages/daemon/src/{ => core}/session-script-publication-capability.ts (100%) rename packages/daemon/src/{ => core}/session-script-publication-state.ts (100%) rename packages/daemon/src/{ => core}/session-script-writer.ts (100%) rename packages/daemon/src/{ => core}/session-selector.ts (100%) rename packages/daemon/src/{ => core}/session-snapshot-freshness.ts (100%) rename packages/daemon/src/{ => core}/session-state.ts (98%) rename packages/daemon/src/{ => core}/session-store.ts (100%) rename packages/daemon/src/{ => core}/session-tenant-scope.ts (100%) rename packages/daemon/src/{ => core}/settle-observation-capture.ts (100%) rename packages/daemon/src/{ => core}/snapshot-capture.ts (100%) rename packages/daemon/src/{ => core}/snapshot-interactor-capture.ts (100%) rename packages/daemon/src/{ => core}/snapshot-runtime-binding.ts (100%) rename packages/daemon/src/{ => core}/snapshot-runtime-capture-input.ts (100%) rename packages/daemon/src/{ => core}/snapshot-session.ts (100%) rename packages/daemon/src/{ => core}/tenant-owned-entry.ts (100%) rename packages/daemon/src/{ => core}/touch-runtime.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/android-owner-seam.test.ts (92%) rename packages/daemon/src/{ => execution}/__tests__/android-system-dialog-occlusion.test.ts (96%) rename packages/daemon/src/{ => execution}/__tests__/android-system-dialog-ref-frame.test.ts (88%) rename packages/daemon/src/{ => execution}/__tests__/android-system-dialog.test.ts (88%) rename packages/daemon/src/{ => execution}/__tests__/back-runtime.test.ts (87%) rename packages/daemon/src/{ => execution}/__tests__/focus-runtime.test.ts (90%) rename packages/daemon/src/{ => execution}/__tests__/fold-runtime.test.ts (94%) rename packages/daemon/src/{ => execution}/__tests__/generic-route-runtime-completeness.test.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/interaction-get-runtime-fixture.ts (96%) rename packages/daemon/src/{ => execution}/__tests__/interaction-surface-baseline-evidence.test.ts (99%) rename packages/daemon/src/{ => execution}/__tests__/internal-observation.test.ts (98%) rename packages/daemon/src/{ => execution}/__tests__/keyboard-runtime.test.ts (99%) rename packages/daemon/src/{ => execution}/__tests__/offscreen-target-probe.test.ts (98%) rename packages/daemon/src/{ => execution}/__tests__/orientation-runtime.test.ts (89%) rename packages/daemon/src/{ => execution}/__tests__/ref-snapshot-flag-policy.test.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/runtime-policy.test.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/screenshot-crop-target.test.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/screenshot-crop.test.ts (97%) rename packages/daemon/src/{ => execution}/__tests__/scroll-movement.test.ts (99%) rename packages/daemon/src/{ => execution}/__tests__/scroll-runtime.test.ts (97%) rename packages/daemon/src/{ => execution}/__tests__/selector-capture-binding.test.ts (93%) rename packages/daemon/src/{ => execution}/__tests__/selector-capture-runtime.test.ts (98%) rename packages/daemon/src/{ => execution}/__tests__/selector-text-runtime.test.ts (100%) rename packages/daemon/src/{ => execution}/__tests__/session-snapshot.test.ts (98%) rename packages/daemon/src/{ => execution}/__tests__/system-button-runtime.test.ts (89%) rename packages/daemon/src/{ => execution}/__tests__/tv-remote-runtime.test.ts (91%) rename packages/daemon/src/{ => execution}/__tests__/type-text-runtime.test.ts (95%) rename packages/daemon/src/{ => execution}/__tests__/viewport-runtime.test.ts (88%) rename packages/daemon/src/{ => execution}/android-foreground-surface.ts (94%) rename packages/daemon/src/{ => execution}/android-snapshot-timeout-evidence.ts (94%) rename packages/daemon/src/{ => execution}/android-system-dialog.ts (98%) rename packages/daemon/src/{ => execution}/app-event-runtime.ts (94%) rename packages/daemon/src/{ => execution}/app-events.test.ts (100%) rename packages/daemon/src/{ => execution}/app-events.ts (100%) rename packages/daemon/src/{ => execution}/apps-runtime.ts (100%) rename packages/daemon/src/{ => execution}/back-runtime.ts (88%) rename packages/daemon/src/{ => execution}/focus-runtime.ts (90%) rename packages/daemon/src/{ => execution}/fold-runtime.ts (95%) rename packages/daemon/src/{ => execution}/generic-runtime-execution.ts (95%) rename packages/daemon/src/{ => execution}/generic-settle.ts (92%) rename packages/daemon/src/{ => execution}/handlers/__tests__/react-native.test.ts (98%) rename packages/daemon/src/{ => execution}/handlers/__tests__/session-clipboard.test.ts (98%) rename packages/daemon/src/{ => execution}/handlers/__tests__/session-selector-dispatch.test.ts (95%) rename packages/daemon/src/{ => execution}/handlers/__tests__/snapshot-alert.test.ts (92%) rename packages/daemon/src/{ => execution}/handlers/__tests__/snapshot-settings-handler.test.ts (95%) rename packages/daemon/src/{ => execution}/handlers/react-native.ts (97%) rename packages/daemon/src/{ => execution}/handlers/session-clipboard.ts (92%) rename packages/daemon/src/{ => execution}/handlers/session-selector-dispatch.ts (92%) rename packages/daemon/src/{ => execution}/handlers/snapshot-alert.ts (89%) rename packages/daemon/src/{ => execution}/handlers/snapshot-settings.ts (95%) rename packages/daemon/src/{ => execution}/interaction/index.ts (86%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find-handler-fixture.ts (83%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find-match-ranking.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find-single-bind.test.ts (81%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find-target-activation-disclosure.test.ts (89%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find-touch-runtime-fixture.ts (88%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/find.test.ts (98%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts (98%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-gesture-response.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-ios-tap-outcome-fixtures.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-recorded-input.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-ref-policy.test.ts (98%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-response-construction-guard.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-response-data-transform.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-runtime.test.ts (85%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-snapshot-scope.test.ts (93%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-touch-fixtures.ts (93%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts (89%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-touch-response.test.ts (96%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-touch-targets.test.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/__tests__/interaction-type-android-readiness.test.ts (86%) rename packages/daemon/src/{ => execution}/interaction/internal/find-match-ranking.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/find-match-resolution.ts (95%) rename packages/daemon/src/{ => execution}/interaction/internal/find-target-capture.ts (91%) rename packages/daemon/src/{ => execution}/interaction/internal/find.ts (95%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-android-escape.ts (95%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-common.ts (94%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-flags.ts (93%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-gesture-response.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-gesture.ts (97%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-ios-tap-outcome.ts (96%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-recorded-input.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-ref-policy.ts (96%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-response-data-transform.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-response.ts (78%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-runtime.ts (90%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-session.ts (65%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-snapshot.ts (92%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-targeting.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-android-freshness.ts (85%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-android-readiness.ts (92%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-direct-ios.ts (94%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-fill.ts (94%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-payload.ts (100%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-policy.ts (84%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-prepare.ts (85%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-press-admission.ts (96%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-press.ts (97%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-reference-frame.ts (91%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-response.ts (99%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-runtime.ts (95%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction-touch-targets.ts (99%) rename packages/daemon/src/{ => execution}/interaction/internal/interaction.ts (96%) rename packages/daemon/src/{ => execution}/internal-observation.ts (95%) rename packages/daemon/src/{ => execution}/keyboard-runtime.ts (98%) rename packages/daemon/src/{ => execution}/offscreen-target-probe.ts (93%) rename packages/daemon/src/{ => execution}/orientation-runtime.ts (92%) rename packages/daemon/src/{ => execution}/ref-positionals.ts (94%) rename packages/daemon/src/{ => execution}/ref-snapshot-flag-policy.ts (92%) rename packages/daemon/src/{ => execution}/request-dispatch-disclosure.ts (94%) rename packages/daemon/src/{ => execution}/request-generic-dispatch.ts (94%) rename packages/daemon/src/{ => execution}/runtime-artifacts.ts (100%) rename packages/daemon/src/{ => execution}/runtime-policy.ts (100%) rename packages/daemon/src/{ => execution}/screenshot-crop-target.ts (100%) rename packages/daemon/src/{ => execution}/screenshot-crop.ts (94%) rename packages/daemon/src/{ => execution}/screenshot-runtime-binding.ts (95%) rename packages/daemon/src/{ => execution}/screenshot-runtime.ts (97%) rename packages/daemon/src/{ => execution}/scroll-movement.ts (99%) rename packages/daemon/src/{ => execution}/scroll-runtime.ts (98%) rename packages/daemon/src/{ => execution}/scroll-until.test.ts (100%) rename packages/daemon/src/{ => execution}/scroll-until.ts (100%) rename packages/daemon/src/{ => execution}/selector-capture-binding.ts (91%) rename packages/daemon/src/{ => execution}/selector-capture-runtime.ts (93%) rename packages/daemon/src/{ => execution}/selector-match-errors.ts (95%) rename packages/daemon/src/{ => execution}/selector-runtime-backend.ts (92%) rename packages/daemon/src/{ => execution}/selector-runtime.ts (97%) rename packages/daemon/src/{ => execution}/selector-text-runtime.ts (93%) rename packages/daemon/src/{ => execution}/session-snapshot.ts (98%) rename packages/daemon/src/{ => execution}/snapshot-timeout-evidence.test.ts (100%) rename packages/daemon/src/{ => execution}/snapshot-timeout-evidence.ts (100%) rename packages/daemon/src/{ => execution}/sparse-fallback-screenshot.ts (95%) rename packages/daemon/src/{ => execution}/system-button-runtime.ts (92%) rename packages/daemon/src/{ => execution}/tv-remote-runtime.ts (91%) rename packages/daemon/src/{ => execution}/type-target-warning.ts (100%) rename packages/daemon/src/{ => execution}/type-text-runtime.ts (95%) rename packages/daemon/src/{ => execution}/viewport-runtime.ts (90%) rename packages/daemon/src/{ => execution}/wait-current-surface.test.ts (98%) rename packages/daemon/src/{ => execution}/wait-current-surface.ts (93%) rename packages/daemon/src/{ => execution}/wait-runtime.ts (96%) rename packages/daemon/src/{ => resources}/__tests__/app-log-admission-ledger.test.ts (98%) rename packages/daemon/src/{ => resources}/__tests__/app-log-files.test.ts (100%) rename packages/daemon/src/{ => resources}/__tests__/app-log-resource-recovery.test.ts (100%) rename packages/daemon/src/{ => resources}/__tests__/app-log-resource-store.test.ts (100%) rename packages/daemon/src/{ => resources}/__tests__/app-log-session-resource.test.ts (98%) rename packages/daemon/src/{ => resources}/__tests__/app-log-start-preflight.test.ts (98%) rename packages/daemon/src/{ => resources}/__tests__/app-log.test.ts (100%) rename packages/daemon/src/{ => resources}/__tests__/filesystem-boundary-faults.test.ts (95%) rename packages/daemon/src/{ => resources}/__tests__/lease-in-flight-work.test.ts (100%) rename packages/daemon/src/{ => resources}/__tests__/lease-registry-scope.test.ts (97%) rename packages/daemon/src/{ => resources}/__tests__/lease-registry.test.ts (99%) rename packages/daemon/src/{ => resources}/__tests__/macos-app-lease.test.ts (98%) rename packages/daemon/src/{ => resources}/__tests__/session-device-resolution.test.ts (93%) rename packages/daemon/src/{ => resources}/app-log-admission-ledger.ts (100%) rename packages/daemon/src/{ => resources}/app-log-files.ts (100%) rename packages/daemon/src/{ => resources}/app-log-resource-recovery.ts (100%) rename packages/daemon/src/{ => resources}/app-log-resource-store.ts (100%) rename packages/daemon/src/{ => resources}/app-log-session-resource.ts (95%) rename packages/daemon/src/{ => resources}/app-log-start-preflight.ts (100%) rename packages/daemon/src/{ => resources}/app-log.ts (100%) rename packages/daemon/src/{ => resources}/artifact-tracking.ts (99%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-admission.test.ts (96%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-conflict.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-prune.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-reboot.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-record.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-rule.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claim-settlement.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-claims.test.ts (100%) rename packages/daemon/src/{ => resources}/device/__tests__/device-mutation-drain.test.ts (95%) rename packages/daemon/src/{ => resources}/device/claim-recovery-gateway.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-admission.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-conflict.ts (98%) rename packages/daemon/src/{ => resources}/device/device-claim-inspection.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-paths.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-reboot.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-record.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-rule.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-settlement.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claim-store.ts (100%) rename packages/daemon/src/{ => resources}/device/device-claims.ts (100%) rename packages/daemon/src/{ => resources}/device/device-mutation-drain.ts (100%) rename packages/daemon/src/{ => resources}/human-control-contract.ts (100%) rename packages/daemon/src/{ => resources}/lease-in-flight-work.ts (100%) rename packages/daemon/src/{ => resources}/lease-registry-scope.ts (99%) rename packages/daemon/src/{ => resources}/lease-registry.ts (100%) rename packages/daemon/src/{ => resources}/macos-app-lease.ts (98%) rename packages/daemon/src/{ => resources}/provider-session-ownership.ts (100%) rename packages/daemon/src/{ => resources}/session-device-resolution.ts (88%) rename packages/daemon/src/{ => server}/__tests__/application-lifecycle-recovery.test.ts (99%) rename packages/daemon/src/{ => server}/__tests__/artifact-archive.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/atomic-publish-ownership.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/daemon-runtime-app-log.test.ts (91%) rename packages/daemon/src/{ => server}/__tests__/daemon-stop.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/host-lease-http.test.ts (97%) rename packages/daemon/src/{ => server}/__tests__/http-server-artifacts.coverage.ts (100%) rename packages/daemon/src/{ => server}/__tests__/http-server-artifacts.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-admission.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-handler-failure.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-invalid-body.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-lifetime.test.ts (96%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-unowned-failure.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc-validation.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/http-server-rpc.fixtures.ts (94%) rename packages/daemon/src/{ => server}/__tests__/http-server-tenant-trust.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/human-control-http.test.ts (94%) rename packages/daemon/src/{ => server}/__tests__/provider-lease-expiry.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/replay-device-selection.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/request-diagnostics-http.test.ts (96%) rename packages/daemon/src/{ => server}/__tests__/request-execution-locks.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/request-execution-scope-lease-expiry.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/request-execution-scope-macos-app-lease.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/request-execution-scope-open-device-wait.test.ts (95%) rename packages/daemon/src/{ => server}/__tests__/request-execution-scope.test.ts (97%) rename packages/daemon/src/{ => server}/__tests__/request-finalization.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/request-lease-work.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/request-lock-identity-policy.test.ts (97%) rename packages/daemon/src/{ => server}/__tests__/request-lock-policy.test.ts (98%) rename packages/daemon/src/{ => server}/__tests__/request-router-apps-admission.test.ts (89%) rename packages/daemon/src/{ => server}/__tests__/request-router-artifacts-web.test.ts (85%) rename packages/daemon/src/{ => server}/__tests__/request-router-cost.test.ts (94%) rename packages/daemon/src/{ => server}/__tests__/request-router-custom-action-flags.test.ts (88%) rename packages/daemon/src/{ => server}/__tests__/request-router-developer-dir.test.ts (85%) rename packages/daemon/src/{ => server}/__tests__/request-router-error-redaction.test.ts (87%) rename packages/daemon/src/{ => server}/__tests__/request-router-events.test.ts (95%) rename packages/daemon/src/{ => server}/__tests__/request-router-idle-expired.test.ts (93%) rename packages/daemon/src/{ => server}/__tests__/request-router-open-claim.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/request-router-open-harness.ts (93%) rename packages/daemon/src/{ => server}/__tests__/request-router-open.test.ts (96%) rename packages/daemon/src/{ => server}/__tests__/request-router-record-flags.test.ts (89%) rename packages/daemon/src/{ => server}/__tests__/request-router-repair-expired.test.ts (91%) rename packages/daemon/src/{ => server}/__tests__/request-router-replay-env.test.ts (89%) rename packages/daemon/src/{ => server}/__tests__/request-router-response-level.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/request-router-session-address.test.ts (90%) rename packages/daemon/src/{ => server}/__tests__/request-router-typed-error.test.ts (93%) rename packages/daemon/src/{ => server}/__tests__/request-save-script-policy.test.ts (96%) rename packages/daemon/src/{ => server}/__tests__/request-save-script-transports.test.ts (92%) rename packages/daemon/src/{ => server}/__tests__/response-views.test.ts (99%) rename packages/daemon/src/{ => server}/__tests__/resumable-upload-range.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/resumable-upload.test.ts (100%) rename packages/daemon/src/{ => server}/__tests__/server-shutdown.test.ts (78%) rename packages/daemon/src/{ => server}/__tests__/session-idle-expiry-harness.ts (93%) rename packages/daemon/src/{ => server}/__tests__/session-idle-expiry.test.ts (97%) rename packages/daemon/src/{ => server}/__tests__/upload.test.ts (100%) rename packages/daemon/src/{ => server}/application-lifecycle-recovery.ts (98%) rename packages/daemon/src/{ => server}/artifact-archive.ts (100%) rename packages/daemon/src/{ => server}/artifact-download.ts (100%) rename packages/daemon/src/{ => server}/daemon-stop.ts (100%) rename packages/daemon/src/{ => server}/device/__tests__/device-claim-owner-recovery.test.ts (98%) rename packages/daemon/src/{ => server}/device/device-claim-owner-recovery.ts (90%) rename packages/daemon/src/{ => server}/downloadable-artifact-http.ts (97%) rename packages/daemon/src/{ => server}/host-lease-http.ts (97%) rename packages/daemon/src/{ => server}/http-errors.ts (100%) rename packages/daemon/src/{ => server}/http-request-target.ts (100%) rename packages/daemon/src/server/{ => http}/daemon-lease-finalizer.test.ts (98%) rename packages/daemon/src/server/{ => http}/daemon-lease-finalizer.ts (92%) rename packages/daemon/src/server/{ => http}/daemon-metadata-loss.test.ts (100%) rename packages/daemon/src/server/{ => http}/daemon-metadata-loss.ts (100%) rename packages/daemon/src/server/{ => http}/daemon-runtime-device-claims.test.ts (83%) rename packages/daemon/src/server/{ => http}/daemon-runtime.ts (95%) rename packages/daemon/src/server/{ => http}/daemon-session-idle-expiry-scheduling.test.ts (99%) rename packages/daemon/src/server/{ => http}/daemon-session-idle-expiry.test.ts (98%) rename packages/daemon/src/server/{ => http}/daemon-session-idle-expiry.ts (99%) rename packages/daemon/src/server/{ => http}/daemon-shutdown-claims.test.ts (93%) rename packages/daemon/src/server/{ => http}/daemon-shutdown-claims.ts (97%) rename packages/daemon/src/server/{ => http}/http-authorization.test.ts (98%) rename packages/daemon/src/server/{ => http}/http-authorization.ts (96%) rename packages/daemon/src/server/{ => http}/http-instance-precondition.test.ts (100%) rename packages/daemon/src/server/{ => http}/http-instance-precondition.ts (100%) rename packages/daemon/src/server/{ => http}/http-rpc-envelope.ts (100%) rename packages/daemon/src/server/{ => http}/http-rpc-methods.ts (99%) rename packages/daemon/src/server/{ => http}/http-server.ts (99%) rename packages/daemon/src/server/{ => http}/server-lifecycle.ts (100%) rename packages/daemon/src/server/{ => http}/server-shutdown.ts (100%) rename packages/daemon/src/server/{ => http}/tenant-trust.ts (100%) rename packages/daemon/src/server/{ => http}/transport.ts (99%) rename packages/daemon/src/{ => server}/human-control-http.ts (98%) rename packages/daemon/src/{ => server}/platform-request-scope.ts (95%) rename packages/daemon/src/{ => server}/provider-lease-expiry.ts (99%) rename packages/daemon/src/{ => server}/replay-device-selection.ts (98%) rename packages/daemon/src/{ => server}/request-binding.ts (95%) rename packages/daemon/src/{ => server}/request-diagnostics-http.ts (98%) rename packages/daemon/src/{ => server}/request-execution-locks.ts (100%) rename packages/daemon/src/{ => server}/request-execution-scope.ts (93%) rename packages/daemon/src/{ => server}/request-finalization.ts (97%) rename packages/daemon/src/{ => server}/request-lease-work.ts (85%) rename packages/daemon/src/{ => server}/request-lock-policy.ts (96%) rename packages/daemon/src/{ => server}/request-platform-provider-context.ts (92%) rename packages/daemon/src/{ => server}/request-router.ts (96%) rename packages/daemon/src/{ => server}/request-save-script-policy.ts (96%) rename packages/daemon/src/{ => server}/response-views.ts (99%) rename packages/daemon/src/{ => server}/resumable-upload-range.ts (100%) rename packages/daemon/src/{ => server}/resumable-upload-transfer.ts (100%) rename packages/daemon/src/{ => server}/resumable-upload.ts (99%) rename packages/daemon/src/{ => server}/session-idle-expiry.ts (97%) rename packages/daemon/src/{ => server}/upload-http.ts (98%) rename packages/daemon/src/{ => server}/upload.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/install-source-resolution.test.ts (94%) rename packages/daemon/src/{ => sessions}/__tests__/lease-lifecycle.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/materialized-path-registry.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/open-device-contention-wait.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/replay-session-fixture.ts (91%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-android-occlusion.test.ts (92%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-capture-policy.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-chrome-filter.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-observation.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-overlay.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-publication.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-divergence/session-replay-divergence-suggestions.test.ts (86%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts (91%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-maestro-failure.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts (90%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts (92%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-keyboard.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-run-flow.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-run-script.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-swipe.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro-targeting.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-maestro/session-replay-runtime-maestro.fixtures.ts (94%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-acceptance.test.ts (93%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-loop.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-transaction-close-ordering.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-transaction-force.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts (88%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair-transaction.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair.fixtures.test.ts (84%) rename packages/daemon/src/{ => sessions}/__tests__/replay-repair/session-replay-repair.fixtures.ts (87%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/application.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/replay-command-fixture.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-action-runtime.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-resume.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-artifact-ledger.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-binding.test.ts (92%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-failure-response.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-failure.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime-plan.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime.fixtures.ts (89%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-runtime.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-runtime/session-replay-script-source.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-command-trust.test.ts (94%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-fail-fast.test.ts (79%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-runner.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-source-discovery.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite-command-cancellation.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite-command-nested-flags.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite-command-remote-artifacts.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite-command-video.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite-infrastructure.test.ts (88%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite.fixtures.ts (79%) rename packages/daemon/src/{ => sessions}/__tests__/replay-suite/session-test-suite.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/replay-target/session-replay-dispatch-selector-miss.test.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-target/session-replay-scenario.fixtures.ts (96%) rename packages/daemon/src/{ => sessions}/__tests__/replay-target/session-replay-selector-routes.test.ts (88%) rename packages/daemon/src/{ => sessions}/__tests__/replay-target/session-replay-target-verification-runtime.test.ts (99%) rename packages/daemon/src/{ => sessions}/__tests__/request-admission.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/request-handler-catalog.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/request-handler-chain-provider-scope.test.ts (87%) rename packages/daemon/src/{ => sessions}/__tests__/request-recording-health.test.ts (95%) rename packages/daemon/src/{ => sessions}/__tests__/runtime-binding-conformance-completeness.test.ts (97%) rename packages/daemon/src/{ => sessions}/__tests__/session-idle-activity.test.ts (94%) rename packages/daemon/src/{ => sessions}/__tests__/session-routing.test.ts (98%) rename packages/daemon/src/{ => sessions}/__tests__/session-runtime.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/session-teardown-budget.test.ts (86%) rename packages/daemon/src/{ => sessions}/__tests__/snapshot-custom-actions-platform-guard.test.ts (89%) rename packages/daemon/src/{ => sessions}/__tests__/snapshot-diff.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/snapshot-publication-membership.test.ts (100%) rename packages/daemon/src/{ => sessions}/__tests__/snapshot-scope-ref.test.ts (90%) rename packages/daemon/src/{ => sessions}/application-lifecycle-execution.ts (81%) rename packages/daemon/src/{ => sessions}/device/__tests__/device-claim-reconciliation.test.ts (97%) rename packages/daemon/src/{ => sessions}/device/device-claim-reconciliation.ts (94%) rename packages/daemon/src/{ => sessions}/device/device-targets.ts (100%) rename packages/daemon/src/{ => sessions}/dispatch-payload.test.ts (100%) rename packages/daemon/src/{ => sessions}/dispatch-payload.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/human-control.test.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/install-source.test.ts (98%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/lease-artifacts.test.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/lease.test.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/record-runtime-request.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/record-runtime-response.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/record-runtime-start.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/record-runtime-stop-recovery.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/record-runtime.fixtures.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-appstate-device-runtime.test.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-appstate-input.test.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-appstate.test.ts (93%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-boot-shutdown-device-claims.test.ts (88%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-boot-warmup.test.ts (72%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-boot.test.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-command-replay.test.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-device-claims.test.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-device-status-response.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-doctor-app-runtime.test.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-doctor-device.test.ts (98%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-doctor-metro.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-doctor-options.test.ts (90%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-install-source-ref-frame.test.ts (86%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-prepare.test.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-push-ref-frame.test.ts (82%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-push.test.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-reinstall.test.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-relaunch-guards.test.ts (90%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-replay-command.test.ts (79%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-runtime-command.test.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-runtime-port-reverse.test.ts (91%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-script-publication.test.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-shutdown.test.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session-trigger.test.ts (69%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/session.test.ts (77%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/snapshot.test.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/__tests__/trace-runtime.test.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/human-control.ts (89%) rename packages/daemon/src/{ => sessions}/handlers/lease.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/record-runtime-request.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/record-runtime-response.ts (98%) rename packages/daemon/src/{ => sessions}/handlers/record-runtime.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/record-trace.ts (85%) rename packages/daemon/src/{ => sessions}/handlers/session-app-deployment-route.ts (84%) rename packages/daemon/src/{ => sessions}/handlers/session-app-deployment.ts (93%) rename packages/daemon/src/{ => sessions}/handlers/session-app-source-deployment.ts (93%) rename packages/daemon/src/{ => sessions}/handlers/session-appstate-apple-session.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/session-appstate-device-runtime.ts (89%) rename packages/daemon/src/{ => sessions}/handlers/session-appstate.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/session-batch.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/session-boot.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/session-command-input.ts (79%) rename packages/daemon/src/{ => sessions}/handlers/session-device-status-response.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-app.ts (97%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-device.ts (98%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-metro.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-options.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-output.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor-types.ts (100%) rename packages/daemon/src/{ => sessions}/handlers/session-doctor.ts (96%) rename packages/daemon/src/{ => sessions}/handlers/session-prepare.ts (91%) rename packages/daemon/src/{ => sessions}/handlers/session-replay-command.ts (90%) rename packages/daemon/src/{ => sessions}/handlers/session-replay-video-owner.ts (89%) rename packages/daemon/src/{ => sessions}/handlers/session-runtime-command.ts (92%) rename packages/daemon/src/{ => sessions}/handlers/session-runtime-port-reverse.ts (91%) rename packages/daemon/src/{ => sessions}/handlers/session-script-publication.ts (92%) rename packages/daemon/src/{ => sessions}/handlers/session-shutdown.ts (95%) rename packages/daemon/src/{ => sessions}/handlers/session.ts (94%) rename packages/daemon/src/{ => sessions}/handlers/snapshot-runtime-route.test.ts (90%) rename packages/daemon/src/{ => sessions}/handlers/snapshot.ts (86%) rename packages/daemon/src/{ => sessions}/handlers/trace-runtime.ts (90%) rename packages/daemon/src/{ => sessions}/install-source-resolution.ts (95%) rename packages/daemon/src/{ => sessions}/lease-lifecycle.ts (92%) rename packages/daemon/src/{ => sessions}/materialized-path-registry.ts (99%) rename packages/daemon/src/{ => sessions}/open-device-contention-wait.ts (97%) rename packages/daemon/src/{ => sessions}/payload-input.ts (100%) rename packages/daemon/src/{ => sessions}/request-admission.ts (93%) rename packages/daemon/src/{ => sessions}/request-handler-chain.ts (90%) rename packages/daemon/src/{ => sessions}/request-recording-health.ts (86%) rename packages/daemon/src/{ => sessions}/route-owner-files.ts (67%) rename packages/daemon/src/{ => sessions}/server/daemon-idle-reap.test.ts (96%) rename packages/daemon/src/{ => sessions}/server/daemon-idle-reap.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/__tests__/application.test.ts (93%) rename packages/daemon/src/{ => sessions}/session-lifecycle/index.ts (100%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts (92%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-capabilities.fixtures.ts (99%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-capabilities.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-cwd-scoped-resources.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-error-precedence.test.ts (98%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-lifecycle-runtime.test.ts (88%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-resource-cleanup.test.ts (96%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-save-script.test.ts (89%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-script.test.ts (96%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-shutdown-platform.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-close-shutdown.fixtures.ts (90%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-devices-batch-runtime.test.ts (96%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-inventory-appleos.test.ts (94%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-inventory-apps-runtime.test.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-inventory-harmonyos.test.ts (92%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-inventory-scoped-paths.test.ts (92%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-device-in-use.test.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-execution-runtime.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-existing.test.ts (90%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-foreground.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-runtime.fixtures.ts (83%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-runtime.test.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-state.test.ts (93%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-surface.test.ts (100%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-open-warnings.test.ts (100%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/__tests__/session-teardown-resources.test.ts (98%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/inventory.ts (94%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-close-lifecycle-teardown.ts (94%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-close-runtime-admission.ts (88%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-close-script.ts (89%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-close.ts (94%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-execution.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-foreground.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-prepare.ts (94%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-state.ts (82%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-surface.ts (97%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open-warnings.ts (100%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-open.ts (95%) rename packages/daemon/src/{ => sessions}/session-lifecycle/internal/session-startup-metrics.ts (100%) rename packages/daemon/src/{ => sessions}/session-observability/__tests__/application.test.ts (86%) rename packages/daemon/src/{ => sessions}/session-observability/__tests__/session-audio.coverage.ts (100%) rename packages/daemon/src/{ => sessions}/session-observability/index.ts (100%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-audio.test.ts (98%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-logs.test.ts (96%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-network-runtime-parity-fixtures.ts (100%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-network-runtime-parity.test.ts (91%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-network.test.ts (79%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-observability.test.ts (89%) rename packages/daemon/src/{ => sessions}/session-observability/internal/__tests__/session-perf-runtime.test.ts (97%) rename packages/daemon/src/{ => sessions}/session-observability/internal/session-audio.ts (94%) rename packages/daemon/src/{ => sessions}/session-observability/internal/session-network.ts (95%) rename packages/daemon/src/{ => sessions}/session-observability/internal/session-observability.ts (95%) rename packages/daemon/src/{ => sessions}/session-observability/internal/session-perf-runtime.ts (96%) rename packages/daemon/src/{ => sessions}/session-replay-coordinator.ts (97%) rename packages/daemon/src/{ => sessions}/session-routing.ts (98%) rename packages/daemon/src/{ => sessions}/session-runtime.ts (98%) rename packages/daemon/src/{ => sessions}/session-teardown-budget.ts (91%) rename packages/daemon/src/{ => sessions}/session-teardown.ts (95%) rename packages/daemon/src/{ => sessions}/snapshot-command-runtime.ts (92%) rename packages/daemon/src/{ => sessions}/snapshot-diff-runtime.ts (86%) rename packages/daemon/src/{ => sessions}/snapshot-quality-latch.ts (97%) rename packages/daemon/src/{ => sessions}/snapshot-runtime.ts (88%) rename packages/daemon/src/{ => sessions}/startup-deadline.ts (100%) rename packages/daemon/src/{ => sessions}/web-session-names.ts (72%) diff --git a/.device-evidence/CHECKLIST.md b/.device-evidence/CHECKLIST.md index eb1bfb1d19..b708fc77b8 100644 --- a/.device-evidence/CHECKLIST.md +++ b/.device-evidence/CHECKLIST.md @@ -99,9 +99,9 @@ appended warning: ### Proof the review asked for on this lane The false-attribution class is covered by unit tests rather than a device run, because the device -cannot show a cache hit on command: `packages/daemon/src/__tests__/selector-capture-runtime.test.ts` +cannot show a cache hit on command: `packages/daemon/src/execution/__tests__/selector-capture-runtime.test.ts` drives a session-snapshot cache hit and pins that the consumed tree earns no repair proof and -discloses nothing, `packages/daemon/src/__tests__/capture-disclosure-target-activation.test.ts` +discloses nothing, `packages/daemon/src/core/__tests__/capture-disclosure-target-activation.test.ts` pins that the response builder never borrows a repair the stored snapshot happens to carry, and `src/__tests__/daemon-composition/interaction/interaction-capture-disclosure.test.ts` pins that a press which consumed no capture is not disclosed against an older tree. diff --git a/.fallowrc.json b/.fallowrc.json index d82e00a3d3..1693be357b 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -65,7 +65,7 @@ "scripts/help-conformance-sample-outputs.d.mts", "scripts/help-conformance-runner-output.d.mts" ], - "dynamicallyLoaded": ["packages/daemon/src/interaction/index.ts"], + "dynamicallyLoaded": ["packages/daemon/src/execution/interaction/index.ts"], "ignoreDependencies": [ "@theme", // @agent-device/maestro owns the source import, while the published root @@ -167,7 +167,7 @@ }, { // The interaction facade exposes #2178's deferred route handlers plus the existing ref mutation response consumed by help conformance. Fallow's production graph cannot follow the request-handler-chain dynamic imports, so this exact list is the facade contract. - "file": "packages/daemon/src/interaction/index.ts", + "file": "packages/daemon/src/execution/interaction/index.ts", "exports": ["refMutationAdmissionResponse", "handleFindCommands", "handleInteractionCommands"] }, { @@ -251,7 +251,7 @@ ] }, { - // packages/daemon/src/__tests__/request-runtime-binding.test.ts drives the daemon's exact bind through the recovery authority, whose cancellation race is what rejects; production reaches it only through finishRecoveredDurableCapture and recoverDurableCaptureResource in the same package. + // packages/daemon/src/core/__tests__/request-runtime-binding.test.ts drives the daemon's exact bind through the recovery authority, whose cancellation race is what rejects; production reaches it only through finishRecoveredDurableCapture and recoverDurableCaptureResource in the same package. "file": "packages/capture-kit/src/durable-capture/index.ts", "exports": ["acquireDurableCaptureRecoveryAuthorityBeforeDeadline"] }, diff --git a/AGENTS.md b/AGENTS.md index 6fdd5c7442..3ff131c658 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,11 +49,11 @@ Read the declaration rather than maintaining a prose copy: - commands and their surface, runtime-use, batch, and timeout traits: `packages/command-registry/src/registry.ts` -- daemon route ownership and request-policy traits: `packages/daemon/src/daemon-command-registry.ts` +- daemon route ownership and request-policy traits: `packages/daemon/src/core/daemon-command-registry.ts` - interaction paths and guarantees: `packages/contracts/src/interaction-guarantees.ts` - canonical command names: `packages/command-registry/src/catalog.ts` - device runtime-use declarations and fact admission: - `packages/command-registry/src/registry.ts`, `packages/daemon/src/runtime-admission.ts`, and + `packages/command-registry/src/registry.ts`, `packages/daemon/src/core/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` @@ -110,7 +110,7 @@ under `contracts/fixtures/`. ## Runtime and diagnostics seams Diagnostics use `@agent-device/host-kit/diagnostics`. Request diagnostics belong in the session request log; -session artifact paths come from `packages/daemon/src/session-artifact-paths.ts`. App/device logs remain in `app.log`; +session artifact paths come from `packages/daemon/src/core/session-artifact-paths.ts`. App/device logs remain in `app.log`; Apple runner and xcodebuild output remains in `runner.log`. Normalize failures with `normalizeError` and preserve `hint`, `diagnosticId`, `logPath`, and typed diff --git a/docs/adr/0003-daemon-command-registry.md b/docs/adr/0003-daemon-command-registry.md index 2b92ac543d..4d24859c03 100644 --- a/docs/adr/0003-daemon-command-registry.md +++ b/docs/adr/0003-daemon-command-registry.md @@ -21,7 +21,7 @@ to public command identity, and it required duplicate command sets to stay align Keep public command identity in `src/command-catalog.ts` and public input/output contracts in `src/commands/**`. -Add `packages/daemon/src/daemon-command-registry.ts` as the daemon-side source of truth for command route +Add `packages/daemon/src/core/daemon-command-registry.ts` as the daemon-side source of truth for command route ownership and daemon request-policy traits. Request modules consume predicate functions from the registry instead of recreating command string sets. Handler modules own execution logic only; they do not export duplicate coverage tables to prove route membership. @@ -85,5 +85,5 @@ derived daemon registry is therefore permitted **only if** it preserves all of t A single flat public descriptor whose daemon fields leak into public views is **not** permitted — that is the "collapse daemon policy into a public command registry" failure this ADR exists to prevent. Compose facets owned by their domains; derive the registry from them. Until that derivation lands and is pinned -by the registry tests, the hand-authored `packages/daemon/src/daemon-command-registry.ts` remains the source of +by the registry tests, the hand-authored `packages/daemon/src/core/daemon-command-registry.ts` remains the source of truth and the operating rule in `AGENTS.md` is unchanged. diff --git a/docs/adr/0004-ios-snapshot-backend-strategy.md b/docs/adr/0004-ios-snapshot-backend-strategy.md index 56ba3ba989..9657ecd3d1 100644 --- a/docs/adr/0004-ios-snapshot-backend-strategy.md +++ b/docs/adr/0004-ios-snapshot-backend-strategy.md @@ -115,7 +115,7 @@ facet in `@agent-device/capture-kit` owns snapshot policy generally rather than stated as a duration budget; the loop derives the deadline from the window's `markedAt` itself, so the budget is always spent from the action and a caller has no absolute instant it could get wrong. - `packages/daemon/src/session-snapshot-freshness.ts` keeps only what needs a session: reading and retiring + `packages/daemon/src/core/session-snapshot-freshness.ts` keeps only what needs a session: reading and retiring the window on store-owned `SessionState`, and choosing the comparison baseline from snapshot lineage. It remains the declared R7 owner of `androidSnapshotFreshness`. - **Timeout evidence.** Whether a capture failed because the hierarchy never arrived is decided @@ -150,7 +150,7 @@ those roots and are outside that gate. It carries a positive control, because a matching would look identical to a boundary being obeyed. The residual call sites #1983 also named are audited and deliberately left in place. -`packages/daemon/src/direct-ios-selector.ts` carries no presentation policy: `isLocalIosRunnerSession` and +`packages/daemon/src/core/direct-ios-selector.ts` carries no presentation policy: `isLocalIosRunnerSession` and `readSimpleIosSelectorTarget` are session routing (device family, provider ownership, the stabilization window), while `deriveDirectIosNodeSelector` and `isDirectIosSelectorFallbackError` are selector derivation and ADR 0011 delegation-on-error. The latter two are pure and diff --git a/docs/adr/0008-command-descriptor-registry.md b/docs/adr/0008-command-descriptor-registry.md index d5c467f710..25bfeeec96 100644 --- a/docs/adr/0008-command-descriptor-registry.md +++ b/docs/adr/0008-command-descriptor-registry.md @@ -24,7 +24,7 @@ Accepted A command's identity is restated, by hand, across roughly ten tables that must stay aligned by convention: `PUBLIC_COMMANDS` (`src/command-catalog.ts`), the per-command metadata and family facets (`src/commands/**`), the capability matrix (`src/core/capabilities.ts`), the daemon command registry -(`packages/daemon/src/daemon-command-registry.ts`, ADR 0003), the structured-batch allowlist +(`packages/daemon/src/core/daemon-command-registry.ts`, ADR 0003), the structured-batch allowlist (`src/batch-policy.ts`), the MCP exposure sets, the Node client interface and impl (`src/client-types.ts`, `src/client.ts`), and the generic-dispatch `switch` (`src/core/dispatch.ts`, whose `default: throw` makes a missing or renamed command a runtime error, not a compile error). Adding one command touches ~24 files, the diff --git a/docs/adr/0012-interactive-replay.md b/docs/adr/0012-interactive-replay.md index 5943a08081..a13bc4badb 100644 --- a/docs/adr/0012-interactive-replay.md +++ b/docs/adr/0012-interactive-replay.md @@ -730,7 +730,7 @@ path — no text editing, no silent similarity-heal. **Core mechanism — the healed script IS `session.actions`.** No new splice engine. `session.actions` already accumulates every executed action for the session's lifetime -(`packages/daemon/src/session-action-recorder.ts:92`, unconditional push), and the divergence refusal is +(`packages/daemon/src/core/session-action-recorder.ts:92`, unconditional push), and the divergence refusal is pre-dispatch (target verification refuses before the device action, decision 3), so a divergent step is never pushed. Across a repair session: original steps that verified and dispatched land in `session.actions`; the divergent step is absent (refused pre-dispatch, never recorded); the agent's @@ -766,7 +766,7 @@ works" and "healed scripts are always valid": steps are re-executed during the repair replay; only if recording is armed from the start do they land in `session.actions` with fresh `target-v1` evidence. Arming late yields a hybrid healed script (an annotated corrective step glued to a bare, unannotated prefix) that re-diverges on its own next replay - (`packages/daemon/src/interaction/internal/interaction-common.ts:64-65` attaches evidence only when `recordSession` was + (`packages/daemon/src/execution/interaction/internal/interaction-common.ts:64-65` attaches evidence only when `recordSession` was true when the step ran). - **R2 — `--from` continuation only; never re-run the full replay on the same session.** After a divergence at step N and the corrective action, the agent must continue with `replay --from k @@ -808,8 +808,8 @@ works" and "healed scripts are always valid": instead of leaving it to agent judgment. - **R4 — corrective actions must materialize to selector form; the writer fails loudly on a bare `@ref` cross-session export.** A `press @e12` normally resolves a `selectorChain` at runtime - (`packages/daemon/src/interaction/internal/interaction-touch-targets.ts`), which `buildOptimizedActions` - (`packages/daemon/src/session-script-writer.ts:368-377`) rewrites to a selector line. If no `selectorChain` was + (`packages/daemon/src/execution/interaction/internal/interaction-touch-targets.ts`), which `buildOptimizedActions` + (`packages/daemon/src/core/session-script-writer.ts:368-377`) rewrites to a selector line. If no `selectorChain` was captured, the writer must refuse to emit a bare `@ref` line into a persisted `.ad` — a session-bound ref will not resolve in a fresh run. It **fails loudly**: an error surfaced to the user with a non-zero exit, never a swallowed or silently-dropped line (existing session-write paths swallow such failures; @@ -893,7 +893,7 @@ by construction. The healed `.ad` is written only when the repair ends (below) a - The healed `.ad` is published when a teardown commits the transaction at state `COMPLETE` — normally the agent's own `close`/`close --save-script `, but any teardown of a completed transaction commits (see the commit state machine below) — reusing the existing `session.actions` serializer - (`SessionScriptWriter.write`, `packages/daemon/src/session-script-writer.ts:120-158`) over the post-watermark slice + (`SessionScriptWriter.write`, `packages/daemon/src/core/session-script-writer.ts:120-158`) over the post-watermark slice only (R6). When no `` path is given, the default is the **`.healed.ad` sibling**: the original script's path with its `.ad` extension replaced by `.healed.ad` (e.g. `flows/login.ad` → `flows/login.healed.ad`), @@ -943,7 +943,7 @@ a separate naming change, not part of this decision. **Scope: this refusal is uniform across repair AND ordinary recording, not repair-only.** Everything above is written in the context of decision 6's repair-armed heal, but `publishHealedScriptAtomically` -(`packages/daemon/src/session-script-writer.ts`) is the single publish primitive `SessionScriptWriter.write` calls +(`packages/daemon/src/core/session-script-writer.ts`) is the single publish primitive `SessionScriptWriter.write` calls for every `--save-script` target, with no repair-armed-vs-ordinary branch — a repair-armed heal (`saveScriptBoundary` set) and an ordinary, non-repair `open --save-script`/`close --save-script` recording (`saveScriptBoundary` absent) publish through the exact same exclusive `linkSync`. Before this @@ -1002,10 +1002,10 @@ The tombstone itself expires after its bounded window, after which the key is fu > Provenance travels as `internal.replayPlanStep`, stamped by `invokeResolvedReplayAction` > (`src/daemon/handlers/session-replay-action-runtime.ts`) — the single point every plan step is > dispatched, so the marker covers annotated and unannotated steps alike. `internal` is a daemon-only -> channel (`toDaemonRequest`, `packages/daemon/src/server/http-rpc-methods.ts`, never copies it off the wire), so +> channel (`toDaemonRequest`, `packages/daemon/src/server/http/http-rpc-methods.ts`, never copies it off the wire), so > authored provenance cannot be spoofed by a client; this is the same channel `replayTargetGuard` and > `findResolvedTarget` already use. The rule is written once, in `isInteractiveObservation` -> (`packages/daemon/src/session-action-recorder.ts`), and both recording call sites consume it. +> (`packages/daemon/src/core/session-action-recorder.ts`), and both recording call sites consume it. > > **2. The corrective-read trap: why even out-of-band reads need an opt-in.** Excluding every out-of-band > read is still not safe on its own: a divergence's **correction** can itself be a read. In the wave-3 E3 drift, the diverged step **was** a `get`, so its corrective replacement is a @@ -1044,11 +1044,11 @@ The tombstone itself expires after its bounded window, after which the key is fu > > **4. How the rule projects across CLI/Node/MCP surfaces.** The exclusion is enforced at a single > daemon-side choke point — `isExcludedRepairSegmentObservation` in `recordActionEntry` -> (`packages/daemon/src/session-action-recorder.ts`), gated on `session.saveScriptBoundary !== undefined` (set ONLY +> (`packages/daemon/src/core/session-action-recorder.ts`), gated on `session.saveScriptBoundary !== undefined` (set ONLY > by a repair-armed `replay --save-script`; an ordinary, non-repair `open --save-script`/`close --save-script` > authoring recording never sets it — see decision 6's "Scope" note above) and on the entry's > `interactiveObservation` marker, which both recording call sites -> (`packages/daemon/src/selector-recording.ts` for `get`/`is`/read-only `find`, `packages/daemon/src/snapshot-runtime.ts` for +> (`packages/daemon/src/core/selector-recording.ts` for `get`/`is`/read-only `find`, `packages/daemon/src/sessions/snapshot-runtime.ts` for > `snapshot`) compute from the shared `isInteractiveObservation` predicate rather than each re-deriving it. > Every surface reaches this same function because every surface's request reaches the same daemon. > @@ -1159,8 +1159,8 @@ above and the gates they name are the authoritative record of current behavior. At acceptance, replay was deterministic. `.ad` scripts were plain text — one action per line, `#` comments, and a `context platform=... device=... theme=...` header (`src/replay/script.ts`) — recorded -via `open --save-script` (`packages/daemon/src/session-action-recorder.ts`, -`packages/daemon/src/session-script-writer.ts`) or hand-written, and executed step-by-step by +via `open --save-script` (`packages/daemon/src/core/session-action-recorder.ts`, +`packages/daemon/src/core/session-script-writer.ts`) or hand-written, and executed step-by-step by `runReplayScriptFile` (`src/daemon/handlers/session-replay-runtime.ts`) under the daemon's `replay`/`test` commands (`src/daemon/handlers/session-replay.ts`). Recorded touch/fill/get targets are selector chains with @@ -1289,15 +1289,15 @@ both `.ad` and Maestro paths) grounds the same conclusions from the caller's sea "Retry with --debug and inspect diagnostics log for details." (`defaultHintForCode`, `src/kernel/errors.ts:253-254`). - **Recordings contain zero verification steps.** The script writer strips every recorded `snapshot` - action (`buildOptimizedActions`, `packages/daemon/src/session-script-writer.ts:315`: `if (action.command === + action (`buildOptimizedActions`, `packages/daemon/src/core/session-script-writer.ts:315`: `if (action.command === 'snapshot') continue;` — only synthetic ref-scoped snapshots are re-inserted, as resolution aids, not observations), and the record-time flag allowlist (`RECORDED_FLAG_KEYS` from the flag - declarations' `recorded` field, `packages/daemon/src/session-action-recorder.ts:367-381`) carries neither `settle`/`settleQuietMs` nor `verify`, + declarations' `recorded` field, `packages/daemon/src/core/session-action-recorder.ts:367-381`) carries neither `settle`/`settleQuietMs` nor `verify`, so `--settle`/`--verify` are dropped from recorded steps. A recording therefore replays actions with no outcome observation at all — exactly the gap decision 3's record-time identity evidence fills. A related, currently under-used precedent: recorded `@ref` steps already carry an optional identity -hint in the `.ad` file. `appendRefLabel` (`packages/daemon/src/session-script-writer.ts:532-537`) writes the +hint in the `.ad` file. `appendRefLabel` (`packages/daemon/src/core/session-script-writer.ts:532-537`) writes the node's label as a trailing token, parsed back into `action.result.refLabel` (`src/replay/script.ts:269,295,315`). Today that label is used only as a fallback LOOKUP key (`tryResolveRefNode`'s `fallbackLabel`, `resolution.ts:393,413-430`) when the ref itself fails to diff --git a/docs/adr/0014-session-ref-frame-lifetime.md b/docs/adr/0014-session-ref-frame-lifetime.md index de18c5de87..a8943fcf06 100644 --- a/docs/adr/0014-session-ref-frame-lifetime.md +++ b/docs/adr/0014-session-ref-frame-lifetime.md @@ -20,7 +20,7 @@ ref-frame vocabulary is promoted into `CONTEXT.md`. issuance scope) — kept separate from the latest operational observation (`session.snapshot`). The frame is one value on `SessionState`, replaced whole by a transition and never edited in place; its type is nominal (`#`-private fields), so no module outside - `packages/daemon/src/ref-frame.ts` can construct a frame, edit one, or derive one from an existing + `packages/daemon/src/core/ref-frame.ts` can construct a frame, edit one, or derive one from an existing frame. What the type cannot judge is a whole frame moved unchanged — clearing the field, or assigning another session's frame — which the field-owner gate still covers. - A complete snapshot activates an `all` frame; `find`, settled diffs, and replay divergence diff --git a/docs/adr/0016-active-session-script-publication.md b/docs/adr/0016-active-session-script-publication.md index 0e35791b69..75d30af7fc 100644 --- a/docs/adr/0016-active-session-script-publication.md +++ b/docs/adr/0016-active-session-script-publication.md @@ -2,8 +2,8 @@ ## Status -Accepted; implemented on `main` (`packages/daemon/src/handlers/session-script-publication.ts`, -`packages/daemon/src/session-script-active-publication.ts`), including the #1349 identity-level +Accepted; implemented on `main` (`packages/daemon/src/sessions/handlers/session-script-publication.ts`, +`packages/daemon/src/core/session-script-active-publication.ts`), including the #1349 identity-level destination-guard amendment. ## Rules at a glance diff --git a/docs/adr/0018-unified-event-journal.md b/docs/adr/0018-unified-event-journal.md index 6f7f4d3fb0..3c0a5781e7 100644 --- a/docs/adr/0018-unified-event-journal.md +++ b/docs/adr/0018-unified-event-journal.md @@ -64,7 +64,7 @@ redaction discipline, and sink (inventoried 2026-07-24): three request-lifecycle points plus `SessionStore.recordAction`, read only by the public `events` command. `action.recorded` is already a projection of `session.actions` pushes — the model this ADR generalizes. Crucially, not every append happens inside a request: - `finalizeRepairTeardown` (`packages/daemon/src/session-store.ts`) records a synthesized `close` action + `finalizeRepairTeardown` (`packages/daemon/src/core/session-store.ts`) records a synthesized `close` action during idle reap or daemon shutdown, with — per its own comment — "no live request here." 3. **Progress streaming** (`src/request/progress.ts`, `src/daemon/request-progress-protocol.ts`). A closed, typed `RequestProgressEvent` union emitted through a single-sink `AsyncLocalStorage` @@ -85,7 +85,7 @@ usage at all — the codebase already avoids implicit pub/sub, which this design The channels overlap but share nothing: no common envelope, no shared kind vocabulary, and consumers couple to emit sites by string. The sharpest instance: agent-cost's `runnerRoundTrips` is `countDiagnosticEventsByPhase(['ios_runner_command_send', 'ios_runner_readiness_preflight'])` -(`packages/daemon/src/request-router.ts`) — a hand-picked name list a new runner phase can silently drift +(`packages/daemon/src/server/request-router.ts`) — a hand-picked name list a new runner phase can silently drift from. That violates two established repo rules: *what enumerates N?* (nothing enumerates round-trip phases), and *categories come from recorded fields, never parsed names*. @@ -325,7 +325,7 @@ gets built. inconsistency, and three write paths. Kept as the migration's first independently useful step instead. - **Merge `upload-progress` and `app-events` in:** rejected. Upload progress is a local - byte-counter callback that never crosses the request scope; `packages/daemon/src/app-events.ts` is a deep-link + byte-counter callback that never crosses the request scope; `packages/daemon/src/execution/app-events.ts` is a deep-link builder for the `trigger-app-event` command, not an event channel. ## Validation required for implementation diff --git a/docs/adr/0019-request-bound-platform-runtime.md b/docs/adr/0019-request-bound-platform-runtime.md index 4caa37e04e..7ef18c7afc 100644 --- a/docs/adr/0019-request-bound-platform-runtime.md +++ b/docs/adr/0019-request-bound-platform-runtime.md @@ -841,13 +841,13 @@ therefore structurally enforced rather than periodically measured. Some request-path work asks the host machine something without ever taking a device runtime: concrete local readiness, boot-time and runner-session observation, and open-target classification. Those asks now cross the daemon boundary as one required dependency, -`DaemonPlatformServices` (`packages/daemon/src/platform-services.ts`), assembled by the daemon runtime's +`DaemonPlatformServices` (`packages/daemon/src/core/platform-services.ts`), assembled by the daemon runtime's root-composition module in `src/daemon-composition.ts` — which reaches the concrete adapters through `src/platform-runtime-daemon-services.ts` behind a function-scoped `await import` — and threaded composition → `startDaemonRuntime` deps → `RequestRouterDeps` → the request execution scope → the handlers and consumers. Stale-claim reconciliation gets the same treatment for the one act it may not perform itself: the composition supplies the `ClaimRecoveryGatewayFactory` -the daemon declares in `packages/daemon/src/device/claim-recovery-gateway.ts`, built from +the daemon declares in `packages/daemon/src/resources/device/claim-recovery-gateway.ts`, built from `src/platform-runtime-claim-recovery.ts` (likewise deferred), and the daemon keeps the transaction — what to rebuild from (the dead owner's recorded state dir), in what order, and when to dispose it. diff --git a/docs/adr/0022-daemon-platform-runtime-coupling.md b/docs/adr/0022-daemon-platform-runtime-coupling.md index 2e00200e3a..8963f6e7a8 100644 --- a/docs/adr/0022-daemon-platform-runtime-coupling.md +++ b/docs/adr/0022-daemon-platform-runtime-coupling.md @@ -11,7 +11,7 @@ ADR classified (the gateway/diagnostics/resource-cleanup/lifecycle edges, the pr hubs, and the platform-services and claim-recovery dynamic edges) moved out of `packages/daemon/src/` into the process-root composition module `src/daemon-composition.ts`, which R76 does not see because it is no longer a daemon-zone importer. #3430 then routed the leaked selector-query edge -(`packages/daemon/src/direct-ios-selector.ts`) through the request-bound runtime binding, so the R76 +(`packages/daemon/src/core/direct-ios-selector.ts`) through the request-bound runtime binding, so the R76 inventory is empty; with nothing left to classify, the same change collapsed R76 to a plain ban on the coupling and deleted the classification machinery, per the rule's own kill criterion. The section-2 outcomes below remain the record of how each was classified. @@ -64,7 +64,7 @@ or owning issue. #2278 audited all four concerns at `27a97ee619`. are daemon-policy-essential. Selector production and lifecycle participation stay separate. - **#2333 (done)** — lifecycle participation of platform resource owners. The `apple-runner-owner` and `operation-host` edges are retired; `daemon-runtime.ts` now holds - only the typed `PlatformOwnerLifecycle` contract (`packages/daemon/src/platform-owner-lifecycle.ts`), + only the typed `PlatformOwnerLifecycle` contract (`packages/daemon/src/core/platform-owner-lifecycle.ts`), composed at the root by `platform-runtime-daemon-lifecycle.ts`, which is the sole importer of the Apple runner owner, the Android snapshot-helper and Web orphan cleanups, and legacy app-log marker recovery. The `resource-cleanup` edge stays, reclassified diff --git a/docs/adr/0023-end-state-hop-trace.md b/docs/adr/0023-end-state-hop-trace.md index 0b75f3cbd8..db08f74e55 100644 --- a/docs/adr/0023-end-state-hop-trace.md +++ b/docs/adr/0023-end-state-hop-trace.md @@ -20,7 +20,7 @@ that reading. - **Unit**: one distinct production `.ts` file entered on the call path, counted once even if re-entered (a lazy `import()` of an already-counted file is not a new hop). Type-only imports and files that only supply types are not hops. -- **Range**: from the daemon's HTTP entry file (`packages/daemon/src/server/http-server.ts`) through the +- **Range**: from the daemon's HTTP entry file (`packages/daemon/src/server/http/http-server.ts`) through the file that issues the concrete platform call, inclusive of both endpoints. For `press`/Android that is the serial-scoped `adb shell input tap` invocation; for `snapshot`/iOS it is the `socket.write` to the in-simulator AX bridge (primary arm) or the `fetch()` to the XCTest @@ -59,7 +59,7 @@ that reading. 41 files: 11 pass-through, 5 translation, 5 policy, 19 orchestration, 1 terminal (adapter). The request spine also runs side-calls that are not hops — they execute on every request but are -not the call that continues toward the platform boundary: `packages/daemon/src/server/daemon-idle-reap.ts` +not the call that continues toward the platform boundary: `packages/daemon/src/sessions/server/daemon-idle-reap.ts` (`cancel()` resets the liveness timer as a sibling of `dispatchRequest`), `packages/host-kit/src/internal/transport.ts` (`timingSafeStringEqual` compares the auth token before the continuation), and `packages/host-kit/src/internal/request-cancel.ts` @@ -67,22 +67,22 @@ before the continuation), and `packages/host-kit/src/internal/request-cancel.ts` | # | File | Hand-off | Role | Delete-test | |---|------|----------|------|-------------| -| 1 | `packages/daemon/src/server/http-server.ts` | parses `/rpc`, resolves the token; calls injected `handleRequest` | pass-through | KEEP — HTTP entry boundary | -| 2 | `packages/daemon/src/server/daemon-runtime.ts` | `handleRequest`: in-flight count, cancels idle reap, `dispatchRequest` | orchestration | KEEP — request lifecycle orchestration | -| 3 | `packages/daemon/src/request-router.ts` | auth, flag guards, scope creation, locked execution, handler chain | orchestration | KEEP — request admission + dispatch core | +| 1 | `packages/daemon/src/server/http/http-server.ts` | parses `/rpc`, resolves the token; calls injected `handleRequest` | pass-through | KEEP — HTTP entry boundary | +| 2 | `packages/daemon/src/server/http/daemon-runtime.ts` | `handleRequest`: in-flight count, cancels idle reap, `dispatchRequest` | orchestration | KEEP — request lifecycle orchestration | +| 3 | `packages/daemon/src/server/request-router.ts` | auth, flag guards, scope creation, locked execution, handler chain | orchestration | KEEP — request admission + dispatch core | | 4 | `packages/host-kit/src/internal/diagnostics.ts` | `withDiagnosticsScope` wraps the request task | pass-through | KEEP — per-request diagnostic attribution | | 5 | `src/request/device-inventory-context.ts` | `withDeviceInventoryContext` wraps the task | pass-through | KEEP — request-scoped device inventory context | | 6 | `src/core/dispatch-resolve.ts` | `withResolveTargetDeviceCacheScope` wraps the task | orchestration | KEEP — per-request target-resolution cache | -| 7 | `packages/daemon/src/request-execution-scope.ts` | `createRequestExecutionScope`; `runLocked`/`runAdmitted` | orchestration | KEEP — scoped execution + lock/claim admission | +| 7 | `packages/daemon/src/server/request-execution-scope.ts` | `createRequestExecutionScope`; `runLocked`/`runAdmitted` | orchestration | KEEP — scoped execution + lock/claim admission | | 8 | `src/provider-device-runtime.ts` | `withProviderDeviceRuntimeScope` (`AsyncLocalStorage.run`) | pass-through | KEEP — provider-runtime scope boundary | -| 9 | `packages/daemon/src/request-handler-chain.ts` | `runRequestHandlerChain` routes to the interaction handler | orchestration | KEEP — command routing | -| 10 | `packages/daemon/src/interaction/index.ts` | route facade delegates to `handleInteractionCommands` | orchestration | KEEP — shared interaction route facade | -| 11 | `packages/daemon/src/interaction/internal/interaction.ts` | switches `press` to `dispatchTargetedTouchViaRuntime` | policy | KEEP — touch command routing | -| 12 | `packages/daemon/src/interaction/internal/interaction-touch-press.ts` | admits the touch, dispatches the runtime interaction | orchestration | KEEP — press admission + orchestration | -| 13 | `packages/daemon/src/interaction/internal/interaction-touch-prepare.ts` | `prepareTouchDispatch` → `resolveBoundTouchRuntime` | translation | KEEP — shared admission + bind seam | -| 14 | `packages/daemon/src/touch-runtime.ts` | resolves the plan, `bind(device, tapPointUse)` | orchestration | KEEP — tap runtime binding | -| 15 | `packages/daemon/src/runtime-admission.ts` | `admitRuntimeOperations`: `inspectFacts`, per-op admission | policy | KEEP — per-operation admission | -| 16 | `packages/daemon/src/request-runtime-binding.ts` | `bindDevice`: per-device-cached `gateway.bind` | orchestration | KEEP — device runtime binding | +| 9 | `packages/daemon/src/sessions/request-handler-chain.ts` | `runRequestHandlerChain` routes to the interaction handler | orchestration | KEEP — command routing | +| 10 | `packages/daemon/src/execution/interaction/index.ts` | route facade delegates to `handleInteractionCommands` | orchestration | KEEP — shared interaction route facade | +| 11 | `packages/daemon/src/execution/interaction/internal/interaction.ts` | switches `press` to `dispatchTargetedTouchViaRuntime` | policy | KEEP — touch command routing | +| 12 | `packages/daemon/src/execution/interaction/internal/interaction-touch-press.ts` | admits the touch, dispatches the runtime interaction | orchestration | KEEP — press admission + orchestration | +| 13 | `packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.ts` | `prepareTouchDispatch` → `resolveBoundTouchRuntime` | translation | KEEP — shared admission + bind seam | +| 14 | `packages/daemon/src/core/touch-runtime.ts` | resolves the plan, `bind(device, tapPointUse)` | orchestration | KEEP — tap runtime binding | +| 15 | `packages/daemon/src/core/runtime-admission.ts` | `admitRuntimeOperations`: `inspectFacts`, per-op admission | policy | KEEP — per-operation admission | +| 16 | `packages/daemon/src/core/request-runtime-binding.ts` | `bindDevice`: per-device-cached `gateway.bind` | orchestration | KEEP — device runtime binding | | 17 | `src/platform-runtime-gateway.ts` | `loadLocal` → `loadHost` → `loadRuntime` | orchestration | KEEP — gateway boundary | | 18 | `src/platform-runtime.ts` | wires the android module, supplies `loadHost` | pass-through | KEEP — declared ADR §1/§2 registry boundary | | 19 | `src/platform-runtime-operation-host.ts` | `createPlatformRuntimeHost` assembles the host | orchestration | KEEP — host composition | @@ -90,12 +90,12 @@ before the continuation), and `packages/host-kit/src/internal/request-cancel.ts` | 21 | `packages/platform-android/src/runtime.ts` | `bind`: `inspectFacts` (fan-out site), builds the tap operation | orchestration | KEEP — android runtime owner | | 22 | `packages/contracts/src/local-interactor-operation-set.ts` | `bindLocalInteractorOperationSet` → `bindLocalTouchInteractor` | translation | KEEP — tap op mapped to the interactor | | 23 | `src/daemon/device-claim-admission.ts` | `admit`: owner claim rule; ordinary owner | policy | KEEP — device claim admission | -| 24 | `packages/daemon/src/interaction/internal/interaction-touch-runtime.ts` | `dispatchRuntimeInteraction` → `createInteractionRuntimeForRoute` | orchestration | KEEP — interaction runtime dispatch | -| 25 | `packages/daemon/src/interaction/internal/interaction-runtime.ts` | `createInteractionAgentDevice` with the executor backend | orchestration | KEEP — agent device construction | +| 24 | `packages/daemon/src/execution/interaction/internal/interaction-touch-runtime.ts` | `dispatchRuntimeInteraction` → `createInteractionRuntimeForRoute` | orchestration | KEEP — interaction runtime dispatch | +| 25 | `packages/daemon/src/execution/interaction/internal/interaction-runtime.ts` | `createInteractionAgentDevice` with the executor backend | orchestration | KEEP — agent device construction | | 26 | `src/runtime.ts` | `createAgentDevice`: backend + `bindCommands` | orchestration | KEEP — agent device facade | | 27 | `src/commands/index.ts` | `bindCommands` → `bindInteractionCommands` | orchestration | KEEP — command catalog boundary | | 28 | `src/commands/interaction/runtime/index.ts` | `bindInteractionCommands`: `press` → `pressCommand` | orchestration | KEEP — nine-command binding surface | -| 29 | `packages/daemon/src/interaction/internal/interaction-touch-android-readiness.ts` | `runWithAndroidDialogReadinessCheck` wraps `run` | policy | KEEP — blocking-dialog readiness gate | +| 29 | `packages/daemon/src/execution/interaction/internal/interaction-touch-android-readiness.ts` | `runWithAndroidDialogReadinessCheck` wraps `run` | policy | KEEP — blocking-dialog readiness gate | | 30 | `src/commands/interaction/runtime/interactions.ts` | `pressCommand` → `tapCommand`: resolve target, `backend.tap` | orchestration | KEEP — tap command execution | | 31 | `src/commands/interaction/runtime/resolution.ts` | `resolveInteractionTarget` applies guards, returns the point | translation | KEEP — tap target resolution | | 32 | `packages/contracts/src/interactor-operation-binding.ts` | `interactorFor` resolves the local interactor | translation | KEEP — shared interactor resolution seam | @@ -125,11 +125,11 @@ only by its named composition module per ADR Decision §1). `tv-remote`, `viewport` (each `-runtime.ts`). **Response path (not hops).** 8 files execute only after the platform call: -`packages/daemon/src/interaction/internal/interaction-touch-response.ts`, -`packages/daemon/src/interaction/internal/interaction-common.ts`, -`packages/daemon/src/interaction-surface-signature.ts`, `packages/daemon/src/request-finalization.ts`, -`packages/session-journal/src/session-event-log.ts`, `packages/daemon/src/session-snapshot.ts`, -`packages/daemon/src/recording-gestures.ts`, `packages/daemon/src/deferred-interaction-outcome.ts`. +`packages/daemon/src/execution/interaction/internal/interaction-touch-response.ts`, +`packages/daemon/src/execution/interaction/internal/interaction-common.ts`, +`packages/daemon/src/core/interaction-surface-signature.ts`, `packages/daemon/src/server/request-finalization.ts`, +`packages/session-journal/src/session-event-log.ts`, `packages/daemon/src/execution/session-snapshot.ts`, +`packages/daemon/src/core/recording-gestures.ts`, `packages/daemon/src/core/deferred-interaction-outcome.ts`. **Forks not followed**: `request-platform-provider-context.ts` (the call is guarded by the router's early return for a bare local daemon — zero runtimes + non-web), @@ -149,31 +149,31 @@ captures join it). Shared prefix 30 files; primary arm 47 distinct (30 + 17); fallback arm 49 distinct (30 + 19); 66 distinct files across the union. The request spine's side-calls — the idle-reap reset, the auth comparison, the cancellation gate, and the Android freshness guard/clear -(`packages/daemon/src/session-snapshot-freshness.ts`, a guard read plus a post-capture clear that no-ops +(`packages/daemon/src/core/session-snapshot-freshness.ts`, a guard read plus a post-capture clear that no-ops on iOS) — run on this prefix as siblings of the continuation and are not counted. ### Shared prefix (entry → fork) | # | File | Hand-off | Role | Delete-test | |---|------|----------|------|-------------| -| 1 | `packages/daemon/src/server/http-server.ts` | parses `/rpc`, resolves the token; calls injected `handleRequest` | pass-through | KEEP — HTTP entry boundary | -| 2 | `packages/daemon/src/server/daemon-runtime.ts` | `handleRequest`: in-flight count, cancels idle reap, `dispatchRequest` | orchestration | KEEP — request lifecycle orchestration | -| 3 | `packages/daemon/src/request-router.ts` | auth, flag guards, scope creation, locked execution, handler chain | orchestration | KEEP — request admission + dispatch core | +| 1 | `packages/daemon/src/server/http/http-server.ts` | parses `/rpc`, resolves the token; calls injected `handleRequest` | pass-through | KEEP — HTTP entry boundary | +| 2 | `packages/daemon/src/server/http/daemon-runtime.ts` | `handleRequest`: in-flight count, cancels idle reap, `dispatchRequest` | orchestration | KEEP — request lifecycle orchestration | +| 3 | `packages/daemon/src/server/request-router.ts` | auth, flag guards, scope creation, locked execution, handler chain | orchestration | KEEP — request admission + dispatch core | | 4 | `packages/host-kit/src/internal/diagnostics.ts` | `withDiagnosticsScope` wraps the request task | pass-through | KEEP — per-request diagnostic attribution | | 5 | `src/request/device-inventory-context.ts` | `withDeviceInventoryContext` wraps the task | pass-through | KEEP — request-scoped device inventory context | | 6 | `src/core/dispatch-resolve.ts` | `withResolveTargetDeviceCacheScope` wraps the task | orchestration | KEEP — per-request target-resolution cache | -| 7 | `packages/daemon/src/request-execution-scope.ts` | `createRequestExecutionScope`; `runLocked`/`runAdmitted` | orchestration | KEEP — scoped execution + lock/claim admission | +| 7 | `packages/daemon/src/server/request-execution-scope.ts` | `createRequestExecutionScope`; `runLocked`/`runAdmitted` | orchestration | KEEP — scoped execution + lock/claim admission | | 8 | `src/provider-device-runtime.ts` | `withProviderDeviceRuntimeScope` (`AsyncLocalStorage.run`) | pass-through | KEEP — provider-runtime scope boundary | -| 9 | `packages/daemon/src/request-handler-chain.ts` | `runRequestHandlerChain` routes `snapshot` to `runSnapshotHandler` | orchestration | KEEP — command routing | -| 10 | `packages/daemon/src/handlers/snapshot.ts` | `handleSnapshotCommands` routes the plain arm | policy | KEEP — snapshot command routing | -| 11 | `packages/daemon/src/snapshot-runtime.ts` | `dispatchSnapshotViaRuntime` → `params.execute` | pass-through | KEEP — snapshot execute seam (route tests pin it) | -| 12 | `packages/daemon/src/snapshot-command-runtime.ts` | resolves the bound capture; wires session/backend; runs the op | orchestration | KEEP — capture wiring + recording | -| 13 | `packages/daemon/src/deferred-interaction-outcome.ts` | `resolveDeferredInteractionOutcome` before a fresh capture | policy | KEEP — pending-outcome settlement (may short-circuit) | -| 14 | `packages/daemon/src/snapshot-capture.ts` | `resolveSnapshotScope` + the capture attempt | orchestration | KEEP — capture attempt + scope resolution | -| 15 | `packages/daemon/src/snapshot-session.ts` | `resolveSessionDevice` for the capture | translation | KEEP — snapshot session/device resolution | -| 16 | `packages/daemon/src/snapshot-runtime-binding.ts` | `resolveBoundSnapshotCaptureRuntime`: admit-then-bind | policy | KEEP — ADR 0019 §9 admit-then-bind seam | -| 17 | `packages/daemon/src/session-runtime-admission.ts` | `admitRuntimePlan` (fan-out site) / `requireRuntimeBinding` | policy | KEEP — runtime plan fact admission | -| 18 | `packages/daemon/src/request-runtime-binding.ts` | `bindDevice`: per-device-cached `gateway.bind` | orchestration | KEEP — device runtime binding | +| 9 | `packages/daemon/src/sessions/request-handler-chain.ts` | `runRequestHandlerChain` routes `snapshot` to `runSnapshotHandler` | orchestration | KEEP — command routing | +| 10 | `packages/daemon/src/sessions/handlers/snapshot.ts` | `handleSnapshotCommands` routes the plain arm | policy | KEEP — snapshot command routing | +| 11 | `packages/daemon/src/sessions/snapshot-runtime.ts` | `dispatchSnapshotViaRuntime` → `params.execute` | pass-through | KEEP — snapshot execute seam (route tests pin it) | +| 12 | `packages/daemon/src/sessions/snapshot-command-runtime.ts` | resolves the bound capture; wires session/backend; runs the op | orchestration | KEEP — capture wiring + recording | +| 13 | `packages/daemon/src/core/deferred-interaction-outcome.ts` | `resolveDeferredInteractionOutcome` before a fresh capture | policy | KEEP — pending-outcome settlement (may short-circuit) | +| 14 | `packages/daemon/src/core/snapshot-capture.ts` | `resolveSnapshotScope` + the capture attempt | orchestration | KEEP — capture attempt + scope resolution | +| 15 | `packages/daemon/src/core/snapshot-session.ts` | `resolveSessionDevice` for the capture | translation | KEEP — snapshot session/device resolution | +| 16 | `packages/daemon/src/core/snapshot-runtime-binding.ts` | `resolveBoundSnapshotCaptureRuntime`: admit-then-bind | policy | KEEP — ADR 0019 §9 admit-then-bind seam | +| 17 | `packages/daemon/src/core/session-runtime-admission.ts` | `admitRuntimePlan` (fan-out site) / `requireRuntimeBinding` | policy | KEEP — runtime plan fact admission | +| 18 | `packages/daemon/src/core/request-runtime-binding.ts` | `bindDevice`: per-device-cached `gateway.bind` | orchestration | KEEP — device runtime binding | | 19 | `src/platform-runtime-gateway.ts` | `loadLocal` → `loadHost` → `loadRuntime` | orchestration | KEEP — gateway boundary | | 20 | `src/platform-runtime.ts` | wires the apple module, supplies `loadHost` | pass-through | KEEP — declared ADR §1/§2 registry boundary | | 21 | `src/platform-runtime-operation-host.ts` | `createPlatformRuntimeHost` assembles the host | orchestration | KEEP — host composition | @@ -242,10 +242,10 @@ Re-entry: arm B #4 enters `packages/platform-apple/src/index.ts` (shared #22) vi above, as side-calls of the admission step. **Response path (not hops).** 22 files execute only after the platform call: -`packages/daemon/src/ref-frame.ts`, `packages/daemon/src/session-action-recorder.ts`, -`packages/daemon/src/snapshot-quality-latch.ts`, `packages/daemon/src/request-finalization.ts`, -`packages/session-journal/src/session-event-request.ts`, `packages/daemon/src/session-snapshot.ts` (lineage), -`packages/daemon/src/sparse-fallback-screenshot.ts`, `src/core/snapshot-state.ts`, +`packages/daemon/src/core/ref-frame.ts`, `packages/daemon/src/core/session-action-recorder.ts`, +`packages/daemon/src/sessions/snapshot-quality-latch.ts`, `packages/daemon/src/server/request-finalization.ts`, +`packages/session-journal/src/session-event-request.ts`, `packages/daemon/src/execution/session-snapshot.ts` (lineage), +`packages/daemon/src/execution/sparse-fallback-screenshot.ts`, `src/core/snapshot-state.ts`, `packages/contracts/src/capture.ts`, `packages/platform-apple/src/runner/snapshot-presentation.ts`, `src/snapshot/ios-snapshot-runtime.ts`, the `packages/capture-kit/src/ios-snapshot-engine/` modules (engine, invariants, geometry, geometry-policy, projection, graph, diff --git a/docs/adr/0033-collocation-decision-table.md b/docs/adr/0033-collocation-decision-table.md index 16f9bf7494..f1ed258c1c 100644 --- a/docs/adr/0033-collocation-decision-table.md +++ b/docs/adr/0033-collocation-decision-table.md @@ -79,7 +79,7 @@ already owns the operations behind the vocabulary. | `src/diagnostics.ts` | keep | The diagnostics seam every zone imports (AGENTS.md mandates it); highest fan-in in the repo is what a substrate looks like, not misplacement. | | `src/internal/request-cancel.ts` | keep | Request-cancellation mechanics AGENTS.md routes to `host-kit/request`; internal beside its facade is already the collocation. | | `src/request.ts` | keep | Cross-layer request contracts AGENTS.md names as a host-kit seam; consumers span every zone. | -| `src/session-paths.ts` | keep | Session-artifact path grammar the daemon, cli, and platforms all resolve; AGENTS.md keeps the path *policy* in `packages/daemon/src/session-artifact-paths.ts`, which consumes this. | +| `src/session-paths.ts` | keep | Session-artifact path grammar the daemon, cli, and platforms all resolve; AGENTS.md keeps the path *policy* in `packages/daemon/src/core/session-artifact-paths.ts`, which consumes this. | ### kernel diff --git a/docs/agents/cli-flags.md b/docs/agents/cli-flags.md index d15af0578c..1b253fef28 100644 --- a/docs/agents/cli-flags.md +++ b/docs/agents/cli-flags.md @@ -28,7 +28,7 @@ Thread a flag only through the layers that consume it: interface exposes it. 6. `src/client/client-normalizers.ts`: update daemon flag normalization only when the request still needs a public-to-internal translation. -7. `packages/daemon/src/context.ts` and `packages/daemon/src/dispatch-context.ts`: add the field only when it flows into +7. `packages/daemon/src/core/context.ts` and `packages/daemon/src/core/dispatch-context.ts`: add the field only when it flows into platform dispatch. 8. Handler/platform modules: thread the option only after the command surface, grammar, and projection prove it belongs there. diff --git a/docs/agents/testing.md b/docs/agents/testing.md index e922b0e81a..67b67d00f3 100644 --- a/docs/agents/testing.md +++ b/docs/agents/testing.md @@ -133,7 +133,7 @@ Run `pnpm depgraph affected` before touching a high-fan-in module: ```sh pnpm depgraph affected packages/host-kit/src/command.ts -pnpm depgraph affected packages/daemon/src/ref-frame.ts --json --limit 25 +pnpm depgraph affected packages/daemon/src/core/ref-frame.ts --json --limit 25 ``` Use its dependent, command, and guarantee-cell report to scope inspection. `pnpm check:affected --run` diff --git a/fallow-baselines/health.json b/fallow-baselines/health.json index e5e6afe7f0..69012dce0e 100644 --- a/fallow-baselines/health.json +++ b/fallow-baselines/health.json @@ -25,22 +25,22 @@ "count": 1 } }, - "packages/daemon/src/interaction/internal/find.ts": { + "packages/daemon/src/execution/interaction/internal/find.ts": { "complexity_moderate": { "count": 1 } }, - "packages/daemon/src/handlers/snapshot-settings.ts": { + "packages/daemon/src/execution/handlers/snapshot-settings.ts": { "complexity_moderate": { "count": 1 } }, - "packages/daemon/src/recording-gestures.ts": { + "packages/daemon/src/core/recording-gestures.ts": { "complexity_moderate": { "count": 1 } }, - "packages/daemon/src/session-selector.ts": { + "packages/daemon/src/core/session-selector.ts": { "complexity_moderate": { "count": 1 } @@ -80,13 +80,13 @@ "target_keys": [ "src/daemon-client/daemon-client.ts:high impact", "src/cli/parser/args.ts:high impact", - "packages/daemon/src/lease-context.ts:high impact", + "packages/daemon/src/core/lease-context.ts:high impact", "packages/replay-port/src/daemon-port/session-replay-heal.ts:high impact", - "packages/daemon/src/context.ts:high impact", - "packages/daemon/src/handlers/session.ts:complexity", + "packages/daemon/src/core/context.ts:high impact", + "packages/daemon/src/sessions/handlers/session.ts:complexity", "packages/selectors/src/internal/predicates.ts:high impact", "packages/provision-kit/src/boot-diagnostics.ts:complexity", - "packages/daemon/src/session-routing.ts:high impact", + "packages/daemon/src/sessions/session-routing.ts:high impact", "src/commands/cli-grammar/common.ts:high impact", "packages/kernel/src/success-text.ts:high impact", "src/cli.ts:complexity", @@ -95,8 +95,8 @@ "packages/kernel/src/rect-center.ts:high impact", "packages/platform-apple/src/core/app-launch.ts:complexity", "packages/kernel/src/record.ts:high impact", - "packages/daemon/src/daemon-command-registry.ts:high impact", - "packages/daemon/src/handlers/session-doctor-output.ts:high impact", + "packages/daemon/src/core/daemon-command-registry.ts:high impact", + "packages/daemon/src/sessions/handlers/session-doctor-output.ts:high impact", "packages/platform-apple/src/core/perf-xml.ts:high impact", "src/client/screenshot-result.ts:high impact", "packages/platform-web/src/json-utils.ts:high impact", diff --git a/oxlint.config.ts b/oxlint.config.ts index 822051a174..e6fd79d90b 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -124,7 +124,7 @@ export default defineConfig({ { files: [ 'src/daemon-client/daemon-client-rpc.ts', - 'packages/daemon/src/downloadable-artifact-http.ts', + 'packages/daemon/src/server/downloadable-artifact-http.ts', 'src/remote/remote-request-diagnostics.ts', 'src/remote/upload-stream.ts', ], @@ -135,7 +135,7 @@ export default defineConfig({ }, { files: [ - 'packages/daemon/src/__tests__/replay-target/session-replay-target-verification-runtime.test.ts', + 'packages/daemon/src/sessions/__tests__/replay-target/session-replay-target-verification-runtime.test.ts', ], rules: { 'unicorn/prefer-string-raw': 'off', diff --git a/packages/ad-replay/src/internal/__tests__/step-loop.test.ts b/packages/ad-replay/src/internal/__tests__/step-loop.test.ts index bf274b8d32..0ab25f33f5 100644 --- a/packages/ad-replay/src/internal/__tests__/step-loop.test.ts +++ b/packages/ad-replay/src/internal/__tests__/step-loop.test.ts @@ -14,7 +14,7 @@ import type { TargetAnnotationV1 } from '@agent-device/contracts/replay'; * `packages/replay-port/src/daemon-port/native-command.ts` (`runReplayCommand`) does. The equivalent * daemon-level assertions (full `SessionStore`/`runReplayCommand` round * trip, including the `--keep-session` live-session postcondition) live in - * `packages/daemon/src/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts` + * `packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts` * (renamed from `session-replay-terminal-lifecycle.test.ts` by the #1555 * structural-quality review — see that file's own header for the rationale); * this file covers the SAME suppression decision at the cheaper, diff --git a/packages/ad-script/src/internal/open-script.ts b/packages/ad-script/src/internal/open-script.ts index 816f1a46e0..451e6a2a37 100644 --- a/packages/ad-script/src/internal/open-script.ts +++ b/packages/ad-script/src/internal/open-script.ts @@ -14,7 +14,7 @@ import { * (or falls back to) that accumulation. Two independent daemon/package call * sites needed exactly this scan and, before this move, each carried its own * copy: `packages/ad-replay/src/internal/inspect.ts`'s plan-digest platform - * precedence, and `packages/daemon/src/replay-device-selection.ts`'s + * precedence, and `packages/daemon/src/server/replay-device-selection.ts`'s * `readScriptReplaySelection` (fused into its own single pass alongside an * app-target scan). A `src/` root file cannot become a façade dependency * (R11), and a workspace package may not reach back into root `src/` either diff --git a/packages/capture-kit/src/mobile-snapshot-semantics.test.ts b/packages/capture-kit/src/mobile-snapshot-semantics.test.ts index e263131c4b..c875a2b8da 100644 --- a/packages/capture-kit/src/mobile-snapshot-semantics.test.ts +++ b/packages/capture-kit/src/mobile-snapshot-semantics.test.ts @@ -644,7 +644,7 @@ test('mobile presentation does not let contradictory scroll indicator add hidden }); // #1542: isConfirmedOnScreenProbe is the pure geometry boundary the off-screen -// refusal double-check's direct probe (packages/daemon/src/offscreen-target-probe.ts) +// refusal double-check's direct probe (packages/daemon/src/execution/offscreen-target-probe.ts) // reduces its confirm/don't-confirm decision to, once it has a fresh, // tree-independent read of the target. Each branch below is proved with a // counterfactual per docs/agents/testing.md — see the comment on each test diff --git a/packages/capture-kit/src/mobile-snapshot-semantics.ts b/packages/capture-kit/src/mobile-snapshot-semantics.ts index 7ef629c4a3..6c121269d0 100644 --- a/packages/capture-kit/src/mobile-snapshot-semantics.ts +++ b/packages/capture-kit/src/mobile-snapshot-semantics.ts @@ -84,7 +84,7 @@ function analyzeMobileSnapshotVisibility(nodes: SnapshotNode[]): { /** * #1542: the pure geometry boundary the off-screen refusal double-check's - * direct probe (`packages/daemon/src/offscreen-target-probe.ts`) reduces its decision + * direct probe (`packages/daemon/src/execution/offscreen-target-probe.ts`) reduces its decision * to, once it has a fresh, tree-independent read of one element. A probe * confirms the element genuinely on-screen only when BOTH hold: XCTest's own * live hit-test says `hittable`, AND the tap point sits inside the root diff --git a/packages/capture-kit/src/snapshot-chrome.ts b/packages/capture-kit/src/snapshot-chrome.ts index f1d993259d..3276987fbc 100644 --- a/packages/capture-kit/src/snapshot-chrome.ts +++ b/packages/capture-kit/src/snapshot-chrome.ts @@ -375,7 +375,7 @@ export function collectSettleChromeRefs( * only excludes nodes whose OWN type is `keyboard` still leaks every key and * assistant control as "discriminating" evidence. * - * Used by `packages/daemon/src/interaction-surface-signature.ts`'s post-gesture + * Used by `packages/daemon/src/core/interaction-surface-signature.ts`'s post-gesture * baseline-distrust discriminating-overlap classification (#1542 defect 2, * #1563 review): that comparison operates on flat signature entries with no * ref-selection budget of its own, so it needs the ref set directly rather diff --git a/packages/command-registry/src/registry.ts b/packages/command-registry/src/registry.ts index d6d2467d2b..6a509dceb3 100644 --- a/packages/command-registry/src/registry.ts +++ b/packages/command-registry/src/registry.ts @@ -136,7 +136,7 @@ export type DescriptorCatalogRecord = { /** * The literal union of every command whose `daemon.route` is `'session'`. - * Drives `SESSION_COMMAND_HANDLER_IMPLS` in `packages/daemon/src/handlers/session.ts`: adding a + * Drives `SESSION_COMMAND_HANDLER_IMPLS` in `packages/daemon/src/sessions/handlers/session.ts`: adding a * session-routed descriptor without a matching handler table entry is a compile error rather * than a runtime routing gap caught only by `expectHandlerResponse`. */ @@ -165,7 +165,7 @@ export type DescriptorDaemonRouteCommandName = // --------------------------------------------------------------------------- // Daemon request-policy trait bundles — copied VERBATIM from -// packages/daemon/src/daemon-command-registry.ts (DAEMON_COMMAND_DESCRIPTORS). +// packages/daemon/src/core/daemon-command-registry.ts (DAEMON_COMMAND_DESCRIPTORS). // --------------------------------------------------------------------------- const ADMISSION_AND_LOCK_EXEMPT = { @@ -509,7 +509,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'human_control', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/human-control.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/human-control.ts'] as const } : {}), catalog: { group: 'internal', key: 'humanControl' }, recordsSessionAction: false, @@ -529,7 +529,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'lease_allocate', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/lease.ts'] as const } : {}), catalog: { group: 'internal', key: 'leaseAllocate' }, recordsSessionAction: false, @@ -546,7 +546,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'lease_heartbeat', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/lease.ts'] as const } : {}), catalog: { group: 'internal', key: 'leaseHeartbeat' }, recordsSessionAction: false, @@ -564,7 +564,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'lease_release', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/lease.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/lease.ts'] as const } : {}), catalog: { group: 'internal', key: 'leaseRelease' }, recordsSessionAction: false, @@ -600,7 +600,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'session_list', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/session-lifecycle/internal/inventory.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/session-lifecycle/internal/inventory.ts'] as const } : {}), catalog: { group: 'internal', key: 'sessionList' }, recordsSessionAction: false, @@ -618,7 +618,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'session_save_script', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/session-script-publication.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/session-script-publication.ts'] as const } : {}), catalog: { group: 'internal', key: 'sessionSaveScript' }, recordsSessionAction: false, @@ -895,8 +895,8 @@ export const RAW_COMMAND_DESCRIPTORS = [ ...(ownerFilesEnabled ? { ownerFiles: [ - 'packages/daemon/src/handlers/session-runtime-command.ts', - 'packages/daemon/src/handlers/session-runtime-port-reverse.ts', + 'packages/daemon/src/sessions/handlers/session-runtime-command.ts', + 'packages/daemon/src/sessions/handlers/session-runtime-port-reverse.ts', ] as const, } : {}), @@ -961,7 +961,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'install_source', deviceClaimPolicy: 'transient-exclusive', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/session-app-source-deployment.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/session-app-source-deployment.ts'] as const } : {}), catalog: { group: 'internal', @@ -979,7 +979,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ name: 'release_materialized_paths', deviceClaimPolicy: 'none', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/handlers/session-app-source-deployment.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/sessions/handlers/session-app-source-deployment.ts'] as const } : {}), catalog: { group: 'internal', key: 'releaseMaterializedPaths' }, recordsSessionAction: false, @@ -1511,7 +1511,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ { name: 'scroll', ...(ownerFilesEnabled - ? { ownerFiles: ['packages/daemon/src/scroll-runtime.ts'] as const } + ? { ownerFiles: ['packages/daemon/src/execution/scroll-runtime.ts'] as const } : {}), catalog: { group: 'public' }, frameworkTier: 'core', @@ -1561,7 +1561,7 @@ export const RAW_COMMAND_DESCRIPTORS = [ ? { ownerFiles: [ 'src/commands/capture/screenshot.ts', - 'packages/daemon/src/screenshot-runtime.ts', + 'packages/daemon/src/execution/screenshot-runtime.ts', ] as const, } : {}), diff --git a/packages/contracts/src/app-state.ts b/packages/contracts/src/app-state.ts index 73f2952dbf..da9e927c37 100644 --- a/packages/contracts/src/app-state.ts +++ b/packages/contracts/src/app-state.ts @@ -3,7 +3,7 @@ import type { SessionSurface } from './session-surface.ts'; /** * Closed result of the `appstate` command, grounded in the daemon handler's - * success returns (packages/daemon/src/handlers/session-appstate.ts `handleAppStateCommand`). + * success returns (packages/daemon/src/sessions/handlers/session-appstate.ts `handleAppStateCommand`). * A discriminated union on `platform`: * - Apple (`ios` / `macos`) session state, with iOS-only device locators that * the previous hand-written mirror omitted; and diff --git a/packages/contracts/src/clipboard.ts b/packages/contracts/src/clipboard.ts index 17571c32be..0a400bcd7f 100644 --- a/packages/contracts/src/clipboard.ts +++ b/packages/contracts/src/clipboard.ts @@ -1,6 +1,6 @@ /** * Closed result of the `clipboard` command. Mirrors the session runtime's - * literal return exactly (`packages/daemon/src/handlers/session-clipboard.ts`): a + * literal return exactly (`packages/daemon/src/execution/handlers/session-clipboard.ts`): a * discriminated union on `action`. `read` returns the clipboard `text`; `write` * reports the written `textLength` plus the `successText` message. The handler * spreads nothing else, so each branch is closed. diff --git a/packages/contracts/src/device.ts b/packages/contracts/src/device.ts index a04e38e296..b4bb813331 100644 --- a/packages/contracts/src/device.ts +++ b/packages/contracts/src/device.ts @@ -8,7 +8,7 @@ import type { TargetShutdownResult } from './target-shutdown-contract.ts'; /** * Closed result of the `boot` command. Mirrors the daemon handler's only - * success return EXACTLY (packages/daemon/src/handlers/session-boot.ts via + * success return EXACTLY (packages/daemon/src/sessions/handlers/session-boot.ts via * session-device-status-response.ts) — the fixed * object literal `{ platform, target, device, id, kind, booted }` plus the * additive `appleOs` discriminant, emitted only for Apple devices. @@ -33,7 +33,7 @@ export type BootCommandResult = { /** * Closed result of the `shutdown` command. Mirrors the daemon handler's success - * return EXACTLY (packages/daemon/src/handlers/session-shutdown.ts via + * return EXACTLY (packages/daemon/src/sessions/handlers/session-shutdown.ts via * session-device-status-response.ts) — the fixed object * literal `{ platform, target, device, id, kind, shutdown }` plus the additive * `appleOs` discriminant (Apple devices only). The `shutdown` field is the raw diff --git a/packages/contracts/src/dispatch-disclosure.fixtures.ts b/packages/contracts/src/dispatch-disclosure.fixtures.ts index 6a35323f7e..bcf8d9ab65 100644 --- a/packages/contracts/src/dispatch-disclosure.fixtures.ts +++ b/packages/contracts/src/dispatch-disclosure.fixtures.ts @@ -38,7 +38,7 @@ export const DISPATCH_DISCLOSURE_TABLE_PATH = path.join( */ export const DISPATCH_DISCLOSURE_DRIVER_OWNERS: Readonly> = { 'daemon.': 'src/__tests__/daemon-composition/interaction/interaction-dispatch-disclosure.test.ts', - 'daemon.scroll-no-progress': 'packages/daemon/src/__tests__/scroll-movement.test.ts', + 'daemon.scroll-no-progress': 'packages/daemon/src/execution/__tests__/scroll-movement.test.ts', 'daemon.route.': 'src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts', 'post-action-guard.': 'src/__tests__/daemon-composition/interaction/interaction-dispatch-disclosure.test.ts', diff --git a/packages/contracts/src/interaction-guarantees.ts b/packages/contracts/src/interaction-guarantees.ts index 021b6b03c8..f783faa40e 100644 --- a/packages/contracts/src/interaction-guarantees.ts +++ b/packages/contracts/src/interaction-guarantees.ts @@ -179,7 +179,7 @@ const RUNTIME_TREE_TARGET_STABILITY: GuaranteeEnforcement = { // (interaction-response-construction-guard.test.ts) keeps new branches on it. const SHARED_RESPONSE_CONSTRUCTION: GuaranteeEnforcement = { kind: 'runtime', - via: 'packages/daemon/src/interaction/internal/interaction-touch-response.ts#buildInteractionResponseData', + via: 'packages/daemon/src/execution/interaction/internal/interaction-touch-response.ts#buildInteractionResponseData', }; // runtime-selector, runtime-ref, and coordinate share this waiver: all three finalize through @@ -192,7 +192,7 @@ const TAP_OUTCOME_NOT_OBSERVED_GAP: GuaranteeEnforcement = { trackingIssue: TAP_OUTCOME_NOT_OBSERVED_GAP_ISSUE, }; -// Both Maestro-compatible fast paths (packages/daemon/src/interaction/internal/interaction-touch-direct-ios.ts) +// Both Maestro-compatible fast paths (packages/daemon/src/execution/interaction/internal/interaction-touch-direct-ios.ts) // dispatch ONE fused XCTest runner request (`command: 'tap'` with a selectorKey/selectorValue) built // in packages/platform-apple/src/interactions.ts#tapElementSelector — not the separate // packages/maestro/ flow-script engine, which drives standalone `.yaml` Maestro flows and never @@ -205,7 +205,7 @@ const DIRECT_IOS_SINGLE_QUERY_READINESS: GuaranteeEnforcement = { // Shares the SAME reasoning as TAP_OUTCOME_NOT_OBSERVED_GAP: the tap outcome is not observed on the // success path here either. The shared ambiguous-XCTest-failure corroboration -// (packages/daemon/src/interaction/internal/interaction-ios-tap-outcome.ts#corroborateIosTapFailure) is +// (packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.ts#corroborateIosTapFailure) is // invoked identically from this fast path and from the tree-based runtime dispatch, but only ever // reconsiders a THROWN error — it never validates a call that returned success, so it is not a // baseline outcome claim for either path. @@ -282,7 +282,7 @@ const RUNTIME_TREE_SHARED_GUARANTEES = { responseConstruction: SHARED_RESPONSE_CONSTRUCTION, responseIdentity: { kind: 'runtime', - via: 'packages/daemon/src/interaction/internal/interaction-touch-targets.ts#interactionResultExtra', + via: 'packages/daemon/src/execution/interaction/internal/interaction-touch-targets.ts#interactionResultExtra', }, verifyEvidence: { kind: 'runtime', @@ -390,7 +390,7 @@ export const INTERACTION_DISPATCH_PATHS: Record(); const { selectionFromResolveTargetDevice } = - await import('../../__tests__/device-selection-stub.ts'); + await import('../device-selection-stub.ts'); const resolveTargetDevice = vi.fn(); return { ...actual, @@ -25,7 +25,7 @@ vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal resolveTargetDeviceSelection: vi.fn(selectionFromResolveTargetDevice(resolveTargetDevice)), }; }); -vi.mock('../../device/device-ready.ts', () => ({ ensureDeviceReady: vi.fn(async () => {}) })); +vi.mock('../../../core/device/device-ready.ts', () => ({ ensureDeviceReady: vi.fn(async () => {}) })); vi.mock('@agent-device/platform-apple/runner/operations', async (importOriginal) => { const actual = await importOriginal(); @@ -72,23 +72,23 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, runCmd: vi.fn(async () => ({ stdout: '', stderr: '', exitCode: 0 })) }; }); -vi.mock('../../materialized-path-registry.ts', async (importOriginal) => { - const actual = await importOriginal(); +vi.mock('../../../sessions/materialized-path-registry.ts', async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, cleanupRetainedMaterializedPathsForSession: vi.fn(async () => {}) }; }); import * as path from 'node:path'; -import { cleanupRetainedMaterializedPathsForSession } from '../../materialized-path-registry.ts'; -import { SessionStore } from '../../session-store.ts'; -import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +import { cleanupRetainedMaterializedPathsForSession } from '../../../sessions/materialized-path-registry.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; -import { ensureDeviceReady } from '../../device/device-ready.ts'; +import { ensureDeviceReady } from '../../../core/device/device-ready.ts'; import { applyRuntimeHintsFixture, clearRuntimeHintsFixture, dispatchApplicationLifecycleEffect, -} from '../../__tests__/application-lifecycle-runtime-fixture.ts'; +} from '../application-lifecycle-runtime-fixture.ts'; import { prepareIosRunner, prewarmAppleRunnerCache, diff --git a/packages/daemon/src/handlers/__tests__/snapshot-handler.fixtures.ts b/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts similarity index 93% rename from packages/daemon/src/handlers/__tests__/snapshot-handler.fixtures.ts rename to packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts index a5d350f263..bfda7d8786 100644 --- a/packages/daemon/src/handlers/__tests__/snapshot-handler.fixtures.ts +++ b/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts @@ -7,13 +7,13 @@ import { buildSnapshotSignatures } from '@agent-device/capture-kit/snapshot-fres import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, -} from '../../request-runtime-binding.ts'; -import { snapshotRuntimeFixture } from '../../__tests__/snapshot-runtime-fixture.ts'; -import { SessionStore } from '../../session-store.ts'; -import type { DaemonRequest } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; -import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../snapshot.ts'; -import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; +} from '../../../core/request-runtime-binding.ts'; +import { snapshotRuntimeFixture } from '../snapshot-runtime-fixture.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import type { DaemonRequest } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; +import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../../../sessions/handlers/snapshot.ts'; +import { platformResourceCleanupFixture } from '../platform-resource-cleanup-fixture.ts'; export function makeSessionStore(): SessionStore { const root = mkdtempForTestSync('agent-device-snapshot-handler-'); diff --git a/packages/daemon/src/__tests__/human-control-fixtures.ts b/packages/daemon/src/__tests__/support/human-control-fixtures.ts similarity index 92% rename from packages/daemon/src/__tests__/human-control-fixtures.ts rename to packages/daemon/src/__tests__/support/human-control-fixtures.ts index b5c2a9b5ff..3a117db731 100644 --- a/packages/daemon/src/__tests__/human-control-fixtures.ts +++ b/packages/daemon/src/__tests__/support/human-control-fixtures.ts @@ -1,7 +1,7 @@ import type { HumanControlHold, HumanControlHoldScope } from '@agent-device/contracts/client'; import type { DeviceLease } from '@agent-device/contracts/device'; -import type { AllocateLeaseRequest } from '../lease-registry-scope.ts'; -import type { DaemonRequest } from '../daemon-request.ts'; +import type { AllocateLeaseRequest } from '../../resources/lease-registry-scope.ts'; +import type { DaemonRequest } from '../../core/daemon-request.ts'; import { AppError } from '@agent-device/kernel/errors'; export const HUMAN_CONTROL_SCOPE: HumanControlHoldScope = { diff --git a/packages/daemon/src/__tests__/human-control-router-fixture.ts b/packages/daemon/src/__tests__/support/human-control-router-fixture.ts similarity index 73% rename from packages/daemon/src/__tests__/human-control-router-fixture.ts rename to packages/daemon/src/__tests__/support/human-control-router-fixture.ts index 095fa4d8fb..54ed1c1295 100644 --- a/packages/daemon/src/__tests__/human-control-router-fixture.ts +++ b/packages/daemon/src/__tests__/support/human-control-router-fixture.ts @@ -3,16 +3,16 @@ import { daemonPlatformServicesFixture, daemonClaimRecoveryGatewayFixture, } from './platform-services-fixture.ts'; -import { makeIosAppSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; -import { buildSessionLeaseFromRequest } from '../lease-context.ts'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { createRequestHandler } from '../request-router.ts'; -import { providerCredentialsFixture } from './support/provider-credentials-fixture.ts'; -import { tenantScopedSessionName } from '../session-tenant-scope.ts'; +import { makeIosAppSession } from './session-factories.ts'; +import { makeSessionStore } from './store-factory.ts'; +import { buildSessionLeaseFromRequest } from '../../core/lease-context.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { createRequestHandler } from '../../server/request-router.ts'; +import { providerCredentialsFixture } from './provider-credentials-fixture.ts'; +import { tenantScopedSessionName } from '../../core/session-tenant-scope.ts'; import { lifecycleDeviceRuntimeGateway } from './test-device-runtime-gateway.ts'; import { HUMAN_CONTROL_LEASE_REQUEST, humanControlRequest } from './human-control-fixtures.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from './command-surface-fake.ts'; export function createHumanControlHarness() { const registry = new LeaseRegistry(); diff --git a/packages/daemon/src/__tests__/legacy-snapshot-capture-fixture.ts b/packages/daemon/src/__tests__/support/legacy-snapshot-capture-fixture.ts similarity index 96% rename from packages/daemon/src/__tests__/legacy-snapshot-capture-fixture.ts rename to packages/daemon/src/__tests__/support/legacy-snapshot-capture-fixture.ts index a206866f21..8979396f22 100644 --- a/packages/daemon/src/__tests__/legacy-snapshot-capture-fixture.ts +++ b/packages/daemon/src/__tests__/support/legacy-snapshot-capture-fixture.ts @@ -1,7 +1,7 @@ import { vi } from 'vitest'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { SnapshotResult } from '@agent-device/contracts/interactor-types'; -import type { captureSnapshotWithInteractor } from '../snapshot-interactor-capture.ts'; +import type { captureSnapshotWithInteractor } from '../../core/snapshot-interactor-capture.ts'; type CaptureParams = Parameters[0]; diff --git a/packages/daemon/src/__tests__/support/platform-resource-cleanup-fixture.ts b/packages/daemon/src/__tests__/support/platform-resource-cleanup-fixture.ts index c97551d7f5..1a8b0c7edd 100644 --- a/packages/daemon/src/__tests__/support/platform-resource-cleanup-fixture.ts +++ b/packages/daemon/src/__tests__/support/platform-resource-cleanup-fixture.ts @@ -1,5 +1,5 @@ import { vi, type Mock } from 'vitest'; -import type { PlatformResourceCleanup } from '../../platform-resource-cleanup.ts'; +import type { PlatformResourceCleanup } from '../../core/platform-resource-cleanup.ts'; /** Every member observable as a spy, which is how the daemon suites read the fixture back. */ export type PlatformResourceCleanupFixture = { diff --git a/packages/daemon/src/__tests__/platform-services-fixture.ts b/packages/daemon/src/__tests__/support/platform-services-fixture.ts similarity index 94% rename from packages/daemon/src/__tests__/platform-services-fixture.ts rename to packages/daemon/src/__tests__/support/platform-services-fixture.ts index 62dc9ae641..8a1aad0e95 100644 --- a/packages/daemon/src/__tests__/platform-services-fixture.ts +++ b/packages/daemon/src/__tests__/support/platform-services-fixture.ts @@ -2,9 +2,9 @@ import { vi } from 'vitest'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { SessionSurface } from '@agent-device/contracts/session'; import type { DeviceBootObservation } from '@agent-device/contracts/device-boot'; -import type { ClaimRecoveryGatewayFactory } from '../device/claim-recovery-gateway.ts'; -import type { DaemonPlatformServices } from '../platform-services.ts'; -import { unavailableDeviceRuntimeGateway } from './support/unavailable-device-runtime-gateway.ts'; +import type { ClaimRecoveryGatewayFactory } from '../../resources/device/claim-recovery-gateway.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; +import { unavailableDeviceRuntimeGateway } from './unavailable-device-runtime-gateway.ts'; /** * The `DaemonPlatformServices` port as the daemon suites answer it: every member is a plain diff --git a/packages/daemon/src/__tests__/support/provider-device-admission-fixture.ts b/packages/daemon/src/__tests__/support/provider-device-admission-fixture.ts index 6ddbaa6c54..f48d53eee7 100644 --- a/packages/daemon/src/__tests__/support/provider-device-admission-fixture.ts +++ b/packages/daemon/src/__tests__/support/provider-device-admission-fixture.ts @@ -1,6 +1,6 @@ import type { ProviderDeviceRuntime } from '@agent-device/contracts/device'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { installProviderDeviceAdmission } from '../../provider-device-admission.ts'; +import { installProviderDeviceAdmission } from '../../core/provider-device-admission.ts'; /** * Provider ownership as the daemon consumes it: the `ProviderDeviceAdmission` port over a list diff --git a/packages/daemon/src/__tests__/request-router-dispatch-mocks.ts b/packages/daemon/src/__tests__/support/request-router-dispatch-mocks.ts similarity index 100% rename from packages/daemon/src/__tests__/request-router-dispatch-mocks.ts rename to packages/daemon/src/__tests__/support/request-router-dispatch-mocks.ts diff --git a/packages/daemon/src/__tests__/runtime-binding-conformance.ts b/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts similarity index 89% rename from packages/daemon/src/__tests__/runtime-binding-conformance.ts rename to packages/daemon/src/__tests__/support/runtime-binding-conformance.ts index f7f5294998..6bbdfe1025 100644 --- a/packages/daemon/src/__tests__/runtime-binding-conformance.ts +++ b/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts @@ -13,30 +13,30 @@ import { commandRuntimeUseRequirements, } from '@agent-device/command-registry/registry'; import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; -import { resolveBoundBackRuntime } from '../back-runtime.ts'; -import { resolveBoundFocusRuntime } from '../focus-runtime.ts'; -import { resolveBoundFoldRuntime } from '../fold-runtime.ts'; -import { resolveBoundGestureRuntime } from '../gesture-runtime.ts'; -import { resolveBoundOrientationRuntime } from '../orientation-runtime.ts'; -import type { ResolvedGenericExecution } from '../generic-leaf-execution.ts'; +import { makeSession } from './session-factories.ts'; +import { makeSessionStore } from './store-factory.ts'; +import { resolveBoundBackRuntime } from '../../execution/back-runtime.ts'; +import { resolveBoundFocusRuntime } from '../../execution/focus-runtime.ts'; +import { resolveBoundFoldRuntime } from '../../execution/fold-runtime.ts'; +import { resolveBoundGestureRuntime } from '../../core/gesture-runtime.ts'; +import { resolveBoundOrientationRuntime } from '../../execution/orientation-runtime.ts'; +import type { ResolvedGenericExecution } from '../../core/generic-leaf-execution.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, RuntimeAdmissionBindings, -} from '../request-runtime-binding.ts'; -import { dispatchSnapshotDiffViaRuntime } from '../snapshot-diff-runtime.ts'; +} from '../../core/request-runtime-binding.ts'; +import { dispatchSnapshotDiffViaRuntime } from '../../sessions/snapshot-diff-runtime.ts'; import { isSystemButtonCommand, resolveBoundSystemButtonRuntime, type SystemButtonCommand, -} from '../system-button-runtime.ts'; -import { resolveBoundTvRemoteRuntime } from '../tv-remote-runtime.ts'; -import { resolveBoundTypeTextRuntime } from '../type-text-runtime.ts'; -import { resolveBoundViewportRuntime } from '../viewport-runtime.ts'; +} from '../../execution/system-button-runtime.ts'; +import { resolveBoundTvRemoteRuntime } from '../../execution/tv-remote-runtime.ts'; +import { resolveBoundTypeTextRuntime } from '../../execution/type-text-runtime.ts'; +import { resolveBoundViewportRuntime } from '../../execution/viewport-runtime.ts'; import type { DaemonFailureResponse } from '@agent-device/kernel/contracts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from './command-surface-fake.ts'; type RuntimeOperation = RuntimeOperationKey; diff --git a/packages/daemon/src/__tests__/support/screen-recording-live-handle.ts b/packages/daemon/src/__tests__/support/screen-recording-live-handle.ts index 7276477b0a..de62056477 100644 --- a/packages/daemon/src/__tests__/support/screen-recording-live-handle.ts +++ b/packages/daemon/src/__tests__/support/screen-recording-live-handle.ts @@ -5,7 +5,7 @@ import { import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { ScreenRecordingLiveSnapshot } from '@agent-device/contracts/screen-recording-runtime'; import { deviceIdentity } from '@agent-device/kernel/device'; -import type { SessionState } from '../../session-state.ts'; +import type { SessionState } from '../../core/session-state.ts'; type ScreenRecordingOverrides = Partial; diff --git a/packages/daemon/src/__tests__/screenshot-runtime-fixture.ts b/packages/daemon/src/__tests__/support/screenshot-runtime-fixture.ts similarity index 97% rename from packages/daemon/src/__tests__/screenshot-runtime-fixture.ts rename to packages/daemon/src/__tests__/support/screenshot-runtime-fixture.ts index 4049fbfb9f..739c65f27c 100644 --- a/packages/daemon/src/__tests__/screenshot-runtime-fixture.ts +++ b/packages/daemon/src/__tests__/support/screenshot-runtime-fixture.ts @@ -20,8 +20,8 @@ import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import fs from 'node:fs'; import { vi, type Mock } from 'vitest'; import { PNG } from '@agent-device/capture-kit/png'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { unavailableDeviceRuntimeGateway } from './support/unavailable-device-runtime-gateway.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { unavailableDeviceRuntimeGateway } from './unavailable-device-runtime-gateway.ts'; import { type TapPointInput, touchRuntimeOperationFacts, diff --git a/packages/daemon/src/__tests__/selector-capture-fixture.ts b/packages/daemon/src/__tests__/support/selector-capture-fixture.ts similarity index 94% rename from packages/daemon/src/__tests__/selector-capture-fixture.ts rename to packages/daemon/src/__tests__/support/selector-capture-fixture.ts index 1cd6bf5998..71b441976f 100644 --- a/packages/daemon/src/__tests__/selector-capture-fixture.ts +++ b/packages/daemon/src/__tests__/support/selector-capture-fixture.ts @@ -12,9 +12,9 @@ import { snapshotRuntimeOperationFacts, } from '@agent-device/contracts/snapshot-runtime'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; -import { isActiveProviderDevice } from '../provider-device-admission.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { unavailableDeviceRuntimeGateway } from './support/unavailable-device-runtime-gateway.ts'; +import { isActiveProviderDevice } from '../../core/provider-device-admission.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { unavailableDeviceRuntimeGateway } from './unavailable-device-runtime-gateway.ts'; const available: RuntimeOperationFact = Object.freeze({ available: true }); diff --git a/packages/daemon/src/__tests__/support/session-factories.ts b/packages/daemon/src/__tests__/support/session-factories.ts index ad7dcb43c6..546a6d8f29 100644 --- a/packages/daemon/src/__tests__/support/session-factories.ts +++ b/packages/daemon/src/__tests__/support/session-factories.ts @@ -1,8 +1,8 @@ -import type { SessionState } from '../../session-state.ts'; +import type { SessionState } from '../../core/session-state.ts'; import type { SessionScriptPublicationState, SessionScriptRepairStatus, -} from '../../session-script-publication-state.ts'; +} from '../../core/session-script-publication-state.ts'; import { IOS_SIMULATOR, ANDROID_EMULATOR, diff --git a/packages/daemon/src/session-observability/internal/__tests__/network-runtime-harness.ts b/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts similarity index 97% rename from packages/daemon/src/session-observability/internal/__tests__/network-runtime-harness.ts rename to packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts index cd88cad1c0..06ac4a6cfd 100644 --- a/packages/daemon/src/session-observability/internal/__tests__/network-runtime-harness.ts +++ b/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts @@ -10,7 +10,7 @@ import { import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import type { BindDeviceRuntime } from '../../../request-runtime-binding.ts'; +import type { BindDeviceRuntime } from '../../../../core/request-runtime-binding.ts'; export function createNetworkRuntime( device: DeviceInfo, diff --git a/packages/daemon/src/__tests__/session-teardown.fixtures.ts b/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts similarity index 94% rename from packages/daemon/src/__tests__/session-teardown.fixtures.ts rename to packages/daemon/src/__tests__/support/session-teardown.fixtures.ts index 94b56f37af..77c4b499a2 100644 --- a/packages/daemon/src/__tests__/session-teardown.fixtures.ts +++ b/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts @@ -4,8 +4,8 @@ import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-r import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; import { screenRecordingResourceStore } from '@agent-device/capture-kit/screen-recording-resource-store'; -import type { SessionStore } from '../session-store.ts'; -import type { SessionState } from '../session-state.ts'; +import type { SessionStore } from '../../core/session-store.ts'; +import type { SessionState } from '../../core/session-state.ts'; export function makeRecordingSession(params: { name: string; diff --git a/packages/daemon/src/__tests__/snapshot-runtime-fixture.ts b/packages/daemon/src/__tests__/support/snapshot-runtime-fixture.ts similarity index 96% rename from packages/daemon/src/__tests__/snapshot-runtime-fixture.ts rename to packages/daemon/src/__tests__/support/snapshot-runtime-fixture.ts index e97687d0fe..b35814c2dc 100644 --- a/packages/daemon/src/__tests__/snapshot-runtime-fixture.ts +++ b/packages/daemon/src/__tests__/support/snapshot-runtime-fixture.ts @@ -6,7 +6,7 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; -import type { DaemonPlatformServices } from '../platform-services.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; import { legacyDispatchCapture } from './legacy-snapshot-capture-fixture.ts'; import { type AlertRuntimeInput, @@ -37,11 +37,11 @@ import { } from '@agent-device/kernel/device'; import { applePlugin } from '@agent-device/platform-apple'; import { textSizeSettingPayload } from '@agent-device/contracts/settings'; -import { type DispatchContext } from '../dispatch-context.ts'; +import { type DispatchContext } from '../../core/dispatch-context.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; -import { isActiveProviderDevice } from '../provider-device-admission.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { unavailableDeviceRuntimeGateway } from './support/unavailable-device-runtime-gateway.ts'; +import { isActiveProviderDevice } from '../../core/provider-device-admission.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { unavailableDeviceRuntimeGateway } from './unavailable-device-runtime-gateway.ts'; import { writeSolidPng } from './screenshot-runtime-fixture.ts'; /** diff --git a/packages/daemon/src/__tests__/support/store-factory.ts b/packages/daemon/src/__tests__/support/store-factory.ts index 0c5bf00423..4ad650155d 100644 --- a/packages/daemon/src/__tests__/support/store-factory.ts +++ b/packages/daemon/src/__tests__/support/store-factory.ts @@ -1,7 +1,7 @@ import path from 'node:path'; -import { SessionStore } from '../../session-store.ts'; +import { SessionStore } from '../../core/session-store.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import type { SessionRef, SessionState } from '../../session-state.ts'; +import type { SessionRef, SessionState } from '../../core/session-state.ts'; export function makeSessionStore(prefix = 'agent-device-test-'): SessionStore { const tempRoot = mkdtempForTestSync(prefix); diff --git a/packages/daemon/src/__tests__/test-device-runtime-gateway.ts b/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts similarity index 95% rename from packages/daemon/src/__tests__/test-device-runtime-gateway.ts rename to packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts index d4b604d099..13ea6b5f15 100644 --- a/packages/daemon/src/__tests__/test-device-runtime-gateway.ts +++ b/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts @@ -17,8 +17,8 @@ import type { ScrollDirectionInput } from '@agent-device/contracts/scroll-runtim import { createRequestHandler as createProductionRequestHandler, type RequestRouterDeps, -} from '../request-router.ts'; -import type { BindDeviceRuntime } from '../request-runtime-binding.ts'; +} from '../../server/request-router.ts'; +import type { BindDeviceRuntime } from '../../core/request-runtime-binding.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { applicationLifecycleRuntimeFixture, @@ -26,18 +26,18 @@ import { } from './application-lifecycle-runtime-fixture.ts'; import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; import { withClientReplayScriptSources } from '@agent-device/replay-port/replay-script-source-fixtures'; -import type { DaemonInvokeFn } from '../daemon-request.ts'; +import type { DaemonInvokeFn } from '../../core/daemon-request.ts'; import { clearAndroidObservationFixture } from './android-observation-fixture.ts'; import { daemonClaimRecoveryGatewayFixture, daemonPlatformServicesFixture, } from './platform-services-fixture.ts'; -import { platformResourceCleanupFixture } from './support/platform-resource-cleanup-fixture.ts'; -import { providerCredentialsFixture } from './support/provider-credentials-fixture.ts'; +import { platformResourceCleanupFixture } from './platform-resource-cleanup-fixture.ts'; +import { providerCredentialsFixture } from './provider-credentials-fixture.ts'; import { unavailableBinding, unavailableDeviceRuntimeGateway, -} from './support/unavailable-device-runtime-gateway.ts'; +} from './unavailable-device-runtime-gateway.ts'; const unavailable = Object.freeze({ available: false as const, diff --git a/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts b/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts index 84665a6fda..aefffccca4 100644 --- a/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts +++ b/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts @@ -6,7 +6,7 @@ import { import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; -import type { BindDeviceRuntime, BindExactDeviceRuntime } from '../../request-runtime-binding.ts'; +import type { BindDeviceRuntime, BindExactDeviceRuntime } from '../../core/request-runtime-binding.ts'; /** * The `DeviceRuntimeGateway` port answering that no owner on this host can bind the device: diff --git a/packages/daemon/src/__tests__/audio-probe-resource-recovery.test.ts b/packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts similarity index 100% rename from packages/daemon/src/__tests__/audio-probe-resource-recovery.test.ts rename to packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts diff --git a/packages/daemon/src/__tests__/capture-disclosure-target-activation-fact.ts b/packages/daemon/src/core/__tests__/capture-disclosure-target-activation-fact.ts similarity index 100% rename from packages/daemon/src/__tests__/capture-disclosure-target-activation-fact.ts rename to packages/daemon/src/core/__tests__/capture-disclosure-target-activation-fact.ts diff --git a/packages/daemon/src/__tests__/capture-disclosure-target-activation.test.ts b/packages/daemon/src/core/__tests__/capture-disclosure-target-activation.test.ts similarity index 100% rename from packages/daemon/src/__tests__/capture-disclosure-target-activation.test.ts rename to packages/daemon/src/core/__tests__/capture-disclosure-target-activation.test.ts diff --git a/packages/daemon/src/__tests__/config.test.ts b/packages/daemon/src/core/__tests__/config.test.ts similarity index 100% rename from packages/daemon/src/__tests__/config.test.ts rename to packages/daemon/src/core/__tests__/config.test.ts diff --git a/packages/daemon/src/__tests__/context.test.ts b/packages/daemon/src/core/__tests__/context.test.ts similarity index 100% rename from packages/daemon/src/__tests__/context.test.ts rename to packages/daemon/src/core/__tests__/context.test.ts diff --git a/packages/daemon/src/__tests__/daemon-command-registry.test.ts b/packages/daemon/src/core/__tests__/daemon-command-registry.test.ts similarity index 100% rename from packages/daemon/src/__tests__/daemon-command-registry.test.ts rename to packages/daemon/src/core/__tests__/daemon-command-registry.test.ts diff --git a/packages/daemon/src/__tests__/daemon-policy.test.ts b/packages/daemon/src/core/__tests__/daemon-policy.test.ts similarity index 95% rename from packages/daemon/src/__tests__/daemon-policy.test.ts rename to packages/daemon/src/core/__tests__/daemon-policy.test.ts index 5e5746003f..cf1557a2a5 100644 --- a/packages/daemon/src/__tests__/daemon-policy.test.ts +++ b/packages/daemon/src/core/__tests__/daemon-policy.test.ts @@ -1,27 +1,27 @@ import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { getResolveTargetDeviceMock } from './request-router-dispatch-mocks.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { getResolveTargetDeviceMock } from '../../__tests__/support/request-router-dispatch-mocks.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; vi.mock('../device/device-ready.ts', () => ({ ensureDeviceReady: vi.fn(async () => {}) })); import type { DeviceInfo } from '@agent-device/kernel/device'; import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { makeIosSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { parseDaemonPolicy } from '@agent-device/daemon-contracts/daemon-policy-file'; import { assertDaemonPolicyAdmitsRequest } from '../daemon-policy.ts'; import type { DaemonRequest } from '../daemon-request.ts'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { hostDiagnosticsFixture } from './support/host-diagnostics-fixture.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { hostDiagnosticsFixture } from '../../__tests__/support/host-diagnostics-fixture.ts'; import { createRequestHandler, lifecycleDeviceRuntimeGateway, systemRuntimeSpies, -} from './test-device-runtime-gateway.ts'; +} from '../../__tests__/support/test-device-runtime-gateway.ts'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); const OTHER_SIMULATOR: DeviceInfo = { ...IOS_SIMULATOR, id: 'sim-2', name: 'iPhone 16' }; diff --git a/packages/daemon/src/__tests__/daemon-request-wire.test.ts b/packages/daemon/src/core/__tests__/daemon-request-wire.test.ts similarity index 100% rename from packages/daemon/src/__tests__/daemon-request-wire.test.ts rename to packages/daemon/src/core/__tests__/daemon-request-wire.test.ts diff --git a/packages/daemon/src/__tests__/deferred-interaction-outcome.test.ts b/packages/daemon/src/core/__tests__/deferred-interaction-outcome.test.ts similarity index 100% rename from packages/daemon/src/__tests__/deferred-interaction-outcome.test.ts rename to packages/daemon/src/core/__tests__/deferred-interaction-outcome.test.ts diff --git a/packages/daemon/src/__tests__/direct-ios-selector.test.ts b/packages/daemon/src/core/__tests__/direct-ios-selector.test.ts similarity index 100% rename from packages/daemon/src/__tests__/direct-ios-selector.test.ts rename to packages/daemon/src/core/__tests__/direct-ios-selector.test.ts diff --git a/packages/daemon/src/__tests__/execution-plan.test.ts b/packages/daemon/src/core/__tests__/execution-plan.test.ts similarity index 95% rename from packages/daemon/src/__tests__/execution-plan.test.ts rename to packages/daemon/src/core/__tests__/execution-plan.test.ts index 75f41c0544..0a9481930d 100644 --- a/packages/daemon/src/__tests__/execution-plan.test.ts +++ b/packages/daemon/src/core/__tests__/execution-plan.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { resolvePlannedOperations } from '../execution-plan.ts'; -import { runBatchCommands } from '../handlers/session-batch.ts'; +import { runBatchCommands } from '../../sessions/handlers/session-batch.ts'; import type { DaemonRequest } from '../daemon-request.ts'; test('an open that ends its batch has an unknown future', () => { diff --git a/packages/daemon/src/__tests__/interaction-surface-signature.test.ts b/packages/daemon/src/core/__tests__/interaction-surface-signature.test.ts similarity index 99% rename from packages/daemon/src/__tests__/interaction-surface-signature.test.ts rename to packages/daemon/src/core/__tests__/interaction-surface-signature.test.ts index 23d20e2b68..5f27716f3a 100644 --- a/packages/daemon/src/__tests__/interaction-surface-signature.test.ts +++ b/packages/daemon/src/core/__tests__/interaction-surface-signature.test.ts @@ -226,7 +226,7 @@ test('classifyBaselineSurfaceEvidence excludes keyboard DESCENDANTS and window S /** * A keyboard-window subtree: a `[Keyboard]` container plus a SIBLING "Next * keyboard" assistant button under the same window — matches the shape in - * `packages/daemon/src/__tests__/post-gesture-stabilization-fixtures.ts`'s + * `packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts`'s * `keyboardWindowNodes` (kept local here rather than imported: this file's * fixtures are raw node literals consumed directly by * `buildInteractionSurfaceSignature`, not `SnapshotState`-wrapped like that diff --git a/packages/daemon/src/__tests__/interactor-resolution.test.ts b/packages/daemon/src/core/__tests__/interactor-resolution.test.ts similarity index 100% rename from packages/daemon/src/__tests__/interactor-resolution.test.ts rename to packages/daemon/src/core/__tests__/interactor-resolution.test.ts diff --git a/packages/daemon/src/__tests__/ios-comparison-key-fixture.ts b/packages/daemon/src/core/__tests__/ios-comparison-key-fixture.ts similarity index 100% rename from packages/daemon/src/__tests__/ios-comparison-key-fixture.ts rename to packages/daemon/src/core/__tests__/ios-comparison-key-fixture.ts diff --git a/packages/daemon/src/__tests__/is-predicates.test.ts b/packages/daemon/src/core/__tests__/is-predicates.test.ts similarity index 100% rename from packages/daemon/src/__tests__/is-predicates.test.ts rename to packages/daemon/src/core/__tests__/is-predicates.test.ts diff --git a/packages/daemon/src/__tests__/lease-context.test.ts b/packages/daemon/src/core/__tests__/lease-context.test.ts similarity index 100% rename from packages/daemon/src/__tests__/lease-context.test.ts rename to packages/daemon/src/core/__tests__/lease-context.test.ts diff --git a/packages/daemon/src/__tests__/managed-session-artifact-path.test.ts b/packages/daemon/src/core/__tests__/managed-session-artifact-path.test.ts similarity index 100% rename from packages/daemon/src/__tests__/managed-session-artifact-path.test.ts rename to packages/daemon/src/core/__tests__/managed-session-artifact-path.test.ts diff --git a/packages/daemon/src/__tests__/moving-target-baseline.test.ts b/packages/daemon/src/core/__tests__/moving-target-baseline.test.ts similarity index 100% rename from packages/daemon/src/__tests__/moving-target-baseline.test.ts rename to packages/daemon/src/core/__tests__/moving-target-baseline.test.ts diff --git a/packages/daemon/src/__tests__/post-gesture-no-effect-claim.test.ts b/packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts similarity index 100% rename from packages/daemon/src/__tests__/post-gesture-no-effect-claim.test.ts rename to packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts diff --git a/packages/daemon/src/__tests__/post-gesture-stabilization-fixtures.ts b/packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts similarity index 100% rename from packages/daemon/src/__tests__/post-gesture-stabilization-fixtures.ts rename to packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts diff --git a/packages/daemon/src/__tests__/post-gesture-stabilization-verdict.test.ts b/packages/daemon/src/core/__tests__/post-gesture-stabilization-verdict.test.ts similarity index 100% rename from packages/daemon/src/__tests__/post-gesture-stabilization-verdict.test.ts rename to packages/daemon/src/core/__tests__/post-gesture-stabilization-verdict.test.ts diff --git a/packages/daemon/src/__tests__/post-gesture-stabilization.test.ts b/packages/daemon/src/core/__tests__/post-gesture-stabilization.test.ts similarity index 100% rename from packages/daemon/src/__tests__/post-gesture-stabilization.test.ts rename to packages/daemon/src/core/__tests__/post-gesture-stabilization.test.ts diff --git a/packages/daemon/src/__tests__/provider-device-admission.test.ts b/packages/daemon/src/core/__tests__/provider-device-admission.test.ts similarity index 100% rename from packages/daemon/src/__tests__/provider-device-admission.test.ts rename to packages/daemon/src/core/__tests__/provider-device-admission.test.ts diff --git a/packages/daemon/src/__tests__/recording-gestures.test.ts b/packages/daemon/src/core/__tests__/recording-gestures.test.ts similarity index 98% rename from packages/daemon/src/__tests__/recording-gestures.test.ts rename to packages/daemon/src/core/__tests__/recording-gestures.test.ts index ca6f4521b2..a816fccc58 100644 --- a/packages/daemon/src/__tests__/recording-gestures.test.ts +++ b/packages/daemon/src/core/__tests__/recording-gestures.test.ts @@ -4,9 +4,9 @@ import { augmentScrollVisualizationResult, recordTouchVisualizationEvent, } from '../recording-gestures.ts'; -import { makeIosSession, makeMacOsSession } from './support/session-factories.ts'; +import { makeIosSession, makeMacOsSession } from '../../__tests__/support/session-factories.ts'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import type { ScreenRecordingLiveSnapshot } from '@agent-device/contracts/screen-recording-runtime'; import { TVOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; diff --git a/packages/daemon/src/__tests__/recording-timing.test.ts b/packages/daemon/src/core/__tests__/recording-timing.test.ts similarity index 100% rename from packages/daemon/src/__tests__/recording-timing.test.ts rename to packages/daemon/src/core/__tests__/recording-timing.test.ts diff --git a/packages/daemon/src/__tests__/ref-frame.test.ts b/packages/daemon/src/core/__tests__/ref-frame.test.ts similarity index 100% rename from packages/daemon/src/__tests__/ref-frame.test.ts rename to packages/daemon/src/core/__tests__/ref-frame.test.ts diff --git a/packages/daemon/src/__tests__/request-dispatch-ledger.test.ts b/packages/daemon/src/core/__tests__/request-dispatch-ledger.test.ts similarity index 100% rename from packages/daemon/src/__tests__/request-dispatch-ledger.test.ts rename to packages/daemon/src/core/__tests__/request-dispatch-ledger.test.ts diff --git a/packages/daemon/src/__tests__/request-runtime-binding-router.test.ts b/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts similarity index 95% rename from packages/daemon/src/__tests__/request-runtime-binding-router.test.ts rename to packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts index 25d1be7565..f94bcac0ad 100644 --- a/packages/daemon/src/__tests__/request-runtime-binding-router.test.ts +++ b/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts @@ -11,10 +11,10 @@ import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-d import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; -import { makeSessionStore } from './support/store-factory.ts'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; test('request binding disposes once after response while adopted app-log handle survives', async () => { const runtime = makeGateway(); diff --git a/packages/daemon/src/__tests__/request-runtime-binding.test.ts b/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts similarity index 99% rename from packages/daemon/src/__tests__/request-runtime-binding.test.ts rename to packages/daemon/src/core/__tests__/request-runtime-binding.test.ts index aa0cd94e6d..50ed9b7a76 100644 --- a/packages/daemon/src/__tests__/request-runtime-binding.test.ts +++ b/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { beforeEach, expect, test, vi } from 'vitest'; import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { diff --git a/packages/daemon/src/__tests__/runtime-operation-effects.test.ts b/packages/daemon/src/core/__tests__/runtime-operation-effects.test.ts similarity index 100% rename from packages/daemon/src/__tests__/runtime-operation-effects.test.ts rename to packages/daemon/src/core/__tests__/runtime-operation-effects.test.ts diff --git a/packages/daemon/src/__tests__/runtime-session.test.ts b/packages/daemon/src/core/__tests__/runtime-session.test.ts similarity index 95% rename from packages/daemon/src/__tests__/runtime-session.test.ts rename to packages/daemon/src/core/__tests__/runtime-session.test.ts index a9e963e83a..df96d306fe 100644 --- a/packages/daemon/src/__tests__/runtime-session.test.ts +++ b/packages/daemon/src/core/__tests__/runtime-session.test.ts @@ -1,7 +1,7 @@ import { test, expect } from 'vitest'; import fs from 'node:fs'; -import { makeSessionStore } from './support/store-factory.ts'; -import { makeIosSession } from './support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; import { flushDiagnosticsToSessionFile, withDiagnosticsScope, diff --git a/packages/daemon/src/__tests__/screen-recording-resource-recovery.test.ts b/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts similarity index 97% rename from packages/daemon/src/__tests__/screen-recording-resource-recovery.test.ts rename to packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts index 428e67e2d8..341fe10060 100644 --- a/packages/daemon/src/__tests__/screen-recording-resource-recovery.test.ts +++ b/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts @@ -6,7 +6,7 @@ import { localRuntimeOwner, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { recoverScreenRecordingResourceAfterDaemonLock } from '@agent-device/capture-kit/screen-recording-recovery'; diff --git a/packages/daemon/src/__tests__/selector-operation-binding.test.ts b/packages/daemon/src/core/__tests__/selector-operation-binding.test.ts similarity index 100% rename from packages/daemon/src/__tests__/selector-operation-binding.test.ts rename to packages/daemon/src/core/__tests__/selector-operation-binding.test.ts diff --git a/packages/daemon/src/__tests__/selector-recording-find-data.test.ts b/packages/daemon/src/core/__tests__/selector-recording-find-data.test.ts similarity index 100% rename from packages/daemon/src/__tests__/selector-recording-find-data.test.ts rename to packages/daemon/src/core/__tests__/selector-recording-find-data.test.ts diff --git a/packages/daemon/src/__tests__/selector-recording.test.ts b/packages/daemon/src/core/__tests__/selector-recording.test.ts similarity index 98% rename from packages/daemon/src/__tests__/selector-recording.test.ts rename to packages/daemon/src/core/__tests__/selector-recording.test.ts index 99c40b3d60..5090a1af02 100644 --- a/packages/daemon/src/__tests__/selector-recording.test.ts +++ b/packages/daemon/src/core/__tests__/selector-recording.test.ts @@ -11,7 +11,7 @@ import { test, expect } from 'vitest'; import path from 'node:path'; import { recordIfSession } from '../selector-recording.ts'; import { SessionStore } from '../session-store.ts'; -import { makeIosSession } from './support/session-factories.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; import type { DaemonRequest } from '../daemon-request.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; diff --git a/packages/daemon/src/__tests__/session-action-recorder.test.ts b/packages/daemon/src/core/__tests__/session-action-recorder.test.ts similarity index 99% rename from packages/daemon/src/__tests__/session-action-recorder.test.ts rename to packages/daemon/src/core/__tests__/session-action-recorder.test.ts index 505189f84a..d690110be7 100644 --- a/packages/daemon/src/__tests__/session-action-recorder.test.ts +++ b/packages/daemon/src/core/__tests__/session-action-recorder.test.ts @@ -8,7 +8,7 @@ import { isSessionRecording } from '../session-script-publication-capability.ts' */ import { test, expect } from 'vitest'; import { recordActionEntry } from '../session-action-recorder.ts'; -import { authoringPublication, makeIosSession } from './support/session-factories.ts'; +import { authoringPublication, makeIosSession } from '../../__tests__/support/session-factories.ts'; test('an observation-only action is excluded while repair-armed and no --record is given', () => { const session = makeIosSession('default', { diff --git a/packages/daemon/src/__tests__/session-artifact-paths.test.ts b/packages/daemon/src/core/__tests__/session-artifact-paths.test.ts similarity index 100% rename from packages/daemon/src/__tests__/session-artifact-paths.test.ts rename to packages/daemon/src/core/__tests__/session-artifact-paths.test.ts diff --git a/packages/daemon/src/__tests__/session-capture-binding.test.ts b/packages/daemon/src/core/__tests__/session-capture-binding.test.ts similarity index 98% rename from packages/daemon/src/__tests__/session-capture-binding.test.ts rename to packages/daemon/src/core/__tests__/session-capture-binding.test.ts index d44d732d86..254b0ca5fd 100644 --- a/packages/daemon/src/__tests__/session-capture-binding.test.ts +++ b/packages/daemon/src/core/__tests__/session-capture-binding.test.ts @@ -1,6 +1,6 @@ import { expect, test, vi } from 'vitest'; -import { makeSessionStore } from './support/store-factory.ts'; -import { makeRecordingSession } from './session-teardown.fixtures.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; +import { makeRecordingSession } from '../../__tests__/support/session-teardown.fixtures.ts'; import { bindSessionScreenRecording, bindRecordOnlyScreenRecording, diff --git a/packages/daemon/src/__tests__/session-runtime-admission.test.ts b/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts similarity index 98% rename from packages/daemon/src/__tests__/session-runtime-admission.test.ts rename to packages/daemon/src/core/__tests__/session-runtime-admission.test.ts index f15fbba70f..e31f3e9b84 100644 --- a/packages/daemon/src/__tests__/session-runtime-admission.test.ts +++ b/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts @@ -1,7 +1,7 @@ import { resolveSnapshotRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; import { expect, test } from 'vitest'; import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { snapshotRuntimeFixture } from './snapshot-runtime-fixture.ts'; +import { snapshotRuntimeFixture } from '../../__tests__/support/snapshot-runtime-fixture.ts'; import { admitRuntimePlan, unwrapAdmittedRuntimePlan, diff --git a/packages/daemon/src/__tests__/session-script-active-publication.test.ts b/packages/daemon/src/core/__tests__/session-script-active-publication.test.ts similarity index 100% rename from packages/daemon/src/__tests__/session-script-active-publication.test.ts rename to packages/daemon/src/core/__tests__/session-script-active-publication.test.ts diff --git a/packages/daemon/src/__tests__/session-script-publication-state.test.ts b/packages/daemon/src/core/__tests__/session-script-publication-state.test.ts similarity index 100% rename from packages/daemon/src/__tests__/session-script-publication-state.test.ts rename to packages/daemon/src/core/__tests__/session-script-publication-state.test.ts diff --git a/packages/daemon/src/__tests__/session-script-writer.test.ts b/packages/daemon/src/core/__tests__/session-script-writer.test.ts similarity index 99% rename from packages/daemon/src/__tests__/session-script-writer.test.ts rename to packages/daemon/src/core/__tests__/session-script-writer.test.ts index 3146071b53..8d1befb235 100644 --- a/packages/daemon/src/__tests__/session-script-writer.test.ts +++ b/packages/daemon/src/core/__tests__/session-script-writer.test.ts @@ -10,7 +10,7 @@ import { makeRepairCompleteSession, repairPublication, authoringPublication, -} from './support/session-factories.ts'; +} from '../../__tests__/support/session-factories.ts'; import { markRepairTransactionComplete } from '../session-replay-transaction.ts'; import { NO_SCRIPT_PUBLICATION, scriptTargetPath } from '../session-script-publication-state.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; diff --git a/packages/daemon/src/__tests__/session-selector.test.ts b/packages/daemon/src/core/__tests__/session-selector.test.ts similarity index 98% rename from packages/daemon/src/__tests__/session-selector.test.ts rename to packages/daemon/src/core/__tests__/session-selector.test.ts index af0efeb371..a51470fe26 100644 --- a/packages/daemon/src/__tests__/session-selector.test.ts +++ b/packages/daemon/src/core/__tests__/session-selector.test.ts @@ -1,4 +1,4 @@ -import { makeStoredSessionRef } from './support/store-factory.ts'; +import { makeStoredSessionRef } from '../../__tests__/support/store-factory.ts'; import { test } from 'vitest'; import assert from 'node:assert/strict'; import { assertSessionSelectorMatches } from '../session-selector.ts'; diff --git a/packages/daemon/src/__tests__/session-snapshot-freshness.test.ts b/packages/daemon/src/core/__tests__/session-snapshot-freshness.test.ts similarity index 100% rename from packages/daemon/src/__tests__/session-snapshot-freshness.test.ts rename to packages/daemon/src/core/__tests__/session-snapshot-freshness.test.ts diff --git a/packages/daemon/src/__tests__/session-store-lifetime.test.ts b/packages/daemon/src/core/__tests__/session-store-lifetime.test.ts similarity index 98% rename from packages/daemon/src/__tests__/session-store-lifetime.test.ts rename to packages/daemon/src/core/__tests__/session-store-lifetime.test.ts index 1873069483..a528264685 100644 --- a/packages/daemon/src/__tests__/session-store-lifetime.test.ts +++ b/packages/daemon/src/core/__tests__/session-store-lifetime.test.ts @@ -7,8 +7,8 @@ import { makeRepairCompleteSession, makeRepairArmedSession, authoringPublication, -} from './support/session-factories.ts'; -import { makeSessionStore, storeSessionForTest } from './support/store-factory.ts'; +} from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore, storeSessionForTest } from '../../__tests__/support/store-factory.ts'; import { resolveRepairTombstonePath } from '@agent-device/daemon-contracts/session-repair-tombstone'; const ADDRESS = 'cwd:worktree:default'; diff --git a/packages/daemon/src/__tests__/session-store.test.ts b/packages/daemon/src/core/__tests__/session-store.test.ts similarity index 99% rename from packages/daemon/src/__tests__/session-store.test.ts rename to packages/daemon/src/core/__tests__/session-store.test.ts index 41cb398a2b..33855f6c95 100644 --- a/packages/daemon/src/__tests__/session-store.test.ts +++ b/packages/daemon/src/core/__tests__/session-store.test.ts @@ -1,4 +1,4 @@ -import { storeSessionForTest } from './support/store-factory.ts'; +import { storeSessionForTest } from '../../__tests__/support/store-factory.ts'; import { test } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; @@ -9,7 +9,7 @@ import { buildRequestFinishedEvent } from '@agent-device/session-journal/session import { HEAL_COMPLETE_SENTINEL } from '../session-script-writer.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import type { TargetAnnotationV1 } from '@agent-device/contracts/replay'; -import { makeMacOsSession, repairPublication } from './support/session-factories.ts'; +import { makeMacOsSession, repairPublication } from '../../__tests__/support/session-factories.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; diff --git a/packages/daemon/src/__tests__/settle-observation-capture.test.ts b/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts similarity index 95% rename from packages/daemon/src/__tests__/settle-observation-capture.test.ts rename to packages/daemon/src/core/__tests__/settle-observation-capture.test.ts index 7f74cc6def..50c7e47084 100644 --- a/packages/daemon/src/__tests__/settle-observation-capture.test.ts +++ b/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts @@ -1,8 +1,8 @@ import { beforeEach, expect, test, vi } from 'vitest'; import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { makeIosSession } from './support/session-factories.ts'; -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; -import { selectorCaptureFixture } from './selector-capture-fixture.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; +import { selectorCaptureFixture } from '../../__tests__/support/selector-capture-fixture.ts'; import { resolveSettleObservationCapture } from '../settle-observation-capture.ts'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; diff --git a/packages/daemon/src/__tests__/snapshot-capture.test.ts b/packages/daemon/src/core/__tests__/snapshot-capture.test.ts similarity index 97% rename from packages/daemon/src/__tests__/snapshot-capture.test.ts rename to packages/daemon/src/core/__tests__/snapshot-capture.test.ts index 389e469178..d45e5bb42e 100644 --- a/packages/daemon/src/__tests__/snapshot-capture.test.ts +++ b/packages/daemon/src/core/__tests__/snapshot-capture.test.ts @@ -10,14 +10,14 @@ import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; import { legacyDispatchCapture, resetLegacySnapshotCapture, -} from './legacy-snapshot-capture-fixture.ts'; +} from '../../__tests__/support/legacy-snapshot-capture-fixture.ts'; import { androidCapture, androidDevice, androidTextRows, inboxBaselineNodes, makeAndroidFreshnessSession, -} from '../handlers/__tests__/snapshot-handler.fixtures.ts'; +} from '../../__tests__/support/handlers/snapshot-handler.fixtures.ts'; import { pendingSurfaceStabilization } from '../deferred-interaction-outcome.ts'; const captureSnapshotWithInteractor = vi.hoisted(() => vi.fn()); diff --git a/packages/daemon/src/__tests__/snapshot-interactor-capture.test.ts b/packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts similarity index 100% rename from packages/daemon/src/__tests__/snapshot-interactor-capture.test.ts rename to packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts diff --git a/packages/daemon/src/__tests__/snapshot-runtime-binding.test.ts b/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts similarity index 87% rename from packages/daemon/src/__tests__/snapshot-runtime-binding.test.ts rename to packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts index 4c5d6b6ad0..ac1e4abfa4 100644 --- a/packages/daemon/src/__tests__/snapshot-runtime-binding.test.ts +++ b/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts @@ -1,19 +1,19 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { expect, test, vi } from 'vitest'; import { resolveSnapshotRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { makeIosSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import type { BindDeviceRuntime } from '../request-runtime-binding.ts'; import { admitAndBindSnapshotCapture, resolveBoundSnapshotCaptureRuntime, } from '../snapshot-runtime-binding.ts'; import type { DaemonRequest } from '../daemon-request.ts'; -import { snapshotRuntimeFixture } from './snapshot-runtime-fixture.ts'; +import { snapshotRuntimeFixture } from '../../__tests__/support/snapshot-runtime-fixture.ts'; import { ensureDeviceReady } from '../device/device-ready.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; vi.mock('../device/device-ready.ts', () => ({ ensureDeviceReady: vi.fn(async () => {}) })); diff --git a/packages/daemon/src/__tests__/tenant-owned-entry.test.ts b/packages/daemon/src/core/__tests__/tenant-owned-entry.test.ts similarity index 100% rename from packages/daemon/src/__tests__/tenant-owned-entry.test.ts rename to packages/daemon/src/core/__tests__/tenant-owned-entry.test.ts diff --git a/packages/daemon/src/capture-disclosure.ts b/packages/daemon/src/core/capture-disclosure.ts similarity index 100% rename from packages/daemon/src/capture-disclosure.ts rename to packages/daemon/src/core/capture-disclosure.ts diff --git a/packages/daemon/src/config.ts b/packages/daemon/src/core/config.ts similarity index 100% rename from packages/daemon/src/config.ts rename to packages/daemon/src/core/config.ts diff --git a/packages/daemon/src/context.ts b/packages/daemon/src/core/context.ts similarity index 100% rename from packages/daemon/src/context.ts rename to packages/daemon/src/core/context.ts diff --git a/packages/daemon/src/daemon-command-registry.ts b/packages/daemon/src/core/daemon-command-registry.ts similarity index 100% rename from packages/daemon/src/daemon-command-registry.ts rename to packages/daemon/src/core/daemon-command-registry.ts diff --git a/packages/daemon/src/daemon-policy.ts b/packages/daemon/src/core/daemon-policy.ts similarity index 100% rename from packages/daemon/src/daemon-policy.ts rename to packages/daemon/src/core/daemon-policy.ts diff --git a/packages/daemon/src/daemon-request.ts b/packages/daemon/src/core/daemon-request.ts similarity index 100% rename from packages/daemon/src/daemon-request.ts rename to packages/daemon/src/core/daemon-request.ts diff --git a/packages/daemon/src/deferred-interaction-outcome.ts b/packages/daemon/src/core/deferred-interaction-outcome.ts similarity index 100% rename from packages/daemon/src/deferred-interaction-outcome.ts rename to packages/daemon/src/core/deferred-interaction-outcome.ts diff --git a/packages/daemon/src/device/device-ready.ts b/packages/daemon/src/core/device/device-ready.ts similarity index 100% rename from packages/daemon/src/device/device-ready.ts rename to packages/daemon/src/core/device/device-ready.ts diff --git a/packages/daemon/src/device/device-selector-intent.ts b/packages/daemon/src/core/device/device-selector-intent.ts similarity index 100% rename from packages/daemon/src/device/device-selector-intent.ts rename to packages/daemon/src/core/device/device-selector-intent.ts diff --git a/packages/daemon/src/direct-ios-selector.ts b/packages/daemon/src/core/direct-ios-selector.ts similarity index 100% rename from packages/daemon/src/direct-ios-selector.ts rename to packages/daemon/src/core/direct-ios-selector.ts diff --git a/packages/daemon/src/dispatch-context.ts b/packages/daemon/src/core/dispatch-context.ts similarity index 100% rename from packages/daemon/src/dispatch-context.ts rename to packages/daemon/src/core/dispatch-context.ts diff --git a/packages/daemon/src/execution-plan.ts b/packages/daemon/src/core/execution-plan.ts similarity index 100% rename from packages/daemon/src/execution-plan.ts rename to packages/daemon/src/core/execution-plan.ts diff --git a/packages/daemon/src/fill-backend-result.test.ts b/packages/daemon/src/core/fill-backend-result.test.ts similarity index 100% rename from packages/daemon/src/fill-backend-result.test.ts rename to packages/daemon/src/core/fill-backend-result.test.ts diff --git a/packages/daemon/src/fill-backend-result.ts b/packages/daemon/src/core/fill-backend-result.ts similarity index 100% rename from packages/daemon/src/fill-backend-result.ts rename to packages/daemon/src/core/fill-backend-result.ts diff --git a/packages/daemon/src/generic-leaf-execution.ts b/packages/daemon/src/core/generic-leaf-execution.ts similarity index 100% rename from packages/daemon/src/generic-leaf-execution.ts rename to packages/daemon/src/core/generic-leaf-execution.ts diff --git a/packages/daemon/src/gesture-runtime.ts b/packages/daemon/src/core/gesture-runtime.ts similarity index 100% rename from packages/daemon/src/gesture-runtime.ts rename to packages/daemon/src/core/gesture-runtime.ts diff --git a/packages/daemon/src/interaction-surface-signature.ts b/packages/daemon/src/core/interaction-surface-signature.ts similarity index 100% rename from packages/daemon/src/interaction-surface-signature.ts rename to packages/daemon/src/core/interaction-surface-signature.ts diff --git a/packages/daemon/src/interaction/internal/interaction-touch-direct-ios-eligibility.ts b/packages/daemon/src/core/interaction/internal/interaction-touch-direct-ios-eligibility.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-touch-direct-ios-eligibility.ts rename to packages/daemon/src/core/interaction/internal/interaction-touch-direct-ios-eligibility.ts diff --git a/packages/daemon/src/interaction/internal/types.ts b/packages/daemon/src/core/interaction/internal/types.ts similarity index 100% rename from packages/daemon/src/interaction/internal/types.ts rename to packages/daemon/src/core/interaction/internal/types.ts diff --git a/packages/daemon/src/interactor-resolution.ts b/packages/daemon/src/core/interactor-resolution.ts similarity index 100% rename from packages/daemon/src/interactor-resolution.ts rename to packages/daemon/src/core/interactor-resolution.ts diff --git a/packages/daemon/src/ios-app-session-hint.test.ts b/packages/daemon/src/core/ios-app-session-hint.test.ts similarity index 97% rename from packages/daemon/src/ios-app-session-hint.test.ts rename to packages/daemon/src/core/ios-app-session-hint.test.ts index 645d5bdb57..1f99c7e91c 100644 --- a/packages/daemon/src/ios-app-session-hint.test.ts +++ b/packages/daemon/src/core/ios-app-session-hint.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './__tests__/platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../__tests__/support/platform-services-fixture.ts'; import { beforeEach, expect, test, vi } from 'vitest'; import { IOS_DEVICE, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; import { buildIosOpenCommandHint } from './ios-app-session-hint.ts'; diff --git a/packages/daemon/src/ios-app-session-hint.ts b/packages/daemon/src/core/ios-app-session-hint.ts similarity index 100% rename from packages/daemon/src/ios-app-session-hint.ts rename to packages/daemon/src/core/ios-app-session-hint.ts diff --git a/packages/daemon/src/lease-context.ts b/packages/daemon/src/core/lease-context.ts similarity index 100% rename from packages/daemon/src/lease-context.ts rename to packages/daemon/src/core/lease-context.ts diff --git a/packages/daemon/src/managed-session-artifact-path.ts b/packages/daemon/src/core/managed-session-artifact-path.ts similarity index 100% rename from packages/daemon/src/managed-session-artifact-path.ts rename to packages/daemon/src/core/managed-session-artifact-path.ts diff --git a/packages/daemon/src/platform-owner-lifecycle.ts b/packages/daemon/src/core/platform-owner-lifecycle.ts similarity index 100% rename from packages/daemon/src/platform-owner-lifecycle.ts rename to packages/daemon/src/core/platform-owner-lifecycle.ts diff --git a/packages/daemon/src/platform-resource-cleanup.ts b/packages/daemon/src/core/platform-resource-cleanup.ts similarity index 100% rename from packages/daemon/src/platform-resource-cleanup.ts rename to packages/daemon/src/core/platform-resource-cleanup.ts diff --git a/packages/daemon/src/platform-services.ts b/packages/daemon/src/core/platform-services.ts similarity index 100% rename from packages/daemon/src/platform-services.ts rename to packages/daemon/src/core/platform-services.ts diff --git a/packages/daemon/src/provider-device-admission.ts b/packages/daemon/src/core/provider-device-admission.ts similarity index 100% rename from packages/daemon/src/provider-device-admission.ts rename to packages/daemon/src/core/provider-device-admission.ts diff --git a/packages/daemon/src/recording-gesture-events.ts b/packages/daemon/src/core/recording-gesture-events.ts similarity index 100% rename from packages/daemon/src/recording-gesture-events.ts rename to packages/daemon/src/core/recording-gesture-events.ts diff --git a/packages/daemon/src/recording-gestures.ts b/packages/daemon/src/core/recording-gestures.ts similarity index 100% rename from packages/daemon/src/recording-gestures.ts rename to packages/daemon/src/core/recording-gestures.ts diff --git a/packages/daemon/src/recording-timing.ts b/packages/daemon/src/core/recording-timing.ts similarity index 100% rename from packages/daemon/src/recording-timing.ts rename to packages/daemon/src/core/recording-timing.ts diff --git a/packages/daemon/src/recording-values.ts b/packages/daemon/src/core/recording-values.ts similarity index 100% rename from packages/daemon/src/recording-values.ts rename to packages/daemon/src/core/recording-values.ts diff --git a/packages/daemon/src/ref-frame-slot.ts b/packages/daemon/src/core/ref-frame-slot.ts similarity index 100% rename from packages/daemon/src/ref-frame-slot.ts rename to packages/daemon/src/core/ref-frame-slot.ts diff --git a/packages/daemon/src/ref-frame.ts b/packages/daemon/src/core/ref-frame.ts similarity index 100% rename from packages/daemon/src/ref-frame.ts rename to packages/daemon/src/core/ref-frame.ts diff --git a/packages/daemon/src/request-dispatch-ledger.ts b/packages/daemon/src/core/request-dispatch-ledger.ts similarity index 100% rename from packages/daemon/src/request-dispatch-ledger.ts rename to packages/daemon/src/core/request-dispatch-ledger.ts diff --git a/packages/daemon/src/request-runtime-binding.ts b/packages/daemon/src/core/request-runtime-binding.ts similarity index 100% rename from packages/daemon/src/request-runtime-binding.ts rename to packages/daemon/src/core/request-runtime-binding.ts diff --git a/packages/daemon/src/runtime-admission.ts b/packages/daemon/src/core/runtime-admission.ts similarity index 100% rename from packages/daemon/src/runtime-admission.ts rename to packages/daemon/src/core/runtime-admission.ts diff --git a/packages/daemon/src/runtime-operation-effects.ts b/packages/daemon/src/core/runtime-operation-effects.ts similarity index 100% rename from packages/daemon/src/runtime-operation-effects.ts rename to packages/daemon/src/core/runtime-operation-effects.ts diff --git a/packages/daemon/src/runtime-session.ts b/packages/daemon/src/core/runtime-session.ts similarity index 100% rename from packages/daemon/src/runtime-session.ts rename to packages/daemon/src/core/runtime-session.ts diff --git a/packages/daemon/src/selector-operation-binding.ts b/packages/daemon/src/core/selector-operation-binding.ts similarity index 100% rename from packages/daemon/src/selector-operation-binding.ts rename to packages/daemon/src/core/selector-operation-binding.ts diff --git a/packages/daemon/src/selector-recording.ts b/packages/daemon/src/core/selector-recording.ts similarity index 100% rename from packages/daemon/src/selector-recording.ts rename to packages/daemon/src/core/selector-recording.ts diff --git a/packages/daemon/src/session-action-recorder.ts b/packages/daemon/src/core/session-action-recorder.ts similarity index 100% rename from packages/daemon/src/session-action-recorder.ts rename to packages/daemon/src/core/session-action-recorder.ts diff --git a/packages/daemon/src/session-artifact-paths.ts b/packages/daemon/src/core/session-artifact-paths.ts similarity index 100% rename from packages/daemon/src/session-artifact-paths.ts rename to packages/daemon/src/core/session-artifact-paths.ts diff --git a/packages/daemon/src/session-capture-binding.ts b/packages/daemon/src/core/session-capture-binding.ts similarity index 100% rename from packages/daemon/src/session-capture-binding.ts rename to packages/daemon/src/core/session-capture-binding.ts diff --git a/packages/daemon/src/session-idle-tombstone.test.ts b/packages/daemon/src/core/session-idle-tombstone.test.ts similarity index 100% rename from packages/daemon/src/session-idle-tombstone.test.ts rename to packages/daemon/src/core/session-idle-tombstone.test.ts diff --git a/packages/daemon/src/session-idle-tombstone.ts b/packages/daemon/src/core/session-idle-tombstone.ts similarity index 100% rename from packages/daemon/src/session-idle-tombstone.ts rename to packages/daemon/src/core/session-idle-tombstone.ts diff --git a/packages/daemon/src/session-recovery-hints.test.ts b/packages/daemon/src/core/session-recovery-hints.test.ts similarity index 97% rename from packages/daemon/src/session-recovery-hints.test.ts rename to packages/daemon/src/core/session-recovery-hints.test.ts index fe88bf2172..f220564329 100644 --- a/packages/daemon/src/session-recovery-hints.test.ts +++ b/packages/daemon/src/core/session-recovery-hints.test.ts @@ -1,4 +1,4 @@ -import { makeStoredSessionRef } from './__tests__/support/store-factory.ts'; +import { makeStoredSessionRef } from '../__tests__/support/store-factory.ts'; import { test, expect } from 'vitest'; import { buildSessionRecoveryHint } from './session-recovery-hints.ts'; import type { SessionRef, SessionState } from './session-state.ts'; diff --git a/packages/daemon/src/session-recovery-hints.ts b/packages/daemon/src/core/session-recovery-hints.ts similarity index 100% rename from packages/daemon/src/session-recovery-hints.ts rename to packages/daemon/src/core/session-recovery-hints.ts diff --git a/packages/daemon/src/session-replay-transaction.ts b/packages/daemon/src/core/session-replay-transaction.ts similarity index 100% rename from packages/daemon/src/session-replay-transaction.ts rename to packages/daemon/src/core/session-replay-transaction.ts diff --git a/packages/daemon/src/session-runtime-admission.ts b/packages/daemon/src/core/session-runtime-admission.ts similarity index 100% rename from packages/daemon/src/session-runtime-admission.ts rename to packages/daemon/src/core/session-runtime-admission.ts diff --git a/packages/daemon/src/session-script-active-publication.ts b/packages/daemon/src/core/session-script-active-publication.ts similarity index 100% rename from packages/daemon/src/session-script-active-publication.ts rename to packages/daemon/src/core/session-script-active-publication.ts diff --git a/packages/daemon/src/session-script-publication-capability.ts b/packages/daemon/src/core/session-script-publication-capability.ts similarity index 100% rename from packages/daemon/src/session-script-publication-capability.ts rename to packages/daemon/src/core/session-script-publication-capability.ts diff --git a/packages/daemon/src/session-script-publication-state.ts b/packages/daemon/src/core/session-script-publication-state.ts similarity index 100% rename from packages/daemon/src/session-script-publication-state.ts rename to packages/daemon/src/core/session-script-publication-state.ts diff --git a/packages/daemon/src/session-script-writer.ts b/packages/daemon/src/core/session-script-writer.ts similarity index 100% rename from packages/daemon/src/session-script-writer.ts rename to packages/daemon/src/core/session-script-writer.ts diff --git a/packages/daemon/src/session-selector.ts b/packages/daemon/src/core/session-selector.ts similarity index 100% rename from packages/daemon/src/session-selector.ts rename to packages/daemon/src/core/session-selector.ts diff --git a/packages/daemon/src/session-snapshot-freshness.ts b/packages/daemon/src/core/session-snapshot-freshness.ts similarity index 100% rename from packages/daemon/src/session-snapshot-freshness.ts rename to packages/daemon/src/core/session-snapshot-freshness.ts diff --git a/packages/daemon/src/session-state.ts b/packages/daemon/src/core/session-state.ts similarity index 98% rename from packages/daemon/src/session-state.ts rename to packages/daemon/src/core/session-state.ts index c3a50070d6..1a1f7c5194 100644 --- a/packages/daemon/src/session-state.ts +++ b/packages/daemon/src/core/session-state.ts @@ -200,7 +200,7 @@ export type SessionState = { * resolution, settle observation, system-modal probes) can arm the runner-side penalty * without any user-facing render — when the latch is not held, the first public * deferred verdict re-renders the warning once. Managed only through - * `packages/daemon/src/snapshot-quality-latch.ts`: a genuine recovered render sets it, a healthy + * `packages/daemon/src/sessions/snapshot-quality-latch.ts`: a genuine recovered render sets it, a healthy * public verdict clears it, and an app switch supersedes it. */ recoveredSnapshotWarningLatch?: { appBundleId?: string }; @@ -290,7 +290,7 @@ export type SessionState = { * app-rendered echo of an already-authored literal. In-memory only for * this session's lifetime: never read by the script writer, the event * log, or diagnostics, and dropped with the session. Owned by - * `packages/daemon/src/session-action-recorder.ts`. + * `packages/daemon/src/core/session-action-recorder.ts`. */ recordedFillLiterals?: Map; /** diff --git a/packages/daemon/src/session-store.ts b/packages/daemon/src/core/session-store.ts similarity index 100% rename from packages/daemon/src/session-store.ts rename to packages/daemon/src/core/session-store.ts diff --git a/packages/daemon/src/session-tenant-scope.ts b/packages/daemon/src/core/session-tenant-scope.ts similarity index 100% rename from packages/daemon/src/session-tenant-scope.ts rename to packages/daemon/src/core/session-tenant-scope.ts diff --git a/packages/daemon/src/settle-observation-capture.ts b/packages/daemon/src/core/settle-observation-capture.ts similarity index 100% rename from packages/daemon/src/settle-observation-capture.ts rename to packages/daemon/src/core/settle-observation-capture.ts diff --git a/packages/daemon/src/snapshot-capture.ts b/packages/daemon/src/core/snapshot-capture.ts similarity index 100% rename from packages/daemon/src/snapshot-capture.ts rename to packages/daemon/src/core/snapshot-capture.ts diff --git a/packages/daemon/src/snapshot-interactor-capture.ts b/packages/daemon/src/core/snapshot-interactor-capture.ts similarity index 100% rename from packages/daemon/src/snapshot-interactor-capture.ts rename to packages/daemon/src/core/snapshot-interactor-capture.ts diff --git a/packages/daemon/src/snapshot-runtime-binding.ts b/packages/daemon/src/core/snapshot-runtime-binding.ts similarity index 100% rename from packages/daemon/src/snapshot-runtime-binding.ts rename to packages/daemon/src/core/snapshot-runtime-binding.ts diff --git a/packages/daemon/src/snapshot-runtime-capture-input.ts b/packages/daemon/src/core/snapshot-runtime-capture-input.ts similarity index 100% rename from packages/daemon/src/snapshot-runtime-capture-input.ts rename to packages/daemon/src/core/snapshot-runtime-capture-input.ts diff --git a/packages/daemon/src/snapshot-session.ts b/packages/daemon/src/core/snapshot-session.ts similarity index 100% rename from packages/daemon/src/snapshot-session.ts rename to packages/daemon/src/core/snapshot-session.ts diff --git a/packages/daemon/src/tenant-owned-entry.ts b/packages/daemon/src/core/tenant-owned-entry.ts similarity index 100% rename from packages/daemon/src/tenant-owned-entry.ts rename to packages/daemon/src/core/tenant-owned-entry.ts diff --git a/packages/daemon/src/touch-runtime.ts b/packages/daemon/src/core/touch-runtime.ts similarity index 100% rename from packages/daemon/src/touch-runtime.ts rename to packages/daemon/src/core/touch-runtime.ts diff --git a/packages/daemon/src/__tests__/android-owner-seam.test.ts b/packages/daemon/src/execution/__tests__/android-owner-seam.test.ts similarity index 92% rename from packages/daemon/src/__tests__/android-owner-seam.test.ts rename to packages/daemon/src/execution/__tests__/android-owner-seam.test.ts index 81e9bcfb27..4c53806429 100644 --- a/packages/daemon/src/__tests__/android-owner-seam.test.ts +++ b/packages/daemon/src/execution/__tests__/android-owner-seam.test.ts @@ -1,14 +1,14 @@ import { test, expect, vi } from 'vitest'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; -import { makeAndroidSession } from './support/session-factories.ts'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import { ensureAndroidBlockingSystemDialogReady, recoverAndroidBlockingSystemDialog, } from '../android-system-dialog.ts'; import { detectAndroidEscapeSurface } from '../android-foreground-surface.ts'; import { resolveDirectTouchReferenceFrameSafely } from '../interaction/internal/interaction-touch-reference-frame.ts'; -import { SessionStore } from '../session-store.ts'; +import { SessionStore } from '../../core/session-store.ts'; test('provider-owned Android sessions bypass local observation and recovery', async () => { const session = makeAndroidSession('provider-owned-android', { diff --git a/packages/daemon/src/__tests__/android-system-dialog-occlusion.test.ts b/packages/daemon/src/execution/__tests__/android-system-dialog-occlusion.test.ts similarity index 96% rename from packages/daemon/src/__tests__/android-system-dialog-occlusion.test.ts rename to packages/daemon/src/execution/__tests__/android-system-dialog-occlusion.test.ts index 5cf08ceff7..d6c470ce32 100644 --- a/packages/daemon/src/__tests__/android-system-dialog-occlusion.test.ts +++ b/packages/daemon/src/execution/__tests__/android-system-dialog-occlusion.test.ts @@ -11,9 +11,9 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { import { runAndroidAdb, snapshotAndroid } from '@agent-device/platform-android/mechanics'; import { recoverAndroidBlockingSystemDialog as recoverOwnedAndroidBlockingSystemDialog } from '../android-system-dialog.ts'; -import { androidObservationPolicyFixture as androidObservation } from './android-observation-fixture.ts'; -import { makeAndroidSession } from './support/session-factories.ts'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { androidObservationPolicyFixture as androidObservation } from '../../__tests__/support/android-observation-fixture.ts'; +import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import { makeAndroidSnapshotCapture } from '@agent-device/platform-android/snapshot-capture-fixtures'; const recoverAndroidBlockingSystemDialog = ( diff --git a/packages/daemon/src/__tests__/android-system-dialog-ref-frame.test.ts b/packages/daemon/src/execution/__tests__/android-system-dialog-ref-frame.test.ts similarity index 88% rename from packages/daemon/src/__tests__/android-system-dialog-ref-frame.test.ts rename to packages/daemon/src/execution/__tests__/android-system-dialog-ref-frame.test.ts index 3a996c8e2c..67dab9618d 100644 --- a/packages/daemon/src/__tests__/android-system-dialog-ref-frame.test.ts +++ b/packages/daemon/src/execution/__tests__/android-system-dialog-ref-frame.test.ts @@ -9,11 +9,11 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { import { runAndroidAdb, snapshotAndroid } from '@agent-device/platform-android/mechanics'; import { recoverAndroidBlockingSystemDialog as recoverOwnedAndroidBlockingSystemDialog } from '../android-system-dialog.ts'; -import { androidObservationPolicyFixture as androidObservation } from './android-observation-fixture.ts'; -import { makeAndroidSession } from './support/session-factories.ts'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { androidObservationPolicyFixture as androidObservation } from '../../__tests__/support/android-observation-fixture.ts'; +import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import { makeAndroidSnapshotCapture } from '@agent-device/platform-android/snapshot-capture-fixtures'; -import { refFrameState } from '../ref-frame.ts'; +import { refFrameState } from '../../core/ref-frame.ts'; const recoverAndroidBlockingSystemDialog = ( params: Omit[0], 'observation'>, diff --git a/packages/daemon/src/__tests__/android-system-dialog.test.ts b/packages/daemon/src/execution/__tests__/android-system-dialog.test.ts similarity index 88% rename from packages/daemon/src/__tests__/android-system-dialog.test.ts rename to packages/daemon/src/execution/__tests__/android-system-dialog.test.ts index 11e9792374..4455fe7e77 100644 --- a/packages/daemon/src/__tests__/android-system-dialog.test.ts +++ b/packages/daemon/src/execution/__tests__/android-system-dialog.test.ts @@ -1,7 +1,7 @@ import { test, expect, vi } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { makeAndroidSession } from './support/session-factories.ts'; -import { makeTestScreenRecordingResource } from './support/screen-recording-live-handle.ts'; +import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { const actual = await importOriginal(); @@ -10,7 +10,7 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { import { snapshotAndroid } from '@agent-device/platform-android/mechanics'; import { recoverAndroidBlockingSystemDialog as recoverOwnedAndroidBlockingSystemDialog } from '../android-system-dialog.ts'; -import { androidObservationPolicyFixture as androidObservation } from './android-observation-fixture.ts'; +import { androidObservationPolicyFixture as androidObservation } from '../../__tests__/support/android-observation-fixture.ts'; const recoverAndroidBlockingSystemDialog = ( params: Omit[0], 'observation'>, diff --git a/packages/daemon/src/__tests__/back-runtime.test.ts b/packages/daemon/src/execution/__tests__/back-runtime.test.ts similarity index 87% rename from packages/daemon/src/__tests__/back-runtime.test.ts rename to packages/daemon/src/execution/__tests__/back-runtime.test.ts index 5dc2420152..ffb43c46ff 100644 --- a/packages/daemon/src/__tests__/back-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/back-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { backRuntimeOperationFacts } from '@agent-device/contracts/back-runtime'; import { @@ -14,17 +14,17 @@ import { type PlatformRuntimeOperations, } from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { resolveBoundBackRuntime } from '../back-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; // File-scoped id, not the widely shared 'ios-simulator' literal: this owner binding's // `local-family` kind reaches the real on-disk device-claim admission (`require-owner` diff --git a/packages/daemon/src/__tests__/focus-runtime.test.ts b/packages/daemon/src/execution/__tests__/focus-runtime.test.ts similarity index 90% rename from packages/daemon/src/__tests__/focus-runtime.test.ts rename to packages/daemon/src/execution/__tests__/focus-runtime.test.ts index 8a97b29908..0564ad0882 100644 --- a/packages/daemon/src/__tests__/focus-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/focus-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { focusRuntimeOperationFacts } from '@agent-device/contracts/focus-runtime'; import { @@ -14,17 +14,17 @@ import { focusRuntimeUse, } from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { readFocusPoint, resolveBoundFocusRuntime } from '../focus-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; const appleDevice = { id: 'ios-simulator', diff --git a/packages/daemon/src/__tests__/fold-runtime.test.ts b/packages/daemon/src/execution/__tests__/fold-runtime.test.ts similarity index 94% rename from packages/daemon/src/__tests__/fold-runtime.test.ts rename to packages/daemon/src/execution/__tests__/fold-runtime.test.ts index 7382d0ba1c..a167af4285 100644 --- a/packages/daemon/src/__tests__/fold-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/fold-runtime.test.ts @@ -1,5 +1,5 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; -import { recordActionEntry } from '../session-action-recorder.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; +import { recordActionEntry } from '../../core/session-action-recorder.ts'; import { expect, test, vi } from 'vitest'; import { @@ -18,11 +18,11 @@ import { type PlatformRuntimeOperations, } from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { readRequestedFoldPose, resolveBoundFoldRuntime } from '../fold-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; // File-scoped id: this owner binding's `local-family` kind reaches the real on-disk device-claim // admission, so a shared id risks a cross-file claim collision under parallel execution. diff --git a/packages/daemon/src/__tests__/generic-route-runtime-completeness.test.ts b/packages/daemon/src/execution/__tests__/generic-route-runtime-completeness.test.ts similarity index 100% rename from packages/daemon/src/__tests__/generic-route-runtime-completeness.test.ts rename to packages/daemon/src/execution/__tests__/generic-route-runtime-completeness.test.ts diff --git a/packages/daemon/src/__tests__/interaction-get-runtime-fixture.ts b/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts similarity index 96% rename from packages/daemon/src/__tests__/interaction-get-runtime-fixture.ts rename to packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts index 563b4ddc09..4f467fe437 100644 --- a/packages/daemon/src/__tests__/interaction-get-runtime-fixture.ts +++ b/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts @@ -30,11 +30,11 @@ import type { QuerySelectorResult, } from '@agent-device/contracts/selector-observation-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import type { DaemonPlatformServices } from '../platform-services.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { captureSnapshotWithInteractor } from '../snapshot-interactor-capture.ts'; -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; -import { androidObservationFixture } from './android-observation-fixture.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { captureSnapshotWithInteractor } from '../../core/snapshot-interactor-capture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; +import { androidObservationFixture } from '../../__tests__/support/android-observation-fixture.ts'; import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; /** diff --git a/packages/daemon/src/__tests__/interaction-surface-baseline-evidence.test.ts b/packages/daemon/src/execution/__tests__/interaction-surface-baseline-evidence.test.ts similarity index 99% rename from packages/daemon/src/__tests__/interaction-surface-baseline-evidence.test.ts rename to packages/daemon/src/execution/__tests__/interaction-surface-baseline-evidence.test.ts index 27cb6a1f3f..6b876eb980 100644 --- a/packages/daemon/src/__tests__/interaction-surface-baseline-evidence.test.ts +++ b/packages/daemon/src/execution/__tests__/interaction-surface-baseline-evidence.test.ts @@ -4,7 +4,7 @@ import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { buildInteractionSurfaceSignature, classifyBaselineSurfaceEvidence, -} from '../interaction-surface-signature.ts'; +} from '../../core/interaction-surface-signature.ts'; // #1569: node shapes below are transcribed from a live iPhone 17 Pro capture of // examples/test-app's checkout form, before and after `scroll down 0.6`. Two diff --git a/packages/daemon/src/__tests__/internal-observation.test.ts b/packages/daemon/src/execution/__tests__/internal-observation.test.ts similarity index 98% rename from packages/daemon/src/__tests__/internal-observation.test.ts rename to packages/daemon/src/execution/__tests__/internal-observation.test.ts index 271ad4ed47..e0f865439f 100644 --- a/packages/daemon/src/__tests__/internal-observation.test.ts +++ b/packages/daemon/src/execution/__tests__/internal-observation.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { expect, test } from 'vitest'; -import { makeIosSession } from './support/session-factories.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { bindInternalObservationAuthority } from '../internal-observation.ts'; import { @@ -9,9 +9,9 @@ import { refFrameScope, refFrameState, refFrameTree, -} from '../ref-frame.ts'; +} from '../../core/ref-frame.ts'; import { markSessionPartialRefsIssued, setSessionSnapshot } from '../session-snapshot.ts'; -import { SessionStore } from '../session-store.ts'; +import { SessionStore } from '../../core/session-store.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; function snapshot(ref: string, label = ref): SnapshotState { diff --git a/packages/daemon/src/__tests__/keyboard-runtime.test.ts b/packages/daemon/src/execution/__tests__/keyboard-runtime.test.ts similarity index 99% rename from packages/daemon/src/__tests__/keyboard-runtime.test.ts rename to packages/daemon/src/execution/__tests__/keyboard-runtime.test.ts index a9caf533e9..591a4c553e 100644 --- a/packages/daemon/src/__tests__/keyboard-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/keyboard-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { keyboardRuntimeOperationFacts, @@ -20,7 +20,7 @@ import { type PlatformRuntimeOperations, } from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; import { resolveBoundKeyboardRuntime } from '../keyboard-runtime.ts'; // File-scoped ids, not the widely shared 'emulator-5554'/'ios-simulator' literals: these owner diff --git a/packages/daemon/src/__tests__/offscreen-target-probe.test.ts b/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts similarity index 98% rename from packages/daemon/src/__tests__/offscreen-target-probe.test.ts rename to packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts index b08dd4b5be..0ddbdb2a1d 100644 --- a/packages/daemon/src/__tests__/offscreen-target-probe.test.ts +++ b/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts @@ -6,7 +6,7 @@ import type { QuerySelectorInput, QuerySelectorResult, } from '@agent-device/contracts/selector-observation-runtime'; -import type { SessionState } from '../session-state.ts'; +import type { SessionState } from '../../core/session-state.ts'; import { confirmIosOffscreenTargetVisible } from '../offscreen-target-probe.ts'; diff --git a/packages/daemon/src/__tests__/orientation-runtime.test.ts b/packages/daemon/src/execution/__tests__/orientation-runtime.test.ts similarity index 89% rename from packages/daemon/src/__tests__/orientation-runtime.test.ts rename to packages/daemon/src/execution/__tests__/orientation-runtime.test.ts index d0a4032a73..92f3a93066 100644 --- a/packages/daemon/src/__tests__/orientation-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/orientation-runtime.test.ts @@ -1,6 +1,6 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; // `orientation` carries `androidBlockingDialogGuard: true` (like every other generic-route leaf // in this migration), so this file's Android device reaching the real request router below hits @@ -37,20 +37,20 @@ import { type PlatformRuntimeOperations, } from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { readRequestedOrientation, resolveBoundOrientationRuntime, } from '../orientation-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { androidObservationFixture } from './android-observation-fixture.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { androidObservationFixture } from '../../__tests__/support/android-observation-fixture.ts'; // File-scoped id, not a shared literal: this owner binding's `local-family` kind reaches the // real on-disk device-claim admission (`require-owner` policy), so a shared id risks a diff --git a/packages/daemon/src/__tests__/ref-snapshot-flag-policy.test.ts b/packages/daemon/src/execution/__tests__/ref-snapshot-flag-policy.test.ts similarity index 100% rename from packages/daemon/src/__tests__/ref-snapshot-flag-policy.test.ts rename to packages/daemon/src/execution/__tests__/ref-snapshot-flag-policy.test.ts diff --git a/packages/daemon/src/__tests__/runtime-policy.test.ts b/packages/daemon/src/execution/__tests__/runtime-policy.test.ts similarity index 100% rename from packages/daemon/src/__tests__/runtime-policy.test.ts rename to packages/daemon/src/execution/__tests__/runtime-policy.test.ts diff --git a/packages/daemon/src/__tests__/screenshot-crop-target.test.ts b/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts similarity index 100% rename from packages/daemon/src/__tests__/screenshot-crop-target.test.ts rename to packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts diff --git a/packages/daemon/src/__tests__/screenshot-crop.test.ts b/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts similarity index 97% rename from packages/daemon/src/__tests__/screenshot-crop.test.ts rename to packages/daemon/src/execution/__tests__/screenshot-crop.test.ts index 2ebe1736bf..ca060f702b 100644 --- a/packages/daemon/src/__tests__/screenshot-crop.test.ts +++ b/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts @@ -1,5 +1,5 @@ import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { makeSession } from './support/session-factories.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; import { readPngSize } from '@agent-device/capture-kit/png-size'; import { SCREENSHOT_CROP_REASONS } from '@agent-device/contracts/capture'; import type { SessionSurface } from '@agent-device/contracts/session'; @@ -14,9 +14,9 @@ import type { import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import type { SessionState } from '../session-state.ts'; +import type { SessionState } from '../../core/session-state.ts'; import { buildScreenshotCropWarnings, cropScreenshotToSelector } from '../screenshot-crop.ts'; -import { writeSolidPng } from './screenshot-runtime-fixture.ts'; +import { writeSolidPng } from '../../__tests__/support/screenshot-runtime-fixture.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; test('the warning composition is the single owner: partial intersection and only', () => { diff --git a/packages/daemon/src/__tests__/scroll-movement.test.ts b/packages/daemon/src/execution/__tests__/scroll-movement.test.ts similarity index 99% rename from packages/daemon/src/__tests__/scroll-movement.test.ts rename to packages/daemon/src/execution/__tests__/scroll-movement.test.ts index 1e2a400be3..8496b50c9e 100644 --- a/packages/daemon/src/__tests__/scroll-movement.test.ts +++ b/packages/daemon/src/execution/__tests__/scroll-movement.test.ts @@ -14,8 +14,8 @@ import type { Rect, SnapshotNode } from '@agent-device/kernel/snapshot'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { readScrollEdgeState } from '@agent-device/capture-kit/scroll-edge-state'; import { IOS_SIMULATOR, MACOS_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { makeSession } from './support/session-factories.ts'; -import { expireRefFrame } from '../ref-frame.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { expireRefFrame } from '../../core/ref-frame.ts'; import { observeScrollMovement, planScrollMovement, diff --git a/packages/daemon/src/__tests__/scroll-runtime.test.ts b/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts similarity index 97% rename from packages/daemon/src/__tests__/scroll-runtime.test.ts rename to packages/daemon/src/execution/__tests__/scroll-runtime.test.ts index 1104f840ce..909f361ff0 100644 --- a/packages/daemon/src/__tests__/scroll-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts @@ -1,12 +1,12 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, expectTypeOf, test } from 'vitest'; import assert from 'node:assert/strict'; import { buildSnapshotState } from '@agent-device/capture-kit/snapshot-state'; import { AppError } from '@agent-device/kernel/errors'; import type { CommandFlags } from '@agent-device/contracts/command'; -import type { DaemonRequest } from '../daemon-request.ts'; -import type { SessionState } from '../session-state.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import type { DaemonRequest } from '../../core/daemon-request.ts'; +import type { SessionState } from '../../core/session-state.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import type { BoundDeviceRuntime, RuntimeFacts } from '@agent-device/contracts/platform-runtime'; import { @@ -14,13 +14,13 @@ import { resolveScrollRuntimePlan, type ScrollRuntimePlan, } from '@agent-device/contracts/platform-runtime-operations'; -import type { DaemonCommandContext } from '../context.ts'; +import type { DaemonCommandContext } from '../../core/context.ts'; import { resolveBoundScrollRuntime } from '../scroll-runtime.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { makeIosSession, makeMacOsSession } from './support/session-factories.ts'; -import { activateCompleteRefFrame, expireRefFrame } from '../ref-frame.ts'; +import { makeIosSession, makeMacOsSession } from '../../__tests__/support/session-factories.ts'; +import { activateCompleteRefFrame, expireRefFrame } from '../../core/ref-frame.ts'; /** * The retired `handleScrollCommand` suite, re-pointed at the bound runtime (R43). Every diff --git a/packages/daemon/src/__tests__/selector-capture-binding.test.ts b/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts similarity index 93% rename from packages/daemon/src/__tests__/selector-capture-binding.test.ts rename to packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts index f38b1a7101..4d2d76e3e2 100644 --- a/packages/daemon/src/__tests__/selector-capture-binding.test.ts +++ b/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts @@ -1,13 +1,13 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test } from 'vitest'; import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { makeAndroidSession, makeIosSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeAndroidSession, makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { withTestDeviceInventory } from '@agent-device/device-selection/inventory-gateways-fixtures'; import { resolveBoundSelectorCapture } from '../selector-capture-binding.ts'; import { createBoundSelectorRuntime } from '../selector-runtime-backend.ts'; -import { selectorCaptureFixture } from './selector-capture-fixture.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { selectorCaptureFixture } from '../../__tests__/support/selector-capture-fixture.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; // The seam every selector unit consumes. `find` landed it; `get`, `is`, and `wait` migrate by // naming their command, so these are the guarantees they inherit rather than re-derive. diff --git a/packages/daemon/src/__tests__/selector-capture-runtime.test.ts b/packages/daemon/src/execution/__tests__/selector-capture-runtime.test.ts similarity index 98% rename from packages/daemon/src/__tests__/selector-capture-runtime.test.ts rename to packages/daemon/src/execution/__tests__/selector-capture-runtime.test.ts index 6eae38f60b..e2bb9e9e1c 100644 --- a/packages/daemon/src/__tests__/selector-capture-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/selector-capture-runtime.test.ts @@ -8,10 +8,10 @@ import { type IosTargetActivation, type SnapshotState, } from '@agent-device/kernel/snapshot'; -import type { DaemonResponse } from '../daemon-request.ts'; -import { type RequestCaptureProof, withCaptureDisclosures } from '../capture-disclosure.ts'; -import { makeIosSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import type { DaemonResponse } from '../../core/daemon-request.ts'; +import { type RequestCaptureProof, withCaptureDisclosures } from '../../core/capture-disclosure.ts'; +import { makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createSelectorCaptureRuntime } from '../selector-capture-runtime.ts'; // R35: the capture runtime executes only through its request-bound capture — there is no diff --git a/packages/daemon/src/__tests__/selector-text-runtime.test.ts b/packages/daemon/src/execution/__tests__/selector-text-runtime.test.ts similarity index 100% rename from packages/daemon/src/__tests__/selector-text-runtime.test.ts rename to packages/daemon/src/execution/__tests__/selector-text-runtime.test.ts diff --git a/packages/daemon/src/__tests__/session-snapshot.test.ts b/packages/daemon/src/execution/__tests__/session-snapshot.test.ts similarity index 98% rename from packages/daemon/src/__tests__/session-snapshot.test.ts rename to packages/daemon/src/execution/__tests__/session-snapshot.test.ts index c638122617..8920a289e9 100644 --- a/packages/daemon/src/__tests__/session-snapshot.test.ts +++ b/packages/daemon/src/execution/__tests__/session-snapshot.test.ts @@ -1,9 +1,9 @@ import { expect, test } from 'vitest'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import type { SettleObservation } from '@agent-device/contracts/interaction'; import { AppError } from '@agent-device/kernel/errors'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import type { SessionState } from '../session-state.ts'; +import type { SessionState } from '../../core/session-state.ts'; import { markSessionPartialRefsIssued, issueSettleRefs, @@ -21,7 +21,7 @@ import { refFrameEpoch, refFrameScope, refFrameState, -} from '../ref-frame.ts'; +} from '../../core/ref-frame.ts'; function makeSession(): SessionState { return { diff --git a/packages/daemon/src/__tests__/system-button-runtime.test.ts b/packages/daemon/src/execution/__tests__/system-button-runtime.test.ts similarity index 89% rename from packages/daemon/src/__tests__/system-button-runtime.test.ts rename to packages/daemon/src/execution/__tests__/system-button-runtime.test.ts index 7ea81ecb8d..4f133ca1d5 100644 --- a/packages/daemon/src/__tests__/system-button-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/system-button-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { systemButtonRuntimeOperationFacts } from '@agent-device/contracts/system-button-runtime'; import { @@ -17,13 +17,13 @@ import { } from '@agent-device/contracts/platform-runtime-operations'; import type { SystemButton } from '@agent-device/contracts/system-button-runtime'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { resolveBoundSystemButtonRuntime, type SystemButtonCommand, @@ -31,9 +31,9 @@ import { import { expectRefusesUnavailableExactOwnerFact, systemButtonCommands, -} from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +} from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; const macOsDevice = { id: 'macos-host', diff --git a/packages/daemon/src/__tests__/tv-remote-runtime.test.ts b/packages/daemon/src/execution/__tests__/tv-remote-runtime.test.ts similarity index 91% rename from packages/daemon/src/__tests__/tv-remote-runtime.test.ts rename to packages/daemon/src/execution/__tests__/tv-remote-runtime.test.ts index 2fd82435cc..14a3cd25c7 100644 --- a/packages/daemon/src/__tests__/tv-remote-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/tv-remote-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { localRuntimeOwner, @@ -14,17 +14,17 @@ import { } from '@agent-device/contracts/platform-runtime-operations'; import { tvRemoteRuntimeOperationFacts } from '@agent-device/contracts/tv-remote-runtime'; import { deviceShape } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { resolveBoundTvRemoteRuntime } from '../tv-remote-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; const vegaVvd = { id: 'vega-vvd', diff --git a/packages/daemon/src/__tests__/type-text-runtime.test.ts b/packages/daemon/src/execution/__tests__/type-text-runtime.test.ts similarity index 95% rename from packages/daemon/src/__tests__/type-text-runtime.test.ts rename to packages/daemon/src/execution/__tests__/type-text-runtime.test.ts index 0a842678b3..50de01b274 100644 --- a/packages/daemon/src/__tests__/type-text-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/type-text-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { type DeviceBinding, @@ -16,9 +16,9 @@ import { typeTextRuntimeOperationFacts, } from '@agent-device/contracts/type-text-runtime'; import { deviceShape } from '@agent-device/kernel/device'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; import { resolveBoundTypeTextRuntime } from '../type-text-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; const appleDevice = { id: 'ios-simulator', diff --git a/packages/daemon/src/__tests__/viewport-runtime.test.ts b/packages/daemon/src/execution/__tests__/viewport-runtime.test.ts similarity index 88% rename from packages/daemon/src/__tests__/viewport-runtime.test.ts rename to packages/daemon/src/execution/__tests__/viewport-runtime.test.ts index 4e74cd6a2f..568f39edbf 100644 --- a/packages/daemon/src/__tests__/viewport-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/viewport-runtime.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from './platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { type DeviceBinding, @@ -14,17 +14,17 @@ import { } from '@agent-device/contracts/platform-runtime-operations'; import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import { deviceShape } from '@agent-device/kernel/device'; -import { makeSession } from './support/session-factories.ts'; -import { makeSessionStore } from './support/store-factory.ts'; +import { makeSession } from '../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { LeaseRegistry } from '../lease-registry.ts'; -import { activateCompleteRefFrame, refFrameState } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { GenericPlatformExecutionParams } from '../generic-leaf-execution.ts'; +import { LeaseRegistry } from '../../resources/lease-registry.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { GenericPlatformExecutionParams } from '../../core/generic-leaf-execution.ts'; import { resolveBoundViewportRuntime } from '../viewport-runtime.ts'; -import { expectRefusesUnavailableExactOwnerFact } from './runtime-binding-conformance.ts'; -import { createRequestHandler } from './test-device-runtime-gateway.ts'; -import { fakeCreateCommandSurface } from './support/command-surface-fake.ts'; +import { expectRefusesUnavailableExactOwnerFact } from '../../__tests__/support/runtime-binding-conformance.ts'; +import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; +import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; const webDevice = { id: 'web', diff --git a/packages/daemon/src/android-foreground-surface.ts b/packages/daemon/src/execution/android-foreground-surface.ts similarity index 94% rename from packages/daemon/src/android-foreground-surface.ts rename to packages/daemon/src/execution/android-foreground-surface.ts index c1f6af601a..c9d52e5f73 100644 --- a/packages/daemon/src/android-foreground-surface.ts +++ b/packages/daemon/src/execution/android-foreground-surface.ts @@ -1,7 +1,7 @@ import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; import { AppError } from '@agent-device/kernel/errors'; -import { isActiveProviderDevice } from './provider-device-admission.ts'; -import type { SessionState } from './session-state.ts'; +import { isActiveProviderDevice } from '../core/provider-device-admission.ts'; +import type { SessionState } from '../core/session-state.ts'; export type AndroidEscapeSurface = { expectedPackage: string; diff --git a/packages/daemon/src/android-snapshot-timeout-evidence.ts b/packages/daemon/src/execution/android-snapshot-timeout-evidence.ts similarity index 94% rename from packages/daemon/src/android-snapshot-timeout-evidence.ts rename to packages/daemon/src/execution/android-snapshot-timeout-evidence.ts index acc02ae071..0d7ab1da01 100644 --- a/packages/daemon/src/android-snapshot-timeout-evidence.ts +++ b/packages/daemon/src/execution/android-snapshot-timeout-evidence.ts @@ -1,8 +1,8 @@ import { promises as fs } from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import type { DaemonResponse } from './daemon-request.ts'; -import type { SessionState } from './session-state.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionState } from '../core/session-state.ts'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { @@ -14,7 +14,7 @@ import { type SnapshotTimeoutEvidence, } from './snapshot-timeout-evidence.ts'; import { isAndroidSnapshotTimeoutError } from '@agent-device/capture-kit/snapshot-timeout-policy'; -import { contextFromFlags } from './context.ts'; +import { contextFromFlags } from '../core/context.ts'; import { annotateScreenshotWithRefs } from '@agent-device/capture-kit/screenshot-overlay'; import { screenshotExecutionFromContext } from './screenshot-runtime.ts'; import { @@ -28,7 +28,7 @@ import { * The two things that are not daemon assembly moved out: whether a failure is the * accessibility-timeout shape is a policy * (`packages/capture-kit/src/snapshot/snapshot-timeout-policy.ts`), and the published evidence shape is - * vocabulary (`packages/daemon/src/snapshot-timeout-evidence.ts`, whose only consumer is this + * vocabulary (`packages/daemon/src/execution/snapshot-timeout-evidence.ts`, whose only consumer is this * module). What remains here is the ordering that * genuinely needs the daemon: resolving a bound screenshot runtime, writing the artifact, * annotating it from the stored observation, and emitting the diagnostics. diff --git a/packages/daemon/src/android-system-dialog.ts b/packages/daemon/src/execution/android-system-dialog.ts similarity index 98% rename from packages/daemon/src/android-system-dialog.ts rename to packages/daemon/src/execution/android-system-dialog.ts index 8816bfe79a..3c13514d94 100644 --- a/packages/daemon/src/android-system-dialog.ts +++ b/packages/daemon/src/execution/android-system-dialog.ts @@ -8,9 +8,9 @@ import { AppError, normalizeError, type NormalizedError } from '@agent-device/ke import { centerOfRect, type SnapshotNode } from '@agent-device/kernel/snapshot'; import { isSnapshotNodeInteractionBlocked } from '@agent-device/capture-kit/snapshot-occlusion'; -import { expireRefFrame } from './ref-frame.ts'; -import type { SessionState } from './session-state.ts'; -import { isActiveProviderDevice } from './provider-device-admission.ts'; +import { expireRefFrame } from '../core/ref-frame.ts'; +import type { SessionState } from '../core/session-state.ts'; +import { isActiveProviderDevice } from '../core/provider-device-admission.ts'; const ANDROID_BLOCKING_MODAL_PATTERN = /\bis(?:n(?:'|'|')?t| not)\s+responding\b/i; const ANDROID_CLOSE_APP_PATTERN = /^close app$/i; diff --git a/packages/daemon/src/app-event-runtime.ts b/packages/daemon/src/execution/app-event-runtime.ts similarity index 94% rename from packages/daemon/src/app-event-runtime.ts rename to packages/daemon/src/execution/app-event-runtime.ts index e74790bb32..e4d270e41b 100644 --- a/packages/daemon/src/app-event-runtime.ts +++ b/packages/daemon/src/execution/app-event-runtime.ts @@ -4,9 +4,9 @@ import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtim import type { DeviceInfo } from '@agent-device/kernel/device'; import { parseTriggerAppEventArgs, resolveAppEventUrl } from './app-events.ts'; import { successText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; -import { admitRuntimeUse, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import { admitRuntimeUse, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; import type { DaemonFailureResponse } from '@agent-device/kernel/contracts'; /** diff --git a/packages/daemon/src/app-events.test.ts b/packages/daemon/src/execution/app-events.test.ts similarity index 100% rename from packages/daemon/src/app-events.test.ts rename to packages/daemon/src/execution/app-events.test.ts diff --git a/packages/daemon/src/app-events.ts b/packages/daemon/src/execution/app-events.ts similarity index 100% rename from packages/daemon/src/app-events.ts rename to packages/daemon/src/execution/app-events.ts diff --git a/packages/daemon/src/apps-runtime.ts b/packages/daemon/src/execution/apps-runtime.ts similarity index 100% rename from packages/daemon/src/apps-runtime.ts rename to packages/daemon/src/execution/apps-runtime.ts diff --git a/packages/daemon/src/back-runtime.ts b/packages/daemon/src/execution/back-runtime.ts similarity index 88% rename from packages/daemon/src/back-runtime.ts rename to packages/daemon/src/execution/back-runtime.ts index e63c7ba663..413d58ba9a 100644 --- a/packages/daemon/src/back-runtime.ts +++ b/packages/daemon/src/execution/back-runtime.ts @@ -4,10 +4,10 @@ import { backRuntimeUse } from '@agent-device/contracts/platform-runtime-operati import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { successText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; /** The neutral intent one `back` carries, projected from a resolved command context. */ function backInput(mode: BackMode | undefined, context: DaemonCommandContext): BackInput { diff --git a/packages/daemon/src/focus-runtime.ts b/packages/daemon/src/execution/focus-runtime.ts similarity index 90% rename from packages/daemon/src/focus-runtime.ts rename to packages/daemon/src/execution/focus-runtime.ts index c16e628e66..cbb2fd7527 100644 --- a/packages/daemon/src/focus-runtime.ts +++ b/packages/daemon/src/execution/focus-runtime.ts @@ -4,10 +4,10 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import type { Point } from '@agent-device/kernel/snapshot'; import { successText } from '@agent-device/kernel/success-text'; import { readPointPositionals } from '@agent-device/kernel/validation'; -import type { DaemonCommandContext } from './context.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; /** `focus x y`, on the same positional parse its still-legacy touch siblings take. */ export function readFocusPoint(positionals: readonly string[]): Point { diff --git a/packages/daemon/src/fold-runtime.ts b/packages/daemon/src/execution/fold-runtime.ts similarity index 95% rename from packages/daemon/src/fold-runtime.ts rename to packages/daemon/src/execution/fold-runtime.ts index d94abe7f4e..065f8b9071 100644 --- a/packages/daemon/src/fold-runtime.ts +++ b/packages/daemon/src/execution/fold-runtime.ts @@ -9,8 +9,8 @@ import { foldRuntimeUse } from '@agent-device/contracts/platform-runtime-operati import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { successText } from '@agent-device/kernel/success-text'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; /** `fold `, parsed with the same aliases the CLI reader accepts. */ export function readRequestedFoldPose(positionals: readonly string[]): FoldPose { diff --git a/packages/daemon/src/generic-runtime-execution.ts b/packages/daemon/src/execution/generic-runtime-execution.ts similarity index 95% rename from packages/daemon/src/generic-runtime-execution.ts rename to packages/daemon/src/execution/generic-runtime-execution.ts index 8539e9b2ae..8aa38b4749 100644 --- a/packages/daemon/src/generic-runtime-execution.ts +++ b/packages/daemon/src/execution/generic-runtime-execution.ts @@ -1,11 +1,11 @@ -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; import { resolveBoundFocusRuntime } from './focus-runtime.ts'; import { resolveBoundScrollRuntime } from './scroll-runtime.ts'; import type { ScreenshotRuntimeBindings } from './screenshot-runtime-binding.ts'; import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon-command-surface'; -import type { DaemonCommandContext } from './context.ts'; -import type { DaemonRequest } from './daemon-request.ts'; -import type { SessionState } from './session-state.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { DaemonRequest } from '../core/daemon-request.ts'; +import type { SessionState } from '../core/session-state.ts'; import { resolveBoundViewportRuntime } from './viewport-runtime.ts'; import { resolveBoundBackRuntime } from './back-runtime.ts'; import { isSystemButtonCommand, resolveBoundSystemButtonRuntime } from './system-button-runtime.ts'; diff --git a/packages/daemon/src/generic-settle.ts b/packages/daemon/src/execution/generic-settle.ts similarity index 92% rename from packages/daemon/src/generic-settle.ts rename to packages/daemon/src/execution/generic-settle.ts index 01559d9598..ba812847c6 100644 --- a/packages/daemon/src/generic-settle.ts +++ b/packages/daemon/src/execution/generic-settle.ts @@ -12,14 +12,14 @@ import { readSettleRequest, settleFlagGuardResponse, } from './interaction/index.ts'; -import type { BoundContextFromFlags } from './context.ts'; -import type { RuntimeAdmissionBindings } from './request-runtime-binding.ts'; -import type { DaemonPlatformServices } from './platform-services.ts'; -import { resolveSettleObservationCapture } from './settle-observation-capture.ts'; +import type { BoundContextFromFlags } from '../core/context.ts'; +import type { RuntimeAdmissionBindings } from '../core/request-runtime-binding.ts'; +import type { DaemonPlatformServices } from '../core/platform-services.ts'; +import { resolveSettleObservationCapture } from '../core/settle-observation-capture.ts'; import { issueSettleRefs } from './session-snapshot.ts'; -import type { SessionStore } from './session-store.ts'; -import type { DaemonRequest, DaemonResponse } from './daemon-request.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; +import type { SessionStore } from '../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; /** * `--settle` on the generic daemon route (#1638): `scroll` and `back` change diff --git a/packages/daemon/src/handlers/__tests__/react-native.test.ts b/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts similarity index 98% rename from packages/daemon/src/handlers/__tests__/react-native.test.ts rename to packages/daemon/src/execution/handlers/__tests__/react-native.test.ts index c2bf743cbd..1dd2f1ada6 100644 --- a/packages/daemon/src/handlers/__tests__/react-native.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts @@ -1,19 +1,19 @@ import { beforeEach, expect, test, vi } from 'vitest'; import path from 'node:path'; import { handleReactNativeCommands } from '../react-native.ts'; -import { captureSnapshot } from '../../snapshot-capture.ts'; -import { SessionStore } from '../../session-store.ts'; -import type { SessionState } from '../../session-state.ts'; +import { captureSnapshot } from '../../../core/snapshot-capture.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { getRuntimeBindings, mockTapPoint, resetGetRuntimeFixture, } from '../../__tests__/interaction-get-runtime-fixture.ts'; -import { refFrameState } from '../../ref-frame.ts'; -import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; +import { refFrameState } from '../../../core/ref-frame.ts'; +import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; -vi.mock('../../snapshot-capture.ts', () => ({ +vi.mock('../../../core/snapshot-capture.ts', () => ({ captureSnapshot: vi.fn(), })); diff --git a/packages/daemon/src/handlers/__tests__/session-clipboard.test.ts b/packages/daemon/src/execution/handlers/__tests__/session-clipboard.test.ts similarity index 98% rename from packages/daemon/src/handlers/__tests__/session-clipboard.test.ts rename to packages/daemon/src/execution/handlers/__tests__/session-clipboard.test.ts index 0111a11351..90ce3d0dd9 100644 --- a/packages/daemon/src/handlers/__tests__/session-clipboard.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/session-clipboard.test.ts @@ -1,4 +1,4 @@ -import { daemonPlatformServicesFixture } from '../../__tests__/platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../../__tests__/support/platform-services-fixture.ts'; import { expect, test, vi } from 'vitest'; import { clipboardRuntimeOperationFacts } from '@agent-device/contracts/clipboard-runtime'; import { @@ -17,13 +17,13 @@ import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, -} from '../../request-runtime-binding.ts'; +} from '../../../core/request-runtime-binding.ts'; import { makeSession, makeSessionStore, mockEnsureDeviceReady, mockResolveTargetDevice, -} from './session-test-harness.ts'; +} from '../../../__tests__/support/handlers/session-test-harness.ts'; import { handleSessionClipboardCommand } from '../session-clipboard.ts'; // File-scoped id, not a shared literal: this owner binding's `local-family` kind reaches the real diff --git a/packages/daemon/src/handlers/__tests__/session-selector-dispatch.test.ts b/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts similarity index 95% rename from packages/daemon/src/handlers/__tests__/session-selector-dispatch.test.ts rename to packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts index cc008dd3ba..62c05ce336 100644 --- a/packages/daemon/src/handlers/__tests__/session-selector-dispatch.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts @@ -1,7 +1,7 @@ import { daemonPlatformServicesFixture, resolveSessionAppBundleIdForTargetFixture, -} from '../../__tests__/platform-services-fixture.ts'; +} from '../../../__tests__/support/platform-services-fixture.ts'; import { test, expect, vi } from 'vitest'; import * as path from 'node:path'; import { AppError } from '@agent-device/kernel/errors'; @@ -20,21 +20,21 @@ import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, -} from '../../request-runtime-binding.ts'; +} from '../../../core/request-runtime-binding.ts'; import { mockDispatch, mockResolveTargetDevice, makeSessionStore, makeSession, noopInvoke, -} from './session-test-harness.ts'; -import type { SessionState } from '../../session-state.ts'; -import { handleSessionCommands } from './session-command-harness.ts'; -import { refFrameState } from '../../ref-frame.ts'; +} from '../../../__tests__/support/handlers/session-test-harness.ts'; +import type { SessionState } from '../../../core/session-state.ts'; +import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; +import { refFrameState } from '../../../core/ref-frame.ts'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { makeIosSession } from '../../__tests__/support/session-factories.ts'; +import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; -import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; const available = Object.freeze({ available: true } as const); const keyboardFamilyDenial = Object.freeze({ diff --git a/packages/daemon/src/handlers/__tests__/snapshot-alert.test.ts b/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts similarity index 92% rename from packages/daemon/src/handlers/__tests__/snapshot-alert.test.ts rename to packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts index 94e66d07ba..0c7e849f49 100644 --- a/packages/daemon/src/handlers/__tests__/snapshot-alert.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts @@ -1,14 +1,14 @@ import { test, expect, vi, beforeEach } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import type { SessionState } from '../../session-state.ts'; -import { SessionStore } from '../../session-store.ts'; -import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../snapshot.ts'; -import { snapshotRuntimeFixture } from '../../__tests__/snapshot-runtime-fixture.ts'; +import type { SessionState } from '../../../core/session-state.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../../../sessions/handlers/snapshot.ts'; +import { snapshotRuntimeFixture } from '../../../__tests__/support/snapshot-runtime-fixture.ts'; import { withAppleRunnerProvider } from '@agent-device/platform-apple/runner'; import { runAppleRunnerCommand } from '@agent-device/platform-apple/runner/operations'; import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import path from 'node:path'; -import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; vi.mock('@agent-device/platform-apple/runner/operations', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/handlers/__tests__/snapshot-settings-handler.test.ts b/packages/daemon/src/execution/handlers/__tests__/snapshot-settings-handler.test.ts similarity index 95% rename from packages/daemon/src/handlers/__tests__/snapshot-settings-handler.test.ts rename to packages/daemon/src/execution/handlers/__tests__/snapshot-settings-handler.test.ts index e9fb476c19..747af24a4f 100644 --- a/packages/daemon/src/handlers/__tests__/snapshot-settings-handler.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/snapshot-settings-handler.test.ts @@ -1,20 +1,20 @@ -import { daemonPlatformServicesFixture } from '../../__tests__/platform-services-fixture.ts'; +import { daemonPlatformServicesFixture } from '../../../__tests__/support/platform-services-fixture.ts'; import { test, expect, vi, afterEach, beforeEach } from 'vitest'; -import { legacyDispatchCapture } from '../../__tests__/legacy-snapshot-capture-fixture.ts'; -import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../snapshot.ts'; -import { providerDeviceAdmissionFixture } from '../../__tests__/support/provider-device-admission-fixture.ts'; -import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; +import { legacyDispatchCapture } from '../../../__tests__/support/legacy-snapshot-capture-fixture.ts'; +import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../../../sessions/handlers/snapshot.ts'; +import { providerDeviceAdmissionFixture } from '../../../__tests__/support/provider-device-admission-fixture.ts'; +import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; // The daemon reads provider ownership through its own typed admission seam; these suites // install the seam over runtime fakes, the way root composition installs the real one. const providerAdmission = providerDeviceAdmissionFixture(); -import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; +import { platformResourceCleanupFixture } from '../../../__tests__/support/platform-resource-cleanup-fixture.ts'; import { fixtureSettingsMutations, fixtureSettingsReads, resetSnapshotRuntimeFixture, snapshotRuntimeFixture, -} from '../../__tests__/snapshot-runtime-fixture.ts'; +} from '../../../__tests__/support/snapshot-runtime-fixture.ts'; import { androidDevice, iosSimulatorDevice, @@ -23,12 +23,12 @@ import { makeSessionStore, snapshotRequest, tvOsSimulatorDevice, -} from './snapshot-handler.fixtures.ts'; -import { activateCompleteRefFrame, refFrameState } from '../../ref-frame.ts'; +} from '../../../__tests__/support/handlers/snapshot-handler.fixtures.ts'; +import { activateCompleteRefFrame, refFrameState } from '../../../core/ref-frame.ts'; import { PRE_DISPATCH_REFUSAL_REASONS } from '@agent-device/kernel/errors'; -vi.mock('../../snapshot-interactor-capture.ts', async () => { - const fixture = await import('../../__tests__/legacy-snapshot-capture-fixture.ts'); +vi.mock('../../../core/snapshot-interactor-capture.ts', async () => { + const fixture = await import('../../../__tests__/support/legacy-snapshot-capture-fixture.ts'); return { captureSnapshotWithInteractor: fixture.captureSnapshotThroughLegacyDispatchFixture }; }); vi.mock('@agent-device/platform-apple/runner/operations', async (importOriginal) => { @@ -41,12 +41,12 @@ vi.mock('@agent-device/platform-apple/runner/operations', async (importOriginal) // unambiguous environment; that live-probe logic is covered by // ios-app-session-hint.test.ts. Stubbed here so this suite stays hermetic and // fast — defaults to "no enrichment", matching the current-behavior fallback. -vi.mock('../../ios-app-session-hint.ts', () => ({ +vi.mock('../../../core/ios-app-session-hint.ts', () => ({ buildIosOpenCommandHint: vi.fn(async () => undefined), })); import { runAppleRunnerCommand } from '@agent-device/platform-apple/runner/operations'; -import { buildIosOpenCommandHint } from '../../ios-app-session-hint.ts'; +import { buildIosOpenCommandHint } from '../../../core/ios-app-session-hint.ts'; const mockRunnerCommand = vi.mocked(runAppleRunnerCommand); const mockBuildIosOpenCommandHint = vi.mocked(buildIosOpenCommandHint); diff --git a/packages/daemon/src/handlers/react-native.ts b/packages/daemon/src/execution/handlers/react-native.ts similarity index 97% rename from packages/daemon/src/handlers/react-native.ts rename to packages/daemon/src/execution/handlers/react-native.ts index 5c9a4bbc8e..1eb4e5a2e2 100644 --- a/packages/daemon/src/handlers/react-native.ts +++ b/packages/daemon/src/execution/handlers/react-native.ts @@ -2,7 +2,7 @@ import { createBoundTouchExecutor, resolveBoundTouchRuntime, type BoundTouchRuntime, -} from '../touch-runtime.ts'; +} from '../../core/touch-runtime.ts'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { analyzeReactNativeOverlay, @@ -14,15 +14,15 @@ import { successText } from '@agent-device/kernel/success-text'; import type { SnapshotQualityVerdict, SnapshotState } from '@agent-device/kernel/snapshot'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import type { DaemonResponse } from '../daemon-request.ts'; -import type { SessionState } from '../session-state.ts'; +import type { DaemonResponse } from '../../core/daemon-request.ts'; +import type { SessionState } from '../../core/session-state.ts'; import { bindInteractionSession, captureSnapshotForSession, finalizeTouchInteraction, type InteractionRouteInput, } from '../interaction/index.ts'; -import { expireRefFrame } from '../ref-frame.ts'; +import { expireRefFrame } from '../../core/ref-frame.ts'; import { readSnapshotNodesReferenceFrame } from '@agent-device/capture-kit/touch-reference-frame'; import { errorResponse, noActiveSessionError } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/handlers/session-clipboard.ts b/packages/daemon/src/execution/handlers/session-clipboard.ts similarity index 92% rename from packages/daemon/src/handlers/session-clipboard.ts rename to packages/daemon/src/execution/handlers/session-clipboard.ts index 61badf6386..3a35530e0e 100644 --- a/packages/daemon/src/handlers/session-clipboard.ts +++ b/packages/daemon/src/execution/handlers/session-clipboard.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from '../platform-services.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; import type { ClipboardReadInput, ClipboardWriteInput, @@ -11,18 +11,18 @@ import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtim import { publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; -import { contextFromFlags, type DaemonCommandContext } from '../context.ts'; -import type { DaemonRequest, DaemonResponse } from '../daemon-request.ts'; -import type { SessionStore } from '../session-store.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { admitRuntimeUse, type RuntimeAdmissionBindings } from '../runtime-admission.ts'; -import { runtimeExecutionFromContext } from '../snapshot-runtime-capture-input.ts'; +import { contextFromFlags, type DaemonCommandContext } from '../../core/context.ts'; +import type { DaemonRequest, DaemonResponse } from '../../core/daemon-request.ts'; +import type { SessionStore } from '../../core/session-store.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { admitRuntimeUse, type RuntimeAdmissionBindings } from '../../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../../core/snapshot-runtime-capture-input.ts'; import { successText } from '@agent-device/kernel/success-text'; -import { recordSessionAction } from '../session-action-recorder.ts'; +import { recordSessionAction } from '../../core/session-action-recorder.ts'; import { requireSessionOrExplicitSelector, resolveCommandDevice, -} from '../session-device-resolution.ts'; +} from '../../resources/session-device-resolution.ts'; import { type DaemonFailureResponse, errorResponse } from '@agent-device/kernel/contracts'; type ClipboardAction = 'read' | 'write'; diff --git a/packages/daemon/src/handlers/session-selector-dispatch.ts b/packages/daemon/src/execution/handlers/session-selector-dispatch.ts similarity index 92% rename from packages/daemon/src/handlers/session-selector-dispatch.ts rename to packages/daemon/src/execution/handlers/session-selector-dispatch.ts index edf0b3b228..c45841cb0e 100644 --- a/packages/daemon/src/handlers/session-selector-dispatch.ts +++ b/packages/daemon/src/execution/handlers/session-selector-dispatch.ts @@ -1,21 +1,21 @@ -import type { DaemonPlatformServices } from '../platform-services.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import type { DaemonRequest, DaemonResponse } from '../daemon-request.ts'; -import type { SessionRef, SessionState } from '../session-state.ts'; -import type { SessionStore } from '../session-store.ts'; -import { contextFromFlags } from '../context.ts'; +import type { DaemonRequest, DaemonResponse } from '../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../core/session-state.ts'; +import type { SessionStore } from '../../core/session-store.ts'; +import { contextFromFlags } from '../../core/context.ts'; import { requireSessionOrExplicitSelector, resolveCommandDevice, -} from '../session-device-resolution.ts'; -import { recordSessionAction } from '../session-action-recorder.ts'; +} from '../../resources/session-device-resolution.ts'; +import { recordSessionAction } from '../../core/session-action-recorder.ts'; import { resolveBoundAppEventRuntime } from '../app-event-runtime.ts'; import { resolveBoundKeyboardRuntime } from '../keyboard-runtime.ts'; -import { resolveRefFrameEffect } from '../daemon-command-registry.ts'; -import { expireRefFrame } from '../ref-frame.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import type { DaemonCommandContext } from '../context.ts'; +import { resolveRefFrameEffect } from '../../core/daemon-command-registry.ts'; +import { expireRefFrame } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import type { DaemonCommandContext } from '../../core/context.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; /** diff --git a/packages/daemon/src/handlers/snapshot-alert.ts b/packages/daemon/src/execution/handlers/snapshot-alert.ts similarity index 89% rename from packages/daemon/src/handlers/snapshot-alert.ts rename to packages/daemon/src/execution/handlers/snapshot-alert.ts index 295529ebd2..3ad1dfd1eb 100644 --- a/packages/daemon/src/handlers/snapshot-alert.ts +++ b/packages/daemon/src/execution/handlers/snapshot-alert.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from '../platform-services.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; import type { AlertRuntimeInput } from '@agent-device/contracts/alert-runtime'; import { type AlertAction, @@ -12,17 +12,17 @@ import { alertWaitUse, } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { contextFromFlags } from '../context.ts'; -import type { DaemonRequest, DaemonResponse } from '../daemon-request.ts'; -import type { SessionRef, SessionState } from '../session-state.ts'; -import { SessionStore } from '../session-store.ts'; -import { recordSessionAction } from '../session-action-recorder.ts'; +import { contextFromFlags } from '../../core/context.ts'; +import type { DaemonRequest, DaemonResponse } from '../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../core/session-state.ts'; +import { SessionStore } from '../../core/session-store.ts'; +import { recordSessionAction } from '../../core/session-action-recorder.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 { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { admitRuntimeUse, type RuntimeAdmissionBindings } from '../runtime-admission.ts'; -import { runtimeExecutionFromContext } from '../snapshot-runtime-capture-input.ts'; +import { resolveRefFrameEffect } from '../../core/daemon-command-registry.ts'; +import { expireRefFrame } from '../../core/ref-frame.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { admitRuntimeUse, type RuntimeAdmissionBindings } from '../../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../../core/snapshot-runtime-capture-input.ts'; import type { DaemonFailureResponse } from '@agent-device/kernel/contracts'; type HandleAlertCommandParams = { diff --git a/packages/daemon/src/handlers/snapshot-settings.ts b/packages/daemon/src/execution/handlers/snapshot-settings.ts similarity index 95% rename from packages/daemon/src/handlers/snapshot-settings.ts rename to packages/daemon/src/execution/handlers/snapshot-settings.ts index ae27c9338c..5b079ae890 100644 --- a/packages/daemon/src/handlers/snapshot-settings.ts +++ b/packages/daemon/src/execution/handlers/snapshot-settings.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from '../platform-services.ts'; +import type { DaemonPlatformServices } from '../../core/platform-services.ts'; import { isApplePlatform, isHandheldAppleSimulator, @@ -27,20 +27,20 @@ import { settingsRuntimeUse, } from '@agent-device/contracts/platform-runtime-operations'; import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; -import { contextFromFlags } from '../context.ts'; -import { SessionStore } from '../session-store.ts'; -import type { DaemonRequest, DaemonResponse } from '../daemon-request.ts'; -import type { SessionRef, SessionState } from '../session-state.ts'; -import { recordSessionAction } from '../session-action-recorder.ts'; -import { expireRefFrame } from '../ref-frame.ts'; +import { contextFromFlags } from '../../core/context.ts'; +import { SessionStore } from '../../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../core/session-state.ts'; +import { recordSessionAction } from '../../core/session-action-recorder.ts'; +import { expireRefFrame } from '../../core/ref-frame.ts'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { readLocationCoordinate } from '@agent-device/kernel/location-coordinates'; import { sessionAppRequiredDetails } from '@agent-device/kernel/errors'; import { successText, withSuccessText } from '@agent-device/kernel/success-text'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; -import { admitRuntimeUse } from '../runtime-admission.ts'; -import { runtimeExecutionFromContext } from '../snapshot-runtime-capture-input.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../../core/request-runtime-binding.ts'; +import { admitRuntimeUse } from '../../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../../core/snapshot-runtime-capture-input.ts'; import { type DaemonFailureResponse, errorResponse } from '@agent-device/kernel/contracts'; type ParsedSettingsArgs = { diff --git a/packages/daemon/src/interaction/index.ts b/packages/daemon/src/execution/interaction/index.ts similarity index 86% rename from packages/daemon/src/interaction/index.ts rename to packages/daemon/src/execution/interaction/index.ts index 612abde8c5..4994de7d4a 100644 --- a/packages/daemon/src/interaction/index.ts +++ b/packages/daemon/src/execution/interaction/index.ts @@ -1,8 +1,8 @@ import { bindInteractionSession } from './internal/interaction-session.ts'; import type { Rect } from '@agent-device/kernel/snapshot'; -import { buildRuntimeCaptureInput } from '../snapshot-runtime-capture-input.ts'; +import { buildRuntimeCaptureInput } from '../../core/snapshot-runtime-capture-input.ts'; import { setSessionSnapshot } from '../session-snapshot.ts'; -import { captureSnapshot } from '../snapshot-capture.ts'; +import { captureSnapshot } from '../../core/snapshot-capture.ts'; import { captureInteractionSnapshot } from './internal/interaction-snapshot.ts'; import { createInteractionRuntimeForRoute } from './internal/interaction-runtime.ts'; import { readSettleRequest, settleFlagGuardResponse } from './internal/interaction-flags.ts'; @@ -11,9 +11,9 @@ import type { FindRouteInput, InteractionRouteInput, SettleObservationCaptureInput, -} from './internal/types.ts'; +} from '../../core/interaction/internal/types.ts'; -export type { FindRouteInput, InteractionRouteInput } from './internal/types.ts'; +export type { FindRouteInput, InteractionRouteInput } from '../../core/interaction/internal/types.ts'; export { refMutationAdmissionResponse } from './internal/interaction-ref-policy.ts'; export { finalizeTouchInteraction } from './internal/interaction-runtime.ts'; @@ -71,8 +71,8 @@ export async function createInteractionRuntime( params: SettleObservationCaptureInput & InteractionRouteInput & { pairedGestureViewport?: Rect; - touchExecutor?: import('../touch-runtime.ts').BoundTouchExecutor; - gestures?: import('../gesture-runtime.ts').BoundGestureExecutor; + touchExecutor?: import('../../core/touch-runtime.ts').BoundTouchExecutor; + gestures?: import('../../core/gesture-runtime.ts').BoundGestureExecutor; }, ) { return await createInteractionRuntimeForRoute({ diff --git a/packages/daemon/src/interaction/internal/__tests__/find-handler-fixture.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-handler-fixture.ts similarity index 83% rename from packages/daemon/src/interaction/internal/__tests__/find-handler-fixture.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find-handler-fixture.ts index 5b26c59892..9bb69ef83e 100644 --- a/packages/daemon/src/interaction/internal/__tests__/find-handler-fixture.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find-handler-fixture.ts @@ -1,9 +1,9 @@ -import type { SessionStore } from '../../../session-store.ts'; -import type { DaemonRequest, DaemonResponse } from '../../../daemon-request.ts'; +import type { SessionStore } from '../../../../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../../../../core/daemon-request.ts'; import { handleFindCommands } from '../find.ts'; import { getRuntimeBindings } from '../../../__tests__/interaction-get-runtime-fixture.ts'; import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon-command-surface'; -import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; /** * One `handleFindCommands` invocation shape. diff --git a/packages/daemon/src/interaction/internal/__tests__/find-match-ranking.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-match-ranking.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/find-match-ranking.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find-match-ranking.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/find-single-bind.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-single-bind.test.ts similarity index 81% rename from packages/daemon/src/interaction/internal/__tests__/find-single-bind.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find-single-bind.test.ts index 9a64128de6..0190dfcfa1 100644 --- a/packages/daemon/src/interaction/internal/__tests__/find-single-bind.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find-single-bind.test.ts @@ -1,7 +1,7 @@ import { test, expect, vi, beforeEach } from 'vitest'; -import type { DaemonResponse } from '../../../daemon-request.ts'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; +import type { DaemonResponse } from '../../../../core/daemon-request.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; +import { makeIosSession } from '../../../../__tests__/support/session-factories.ts'; import { mockFocusPoint, mockTypeText, @@ -9,10 +9,10 @@ import { runtimeBindingSpies, } from '../../../__tests__/interaction-get-runtime-fixture.ts'; import { invokeFindHandler } from './find-handler-fixture.ts'; -import { legacyDispatchCapture } from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +import { legacyDispatchCapture } from '../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'; -vi.mock('../../../snapshot-interactor-capture.ts', async () => { - const fixture = await import('../../../__tests__/legacy-snapshot-capture-fixture.ts'); +vi.mock('../../../../core/snapshot-interactor-capture.ts', async () => { + const fixture = await import('../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'); return { captureSnapshotWithInteractor: fixture.captureSnapshotThroughLegacyDispatchFixture }; }); diff --git a/packages/daemon/src/interaction/internal/__tests__/find-target-activation-disclosure.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-target-activation-disclosure.test.ts similarity index 89% rename from packages/daemon/src/interaction/internal/__tests__/find-target-activation-disclosure.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find-target-activation-disclosure.test.ts index d686d53bef..662ddf25b8 100644 --- a/packages/daemon/src/interaction/internal/__tests__/find-target-activation-disclosure.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find-target-activation-disclosure.test.ts @@ -1,18 +1,18 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { IosTargetActivation, PostGestureOutcome } from '@agent-device/kernel/snapshot'; import { iosTargetActivationDisclosure } from '@agent-device/contracts/ios-target-activation'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; -import type { DaemonResponse } from '../../../daemon-request.ts'; -import { legacyDispatchCapture } from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; +import { makeIosSession } from '../../../../__tests__/support/session-factories.ts'; +import type { DaemonResponse } from '../../../../core/daemon-request.ts'; +import { legacyDispatchCapture } from '../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'; import { getRuntimeBindings } from '../../../__tests__/interaction-get-runtime-fixture.ts'; import { handleFindCommands } from '../../index.ts'; -import { markDeferredInteractionOutcome } from '../../../deferred-interaction-outcome.ts'; +import { markDeferredInteractionOutcome } from '../../../../core/deferred-interaction-outcome.ts'; import { formatPostGestureOutcomeWarning } from '@agent-device/capture-kit/post-gesture-stability'; -import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; -vi.mock('../../../snapshot-interactor-capture.ts', async () => { - const fixture = await import('../../../__tests__/legacy-snapshot-capture-fixture.ts'); +vi.mock('../../../../core/snapshot-interactor-capture.ts', async () => { + const fixture = await import('../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'); return { captureSnapshotWithInteractor: fixture.captureSnapshotThroughLegacyDispatchFixture }; }); diff --git a/packages/daemon/src/interaction/internal/__tests__/find-touch-runtime-fixture.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts similarity index 88% rename from packages/daemon/src/interaction/internal/__tests__/find-touch-runtime-fixture.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts index 4c2ee94934..46f439138d 100644 --- a/packages/daemon/src/interaction/internal/__tests__/find-touch-runtime-fixture.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts @@ -1,5 +1,5 @@ import { expect } from 'vitest'; -import { legacyDispatchCapture } from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +import { legacyDispatchCapture } from '../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'; import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; import { getRuntimeBindings, @@ -8,10 +8,10 @@ import { mockTapPoint, resetGetRuntimeFixture, } from '../../../__tests__/interaction-get-runtime-fixture.ts'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { makeIosSession as makeSession } from '../../../__tests__/support/session-factories.ts'; -import type { DaemonRequest, DaemonResponse } from '../../../daemon-request.ts'; -import type { SessionState } from '../../../session-state.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; +import { makeIosSession as makeSession } from '../../../../__tests__/support/session-factories.ts'; +import type { DaemonRequest, DaemonResponse } from '../../../../core/daemon-request.ts'; +import type { SessionState } from '../../../../core/session-state.ts'; import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon-command-surface'; import type { handleFindCommands } from '../find.ts'; import { invokeFindHandler } from './find-handler-fixture.ts'; diff --git a/packages/daemon/src/interaction/internal/__tests__/find.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find.test.ts similarity index 98% rename from packages/daemon/src/interaction/internal/__tests__/find.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/find.test.ts index 7f24f1cef0..27b4050d7c 100644 --- a/packages/daemon/src/interaction/internal/__tests__/find.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find.test.ts @@ -1,5 +1,5 @@ import { test, expect, vi, beforeEach } from 'vitest'; -import { makeIosSession as makeSession } from '../../../__tests__/support/session-factories.ts'; +import { makeIosSession as makeSession } from '../../../../__tests__/support/session-factories.ts'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = (await importOriginal()) as Record; @@ -8,8 +8,8 @@ vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal resolveTargetDevice: actual.resolveTargetDevice, }; }); -vi.mock('../../../snapshot-interactor-capture.ts', async () => { - const fixture = await import('../../../__tests__/legacy-snapshot-capture-fixture.ts'); +vi.mock('../../../../core/snapshot-interactor-capture.ts', async () => { + const fixture = await import('../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'); return { captureSnapshotWithInteractor: fixture.captureSnapshotThroughLegacyDispatchFixture }; }); @@ -19,7 +19,7 @@ import { resetFindTouchRuntimeFixture, runFindClickScenario, } from './find-touch-runtime-fixture.ts'; -import { refFrameState } from '../../../ref-frame.ts'; +import { refFrameState } from '../../../../core/ref-frame.ts'; beforeEach(() => { resetFindTouchRuntimeFixture(); diff --git a/packages/daemon/src/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts b/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts similarity index 98% rename from packages/daemon/src/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts index e66c287994..ba8a00ca92 100644 --- a/packages/daemon/src/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts @@ -13,7 +13,7 @@ import type { import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, -} from '../../../request-runtime-binding.ts'; +} from '../../../../core/request-runtime-binding.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; const available = Object.freeze({ available: true } as const); diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-gesture-response.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-gesture-response.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-gesture-response.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-gesture-response.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-ios-tap-outcome-fixtures.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-ios-tap-outcome-fixtures.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-ios-tap-outcome-fixtures.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-ios-tap-outcome-fixtures.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-recorded-input.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-recorded-input.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-recorded-input.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-recorded-input.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-ref-policy.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-ref-policy.test.ts similarity index 98% rename from packages/daemon/src/interaction/internal/__tests__/interaction-ref-policy.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-ref-policy.test.ts index c65902c850..11dabba40a 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-ref-policy.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-ref-policy.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { activatePartialRefFrame, readRefMutationFrame } from '../../../ref-frame.ts'; +import { activatePartialRefFrame, readRefMutationFrame } from '../../../../core/ref-frame.ts'; import { refMutationAdmissionResponse } from '../interaction-ref-policy.ts'; import { makeStaleRefSession } from './interaction-touch-fixtures.ts'; diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-response-construction-guard.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-response-construction-guard.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-response-construction-guard.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-response-construction-guard.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-response-data-transform.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-response-data-transform.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-response-data-transform.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-response-data-transform.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-runtime.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-runtime.test.ts similarity index 85% rename from packages/daemon/src/interaction/internal/__tests__/interaction-runtime.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-runtime.test.ts index 8994028ee3..d23491de0a 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-runtime.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-runtime.test.ts @@ -1,6 +1,6 @@ import { expectTypeOf, test } from 'vitest'; import type { CommandFlags } from '@agent-device/contracts/command'; -import type { InteractionRuntimeInput } from '../types.ts'; +import type { InteractionRuntimeInput } from '../../../../core/interaction/internal/types.ts'; test('interaction runtime accepts only explicit request capabilities', () => { expectTypeOf() diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-snapshot-scope.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-snapshot-scope.test.ts similarity index 93% rename from packages/daemon/src/interaction/internal/__tests__/interaction-snapshot-scope.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-snapshot-scope.test.ts index 7c4904cbbd..c62c5218d0 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-snapshot-scope.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-snapshot-scope.test.ts @@ -2,9 +2,9 @@ import { afterEach, expect, test, vi } from 'vitest'; import type { SnapshotOptions } from '@agent-device/contracts/interactor-types'; import type { CommandFlags } from '@agent-device/contracts/command'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { makeAndroidSession } from '../../../__tests__/support/session-factories.ts'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { contextFromFlags } from '../../../context.ts'; +import { makeAndroidSession } from '../../../../__tests__/support/session-factories.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; +import { contextFromFlags } from '../../../../core/context.ts'; import { captureSnapshotForSession } from '../../index.ts'; // The interaction runtime's capture (press/click/fill/longpress/hover --scope X, @@ -18,7 +18,7 @@ const captured = vi.hoisted(() => ({ held: undefined as Promise | undefined, })); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../../../core/snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(async ({ options }: { options: SnapshotOptions }) => { captured.options.push(options); await captured.held; diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-fixtures.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-fixtures.ts similarity index 93% rename from packages/daemon/src/interaction/internal/__tests__/interaction-touch-fixtures.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-fixtures.ts index c9fbad50d5..1b51da7f56 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-fixtures.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-fixtures.ts @@ -4,10 +4,10 @@ import { makeAndroidSession as makeBaseAndroidSession, makeIosAppSession, makeMacOsSession as makeBaseMacOsSession, -} from '../../../__tests__/support/session-factories.ts'; -import { makeTestScreenRecordingResource } from '../../../__tests__/support/screen-recording-live-handle.ts'; -import { activateCompleteRefFrame } from '../../../ref-frame.ts'; -import type { SessionState } from '../../../session-state.ts'; +} from '../../../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../../../__tests__/support/screen-recording-live-handle.ts'; +import { activateCompleteRefFrame } from '../../../../core/ref-frame.ts'; +import type { SessionState } from '../../../../core/session-state.ts'; import { buildSnapshotState } from '@agent-device/capture-kit/snapshot-state'; /** diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts similarity index 89% rename from packages/daemon/src/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts index 5eab8cd09c..df7e217a5a 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-reference-frame.test.ts @@ -3,10 +3,10 @@ import { makeSnapshotState } from '@agent-device/capture-kit/snapshot-state-fixt import { makeAndroidSession, makeIosAppSession, -} from '../../../__tests__/support/session-factories.ts'; -import { makeTestScreenRecordingResource } from '../../../__tests__/support/screen-recording-live-handle.ts'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { clearAndroidObservationFixture } from '../../../__tests__/android-observation-fixture.ts'; +} from '../../../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../../../__tests__/support/screen-recording-live-handle.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; +import { clearAndroidObservationFixture } from '../../../../__tests__/support/android-observation-fixture.ts'; import { contextFromFlags } from './interaction-touch-fixtures.ts'; import { resolveDirectTouchReferenceFrameSafely } from '../interaction-touch-reference-frame.ts'; diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-response.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts similarity index 96% rename from packages/daemon/src/interaction/internal/__tests__/interaction-touch-response.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts index 09b8672601..13ea9cd835 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-response.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts @@ -7,15 +7,15 @@ import { import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { test, expect, vi, beforeEach } from 'vitest'; import { attachRefs } from '@agent-device/kernel/snapshot'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; import { buildInteractionResponseData, buildTargetedTouchResponsePayloads, transformTouchResponseData, } from '../interaction-touch-response.ts'; import type { PressCommandResult } from '@agent-device/contracts/interaction'; -import { daemonPlatformServicesFixture } from '../../../__tests__/platform-services-fixture.ts'; -import { fakeCreateCommandSurface as testCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; +import { daemonPlatformServicesFixture } from '../../../../__tests__/support/platform-services-fixture.ts'; +import { fakeCreateCommandSurface as testCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; import { contextFromFlags, installTestScreenRecording, @@ -41,7 +41,7 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../../../core/snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); @@ -56,7 +56,7 @@ import { getAndroidBlockingDialogObservation, getAndroidScreenSize, } from '@agent-device/platform-android/mechanics'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { captureSnapshotWithInteractor } from '../../../../core/snapshot-interactor-capture.ts'; beforeEach(() => { vi.mocked(getAndroidAppState).mockReset(); diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-touch-targets.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-targets.test.ts similarity index 100% rename from packages/daemon/src/interaction/internal/__tests__/interaction-touch-targets.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-targets.test.ts diff --git a/packages/daemon/src/interaction/internal/__tests__/interaction-type-android-readiness.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-type-android-readiness.test.ts similarity index 86% rename from packages/daemon/src/interaction/internal/__tests__/interaction-type-android-readiness.test.ts rename to packages/daemon/src/execution/interaction/internal/__tests__/interaction-type-android-readiness.test.ts index fe3edf0530..cf077efe6e 100644 --- a/packages/daemon/src/interaction/internal/__tests__/interaction-type-android-readiness.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-type-android-readiness.test.ts @@ -1,8 +1,8 @@ import { test, expect, vi, beforeEach } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { makeAndroidSession } from '../../../__tests__/support/session-factories.ts'; -import { makeTestScreenRecordingResource } from '../../../__tests__/support/screen-recording-live-handle.ts'; -import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; +import { makeAndroidSession } from '../../../../__tests__/support/session-factories.ts'; +import { makeTestScreenRecordingResource } from '../../../../__tests__/support/screen-recording-live-handle.ts'; +import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; import { handleInteractionCommands } from '../../index.ts'; import { contextFromFlags } from './interaction-touch-fixtures.ts'; import { @@ -10,7 +10,7 @@ import { mockTypeText, resetGetRuntimeFixture, } from '../../../__tests__/interaction-get-runtime-fixture.ts'; -import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; +import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { const actual = await importOriginal(); diff --git a/packages/daemon/src/interaction/internal/find-match-ranking.ts b/packages/daemon/src/execution/interaction/internal/find-match-ranking.ts similarity index 100% rename from packages/daemon/src/interaction/internal/find-match-ranking.ts rename to packages/daemon/src/execution/interaction/internal/find-match-ranking.ts diff --git a/packages/daemon/src/interaction/internal/find-match-resolution.ts b/packages/daemon/src/execution/interaction/internal/find-match-resolution.ts similarity index 95% rename from packages/daemon/src/interaction/internal/find-match-resolution.ts rename to packages/daemon/src/execution/interaction/internal/find-match-resolution.ts index 6c4b16152e..3184388f78 100644 --- a/packages/daemon/src/interaction/internal/find-match-resolution.ts +++ b/packages/daemon/src/execution/interaction/internal/find-match-resolution.ts @@ -8,8 +8,8 @@ import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pip import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { isRootInteractionContainer } from '@agent-device/selectors/interaction-targeting'; import { preferOnscreenMatches } from './find-match-ranking.ts'; -import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +import type { DaemonRequest, DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { buildAmbiguousMatchError } from '../../selector-match-errors.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/interaction/internal/find-target-capture.ts b/packages/daemon/src/execution/interaction/internal/find-target-capture.ts similarity index 91% rename from packages/daemon/src/interaction/internal/find-target-capture.ts rename to packages/daemon/src/execution/interaction/internal/find-target-capture.ts index 3109598692..d1ed52ee94 100644 --- a/packages/daemon/src/interaction/internal/find-target-capture.ts +++ b/packages/daemon/src/execution/interaction/internal/find-target-capture.ts @@ -1,11 +1,11 @@ import type { FindLocator } from '@agent-device/selectors'; import type { BoundSelectorCapture } from '../../selector-capture-binding.ts'; import type { SnapshotQualityVerdict, SnapshotState } from '@agent-device/kernel/snapshot'; -import type { CaptureProvenance, RequestCaptureProof } from '../../capture-disclosure.ts'; +import type { CaptureProvenance, RequestCaptureProof } from '../../../core/capture-disclosure.ts'; import { createSelectorCaptureRuntime } from '../../selector-capture-runtime.ts'; -import { SessionStore } from '../../session-store.ts'; -import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; -import type { SessionRef, SessionState } from '../../session-state.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../../core/session-state.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; /** The tree a mutating find resolves its target against, plus what the capture disclosed. */ diff --git a/packages/daemon/src/interaction/internal/find.ts b/packages/daemon/src/execution/interaction/internal/find.ts similarity index 95% rename from packages/daemon/src/interaction/internal/find.ts rename to packages/daemon/src/execution/interaction/internal/find.ts index 66c635830e..670c75bf5e 100644 --- a/packages/daemon/src/interaction/internal/find.ts +++ b/packages/daemon/src/execution/interaction/internal/find.ts @@ -13,28 +13,28 @@ import { type SnapshotKeyboardBandFact, type SnapshotState, } from '@agent-device/kernel/snapshot'; -import { expireRefFrame } from '../../ref-frame.ts'; -import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; -import type { SessionRef, SessionState } from '../../session-state.ts'; -import { SessionStore } from '../../session-store.ts'; -import { contextFromFlags } from '../../context.ts'; +import { expireRefFrame } from '../../../core/ref-frame.ts'; +import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../../core/session-state.ts'; +import { SessionStore } from '../../../core/session-store.ts'; +import { contextFromFlags } from '../../../core/context.ts'; import { readCommandMessage, successText } from '@agent-device/kernel/success-text'; -import type { RequestCaptureProof } from '../../capture-disclosure.ts'; -import { withCaptureDisclosures } from '../../capture-disclosure.ts'; -import { recordSessionAction } from '../../session-action-recorder.ts'; -import { stripInternalInteractionFlags } from '../../deferred-interaction-outcome.ts'; +import type { RequestCaptureProof } from '../../../core/capture-disclosure.ts'; +import { withCaptureDisclosures } from '../../../core/capture-disclosure.ts'; +import { recordSessionAction } from '../../../core/session-action-recorder.ts'; +import { stripInternalInteractionFlags } from '../../../core/deferred-interaction-outcome.ts'; import { resolveFindMatch } from './find-match-resolution.ts'; import { executeFocusPoint } from '../../focus-runtime.ts'; import { executeBoundTypeText } from '../../type-text-runtime.ts'; import { dispatchFindReadOnlyViaRuntime } from '../../selector-runtime.ts'; -import { admitAndBindSnapshotCapture } from '../../snapshot-runtime-binding.ts'; +import { admitAndBindSnapshotCapture } from '../../../core/snapshot-runtime-binding.ts'; import type { FocusPointInput } from '@agent-device/contracts/focus-runtime'; import { findRuntimeIntent, resolveSelectorCaptureRuntimePlan, } from '@agent-device/contracts/platform-runtime-operations'; import type { TypeTextRuntimeOperations } from '@agent-device/contracts/type-text-runtime'; -import type { FindRouteInput } from './types.ts'; +import type { FindRouteInput } from '../../../core/interaction/internal/types.ts'; import { createFindTargetCapture, sparseFindSnapshotResponse } from './find-target-capture.ts'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; import { errorResponse, noActiveSessionError } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/interaction/internal/interaction-android-escape.ts b/packages/daemon/src/execution/interaction/internal/interaction-android-escape.ts similarity index 95% rename from packages/daemon/src/interaction/internal/interaction-android-escape.ts rename to packages/daemon/src/execution/interaction/internal/interaction-android-escape.ts index 4f923396be..355acaf1b8 100644 --- a/packages/daemon/src/interaction/internal/interaction-android-escape.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-android-escape.ts @@ -1,7 +1,7 @@ import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; import { AppError } from '@agent-device/kernel/errors'; import { detectAndroidEscapeSurface } from '../../android-foreground-surface.ts'; -import type { SessionState } from '../../session-state.ts'; +import type { SessionState } from '../../../core/session-state.ts'; /** * Post-press escape guard. Throws when the tap left the app for a genuine diff --git a/packages/daemon/src/interaction/internal/interaction-common.ts b/packages/daemon/src/execution/interaction/internal/interaction-common.ts similarity index 94% rename from packages/daemon/src/interaction/internal/interaction-common.ts rename to packages/daemon/src/execution/interaction/internal/interaction-common.ts index 05d1ecccab..fcbb012248 100644 --- a/packages/daemon/src/interaction/internal/interaction-common.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-common.ts @@ -1,8 +1,8 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SettleObservation, SurfaceScopedNodes } from '@agent-device/contracts/interaction'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import { stripInternalInteractionFlags } from '../../deferred-interaction-outcome.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import { stripInternalInteractionFlags } from '../../../core/deferred-interaction-outcome.ts'; import { computeTargetEvidence, type RecordedTargetCapture, @@ -14,7 +14,7 @@ import { sensitiveFillPlaceholder, } from '@agent-device/ad-script'; import { parameterizeRecordedFillPayload } from '@agent-device/selectors/parameterized-recorded-fill'; -import type { InteractionFinalizationOperations } from './types.ts'; +import type { InteractionFinalizationOperations } from '../../../core/interaction/internal/types.ts'; export function finalizeTouchInteraction(params: { operations: InteractionFinalizationOperations; diff --git a/packages/daemon/src/interaction/internal/interaction-flags.ts b/packages/daemon/src/execution/interaction/internal/interaction-flags.ts similarity index 93% rename from packages/daemon/src/interaction/internal/interaction-flags.ts rename to packages/daemon/src/execution/interaction/internal/interaction-flags.ts index 4e72352012..075bc4352b 100644 --- a/packages/daemon/src/interaction/internal/interaction-flags.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-flags.ts @@ -1,6 +1,6 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SettleParams } from '@agent-device/contracts/interaction'; -import type { DaemonResponse } from '../../daemon-request.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; import { interactionErrorResponse } from './interaction-response.ts'; export function settleFlagGuardResponse( diff --git a/packages/daemon/src/interaction/internal/interaction-gesture-response.ts b/packages/daemon/src/execution/interaction/internal/interaction-gesture-response.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-gesture-response.ts rename to packages/daemon/src/execution/interaction/internal/interaction-gesture-response.ts diff --git a/packages/daemon/src/interaction/internal/interaction-gesture.ts b/packages/daemon/src/execution/interaction/internal/interaction-gesture.ts similarity index 97% rename from packages/daemon/src/interaction/internal/interaction-gesture.ts rename to packages/daemon/src/execution/interaction/internal/interaction-gesture.ts index 7e253533ab..31a516cc8d 100644 --- a/packages/daemon/src/interaction/internal/interaction-gesture.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-gesture.ts @@ -24,23 +24,23 @@ import { splitRefGenerationSuffix, type Point, } from '@agent-device/kernel/snapshot'; -import { resolveBoundGestureRuntime, type BoundGestureExecutor } from '../../gesture-runtime.ts'; -import { isActiveProviderDevice } from '../../provider-device-admission.ts'; +import { resolveBoundGestureRuntime, type BoundGestureExecutor } from '../../../core/gesture-runtime.ts'; +import { isActiveProviderDevice } from '../../../core/provider-device-admission.ts'; import { sleep } from '@agent-device/host-kit/retry'; import { ensureAndroidBlockingSystemDialogReady, type AndroidBlockingDialogReadinessResult, } from '../../android-system-dialog.ts'; -import { readRefMutationFrame } from '../../ref-frame.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; +import { readRefMutationFrame } from '../../../core/ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; import { thrownBeforeDispatch } from '../../request-dispatch-disclosure.ts'; -import type { SessionState } from '../../session-state.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { assertRefMutationAdmitted } from './interaction-ref-policy.ts'; import { createInteractionRuntimeForRoute, finalizeTouchInteraction, } from './interaction-runtime.ts'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import type { RecordedTargetCapture } from '@agent-device/selectors/target-evidence'; import { gestureResponseData } from './interaction-gesture-response.ts'; import { noActiveSessionError } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/interaction/internal/interaction-ios-tap-outcome.ts b/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.ts similarity index 96% rename from packages/daemon/src/interaction/internal/interaction-ios-tap-outcome.ts rename to packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.ts index daa210dd46..5c923a9360 100644 --- a/packages/daemon/src/interaction/internal/interaction-ios-tap-outcome.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.ts @@ -8,12 +8,12 @@ import { } from '@agent-device/capture-kit/snapshot-quality-verdict'; import { summarizeAxEvidence } from '@agent-device/capture-kit/snapshot-evidence'; import { getRequestSignal } from '@agent-device/host-kit/request'; -import { isLocalIosRunnerSession } from '../../direct-ios-selector.ts'; +import { isLocalIosRunnerSession } from '../../../core/direct-ios-selector.ts'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; -import type { SessionStore } from '../../session-store.ts'; -import type { SessionRef, SessionState } from '../../session-state.ts'; -import type { BoundSnapshotCapture } from '../../snapshot-runtime-binding.ts'; -import type { BoundContextFromFlags, CaptureSnapshotForSession } from './types.ts'; +import type { SessionStore } from '../../../core/session-store.ts'; +import type { SessionRef, SessionState } from '../../../core/session-state.ts'; +import type { BoundSnapshotCapture } from '../../../core/snapshot-runtime-binding.ts'; +import type { BoundContextFromFlags, CaptureSnapshotForSession } from '../../../core/interaction/internal/types.ts'; const XCTEST_RECORDED_FAILURE = 'XCTEST_RECORDED_FAILURE'; // A model commonly needs 5-10s to choose a target after receiving a snapshot. diff --git a/packages/daemon/src/interaction/internal/interaction-recorded-input.ts b/packages/daemon/src/execution/interaction/internal/interaction-recorded-input.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-recorded-input.ts rename to packages/daemon/src/execution/interaction/internal/interaction-recorded-input.ts diff --git a/packages/daemon/src/interaction/internal/interaction-ref-policy.ts b/packages/daemon/src/execution/interaction/internal/interaction-ref-policy.ts similarity index 96% rename from packages/daemon/src/interaction/internal/interaction-ref-policy.ts rename to packages/daemon/src/execution/interaction/internal/interaction-ref-policy.ts index b0a4723ce5..2e100ffd8b 100644 --- a/packages/daemon/src/interaction/internal/interaction-ref-policy.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-ref-policy.ts @@ -1,6 +1,6 @@ import { AppError } from '@agent-device/kernel/errors'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { RefFrameRejectReason, RefMutationFrame } from '../../ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { RefFrameRejectReason, RefMutationFrame } from '../../../core/ref-frame.ts'; import { interactionErrorResponse } from './interaction-response.ts'; export function refMutationAdmissionResponse(params: { diff --git a/packages/daemon/src/interaction/internal/interaction-response-data-transform.ts b/packages/daemon/src/execution/interaction/internal/interaction-response-data-transform.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-response-data-transform.ts rename to packages/daemon/src/execution/interaction/internal/interaction-response-data-transform.ts diff --git a/packages/daemon/src/interaction/internal/interaction-response.ts b/packages/daemon/src/execution/interaction/internal/interaction-response.ts similarity index 78% rename from packages/daemon/src/interaction/internal/interaction-response.ts rename to packages/daemon/src/execution/interaction/internal/interaction-response.ts index 345b6315f7..71658fa8e2 100644 --- a/packages/daemon/src/interaction/internal/interaction-response.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-response.ts @@ -1,4 +1,4 @@ -import type { DaemonResponse } from '../../daemon-request.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; export function interactionErrorResponse( code: string, diff --git a/packages/daemon/src/interaction/internal/interaction-runtime.ts b/packages/daemon/src/execution/interaction/internal/interaction-runtime.ts similarity index 90% rename from packages/daemon/src/interaction/internal/interaction-runtime.ts rename to packages/daemon/src/execution/interaction/internal/interaction-runtime.ts index bee3cd7c63..d62c4a488c 100644 --- a/packages/daemon/src/interaction/internal/interaction-runtime.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-runtime.ts @@ -8,30 +8,30 @@ import type { } from '@agent-device/contracts/backend'; import { getRequestSignal } from '@agent-device/host-kit/request'; import type { Rect, SnapshotState } from '@agent-device/kernel/snapshot'; -import type { DaemonCommandContext } from '../../context.ts'; +import type { DaemonCommandContext } from '../../../core/context.ts'; import { createDaemonRuntimePolicy } from '../../runtime-policy.ts'; -import { recordCaptureProof } from '../../capture-disclosure.ts'; +import { recordCaptureProof } from '../../../core/capture-disclosure.ts'; import { confirmIosOffscreenTargetVisible } from '../../offscreen-target-probe.ts'; -import { runtimeExecutionFromContext } from '../../snapshot-runtime-capture-input.ts'; -import { createDaemonRuntimeSessionStore } from '../../runtime-session.ts'; -import { expireRefFrame } from '../../ref-frame.ts'; +import { runtimeExecutionFromContext } from '../../../core/snapshot-runtime-capture-input.ts'; +import { createDaemonRuntimeSessionStore } from '../../../core/runtime-session.ts'; +import { expireRefFrame } from '../../../core/ref-frame.ts'; import { setSessionSnapshot } from '../../session-snapshot.ts'; import type { CaptureSnapshotForSession, InteractionRouteInput, InteractionRuntimeInput, SettleObservationCaptureInput, -} from './types.ts'; +} from '../../../core/interaction/internal/types.ts'; import { finalizeTouchInteraction as finalizeInteraction } from './interaction-common.ts'; -import { markDeferredInteractionOutcome } from '../../deferred-interaction-outcome.ts'; -import { isSessionRecording } from '../../session-script-publication-capability.ts'; -import { recordTouchVisualizationEvent } from '../../recording-gestures.ts'; -import type { SessionStore } from '../../session-store.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionRef } from '../../session-state.ts'; -import type { BoundTouchExecutor } from '../../touch-runtime.ts'; -import type { BoundGestureExecutor } from '../../gesture-runtime.ts'; -import type { BoundSnapshotCapture } from '../../snapshot-runtime-binding.ts'; +import { markDeferredInteractionOutcome } from '../../../core/deferred-interaction-outcome.ts'; +import { isSessionRecording } from '../../../core/session-script-publication-capability.ts'; +import { recordTouchVisualizationEvent } from '../../../core/recording-gestures.ts'; +import type { SessionStore } from '../../../core/session-store.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionRef } from '../../../core/session-state.ts'; +import type { BoundTouchExecutor } from '../../../core/touch-runtime.ts'; +import type { BoundGestureExecutor } from '../../../core/gesture-runtime.ts'; +import type { BoundSnapshotCapture } from '../../../core/snapshot-runtime-binding.ts'; import { NO_ACTIVE_SESSION_MESSAGE } from '@agent-device/kernel/contracts'; export async function createInteractionRuntimeForRoute( diff --git a/packages/daemon/src/interaction/internal/interaction-session.ts b/packages/daemon/src/execution/interaction/internal/interaction-session.ts similarity index 65% rename from packages/daemon/src/interaction/internal/interaction-session.ts rename to packages/daemon/src/execution/interaction/internal/interaction-session.ts index fa079cd281..8f80c14e17 100644 --- a/packages/daemon/src/interaction/internal/interaction-session.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-session.ts @@ -1,5 +1,5 @@ -import type { InteractionRouteInput } from './types.ts'; -import type { SessionRef } from '../../session-state.ts'; +import type { InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; +import type { SessionRef } from '../../../core/session-state.ts'; export function bindInteractionSession( params: Params, diff --git a/packages/daemon/src/interaction/internal/interaction-snapshot.ts b/packages/daemon/src/execution/interaction/internal/interaction-snapshot.ts similarity index 92% rename from packages/daemon/src/interaction/internal/interaction-snapshot.ts rename to packages/daemon/src/execution/interaction/internal/interaction-snapshot.ts index 32af84964c..cefb420438 100644 --- a/packages/daemon/src/interaction/internal/interaction-snapshot.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-snapshot.ts @@ -1,13 +1,13 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import type { DaemonCommandContext } from '../../context.ts'; +import type { DaemonCommandContext } from '../../../core/context.ts'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; import { snapshotOptionsToFlags } from '@agent-device/contracts/backend-snapshot-options'; import type { BoundContextFromFlags, InteractionSessionView, InteractionSnapshotOptions, -} from './types.ts'; +} from '../../../core/interaction/internal/types.ts'; export type InteractionSnapshotCapture = (params: { flags: CommandFlags; diff --git a/packages/daemon/src/interaction/internal/interaction-targeting.ts b/packages/daemon/src/execution/interaction/internal/interaction-targeting.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-targeting.ts rename to packages/daemon/src/execution/interaction/internal/interaction-targeting.ts diff --git a/packages/daemon/src/interaction/internal/interaction-touch-android-freshness.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-android-freshness.ts similarity index 85% rename from packages/daemon/src/interaction/internal/interaction-touch-android-freshness.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-android-freshness.ts index 2704184b40..9d33239090 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-android-freshness.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-android-freshness.ts @@ -1,7 +1,7 @@ import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; -import { getActiveAndroidSnapshotFreshness } from '../../session-snapshot-freshness.ts'; -import type { SessionState } from '../../session-state.ts'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import { getActiveAndroidSnapshotFreshness } from '../../../core/session-snapshot-freshness.ts'; +import type { SessionState } from '../../../core/session-state.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; /** * The Android ref-refresh capture a `@ref` mutation takes before dispatch, and diff --git a/packages/daemon/src/interaction/internal/interaction-touch-android-readiness.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-android-readiness.ts similarity index 92% rename from packages/daemon/src/interaction/internal/interaction-touch-android-readiness.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-android-readiness.ts index 77da08deca..30d684558e 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-android-readiness.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-android-readiness.ts @@ -2,9 +2,9 @@ import { ensureAndroidBlockingSystemDialogReady, type AndroidBlockingDialogReadinessResult, } from '../../android-system-dialog.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; -import { readRefMutationFrame } from '../../ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; +import { readRefMutationFrame } from '../../../core/ref-frame.ts'; import { refMutationAdmissionResponse } from './interaction-ref-policy.ts'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; diff --git a/packages/daemon/src/interaction/internal/interaction-touch-direct-ios.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-direct-ios.ts similarity index 94% rename from packages/daemon/src/interaction/internal/interaction-touch-direct-ios.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-direct-ios.ts index 96564df057..c3ff5c5738 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-direct-ios.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-direct-ios.ts @@ -4,14 +4,14 @@ import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { isDirectIosSelectorFallbackError, type DirectIosSelectorTarget, -} from '../../direct-ios-selector.ts'; -import { expireRefFrame } from '../../ref-frame.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +} from '../../../core/direct-ios-selector.ts'; +import { expireRefFrame } from '../../../core/ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { finalizeTouchInteraction } from './interaction-runtime.ts'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import { corroborateIosTapFailure } from './interaction-ios-tap-outcome.ts'; -import type { BoundTouchExecutor } from '../../touch-runtime.ts'; +import type { BoundTouchExecutor } from '../../../core/touch-runtime.ts'; import { buildCorroboratedTapResponseData, buildInteractionResponseData, diff --git a/packages/daemon/src/interaction/internal/interaction-touch-fill.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-fill.ts similarity index 94% rename from packages/daemon/src/interaction/internal/interaction-touch-fill.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-fill.ts index 0142edac5d..e2ef365ce5 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-fill.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-fill.ts @@ -2,11 +2,11 @@ import { bindInteractionSession } from './interaction-session.ts'; import type { CommandFlags } from '@agent-device/contracts/command'; import type { FillCommandResult, InteractionTarget } from '@agent-device/contracts/interaction'; import { issueSettleRefs, resolveRefStalenessWarning } from '../../session-snapshot.ts'; -import { readRefMutationFrame } from '../../ref-frame.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionRef, SessionState } from '../../session-state.ts'; -import type { SessionStore } from '../../session-store.ts'; -import { isSessionRecording } from '../../session-script-publication-capability.ts'; +import { readRefMutationFrame } from '../../../core/ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../../core/session-state.ts'; +import type { SessionStore } from '../../../core/session-store.ts'; +import { isSessionRecording } from '../../../core/session-script-publication-capability.ts'; import { assertRecordedFillParameterization } from './interaction-recorded-input.ts'; import { readSettleRequest, settleFlagGuardResponse } from './interaction-flags.ts'; import { refMutationAdmissionResponse } from './interaction-ref-policy.ts'; @@ -15,7 +15,7 @@ import type { InteractionRouteInput, RefSnapshotFlagGuardResponse, SettleObservationCaptureInput, -} from './types.ts'; +} from '../../../core/interaction/internal/types.ts'; import { refreshAndroidRefSnapshotIfFreshnessActive } from './interaction-touch-android-freshness.ts'; import { unsupportedMacOsDesktopSurfaceInteraction } from './interaction-touch-policy.ts'; import { readSnapshotNodesReferenceFrame } from '@agent-device/capture-kit/touch-reference-frame'; @@ -29,7 +29,7 @@ import { dispatchRuntimeInteraction } from './interaction-touch-runtime.ts'; import { parseFillTarget } from './interaction-touch-targets.ts'; import { prepareTouchDispatch } from './interaction-touch-prepare.ts'; import { refusedBeforeDispatch, thrownBeforeDispatch } from '../../request-dispatch-disclosure.ts'; -import type { BoundTouchExecutor } from '../../touch-runtime.ts'; +import type { BoundTouchExecutor } from '../../../core/touch-runtime.ts'; import { noActiveSessionError } from '@agent-device/kernel/contracts'; /** diff --git a/packages/daemon/src/interaction/internal/interaction-touch-payload.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-payload.ts similarity index 100% rename from packages/daemon/src/interaction/internal/interaction-touch-payload.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-payload.ts diff --git a/packages/daemon/src/interaction/internal/interaction-touch-policy.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-policy.ts similarity index 84% rename from packages/daemon/src/interaction/internal/interaction-touch-policy.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-policy.ts index c557478326..ff7d7049a0 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-policy.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-policy.ts @@ -1,6 +1,6 @@ import { isMacOs } from '@agent-device/kernel/device'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; export function unsupportedMacOsDesktopSurfaceInteraction( diff --git a/packages/daemon/src/interaction/internal/interaction-touch-prepare.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.ts similarity index 85% rename from packages/daemon/src/interaction/internal/interaction-touch-prepare.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.ts index 6cc9ab7ba5..f38fa831f3 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-prepare.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.ts @@ -1,14 +1,14 @@ -import type { SessionState } from '../../session-state.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { createBoundTouchExecutor, resolveBoundTouchRuntime, type BoundTouchExecutor, type TouchRuntimeCommand, -} from '../../touch-runtime.ts'; +} from '../../../core/touch-runtime.ts'; import { readSettleRequest } from './interaction-flags.ts'; -import type { BoundSnapshotCapture } from '../../snapshot-runtime-binding.ts'; -import { resolveSettleObservationCapture } from '../../settle-observation-capture.ts'; -import type { InteractionRouteInput } from './types.ts'; +import type { BoundSnapshotCapture } from '../../../core/snapshot-runtime-binding.ts'; +import { resolveSettleObservationCapture } from '../../../core/settle-observation-capture.ts'; +import type { InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import type { DaemonFailureResponse } from '@agent-device/kernel/contracts'; import { refusedBeforeDispatch } from '../../request-dispatch-disclosure.ts'; diff --git a/packages/daemon/src/interaction/internal/interaction-touch-press-admission.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-press-admission.ts similarity index 96% rename from packages/daemon/src/interaction/internal/interaction-touch-press-admission.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-press-admission.ts index b57006e5aa..63232dfa26 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-press-admission.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-press-admission.ts @@ -7,9 +7,9 @@ import { } from '@agent-device/contracts/click-button'; import { publicPlatformString } from '@agent-device/kernel/device'; import { resolveRefStalenessWarning } from '../../session-snapshot.ts'; -import { readRefMutationFrame } from '../../ref-frame.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +import { readRefMutationFrame } from '../../../core/ref-frame.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { refMutationAdmissionResponse } from './interaction-ref-policy.ts'; import { refusedBeforeDispatch } from '../../request-dispatch-disclosure.ts'; import { settleFlagGuardResponse } from './interaction-flags.ts'; @@ -17,7 +17,7 @@ import type { CaptureSnapshotForSession, InteractionRouteInput, RefSnapshotFlagGuardResponse, -} from './types.ts'; +} from '../../../core/interaction/internal/types.ts'; import type { RefAdmissionContext } from './interaction-touch-android-readiness.ts'; import { unsupportedMacOsDesktopSurfaceInteraction } from './interaction-touch-policy.ts'; import { diff --git a/packages/daemon/src/interaction/internal/interaction-touch-press.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-press.ts similarity index 97% rename from packages/daemon/src/interaction/internal/interaction-touch-press.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-press.ts index 1bd6944889..e19a4384f1 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-press.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-press.ts @@ -6,12 +6,12 @@ import type { } from '@agent-device/contracts/interaction'; import type { resolveClickButton } from '@agent-device/contracts/click-button'; import type { ReplayTargetGuardDenotation } from '@agent-device/contracts/replay'; -import type { DaemonResponse } from '../../daemon-request.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; import { assertAndroidPressStayedInApp } from './interaction-android-escape.ts'; import { createInteractionRuntimeForRoute } from './interaction-runtime.ts'; import { readSettleRequest } from './interaction-flags.ts'; import { dispatchDirectIosSelectorTap } from './interaction-touch-direct-ios.ts'; -import { readDirectIosSelectorTapTarget } from './interaction-touch-direct-ios-eligibility.ts'; +import { readDirectIosSelectorTapTarget } from '../../../core/interaction/internal/interaction-touch-direct-ios-eligibility.ts'; import { admitTargetedTouch, type AdmittedTargetedTouch, diff --git a/packages/daemon/src/interaction/internal/interaction-touch-reference-frame.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-reference-frame.ts similarity index 91% rename from packages/daemon/src/interaction/internal/interaction-touch-reference-frame.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-reference-frame.ts index e8c4c39389..ab8bcca713 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-reference-frame.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-reference-frame.ts @@ -2,11 +2,11 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; import type { GestureReferenceFrame } from '@agent-device/contracts/scroll-gesture'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; -import type { SessionStore } from '../../session-store.ts'; +import type { SessionStore } from '../../../core/session-store.ts'; import { getSnapshotReferenceFrame } from '@agent-device/capture-kit/touch-reference-frame'; -import type { SessionRef } from '../../session-state.ts'; -import type { BoundContextFromFlags, CaptureSnapshotForSession } from './types.ts'; -import { isActiveProviderDevice } from '../../provider-device-admission.ts'; +import type { SessionRef } from '../../../core/session-state.ts'; +import type { BoundContextFromFlags, CaptureSnapshotForSession } from '../../../core/interaction/internal/types.ts'; +import { isActiveProviderDevice } from '../../../core/provider-device-admission.ts'; async function resolveDirectTouchReferenceFrame(params: { ref: SessionRef; diff --git a/packages/daemon/src/interaction/internal/interaction-touch-response.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-response.ts similarity index 99% rename from packages/daemon/src/interaction/internal/interaction-touch-response.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-response.ts index 3ed955f893..36158a0fb9 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-response.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-response.ts @@ -17,7 +17,7 @@ import { } from './interaction-response-data-transform.ts'; import { issueSettleRefs } from '../../session-snapshot.ts'; import type { RecordedTargetCapture } from '@agent-device/selectors/target-evidence'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import { resolveDirectTouchReferenceFrameSafely } from './interaction-touch-reference-frame.ts'; import { readSnapshotNodesReferenceFrame } from '@agent-device/capture-kit/touch-reference-frame'; import { buildTouchPayload } from './interaction-touch-payload.ts'; @@ -155,7 +155,7 @@ export function buildInteractionResponseData(params: { extra?: Record; /** * Staleness warning for the consumed `@ref` argument (ADR 0014), resolved by - * `resolveRefStalenessWarning` (packages/daemon/src/session-snapshot.ts): the + * `resolveRefStalenessWarning` (packages/daemon/src/execution/session-snapshot.ts): the * STALE_SNAPSHOT_REFS_WARNING for a plain ref once the frame has expired, or * the precise pinned-generation warning for a `@e12~s3` ref whose epoch no * longer matches the frame. Stale mutations are rejected before reaching this diff --git a/packages/daemon/src/interaction/internal/interaction-touch-runtime.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-runtime.ts similarity index 95% rename from packages/daemon/src/interaction/internal/interaction-touch-runtime.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-runtime.ts index b7b7480468..30ec02fd0c 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-runtime.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-runtime.ts @@ -11,14 +11,14 @@ import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { asAppError, normalizeError } from '@agent-device/kernel/errors'; import { readResolvedInteractionTarget } from '@agent-device/host-kit/interaction-outcome'; import { publishAmbiguousMatchCandidateRefs } from '../../session-snapshot.ts'; -import { isSessionRecording } from '../../session-script-publication-capability.ts'; -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionState } from '../../session-state.ts'; +import { isSessionRecording } from '../../../core/session-script-publication-capability.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionState } from '../../../core/session-state.ts'; import { createInteractionRuntimeForRoute, finalizeTouchInteraction, } from './interaction-runtime.ts'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import { isAndroidEscapeError } from './interaction-android-escape.ts'; import { corroborateIosTapFailure, interactionTargetExtra } from './interaction-ios-tap-outcome.ts'; import { @@ -31,8 +31,8 @@ import { buildInteractionResponseData, type InteractionResponsePayloads, } from './interaction-touch-response.ts'; -import type { BoundTouchExecutor } from '../../touch-runtime.ts'; -import type { BoundSnapshotCapture } from '../../snapshot-runtime-binding.ts'; +import type { BoundTouchExecutor } from '../../../core/touch-runtime.ts'; +import type { BoundSnapshotCapture } from '../../../core/snapshot-runtime-binding.ts'; import { noActiveSessionError } from '@agent-device/kernel/contracts'; /** diff --git a/packages/daemon/src/interaction/internal/interaction-touch-targets.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-targets.ts similarity index 99% rename from packages/daemon/src/interaction/internal/interaction-touch-targets.ts rename to packages/daemon/src/execution/interaction/internal/interaction-touch-targets.ts index 922da79a98..100dee27a2 100644 --- a/packages/daemon/src/interaction/internal/interaction-touch-targets.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-targets.ts @@ -9,7 +9,7 @@ import { stripAtPrefix, type DecodedFillTarget, } from '@agent-device/selectors/interaction-positionals'; -import type { DaemonResponse } from '../../daemon-request.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; import { parseCoordinateTarget } from './interaction-targeting.ts'; import { parseVersionedRefPositional } from '../../ref-positionals.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/interaction/internal/interaction.ts b/packages/daemon/src/execution/interaction/internal/interaction.ts similarity index 96% rename from packages/daemon/src/interaction/internal/interaction.ts rename to packages/daemon/src/execution/interaction/internal/interaction.ts index 34bdb679c7..bf3d6ee567 100644 --- a/packages/daemon/src/interaction/internal/interaction.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction.ts @@ -1,13 +1,13 @@ -import type { DaemonResponse } from '../../daemon-request.ts'; -import type { SessionRef, SessionState } from '../../session-state.ts'; -import { type RequestCaptureProof, withCaptureDisclosures } from '../../capture-disclosure.ts'; -import type { CaptureSnapshotForSession, InteractionRouteInput } from './types.ts'; +import type { DaemonResponse } from '../../../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../../../core/session-state.ts'; +import { type RequestCaptureProof, withCaptureDisclosures } from '../../../core/capture-disclosure.ts'; +import type { CaptureSnapshotForSession, InteractionRouteInput } from '../../../core/interaction/internal/types.ts'; import { dispatchFillViaRuntime } from './interaction-touch-fill.ts'; import { dispatchTargetedTouchViaRuntime } from './interaction-touch-press.ts'; import { finalizeTouchInteraction } from './interaction-runtime.ts'; import { refSnapshotFlagGuardResponse } from '../../ref-snapshot-flag-policy.ts'; import { dispatchGetViaRuntime, dispatchIsViaRuntime } from '../../selector-runtime.ts'; -import { expireRefFrame } from '../../ref-frame.ts'; +import { expireRefFrame } from '../../../core/ref-frame.ts'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { normalizeError } from '@agent-device/kernel/errors'; import { diff --git a/packages/daemon/src/internal-observation.ts b/packages/daemon/src/execution/internal-observation.ts similarity index 95% rename from packages/daemon/src/internal-observation.ts rename to packages/daemon/src/execution/internal-observation.ts index ad1e4bff5b..7b9659c4dd 100644 --- a/packages/daemon/src/internal-observation.ts +++ b/packages/daemon/src/execution/internal-observation.ts @@ -6,11 +6,11 @@ import type { ReplayRefPublicationProjection, ReplayRefPublicationResult, } from '@agent-device/contracts/replay'; -import { readSessionRuntimeRevision, refFrame } from './ref-frame.ts'; -import type { RefFrame } from './ref-frame-slot.ts'; +import { readSessionRuntimeRevision, refFrame } from '../core/ref-frame.ts'; +import type { RefFrame } from '../core/ref-frame-slot.ts'; import { markSessionPartialRefsIssued, setSessionSnapshot } from './session-snapshot.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; -import type { SessionStore } from './session-store.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; +import type { SessionStore } from '../core/session-store.ts'; type InternalObservationLineage = Readonly<{ ref: SessionRef; diff --git a/packages/daemon/src/keyboard-runtime.ts b/packages/daemon/src/execution/keyboard-runtime.ts similarity index 98% rename from packages/daemon/src/keyboard-runtime.ts rename to packages/daemon/src/execution/keyboard-runtime.ts index 5330e5c184..71e394afc5 100644 --- a/packages/daemon/src/keyboard-runtime.ts +++ b/packages/daemon/src/execution/keyboard-runtime.ts @@ -22,13 +22,13 @@ import { type KeyboardAction, } from '@agent-device/session-journal/keyboard-actions'; import { successText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; import { admitRuntimeUse, type RuntimeAdmissionBindings, type RuntimeAdmissionRequest, -} from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +} from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; import type { DaemonFailureResponse } from '@agent-device/kernel/contracts'; type KeyboardRuntimeAction = 'status' | 'dismiss' | 'enter'; diff --git a/packages/daemon/src/offscreen-target-probe.ts b/packages/daemon/src/execution/offscreen-target-probe.ts similarity index 93% rename from packages/daemon/src/offscreen-target-probe.ts rename to packages/daemon/src/execution/offscreen-target-probe.ts index ff253d7e98..b28e560b51 100644 --- a/packages/daemon/src/offscreen-target-probe.ts +++ b/packages/daemon/src/execution/offscreen-target-probe.ts @@ -2,8 +2,8 @@ import type { Rect, SnapshotNode } from '@agent-device/kernel/snapshot'; import { isConfirmedOnScreenProbe } from '@agent-device/capture-kit/mobile-snapshot-semantics'; import type { QuerySelectorRuntimeOperations } from '@agent-device/contracts/selector-observation-runtime'; import type { SnapshotRuntimeExecution } from '@agent-device/contracts/snapshot-runtime'; -import { deriveDirectIosNodeSelector } from './direct-ios-selector.ts'; -import type { SessionState } from './session-state.ts'; +import { deriveDirectIosNodeSelector } from '../core/direct-ios-selector.ts'; +import type { SessionState } from '../core/session-state.ts'; /** * The #1542 rescue read: one live `querySelector` on the caller's request-bound operation, diff --git a/packages/daemon/src/orientation-runtime.ts b/packages/daemon/src/execution/orientation-runtime.ts similarity index 92% rename from packages/daemon/src/orientation-runtime.ts rename to packages/daemon/src/execution/orientation-runtime.ts index 170d1fb87b..97c3fcef2d 100644 --- a/packages/daemon/src/orientation-runtime.ts +++ b/packages/daemon/src/execution/orientation-runtime.ts @@ -4,10 +4,10 @@ import { orientationRuntimeUse } from '@agent-device/contracts/platform-runtime- import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { successText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; /** `orientation `, on the same parse the retired leaf used. */ export function readRequestedOrientation(positionals: readonly string[]): DeviceRotation { diff --git a/packages/daemon/src/ref-positionals.ts b/packages/daemon/src/execution/ref-positionals.ts similarity index 94% rename from packages/daemon/src/ref-positionals.ts rename to packages/daemon/src/execution/ref-positionals.ts index 1e0e629661..1a8689edc1 100644 --- a/packages/daemon/src/ref-positionals.ts +++ b/packages/daemon/src/execution/ref-positionals.ts @@ -1,5 +1,5 @@ import { REF_GRAMMAR_HINT, splitRefGenerationSuffix } from '@agent-device/kernel/snapshot'; -import type { DaemonResponse } from './daemon-request.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; /** diff --git a/packages/daemon/src/ref-snapshot-flag-policy.ts b/packages/daemon/src/execution/ref-snapshot-flag-policy.ts similarity index 92% rename from packages/daemon/src/ref-snapshot-flag-policy.ts rename to packages/daemon/src/execution/ref-snapshot-flag-policy.ts index 2ae4232ba7..e112ded6c8 100644 --- a/packages/daemon/src/ref-snapshot-flag-policy.ts +++ b/packages/daemon/src/execution/ref-snapshot-flag-policy.ts @@ -1,5 +1,5 @@ import type { CommandFlags } from '@agent-device/contracts/command'; -import type { DaemonResponse } from './daemon-request.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; const REF_UNSUPPORTED_FLAG_MAP: ReadonlyArray<[keyof CommandFlags, string]> = [ diff --git a/packages/daemon/src/request-dispatch-disclosure.ts b/packages/daemon/src/execution/request-dispatch-disclosure.ts similarity index 94% rename from packages/daemon/src/request-dispatch-disclosure.ts rename to packages/daemon/src/execution/request-dispatch-disclosure.ts index 8fef8ecaeb..35e331d587 100644 --- a/packages/daemon/src/request-dispatch-disclosure.ts +++ b/packages/daemon/src/execution/request-dispatch-disclosure.ts @@ -6,8 +6,8 @@ import { type ErrorWireDetails, } from '@agent-device/kernel/errors'; import { resolveCommandRecordingEffect } from '@agent-device/command-registry/registry'; -import type { DaemonRequest, DaemonResponse } from './daemon-request.ts'; -import type { RequestDispatchLedger } from './request-dispatch-ledger.ts'; +import type { DaemonRequest, DaemonResponse } from '../core/daemon-request.ts'; +import type { RequestDispatchLedger } from '../core/request-dispatch-ledger.ts'; type RecordingEffect = ReturnType; diff --git a/packages/daemon/src/request-generic-dispatch.ts b/packages/daemon/src/execution/request-generic-dispatch.ts similarity index 94% rename from packages/daemon/src/request-generic-dispatch.ts rename to packages/daemon/src/execution/request-generic-dispatch.ts index 4c76de00e2..6547d18fe9 100644 --- a/packages/daemon/src/request-generic-dispatch.ts +++ b/packages/daemon/src/execution/request-generic-dispatch.ts @@ -1,32 +1,32 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SettleObservation } from '@agent-device/contracts/interaction'; 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 } from './daemon-request.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; -import type { DaemonPlatformServices } from './platform-services.ts'; +import type { SessionStore } from '../core/session-store.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { DaemonRequest, DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; +import type { DaemonPlatformServices } from '../core/platform-services.ts'; import { ensureAndroidBlockingSystemDialogReady, recoverAndroidBlockingSystemDialog, } from './android-system-dialog.ts'; -import { markDeferredInteractionOutcome } from './deferred-interaction-outcome.ts'; +import { markDeferredInteractionOutcome } from '../core/deferred-interaction-outcome.ts'; import { augmentScrollVisualizationResult, recordTouchVisualizationEvent, -} from './recording-gestures.ts'; +} from '../core/recording-gestures.ts'; import { normalizeError } from '@agent-device/kernel/errors'; -import { expireRefFrame } from './ref-frame.ts'; +import { expireRefFrame } from '../core/ref-frame.ts'; import { resolveRefFrameEffect, shouldGuardAndroidBlockingDialog, -} from './daemon-command-registry.ts'; -import { isActiveProviderDevice } from './provider-device-admission.ts'; +} from '../core/daemon-command-registry.ts'; +import { isActiveProviderDevice } from '../core/provider-device-admission.ts'; import { buildActionEventResult } from '@agent-device/session-journal/session-event-action-presentation'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon-command-surface'; -import type { GenericPlatformExecution, RecordedGenericRequest } from './generic-leaf-execution.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; +import type { GenericPlatformExecution, RecordedGenericRequest } from '../core/generic-leaf-execution.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../core/request-runtime-binding.ts'; export async function dispatchGenericCommand(params: { req: DaemonRequest; diff --git a/packages/daemon/src/runtime-artifacts.ts b/packages/daemon/src/execution/runtime-artifacts.ts similarity index 100% rename from packages/daemon/src/runtime-artifacts.ts rename to packages/daemon/src/execution/runtime-artifacts.ts diff --git a/packages/daemon/src/runtime-policy.ts b/packages/daemon/src/execution/runtime-policy.ts similarity index 100% rename from packages/daemon/src/runtime-policy.ts rename to packages/daemon/src/execution/runtime-policy.ts diff --git a/packages/daemon/src/screenshot-crop-target.ts b/packages/daemon/src/execution/screenshot-crop-target.ts similarity index 100% rename from packages/daemon/src/screenshot-crop-target.ts rename to packages/daemon/src/execution/screenshot-crop-target.ts diff --git a/packages/daemon/src/screenshot-crop.ts b/packages/daemon/src/execution/screenshot-crop.ts similarity index 94% rename from packages/daemon/src/screenshot-crop.ts rename to packages/daemon/src/execution/screenshot-crop.ts index 60f1faf87a..964cfd0ec1 100644 --- a/packages/daemon/src/screenshot-crop.ts +++ b/packages/daemon/src/execution/screenshot-crop.ts @@ -15,11 +15,11 @@ import { import { buildSnapshotState } from '@agent-device/capture-kit/snapshot-state'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import { resolveSelectorPipeline } from '@agent-device/selectors/selector-pipeline'; -import type { DaemonCommandContext } from './context.ts'; -import { captureSnapshotData } from './snapshot-capture.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import { captureSnapshotData } from '../core/snapshot-capture.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; import type { BoundScreenshotRuntime } from './screenshot-runtime-binding.ts'; -import type { SessionState } from './session-state.ts'; +import type { SessionState } from '../core/session-state.ts'; export type ScreenshotCropOutcome = Readonly<{ partialIntersection: boolean }>; diff --git a/packages/daemon/src/screenshot-runtime-binding.ts b/packages/daemon/src/execution/screenshot-runtime-binding.ts similarity index 95% rename from packages/daemon/src/screenshot-runtime-binding.ts rename to packages/daemon/src/execution/screenshot-runtime-binding.ts index a0c75f0969..656d3307e4 100644 --- a/packages/daemon/src/screenshot-runtime-binding.ts +++ b/packages/daemon/src/execution/screenshot-runtime-binding.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from './platform-services.ts'; +import type { DaemonPlatformServices } from '../core/platform-services.ts'; import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime'; import { type ScreenshotRuntimePlan, @@ -21,9 +21,9 @@ import { unavailableRuntimeOperationResponse, unwrapAdmittedRuntimePlan, type AdmittedRuntimePlan, -} from './session-runtime-admission.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; -import type { DaemonResponse } from './daemon-request.ts'; +} from '../core/session-runtime-admission.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../core/request-runtime-binding.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; export type ScreenshotRuntimeBindings = Readonly<{ diff --git a/packages/daemon/src/screenshot-runtime.ts b/packages/daemon/src/execution/screenshot-runtime.ts similarity index 97% rename from packages/daemon/src/screenshot-runtime.ts rename to packages/daemon/src/execution/screenshot-runtime.ts index 500630360f..890cd5cf92 100644 --- a/packages/daemon/src/screenshot-runtime.ts +++ b/packages/daemon/src/execution/screenshot-runtime.ts @@ -21,12 +21,12 @@ import { assertSupportedScreenshotPixelDensity, readScreenshotResultMetadata, } from '@agent-device/capture-kit/screenshot-density'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; -import type { DaemonCommandContext } from './context.ts'; -import { captureSnapshotData } from './snapshot-capture.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import { captureSnapshotData } from '../core/snapshot-capture.ts'; import { buildSnapshotState } from '@agent-device/capture-kit/snapshot-state'; -import type { RecordedGenericRequest, ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { createReadonlyRuntimeSessionStore } from './runtime-session.ts'; +import type { RecordedGenericRequest, ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { createReadonlyRuntimeSessionStore } from '../core/runtime-session.ts'; import { assertScreenshotCropPolicy } from './screenshot-crop-target.ts'; import { buildScreenshotCropWarnings, cropScreenshotToSelector } from './screenshot-crop.ts'; import { annotateScreenshotWithRefs } from '@agent-device/capture-kit/screenshot-overlay'; @@ -36,8 +36,8 @@ import { type ScreenshotRuntimeBindings, } from './screenshot-runtime-binding.ts'; import { setSessionSnapshot } from './session-snapshot.ts'; -import type { DaemonRequest } from './daemon-request.ts'; -import type { SessionState } from './session-state.ts'; +import type { DaemonRequest } from '../core/daemon-request.ts'; +import type { SessionState } from '../core/session-state.ts'; /** * The `screenshot` leaf of the generic route. Argument policy is answered before any device work, diff --git a/packages/daemon/src/scroll-movement.ts b/packages/daemon/src/execution/scroll-movement.ts similarity index 99% rename from packages/daemon/src/scroll-movement.ts rename to packages/daemon/src/execution/scroll-movement.ts index a05c112964..f66ae5b209 100644 --- a/packages/daemon/src/scroll-movement.ts +++ b/packages/daemon/src/execution/scroll-movement.ts @@ -29,10 +29,10 @@ import { summarizeDiscriminatingSurfaceDivergence, type InteractionSurfaceChange, type InteractionSurfaceSignature, -} from './interaction-surface-signature.ts'; -import { refFrameState } from './ref-frame.ts'; -import { isPostGestureStabilizationPending } from './deferred-interaction-outcome.ts'; -import type { SessionState } from './session-state.ts'; +} from '../core/interaction-surface-signature.ts'; +import { refFrameState } from '../core/ref-frame.ts'; +import { isPostGestureStabilizationPending } from '../core/deferred-interaction-outcome.ts'; +import type { SessionState } from '../core/session-state.ts'; /** * What one directional scroll saw after its gesture, and the only thing that can back the distance diff --git a/packages/daemon/src/scroll-runtime.ts b/packages/daemon/src/execution/scroll-runtime.ts similarity index 98% rename from packages/daemon/src/scroll-runtime.ts rename to packages/daemon/src/execution/scroll-runtime.ts index 40ea1212e7..b37c7a90a1 100644 --- a/packages/daemon/src/scroll-runtime.ts +++ b/packages/daemon/src/execution/scroll-runtime.ts @@ -32,10 +32,10 @@ import { formatScrollUntilMessage, runScrollUntilVisible } from './scroll-until. import { publicPlatformString } from '@agent-device/kernel/device'; import type { CommandFlags } from '@agent-device/contracts/command'; import { withSuccessText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; -import type { SessionState } from './session-state.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { SessionState } from '../core/session-state.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; import { observeScrollMovement, planScrollMovement, @@ -44,7 +44,7 @@ import { type ScrollMovementPlan, type ScrollSwipeEvidence, } from './scroll-movement.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; import type { CaptureSnapshotInput } from '@agent-device/contracts/snapshot-runtime'; import { errorResponse } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/scroll-until.test.ts b/packages/daemon/src/execution/scroll-until.test.ts similarity index 100% rename from packages/daemon/src/scroll-until.test.ts rename to packages/daemon/src/execution/scroll-until.test.ts diff --git a/packages/daemon/src/scroll-until.ts b/packages/daemon/src/execution/scroll-until.ts similarity index 100% rename from packages/daemon/src/scroll-until.ts rename to packages/daemon/src/execution/scroll-until.ts diff --git a/packages/daemon/src/selector-capture-binding.ts b/packages/daemon/src/execution/selector-capture-binding.ts similarity index 91% rename from packages/daemon/src/selector-capture-binding.ts rename to packages/daemon/src/execution/selector-capture-binding.ts index aa721933d4..76ddbd45ab 100644 --- a/packages/daemon/src/selector-capture-binding.ts +++ b/packages/daemon/src/execution/selector-capture-binding.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from './platform-services.ts'; +import type { DaemonPlatformServices } from '../core/platform-services.ts'; import type { ElementTextRuntimeOperations } from '@agent-device/contracts/element-text-runtime'; import { resolveSelectorCaptureRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; import type { FindTextRuntimeOperations } from '@agent-device/contracts/selector-observation-runtime'; @@ -6,10 +6,10 @@ import type { CaptureSnapshotInput, SnapshotResult, } from '@agent-device/contracts/snapshot-runtime'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; -import { admitAndBindSnapshotCapture } from './snapshot-runtime-binding.ts'; -import type { DaemonResponse } from './daemon-request.ts'; -import type { SessionState } from './session-state.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../core/request-runtime-binding.ts'; +import { admitAndBindSnapshotCapture } from '../core/snapshot-runtime-binding.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionState } from '../core/session-state.ts'; /** The selector commands that resolve their targets from the shared request-bound capture seam. */ export type SelectorCaptureCommand = 'find' | 'get' | 'is' | 'wait'; diff --git a/packages/daemon/src/selector-capture-runtime.ts b/packages/daemon/src/execution/selector-capture-runtime.ts similarity index 93% rename from packages/daemon/src/selector-capture-runtime.ts rename to packages/daemon/src/execution/selector-capture-runtime.ts index 26b95f3555..6baefa4782 100644 --- a/packages/daemon/src/selector-capture-runtime.ts +++ b/packages/daemon/src/execution/selector-capture-runtime.ts @@ -7,18 +7,18 @@ import { type SnapshotState, } from '@agent-device/kernel/snapshot'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import type { DaemonRequest } from './daemon-request.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; -import { SessionStore } from './session-store.ts'; -import { recordCaptureProof } from './capture-disclosure.ts'; -import type { RequestCaptureProof } from './capture-disclosure.ts'; -import { captureSnapshot } from './snapshot-capture.ts'; +import type { DaemonRequest } from '../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; +import { SessionStore } from '../core/session-store.ts'; +import { recordCaptureProof } from '../core/capture-disclosure.ts'; +import type { RequestCaptureProof } from '../core/capture-disclosure.ts'; +import { captureSnapshot } from '../core/snapshot-capture.ts'; import { setSessionSnapshot } from './session-snapshot.ts'; -import { getActiveAndroidSnapshotFreshness } from './session-snapshot-freshness.ts'; -import { isPostGestureStabilizationPending } from './deferred-interaction-outcome.ts'; -import { isOutdatedObservation } from './ref-frame.ts'; +import { getActiveAndroidSnapshotFreshness } from '../core/session-snapshot-freshness.ts'; +import { isPostGestureStabilizationPending } from '../core/deferred-interaction-outcome.ts'; +import { isOutdatedObservation } from '../core/ref-frame.ts'; import type { BoundSelectorCapture } from './selector-capture-binding.ts'; -import { buildRuntimeCaptureInput } from './snapshot-runtime-capture-input.ts'; +import { buildRuntimeCaptureInput } from '../core/snapshot-runtime-capture-input.ts'; import { isLegacySparseIosInteractiveSnapshot } from '@agent-device/selectors/absence-observation'; const SELECTOR_CAPTURE_CACHE_TTL_MS = 750; diff --git a/packages/daemon/src/selector-match-errors.ts b/packages/daemon/src/execution/selector-match-errors.ts similarity index 95% rename from packages/daemon/src/selector-match-errors.ts rename to packages/daemon/src/execution/selector-match-errors.ts index 1cd32ca536..cbfa9b7c8a 100644 --- a/packages/daemon/src/selector-match-errors.ts +++ b/packages/daemon/src/execution/selector-match-errors.ts @@ -1,7 +1,7 @@ import type { FindLocator } from '@agent-device/selectors'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { elementMatchCandidateDetails } from '@agent-device/capture-kit/snapshot-lines'; -import type { DaemonResponse } from './daemon-request.ts'; +import type { DaemonResponse } from '../core/daemon-request.ts'; import { errorResponse } from '@agent-device/kernel/contracts'; // #1597: an agent reading an ambiguous-match error must be able to act on the diff --git a/packages/daemon/src/selector-runtime-backend.ts b/packages/daemon/src/execution/selector-runtime-backend.ts similarity index 92% rename from packages/daemon/src/selector-runtime-backend.ts rename to packages/daemon/src/execution/selector-runtime-backend.ts index 482d1bedf7..f87e439009 100644 --- a/packages/daemon/src/selector-runtime-backend.ts +++ b/packages/daemon/src/execution/selector-runtime-backend.ts @@ -1,4 +1,4 @@ -import type { DaemonPlatformServices } from './platform-services.ts'; +import type { DaemonPlatformServices } from '../core/platform-services.ts'; import type { AgentDeviceBackend, BackendCommandContext, @@ -9,27 +9,27 @@ import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon- import { publicPlatformString } from '@agent-device/kernel/device'; import type { SnapshotState, SnapshotNode } from '@agent-device/kernel/snapshot'; import { createDaemonRuntimePolicy } from './runtime-policy.ts'; -import { createDaemonRuntimeSessionStore } from './runtime-session.ts'; -import { contextFromFlags, type BoundContextFromFlags } from './context.ts'; +import { createDaemonRuntimeSessionStore } from '../core/runtime-session.ts'; +import { contextFromFlags, type BoundContextFromFlags } from '../core/context.ts'; import { readTextForNode } from './selector-text-runtime.ts'; import { setSessionSnapshot } from './session-snapshot.ts'; -import { markSessionSnapshotOutdated } from './ref-frame.ts'; -import { SessionStore } from './session-store.ts'; -import type { DaemonRequest, DaemonResponse } from './daemon-request.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; +import { markSessionSnapshotOutdated } from '../core/ref-frame.ts'; +import { SessionStore } from '../core/session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; import { createSelectorCaptureRuntime } from './selector-capture-runtime.ts'; -import { buildRuntimeCaptureInput } from './snapshot-runtime-capture-input.ts'; +import { buildRuntimeCaptureInput } from '../core/snapshot-runtime-capture-input.ts'; import { resolveBoundSelectorCapture, type BoundSelectorOperations, type SelectorCaptureCommand, } from './selector-capture-binding.ts'; -import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; +import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../core/request-runtime-binding.ts'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; -import type { PlatformResourceCleanup } from './platform-resource-cleanup.ts'; +import type { PlatformResourceCleanup } from '../core/platform-resource-cleanup.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; import { snapshotOptionsToFlags } from '@agent-device/contracts/backend-snapshot-options'; -import type { RequestCaptureProof } from './capture-disclosure.ts'; +import type { RequestCaptureProof } from '../core/capture-disclosure.ts'; import { checkIsArgs } from '@agent-device/selectors'; import { noActiveSessionError } from '@agent-device/kernel/contracts'; diff --git a/packages/daemon/src/selector-runtime.ts b/packages/daemon/src/execution/selector-runtime.ts similarity index 97% rename from packages/daemon/src/selector-runtime.ts rename to packages/daemon/src/execution/selector-runtime.ts index 8f54705113..b011a40871 100644 --- a/packages/daemon/src/selector-runtime.ts +++ b/packages/daemon/src/execution/selector-runtime.ts @@ -2,9 +2,9 @@ import { asAppError } from '@agent-device/kernel/errors'; import type { SnapshotNode, SnapshotState } from '@agent-device/kernel/snapshot'; import { absenceCaptureOptionError } from '@agent-device/selectors/absence-observation-errors'; import { absenceCaptureOptionRefusal } from '@agent-device/selectors/absence-observation'; -import type { DaemonRequest, DaemonResponse } from './daemon-request.ts'; -import type { SessionRef } from './session-state.ts'; -import type { SessionStore } from './session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../core/daemon-request.ts'; +import type { SessionRef } from '../core/session-state.ts'; +import type { SessionStore } from '../core/session-store.ts'; import { markSessionPartialRefsIssued, publishAmbiguousMatchCandidateRefs, @@ -31,9 +31,9 @@ import { stripSelectorChain, toDaemonFindData, toDaemonGetData, -} from './selector-recording.ts'; +} from '../core/selector-recording.ts'; import type { RecordedTargetCapture } from '@agent-device/selectors/target-evidence'; -import { withCaptureDisclosures } from './capture-disclosure.ts'; +import { withCaptureDisclosures } from '../core/capture-disclosure.ts'; import { createBoundSelectorRuntime, type SelectorRuntimeParams, diff --git a/packages/daemon/src/selector-text-runtime.ts b/packages/daemon/src/execution/selector-text-runtime.ts similarity index 93% rename from packages/daemon/src/selector-text-runtime.ts rename to packages/daemon/src/execution/selector-text-runtime.ts index 2881b3414e..db6ece8456 100644 --- a/packages/daemon/src/selector-text-runtime.ts +++ b/packages/daemon/src/execution/selector-text-runtime.ts @@ -4,7 +4,7 @@ import type { ElementTextUnreadableReason, } from '@agent-device/contracts/element-text-runtime'; import { isIosFamily } from '@agent-device/kernel/device'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import type { DeviceInfo } from '@agent-device/kernel/device'; @@ -13,7 +13,7 @@ import { extractReadableText, prefersValueForReadableText, } from '@agent-device/capture-kit/text-surface'; -import type { BoundContextFromFlags } from './context.ts'; +import type { BoundContextFromFlags } from '../core/context.ts'; import { resolveRectCenter } from '@agent-device/kernel/rect-center'; export type ReadElementTextAtPoint = ElementTextRuntimeOperations['readTextAtPoint']; diff --git a/packages/daemon/src/session-snapshot.ts b/packages/daemon/src/execution/session-snapshot.ts similarity index 98% rename from packages/daemon/src/session-snapshot.ts rename to packages/daemon/src/execution/session-snapshot.ts index a5178babf6..daf24c941d 100644 --- a/packages/daemon/src/session-snapshot.ts +++ b/packages/daemon/src/execution/session-snapshot.ts @@ -2,9 +2,9 @@ import { randomInt } from 'node:crypto'; import type { SettleObservation } from '@agent-device/contracts/interaction'; import { readElementMatchCandidateRefs, AppError } from '@agent-device/kernel/errors'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import { activatePartialRefFrame, refFrameEpoch, refFrameState } from './ref-frame.ts'; -import type { SessionRef, SessionState } from './session-state.ts'; -import type { SessionStore } from './session-store.ts'; +import { activatePartialRefFrame, refFrameEpoch, refFrameState } from '../core/ref-frame.ts'; +import type { SessionRef, SessionState } from '../core/session-state.ts'; +import type { SessionStore } from '../core/session-store.ts'; /** * Warning attached to a read of an `@ref` argument once the ref frame has @@ -22,7 +22,7 @@ export const STALE_SNAPSHOT_REFS_WARNING = * does NOT touch the ref frame: replacing the latest observation is an * operational read, so it never expires, reactivates, or reindexes the * authorized frame (ADR 0014). Frame lifetime is owned solely by - * `packages/daemon/src/ref-frame.ts`; the partial-issuance writer below decides WHETHER to issue + * `packages/daemon/src/core/ref-frame.ts`; the partial-issuance writer below decides WHETHER to issue * and hands the transition there. */ export function setSessionSnapshot(session: SessionState, snapshot: SnapshotState): void { diff --git a/packages/daemon/src/snapshot-timeout-evidence.test.ts b/packages/daemon/src/execution/snapshot-timeout-evidence.test.ts similarity index 100% rename from packages/daemon/src/snapshot-timeout-evidence.test.ts rename to packages/daemon/src/execution/snapshot-timeout-evidence.test.ts diff --git a/packages/daemon/src/snapshot-timeout-evidence.ts b/packages/daemon/src/execution/snapshot-timeout-evidence.ts similarity index 100% rename from packages/daemon/src/snapshot-timeout-evidence.ts rename to packages/daemon/src/execution/snapshot-timeout-evidence.ts diff --git a/packages/daemon/src/sparse-fallback-screenshot.ts b/packages/daemon/src/execution/sparse-fallback-screenshot.ts similarity index 95% rename from packages/daemon/src/sparse-fallback-screenshot.ts rename to packages/daemon/src/execution/sparse-fallback-screenshot.ts index a57f53a6a5..5574857df2 100644 --- a/packages/daemon/src/sparse-fallback-screenshot.ts +++ b/packages/daemon/src/execution/sparse-fallback-screenshot.ts @@ -2,14 +2,14 @@ import type { DeviceRotation } from '@agent-device/contracts/device'; import type { CreateDaemonCommandSurface } from '@agent-device/contracts/daemon-command-surface'; import type { SnapshotQualityVerdict } from '@agent-device/kernel/snapshot'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import { contextFromFlags } from './context.ts'; +import { contextFromFlags } from '../core/context.ts'; import { captureScreenshotArtifact } from './screenshot-runtime.ts'; import { resolveBoundScreenshotRuntime, type ScreenshotRuntimeBindings, } from './screenshot-runtime-binding.ts'; -import type { DaemonRequest } from './daemon-request.ts'; -import type { SessionState } from './session-state.ts'; +import type { DaemonRequest } from '../core/daemon-request.ts'; +import type { SessionState } from '../core/session-state.ts'; export type SparseFallbackScreenshot = { path: string; diff --git a/packages/daemon/src/system-button-runtime.ts b/packages/daemon/src/execution/system-button-runtime.ts similarity index 92% rename from packages/daemon/src/system-button-runtime.ts rename to packages/daemon/src/execution/system-button-runtime.ts index aa01452482..046b401647 100644 --- a/packages/daemon/src/system-button-runtime.ts +++ b/packages/daemon/src/execution/system-button-runtime.ts @@ -11,10 +11,10 @@ import type { } from '@agent-device/contracts/system-button-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { successText } from '@agent-device/kernel/success-text'; -import type { DaemonCommandContext } from './context.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; type SystemButtonUse = RuntimeUse< PlatformRuntimeOperations, diff --git a/packages/daemon/src/tv-remote-runtime.ts b/packages/daemon/src/execution/tv-remote-runtime.ts similarity index 91% rename from packages/daemon/src/tv-remote-runtime.ts rename to packages/daemon/src/execution/tv-remote-runtime.ts index b2263a5d2f..6082fee312 100644 --- a/packages/daemon/src/tv-remote-runtime.ts +++ b/packages/daemon/src/execution/tv-remote-runtime.ts @@ -6,10 +6,10 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '@agent-device/kernel/success-text'; import { requireIntInRange } from '@agent-device/kernel/validation'; -import type { DaemonCommandContext } from './context.ts'; -import type { ResolvedGenericExecution } from './generic-leaf-execution.ts'; -import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from './runtime-admission.ts'; -import { runtimeExecutionFromContext } from './snapshot-runtime-capture-input.ts'; +import type { DaemonCommandContext } from '../core/context.ts'; +import type { ResolvedGenericExecution } from '../core/generic-leaf-execution.ts'; +import { resolveBoundGenericRuntime, type RuntimeAdmissionBindings } from '../core/runtime-admission.ts'; +import { runtimeExecutionFromContext } from '../core/snapshot-runtime-capture-input.ts'; /** `tv-remote