From bd5c5cd904cfba5bc738b700e7415145aa5f07d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 15:13:48 +0200 Subject: [PATCH 1/5] refactor(test-kit): collapse the 18 subpaths into one named-export entry @agent-device/test-kit exports exactly '.', pointing at src/index.ts, with every helper a named export (no export *). All 458 importers move to the entry. The eight tests that pinned the host process start time through a vi.mock factory importing test-kit now spy the host-kit process module in place: a factory that imports the entry deadlocks, because the entry loads host-kit/process while that module is still being mocked. R83 also pins test-kit's shape: one entry, no dependency on or import of platform-*, provider-*, the daemon or the root, and no package it builds on may declare it. Co-Authored-By: Claude Opus 5.5 --- .../src/internal/__tests__/script.test.ts | 2 +- .../application-lifecycle-runtime-harness.ts | 2 +- .../__tests__/support/device-claim-store.ts | 2 +- .../handlers/session-command-harness.ts | 2 +- .../support/handlers/session-test-harness.ts | 3 +- .../handlers/snapshot-handler.fixtures.ts | 3 +- .../support/runtime-binding-conformance.ts | 2 +- .../__tests__/support/session-factories.ts | 6 +- .../internal/network-runtime-harness.ts | 2 +- .../support/session-teardown.fixtures.ts | 2 +- .../src/__tests__/support/store-factory.ts | 2 +- .../support/test-device-runtime-gateway.ts | 2 +- .../unavailable-device-runtime-gateway.ts | 2 +- .../audio-probe-resource-recovery.test.ts | 6 +- .../daemon/src/core/__tests__/config.test.ts | 2 +- .../src/core/__tests__/daemon-policy.test.ts | 3 +- .../__tests__/direct-ios-selector.test.ts | 2 +- .../post-gesture-no-effect-claim.test.ts | 2 +- .../post-gesture-stabilization-fixtures.ts | 2 +- .../core/__tests__/recording-gestures.test.ts | 2 +- .../__tests__/request-ended-leases.test.ts | 2 +- .../request-runtime-binding-router.test.ts | 6 +- .../__tests__/request-runtime-binding.test.ts | 2 +- .../core/__tests__/runtime-session.test.ts | 2 +- ...screen-recording-resource-recovery.test.ts | 6 +- .../core/__tests__/selector-recording.test.ts | 2 +- .../session-runtime-admission.test.ts | 2 +- .../__tests__/session-script-writer.test.ts | 2 +- .../src/core/__tests__/session-store.test.ts | 2 +- .../settle-observation-capture.test.ts | 2 +- .../core/__tests__/snapshot-capture.test.ts | 7 +- .../snapshot-interactor-capture.test.ts | 2 +- .../snapshot-runtime-binding.test.ts | 2 +- .../src/core/device/device-ready.test.ts | 6 +- .../src/core/ios-app-session-hint.test.ts | 2 +- .../src/core/session-idle-tombstone.test.ts | 2 +- .../src/core/session-recovery-hints.test.ts | 2 +- .../daemon/src/core/snapshot-session.test.ts | 2 +- .../interaction-get-runtime-fixture.ts | 2 +- .../__tests__/internal-observation.test.ts | 2 +- .../__tests__/offscreen-target-probe.test.ts | 2 +- .../__tests__/screenshot-crop-target.test.ts | 2 +- .../__tests__/screenshot-crop.test.ts | 3 +- .../__tests__/scroll-movement.test.ts | 2 +- .../__tests__/scroll-runtime.test.ts | 6 +- .../selector-capture-binding.test.ts | 2 +- .../handlers/__tests__/react-native.test.ts | 2 +- .../session-selector-dispatch.test.ts | 3 +- .../handlers/__tests__/snapshot-alert.test.ts | 2 +- .../__tests__/find-touch-runtime-fixture.ts | 2 +- .../gesture-runtime-bindings.fixtures.ts | 2 +- .../interaction-touch-response.test.ts | 2 +- .../interaction-ios-tap-outcome.test.ts | 3 +- .../interaction-touch-prepare.test.ts | 2 +- .../interaction-touch-routing.test.ts | 2 +- .../selector-runtime-is-reads.test.ts | 2 +- .../execution/wait-current-surface.test.ts | 2 +- .../resources/__tests__/app-log-files.test.ts | 3 +- .../app-log-resource-recovery.test.ts | 8 +- .../app-log-session-resource.test.ts | 3 +- .../src/resources/__tests__/app-log.test.ts | 3 +- .../filesystem-boundary-faults.test.ts | 12 +- .../__tests__/device-claim-admission.test.ts | 2 +- .../__tests__/device-claim-prune.test.ts | 7 +- .../__tests__/device-claim-settlement.test.ts | 7 +- .../device/__tests__/device-claims.test.ts | 7 +- .../application-lifecycle-recovery.test.ts | 2 +- .../server/__tests__/artifact-archive.test.ts | 2 +- .../__tests__/daemon-runtime-app-log.test.ts | 3 +- .../server/__tests__/host-lease-http.test.ts | 2 +- .../__tests__/http-server-artifacts.test.ts | 4 +- .../http-server-rpc-admission.test.ts | 9 +- .../http-server-rpc-handler-failure.test.ts | 2 +- .../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 | 4 +- .../__tests__/http-server-rpc.fixtures.ts | 2 +- .../http-server-tenant-trust.test.ts | 6 +- .../__tests__/human-control-http.test.ts | 2 +- .../__tests__/provider-lease-expiry.test.ts | 2 +- .../__tests__/replay-device-selection.test.ts | 2 +- .../request-diagnostics-http.test.ts | 4 +- ...quest-execution-scope-lease-expiry.test.ts | 2 +- ...-execution-scope-lease-session-end.test.ts | 2 +- ...t-execution-scope-open-device-wait.test.ts | 2 +- .../__tests__/request-execution-scope.test.ts | 2 +- .../request-router-apps-admission.test.ts | 2 +- .../request-router-artifacts-web.test.ts | 3 +- .../__tests__/request-router-cost.test.ts | 2 +- ...request-router-custom-action-flags.test.ts | 2 +- .../request-router-developer-dir.test.ts | 2 +- .../request-router-error-redaction.test.ts | 2 +- .../__tests__/request-router-events.test.ts | 3 +- .../request-router-idle-expired.test.ts | 2 +- .../request-router-open-claim.test.ts | 2 +- .../__tests__/request-router-open.test.ts | 2 +- .../request-router-record-flags.test.ts | 2 +- .../request-router-repair-expired.test.ts | 2 +- .../request-router-replay-env.test.ts | 2 +- .../request-router-response-level.test.ts | 2 +- .../request-router-session-address.test.ts | 2 +- .../request-router-typed-error.test.ts | 2 +- .../request-save-script-transports.test.ts | 4 +- .../__tests__/resumable-upload-range.test.ts | 2 +- .../server/__tests__/resumable-upload.test.ts | 2 +- .../__tests__/session-idle-expiry-harness.ts | 3 +- .../src/server/__tests__/upload.test.ts | 2 +- .../device-claim-owner-recovery.test.ts | 2 +- .../http/daemon-lease-finalizer.test.ts | 2 +- .../server/http/daemon-metadata-loss.test.ts | 2 +- .../http/daemon-runtime-artifacts.test.ts | 2 +- .../http/daemon-runtime-composition.test.ts | 3 +- .../http/daemon-runtime-device-claims.test.ts | 2 +- .../http/daemon-runtime-idle-reap.test.ts | 2 +- .../http/daemon-runtime-lease-expiry.test.ts | 2 +- .../daemon-runtime-lifecycle-shutdown.test.ts | 3 +- .../daemon-runtime-metadata-ownership.test.ts | 2 +- .../daemon-runtime-owner-lifecycle.test.ts | 2 +- .../daemon-runtime-recording-reaper.test.ts | 2 +- .../daemon-runtime-recording-teardown.test.ts | 2 +- .../daemon-runtime-rpc-flow-failure.test.ts | 2 +- .../daemon-runtime-snapshot-shutdown.test.ts | 2 +- .../daemon-runtime-web-close-teardown.test.ts | 3 +- ...mon-session-idle-expiry-scheduling.test.ts | 2 +- .../http/daemon-shutdown-claims.test.ts | 2 +- .../server/http/http-authorization.test.ts | 6 +- .../http/http-instance-precondition.test.ts | 2 +- .../http-server-boundary-cancellation.test.ts | 2 +- .../http/http-server-disconnect.test.ts | 2 +- .../http/http-server-lease-allocate.test.ts | 2 +- .../src/server/http/http-server-proxy.test.ts | 2 +- .../http/http-server-resumable-upload.test.ts | 2 +- .../src/server/http/server-lifecycle.test.ts | 2 +- .../daemon/src/server/http/transport.test.ts | 2 +- .../install-source-resolution.test.ts | 2 +- .../materialized-path-registry.test.ts | 2 +- .../open-device-contention-wait.test.ts | 2 +- ...eplay-divergence-android-occlusion.test.ts | 2 +- ...n-replay-divergence-capture-policy.test.ts | 2 +- ...on-replay-divergence-chrome-filter.test.ts | 2 +- ...sion-replay-divergence-observation.test.ts | 2 +- .../session-replay-divergence-overlay.test.ts | 2 +- ...sion-replay-divergence-publication.test.ts | 2 +- ...sion-replay-divergence-suggestions.test.ts | 2 +- ...on-replay-maestro-error-projection.test.ts | 2 +- .../session-replay-maestro-failure.test.ts | 2 +- ...n-replay-maestro-remote-evalscript.test.ts | 2 +- ...ion-replay-maestro-session-address.test.ts | 2 +- ...on-replay-runtime-maestro-dispatch.test.ts | 2 +- ...ay-runtime-maestro-shell-artifacts.test.ts | 2 +- ...session-replay-runtime-maestro.fixtures.ts | 2 +- .../session-replay-repair-acceptance.test.ts | 2 +- .../session-replay-repair-empty-tail.test.ts | 2 +- .../session-replay-repair-loop.test.ts | 2 +- ...ion-replay-repair-record-exclusion.test.ts | 2 +- ...sion-replay-repair-transaction.fixtures.ts | 2 +- .../replay-runtime/application.test.ts | 2 +- ...ion-replay-runtime-artifact-ledger.test.ts | 2 +- .../session-replay-runtime-binding.test.ts | 2 +- ...on-replay-runtime-failure-response.test.ts | 2 +- .../session-replay-runtime-failure.test.ts | 2 +- ...ession-replay-runtime-keep-session.test.ts | 2 +- .../session-replay-runtime-plan.test.ts | 2 +- .../session-replay-runtime.test.ts | 2 +- .../session-replay-script-source.test.ts | 2 +- .../session-test-command-trust.test.ts | 2 +- .../session-test-fail-fast.test.ts | 2 +- .../replay-suite/session-test-runner.test.ts | 2 +- .../session-test-suite-command-video.test.ts | 2 +- .../session-test-suite-infrastructure.test.ts | 2 +- .../session-test-suite.fixtures.ts | 2 +- .../replay-suite/session-test-suite.test.ts | 2 +- ...sion-replay-dispatch-selector-miss.test.ts | 2 +- .../session-replay-scenario.fixtures.ts | 2 +- .../session-replay-selector-routes.test.ts | 2 +- .../__tests__/request-handler-catalog.test.ts | 2 +- .../__tests__/session-idle-activity.test.ts | 2 +- .../__tests__/session-routing.test.ts | 2 +- .../__tests__/session-teardown-budget.test.ts | 2 +- ...shot-custom-actions-platform-guard.test.ts | 2 +- .../sessions/__tests__/snapshot-diff.test.ts | 4 +- .../device-claim-reconciliation.test.ts | 8 +- .../src/sessions/dispatch-payload.test.ts | 2 +- .../handlers/__tests__/install-source.test.ts | 6 +- .../sessions/handlers/__tests__/lease.test.ts | 2 +- .../__tests__/record-runtime-start.test.ts | 2 +- .../record-runtime-stop-recovery.test.ts | 2 +- .../__tests__/record-runtime.fixtures.ts | 2 +- .../session-appstate-device-runtime.test.ts | 2 +- .../__tests__/session-appstate-input.test.ts | 2 +- ...ession-boot-shutdown-device-claims.test.ts | 2 +- .../handlers/__tests__/session-boot.test.ts | 2 +- .../__tests__/session-command-replay.test.ts | 2 +- .../__tests__/session-device-claims.test.ts | 8 +- .../session-device-status-response.test.ts | 2 +- .../session-doctor-app-runtime.test.ts | 6 +- .../__tests__/session-prepare.test.ts | 4 +- .../handlers/__tests__/session-push.test.ts | 2 +- .../__tests__/session-reinstall.test.ts | 2 +- .../__tests__/session-relaunch-guards.test.ts | 2 +- .../__tests__/session-replay-command.test.ts | 2 +- .../__tests__/session-runtime-command.test.ts | 2 +- .../session-script-publication.test.ts | 2 +- .../__tests__/session-shutdown.test.ts | 2 +- .../handlers/__tests__/session.test.ts | 2 +- .../handlers/__tests__/trace-runtime.test.ts | 2 +- .../sessions/server/daemon-idle-reap.test.ts | 2 +- ...on-capabilities-install-projection.test.ts | 2 +- .../session-capabilities.fixtures.ts | 2 +- .../__tests__/session-capabilities.test.ts | 9 +- ...session-close-cwd-scoped-resources.test.ts | 2 +- .../session-close-ended-lease.test.ts | 2 +- .../session-close-lifecycle-runtime.test.ts | 2 +- .../session-close-resource-cleanup.test.ts | 2 +- .../session-close-save-script.test.ts | 2 +- .../__tests__/session-close-script.test.ts | 2 +- .../session-close-shutdown-platform.test.ts | 2 +- .../session-close-shutdown.fixtures.ts | 3 +- ...session-close-without-session-mode.test.ts | 2 +- .../session-devices-batch-runtime.test.ts | 2 +- .../session-inventory-appleos.test.ts | 2 +- .../session-inventory-apps-runtime.test.ts | 2 +- .../session-inventory-harmonyos.test.ts | 2 +- .../session-inventory-scoped-paths.test.ts | 2 +- .../session-open-device-in-use.test.ts | 2 +- .../session-open-execution-runtime.test.ts | 2 +- .../__tests__/session-open-existing.test.ts | 2 +- .../session-open-runtime.fixtures.ts | 2 +- .../__tests__/session-open-runtime.test.ts | 2 +- .../__tests__/session-open-state.test.ts | 2 +- .../__tests__/session-open-surface.test.ts | 2 +- .../session-close-lifecycle-teardown.test.ts | 2 +- .../session-open-execution-relaunch.test.ts | 2 +- .../internal/__tests__/session-audio.test.ts | 11 +- .../internal/__tests__/session-logs.test.ts | 6 +- .../__tests__/session-perf-runtime.test.ts | 2 +- packages/selectors/src/internal/parse.test.ts | 2 +- packages/test-kit/package.json | 76 +---------- packages/test-kit/src/host-process-mock.ts | 52 ++++---- packages/test-kit/src/index.ts | 88 +++++++++++++ .../__tests__/build-package-xcuitest.test.ts | 2 +- .../__tests__/fallow-fixture-policy.test.ts | 2 +- .../__tests__/prepare-publish-assets.test.ts | 2 +- .../runner-isolation-diagnostics.test.ts | 2 +- scripts/__tests__/xctest-selection.test.ts | 2 +- .../lockfile-install-sync.test.ts | 2 +- scripts/fuzz/arbitraries.ts | 2 +- .../benchmark-config.test.ts | 2 +- .../cli-process.test.ts | 2 +- scripts/ios-snapshot-benchmark/run.test.ts | 2 +- .../size-install.test.ts | 2 +- .../state-ownership.test.ts | 2 +- scripts/layering/check.ts | 10 +- .../layering/package-export-surface.test.ts | 120 ++++++++++++++++++ scripts/layering/package-export-surface.ts | 102 ++++++++++++++- scripts/mutation/coverage-reporter.test.ts | 2 +- scripts/mutation/coverage-scope.test.ts | 2 +- scripts/mutation/envelope.test.ts | 2 +- scripts/mutation/sharding.test.ts | 2 +- scripts/mutation/test-scope.test.ts | 2 +- scripts/replays/android-manual.test.ts | 2 +- src/__tests__/agent-device-client.test.ts | 2 +- ...android-snapshot-occlusion-context.test.ts | 2 +- src/__tests__/cli-agent-cdp-session.test.ts | 2 +- src/__tests__/cli-auth-diagnostics.test.ts | 2 +- src/__tests__/cli-capture.ts | 2 +- src/__tests__/cli-client-commands.test.ts | 2 +- src/__tests__/cli-config-fixtures.ts | 2 +- src/__tests__/cli-config-trust.test.ts | 2 +- src/__tests__/cli-debug-symbols.test.ts | 2 +- src/__tests__/cli-device-status.test.ts | 9 +- src/__tests__/cli-diagnostics.test.ts | 2 +- src/__tests__/cli-diff.test.ts | 2 +- src/__tests__/cli-exit-paths.test.ts | 2 +- src/__tests__/cli-network.test.ts | 2 +- .../cli-react-devtools-session.test.ts | 2 +- src/__tests__/cli-remote-diagnostics.test.ts | 4 +- .../cli-replay-script-sources.test.ts | 2 +- src/__tests__/cli-session-state-dir.test.ts | 2 +- src/__tests__/cli-test-env.ts | 2 +- src/__tests__/cli-web.test.ts | 4 +- src/__tests__/client-transport-fixture.ts | 2 +- src/__tests__/cloud-connect-auth.test.ts | 2 +- .../cloud-connect-profile-fields.test.ts | 2 +- src/__tests__/cloud-connect-profile.test.ts | 2 +- src/__tests__/cloud-connect-testmu.test.ts | 3 +- .../contracts/apple-os-resolution.test.ts | 2 +- .../contracts/boundary-fault-matrix.test.ts | 4 +- .../app-event-delivery.test.ts | 3 +- .../capture-disclosure.test.ts | 2 +- .../http-server-limrun-uploaded-apps.test.ts | 4 +- .../interaction/interaction-common.test.ts | 2 +- .../interaction/interaction-settle.test.ts | 2 +- .../interaction-target-evidence.test.ts | 2 +- .../daemon-composition/is-runtime.test.ts | 2 +- ...m-resource-cleanup-snapshot-helper.test.ts | 2 +- .../providers-plugin-routing-parity.test.ts | 2 +- .../request-dispatch-disclosure.test.ts | 2 +- .../request-handler-chain.test.ts | 2 +- .../request-platform-providers.test.ts | 2 +- .../request-router-android-modal.test.ts | 2 +- .../request-router-fill-text-stdin.test.ts | 3 +- .../request-router-lock-policy.test.ts | 2 +- .../request-router-macos-app-lease.test.ts | 3 +- ...request-router-open-claim-recovery.test.ts | 2 +- ...equest-router-provider-credentials.test.ts | 2 +- ...request-router-record-runtime-lock.test.ts | 6 +- .../request-router-recording-health.test.ts | 2 +- .../request-router-replay-scope.test.ts | 3 +- .../request-router-replay-test-ime.test.ts | 3 +- .../request-router-screenshot.test.ts | 3 +- .../screenshot-runtime.test.ts | 3 +- ...elector-runtime-ambiguity-issuance.test.ts | 2 +- .../selector-runtime-backend.test.ts | 2 +- .../selector-runtime.test.ts | 2 +- .../snapshot-quality-latch.test.ts | 2 +- .../snapshot-runtime-disclosure.test.ts | 2 +- .../sparse-fallback-screenshot.test.ts | 2 +- .../daemon-composition/wait-runtime.test.ts | 2 +- .../daemon-registration-owner.test.ts | 3 +- src/__tests__/install-source.test.ts | 2 +- .../kernel/platform-collapse-parity.test.ts | 2 +- .../kernel/snapshot-ref-grammar.test.ts | 2 +- src/__tests__/limrun-runtime.test.ts | 2 +- .../platform-runtime-claim-recovery.test.ts | 9 +- ...platform-runtime-runtime-hints.fixtures.ts | 2 +- .../provider-device-runtimes.test.ts | 6 +- src/__tests__/remote-connection.fixtures.ts | 2 +- src/__tests__/runtime-public.test.ts | 2 +- src/__tests__/selectors-build.test.ts | 2 +- .../test-utils/daemon-http-fixture.ts | 2 +- src/__tests__/test-utils/fake-adb.ts | 2 +- .../registered-daemon-fixture.test.ts | 2 +- src/cli/__tests__/auth-session.test.ts | 6 +- src/cli/__tests__/browser-launch.test.ts | 2 +- src/cli/__tests__/update-check.test.ts | 2 +- src/cli/commands/__tests__/auth.test.ts | 2 +- src/cli/commands/__tests__/connection.test.ts | 2 +- src/cli/commands/__tests__/daemon.test.ts | 2 +- src/cli/commands/__tests__/generic.test.ts | 2 +- src/cli/commands/__tests__/plugins.test.ts | 2 +- src/cli/commands/__tests__/proxy.test.ts | 6 +- .../__tests__/replay-maestro-export.test.ts | 2 +- src/cli/commands/connection-context.test.ts | 2 +- src/cli/connection/provider-policy.test.ts | 2 +- .../replay-test/__tests__/reporting.test.ts | 2 +- ...ssion-test-reporter-values-maestro.test.ts | 2 +- .../session-test-reporter-values.test.ts | 2 +- .../reporters/__tests__/custom.test.ts | 2 +- .../reporters/__tests__/junit.test.ts | 2 +- src/cli/resolve-cli-options.test.ts | 2 +- ...client-companion-tunnel-worker.fixtures.ts | 2 +- .../client-companion-tunnel-worker.test.ts | 3 +- src/commands/batch/cli.test.ts | 2 +- .../capture/runtime/diff-screenshot.test.ts | 2 +- src/commands/management/app.test.ts | 4 +- src/commands/management/output.test.ts | 2 +- src/commands/output/diff.test.ts | 2 +- src/commands/output/snapshot-android.test.ts | 2 +- src/commands/output/snapshot.test.ts | 2 +- .../replay/ad-script-round-trip.test.ts | 2 +- src/commands/replay/index.test.ts | 2 +- src/commands/schema/cli-config.test.ts | 2 +- src/core/__tests__/device.test.ts | 2 +- .../android-alert-occlusion.test.ts | 2 +- src/core/press-retarget.test.ts | 2 +- .../boundary-fault-acceptance.test.ts | 3 +- .../boundary-fault-transport.test.ts | 4 +- ...mon-client-abort-default-transport.test.ts | 6 +- .../daemon-client-abort-timeout.test.ts | 6 +- .../__tests__/daemon-client-abort.test.ts | 6 +- .../daemon-client-developer-dir.test.ts | 4 +- .../daemon-client-health-compat.test.ts | 2 +- .../daemon-client-lease-beat.test.ts | 2 +- .../daemon-client-lease-header.test.ts | 4 +- .../__tests__/daemon-client-lifecycle.test.ts | 12 +- .../daemon-client-liveness-probe.test.ts | 4 +- .../__tests__/daemon-client-metadata.test.ts | 2 +- .../daemon-client-newer-daemon.test.ts | 7 +- .../daemon-client-policy-reuse.test.ts | 7 +- ...daemon-client-provider-credentials.test.ts | 4 +- .../daemon-client-stalled-probe.test.ts | 4 +- .../daemon-client-startup-race.test.ts | 7 +- .../daemon-client-timeout-route.test.ts | 6 +- .../__tests__/daemon-client-transport.test.ts | 12 +- .../__tests__/daemon-client.test.ts | 4 +- src/daemon-composition-credentials.test.ts | 2 +- src/daemon-composition-web-cleanup.test.ts | 3 +- src/daemon-composition.test.ts | 3 +- src/daemon-entrypoint.test.ts | 4 +- .../command-tools-operator-inputs.test.ts | 2 +- .../__tests__/command-tools-parity.test.ts | 2 +- src/metro/client-metro-auto-companion.test.ts | 2 +- src/metro/client-metro-companion.test.ts | 2 +- .../client-metro-startup-cleanup.test.ts | 2 +- src/metro/client-metro.test.ts | 3 +- src/metro/metro-session-hints.test.ts | 2 +- src/platform-runtime-android-adb-host.test.ts | 3 +- src/platform-runtime-app-log-output.test.ts | 2 +- src/platform-runtime-app-log-process.test.ts | 2 +- ...ple-application-tools-close-alerts.test.ts | 2 +- src/platform-runtime-daemon-lifecycle.test.ts | 3 +- src/platform-runtime-device-boot.test.ts | 4 +- src/platform-runtime-device-ready.test.ts | 7 +- src/platform-runtime-gateway.fixtures.ts | 2 +- src/platform-runtime-host-diagnostics.test.ts | 2 +- src/platform-runtime-network-host.test.ts | 2 +- ...platform-runtime-perf-capture-host.test.ts | 2 +- ...runtime-resource-cleanup-retention.test.ts | 6 +- ...-resource-cleanup-sessionless-host.test.ts | 2 +- src/platform-runtime-resource-cleanup.test.ts | 9 +- ...een-recording-apple-simulator-host.test.ts | 2 +- ...ntime-screen-recording-output-host.test.ts | 2 +- src/plugins/load.test.ts | 4 +- src/plugins/manifest.test.ts | 2 +- src/plugins/store.test.ts | 2 +- src/provider-credential-fingerprint.test.ts | 2 +- src/provider-webdriver.test.ts | 2 +- .../__tests__/artifact-download.test.ts | 4 +- .../__tests__/remote-config-public.test.ts | 2 +- .../__tests__/remote-connection-state.test.ts | 2 +- .../remote-request-diagnostics.test.ts | 4 +- .../upload-client-cancellation.test.ts | 2 +- src/remote/__tests__/upload-client.test.ts | 3 +- .../__tests__/screenshot-diff.test.ts | 2 +- src/sdk/limrun-download-file.test.ts | 2 +- src/sdk/selectors.test.ts | 2 +- .../daemon-replace-exit-flush.test.ts | 2 +- .../installed-package-metro.test.ts | 2 +- .../live-device-e2e-runtime.test.ts | 2 +- .../cloud-webdriver-lease-http.test.ts | 2 +- .../daemon-http-server.test.ts | 2 +- .../integration/provider-scenarios/harness.ts | 2 +- .../ios-alert-settings.test.ts | 6 +- .../ios-wait-selector.test.ts | 2 +- ...limrun-deployment-cancellation.fixtures.ts | 2 +- .../provider-device-runtime.fixtures.ts | 2 +- .../remote-daemon-client.test.ts | 2 +- .../remote-proxy-artifact-tenant.test.ts | 2 +- .../remote-proxy-parity.test.ts | 2 +- .../remote-proxy-request-diagnostics.test.ts | 4 +- .../remote-test-artifacts-directory.test.ts | 2 +- ...ote-test-artifacts-materialization.test.ts | 2 +- .../remote-upload-lease-beat.test.ts | 2 +- ...ale-provider-runtime-admission.fixtures.ts | 2 +- .../provider-scenarios/web-provider.test.ts | 10 +- .../provider-scenarios/web-world.ts | 2 +- ...emote-connection-process-isolation.test.ts | 2 +- test/integration/smoke-daemon-clean.test.ts | 2 +- test/integration/smoke-daemon-http.test.ts | 2 +- ...os-runner-status-visible-transport.test.ts | 2 +- test/integration/smoke-macos-coverage.test.ts | 2 +- .../smoke-open-remote-config.test.ts | 2 +- .../smoke-tvos-platform-coverage.test.ts | 2 +- .../smoke-web-platform-coverage.test.ts | 2 +- .../support/daemon-test-cleanup.test.ts | 2 +- .../apple-runner-package-source.test.ts | 2 +- 458 files changed, 943 insertions(+), 715 deletions(-) create mode 100644 packages/test-kit/src/index.ts diff --git a/packages/ad-script/src/internal/__tests__/script.test.ts b/packages/ad-script/src/internal/__tests__/script.test.ts index 9ad8008551..c4d608b53c 100644 --- a/packages/ad-script/src/internal/__tests__/script.test.ts +++ b/packages/ad-script/src/internal/__tests__/script.test.ts @@ -894,7 +894,7 @@ test('formatDivergenceActionLabel categorically drops fill/type text but keeps t // The property test asserting "serializing a parsed script is a fixed point // for generated scripts" stays at `src/commands/replay/ad-script-round-trip.test.ts`: // its script generator (`replayScriptArb`) is derived from the root command -// catalog and selector grammar (`@agent-device/test-kit/property-arbitraries`), +// catalog and selector grammar (`@agent-device/test-kit`), // which this package cannot import without an R11 package→root-src escape // (#1478 P5 scoping dossier §5d). It exercises this package's exports via // the `@agent-device/ad-script` specifier instead of duplicating the codec. diff --git a/packages/daemon/src/__tests__/support/application-lifecycle-runtime-harness.ts b/packages/daemon/src/__tests__/support/application-lifecycle-runtime-harness.ts index dc9f010fc3..6d8153cd9a 100644 --- a/packages/daemon/src/__tests__/support/application-lifecycle-runtime-harness.ts +++ b/packages/daemon/src/__tests__/support/application-lifecycle-runtime-harness.ts @@ -12,7 +12,7 @@ import { providerRuntimeOwner, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { vi } from 'vitest'; import type { diff --git a/packages/daemon/src/__tests__/support/device-claim-store.ts b/packages/daemon/src/__tests__/support/device-claim-store.ts index bc59364841..16bbd6b313 100644 --- a/packages/daemon/src/__tests__/support/device-claim-store.ts +++ b/packages/daemon/src/__tests__/support/device-claim-store.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DeviceClaimReconciler } from '@agent-device/daemon-contracts/device-claims'; export type IsolatedDeviceClaimStore = { diff --git a/packages/daemon/src/__tests__/support/handlers/session-command-harness.ts b/packages/daemon/src/__tests__/support/handlers/session-command-harness.ts index b1b2c1b57a..a74329053b 100644 --- a/packages/daemon/src/__tests__/support/handlers/session-command-harness.ts +++ b/packages/daemon/src/__tests__/support/handlers/session-command-harness.ts @@ -27,7 +27,7 @@ import { type LifecycleOperationsLoader, } from '../application-lifecycle-runtime-fixture.ts'; import { withClientReplayScriptSources } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import { platformResourceCleanupFixture } from '../platform-resource-cleanup-fixture.ts'; const unavailable = Object.freeze({ diff --git a/packages/daemon/src/__tests__/support/handlers/session-test-harness.ts b/packages/daemon/src/__tests__/support/handlers/session-test-harness.ts index a494ce93bd..325beec697 100644 --- a/packages/daemon/src/__tests__/support/handlers/session-test-harness.ts +++ b/packages/daemon/src/__tests__/support/handlers/session-test-harness.ts @@ -2,11 +2,10 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { isMacOs } from '@agent-device/kernel/device'; import { legacyDispatchCapture } from '../legacy-snapshot-capture-fixture.ts'; import { expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { createTestAppLogLiveHandle, mkdtempForTestSync } from '@agent-device/test-kit'; import type { AppLogLiveState } from '@agent-device/contracts/app-log-runtime'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; import type { LogBackend } from '@agent-device/contracts/observability'; vi.mock('node:timers/promises', async (importOriginal) => { diff --git a/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts b/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts index bfda7d8786..39c66efea8 100644 --- a/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts +++ b/packages/daemon/src/__tests__/support/handlers/snapshot-handler.fixtures.ts @@ -1,6 +1,5 @@ import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; +import { buildNodes, mkdtempForTestSync } from '@agent-device/test-kit'; import type { ProviderDeviceRuntime } from '@agent-device/contracts/device'; import type { RawSnapshotNode, SnapshotNode } from '@agent-device/kernel/snapshot'; import { buildSnapshotSignatures } from '@agent-device/capture-kit/snapshot-freshness'; diff --git a/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts b/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts index 6bbdfe1025..c2c89de1c7 100644 --- a/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts +++ b/packages/daemon/src/__tests__/support/runtime-binding-conformance.ts @@ -12,7 +12,7 @@ import { commandDescriptors, commandRuntimeUseRequirements, } from '@agent-device/command-registry/registry'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import { makeSession } from './session-factories.ts'; import { makeSessionStore } from './store-factory.ts'; import { resolveBoundBackRuntime } from '../../execution/back-runtime.ts'; diff --git a/packages/daemon/src/__tests__/support/session-factories.ts b/packages/daemon/src/__tests__/support/session-factories.ts index 546a6d8f29..b5bb316aef 100644 --- a/packages/daemon/src/__tests__/support/session-factories.ts +++ b/packages/daemon/src/__tests__/support/session-factories.ts @@ -3,11 +3,7 @@ import type { SessionScriptPublicationState, SessionScriptRepairStatus, } from '../../core/session-script-publication-state.ts'; -import { - IOS_SIMULATOR, - ANDROID_EMULATOR, - MACOS_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR, MACOS_DEVICE } from '@agent-device/test-kit'; /** A repair-variant `scriptPublication` literal for test setups. */ export function repairPublication( diff --git a/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts b/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts index 06ac4a6cfd..a16d7f30e5 100644 --- a/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts +++ b/packages/daemon/src/__tests__/support/session-observability/internal/network-runtime-harness.ts @@ -8,7 +8,7 @@ import { narrowDeviceBinding, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime } from '../../../../core/request-runtime-binding.ts'; diff --git a/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts b/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts index 77c4b499a2..7724714f01 100644 --- a/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts +++ b/packages/daemon/src/__tests__/support/session-teardown.fixtures.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { screenRecordingResourceStore } from '@agent-device/capture-kit/screen-recording-resource-store'; import type { SessionStore } from '../../core/session-store.ts'; import type { SessionState } from '../../core/session-state.ts'; diff --git a/packages/daemon/src/__tests__/support/store-factory.ts b/packages/daemon/src/__tests__/support/store-factory.ts index 4ad650155d..c6f893d37b 100644 --- a/packages/daemon/src/__tests__/support/store-factory.ts +++ b/packages/daemon/src/__tests__/support/store-factory.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { SessionStore } from '../../core/session-store.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { SessionRef, SessionState } from '../../core/session-state.ts'; export function makeSessionStore(prefix = 'agent-device-test-'): SessionStore { diff --git a/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts b/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts index 6c2036efc7..3076678496 100644 --- a/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts +++ b/packages/daemon/src/__tests__/support/test-device-runtime-gateway.ts @@ -24,7 +24,7 @@ import { applicationLifecycleRuntimeFixture, type LifecycleOperationsLoader, } from './application-lifecycle-runtime-fixture.ts'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import { withClientReplayScriptSources } from '@agent-device/replay-port/replay-script-source-fixtures'; import type { DaemonInvokeFn } from '../../core/daemon-request.ts'; import { clearAndroidObservationFixture } from './android-observation-fixture.ts'; 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 2426053d8f..18d02906b3 100644 --- a/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts +++ b/packages/daemon/src/__tests__/support/unavailable-device-runtime-gateway.ts @@ -5,7 +5,7 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import type { BindDeviceRuntime, BindExactDeviceRuntime, diff --git a/packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts b/packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts index 151dda18ed..fe3ec242e2 100644 --- a/packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts +++ b/packages/daemon/src/core/__tests__/audio-probe-resource-recovery.test.ts @@ -13,8 +13,10 @@ import { createDurableResourceEnvelope, createHostAudioProbeCaptureOperations, } from '@agent-device/capture-kit'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { recoverAudioProbeResourceAfterDaemonLock } from '@agent-device/capture-kit/audio-probe-recovery'; import { audioProbeResourceStore } from '@agent-device/capture-kit/audio-probe-resource-store'; import { encodeHostAudioProbeDescriptor } from '@agent-device/capture-kit/audio-probe-descriptor-fixtures'; diff --git a/packages/daemon/src/core/__tests__/config.test.ts b/packages/daemon/src/core/__tests__/config.test.ts index 1a8536b43c..a79d926eb1 100644 --- a/packages/daemon/src/core/__tests__/config.test.ts +++ b/packages/daemon/src/core/__tests__/config.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('resolveDaemonPaths keeps explicit state directories authoritative', () => { const home = mkdtempForTestSync('agent-device-config-home-'); diff --git a/packages/daemon/src/core/__tests__/daemon-policy.test.ts b/packages/daemon/src/core/__tests__/daemon-policy.test.ts index cf1557a2a5..73ac1803be 100644 --- a/packages/daemon/src/core/__tests__/daemon-policy.test.ts +++ b/packages/daemon/src/core/__tests__/daemon-policy.test.ts @@ -7,11 +7,10 @@ import { fakeCreateCommandSurface } from '../../__tests__/support/command-surfac 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 { ANDROID_EMULATOR, IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; 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'; diff --git a/packages/daemon/src/core/__tests__/direct-ios-selector.test.ts b/packages/daemon/src/core/__tests__/direct-ios-selector.test.ts index 120ca4b83f..3623a0f3a2 100644 --- a/packages/daemon/src/core/__tests__/direct-ios-selector.test.ts +++ b/packages/daemon/src/core/__tests__/direct-ios-selector.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { AppError, createRequestCanceledError } from '@agent-device/kernel/errors'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import type { SessionState } from '../session-state.ts'; import { deriveDirectIosNodeSelector, diff --git a/packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts b/packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts index 03da844c60..875ffd78af 100644 --- a/packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts +++ b/packages/daemon/src/core/__tests__/post-gesture-no-effect-claim.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { countDiagnosticEventsByPhase, withDiagnosticsScope, diff --git a/packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts b/packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts index d9c682e75c..f3c448f3f6 100644 --- a/packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts +++ b/packages/daemon/src/core/__tests__/post-gesture-stabilization-fixtures.ts @@ -1,4 +1,4 @@ -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import type { SessionState } from '../session-state.ts'; diff --git a/packages/daemon/src/core/__tests__/recording-gestures.test.ts b/packages/daemon/src/core/__tests__/recording-gestures.test.ts index a816fccc58..5dce7ae6d8 100644 --- a/packages/daemon/src/core/__tests__/recording-gestures.test.ts +++ b/packages/daemon/src/core/__tests__/recording-gestures.test.ts @@ -8,7 +8,7 @@ import { makeIosSession, makeMacOsSession } from '../../__tests__/support/sessio import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; 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'; +import { TVOS_SIMULATOR } from '@agent-device/test-kit'; function makeSession(recording: Partial = {}) { const session = makeIosSession('default', { diff --git a/packages/daemon/src/core/__tests__/request-ended-leases.test.ts b/packages/daemon/src/core/__tests__/request-ended-leases.test.ts index 15fe160c70..b18b221fef 100644 --- a/packages/daemon/src/core/__tests__/request-ended-leases.test.ts +++ b/packages/daemon/src/core/__tests__/request-ended-leases.test.ts @@ -2,7 +2,7 @@ import { createTestDeviceInventoryGateways } from '@agent-device/device-selectio import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { makeIosSession } from '../../__tests__/support/session-factories.ts'; diff --git a/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts b/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts index f94bcac0ad..15cd4e57fc 100644 --- a/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts +++ b/packages/daemon/src/core/__tests__/request-runtime-binding-router.test.ts @@ -8,9 +8,11 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; +import { + createTestAppLogLiveHandle, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; 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'; diff --git a/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts b/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts index 50ed9b7a76..25c337103e 100644 --- a/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts +++ b/packages/daemon/src/core/__tests__/request-runtime-binding.test.ts @@ -16,7 +16,7 @@ import { import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { screenRecordingRecoveryUse } from '@agent-device/contracts/screen-recording-runtime-plan'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { acquireDurableCaptureRecoveryAuthorityBeforeDeadline } from '@agent-device/capture-kit/durable-capture'; import { diff --git a/packages/daemon/src/core/__tests__/runtime-session.test.ts b/packages/daemon/src/core/__tests__/runtime-session.test.ts index df96d306fe..baae7deb5d 100644 --- a/packages/daemon/src/core/__tests__/runtime-session.test.ts +++ b/packages/daemon/src/core/__tests__/runtime-session.test.ts @@ -8,7 +8,7 @@ import { } from '@agent-device/host-kit/diagnostics'; import { createDaemonRuntimeSessionStore } from '../runtime-session.ts'; import type { CommandSessionRecord } from '@agent-device/contracts/runtime-contract'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('createDaemonRuntimeSessionStore hides non-matching sessions and scopes writes', async () => { const previousHome = process.env.HOME; diff --git a/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts b/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts index 341fe10060..6b64c2c288 100644 --- a/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts +++ b/packages/daemon/src/core/__tests__/screen-recording-resource-recovery.test.ts @@ -7,8 +7,10 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; 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 { + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { recoverScreenRecordingResourceAfterDaemonLock } from '@agent-device/capture-kit/screen-recording-recovery'; import { screenRecordingResourceStore } from '@agent-device/capture-kit/screen-recording-resource-store'; diff --git a/packages/daemon/src/core/__tests__/selector-recording.test.ts b/packages/daemon/src/core/__tests__/selector-recording.test.ts index 5090a1af02..f82fbf976e 100644 --- a/packages/daemon/src/core/__tests__/selector-recording.test.ts +++ b/packages/daemon/src/core/__tests__/selector-recording.test.ts @@ -13,7 +13,7 @@ import { recordIfSession } from '../selector-recording.ts'; import { SessionStore } from '../session-store.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'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function makeStore(): SessionStore { const root = mkdtempForTestSync('agent-device-selector-recording-'); diff --git a/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts b/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts index e31f3e9b84..c697307efd 100644 --- a/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts +++ b/packages/daemon/src/core/__tests__/session-runtime-admission.test.ts @@ -1,6 +1,6 @@ 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 { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { snapshotRuntimeFixture } from '../../__tests__/support/snapshot-runtime-fixture.ts'; import { admitRuntimePlan, diff --git a/packages/daemon/src/core/__tests__/session-script-writer.test.ts b/packages/daemon/src/core/__tests__/session-script-writer.test.ts index 8d1befb235..6e88b8cd3a 100644 --- a/packages/daemon/src/core/__tests__/session-script-writer.test.ts +++ b/packages/daemon/src/core/__tests__/session-script-writer.test.ts @@ -14,7 +14,7 @@ import { 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'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function action(overrides: Partial = {}): SessionAction { return { ts: Date.now(), command: 'click', positionals: [], flags: {}, ...overrides }; diff --git a/packages/daemon/src/core/__tests__/session-store.test.ts b/packages/daemon/src/core/__tests__/session-store.test.ts index 33855f6c95..ce1a590222 100644 --- a/packages/daemon/src/core/__tests__/session-store.test.ts +++ b/packages/daemon/src/core/__tests__/session-store.test.ts @@ -11,7 +11,7 @@ import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import type { TargetAnnotationV1 } from '@agent-device/contracts/replay'; import { makeMacOsSession, repairPublication } from '../../__tests__/support/session-factories.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type RecordActionEntry = Parameters[1]; diff --git a/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts b/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts index 50c7e47084..b30c312b3a 100644 --- a/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts +++ b/packages/daemon/src/core/__tests__/settle-observation-capture.test.ts @@ -1,5 +1,5 @@ import { beforeEach, expect, test, vi } from 'vitest'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; 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'; diff --git a/packages/daemon/src/core/__tests__/snapshot-capture.test.ts b/packages/daemon/src/core/__tests__/snapshot-capture.test.ts index b513a1faac..9ad2046ff5 100644 --- a/packages/daemon/src/core/__tests__/snapshot-capture.test.ts +++ b/packages/daemon/src/core/__tests__/snapshot-capture.test.ts @@ -1,12 +1,7 @@ import { expect, test, vi } from 'vitest'; import { captureSnapshot, captureSnapshotData } from '../snapshot-capture.ts'; import { buildSnapshotVisibility } from '@agent-device/capture-kit/snapshot-visibility'; -import { - ANDROID_EMULATOR, - IOS_SIMULATOR, - MACOS_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; -import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; +import { ANDROID_EMULATOR, buildNodes, IOS_SIMULATOR, MACOS_DEVICE } from '@agent-device/test-kit'; import { legacyDispatchCapture, resetLegacySnapshotCapture, diff --git a/packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts b/packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts index 15a7b2269a..cba45f4599 100644 --- a/packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts +++ b/packages/daemon/src/core/__tests__/snapshot-interactor-capture.test.ts @@ -5,7 +5,7 @@ import type { SnapshotResult, SnapshotRuntimeAcquiredResult, } from '@agent-device/contracts/interactor-types'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { installInteractorResolution } from '../interactor-resolution.ts'; import { captureSnapshotWithInteractor } from '../snapshot-interactor-capture.ts'; diff --git a/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts b/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts index ac1e4abfa4..6973c0c5d0 100644 --- a/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts +++ b/packages/daemon/src/core/__tests__/snapshot-runtime-binding.test.ts @@ -2,7 +2,7 @@ import { daemonPlatformServicesFixture } from '../../__tests__/support/platform- 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 { IOS_SIMULATOR } from '@agent-device/test-kit'; import { makeIosSession } from '../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import type { BindDeviceRuntime } from '../request-runtime-binding.ts'; diff --git a/packages/daemon/src/core/device/device-ready.test.ts b/packages/daemon/src/core/device/device-ready.test.ts index ddfe311932..a15000d3e3 100644 --- a/packages/daemon/src/core/device/device-ready.test.ts +++ b/packages/daemon/src/core/device/device-ready.test.ts @@ -1,10 +1,6 @@ import { afterEach, beforeEach, expect, test, vi } from 'vitest'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { - ANDROID_EMULATOR, - IOS_DEVICE, - IOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_DEVICE, IOS_SIMULATOR } from '@agent-device/test-kit'; import { daemonPlatformServicesFixture } from '../../__tests__/support/platform-services-fixture.ts'; import { DEVICE_READY_CACHE_TTL_MS, ensureDeviceReady } from './device-ready.ts'; diff --git a/packages/daemon/src/core/ios-app-session-hint.test.ts b/packages/daemon/src/core/ios-app-session-hint.test.ts index 1f99c7e91c..a5e915201d 100644 --- a/packages/daemon/src/core/ios-app-session-hint.test.ts +++ b/packages/daemon/src/core/ios-app-session-hint.test.ts @@ -1,6 +1,6 @@ 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 { IOS_DEVICE, IOS_SIMULATOR } from '@agent-device/test-kit'; import { buildIosOpenCommandHint } from './ios-app-session-hint.ts'; // The foreground-app probe is stubbed through the port (ADR 0019 section 11), never by mocking diff --git a/packages/daemon/src/core/session-idle-tombstone.test.ts b/packages/daemon/src/core/session-idle-tombstone.test.ts index ae977af97e..c9ca48c653 100644 --- a/packages/daemon/src/core/session-idle-tombstone.test.ts +++ b/packages/daemon/src/core/session-idle-tombstone.test.ts @@ -5,7 +5,7 @@ import { readIdleSessionTombstoneFile, resolveIdleSessionTombstonePath, } from './session-idle-tombstone.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('a marker whose lifetime cannot be represented stops explaining the absence', () => { const markerPath = resolveIdleSessionTombstonePath( diff --git a/packages/daemon/src/core/session-recovery-hints.test.ts b/packages/daemon/src/core/session-recovery-hints.test.ts index f220564329..d469b0440c 100644 --- a/packages/daemon/src/core/session-recovery-hints.test.ts +++ b/packages/daemon/src/core/session-recovery-hints.test.ts @@ -2,7 +2,7 @@ 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'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; // The recovery hint's whole job is to hand back a command that works. For an implicitly // cwd-scoped session — named `default`, stored as `cwd::default` — building it from the diff --git a/packages/daemon/src/core/snapshot-session.test.ts b/packages/daemon/src/core/snapshot-session.test.ts index 3815bb7d4f..c44c173f52 100644 --- a/packages/daemon/src/core/snapshot-session.test.ts +++ b/packages/daemon/src/core/snapshot-session.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, test } from 'vitest'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { withSessionlessRunnerCleanup } from './snapshot-session.ts'; import { installProviderDeviceAdmission } from './provider-device-admission.ts'; import { platformResourceCleanupFixture } from '../__tests__/support/platform-resource-cleanup-fixture.ts'; diff --git a/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts b/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts index e889bd06fb..443ace358e 100644 --- a/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts +++ b/packages/daemon/src/execution/__tests__/interaction-get-runtime-fixture.ts @@ -38,7 +38,7 @@ import type { 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'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; /** * The request-bound runtime seam `get` consumes, faked at `inspectFacts` / `bindDevice` — never diff --git a/packages/daemon/src/execution/__tests__/internal-observation.test.ts b/packages/daemon/src/execution/__tests__/internal-observation.test.ts index e0f865439f..d1033bc854 100644 --- a/packages/daemon/src/execution/__tests__/internal-observation.test.ts +++ b/packages/daemon/src/execution/__tests__/internal-observation.test.ts @@ -12,7 +12,7 @@ import { } from '../../core/ref-frame.ts'; import { markSessionPartialRefsIssued, setSessionSnapshot } from '../session-snapshot.ts'; import { SessionStore } from '../../core/session-store.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function snapshot(ref: string, label = ref): SnapshotState { return { diff --git a/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts b/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts index 0ddbdb2a1d..b51b9d353b 100644 --- a/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts +++ b/packages/daemon/src/execution/__tests__/offscreen-target-probe.test.ts @@ -1,7 +1,7 @@ import { test, vi } from 'vitest'; import assert from 'node:assert/strict'; import { AppError } from '@agent-device/kernel/errors'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import type { QuerySelectorInput, QuerySelectorResult, diff --git a/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts b/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts index 42954dcb7e..0003a3c103 100644 --- a/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts +++ b/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts @@ -7,7 +7,7 @@ import { MACOS_DEVICE, TVOS_SIMULATOR, WEB_DESKTOP_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { SCREENSHOT_CROP_REASONS } from '@agent-device/contracts/capture'; import { SESSION_SURFACES, diff --git a/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts b/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts index ca060f702b..99e131f9dc 100644 --- a/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts +++ b/packages/daemon/src/execution/__tests__/screenshot-crop.test.ts @@ -1,4 +1,4 @@ -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; 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'; @@ -17,7 +17,6 @@ import { expect, test, vi } from 'vitest'; import type { SessionState } from '../../core/session-state.ts'; import { buildScreenshotCropWarnings, cropScreenshotToSelector } from '../screenshot-crop.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', () => { expect(buildScreenshotCropWarnings(undefined)).toEqual([]); diff --git a/packages/daemon/src/execution/__tests__/scroll-movement.test.ts b/packages/daemon/src/execution/__tests__/scroll-movement.test.ts index 8496b50c9e..2b11a2de39 100644 --- a/packages/daemon/src/execution/__tests__/scroll-movement.test.ts +++ b/packages/daemon/src/execution/__tests__/scroll-movement.test.ts @@ -13,7 +13,7 @@ import type { CommandFlags } from '@agent-device/contracts/command'; 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 { IOS_SIMULATOR, MACOS_DEVICE } from '@agent-device/test-kit'; import { makeSession } from '../../__tests__/support/session-factories.ts'; import { expireRefFrame } from '../../core/ref-frame.ts'; import { diff --git a/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts b/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts index e34a6a3f4c..b967ad239b 100644 --- a/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts +++ b/packages/daemon/src/execution/__tests__/scroll-runtime.test.ts @@ -20,8 +20,10 @@ 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 { + IOS_SIMULATOR, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { makeIosSession, makeMacOsSession } from '../../__tests__/support/session-factories.ts'; import { activateCompleteRefFrame, expireRefFrame } from '../../core/ref-frame.ts'; diff --git a/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts b/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts index 4d2d76e3e2..c91c8d413f 100644 --- a/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts +++ b/packages/daemon/src/execution/__tests__/selector-capture-binding.test.ts @@ -1,6 +1,6 @@ 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 { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; 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'; diff --git a/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts b/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts index 1dd2f1ada6..b3ee6ad5c3 100644 --- a/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/react-native.test.ts @@ -4,7 +4,7 @@ import { handleReactNativeCommands } from '../react-native.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 { mkdtempForTestSync } from '@agent-device/test-kit'; import { getRuntimeBindings, mockTapPoint, diff --git a/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts b/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts index 62c05ce336..91ad4f7339 100644 --- a/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/session-selector-dispatch.test.ts @@ -31,9 +31,8 @@ import { 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 { createUnavailableRuntimeFactsForTest, mkdtempForTestSync } from '@agent-device/test-kit'; 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'; const available = Object.freeze({ available: true } as const); diff --git a/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts b/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts index 0c7e849f49..f30c9788e7 100644 --- a/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts +++ b/packages/daemon/src/execution/handlers/__tests__/snapshot-alert.test.ts @@ -6,7 +6,7 @@ import { handleSnapshotCommands as handleProductionSnapshotCommands } from '../. 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 { mkdtempForTestSync } from '@agent-device/test-kit'; import path from 'node:path'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; diff --git a/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts b/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts index 6bcc4259fa..146559c05c 100644 --- a/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/find-touch-runtime-fixture.ts @@ -1,7 +1,7 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { expect } from 'vitest'; import { legacyDispatchCapture } from '../../../../__tests__/support/legacy-snapshot-capture-fixture.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { getRuntimeBindings, mockFillPoint, diff --git a/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts b/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts index ba8a00ca92..1595c4b787 100644 --- a/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/gesture-runtime-bindings.fixtures.ts @@ -14,7 +14,7 @@ import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, } from '../../../../core/request-runtime-binding.ts'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; const available = Object.freeze({ available: true } as const); diff --git a/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts index 5ba9173951..a36f222fb1 100644 --- a/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts +++ b/packages/daemon/src/execution/interaction/internal/__tests__/interaction-touch-response.test.ts @@ -4,7 +4,7 @@ import { withDiagnosticsScope, flushDiagnosticsToSessionFile, } from '@agent-device/host-kit/diagnostics'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { test, expect, vi, beforeEach } from 'vitest'; import { attachRefs } from '@agent-device/kernel/snapshot'; import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; diff --git a/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.test.ts b/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.test.ts index 361270a012..2947916412 100644 --- a/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.test.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-ios-tap-outcome.test.ts @@ -30,7 +30,7 @@ import { appCaptureComparisonKey, systemSurfaceCaptureComparisonKey, } from '../../../core/__tests__/ios-comparison-key-fixture.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { getRuntimeBindings, mockTapPoint, @@ -42,7 +42,6 @@ import { } from '../../../__tests__/support/interactor-resolution-fixture.ts'; import { corroborateIosTapFailure } from './interaction-ios-tap-outcome.ts'; import { movingTargetBaseline } from '../../../core/deferred-interaction-outcome.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { touchCreateCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts'; const contextFromFlags = (flags: CommandFlags | undefined) => ({ diff --git a/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.test.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.test.ts index 531de7cb23..b364c67565 100644 --- a/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.test.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-prepare.test.ts @@ -15,7 +15,7 @@ import { } from '@agent-device/contracts/touch-runtime'; import { attachRefs, type RawSnapshotNode } from '@agent-device/kernel/snapshot'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import { makeIosAppSession } from '../../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import type { diff --git a/packages/daemon/src/execution/interaction/internal/interaction-touch-routing.test.ts b/packages/daemon/src/execution/interaction/internal/interaction-touch-routing.test.ts index 6690831aee..885e3e960a 100644 --- a/packages/daemon/src/execution/interaction/internal/interaction-touch-routing.test.ts +++ b/packages/daemon/src/execution/interaction/internal/interaction-touch-routing.test.ts @@ -1,6 +1,6 @@ import { test, expect, beforeEach } from 'vitest'; import { attachRefs } from '@agent-device/kernel/snapshot'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import { installInteractorSnapshotResolution, diff --git a/packages/daemon/src/execution/selector-runtime-is-reads.test.ts b/packages/daemon/src/execution/selector-runtime-is-reads.test.ts index 96c90db1d7..25bc5ec1ae 100644 --- a/packages/daemon/src/execution/selector-runtime-is-reads.test.ts +++ b/packages/daemon/src/execution/selector-runtime-is-reads.test.ts @@ -3,7 +3,7 @@ import { legacyDispatchCapture, resetLegacySnapshotCapture, } from '../__tests__/support/legacy-snapshot-capture-fixture.ts'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { makeAndroidSession as makeBaseAndroidSession, makeIosSession, diff --git a/packages/daemon/src/execution/wait-current-surface.test.ts b/packages/daemon/src/execution/wait-current-surface.test.ts index c2669822ca..f4f82c270d 100644 --- a/packages/daemon/src/execution/wait-current-surface.test.ts +++ b/packages/daemon/src/execution/wait-current-surface.test.ts @@ -1,6 +1,6 @@ import { expect, test, vi } from 'vitest'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import type { RequestCaptureProof } from '../core/capture-disclosure.ts'; import { maybeWaitTimeoutSurfaceResponse } from './wait-current-surface.ts'; import type { BoundSelectorCapture } from './selector-capture-binding.ts'; diff --git a/packages/daemon/src/resources/__tests__/app-log-files.test.ts b/packages/daemon/src/resources/__tests__/app-log-files.test.ts index 04903865af..0689e50b67 100644 --- a/packages/daemon/src/resources/__tests__/app-log-files.test.ts +++ b/packages/daemon/src/resources/__tests__/app-log-files.test.ts @@ -2,8 +2,7 @@ import { ensureAppLogPath, rotateAppLogIfNeeded } from '@agent-device/capture-ki import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { assertThrowsAppError } from '@agent-device/test-kit/app-error'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { assertThrowsAppError, mkdtempForTestSync } from '@agent-device/test-kit'; // Pinned as a literal on purpose — see the note in packages/host-kit/src/internal/verified-file.test.ts. const NOT_REGULAR_FILE_HINT = diff --git a/packages/daemon/src/resources/__tests__/app-log-resource-recovery.test.ts b/packages/daemon/src/resources/__tests__/app-log-resource-recovery.test.ts index ab3632bfbd..9092621873 100644 --- a/packages/daemon/src/resources/__tests__/app-log-resource-recovery.test.ts +++ b/packages/daemon/src/resources/__tests__/app-log-resource-recovery.test.ts @@ -12,9 +12,11 @@ import { } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + createTestAppLogLiveHandle, + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; const scope = { signal: new AbortController().signal, diff --git a/packages/daemon/src/resources/__tests__/app-log-session-resource.test.ts b/packages/daemon/src/resources/__tests__/app-log-session-resource.test.ts index 40edca81f0..2db2ebda52 100644 --- a/packages/daemon/src/resources/__tests__/app-log-session-resource.test.ts +++ b/packages/daemon/src/resources/__tests__/app-log-session-resource.test.ts @@ -10,8 +10,7 @@ import { createDurableResourceEnvelope, } from '@agent-device/capture-kit'; import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; +import { createTestAppLogLiveHandle, mkdtempForTestSync } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; diff --git a/packages/daemon/src/resources/__tests__/app-log.test.ts b/packages/daemon/src/resources/__tests__/app-log.test.ts index cc9413ed3d..c96feea65a 100644 --- a/packages/daemon/src/resources/__tests__/app-log.test.ts +++ b/packages/daemon/src/resources/__tests__/app-log.test.ts @@ -1,8 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { assertThrowsAppError } from '@agent-device/test-kit/app-error'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { assertThrowsAppError, mkdtempForTestSync } from '@agent-device/test-kit'; import { appendAppLogMarker, clearAppLogFiles, getAppLogPathMetadata } from '../app-log.ts'; // Pinned as a literal on purpose — see the note in packages/host-kit/src/internal/verified-file.test.ts. diff --git a/packages/daemon/src/resources/__tests__/filesystem-boundary-faults.test.ts b/packages/daemon/src/resources/__tests__/filesystem-boundary-faults.test.ts index b7d3db2175..d6f7d7eecd 100644 --- a/packages/daemon/src/resources/__tests__/filesystem-boundary-faults.test.ts +++ b/packages/daemon/src/resources/__tests__/filesystem-boundary-faults.test.ts @@ -3,6 +3,7 @@ import assert from 'node:assert/strict'; import crypto from 'node:crypto'; import path from 'node:path'; import { afterEach, vi } from 'vitest'; +import * as hostProcess from '@agent-device/host-kit/process'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; @@ -23,14 +24,13 @@ import { makeRepairCompleteSession, } from '../../__tests__/support/session-factories.ts'; import { - registerFilesystemBoundaryMatrix, - type FilesystemBoundaryOwner, type FilesystemBoundaryFixture, -} from '@agent-device/test-kit/filesystem-boundary-faults'; + type FilesystemBoundaryOwner, + registerFilesystemBoundaryMatrix, + pinOwnProcessStartTime, +} from '@agent-device/test-kit'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); type DaemonFilesystemBoundaryOwner = | 'durable-capture-resource-store/screen-recording' diff --git a/packages/daemon/src/resources/device/__tests__/device-claim-admission.test.ts b/packages/daemon/src/resources/device/__tests__/device-claim-admission.test.ts index d832c4a792..d533809a9d 100644 --- a/packages/daemon/src/resources/device/__tests__/device-claim-admission.test.ts +++ b/packages/daemon/src/resources/device/__tests__/device-claim-admission.test.ts @@ -8,7 +8,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { localRuntimeOwner, providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { asAppError } from '@agent-device/kernel/errors'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { isolatedDeviceClaimStores, retainOrphanedDeviceClaims, diff --git a/packages/daemon/src/resources/device/__tests__/device-claim-prune.test.ts b/packages/daemon/src/resources/device/__tests__/device-claim-prune.test.ts index afd2dff3ee..3b7bbe3ed0 100644 --- a/packages/daemon/src/resources/device/__tests__/device-claim-prune.test.ts +++ b/packages/daemon/src/resources/device/__tests__/device-claim-prune.test.ts @@ -6,14 +6,13 @@ import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import { reconcileOrphanedDeviceClaims } from '@agent-device/daemon-contracts/device-claims'; import { acquireProcessLock } from '@agent-device/host-kit/file'; +import * as hostProcess from '@agent-device/host-kit/process'; import { readCurrentOwnerIdentity } from '@agent-device/host-kit/process'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); const previousClaimsDir = process.env.AGENT_DEVICE_CLAIMS_DIR; diff --git a/packages/daemon/src/resources/device/__tests__/device-claim-settlement.test.ts b/packages/daemon/src/resources/device/__tests__/device-claim-settlement.test.ts index 305f3b02f8..72886b8204 100644 --- a/packages/daemon/src/resources/device/__tests__/device-claim-settlement.test.ts +++ b/packages/daemon/src/resources/device/__tests__/device-claim-settlement.test.ts @@ -3,6 +3,7 @@ import crypto from 'node:crypto'; import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; +import * as hostProcess from '@agent-device/host-kit/process'; import { acquireDeviceClaim as acquireProductionDeviceClaim, canonicalLocalDeviceKey, @@ -10,11 +11,9 @@ import { } from '@agent-device/daemon-contracts/device-claims'; import type { DeviceBootObservationService } from '@agent-device/contracts/device-boot'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); const device: DeviceInfo = { platform: 'android', diff --git a/packages/daemon/src/resources/device/__tests__/device-claims.test.ts b/packages/daemon/src/resources/device/__tests__/device-claims.test.ts index 83fa800619..b1c6155d87 100644 --- a/packages/daemon/src/resources/device/__tests__/device-claims.test.ts +++ b/packages/daemon/src/resources/device/__tests__/device-claims.test.ts @@ -13,14 +13,13 @@ import { inspectDeviceClaims, } from '@agent-device/daemon-contracts/device-claims'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; +import * as hostProcess from '@agent-device/host-kit/process'; import { readCurrentOwnerIdentity } from '@agent-device/host-kit/process'; import { acquireProcessLock } from '@agent-device/host-kit/file'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); const device: DeviceInfo = { platform: 'android', diff --git a/packages/daemon/src/server/__tests__/application-lifecycle-recovery.test.ts b/packages/daemon/src/server/__tests__/application-lifecycle-recovery.test.ts index 0f42223b76..35f1d6a014 100644 --- a/packages/daemon/src/server/__tests__/application-lifecycle-recovery.test.ts +++ b/packages/daemon/src/server/__tests__/application-lifecycle-recovery.test.ts @@ -11,7 +11,7 @@ import { import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import type { SessionState } from '../../core/session-state.ts'; import { finalizeDaemonSessionApplicationLifecycle } from '../application-lifecycle-recovery.ts'; diff --git a/packages/daemon/src/server/__tests__/artifact-archive.test.ts b/packages/daemon/src/server/__tests__/artifact-archive.test.ts index 75e8d9ef93..0d3f73d096 100644 --- a/packages/daemon/src/server/__tests__/artifact-archive.test.ts +++ b/packages/daemon/src/server/__tests__/artifact-archive.test.ts @@ -4,7 +4,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { extractTarInstallableArtifact } from '../artifact-archive.ts'; import { runCmdSync } from '@agent-device/host-kit/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const TAR_ENV = { ...process.env, COPYFILE_DISABLE: '1' }; diff --git a/packages/daemon/src/server/__tests__/daemon-runtime-app-log.test.ts b/packages/daemon/src/server/__tests__/daemon-runtime-app-log.test.ts index 3abdd04830..532ae85cde 100644 --- a/packages/daemon/src/server/__tests__/daemon-runtime-app-log.test.ts +++ b/packages/daemon/src/server/__tests__/daemon-runtime-app-log.test.ts @@ -7,9 +7,8 @@ import { expect, test, vi } from 'vitest'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { ResourceDiagnostic } from '@agent-device/host-kit/diagnostics'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; +import { createTestAppLogLiveHandle, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { flushDaemonStartupDiagnostics, teardownDaemonSessionForShutdown, diff --git a/packages/daemon/src/server/__tests__/host-lease-http.test.ts b/packages/daemon/src/server/__tests__/host-lease-http.test.ts index bbb5087da0..ce00adc40c 100644 --- a/packages/daemon/src/server/__tests__/host-lease-http.test.ts +++ b/packages/daemon/src/server/__tests__/host-lease-http.test.ts @@ -4,7 +4,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { HOST_LEASE_HTTP_PREFIX } from '../host-lease-http.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { createDaemonHttpServer } from '../http/http-server.ts'; diff --git a/packages/daemon/src/server/__tests__/http-server-artifacts.test.ts b/packages/daemon/src/server/__tests__/http-server-artifacts.test.ts index ec8fbd2e59..bd6393420a 100644 --- a/packages/daemon/src/server/__tests__/http-server-artifacts.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-artifacts.test.ts @@ -13,10 +13,10 @@ import { runCmdSync, withCommandExecutorOverride } from '@agent-device/host-kit/ import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { ANDROID_ARTIFACTS_CONTRACT_EVIDENCE } from './http-server-artifacts.coverage.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; type ArtifactInventoryResponse = { artifacts: Array<{ diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-admission.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-admission.test.ts index 350a9ee1e1..c78d61d6c1 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-admission.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-admission.test.ts @@ -4,9 +4,12 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { restoreEnv } from '@agent-device/test-kit/env'; +import { + closeLoopbackServer, + mkdtempForTestSync, + restoreEnv, + skipWhenLoopbackUnavailable, +} from '@agent-device/test-kit'; import { postRpcCommand, startRpcServer } from './http-server-rpc.fixtures.ts'; const DAEMON_TOKEN = 'admission-daemon-secret'; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-handler-failure.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-handler-failure.test.ts index 6c2d0c6f54..024118d322 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-handler-failure.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-handler-failure.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { AppError } from '@agent-device/kernel/errors'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { postRpcCommand, startRpcServer } from './http-server-rpc.fixtures.ts'; const TOKEN = 'throwing-handler-token'; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-invalid-body.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-invalid-body.test.ts index 98033484f4..28d0c3617d 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-invalid-body.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-invalid-body.test.ts @@ -1,7 +1,7 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { test } from 'vitest'; import assert from 'node:assert/strict'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { postRpcCommand, postRpcRaw, startRpcServer } from './http-server-rpc.fixtures.ts'; const TOKEN = 'invalid-body-token'; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-lifetime.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-lifetime.test.ts index 109849ae0e..1051e1b567 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-lifetime.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-lifetime.test.ts @@ -2,7 +2,7 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { test } from 'vitest'; import assert from 'node:assert/strict'; import { getRequestSignal } from '@agent-device/host-kit/request'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { postRpcCommand, startRpcServer } from './http-server-rpc.fixtures.ts'; const TOKEN = 'lifetime-token'; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-unowned-failure.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-unowned-failure.test.ts index 098a21ef8e..82490ddc57 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-unowned-failure.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-unowned-failure.test.ts @@ -2,7 +2,7 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { test } from 'vitest'; import assert from 'node:assert/strict'; import type { NormalizedError } from '@agent-device/kernel/errors'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { postRpcCommand, startRpcServer } from './http-server-rpc.fixtures.ts'; const TOKEN = 'unowned-failure-token'; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc-validation.test.ts b/packages/daemon/src/server/__tests__/http-server-rpc-validation.test.ts index 9f630caaf3..0a95d97b20 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc-validation.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc-validation.test.ts @@ -13,9 +13,9 @@ import { resolveInstallSource } from '../../sessions/install-source-resolution.t import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; type RpcErrorResponse = { jsonrpc: string; diff --git a/packages/daemon/src/server/__tests__/http-server-rpc.fixtures.ts b/packages/daemon/src/server/__tests__/http-server-rpc.fixtures.ts index 656ba2a3e6..b97a43e9a3 100644 --- a/packages/daemon/src/server/__tests__/http-server-rpc.fixtures.ts +++ b/packages/daemon/src/server/__tests__/http-server-rpc.fixtures.ts @@ -3,7 +3,7 @@ import type { Server } from 'node:http'; import http from 'node:http'; import { createDaemonHttpServer } from '../http/http-server.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { listenOnLoopback } from '@agent-device/test-kit'; const RPC_ANSWER_DEADLINE_MS = 1_000; diff --git a/packages/daemon/src/server/__tests__/http-server-tenant-trust.test.ts b/packages/daemon/src/server/__tests__/http-server-tenant-trust.test.ts index 4afa11b7f7..966430a645 100644 --- a/packages/daemon/src/server/__tests__/http-server-tenant-trust.test.ts +++ b/packages/daemon/src/server/__tests__/http-server-tenant-trust.test.ts @@ -11,10 +11,10 @@ import type { DaemonRequest } from '../../core/daemon-request.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, + restoreEnv, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { restoreEnv } from '@agent-device/test-kit/env'; +} from '@agent-device/test-kit'; const DAEMON_TOKEN = 'daemon-secret'; const DIAGNOSTICS_RECORD = '{"phase":"request_start"}\n{"phase":"request_failed"}\n'; diff --git a/packages/daemon/src/server/__tests__/human-control-http.test.ts b/packages/daemon/src/server/__tests__/human-control-http.test.ts index 988ab61efe..833de8970f 100644 --- a/packages/daemon/src/server/__tests__/human-control-http.test.ts +++ b/packages/daemon/src/server/__tests__/human-control-http.test.ts @@ -5,7 +5,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { HUMAN_CONTROL_HTTP_PREFIX } from '../../resources/human-control-contract.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { diff --git a/packages/daemon/src/server/__tests__/provider-lease-expiry.test.ts b/packages/daemon/src/server/__tests__/provider-lease-expiry.test.ts index 96ddab3991..5847071016 100644 --- a/packages/daemon/src/server/__tests__/provider-lease-expiry.test.ts +++ b/packages/daemon/src/server/__tests__/provider-lease-expiry.test.ts @@ -3,7 +3,7 @@ import { expect, test, vi } from 'vitest'; import { createExpiredProviderLeaseReleaser } from '../provider-lease-expiry.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import type { DeviceLease } from '@agent-device/contracts/device'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('retries an expired live-only provider lease release after a transient failure', async () => { vi.useFakeTimers(); diff --git a/packages/daemon/src/server/__tests__/replay-device-selection.test.ts b/packages/daemon/src/server/__tests__/replay-device-selection.test.ts index 6cace56ba2..92acff88c5 100644 --- a/packages/daemon/src/server/__tests__/replay-device-selection.test.ts +++ b/packages/daemon/src/server/__tests__/replay-device-selection.test.ts @@ -8,7 +8,7 @@ import { appTargetResolutionOptions, buildReplayScriptPlatformFlags, } from '@agent-device/replay-port/replay-script-selection'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { maestroScriptSourceBundleFor, replayScriptSourceBundleFor, diff --git a/packages/daemon/src/server/__tests__/request-diagnostics-http.test.ts b/packages/daemon/src/server/__tests__/request-diagnostics-http.test.ts index fc1cbe050a..7cd709a32a 100644 --- a/packages/daemon/src/server/__tests__/request-diagnostics-http.test.ts +++ b/packages/daemon/src/server/__tests__/request-diagnostics-http.test.ts @@ -11,9 +11,9 @@ import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; const RECORD = '{"phase":"request_start"}\n{"phase":"request_failed"}\n'; diff --git a/packages/daemon/src/server/__tests__/request-execution-scope-lease-expiry.test.ts b/packages/daemon/src/server/__tests__/request-execution-scope-lease-expiry.test.ts index ceb68fd6c8..47ab96dcdc 100644 --- a/packages/daemon/src/server/__tests__/request-execution-scope-lease-expiry.test.ts +++ b/packages/daemon/src/server/__tests__/request-execution-scope-lease-expiry.test.ts @@ -4,7 +4,7 @@ import { daemonClaimRecoveryGatewayFixture, } from '../../__tests__/support/platform-services-fixture.ts'; import { makeSession } from '../../__tests__/support/session-factories.ts'; -import { LINUX_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { LINUX_DEVICE } from '@agent-device/test-kit'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { createRequestExecutionScope } from '../request-execution-scope.ts'; diff --git a/packages/daemon/src/server/__tests__/request-execution-scope-lease-session-end.test.ts b/packages/daemon/src/server/__tests__/request-execution-scope-lease-session-end.test.ts index 91c95d3688..ded5a2c0f7 100644 --- a/packages/daemon/src/server/__tests__/request-execution-scope-lease-session-end.test.ts +++ b/packages/daemon/src/server/__tests__/request-execution-scope-lease-session-end.test.ts @@ -2,7 +2,7 @@ import { resolveDeviceClaimPath } from '@agent-device/daemon-contracts/device-cl import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { authoringPublication, makeIosSession } from '../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { diff --git a/packages/daemon/src/server/__tests__/request-execution-scope-open-device-wait.test.ts b/packages/daemon/src/server/__tests__/request-execution-scope-open-device-wait.test.ts index 379d7ae03c..fff6f742db 100644 --- a/packages/daemon/src/server/__tests__/request-execution-scope-open-device-wait.test.ts +++ b/packages/daemon/src/server/__tests__/request-execution-scope-open-device-wait.test.ts @@ -10,7 +10,7 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; import { makeSession } from '../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '../../core/daemon-request.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { readOpenWaitAttempt } from '../../sessions/open-device-contention-wait.ts'; diff --git a/packages/daemon/src/server/__tests__/request-execution-scope.test.ts b/packages/daemon/src/server/__tests__/request-execution-scope.test.ts index 4d12e57193..007e13dfb8 100644 --- a/packages/daemon/src/server/__tests__/request-execution-scope.test.ts +++ b/packages/daemon/src/server/__tests__/request-execution-scope.test.ts @@ -21,7 +21,7 @@ import { } from '../request-execution-scope.ts'; import { resolveSessionScope } from '../../sessions/session-routing.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; import { handleSessionCloseCommands } from '../../sessions/session-lifecycle/index.ts'; diff --git a/packages/daemon/src/server/__tests__/request-router-apps-admission.test.ts b/packages/daemon/src/server/__tests__/request-router-apps-admission.test.ts index 73fdc3ffe8..7befa196a6 100644 --- a/packages/daemon/src/server/__tests__/request-router-apps-admission.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-apps-admission.test.ts @@ -8,7 +8,7 @@ import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; function createAppsAdmissionHarness(apps: readonly string[] = []) { diff --git a/packages/daemon/src/server/__tests__/request-router-artifacts-web.test.ts b/packages/daemon/src/server/__tests__/request-router-artifacts-web.test.ts index c57afb13a2..40c634dd0b 100644 --- a/packages/daemon/src/server/__tests__/request-router-artifacts-web.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-artifacts-web.test.ts @@ -8,13 +8,12 @@ import { LeaseRegistry } from '../../resources/lease-registry.ts'; import type { DaemonArtifactInventoryEntry } from '@agent-device/contracts/observability'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { makeSession } from '../../__tests__/support/session-factories.ts'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { cleanupDownloadableArtifact, trackDownloadableArtifact, } from '../../resources/artifact-tracking.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; // #1900: `artifacts` (`handlers/lease.ts`) lists daemon-tracked artifacts by tenant scope with no diff --git a/packages/daemon/src/server/__tests__/request-router-cost.test.ts b/packages/daemon/src/server/__tests__/request-router-cost.test.ts index 1789bc60b4..053768eb5f 100644 --- a/packages/daemon/src/server/__tests__/request-router-cost.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-cost.test.ts @@ -23,7 +23,7 @@ import type { SessionState } from '../../core/session-state.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { commandRpcParamsSchema } from '@agent-device/kernel/contracts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; // A representative, structurally rich owner payload so the parity assertions exercise nested // objects/arrays rather than a trivial flat record. `scroll` is the subject because it reaches a diff --git a/packages/daemon/src/server/__tests__/request-router-custom-action-flags.test.ts b/packages/daemon/src/server/__tests__/request-router-custom-action-flags.test.ts index 57ee641066..ef38356735 100644 --- a/packages/daemon/src/server/__tests__/request-router-custom-action-flags.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-custom-action-flags.test.ts @@ -12,7 +12,7 @@ import path from 'node:path'; import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; function createHandler() { diff --git a/packages/daemon/src/server/__tests__/request-router-developer-dir.test.ts b/packages/daemon/src/server/__tests__/request-router-developer-dir.test.ts index b226988c73..3c8081c1d4 100644 --- a/packages/daemon/src/server/__tests__/request-router-developer-dir.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-developer-dir.test.ts @@ -5,7 +5,7 @@ import { runCmd } from '@agent-device/host-kit/command'; 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 { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; test( diff --git a/packages/daemon/src/server/__tests__/request-router-error-redaction.test.ts b/packages/daemon/src/server/__tests__/request-router-error-redaction.test.ts index 670a9a2a7c..1bae28a6c6 100644 --- a/packages/daemon/src/server/__tests__/request-router-error-redaction.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-error-redaction.test.ts @@ -21,7 +21,7 @@ import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; import { makeIosAppSession } from '../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { diff --git a/packages/daemon/src/server/__tests__/request-router-events.test.ts b/packages/daemon/src/server/__tests__/request-router-events.test.ts index a61146cf03..9f9e261b89 100644 --- a/packages/daemon/src/server/__tests__/request-router-events.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-events.test.ts @@ -7,8 +7,7 @@ import { createRequestHandler } from '../../__tests__/support/test-device-runtim import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { makeIosSession, makeSession } from '../../__tests__/support/session-factories.ts'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; test('events reads the daemon-owned session timeline without appending poll noise', async () => { diff --git a/packages/daemon/src/server/__tests__/request-router-idle-expired.test.ts b/packages/daemon/src/server/__tests__/request-router-idle-expired.test.ts index 245047d0bf..6dabe6ed75 100644 --- a/packages/daemon/src/server/__tests__/request-router-idle-expired.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-idle-expired.test.ts @@ -14,7 +14,7 @@ import { buildIdleExpiryTombstone } from '../session-idle-expiry.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; function makeHandler(prefix: string) { diff --git a/packages/daemon/src/server/__tests__/request-router-open-claim.test.ts b/packages/daemon/src/server/__tests__/request-router-open-claim.test.ts index 7cf30ae176..8833960754 100644 --- a/packages/daemon/src/server/__tests__/request-router-open-claim.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-open-claim.test.ts @@ -59,7 +59,7 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { inspectDeviceClaims } from '@agent-device/daemon-contracts/device-claims'; import { makeIosDevice, openRequest, storedClaimUpdatedAt } from './request-router-open-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); const mockEnsureDeviceReady = vi.mocked(ensureDeviceReady); diff --git a/packages/daemon/src/server/__tests__/request-router-open.test.ts b/packages/daemon/src/server/__tests__/request-router-open.test.ts index b49ab29844..dab08fb9e6 100644 --- a/packages/daemon/src/server/__tests__/request-router-open.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-open.test.ts @@ -77,7 +77,7 @@ import { openRequest, storedClaimUpdatedAt, } from './request-router-open-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); const mockEnsureDeviceReady = vi.mocked(ensureDeviceReady); diff --git a/packages/daemon/src/server/__tests__/request-router-record-flags.test.ts b/packages/daemon/src/server/__tests__/request-router-record-flags.test.ts index 9da1e56d3f..bcb9c0b05e 100644 --- a/packages/daemon/src/server/__tests__/request-router-record-flags.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-record-flags.test.ts @@ -12,7 +12,7 @@ import path from 'node:path'; import { createRequestHandler } from '../../__tests__/support/test-device-runtime-gateway.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; function createHandler() { diff --git a/packages/daemon/src/server/__tests__/request-router-repair-expired.test.ts b/packages/daemon/src/server/__tests__/request-router-repair-expired.test.ts index 9e1810236b..4e7b9fc407 100644 --- a/packages/daemon/src/server/__tests__/request-router-repair-expired.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-repair-expired.test.ts @@ -24,7 +24,7 @@ import { scopeRequestSession } from '../../sessions/request-admission.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { inspectAdReplay } from '@agent-device/ad-replay'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); diff --git a/packages/daemon/src/server/__tests__/request-router-replay-env.test.ts b/packages/daemon/src/server/__tests__/request-router-replay-env.test.ts index d0bde73f7f..a6d6abae34 100644 --- a/packages/daemon/src/server/__tests__/request-router-replay-env.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-replay-env.test.ts @@ -5,7 +5,7 @@ import { expect, test } from 'vitest'; 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 { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; diff --git a/packages/daemon/src/server/__tests__/request-router-response-level.test.ts b/packages/daemon/src/server/__tests__/request-router-response-level.test.ts index 2578607641..9d9a7fc7ad 100644 --- a/packages/daemon/src/server/__tests__/request-router-response-level.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-response-level.test.ts @@ -40,7 +40,7 @@ import type { SessionState } from '../../core/session-state.ts'; import { LeaseRegistry } from '../../resources/lease-registry.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { commandRpcParamsSchema } from '@agent-device/kernel/contracts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const REPRESENTATIVE_PAYLOAD = { message: 'scroll-ok', items: [1, 2, 3] } as const; /** What the bound `app-switcher` leaf answers; this file's registered view digests it. */ diff --git a/packages/daemon/src/server/__tests__/request-router-session-address.test.ts b/packages/daemon/src/server/__tests__/request-router-session-address.test.ts index 29ff73da97..edcd427f6e 100644 --- a/packages/daemon/src/server/__tests__/request-router-session-address.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-session-address.test.ts @@ -33,7 +33,7 @@ import { awaitFixtureReadiness } from '../../__tests__/support/application-lifec import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; /** * The production route for the #2031/#1394 defect: a request without `--session` resolves the diff --git a/packages/daemon/src/server/__tests__/request-router-typed-error.test.ts b/packages/daemon/src/server/__tests__/request-router-typed-error.test.ts index 19ee0d0089..daed8613cc 100644 --- a/packages/daemon/src/server/__tests__/request-router-typed-error.test.ts +++ b/packages/daemon/src/server/__tests__/request-router-typed-error.test.ts @@ -36,7 +36,7 @@ import { PRE_DISPATCH_REFUSAL_REASONS, retriableForErrorCode, } from '@agent-device/kernel/errors'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockLifecycleEffect = vi.mocked(dispatchApplicationLifecycleEffect); diff --git a/packages/daemon/src/server/__tests__/request-save-script-transports.test.ts b/packages/daemon/src/server/__tests__/request-save-script-transports.test.ts index 78376c36e0..bb6e50625d 100644 --- a/packages/daemon/src/server/__tests__/request-save-script-transports.test.ts +++ b/packages/daemon/src/server/__tests__/request-save-script-transports.test.ts @@ -34,9 +34,9 @@ import { makeIosSession } from '../../__tests__/support/session-factories.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { flushSessionEventLogWrites } from '@agent-device/session-journal/session-event-log'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; diff --git a/packages/daemon/src/server/__tests__/resumable-upload-range.test.ts b/packages/daemon/src/server/__tests__/resumable-upload-range.test.ts index 79ce7e6b13..b4f3e27af8 100644 --- a/packages/daemon/src/server/__tests__/resumable-upload-range.test.ts +++ b/packages/daemon/src/server/__tests__/resumable-upload-range.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { assertThrowsAppError } from '@agent-device/test-kit/app-error'; +import { assertThrowsAppError } from '@agent-device/test-kit'; import { parseUploadContentLength, parseUploadContentRange } from '../resumable-upload-range.ts'; test('content ranges are bounded by the declared upload size', () => { diff --git a/packages/daemon/src/server/__tests__/resumable-upload.test.ts b/packages/daemon/src/server/__tests__/resumable-upload.test.ts index 19af0627d3..36c6e177c0 100644 --- a/packages/daemon/src/server/__tests__/resumable-upload.test.ts +++ b/packages/daemon/src/server/__tests__/resumable-upload.test.ts @@ -11,7 +11,7 @@ import { finalizeResumableUpload, receiveResumableUploadChunk, } from '../resumable-upload.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { runCmdSync } from '@agent-device/host-kit/command'; test('finalizing an unknown upload reports expiry with a recovery hint', async () => { diff --git a/packages/daemon/src/server/__tests__/session-idle-expiry-harness.ts b/packages/daemon/src/server/__tests__/session-idle-expiry-harness.ts index 94058f7e42..af080d4eb8 100644 --- a/packages/daemon/src/server/__tests__/session-idle-expiry-harness.ts +++ b/packages/daemon/src/server/__tests__/session-idle-expiry-harness.ts @@ -15,8 +15,7 @@ import { acquireDeviceClaim, type DeviceClaimSessionOwnership, } from '@agent-device/daemon-contracts/device-claims'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; /** The inactivity window every harness session is already past, except where a test says otherwise. */ export const WINDOW_MS = 1_000; diff --git a/packages/daemon/src/server/__tests__/upload.test.ts b/packages/daemon/src/server/__tests__/upload.test.ts index 1dc6263f62..b2d00ba23c 100644 --- a/packages/daemon/src/server/__tests__/upload.test.ts +++ b/packages/daemon/src/server/__tests__/upload.test.ts @@ -7,7 +7,7 @@ import type { IncomingMessage } from 'node:http'; import { receiveUpload } from '../upload.ts'; import { streamReadableToFile, validateArtifactContentLength } from '../artifact-download.ts'; import { runCmdSync } from '@agent-device/host-kit/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function makeUploadRequest(body: Buffer, headers: Record): IncomingMessage { return Object.assign(Readable.from(body), { headers }) as IncomingMessage; diff --git a/packages/daemon/src/server/device/__tests__/device-claim-owner-recovery.test.ts b/packages/daemon/src/server/device/__tests__/device-claim-owner-recovery.test.ts index 15dfe80663..5e6a22eabf 100644 --- a/packages/daemon/src/server/device/__tests__/device-claim-owner-recovery.test.ts +++ b/packages/daemon/src/server/device/__tests__/device-claim-owner-recovery.test.ts @@ -6,7 +6,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { AppLogSessionArtifacts } from '@agent-device/contracts/app-log-runtime'; import type { OwnedProcessRecordWriter } from '@agent-device/contracts/platform-runtime-host'; import type { DeviceClaim } from '@agent-device/daemon-contracts/device-claims'; diff --git a/packages/daemon/src/server/http/daemon-lease-finalizer.test.ts b/packages/daemon/src/server/http/daemon-lease-finalizer.test.ts index f5105d402e..5be1e1985a 100644 --- a/packages/daemon/src/server/http/daemon-lease-finalizer.test.ts +++ b/packages/daemon/src/server/http/daemon-lease-finalizer.test.ts @@ -5,7 +5,7 @@ import { LeaseRegistry } from '../../resources/lease-registry.ts'; import type { DeviceLease } from '@agent-device/contracts/device'; import { createExpiredProviderLeaseReleaser } from '../provider-lease-expiry.ts'; import { finalizeDaemonLeases } from './daemon-lease-finalizer.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('journals and bounds a hung recoverable lease release before the final drain', async () => { vi.useFakeTimers(); diff --git a/packages/daemon/src/server/http/daemon-metadata-loss.test.ts b/packages/daemon/src/server/http/daemon-metadata-loss.test.ts index 0eaf0c712a..e5d4c6368a 100644 --- a/packages/daemon/src/server/http/daemon-metadata-loss.test.ts +++ b/packages/daemon/src/server/http/daemon-metadata-loss.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { describe, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; import { readDaemonMetadataLoss, diff --git a/packages/daemon/src/server/http/daemon-runtime-artifacts.test.ts b/packages/daemon/src/server/http/daemon-runtime-artifacts.test.ts index 0af002bf4a..65f94c0d57 100644 --- a/packages/daemon/src/server/http/daemon-runtime-artifacts.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-artifacts.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { daemonRuntimeDepsFixture } from '../../__tests__/support/daemon-runtime-deps-fixture.ts'; import { cleanupDownloadableArtifact, diff --git a/packages/daemon/src/server/http/daemon-runtime-composition.test.ts b/packages/daemon/src/server/http/daemon-runtime-composition.test.ts index 0e4e12892a..c6aa03f5c4 100644 --- a/packages/daemon/src/server/http/daemon-runtime-composition.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-composition.test.ts @@ -8,8 +8,7 @@ import { tryAcquireDaemonRegistration, } from '@agent-device/daemon-contracts/daemon-registration-owner'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { IOS_SIMULATOR, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { IOS_SIMULATOR, mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { installInteractorResolution, interactorResolution, diff --git a/packages/daemon/src/server/http/daemon-runtime-device-claims.test.ts b/packages/daemon/src/server/http/daemon-runtime-device-claims.test.ts index 5c2c724bf2..8e860c4ed2 100644 --- a/packages/daemon/src/server/http/daemon-runtime-device-claims.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-device-claims.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; vi.mock('../../sessions/session-teardown.ts', async (importOriginal) => { diff --git a/packages/daemon/src/server/http/daemon-runtime-idle-reap.test.ts b/packages/daemon/src/server/http/daemon-runtime-idle-reap.test.ts index d0ca20cb30..eff7cd1d1e 100644 --- a/packages/daemon/src/server/http/daemon-runtime-idle-reap.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-idle-reap.test.ts @@ -19,7 +19,7 @@ vi.mock('../../resources/lease-registry.ts', async (importOriginal) => { import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { daemonRuntimeDepsFixture } from '../../__tests__/support/daemon-runtime-deps-fixture.ts'; import { startDaemonRuntime } from './daemon-runtime.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; afterEach(() => { vi.useRealTimers(); diff --git a/packages/daemon/src/server/http/daemon-runtime-lease-expiry.test.ts b/packages/daemon/src/server/http/daemon-runtime-lease-expiry.test.ts index d441b60302..21b1f9eab8 100644 --- a/packages/daemon/src/server/http/daemon-runtime-lease-expiry.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-lease-expiry.test.ts @@ -38,7 +38,7 @@ vi.mock('../request-execution-scope.ts', async (importOriginal) => { import { SessionStore } from '../../core/session-store.ts'; import { daemonRuntimeDepsFixture } from '../../__tests__/support/daemon-runtime-deps-fixture.ts'; import { startDaemonRuntime } from './daemon-runtime.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; afterEach(() => { vi.useRealTimers(); diff --git a/packages/daemon/src/server/http/daemon-runtime-lifecycle-shutdown.test.ts b/packages/daemon/src/server/http/daemon-runtime-lifecycle-shutdown.test.ts index a281a832c6..81c91e244e 100644 --- a/packages/daemon/src/server/http/daemon-runtime-lifecycle-shutdown.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-lifecycle-shutdown.test.ts @@ -2,7 +2,7 @@ import { resolveDeviceClaimPath } from '@agent-device/daemon-contracts/device-cl import fs from 'node:fs'; import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { ANDROID_EMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; const lifecycleEvents = vi.hoisted(() => [] as string[]); @@ -87,7 +87,6 @@ vi.mock('../provider-lease-expiry.ts', async (importOriginal) => { }); import { acquireDeviceClaim } from '@agent-device/daemon-contracts/device-claims'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; import { isolatedDeviceClaimStores, retainOrphanedDeviceClaims, diff --git a/packages/daemon/src/server/http/daemon-runtime-metadata-ownership.test.ts b/packages/daemon/src/server/http/daemon-runtime-metadata-ownership.test.ts index 1ee505f405..b2314bf28d 100644 --- a/packages/daemon/src/server/http/daemon-runtime-metadata-ownership.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-metadata-ownership.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; const lifecycleEvents = vi.hoisted(() => [] as string[]); diff --git a/packages/daemon/src/server/http/daemon-runtime-owner-lifecycle.test.ts b/packages/daemon/src/server/http/daemon-runtime-owner-lifecycle.test.ts index 56c0dbeb19..8888613a11 100644 --- a/packages/daemon/src/server/http/daemon-runtime-owner-lifecycle.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-owner-lifecycle.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { daemonRuntimeDepsFixture, platformOwnerLifecycleFixture, diff --git a/packages/daemon/src/server/http/daemon-runtime-recording-reaper.test.ts b/packages/daemon/src/server/http/daemon-runtime-recording-reaper.test.ts index 6b06f0036c..ab279d09cc 100644 --- a/packages/daemon/src/server/http/daemon-runtime-recording-reaper.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-recording-reaper.test.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import { afterEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const reapCalls = vi.hoisted(() => [] as Array>); diff --git a/packages/daemon/src/server/http/daemon-runtime-recording-teardown.test.ts b/packages/daemon/src/server/http/daemon-runtime-recording-teardown.test.ts index e2b86d9025..f8b95f5e83 100644 --- a/packages/daemon/src/server/http/daemon-runtime-recording-teardown.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-recording-teardown.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; import type { ScreenRecordingCompletion } from '@agent-device/contracts/screen-recording-runtime'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; import { SessionStore } from '../../core/session-store.ts'; import { makeRecordingSession } from '../../__tests__/support/session-teardown.fixtures.ts'; diff --git a/packages/daemon/src/server/http/daemon-runtime-rpc-flow-failure.test.ts b/packages/daemon/src/server/http/daemon-runtime-rpc-flow-failure.test.ts index 0a821cfd65..e168788efe 100644 --- a/packages/daemon/src/server/http/daemon-runtime-rpc-flow-failure.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-rpc-flow-failure.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import { afterEach, expect, test, vi } from 'vitest'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; // The HTTP server hands a `/rpc` flow rejection it answered itself to `onUnownedRequestFailure`, // because that event has no request scope to be recorded in — the request's own scope opens later, diff --git a/packages/daemon/src/server/http/daemon-runtime-snapshot-shutdown.test.ts b/packages/daemon/src/server/http/daemon-runtime-snapshot-shutdown.test.ts index dc78578bc5..46a1379c5b 100644 --- a/packages/daemon/src/server/http/daemon-runtime-snapshot-shutdown.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-snapshot-shutdown.test.ts @@ -4,7 +4,7 @@ import { markRequestCanceled, registerRequestAbort, } from '@agent-device/host-kit/request'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import { legacyDispatchCapture } from '../../__tests__/support/legacy-snapshot-capture-fixture.ts'; diff --git a/packages/daemon/src/server/http/daemon-runtime-web-close-teardown.test.ts b/packages/daemon/src/server/http/daemon-runtime-web-close-teardown.test.ts index 81fb21800b..46e2b2d332 100644 --- a/packages/daemon/src/server/http/daemon-runtime-web-close-teardown.test.ts +++ b/packages/daemon/src/server/http/daemon-runtime-web-close-teardown.test.ts @@ -1,7 +1,6 @@ import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { platformResourceCleanupFixture } from '../../__tests__/support/platform-resource-cleanup-fixture.ts'; import { makeWebSession } from '../../__tests__/support/session-teardown.fixtures.ts'; import { SessionStore } from '../../core/session-store.ts'; diff --git a/packages/daemon/src/server/http/daemon-session-idle-expiry-scheduling.test.ts b/packages/daemon/src/server/http/daemon-session-idle-expiry-scheduling.test.ts index def78af4fe..b32bf91c2b 100644 --- a/packages/daemon/src/server/http/daemon-session-idle-expiry-scheduling.test.ts +++ b/packages/daemon/src/server/http/daemon-session-idle-expiry-scheduling.test.ts @@ -9,7 +9,7 @@ import { WINDOW_MS, } from '../__tests__/session-idle-expiry-harness.ts'; import { makeIosSession } from '../../__tests__/support/session-factories.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; /** * #2833: WHEN the reaper starts an expiry and how long it may take. The window that arms it, the diff --git a/packages/daemon/src/server/http/daemon-shutdown-claims.test.ts b/packages/daemon/src/server/http/daemon-shutdown-claims.test.ts index 57bf1e2a9d..de1600f3d7 100644 --- a/packages/daemon/src/server/http/daemon-shutdown-claims.test.ts +++ b/packages/daemon/src/server/http/daemon-shutdown-claims.test.ts @@ -1,6 +1,6 @@ import { resolveDeviceClaimPath } from '@agent-device/daemon-contracts/device-claims-fixtures'; import { afterEach, expect, test, vi } from 'vitest'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { isolatedDeviceClaimStores, retainOrphanedDeviceClaims, diff --git a/packages/daemon/src/server/http/http-authorization.test.ts b/packages/daemon/src/server/http/http-authorization.test.ts index 734112cfcf..6fab53b1c3 100644 --- a/packages/daemon/src/server/http/http-authorization.test.ts +++ b/packages/daemon/src/server/http/http-authorization.test.ts @@ -7,10 +7,10 @@ import { createDaemonHttpServer } from './http-server.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, + restoreEnv, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { restoreEnv } from '@agent-device/test-kit/env'; +} from '@agent-device/test-kit'; const DAEMON_TOKEN = 'daemon-secret'; diff --git a/packages/daemon/src/server/http/http-instance-precondition.test.ts b/packages/daemon/src/server/http/http-instance-precondition.test.ts index 48db98fa1b..958742ff44 100644 --- a/packages/daemon/src/server/http/http-instance-precondition.test.ts +++ b/packages/daemon/src/server/http/http-instance-precondition.test.ts @@ -10,7 +10,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; type RpcErrorResponse = { error?: { code?: number; data?: { code?: string } } }; diff --git a/packages/daemon/src/server/http/http-server-boundary-cancellation.test.ts b/packages/daemon/src/server/http/http-server-boundary-cancellation.test.ts index cb635b9149..1d4c26b7c4 100644 --- a/packages/daemon/src/server/http/http-server-boundary-cancellation.test.ts +++ b/packages/daemon/src/server/http/http-server-boundary-cancellation.test.ts @@ -9,7 +9,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const CANCELLATION_ROWS = { mutation: { command: 'press', positionals: ['enter'] }, diff --git a/packages/daemon/src/server/http/http-server-disconnect.test.ts b/packages/daemon/src/server/http/http-server-disconnect.test.ts index fab916dd07..862a79d735 100644 --- a/packages/daemon/src/server/http/http-server-disconnect.test.ts +++ b/packages/daemon/src/server/http/http-server-disconnect.test.ts @@ -9,7 +9,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; // A non-streaming request that loses its client before response headers must be // marked canceled through its request-scoped AbortSignal. The old behavior only diff --git a/packages/daemon/src/server/http/http-server-lease-allocate.test.ts b/packages/daemon/src/server/http/http-server-lease-allocate.test.ts index 769a458e7f..85a9e35fae 100644 --- a/packages/daemon/src/server/http/http-server-lease-allocate.test.ts +++ b/packages/daemon/src/server/http/http-server-lease-allocate.test.ts @@ -7,7 +7,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; // The compact lease envelope is the only projection that has to name the provider-allocation flags // by key; the daemon's lease request must carry every one the lease-lifecycle provider reads, and diff --git a/packages/daemon/src/server/http/http-server-proxy.test.ts b/packages/daemon/src/server/http/http-server-proxy.test.ts index 86332eb96c..b670de57a9 100644 --- a/packages/daemon/src/server/http/http-server-proxy.test.ts +++ b/packages/daemon/src/server/http/http-server-proxy.test.ts @@ -19,7 +19,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const PROXY_ARTIFACT_INVENTORY_ENTRY = { id: 'shot-1', diff --git a/packages/daemon/src/server/http/http-server-resumable-upload.test.ts b/packages/daemon/src/server/http/http-server-resumable-upload.test.ts index ffd3e4b47a..3190c6e991 100644 --- a/packages/daemon/src/server/http/http-server-resumable-upload.test.ts +++ b/packages/daemon/src/server/http/http-server-resumable-upload.test.ts @@ -13,7 +13,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; test('chunked ranged overflow rolls back before an exact retry and finalize', async (t) => { if (await skipWhenLoopbackUnavailable(t, 'daemon HTTP resumable upload coverage')) return; diff --git a/packages/daemon/src/server/http/server-lifecycle.test.ts b/packages/daemon/src/server/http/server-lifecycle.test.ts index 5c505ff137..a05d738640 100644 --- a/packages/daemon/src/server/http/server-lifecycle.test.ts +++ b/packages/daemon/src/server/http/server-lifecycle.test.ts @@ -5,7 +5,7 @@ import { test } from 'vitest'; import { parseIntegerEnv } from './server-lifecycle.ts'; import { tryAcquireDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-owner'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('Provider-backed integration daemon lifecycle writes metadata and protects acquisitions', async () => { const root = mkdtempForTestSync('agent-device-daemon-lifecycle-'); diff --git a/packages/daemon/src/server/http/transport.test.ts b/packages/daemon/src/server/http/transport.test.ts index 7c12e8d9d6..15ffba5348 100644 --- a/packages/daemon/src/server/http/transport.test.ts +++ b/packages/daemon/src/server/http/transport.test.ts @@ -6,7 +6,7 @@ import net from 'node:net'; import { test } from 'vitest'; import { createSocketServer, listenHttpServer, listenNetServer } from './transport.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; -import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; test('Provider-backed integration daemon socket transport frames requests and normalizes malformed input', async (t) => { if (await skipWhenLoopbackUnavailable(t)) { diff --git a/packages/daemon/src/sessions/__tests__/install-source-resolution.test.ts b/packages/daemon/src/sessions/__tests__/install-source-resolution.test.ts index dbb0c5c199..08d4641af7 100644 --- a/packages/daemon/src/sessions/__tests__/install-source-resolution.test.ts +++ b/packages/daemon/src/sessions/__tests__/install-source-resolution.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { resolveInstallSource } from '../install-source-resolution.ts'; import { trackUploadedArtifact } from '../../resources/artifact-tracking.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function makeRequest(meta?: DaemonRequest['meta']): DaemonRequest { return { diff --git a/packages/daemon/src/sessions/__tests__/materialized-path-registry.test.ts b/packages/daemon/src/sessions/__tests__/materialized-path-registry.test.ts index 61f72b5e26..ff5bdbb6c9 100644 --- a/packages/daemon/src/sessions/__tests__/materialized-path-registry.test.ts +++ b/packages/daemon/src/sessions/__tests__/materialized-path-registry.test.ts @@ -8,7 +8,7 @@ import { cleanupRetainedMaterializedPathsForSession, retainMaterializedPaths, } from '../materialized-path-registry.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('retainMaterializedPaths copies file and directory artifacts into managed storage', async () => { const tempRoot = mkdtempForTestSync('agent-device-retained-paths-'); diff --git a/packages/daemon/src/sessions/__tests__/open-device-contention-wait.test.ts b/packages/daemon/src/sessions/__tests__/open-device-contention-wait.test.ts index e875c2fcab..ef065afa89 100644 --- a/packages/daemon/src/sessions/__tests__/open-device-contention-wait.test.ts +++ b/packages/daemon/src/sessions/__tests__/open-device-contention-wait.test.ts @@ -2,7 +2,7 @@ import { test, expect, vi, afterEach } from 'vitest'; import { isRequestCanceledError } from '@agent-device/kernel/errors'; import type { CommandFlags } from '@agent-device/contracts/command'; import { clearRequestCanceled, markRequestCanceled } from '@agent-device/host-kit/request'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { getFlagDefinitionsForKey } from '@agent-device/command-registry/flag-registry'; import { makeSessionStore } from '../../__tests__/support/store-factory.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-android-occlusion.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-android-occlusion.test.ts index d215aa0d3b..1437d0ebc4 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-android-occlusion.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-android-occlusion.test.ts @@ -6,7 +6,7 @@ import { ANDROID_QS_SHADE_CAPTURE_RAW_NODES, walkNonRawAndroidFixture, } from '@agent-device/platform-android/ui-hierarchy-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { replayCoordinatorForTest, replaySessionForTest } from './replay-session-fixture.ts'; import { diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-capture-policy.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-capture-policy.test.ts index 42eb15777c..e62394d153 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-capture-policy.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-capture-policy.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeAndroidSession } from '../../../__tests__/support/session-factories.ts'; import { SessionStore } from '../../../core/session-store.ts'; import { buildReplayFailureDivergence } from '@agent-device/replay-port/session-replay-divergence'; diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-chrome-filter.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-chrome-filter.test.ts index 03a3c35198..d917a5f6b1 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-chrome-filter.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-chrome-filter.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeAndroidSession, makeIosSession, diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-observation.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-observation.test.ts index ada527aac3..ef0cdeee7f 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-observation.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-observation.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import { sleep } from '@agent-device/host-kit/retry'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-overlay.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-overlay.test.ts index b74bfcf68a..9d24591e07 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-overlay.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-overlay.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeAndroidSession } from '../../../__tests__/support/session-factories.ts'; import { ANDROID_IME_CAPTURE_RAW_NODES, diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-publication.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-publication.test.ts index 43ec3111b2..03ce256165 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-publication.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-publication.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('../../../core/snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), diff --git a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-suggestions.test.ts b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-suggestions.test.ts index 8f0379c6a6..86cd71791d 100644 --- a/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-suggestions.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-divergence/session-replay-divergence-suggestions.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { SessionStore } from '../../../core/session-store.ts'; import { buildReplayFailureDivergence } from '@agent-device/replay-port/session-replay-divergence'; diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts index e761698892..98fbef51d1 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-error-projection.test.ts @@ -7,7 +7,7 @@ import { SessionStore } from '../../../core/session-store.ts'; import { replayCommandForTest } from '../replay-runtime/replay-command-fixture.ts'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { maestroScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; // A replay error raised before any step runs carries no `failure`, so the route diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-failure.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-failure.test.ts index 1888123fcb..efec07e900 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-failure.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-failure.test.ts @@ -1,5 +1,5 @@ import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts index e0aa484eb1..57f5a0b502 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-remote-evalscript.test.ts @@ -8,7 +8,7 @@ import { platformResourceCleanupFixture } from '../../../__tests__/support/platf import { SessionStore } from '../../../core/session-store.ts'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { maestroScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; import { unavailableBindDevice, diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts index c863bbf792..7add259cb3 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-maestro-session-address.test.ts @@ -7,7 +7,7 @@ import { SessionStore } from '../../../core/session-store.ts'; import { replayCommandForTest } from '../replay-runtime/replay-command-fixture.ts'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { maestroScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; // The Maestro replay route resolves the store key upstream and then validates the session's diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts index a823635996..8611419958 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-dispatch.test.ts @@ -4,7 +4,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; import { SessionStore } from '../../../core/session-store.ts'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts index 587bc5e2a3..645acf364d 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro-shell-artifacts.test.ts @@ -3,7 +3,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; diff --git a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro.fixtures.ts b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro.fixtures.ts index ef7485a331..356601429d 100644 --- a/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro.fixtures.ts +++ b/packages/daemon/src/sessions/__tests__/replay-maestro/session-replay-runtime-maestro.fixtures.ts @@ -45,7 +45,7 @@ import fs from 'node:fs'; import path from 'node:path'; import type { CommandFlags } from '@agent-device/contracts/command'; import type { DaemonInvokeFn, DaemonRequest } from '../../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { runReplayForTest } from '../replay-runtime/replay-command-fixture.ts'; import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay'; diff --git a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-acceptance.test.ts b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-acceptance.test.ts index e544dc4b39..d2a5dc21f2 100644 --- a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-acceptance.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-acceptance.test.ts @@ -8,7 +8,7 @@ import { storeSessionForTest } from '../../../__tests__/support/store-factory.ts */ import { test, expect, vi, beforeEach } from 'vitest'; import { markRepairTransactionComplete } from '../../../core/session-replay-transaction.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts index abba0b5bbc..c02bb62ddb 100644 --- a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts @@ -24,7 +24,7 @@ import { storeSessionForTest } from '../../../__tests__/support/store-factory.ts * `caution`/`manual` divergence is no longer a dead end. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-loop.test.ts b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-loop.test.ts index d12c25768b..19f976a4d5 100644 --- a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-loop.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-loop.test.ts @@ -12,7 +12,7 @@ import { isSessionRecording } from '../../../core/session-script-publication-cap * `session.actions` accumulates for real instead of staying empty. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts index 62f583a4d0..9787199b53 100644 --- a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts @@ -20,7 +20,7 @@ import { storeSessionForTest } from '../../../__tests__/support/store-factory.ts * completely unchanged. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/platform-apple/runner/operations', () => ({ resolveRunnerAppBundleId: vi.fn(), diff --git a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts index fb2e223d27..88e1ea6c2e 100644 --- a/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts +++ b/packages/daemon/src/sessions/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts @@ -1,5 +1,5 @@ import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { LeaseRegistry } from '../../../resources/lease-registry.ts'; import { diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/application.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/application.test.ts index 388ddc2c83..1b265e3a66 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/application.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/application.test.ts @@ -9,7 +9,7 @@ import { registerRequestAbort, withRequestProgressSink, } from '@agent-device/host-kit/request'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; import { withClientReplayScriptSources } from '@agent-device/replay-port/replay-script-source-fixtures'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-artifact-ledger.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-artifact-ledger.test.ts index 92ba1be300..77997e1ac5 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-artifact-ledger.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-artifact-ledger.test.ts @@ -9,7 +9,7 @@ import { baseReplayRequest as baseReq, writeReplayFile, } from './session-replay-runtime.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; /** * #1478 P5 follow-up (one daemon-owned artifact ledger): artifact-path diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-binding.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-binding.test.ts index a2ea3e9f66..0540b12bf0 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-binding.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-binding.test.ts @@ -8,7 +8,7 @@ import { SessionStore } from '../../../core/session-store.ts'; import { runReplayForTest } from './replay-command-fixture.ts'; import { captureSnapshotWithInteractor } from '../../../core/snapshot-interactor-capture.ts'; import { baseReplayRequest as baseReq } from './session-replay-runtime.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure-response.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure-response.test.ts index 0357a81657..fd4b5a155a 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure-response.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure-response.test.ts @@ -1,5 +1,5 @@ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure.test.ts index 59465b6119..e382de1088 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-failure.test.ts @@ -1,6 +1,6 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts index 9899ed882b..ff5a1a2d5d 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-keep-session.test.ts @@ -1,5 +1,5 @@ import { test, expect, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; /** * #1555 structural-quality review ("topology fix... its subject now lives diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-plan.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-plan.test.ts index f61b7070e1..69c4625ecb 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-plan.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime-plan.test.ts @@ -1,5 +1,5 @@ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime.test.ts index 8cf81aa459..069d023075 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-runtime.test.ts @@ -1,6 +1,6 @@ import { isSessionRecording } from '../../../core/session-script-publication-capability.ts'; import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-script-source.test.ts b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-script-source.test.ts index 7ff2bb759f..863cdd029c 100644 --- a/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-script-source.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-runtime/session-replay-script-source.test.ts @@ -6,7 +6,7 @@ * path is refused with a message that says so. */ import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-command-trust.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-command-trust.test.ts index 2920dca95d..71728ea609 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-command-trust.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-command-trust.test.ts @@ -13,7 +13,7 @@ import { import { runReplayTestCommand } from '@agent-device/replay-port/test-command'; import type { ReplayCommand, ReplayTestCommand } from '@agent-device/replay-port/command-types'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonInvokeFn, DaemonRequest } from '../../../core/daemon-request.ts'; const capturedCommands: ReplayCommand[] = []; diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-fail-fast.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-fail-fast.test.ts index 37ecc7da9f..363cffc890 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-fail-fast.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-fail-fast.test.ts @@ -6,7 +6,7 @@ import { expect, test } from 'vitest'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; test('test --fail-fast continues after passing scripts', async () => { diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-runner.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-runner.test.ts index 577718ad30..4354b06119 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-runner.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-runner.test.ts @@ -13,7 +13,7 @@ import { import type { DaemonRequest } from '../../../core/daemon-request.ts'; import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; // Opening a Simulator schedules a best-effort runner prewarm that outlives the request; a real one diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-command-video.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-command-video.test.ts index 293fd84e04..ad3a4e5910 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-command-video.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-command-video.test.ts @@ -13,7 +13,7 @@ import { replayInvokeOverDispatch, splitReplayCommandRequest, } from '@agent-device/replay-port/replay-dispatch-envelope'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; import { unavailableBindDevice, diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-infrastructure.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-infrastructure.test.ts index 49ab1ce64e..35833817c9 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-infrastructure.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite-infrastructure.test.ts @@ -7,7 +7,7 @@ import path from 'node:path'; import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; import { expectOkData, makeSessionStore } from './session-test-suite.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; vi.mock('../../../core/snapshot-interactor-capture.ts', () => ({ diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.fixtures.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.fixtures.ts index 0c94eb1137..6172b7a916 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.fixtures.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.fixtures.ts @@ -1,7 +1,7 @@ import type { DaemonResponse, DaemonResponseData } from '@agent-device/kernel/contracts'; import { expect } from 'vitest'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; export function makeSessionStore(): SessionStore { diff --git a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.test.ts b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.test.ts index d72ced78d1..94844e9693 100644 --- a/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-suite/session-test-suite.test.ts @@ -38,7 +38,7 @@ import { makeAndroidSession, makeMacOsSession, } from '../../../__tests__/support/session-factories.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { storeSessionForTest } from '../../../__tests__/support/store-factory.ts'; const ANDROID_ONE: DeviceInfo = { diff --git a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-dispatch-selector-miss.test.ts b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-dispatch-selector-miss.test.ts index 0f411ebb07..9843768577 100644 --- a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-dispatch-selector-miss.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-dispatch-selector-miss.test.ts @@ -20,7 +20,7 @@ * zero-match selector) instead of returning it. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = diff --git a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-scenario.fixtures.ts b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-scenario.fixtures.ts index c057c2baa4..f8a3626575 100644 --- a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-scenario.fixtures.ts +++ b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-scenario.fixtures.ts @@ -1,6 +1,6 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeIosAppSession } from '../../../__tests__/support/session-factories.ts'; import { SessionStore } from '../../../core/session-store.ts'; import type { DaemonInvokeFn, DaemonRequest } from '../../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-selector-routes.test.ts b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-selector-routes.test.ts index 36fb244721..5e38bd2dca 100644 --- a/packages/daemon/src/sessions/__tests__/replay-target/session-replay-selector-routes.test.ts +++ b/packages/daemon/src/sessions/__tests__/replay-target/session-replay-selector-routes.test.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { runReplayForTest } from '../replay-runtime/replay-command-fixture.ts'; import { diff --git a/packages/daemon/src/sessions/__tests__/request-handler-catalog.test.ts b/packages/daemon/src/sessions/__tests__/request-handler-catalog.test.ts index f680d970cc..f58e1804a3 100644 --- a/packages/daemon/src/sessions/__tests__/request-handler-catalog.test.ts +++ b/packages/daemon/src/sessions/__tests__/request-handler-catalog.test.ts @@ -32,7 +32,7 @@ import { unavailableInspectFacts, } from '../../__tests__/support/unavailable-device-runtime-gateway.ts'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createAudioProbeAdmissionLedger } from '@agent-device/capture-kit/audio-probe-admission-ledger'; import { createPerfCaptureAdmissionLedger } from '@agent-device/capture-kit/perf-capture-admission-ledger'; import { createScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/screen-recording-admission-ledger'; diff --git a/packages/daemon/src/sessions/__tests__/session-idle-activity.test.ts b/packages/daemon/src/sessions/__tests__/session-idle-activity.test.ts index baeb0900f2..7b57609208 100644 --- a/packages/daemon/src/sessions/__tests__/session-idle-activity.test.ts +++ b/packages/daemon/src/sessions/__tests__/session-idle-activity.test.ts @@ -30,7 +30,7 @@ import { } from '../../server/request-execution-scope.ts'; import { withKeyedLock } from '@agent-device/kernel/keyed-lock'; import type { DaemonRequest } from '../../core/daemon-request.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const TEST_ROOT = mkdtempForTestSync('agent-device-session-idle-activity-'); const LOG_PATH = path.join(TEST_ROOT, 'diagnostics.log'); diff --git a/packages/daemon/src/sessions/__tests__/session-routing.test.ts b/packages/daemon/src/sessions/__tests__/session-routing.test.ts index e0caddd4fd..ea894f5e53 100644 --- a/packages/daemon/src/sessions/__tests__/session-routing.test.ts +++ b/packages/daemon/src/sessions/__tests__/session-routing.test.ts @@ -9,7 +9,7 @@ import { resolveEffectiveSessionName, resolveSessionScope } from '../session-rou import type { DaemonRequest } from '../../core/daemon-request.ts'; import type { SessionState } from '../../core/session-state.ts'; import type { SessionScope } from '@agent-device/contracts/session'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function makeSession(name: string): SessionState { return { diff --git a/packages/daemon/src/sessions/__tests__/session-teardown-budget.test.ts b/packages/daemon/src/sessions/__tests__/session-teardown-budget.test.ts index dc3ab65f00..071f543d98 100644 --- a/packages/daemon/src/sessions/__tests__/session-teardown-budget.test.ts +++ b/packages/daemon/src/sessions/__tests__/session-teardown-budget.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import { expect, test } from 'vitest'; import { AGENT_BROWSER_TIMEOUT_MS } from '@agent-device/platform-web'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeAndroidSession } from '../../__tests__/support/session-factories.ts'; import { SessionStore } from '../../core/session-store.ts'; import { diff --git a/packages/daemon/src/sessions/__tests__/snapshot-custom-actions-platform-guard.test.ts b/packages/daemon/src/sessions/__tests__/snapshot-custom-actions-platform-guard.test.ts index 20a76445fe..926757915d 100644 --- a/packages/daemon/src/sessions/__tests__/snapshot-custom-actions-platform-guard.test.ts +++ b/packages/daemon/src/sessions/__tests__/snapshot-custom-actions-platform-guard.test.ts @@ -21,7 +21,7 @@ import { captureSnapshotUse, } from '@agent-device/contracts/platform-runtime-operations'; import { snapshotRuntimeFixture } from '../../__tests__/support/snapshot-runtime-fixture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../__tests__/support/command-surface-fake.ts'; function snapshotDeviceRuntimeGateway(): DeviceRuntimeGateway { diff --git a/packages/daemon/src/sessions/__tests__/snapshot-diff.test.ts b/packages/daemon/src/sessions/__tests__/snapshot-diff.test.ts index 6436c7393a..d04b9f49fd 100644 --- a/packages/daemon/src/sessions/__tests__/snapshot-diff.test.ts +++ b/packages/daemon/src/sessions/__tests__/snapshot-diff.test.ts @@ -5,11 +5,11 @@ import { buildSnapshotDiff, countSnapshotComparableLines, } from '@agent-device/capture-kit/snapshot-diff'; -import { buildNodes as nodes } from '@agent-device/test-kit/snapshot-builders'; import { + buildNodes as nodes, PROPERTY_RUNS_SMALL, rawSnapshotNodesArb, -} from '@agent-device/test-kit/property-arbitraries'; +} from '@agent-device/test-kit'; test('buildSnapshotDiff reports unchanged lines when snapshots are equal', () => { const previous = nodes([ diff --git a/packages/daemon/src/sessions/device/__tests__/device-claim-reconciliation.test.ts b/packages/daemon/src/sessions/device/__tests__/device-claim-reconciliation.test.ts index 01b34c9492..4d51b8a280 100644 --- a/packages/daemon/src/sessions/device/__tests__/device-claim-reconciliation.test.ts +++ b/packages/daemon/src/sessions/device/__tests__/device-claim-reconciliation.test.ts @@ -10,9 +10,11 @@ import { localRuntimeOwner, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + createTestAppLogLiveHandle, + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import type { DeviceClaim } from '@agent-device/daemon-contracts/device-claims'; const scope = { diff --git a/packages/daemon/src/sessions/dispatch-payload.test.ts b/packages/daemon/src/sessions/dispatch-payload.test.ts index b07f421fd0..b9600f5cfc 100644 --- a/packages/daemon/src/sessions/dispatch-payload.test.ts +++ b/packages/daemon/src/sessions/dispatch-payload.test.ts @@ -2,7 +2,7 @@ import { promises as fs } from 'node:fs'; import path from 'node:path'; import { afterEach, beforeEach, describe, expect, test } from 'vitest'; import { readNotificationPayload } from './dispatch-payload.ts'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; let tmpDir: string; diff --git a/packages/daemon/src/sessions/handlers/__tests__/install-source.test.ts b/packages/daemon/src/sessions/handlers/__tests__/install-source.test.ts index 569f319843..55018dc3de 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/install-source.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/install-source.test.ts @@ -26,8 +26,10 @@ import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot- import { touchRuntimeOperationFacts } from '@agent-device/contracts/touch-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { unavailableApplicationLifecycleOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { + mkdtempForTestSync, + unavailableApplicationLifecycleOperationFacts, +} from '@agent-device/test-kit'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/packages/daemon/src/sessions/handlers/__tests__/lease.test.ts b/packages/daemon/src/sessions/handlers/__tests__/lease.test.ts index 5b1a31f3ae..57efb854a6 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/lease.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/lease.test.ts @@ -7,7 +7,7 @@ import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import type { DeviceLease } from '@agent-device/contracts/device'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { withTestDeviceInventory } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { IOS_SIMULATOR, TVOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR, TVOS_SIMULATOR } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import { clearRequestCanceled, diff --git a/packages/daemon/src/sessions/handlers/__tests__/record-runtime-start.test.ts b/packages/daemon/src/sessions/handlers/__tests__/record-runtime-start.test.ts index 8f60636b6b..4119854f24 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/record-runtime-start.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/record-runtime-start.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeRecordRuntimeHarness } from './record-runtime.fixtures.ts'; test('record start adopts the runtime pair and projects unchanged response metadata', async () => { diff --git a/packages/daemon/src/sessions/handlers/__tests__/record-runtime-stop-recovery.test.ts b/packages/daemon/src/sessions/handlers/__tests__/record-runtime-stop-recovery.test.ts index bc09634186..4414dc4618 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/record-runtime-stop-recovery.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/record-runtime-stop-recovery.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { screenRecordingResourceStore } from '@agent-device/capture-kit/screen-recording-resource-store'; import { expectDecodedCompletedRecording, diff --git a/packages/daemon/src/sessions/handlers/__tests__/record-runtime.fixtures.ts b/packages/daemon/src/sessions/handlers/__tests__/record-runtime.fixtures.ts index 6767857e81..18397e0dbd 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/record-runtime.fixtures.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/record-runtime.fixtures.ts @@ -12,7 +12,7 @@ import { import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import { createScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/screen-recording-admission-ledger'; diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-appstate-device-runtime.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-appstate-device-runtime.test.ts index c8af517973..a6b70410e2 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-appstate-device-runtime.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-appstate-device-runtime.test.ts @@ -4,7 +4,7 @@ import { test, expect, vi } from 'vitest'; import { handleAppStateCommand } from '../session-appstate.ts'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import { withTestDeviceInventory } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { type DeviceBinding, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-appstate-input.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-appstate-input.test.ts index 0f74de140b..41578df148 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-appstate-input.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-appstate-input.test.ts @@ -15,7 +15,7 @@ import { handleSessionCommands, mockInspectDeviceRuntimeFacts, } from '../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import type { AppStateRuntimeInput, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-boot-shutdown-device-claims.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-boot-shutdown-device-claims.test.ts index ef42a7d362..aaba503c53 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-boot-shutdown-device-claims.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-boot-shutdown-device-claims.test.ts @@ -13,7 +13,7 @@ import { readinessDeviceRuntimeGateway, } from '../../../__tests__/support/handlers/session-command-harness.ts'; import { normalizeError } from '@agent-device/kernel/errors'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { isolatedDeviceClaimStores, retainOrphanedDeviceClaims, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-boot.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-boot.test.ts index df65c1e7e7..0b593bd6d6 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-boot.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-boot.test.ts @@ -21,7 +21,7 @@ import { mockEnsureReadyRuntime, mockInspectDeviceRuntimeFacts, } from '../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; test('boot requires session or explicit selector', async () => { diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-command-replay.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-command-replay.test.ts index 9fa6f88b4e..c151ad89ff 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-command-replay.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-command-replay.test.ts @@ -7,7 +7,7 @@ import { handleSessionCommands } from '../../../__tests__/support/handlers/sessi import type { DaemonRequest } from '../../../core/daemon-request.ts'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; test('replay parses open --relaunch flag and replays open with relaunch semantics', async () => { diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-device-claims.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-device-claims.test.ts index 12d131bef3..1c7604a3a0 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-device-claims.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-device-claims.test.ts @@ -3,7 +3,8 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import * as hostProcess from '@agent-device/host-kit/process'; +import { MACOS_DEVICE, mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { @@ -30,9 +31,7 @@ vi.mock('@agent-device/platform-android/mechanics', () => ({ async (_device, _target, currentAppBundleId) => currentAppBundleId, ), })); -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; import { ensureDeviceReady } from '../../../core/device/device-ready.ts'; @@ -58,7 +57,6 @@ import { } from '../../session-lifecycle/index.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { makeAuthoringSession } from '../../../__tests__/support/session-factories.ts'; -import { MACOS_DEVICE } from '@agent-device/test-kit/device-fixtures'; import { AppError } from '@agent-device/kernel/errors'; import { bindProviderLifecycleRuntime, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-device-status-response.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-device-status-response.test.ts index 1c82622713..a6d4292175 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-device-status-response.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-device-status-response.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest'; import type { TargetShutdownResult } from '@agent-device/contracts/device'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { deviceStatusReportResponse } from '../session-device-status-response.ts'; const shutdownResult: TargetShutdownResult = { diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-doctor-app-runtime.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-doctor-app-runtime.test.ts index 1143c114f9..9f545d4173 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-doctor-app-runtime.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-doctor-app-runtime.test.ts @@ -1,6 +1,9 @@ import { expect, test, vi } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { LINUX_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { + LINUX_DEVICE, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; import type { BindDeviceRuntime, @@ -13,7 +16,6 @@ import { narrowDeviceBinding, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; import { handleDoctorCommand } from '../session-doctor.ts'; import { hostDiagnosticsFixture } from '../../../__tests__/support/host-diagnostics-fixture.ts'; diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-prepare.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-prepare.test.ts index 133ba0724f..dd4bcd3396 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-prepare.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-prepare.test.ts @@ -13,11 +13,11 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; import { ANDROID_EMULATOR, + createUnavailableRuntimeFactsForTest, IOS_SIMULATOR, MACOS_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-push.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-push.test.ts index bee662b540..8d13e0ad26 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-push.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-push.test.ts @@ -10,7 +10,7 @@ import type { import type { DaemonRequest } from '../../../core/daemon-request.ts'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { handleSessionCommands, mockBindDeviceRuntime, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-reinstall.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-reinstall.test.ts index 830fd82d80..0344a5c662 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-reinstall.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-reinstall.test.ts @@ -3,7 +3,7 @@ import { daemonPlatformServicesFixture } from '../../../__tests__/support/platfo import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { trackUploadedArtifact } from '../../../resources/artifact-tracking.ts'; import type { BindDeviceRuntime, diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-relaunch-guards.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-relaunch-guards.test.ts index 75aa6df9d0..2759cb1aa6 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-relaunch-guards.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-relaunch-guards.test.ts @@ -11,7 +11,7 @@ import { } from '../../../__tests__/support/handlers/session-test-harness.ts'; import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; import { makeTestScreenRecordingResource } from '../../../__tests__/support/screen-recording-live-handle.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; import type { DaemonPlatformServices } from '../../../core/platform-services.ts'; diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-replay-command.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-replay-command.test.ts index 8aba235f06..1bbd4dd417 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-replay-command.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-replay-command.test.ts @@ -12,7 +12,7 @@ import type { SessionCommandParams } from '../session-command-input.ts'; import { handleReplayTestCommand } from '../session-replay-command.ts'; import { daemonPlatformServicesFixture } from '../../../__tests__/support/platform-services-fixture.ts'; import { makeSessionStore } from '../../../__tests__/support/handlers/session-test-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; import { withClientReplayScriptSources } from '@agent-device/replay-port/replay-script-source-fixtures'; import { makeIosSession } from '../../../__tests__/support/session-factories.ts'; diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-runtime-command.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-runtime-command.test.ts index 2d52895bad..80238053b4 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-runtime-command.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-runtime-command.test.ts @@ -21,7 +21,7 @@ import { gestureRuntimeSpies, } from '../../../__tests__/support/test-device-runtime-gateway.ts'; import { refFrameState } from '../../../core/ref-frame.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; test('runtime set/show/clear manages session-scoped runtime hints before open', async () => { diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-script-publication.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-script-publication.test.ts index 14d6fc926e..4615c9f057 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-script-publication.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-script-publication.test.ts @@ -19,7 +19,7 @@ import { scriptTargetPath, scriptTargetForce, } from '../../../core/session-script-publication-state.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const TARGET_EVIDENCE: TargetAnnotationV1 = { id: 'continue', diff --git a/packages/daemon/src/sessions/handlers/__tests__/session-shutdown.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session-shutdown.test.ts index 789ed4b702..47789f4e26 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session-shutdown.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session-shutdown.test.ts @@ -15,7 +15,7 @@ import { mockInspectDeviceRuntimeFacts, mockShutdownTargetRuntime, } from '../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; test('shutdown turns off selected iOS simulator', async () => { diff --git a/packages/daemon/src/sessions/handlers/__tests__/session.test.ts b/packages/daemon/src/sessions/handlers/__tests__/session.test.ts index 4fe664d2a6..9ef7a5e7c2 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/session.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/session.test.ts @@ -3,7 +3,7 @@ import { expect, test } from 'vitest'; import * as path from 'node:path'; import { handleSessionCommands } from '../../../__tests__/support/handlers/session-command-harness.ts'; import { makeSessionStore } from '../../../__tests__/support/store-factory.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../__tests__/support/command-surface-fake.ts'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/handlers/__tests__/trace-runtime.test.ts b/packages/daemon/src/sessions/handlers/__tests__/trace-runtime.test.ts index 3be7649c90..2e4855596a 100644 --- a/packages/daemon/src/sessions/handlers/__tests__/trace-runtime.test.ts +++ b/packages/daemon/src/sessions/handlers/__tests__/trace-runtime.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; import type { SessionState } from '../../../core/session-state.ts'; diff --git a/packages/daemon/src/sessions/server/daemon-idle-reap.test.ts b/packages/daemon/src/sessions/server/daemon-idle-reap.test.ts index b5bb667720..bc08e79861 100644 --- a/packages/daemon/src/sessions/server/daemon-idle-reap.test.ts +++ b/packages/daemon/src/sessions/server/daemon-idle-reap.test.ts @@ -12,7 +12,7 @@ import { isDaemonIdle, resolveDaemonIdleReapMs, } from './daemon-idle-reap.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeTestScreenRecordingResource } from '../../__tests__/support/screen-recording-live-handle.ts'; let stateDir: string; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts index 9ac5aaa698..d195dd3475 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities-install-projection.test.ts @@ -11,7 +11,7 @@ import type { } from '../../../../core/request-runtime-binding.ts'; import { createCapabilitiesAdmissionRuntime } from './session-capabilities.fixtures.ts'; import { handleSessionCommands } from '../../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; test('capabilities projects the install family from exactly one facts inspection', async () => { diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.fixtures.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.fixtures.ts index 1ed3790f07..812dbc7671 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.fixtures.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.fixtures.ts @@ -16,7 +16,7 @@ import type { import { createUnavailableRuntimeFactsForTest, unavailableApplicationLifecycleOperationFacts, -} from '@agent-device/test-kit/runtime-operation-facts'; +} from '@agent-device/test-kit'; const nativeRefUnavailable = Object.freeze({ available: false, diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.test.ts index 999aa393b3..cff49618f7 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-capabilities.test.ts @@ -3,14 +3,18 @@ import { test, expect, vi } from 'vitest'; import path from 'node:path'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; -import { LINUX_DEVICE, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { + LINUX_DEVICE, + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, + WEB_DESKTOP_DEVICE, +} from '@agent-device/test-kit'; import { makeAndroidSession, makeSession, } from '../../../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; import { withTestDeviceInventoryProvider as withTargetDeviceResolutionScope } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { @@ -29,7 +33,6 @@ import type { InspectDeviceRuntimeFacts, } from '../../../../core/request-runtime-binding.ts'; import { handleSessionCommands } from '../../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; /** The system leaves this owner refuses: the retired fallback listed them unconditionally. */ diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-cwd-scoped-resources.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-cwd-scoped-resources.test.ts index 3d6b95b9ba..57171f40c6 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-cwd-scoped-resources.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-cwd-scoped-resources.test.ts @@ -14,7 +14,7 @@ import { sessionCloseShutdownFixture, type SessionState, } from './session-close-shutdown.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { encodeHostAudioProbeDescriptor } from '@agent-device/capture-kit/audio-probe-descriptor-fixtures'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-ended-lease.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-ended-lease.test.ts index 3fa0dfbc3f..b672f2f402 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-ended-lease.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-ended-lease.test.ts @@ -2,7 +2,7 @@ import { daemonPlatformServicesFixture } from '../../../../__tests__/support/pla import { beforeEach, expect, test, vi } from 'vitest'; import path from 'node:path'; import { AppError } from '@agent-device/kernel/errors'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../../core/session-store.ts'; import type { DaemonResponse } from '@agent-device/kernel/contracts'; import type { DaemonRequest } from '../../../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-lifecycle-runtime.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-lifecycle-runtime.test.ts index d43f78abbd..06dcce1e51 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-lifecycle-runtime.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-lifecycle-runtime.test.ts @@ -24,7 +24,7 @@ import { clearRuntimeHintsFixture, dispatchApplicationLifecycleEffect, } from '../../../../__tests__/support/application-lifecycle-runtime-fixture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockDispatch = vi.mocked(dispatchApplicationLifecycleEffect); const noopInvoke = async (_req: DaemonRequest): Promise => ({ ok: true, data: {} }); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-resource-cleanup.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-resource-cleanup.test.ts index 22c53d3e50..d3eb9e1c6a 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-resource-cleanup.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-resource-cleanup.test.ts @@ -7,7 +7,7 @@ import { sessionCloseShutdownFixture, type SessionState, } from './session-close-shutdown.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { encodeHostAudioProbeDescriptor } from '@agent-device/capture-kit/audio-probe-descriptor-fixtures'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; import { platformResourceCleanupFixture } from '../../../../__tests__/support/platform-resource-cleanup-fixture.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-save-script.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-save-script.test.ts index 2dd42d54c8..cee7a01b44 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-save-script.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-save-script.test.ts @@ -1,7 +1,7 @@ import { daemonPlatformServicesFixture } from '../../../../__tests__/support/platform-services-fixture.ts'; import { beforeEach, expect, test } from 'vitest'; import { sessionCloseShutdownFixture } from './session-close-shutdown.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; import { lifecycleOperationsSpy } from '../../../../__tests__/support/lifecycle-operations-spy.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-script.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-script.test.ts index 0d69a7a9e7..340335fe63 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-script.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-script.test.ts @@ -14,7 +14,7 @@ import { commitRepairScriptBeforeClose, finalizeOrdinaryCloseScript, } from '../session-close-script.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { flushSessionEventLogWrites } from '@agent-device/session-journal/session-event-log'; const roots: string[] = []; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown-platform.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown-platform.test.ts index 453fe454a2..eb964dfbaf 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown-platform.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown-platform.test.ts @@ -5,7 +5,7 @@ import { type DeviceBinding, type PlatformRuntimeOperations, } from './session-close-shutdown.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; import { lifecycleOperationsSpy } from '../../../../__tests__/support/lifecycle-operations-spy.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown.fixtures.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown.fixtures.ts index f470a015b1..b62d1438a0 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown.fixtures.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-shutdown.fixtures.ts @@ -65,7 +65,7 @@ import { stopIosRunnerSession, } from '@agent-device/platform-apple/runner/operations'; import { cleanupAppleXctracePerfCapture } from '@agent-device/platform-apple/perf'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { acquireDeviceClaim, inspectDeviceClaims, @@ -83,7 +83,6 @@ import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { screenRecordingResourceStore } from '@agent-device/capture-kit/screen-recording-resource-store'; import { lifecycleRuntimeFacts } from '../../../../__tests__/support/application-lifecycle-runtime-harness.ts'; import { dispatchApplicationLifecycleEffect } from '../../../../__tests__/support/application-lifecycle-runtime-fixture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; export type { DeviceBinding, PlatformRuntimeOperations, SessionState }; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-without-session-mode.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-without-session-mode.test.ts index 7a5d438407..6d4bd0655d 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-without-session-mode.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-close-without-session-mode.test.ts @@ -8,7 +8,7 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import type { DaemonRequest } from '../../../../core/daemon-request.ts'; import { SessionStore } from '../../../../core/session-store.ts'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockResolveTargetDevice = vi.hoisted(() => vi.fn()); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-devices-batch-runtime.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-devices-batch-runtime.test.ts index 46ee6b307d..56c57b34f4 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-devices-batch-runtime.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-devices-batch-runtime.test.ts @@ -25,7 +25,7 @@ import type { DaemonRequest } from '../../../../core/daemon-request.ts'; import { withTestDeviceInventory } from '@agent-device/device-selection/inventory-gateways-fixtures'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { readCurrentOwnerIdentity } from '@agent-device/host-kit/process'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const noopInvoke = async (_req: DaemonRequest): Promise => ({ ok: true, diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-appleos.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-appleos.test.ts index f137a3f0f5..087d9c39df 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-appleos.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-appleos.test.ts @@ -26,7 +26,7 @@ import { MACOS_DEVICE, TVOS_SIMULATOR, VISIONOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; const mockListDeviceInventory = vi.mocked(listDeviceInventory); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-apps-runtime.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-apps-runtime.test.ts index 005338f468..aacc216d59 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-apps-runtime.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-apps-runtime.test.ts @@ -13,7 +13,7 @@ import { narrowDeviceBinding, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-harmonyos.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-harmonyos.test.ts index 97bc83893a..80633c230f 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-harmonyos.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-harmonyos.test.ts @@ -14,7 +14,7 @@ import { narrowDeviceBinding, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-scoped-paths.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-scoped-paths.test.ts index ebe65005c5..0145f1d7c5 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-scoped-paths.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-inventory-scoped-paths.test.ts @@ -6,7 +6,7 @@ import { handleSessionInventoryCommands } from '../inventory.ts'; import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; import type { DaemonRequest } from '../../../../core/daemon-request.ts'; import type { SessionState } from '../../../../core/session-state.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { resolveImplicitSessionScope } from '../../../session-routing.ts'; import { tenantScopedSessionName } from '../../../../core/session-tenant-scope.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-device-in-use.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-device-in-use.test.ts index 55059741af..5b049a9f3a 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-device-in-use.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-device-in-use.test.ts @@ -5,7 +5,7 @@ import { buildForeignWorkspaceSessionConflict, } from '../../../../core/session-recovery-hints.ts'; import type { SessionRef } from '../../../../core/session-state.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; // DEVICE_IN_USE named `SessionState.name`, and for an implicitly cwd-scoped session that is // `default` while the session is stored — and addressable — as `cwd::default`. Both the diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-execution-runtime.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-execution-runtime.test.ts index 8a10c67a6a..190d27cd11 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-execution-runtime.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-execution-runtime.test.ts @@ -76,7 +76,7 @@ import { makeSessionStore, noopInvoke, } from './session-open-runtime.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockDispatch = vi.mocked(dispatchApplicationLifecycleEffect); const mockApplyRuntimeHints = vi.mocked(applyRuntimeHintsFixture); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-existing.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-existing.test.ts index 892dd54cd8..a2864df527 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-existing.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-existing.test.ts @@ -15,7 +15,7 @@ import { import { resolveOpenTargetFixture } from '../../../../__tests__/support/application-lifecycle-runtime-fixture.ts'; import type { SessionState } from '../../../../core/session-state.ts'; import { handleSessionCommands } from '../../../../__tests__/support/handlers/session-command-harness.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { fakeCreateCommandSurface } from '../../../../__tests__/support/command-surface-fake.ts'; const mockResolveOpenTarget = vi.mocked(resolveOpenTargetFixture); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.fixtures.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.fixtures.ts index e4c6fc8122..01924ac24c 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.fixtures.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.fixtures.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { SessionStore } from '../../../../core/session-store.ts'; import type { DaemonRequest } from '../../../../core/daemon-request.ts'; import type { SessionState } from '../../../../core/session-state.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; export const noopInvoke = async (_req: DaemonRequest): Promise => ({ ok: true, diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.test.ts index 75659baad2..d934f5640f 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-runtime.test.ts @@ -67,7 +67,7 @@ import { makeSessionStore, noopInvoke, } from './session-open-runtime.fixtures.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockDispatch = vi.mocked(dispatchApplicationLifecycleEffect); const mockApplyRuntimeHints = vi.mocked(applyRuntimeHintsFixture); diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-state.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-state.test.ts index f3629d097a..e6ee661111 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-state.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-state.test.ts @@ -6,7 +6,7 @@ import { authoringPublication, makeIosSession, } from '../../../../__tests__/support/session-factories.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { isSessionRecording } from '../../../../core/session-script-publication-capability.ts'; // --- #1533: a re-open cannot resurrect a terminal authoring lifecycle --- diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-surface.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-surface.test.ts index dc1e065ec6..1bce8ee814 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-surface.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/__tests__/session-open-surface.test.ts @@ -1,6 +1,6 @@ import { test } from 'vitest'; import { buildOpenResult } from '../session-open-surface.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import assert from 'node:assert/strict'; test('buildOpenResult exposes the Vega serial without leaking an internal platform alias', () => { diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.test.ts index 193dfa9c8d..d922ce82dd 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.test.ts @@ -3,7 +3,7 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { DaemonResponse } from '@agent-device/kernel/contracts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { CloseApplicationFinalizationInput } from '@agent-device/contracts/application-lifecycle-runtime'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import { LeaseRegistry } from '../../../resources/lease-registry.ts'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; diff --git a/packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution-relaunch.test.ts b/packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution-relaunch.test.ts index c523d6d967..fafbdc4e8f 100644 --- a/packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution-relaunch.test.ts +++ b/packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution-relaunch.test.ts @@ -3,7 +3,7 @@ import { afterEach, beforeEach, expect, test, vi } from 'vitest'; import type { DaemonResponse } from '@agent-device/kernel/contracts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { OpenApplicationInput } from '@agent-device/contracts/application-lifecycle-runtime'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '../../../core/session-store.ts'; import type { DaemonRequest } from '../../../core/daemon-request.ts'; import type { SessionState } from '../../../core/session-state.ts'; diff --git a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-audio.test.ts b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-audio.test.ts index f62eb95c2a..30a61773f8 100644 --- a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-audio.test.ts +++ b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-audio.test.ts @@ -10,7 +10,12 @@ import type { AudioProbeResult } from '@agent-device/contracts/audio-probe-resul import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { deviceIdentity, type DeviceInfo } from '@agent-device/kernel/device'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { IOS_DEVICE, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { + IOS_DEVICE, + unavailableApplicationLifecycleOperationFacts, + unavailableDeploymentSnapshotAndShutdownOperationFacts, + WEB_DESKTOP_DEVICE, +} from '@agent-device/test-kit'; import { makeAndroidSession, makeIosSession, @@ -18,10 +23,6 @@ import { makeSession, } from '../../../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; -import { - unavailableApplicationLifecycleOperationFacts, - unavailableDeploymentSnapshotAndShutdownOperationFacts, -} from '@agent-device/test-kit/runtime-operation-facts'; import { createAudioProbeAdmissionLedger } from '@agent-device/capture-kit/audio-probe-admission-ledger'; import { audioProbeDurableResource } from '@agent-device/capture-kit/audio-probe-session-resource'; import type { SessionStore } from '../../../../core/session-store.ts'; diff --git a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-logs.test.ts b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-logs.test.ts index 13f2a05595..16b8c9bfc6 100644 --- a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-logs.test.ts +++ b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-logs.test.ts @@ -11,9 +11,11 @@ import { narrowDeviceBinding, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { + createTestAppLogLiveHandle, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { diff --git a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-perf-runtime.test.ts b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-perf-runtime.test.ts index 16e0a8aa28..ade44c5367 100644 --- a/packages/daemon/src/sessions/session-observability/internal/__tests__/session-perf-runtime.test.ts +++ b/packages/daemon/src/sessions/session-observability/internal/__tests__/session-perf-runtime.test.ts @@ -19,7 +19,7 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { deviceIdentity } from '@agent-device/kernel/device'; import { makeAndroidSession } from '../../../../__tests__/support/session-factories.ts'; import { makeSessionStore } from '../../../../__tests__/support/store-factory.ts'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { createPerfCaptureAdmissionLedger } from '@agent-device/capture-kit/perf-capture-admission-ledger'; import type { BindDeviceRuntime, diff --git a/packages/selectors/src/internal/parse.test.ts b/packages/selectors/src/internal/parse.test.ts index bd6dcd631f..8617be027d 100644 --- a/packages/selectors/src/internal/parse.test.ts +++ b/packages/selectors/src/internal/parse.test.ts @@ -16,7 +16,7 @@ function chainTerms(expression: string): SelectorTerm[][] { // Property, not another example: a selector value carries user text, so the // grammar has to survive both quote characters, backslash runs, `||` and `=` // inside a value, and whitespace-only values. Extend the hazard vocabulary in -// @agent-device/test-kit/property-arbitraries rather than pinning one more +// @agent-device/test-kit rather than pinning one more // case here. test('parsing a printed selector chain yields the terms it was printed from', () => { fc.assert( diff --git a/packages/test-kit/package.json b/packages/test-kit/package.json index ba9fc020f5..fba5bef435 100644 --- a/packages/test-kit/package.json +++ b/packages/test-kit/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "type": "module", - "description": "Private generic test helpers (temp dirs, device/session/snapshot fixtures, mocked processes, loopback servers) shared by the root and workspace-package test trees. One narrow subpath per helper; test-only, never bundled, and never importing root `src/` so the daemon package can depend on it.", + "description": "Private shared test helpers (temp dirs, device/session/snapshot fixtures, mocked processes, loopback servers) for the root and workspace-package test trees. One entry, named exports; test-only, never bundled, never importing root `src/`, `platform-*`, `provider-*` or the daemon.", "dependencies": { "@agent-device/capture-kit": "workspace:*", "@agent-device/command-registry": "workspace:*", @@ -13,77 +13,9 @@ "@agent-device/kernel": "workspace:*" }, "exports": { - "./app-error": { - "types": "./src/app-error.ts", - "default": "./src/app-error.ts" - }, - "./app-log-live-handle": { - "types": "./src/app-log-live-handle.ts", - "default": "./src/app-log-live-handle.ts" - }, - "./boundary-fault-matrix": { - "types": "./src/boundary-fault-matrix.ts", - "default": "./src/boundary-fault-matrix.ts" - }, - "./color": { - "types": "./src/color.ts", - "default": "./src/color.ts" - }, - "./device-fixtures": { - "types": "./src/device-fixtures.ts", - "default": "./src/device-fixtures.ts" - }, - "./env": { - "types": "./src/env.ts", - "default": "./src/env.ts" - }, - "./filesystem-boundary-faults": { - "types": "./src/filesystem-boundary-faults.ts", - "default": "./src/filesystem-boundary-faults.ts" - }, - "./host-execution": { - "types": "./src/host-execution.ts", - "default": "./src/host-execution.ts" - }, - "./host-process-mock": { - "types": "./src/host-process-mock.ts", - "default": "./src/host-process-mock.ts" - }, - "./legacy-daemon-fixture": { - "types": "./src/legacy-daemon-fixture.ts", - "default": "./src/legacy-daemon-fixture.ts" - }, - "./loopback": { - "types": "./src/loopback.ts", - "default": "./src/loopback.ts" - }, - "./plugin.fixtures": { - "types": "./src/plugin.fixtures.ts", - "default": "./src/plugin.fixtures.ts" - }, - "./property-arbitraries": { - "types": "./src/property-arbitraries.ts", - "default": "./src/property-arbitraries.ts" - }, - "./runtime-operation-facts": { - "types": "./src/runtime-operation-facts.ts", - "default": "./src/runtime-operation-facts.ts" - }, - "./snapshot-builders": { - "types": "./src/snapshot-builders.ts", - "default": "./src/snapshot-builders.ts" - }, - "./tmp-dir": { - "types": "./src/tmp-dir.ts", - "default": "./src/tmp-dir.ts" - }, - "./video-fixtures": { - "types": "./src/video-fixtures.ts", - "default": "./src/video-fixtures.ts" - }, - "./web-managed-agent-browser": { - "types": "./src/web-managed-agent-browser.ts", - "default": "./src/web-managed-agent-browser.ts" + ".": { + "types": "./src/index.ts", + "default": "./src/index.ts" } }, "devDependencies": { diff --git a/packages/test-kit/src/host-process-mock.ts b/packages/test-kit/src/host-process-mock.ts index 95f9b8098a..ff51ff3d3e 100644 --- a/packages/test-kit/src/host-process-mock.ts +++ b/packages/test-kit/src/host-process-mock.ts @@ -1,29 +1,37 @@ -type HostProcessModule = typeof import('@agent-device/host-kit/process'); -type HostProcessIdentityObservation = - import('@agent-device/host-kit/process').HostProcessIdentityObservation; +import { beforeEach, vi } from 'vitest'; +import type * as HostProcess from '@agent-device/host-kit/process'; -export async function pinOwnProcessStartTime( - importOriginal: () => Promise, -): Promise { - const actual = await importOriginal(); +type HostProcessModule = typeof HostProcess; +type HostProcessIdentityObservation = HostProcess.HostProcessIdentityObservation; + +/** + * Pins this test process's start time to a constant on the host-kit process module, so claim and + * lock identity checks behave the same on every host. Call it once at module scope (it registers a `beforeEach`, so `vi.restoreAllMocks` between tests cannot unpin it) with the + * namespace the test imported: `pinOwnProcessStartTime(hostProcess)` where + * `import * as hostProcess from '@agent-device/host-kit/process'`. It spies the module in place + * rather than replacing it with `vi.mock`, so the helper is never imported while the module it + * pins is still being mocked. + */ +export function pinOwnProcessStartTime(hostProcess: HostProcessModule): void { + beforeEach(() => installPin(hostProcess)); +} + +function installPin(hostProcess: HostProcessModule): void { const ownStartTime = 'test-process-start-time'; - return { - ...actual, - readCurrentOwnerIdentity: () => ({ pid: process.pid, startTime: ownStartTime }), - readProcessStartTime: (pid: number) => { - if (pid !== process.pid) return null; - return ownStartTime; - }, - readHostProcessIdentityObservations: (pids: Iterable) => { - const selected = [...pids]; + vi.spyOn(hostProcess, 'readCurrentOwnerIdentity').mockImplementation(() => ({ + pid: process.pid, + startTime: ownStartTime, + })); + vi.spyOn(hostProcess, 'readProcessStartTime').mockImplementation((pid: number) => + pid === process.pid ? ownStartTime : null, + ); + vi.spyOn(hostProcess, 'readHostProcessIdentityObservations').mockImplementation( + (pids: Iterable) => { const observations = new Map(); - if (selected.includes(process.pid)) { - observations.set(process.pid, { - state: 'S', - startTime: ownStartTime, - }); + if ([...pids].includes(process.pid)) { + observations.set(process.pid, { state: 'S', startTime: ownStartTime }); } return observations; }, - }; + ); } diff --git a/packages/test-kit/src/index.ts b/packages/test-kit/src/index.ts new file mode 100644 index 0000000000..28b5022bc5 --- /dev/null +++ b/packages/test-kit/src/index.ts @@ -0,0 +1,88 @@ +// The one entry of @agent-device/test-kit: every shared test helper, named explicitly. Importing it +// loads every module below; each is free of import-time side effects. Tests import helpers from +// '@agent-device/test-kit', never from a file path. + +export { assertRejectsAppError, assertThrowsAppError } from './app-error.ts'; +export { createTestAppLogLiveHandle } from './app-log-live-handle.ts'; +export { + BOUNDARY_COMMAND_CLASSES, + BOUNDARY_FAULT_MATRIX, + BOUNDARY_FAULTS, + type BoundaryCommandClass, + type BoundaryCoverage, + type BoundaryFault, + type BoundaryFaultMatrix, + type BoundaryInvariant, +} from './boundary-fault-matrix.ts'; +export { withNoColor, withNoColorAsync } from './color.ts'; +export { + ANDROID_DEVICE, + ANDROID_EMULATOR, + ANDROID_TV_DEVICE, + IOS_DEVICE, + IOS_SIMULATOR, + IPADOS_SIMULATOR, + LINUX_DEVICE, + MACOS_DEVICE, + TVOS_SIMULATOR, + VISIONOS_SIMULATOR, + WEB_DESKTOP_DEVICE, +} from './device-fixtures.ts'; +export { restoreEnv } from './env.ts'; +export { + type FilesystemBoundaryFixture, + type FilesystemBoundaryOwner, + type FilesystemErrno, + type FilesystemFaultPoint, + registerFilesystemBoundaryMatrix, +} from './filesystem-boundary-faults.ts'; +export { + type CommandSpawnOutcome, + type CommandSpawnRecorder, + recordCommandSpawns, + type RecordedSpawn, + withMockedPlatform, +} from './host-execution.ts'; +export { pinOwnProcessStartTime } from './host-process-mock.ts'; +export { spawnLegacyDaemonFixture } from './legacy-daemon-fixture.ts'; +export { + closeLoopbackServer, + listenOnLoopback, + type LoopbackServer, + type SkippableTestContext, + skipWhenLoopbackUnavailable, + supportsLoopbackBind, + trackLoopbackSockets, + waitForHttpOk, +} from './loopback.ts'; +export { + pluginHome, + registrationSource, + selectPlugin, + selectPluginManifest, + webDriverPluginSource, + writePlugin, +} from './plugin.fixtures.ts'; +export { + COMPACT_VIEWPORTS, + formatRef, + type GeneratedRef, + gestureInViewportArb, + PROPERTY_RUNS_SMALL, + rawSnapshotNodesArb, + refArb, + replayScriptArb, +} from './property-arbitraries.ts'; +export { + createUnavailableRuntimeFactsForTest, + unavailableApplicationLifecycleOperationFacts, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from './runtime-operation-facts.ts'; +export { buildNodes } from './snapshot-builders.ts'; +export { mkdtempForTest, mkdtempForTestSync } from './tmp-dir.ts'; +export { likelyPlayableWebmContainer } from './video-fixtures.ts'; +export { + installFakeManagedAgentBrowser, + withNodeRuntime, + writeFakeManagedAgentBrowserPackage, +} from './web-managed-agent-browser.ts'; diff --git a/scripts/__tests__/build-package-xcuitest.test.ts b/scripts/__tests__/build-package-xcuitest.test.ts index 7220430e61..4a34da404f 100644 --- a/scripts/__tests__/build-package-xcuitest.test.ts +++ b/scripts/__tests__/build-package-xcuitest.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { buildPackageXcuitest } from '../build-package-xcuitest.mjs'; type Build = { root: string; platform: string; derivedPath: string }; diff --git a/scripts/__tests__/fallow-fixture-policy.test.ts b/scripts/__tests__/fallow-fixture-policy.test.ts index 9d9374dec2..88ed3b202c 100644 --- a/scripts/__tests__/fallow-fixture-policy.test.ts +++ b/scripts/__tests__/fallow-fixture-policy.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { test } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { runCmd } from '@agent-device/host-kit/command'; const REPOSITORY_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); diff --git a/scripts/__tests__/prepare-publish-assets.test.ts b/scripts/__tests__/prepare-publish-assets.test.ts index 2f1b0378b6..69e614a6c3 100644 --- a/scripts/__tests__/prepare-publish-assets.test.ts +++ b/scripts/__tests__/prepare-publish-assets.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { preparePublishAssets } from '../prepare-publish-assets.mjs'; test('prepares both Android runtime helpers through the shared publish owner', () => { diff --git a/scripts/__tests__/runner-isolation-diagnostics.test.ts b/scripts/__tests__/runner-isolation-diagnostics.test.ts index 25ef061a94..293b539652 100644 --- a/scripts/__tests__/runner-isolation-diagnostics.test.ts +++ b/scripts/__tests__/runner-isolation-diagnostics.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { spawnSync } from 'node:child_process'; import { describe, expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { ISOLATION_CANARY_PATH, isolationCanaryLines, diff --git a/scripts/__tests__/xctest-selection.test.ts b/scripts/__tests__/xctest-selection.test.ts index 7c93631f1e..bc367120a9 100644 --- a/scripts/__tests__/xctest-selection.test.ts +++ b/scripts/__tests__/xctest-selection.test.ts @@ -9,7 +9,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { describe, expect, onTestFinished, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { buildReport, counts, diff --git a/scripts/check-affected/lockfile-install-sync.test.ts b/scripts/check-affected/lockfile-install-sync.test.ts index 35c29cb909..405a2550b7 100644 --- a/scripts/check-affected/lockfile-install-sync.test.ts +++ b/scripts/check-affected/lockfile-install-sync.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'node:test'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { checkLockfileInstallSync } from './lockfile-install-sync.ts'; function writeLockfile(root: string, content: string): void { diff --git a/scripts/fuzz/arbitraries.ts b/scripts/fuzz/arbitraries.ts index 8e6a2ba6b2..063af0d976 100644 --- a/scripts/fuzz/arbitraries.ts +++ b/scripts/fuzz/arbitraries.ts @@ -8,7 +8,7 @@ // reaches deep parser branches that uniformly random noise never gets past the first token of. import fc from 'fast-check'; -import { replayScriptArb } from '@agent-device/test-kit/property-arbitraries'; +import { replayScriptArb } from '@agent-device/test-kit'; import type { FuzzTarget, FuzzTargetName } from './target-types.ts'; const SELECTOR_VALUE_HAZARDS = [ diff --git a/scripts/ios-snapshot-benchmark/benchmark-config.test.ts b/scripts/ios-snapshot-benchmark/benchmark-config.test.ts index f62e587cc5..f99339ced5 100644 --- a/scripts/ios-snapshot-benchmark/benchmark-config.test.ts +++ b/scripts/ios-snapshot-benchmark/benchmark-config.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { parseConfig } from './benchmark-config.ts'; import { createBenchmarkStateRoot } from './state-ownership.ts'; diff --git a/scripts/ios-snapshot-benchmark/cli-process.test.ts b/scripts/ios-snapshot-benchmark/cli-process.test.ts index d98cabe956..426901485a 100644 --- a/scripts/ios-snapshot-benchmark/cli-process.test.ts +++ b/scripts/ios-snapshot-benchmark/cli-process.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { classifyFailure } from './command.ts'; import { runCliAsync } from './cli-process.ts'; diff --git a/scripts/ios-snapshot-benchmark/run.test.ts b/scripts/ios-snapshot-benchmark/run.test.ts index 8460fa0f84..4639d11b35 100644 --- a/scripts/ios-snapshot-benchmark/run.test.ts +++ b/scripts/ios-snapshot-benchmark/run.test.ts @@ -3,7 +3,7 @@ import { execFileSync } from 'node:child_process'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { resolveRepoRoot } from './host.ts'; test('CLI refuses an unmarked existing root before any descendant can be cleared', async () => { diff --git a/scripts/ios-snapshot-benchmark/size-install.test.ts b/scripts/ios-snapshot-benchmark/size-install.test.ts index 993e386fa9..6791599692 100644 --- a/scripts/ios-snapshot-benchmark/size-install.test.ts +++ b/scripts/ios-snapshot-benchmark/size-install.test.ts @@ -4,7 +4,7 @@ import fs from 'node:fs'; import { mkdir, rm, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { test, vi } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { assertInstalledSnapshotBridge, measureCleanInstalledPackage, diff --git a/scripts/ios-snapshot-benchmark/state-ownership.test.ts b/scripts/ios-snapshot-benchmark/state-ownership.test.ts index 8ca05bd2bd..e1e39608af 100644 --- a/scripts/ios-snapshot-benchmark/state-ownership.test.ts +++ b/scripts/ios-snapshot-benchmark/state-ownership.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { assertBenchmarkOwner, assertOwnedDerivedPath, diff --git a/scripts/layering/check.ts b/scripts/layering/check.ts index 28c48b87c7..6b7d5753c0 100644 --- a/scripts/layering/check.ts +++ b/scripts/layering/check.ts @@ -140,6 +140,7 @@ import { checkDaemonClientEntry } from './daemon-client-entry.ts'; import { checkDaemonProcessReach } from './daemon-process-reach.ts'; import { checkPackageExportSurface, + checkTestKitIsolation, packageExportSurfaceSummary, } from './package-export-surface.ts'; import { checkDaemonLayers, DAEMON_ROOT } from './daemon-layers.ts'; @@ -607,8 +608,13 @@ export const LAYERING_RULES: Readonly> = { context.sourceFiles.filter((file) => file.startsWith(DAEMON_SOURCE_ROOT)), context.edges, ), - 'package-export-surface': (context) => - checkPackageExportSurface(context.ratchets.testOnlyExports, context.reference.testOnlyExports), + 'package-export-surface': (context) => [ + ...checkPackageExportSurface( + context.ratchets.testOnlyExports, + context.reference.testOnlyExports, + ), + ...checkTestKitIsolation(readTrackedPackageManifests(repoRoot), context.allTypeScriptSources), + ], }; export function main(): number { diff --git a/scripts/layering/package-export-surface.test.ts b/scripts/layering/package-export-surface.test.ts index edda04e9f0..56450978db 100644 --- a/scripts/layering/package-export-surface.test.ts +++ b/scripts/layering/package-export-surface.test.ts @@ -12,6 +12,7 @@ import { } from './package-boundaries.ts'; import { checkPackageExportSurface, + checkTestKitIsolation, expandExportTarget, isTestOnlyExport, isTestOnlyExportSpecifier, @@ -339,3 +340,122 @@ test('a production subpath of the same package stays importable from production assert.deepEqual(refusals(file, '@agent-device/owner'), [], file); } }); + +function kitManifests(overrides: { + kit?: Record; + kernel?: Record; +}): Map { + return new Map([ + [ + 'packages/test-kit/package.json', + JSON.stringify({ + name: '@agent-device/test-kit', + exports: { '.': entry('./src/index.ts') }, + dependencies: { '@agent-device/kernel': 'workspace:*' }, + ...overrides.kit, + }), + ], + [ + 'packages/kernel/package.json', + JSON.stringify({ + name: '@agent-device/kernel', + exports: { '.': entry('./src/index.ts') }, + ...overrides.kernel, + }), + ], + ]); +} + +const KIT_SOURCE = new Map([ + ['packages/test-kit/src/index.ts', "export { a } from './a.ts';"], + ['packages/test-kit/src/a.ts', "import { x } from '@agent-device/kernel/errors';"], +]); + +test('the test-kit shape holds: one entry, built only on packages below it', () => { + assert.deepEqual(checkTestKitIsolation(kitManifests({}), KIT_SOURCE), []); +}); + +test('test-kit exports exactly "." and nothing else', () => { + const extra = checkTestKitIsolation( + kitManifests({ + kit: { exports: { '.': entry('./src/index.ts'), './tmp-dir': entry('./src/tmp-dir.ts') } }, + }), + KIT_SOURCE, + ); + assert.equal(extra.length, 1); + assert.match(extra[0]!.message, /exports exactly "\."/); + assert.equal( + checkTestKitIsolation( + kitManifests({ kit: { exports: { './tmp-dir': entry('./x.ts') } } }), + KIT_SOURCE, + ).length, + 1, + ); +}); + +test('test-kit may not depend on a platform, provider, daemon or root package', () => { + for (const name of [ + '@agent-device/platform-apple', + '@agent-device/provider-limrun', + '@agent-device/daemon', + 'agent-device', + ]) { + for (const field of ['dependencies', 'devDependencies', 'peerDependencies']) { + const found = checkTestKitIsolation( + kitManifests({ kit: { [field]: { [name]: 'workspace:*' } } }), + KIT_SOURCE, + ); + assert.equal(found.length, 1, `${name} in ${field}`); + assert.match(found[0]!.message, /belongs in it/); + } + } +}); + +test('test-kit may not import a platform, provider, daemon or root module, or reach out of its directory', () => { + for (const spec of [ + '@agent-device/platform-android', + '@agent-device/platform-apple/runner', + '@agent-device/provider-testmu/connection', + '@agent-device/daemon/testing/context', + '@agent-device/daemon', + 'agent-device/commands', + '../../../src/platform-runtime-gateway.ts', + '../../kernel/src/errors.ts', + ]) { + const found = checkTestKitIsolation( + kitManifests({}), + new Map([['packages/test-kit/src/a.ts', `import { x } from '${spec}';`]]), + ); + assert.equal(found.length, 1, spec); + assert.equal(found[0]!.file, 'packages/test-kit/src/a.ts'); + } + // A sibling inside its own directory, and a lookalike package name, are fine. + assert.deepEqual( + checkTestKitIsolation( + kitManifests({}), + new Map([ + [ + 'packages/test-kit/src/a.ts', + "import { b } from './b.ts';\nimport { c } from '@agent-device/daemon-contracts/device-claims';", + ], + ]), + ), + [], + ); +}); + +test('a package test-kit builds on cannot declare test-kit: that is a reference cycle', () => { + for (const field of ['dependencies', 'devDependencies']) { + const found = checkTestKitIsolation( + kitManifests({ kernel: { [field]: { '@agent-device/test-kit': 'workspace:*' } } }), + KIT_SOURCE, + ); + assert.equal(found.length, 1, field); + assert.equal(found[0]!.file, 'packages/kernel/package.json'); + assert.match(found[0]!.message, /project-reference cycle/); + } +}); + +test('a repo without a test-kit package has nothing to isolate', () => { + assert.deepEqual(checkTestKitIsolation(new Map(), new Map()), []); +}); diff --git a/scripts/layering/package-export-surface.ts b/scripts/layering/package-export-surface.ts index f7455b49d7..2ed60d2552 100644 --- a/scripts/layering/package-export-surface.ts +++ b/scripts/layering/package-export-surface.ts @@ -20,7 +20,8 @@ // fixture. `@agent-device/test-kit` is the one package exempt from the export check. "Production // source" is `isProductionSourceFile` in `tracked-sources.ts`. -import { resolveWorkspaceSpecifier, type LayeringViolation } from './model.ts'; +import path from 'node:path'; +import { parseImports, resolveWorkspaceSpecifier, type LayeringViolation } from './model.ts'; import { isProductionSourceFile } from './tracked-sources.ts'; export const PACKAGE_EXPORT_SURFACE_RULE = 'R83 package-export-surface'; @@ -284,3 +285,102 @@ export function testOnlyImportMessage( `package's production subpath or inject the port.` ); } + +function violation(file: string, message: string): LayeringViolation { + return { rule: PACKAGE_EXPORT_SURFACE_RULE, file, line: 1, message }; +} + +/** + * Packages test-kit may not depend on, import or reach: a platform or provider package, the + * daemon, or the root package. A fixture that needs one of those packages' code is a test of that + * package and belongs in it. + */ +const TEST_KIT_FORBIDDEN_PACKAGE = + /^(?:@agent-device\/(?:platform-[^/]+|provider-[^/]+|daemon)|agent-device)(?:\/|$)/; + +const TEST_KIT_DIR = 'packages/test-kit'; + +type DependencyManifest = { + name?: string; + exports?: unknown; + dependencies?: Record; + devDependencies?: Record; + peerDependencies?: Record; +}; + +function workspaceNames(manifest: DependencyManifest): string[] { + return [ + ...Object.keys(manifest.dependencies ?? {}), + ...Object.keys(manifest.devDependencies ?? {}), + ...Object.keys(manifest.peerDependencies ?? {}), + ]; +} + +/** + * The shape of the one shared test package: a single `.` entry, no dependency on or import of a + * platform, provider, daemon or root module, no relative reach out of its directory, and no + * dependency cycle through the packages it builds on (a package test-kit depends on cannot declare + * test-kit: project references are acyclic, so its tests keep their helpers local). + */ +export function checkTestKitIsolation( + manifests: ReadonlyMap, + sources: ReadonlyMap, +): LayeringViolation[] { + const violations: LayeringViolation[] = []; + const parsed = new Map(); + for (const [file, text] of manifests) parsed.set(file, JSON.parse(text) as DependencyManifest); + const testKitFile = `${TEST_KIT_DIR}/package.json`; + const testKit = parsed.get(testKitFile); + if (!testKit) return violations; + + const exportKeys = Object.keys((testKit.exports as Record | undefined) ?? {}); + if (exportKeys.length !== 1 || exportKeys[0] !== '.') { + violations.push( + violation( + testKitFile, + `${TEST_KIT_PACKAGE} exports exactly "." (found ${exportKeys.join(', ') || 'none'}): a ` + + `shared helper is a named export of src/index.ts, not a subpath.`, + ), + ); + } + for (const name of workspaceNames(testKit)) { + if (!TEST_KIT_FORBIDDEN_PACKAGE.test(name)) continue; + violations.push( + violation( + testKitFile, + `${TEST_KIT_PACKAGE} depends on '${name}'. A fixture that needs a platform, provider, ` + + `daemon or root module's code is a test of that package and belongs in it.`, + ), + ); + } + const builtOn = new Set(workspaceNames(testKit)); + for (const [file, manifest] of parsed) { + if (!manifest.name || !builtOn.has(manifest.name)) continue; + if (!workspaceNames(manifest).includes(TEST_KIT_PACKAGE)) continue; + violations.push( + violation( + file, + `'${manifest.name}' declares ${TEST_KIT_PACKAGE}, which already depends on it: a ` + + `project-reference cycle. Keep that package's test helpers beside its tests.`, + ), + ); + } + for (const [file, source] of sources) { + if (!file.startsWith(`${TEST_KIT_DIR}/`)) continue; + for (const site of parseImports(source)) { + const escapes = + site.spec.startsWith('.') && + !path.posix.join(path.posix.dirname(file), site.spec).startsWith(`${TEST_KIT_DIR}/`); + if (!escapes && !TEST_KIT_FORBIDDEN_PACKAGE.test(site.spec)) continue; + violations.push({ + rule: PACKAGE_EXPORT_SURFACE_RULE, + file, + line: site.line, + message: + `${TEST_KIT_PACKAGE} imports '${site.spec}'. It may build only on the packages below ` + + `it, never on a platform, provider, daemon or root module.`, + }); + } + } + return violations; +} diff --git a/scripts/mutation/coverage-reporter.test.ts b/scripts/mutation/coverage-reporter.test.ts index dd62b058a0..f0035e65fe 100644 --- a/scripts/mutation/coverage-reporter.test.ts +++ b/scripts/mutation/coverage-reporter.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'node:test'; import { runCmdSync } from '@agent-device/host-kit/command'; import { DryRunStatus } from '@stryker-mutator/api/test-runner'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { COVERAGE_CAPTURE_ENV } from './coverage-reporter.mjs'; const repoRoot = path.resolve(import.meta.dirname, '../..'); diff --git a/scripts/mutation/coverage-scope.test.ts b/scripts/mutation/coverage-scope.test.ts index 95aa1220ea..eff6983259 100644 --- a/scripts/mutation/coverage-scope.test.ts +++ b/scripts/mutation/coverage-scope.test.ts @@ -5,7 +5,7 @@ import { test } from 'node:test'; import { runCmdSync } from '@agent-device/host-kit/command'; import type { DryRunCompletedEvent } from '@stryker-mutator/api/report'; import { DryRunStatus, TestStatus } from '@stryker-mutator/api/test-runner'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { assertCoveragePolicy, coverageScope, diff --git a/scripts/mutation/envelope.test.ts b/scripts/mutation/envelope.test.ts index e11ffb34f4..99f13c7fea 100644 --- a/scripts/mutation/envelope.test.ts +++ b/scripts/mutation/envelope.test.ts @@ -6,7 +6,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { test } from 'node:test'; import { runCmdSync } from '@agent-device/host-kit/command'; import { laneEnvelope, LANE_ENVELOPE_SCHEMA_VERSION } from '../lib/lane-envelope.ts'; diff --git a/scripts/mutation/sharding.test.ts b/scripts/mutation/sharding.test.ts index 2774a87786..c87ae7f636 100644 --- a/scripts/mutation/sharding.test.ts +++ b/scripts/mutation/sharding.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import path from 'node:path'; import { test } from 'node:test'; import { parseSync } from 'oxc-parser'; diff --git a/scripts/mutation/test-scope.test.ts b/scripts/mutation/test-scope.test.ts index 33d4bbe995..8c7f07fb3b 100644 --- a/scripts/mutation/test-scope.test.ts +++ b/scripts/mutation/test-scope.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; import fs from 'node:fs'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { test } from 'node:test'; import { expandMutateFiles, diff --git a/scripts/replays/android-manual.test.ts b/scripts/replays/android-manual.test.ts index 8d831d3d9c..daf205c94f 100644 --- a/scripts/replays/android-manual.test.ts +++ b/scripts/replays/android-manual.test.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { parse } from 'yaml'; import { expect, test } from 'vitest'; import { runCmdSync } from '@agent-device/host-kit/command'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; const pipeline = (serial: string) => [ 'pnpm|gate build', diff --git a/src/__tests__/agent-device-client.test.ts b/src/__tests__/agent-device-client.test.ts index 0f02ee7f62..b46ee65320 100644 --- a/src/__tests__/agent-device-client.test.ts +++ b/src/__tests__/agent-device-client.test.ts @@ -27,7 +27,7 @@ import type { DaemonResponse, DaemonResponseData } from '@agent-device/kernel/co import { AppError } from '@agent-device/kernel/errors'; import fs from 'node:fs'; import nodePath from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createTransport } from './client-transport-fixture.ts'; // #1802: replay/test requests carry the script text the CLIENT read, so these cases need real diff --git a/src/__tests__/android-snapshot-occlusion-context.test.ts b/src/__tests__/android-snapshot-occlusion-context.test.ts index bcd097e5d8..29525e0a8a 100644 --- a/src/__tests__/android-snapshot-occlusion-context.test.ts +++ b/src/__tests__/android-snapshot-occlusion-context.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import { afterEach, test, vi } from 'vitest'; import { readSnapshotOcclusionContextEvidence } from '@agent-device/contracts/capture'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { androidSnapshotPublicationInput, resetAndroidSnapshotHelperInstallCache, diff --git a/src/__tests__/cli-agent-cdp-session.test.ts b/src/__tests__/cli-agent-cdp-session.test.ts index c399ebee38..ad56b4b7c2 100644 --- a/src/__tests__/cli-agent-cdp-session.test.ts +++ b/src/__tests__/cli-agent-cdp-session.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('../cli/commands/agent-cdp.ts', async (importOriginal) => { const actual = await importOriginal(); diff --git a/src/__tests__/cli-auth-diagnostics.test.ts b/src/__tests__/cli-auth-diagnostics.test.ts index 192e567730..1e7f171edc 100644 --- a/src/__tests__/cli-auth-diagnostics.test.ts +++ b/src/__tests__/cli-auth-diagnostics.test.ts @@ -3,7 +3,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('daemon auth tokens are scrubbed from CLI diagnostics and serialized requests', async () => { const home = mkdtempForTestSync('agent-device-auth-diagnostics-'); diff --git a/src/__tests__/cli-capture.ts b/src/__tests__/cli-capture.ts index 255e3e83ba..437bcac5eb 100644 --- a/src/__tests__/cli-capture.ts +++ b/src/__tests__/cli-capture.ts @@ -6,7 +6,7 @@ import type { sendToDaemon, } from '../daemon-client/daemon-client.ts'; import { installIsolatedCliTestEnv } from './cli-test-env.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { beginStderrCapture, beginStdoutCapture } from './test-utils/stream-capture.ts'; class ExitSignal extends Error { diff --git a/src/__tests__/cli-client-commands.test.ts b/src/__tests__/cli-client-commands.test.ts index f5eabef302..fd842ce36a 100644 --- a/src/__tests__/cli-client-commands.test.ts +++ b/src/__tests__/cli-client-commands.test.ts @@ -15,7 +15,7 @@ import type { import type { SettingsUpdateOptions } from '@agent-device/contracts/client'; import { AppError } from '@agent-device/kernel/errors'; import { resolveCliOptions } from '../cli/resolve-cli-options.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createStubClientLeases } from './test-utils/client-lease-fixtures.ts'; import { withCapturedOutput, withCapturedStdoutAsync } from './test-utils/stream-capture.ts'; diff --git a/src/__tests__/cli-config-fixtures.ts b/src/__tests__/cli-config-fixtures.ts index 1da4792d35..bd593f4fbc 100644 --- a/src/__tests__/cli-config-fixtures.ts +++ b/src/__tests__/cli-config-fixtures.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; export function makeTempWorkspace(): { root: string; home: string; project: string } { const root = mkdtempForTestSync('agent-device-config-'); diff --git a/src/__tests__/cli-config-trust.test.ts b/src/__tests__/cli-config-trust.test.ts index e385b0f7af..74de554b02 100644 --- a/src/__tests__/cli-config-trust.test.ts +++ b/src/__tests__/cli-config-trust.test.ts @@ -9,7 +9,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; test('project config rejects remote connection fields before daemon dispatch without echoing values', async () => { const { root, home, project } = makeTempWorkspace(); diff --git a/src/__tests__/cli-debug-symbols.test.ts b/src/__tests__/cli-debug-symbols.test.ts index 3ffa1c0420..1be00298de 100644 --- a/src/__tests__/cli-debug-symbols.test.ts +++ b/src/__tests__/cli-debug-symbols.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'vitest'; import { withCommandExecutorOverride } from '@agent-device/host-kit/command'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; const UUID = 'ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB'; diff --git a/src/__tests__/cli-device-status.test.ts b/src/__tests__/cli-device-status.test.ts index e4954bdf17..bcb8e37dab 100644 --- a/src/__tests__/cli-device-status.test.ts +++ b/src/__tests__/cli-device-status.test.ts @@ -1,15 +1,14 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { test, vi } from 'vitest'; +import { test } from 'vitest'; +import * as hostProcess from '@agent-device/host-kit/process'; import { readCurrentOwnerIdentity } from '@agent-device/host-kit/process'; import { runCliCapture } from './cli-capture.ts'; import { publishDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); test('device status is daemonless and does not send a daemon request', async () => { const result = await runCliCapture(['device', 'status', '--json']); diff --git a/src/__tests__/cli-diagnostics.test.ts b/src/__tests__/cli-diagnostics.test.ts index 6d77f45f89..59401c80a5 100644 --- a/src/__tests__/cli-diagnostics.test.ts +++ b/src/__tests__/cli-diagnostics.test.ts @@ -9,7 +9,7 @@ import { type CapturedCliRun, type CapturedDaemonRequest, } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; async function runCliCapture( argv: string[], diff --git a/src/__tests__/cli-diff.test.ts b/src/__tests__/cli-diff.test.ts index fbd513f45b..32c6252c67 100644 --- a/src/__tests__/cli-diff.test.ts +++ b/src/__tests__/cli-diff.test.ts @@ -11,7 +11,7 @@ import { type CapturedCliRun, type CapturedDaemonRequest, } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type RunCliCaptureOptions = { preserveHome?: boolean; diff --git a/src/__tests__/cli-exit-paths.test.ts b/src/__tests__/cli-exit-paths.test.ts index caa41ac2c0..af8af1d4da 100644 --- a/src/__tests__/cli-exit-paths.test.ts +++ b/src/__tests__/cli-exit-paths.test.ts @@ -14,7 +14,7 @@ import { runWebCommand } from '../cli/commands/web.ts'; import { installIsolatedCliTestEnv } from './cli-test-env.ts'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import type { DaemonResponse } from '../daemon-client/daemon-client.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { beginStderrCapture, beginStdoutCapture } from './test-utils/stream-capture.ts'; afterEach(() => { diff --git a/src/__tests__/cli-network.test.ts b/src/__tests__/cli-network.test.ts index 0b5d91c47c..af178c0772 100644 --- a/src/__tests__/cli-network.test.ts +++ b/src/__tests__/cli-network.test.ts @@ -3,7 +3,7 @@ import assert from 'node:assert/strict'; import nodeFs, { promises as fs } from 'node:fs'; import path from 'node:path'; import { runCliCapture, type CliCaptureOptions } from './cli-capture.ts'; -import { mkdtempForTest, mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest, mkdtempForTestSync } from '@agent-device/test-kit'; /** * #1802: `test ` expands on the CALLER, so these reporter cases need a real suite diff --git a/src/__tests__/cli-react-devtools-session.test.ts b/src/__tests__/cli-react-devtools-session.test.ts index c8b6242fe5..28458d1ee6 100644 --- a/src/__tests__/cli-react-devtools-session.test.ts +++ b/src/__tests__/cli-react-devtools-session.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('../cli/commands/react-devtools.ts', () => ({ runReactDevtoolsCommand: vi.fn(async () => 0), diff --git a/src/__tests__/cli-remote-diagnostics.test.ts b/src/__tests__/cli-remote-diagnostics.test.ts index 3bd3b0e71b..5d4d8d7eb7 100644 --- a/src/__tests__/cli-remote-diagnostics.test.ts +++ b/src/__tests__/cli-remote-diagnostics.test.ts @@ -19,9 +19,9 @@ import { runCliCapture, type CapturedCliRun } from './cli-capture.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; const DAEMON_TOKEN = 'daemon-secret'; const DAEMON_SESSION = 'cwd:abcdef0123456789:default'; diff --git a/src/__tests__/cli-replay-script-sources.test.ts b/src/__tests__/cli-replay-script-sources.test.ts index c566f4cd92..7a28590105 100644 --- a/src/__tests__/cli-replay-script-sources.test.ts +++ b/src/__tests__/cli-replay-script-sources.test.ts @@ -10,7 +10,7 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const REMOTE_DAEMON_ENV = { AGENT_DEVICE_DAEMON_BASE_URL: 'http://remote-mac.example.test:7777/agent-device', diff --git a/src/__tests__/cli-session-state-dir.test.ts b/src/__tests__/cli-session-state-dir.test.ts index 3c55d7b8ce..96e1094a47 100644 --- a/src/__tests__/cli-session-state-dir.test.ts +++ b/src/__tests__/cli-session-state-dir.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('session state-dir prints the resolved source-checkout daemon state dir without daemon startup', async () => { const root = mkdtempForTestSync('agent-device-session-state-dir-'); diff --git a/src/__tests__/cli-test-env.ts b/src/__tests__/cli-test-env.ts index e446ae080e..188ea44d18 100644 --- a/src/__tests__/cli-test-env.ts +++ b/src/__tests__/cli-test-env.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; export function installIsolatedCliTestEnv( explicitEnv: Record = {}, diff --git a/src/__tests__/cli-web.test.ts b/src/__tests__/cli-web.test.ts index 4f87bd4b88..636901ec03 100644 --- a/src/__tests__/cli-web.test.ts +++ b/src/__tests__/cli-web.test.ts @@ -2,12 +2,12 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import { test } from 'vitest'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { installFakeManagedAgentBrowser, + mkdtempForTestSync, withNodeRuntime, writeFakeManagedAgentBrowserPackage, -} from '@agent-device/test-kit/web-managed-agent-browser'; +} from '@agent-device/test-kit'; import { withCommandExecutorOverride } from '@agent-device/host-kit/command'; type SpawnedCommand = { cmd: string; args: readonly string[] }; diff --git a/src/__tests__/client-transport-fixture.ts b/src/__tests__/client-transport-fixture.ts index 01bae99ac3..5e704fbb2d 100644 --- a/src/__tests__/client-transport-fixture.ts +++ b/src/__tests__/client-transport-fixture.ts @@ -1,6 +1,6 @@ import type { AgentDeviceClientConfig } from '../agent-device-client.ts'; import type { DaemonRequest, DaemonResponse } from '@agent-device/kernel/contracts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const TEST_STATE_DIR = mkdtempForTestSync('agent-device-client-test-'); diff --git a/src/__tests__/cloud-connect-auth.test.ts b/src/__tests__/cloud-connect-auth.test.ts index 52cc8d18a9..3ea6e1cf8d 100644 --- a/src/__tests__/cloud-connect-auth.test.ts +++ b/src/__tests__/cloud-connect-auth.test.ts @@ -7,7 +7,7 @@ import { beginStdoutCapture } from './test-utils/stream-capture.ts'; import { resolveCloudAccessForConnect } from '../cli/auth-session.ts'; import { readActiveConnectionState } from '../remote/remote-connection-state.ts'; import type { AgentDeviceClient } from '../agent-device-client.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; afterEach(() => { vi.unstubAllGlobals(); diff --git a/src/__tests__/cloud-connect-profile-fields.test.ts b/src/__tests__/cloud-connect-profile-fields.test.ts index 26c0ebc680..26992d84ff 100644 --- a/src/__tests__/cloud-connect-profile-fields.test.ts +++ b/src/__tests__/cloud-connect-profile-fields.test.ts @@ -6,7 +6,7 @@ import { AppError } from '@agent-device/kernel/errors'; import { resolveConnectProviderProfile } from '../cli/connection/connect-provider-adapters.ts'; import { resolveLimrunConnectProfile } from '../cli/connection/limrun-profile.ts'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('connect limrun refuses profile fields Limrun does not read', async () => { const result = await runCliCapture( diff --git a/src/__tests__/cloud-connect-profile.test.ts b/src/__tests__/cloud-connect-profile.test.ts index 686b0a1333..5e5c47bd13 100644 --- a/src/__tests__/cloud-connect-profile.test.ts +++ b/src/__tests__/cloud-connect-profile.test.ts @@ -20,7 +20,7 @@ import { verifyAwsDeviceFarmConnection, verifyBrowserStackConnection, } from '@agent-device/provider-webdriver/connection-verification'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { connectWithGeneratedProviderProfile } from './test-utils/connect-command.ts'; vi.mock('../cli/auth-session.ts', async (importOriginal) => ({ diff --git a/src/__tests__/cloud-connect-testmu.test.ts b/src/__tests__/cloud-connect-testmu.test.ts index 068ad8ae4a..e6d3a0ac5c 100644 --- a/src/__tests__/cloud-connect-testmu.test.ts +++ b/src/__tests__/cloud-connect-testmu.test.ts @@ -12,11 +12,10 @@ import { verifyTestMuConnection } from '@agent-device/testmu/connection-verifica import testMuPlugin from '@agent-device/testmu'; import { createPluginHost } from '../plugins/host.ts'; import { resolveConnectProviderProfile } from '../cli/connection/connect-provider-adapters.ts'; -import { selectPlugin, pluginHome } from '@agent-device/test-kit/plugin.fixtures'; +import { mkdtempForTestSync, pluginHome, selectPlugin } from '@agent-device/test-kit'; import { installedPlugins } from '../plugins/store.ts'; import manifest from '@agent-device/testmu/package.json' with { type: 'json' }; import type { PluginConnection } from '../plugins/connection.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { connectWithGeneratedProviderProfile } from './test-utils/connect-command.ts'; vi.mock('@agent-device/testmu/connection-verification', () => ({ diff --git a/src/__tests__/contracts/apple-os-resolution.test.ts b/src/__tests__/contracts/apple-os-resolution.test.ts index 470f65b6ea..53399f7d94 100644 --- a/src/__tests__/contracts/apple-os-resolution.test.ts +++ b/src/__tests__/contracts/apple-os-resolution.test.ts @@ -13,7 +13,7 @@ import { MACOS_DEVICE, TVOS_SIMULATOR, VISIONOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; test('resolveDeviceAppleOs prefers the stored discriminant, else infers from target', () => { assert.equal(resolveDeviceAppleOs(IPADOS_SIMULATOR), 'ipados'); diff --git a/src/__tests__/contracts/boundary-fault-matrix.test.ts b/src/__tests__/contracts/boundary-fault-matrix.test.ts index cdb4c487a5..a4a66b93b5 100644 --- a/src/__tests__/contracts/boundary-fault-matrix.test.ts +++ b/src/__tests__/contracts/boundary-fault-matrix.test.ts @@ -4,10 +4,10 @@ import path from 'node:path'; import { test } from 'vitest'; import { BOUNDARY_COMMAND_CLASSES, - BOUNDARY_FAULTS, BOUNDARY_FAULT_MATRIX, + BOUNDARY_FAULTS, type BoundaryCoverage, -} from '@agent-device/test-kit/boundary-fault-matrix'; +} from '@agent-device/test-kit'; test('boundary fault matrix is complete across both declared axes', () => { assert.deepEqual(Object.keys(BOUNDARY_FAULT_MATRIX).sort(), [...BOUNDARY_FAULTS].sort()); diff --git a/src/__tests__/daemon-composition/app-event-delivery.test.ts b/src/__tests__/daemon-composition/app-event-delivery.test.ts index 2ca5afa435..c84810e602 100644 --- a/src/__tests__/daemon-composition/app-event-delivery.test.ts +++ b/src/__tests__/daemon-composition/app-event-delivery.test.ts @@ -10,8 +10,7 @@ import { } from '@agent-device/daemon/testing/app-events'; import { getInteractor } from '../../core/interactors.ts'; import { AppError } from '@agent-device/kernel/errors'; -import { ANDROID_EMULATOR, IOS_DEVICE, MACOS_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { ANDROID_EMULATOR, IOS_DEVICE, MACOS_DEVICE, mkdtempForTest } from '@agent-device/test-kit'; /** * The composed `trigger-app-event` path as R57 left it: the daemon's own policy resolves the diff --git a/src/__tests__/daemon-composition/capture-disclosure.test.ts b/src/__tests__/daemon-composition/capture-disclosure.test.ts index 886851e4a5..05da0cd967 100644 --- a/src/__tests__/daemon-composition/capture-disclosure.test.ts +++ b/src/__tests__/daemon-composition/capture-disclosure.test.ts @@ -37,7 +37,7 @@ vi.mock('@agent-device/daemon/testing/device/device-ready', () => ({ })); import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { withSystemSurfaceDisclosure } from '@agent-device/daemon/testing/capture-disclosure'; import { iosTargetActivationDisclosure } from '@agent-device/contracts/ios-target-activation'; import { TARGET_ACTIVATION_FACT } from '@agent-device/daemon/testing/__tests__/capture-disclosure-target-activation-fact'; diff --git a/src/__tests__/daemon-composition/http-server-limrun-uploaded-apps.test.ts b/src/__tests__/daemon-composition/http-server-limrun-uploaded-apps.test.ts index d42f3b0e43..3ff8eef2ef 100644 --- a/src/__tests__/daemon-composition/http-server-limrun-uploaded-apps.test.ts +++ b/src/__tests__/daemon-composition/http-server-limrun-uploaded-apps.test.ts @@ -8,8 +8,9 @@ import { createTestDeviceInventoryGateways } from '@agent-device/device-selectio import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { limrunTestDependencies } from '../../platform-runtime-gateway.fixtures.ts'; import { @@ -19,7 +20,6 @@ import { import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { createDaemonHttpServer } from '@agent-device/daemon/testing/server/http-server'; import { createRequestHandler } from '@agent-device/daemon/testing/__tests__/test-device-runtime-gateway'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { testCreateCommandSurface } from './command-surface-fixture.ts'; const limrunIo = vi.hoisted(() => ({ diff --git a/src/__tests__/daemon-composition/interaction/interaction-common.test.ts b/src/__tests__/daemon-composition/interaction/interaction-common.test.ts index f659e60046..a29df237a2 100644 --- a/src/__tests__/daemon-composition/interaction/interaction-common.test.ts +++ b/src/__tests__/daemon-composition/interaction/interaction-common.test.ts @@ -12,7 +12,7 @@ import { finalizeTouchInteraction, handleInteractionCommands, } from '@agent-device/daemon/testing/interaction/index'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { getRuntimeBindings, mockFillPoint, diff --git a/src/__tests__/daemon-composition/interaction/interaction-settle.test.ts b/src/__tests__/daemon-composition/interaction/interaction-settle.test.ts index 70433c07a0..ad26ed494e 100644 --- a/src/__tests__/daemon-composition/interaction/interaction-settle.test.ts +++ b/src/__tests__/daemon-composition/interaction/interaction-settle.test.ts @@ -23,7 +23,7 @@ import { clearRequestAbortRegistration, registerRequestAbort, } from '@agent-device/host-kit/request'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { getRuntimeBindings, mockFillPoint, diff --git a/src/__tests__/daemon-composition/interaction/interaction-target-evidence.test.ts b/src/__tests__/daemon-composition/interaction/interaction-target-evidence.test.ts index 57104a230b..bcaf53b4c8 100644 --- a/src/__tests__/daemon-composition/interaction/interaction-target-evidence.test.ts +++ b/src/__tests__/daemon-composition/interaction/interaction-target-evidence.test.ts @@ -13,7 +13,7 @@ import { } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { SessionScriptWriter } from '@agent-device/daemon/testing/session-script-writer'; import type { SessionState } from '@agent-device/daemon/testing/session-state'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { testCreateCommandSurface } from '../command-surface-fixture.ts'; // ADR 0012 decision 3, daemon-routed recording: target-v1 evidence is diff --git a/src/__tests__/daemon-composition/is-runtime.test.ts b/src/__tests__/daemon-composition/is-runtime.test.ts index 7f83e37515..b0d4e5f865 100644 --- a/src/__tests__/daemon-composition/is-runtime.test.ts +++ b/src/__tests__/daemon-composition/is-runtime.test.ts @@ -2,7 +2,7 @@ import { composedPlatformServicesFixture } from './platform-services-fixture.ts' import { afterEach, beforeEach, expect, test, vi } from 'vitest'; import type { SnapshotResult } from '@agent-device/contracts/snapshot-runtime'; import { buildSnapshotPresentationKey } from '@agent-device/kernel/snapshot'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { makeAndroidSession, makeIosAppSession, diff --git a/src/__tests__/daemon-composition/platform-resource-cleanup-snapshot-helper.test.ts b/src/__tests__/daemon-composition/platform-resource-cleanup-snapshot-helper.test.ts index 31efd79fc6..2e8040c49a 100644 --- a/src/__tests__/daemon-composition/platform-resource-cleanup-snapshot-helper.test.ts +++ b/src/__tests__/daemon-composition/platform-resource-cleanup-snapshot-helper.test.ts @@ -12,7 +12,7 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { }; }); -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { platformResourceCleanup } from '../../platform-runtime-resource-cleanup.ts'; beforeEach(() => { diff --git a/src/__tests__/daemon-composition/providers-plugin-routing-parity.test.ts b/src/__tests__/daemon-composition/providers-plugin-routing-parity.test.ts index 3a434e3795..da60815f8e 100644 --- a/src/__tests__/daemon-composition/providers-plugin-routing-parity.test.ts +++ b/src/__tests__/daemon-composition/providers-plugin-routing-parity.test.ts @@ -24,7 +24,7 @@ import { TVOS_SIMULATOR, VISIONOS_SIMULATOR, WEB_DESKTOP_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { makeSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { getPlugin, tryGetPlugin } from '../../core/platform-plugin-registry.ts'; import { registerBuiltinPlatformPlugins } from '../../core/interactors/register-builtins.ts'; diff --git a/src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts b/src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts index 614270d132..a63303d194 100644 --- a/src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts +++ b/src/__tests__/daemon-composition/request-dispatch-disclosure.test.ts @@ -31,7 +31,7 @@ import { makeSession, } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonRequest } from '@agent-device/daemon'; import { discloseRequestDispatch } from '@agent-device/daemon/testing/request-dispatch-disclosure'; import { createRequestDispatchLedger } from '@agent-device/daemon/testing/request-dispatch-ledger'; diff --git a/src/__tests__/daemon-composition/request-handler-chain.test.ts b/src/__tests__/daemon-composition/request-handler-chain.test.ts index 479a7df83d..14f42b640e 100644 --- a/src/__tests__/daemon-composition/request-handler-chain.test.ts +++ b/src/__tests__/daemon-composition/request-handler-chain.test.ts @@ -9,7 +9,7 @@ import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { runRequestHandlerChain } from '@agent-device/daemon/testing/request-handler-chain'; import { getDaemonRouteOwnerFiles } from '@agent-device/command-registry/owner-files'; import type { DaemonRequest } from '@agent-device/daemon'; -import { LINUX_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { LINUX_DEVICE } from '@agent-device/test-kit'; import { makeIosSession, makeSession, diff --git a/src/__tests__/daemon-composition/request-platform-providers.test.ts b/src/__tests__/daemon-composition/request-platform-providers.test.ts index 736db9cb09..9881ec8753 100644 --- a/src/__tests__/daemon-composition/request-platform-providers.test.ts +++ b/src/__tests__/daemon-composition/request-platform-providers.test.ts @@ -5,7 +5,7 @@ import { IOS_SIMULATOR, MACOS_DEVICE, WEB_DESKTOP_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { makeAndroidSession, makeIosSession, diff --git a/src/__tests__/daemon-composition/request-router-android-modal.test.ts b/src/__tests__/daemon-composition/request-router-android-modal.test.ts index a5941a99b6..9b7176b6b1 100644 --- a/src/__tests__/daemon-composition/request-router-android-modal.test.ts +++ b/src/__tests__/daemon-composition/request-router-android-modal.test.ts @@ -30,7 +30,7 @@ import type { ProviderDeviceRuntime } from '@agent-device/contracts/device'; import { makeTestScreenRecordingResource } from '@agent-device/daemon/testing/__tests__/support/screen-recording-live-handle'; import { androidObservation } from '../../platform-runtime.ts'; import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { const actual = await importOriginal(); diff --git a/src/__tests__/daemon-composition/request-router-fill-text-stdin.test.ts b/src/__tests__/daemon-composition/request-router-fill-text-stdin.test.ts index 5433c33582..5da9c6d960 100644 --- a/src/__tests__/daemon-composition/request-router-fill-text-stdin.test.ts +++ b/src/__tests__/daemon-composition/request-router-fill-text-stdin.test.ts @@ -18,8 +18,7 @@ import { makeAuthoringSession, makeSession, } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit'; import { testCreateCommandSurface } from './command-surface-fixture.ts'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; import { diff --git a/src/__tests__/daemon-composition/request-router-lock-policy.test.ts b/src/__tests__/daemon-composition/request-router-lock-policy.test.ts index 338155f05a..a72cda18ba 100644 --- a/src/__tests__/daemon-composition/request-router-lock-policy.test.ts +++ b/src/__tests__/daemon-composition/request-router-lock-policy.test.ts @@ -31,7 +31,7 @@ import { type PlatformRuntimeOperations, snapshotRuntimePlanUses, } from '@agent-device/contracts/platform-runtime-operations'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function snapshotDeviceRuntimeGateway(): DeviceRuntimeGateway { const runtime = snapshotRuntimeFixture(); diff --git a/src/__tests__/daemon-composition/request-router-macos-app-lease.test.ts b/src/__tests__/daemon-composition/request-router-macos-app-lease.test.ts index bd89a67191..7a7c571765 100644 --- a/src/__tests__/daemon-composition/request-router-macos-app-lease.test.ts +++ b/src/__tests__/daemon-composition/request-router-macos-app-lease.test.ts @@ -2,10 +2,9 @@ import type { DaemonResponse } from '@agent-device/kernel/contracts'; import { afterEach, beforeEach, expect, test, vi } from 'vitest'; import path from 'node:path'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { MACOS_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { MACOS_DEVICE, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { makeMacOsSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import type { DaemonRequest } from '@agent-device/daemon'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { createRequestHandler } from '@agent-device/daemon/testing/__tests__/test-device-runtime-gateway'; diff --git a/src/__tests__/daemon-composition/request-router-open-claim-recovery.test.ts b/src/__tests__/daemon-composition/request-router-open-claim-recovery.test.ts index 08fe609a3d..3e23d4b72c 100644 --- a/src/__tests__/daemon-composition/request-router-open-claim-recovery.test.ts +++ b/src/__tests__/daemon-composition/request-router-open-claim-recovery.test.ts @@ -92,7 +92,7 @@ import { makeIosDevice, openRequest, } from '@agent-device/daemon/testing/__tests__/request-router-open-harness'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); const mockDispatch = vi.mocked(dispatchApplicationLifecycleEffect); diff --git a/src/__tests__/daemon-composition/request-router-provider-credentials.test.ts b/src/__tests__/daemon-composition/request-router-provider-credentials.test.ts index 4c7bc35aef..8282701a77 100644 --- a/src/__tests__/daemon-composition/request-router-provider-credentials.test.ts +++ b/src/__tests__/daemon-composition/request-router-provider-credentials.test.ts @@ -2,7 +2,7 @@ import path from 'node:path'; import { expect, test } from 'vitest'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { providerCredentialFingerprint, readDaemonProviderCredentials, diff --git a/src/__tests__/daemon-composition/request-router-record-runtime-lock.test.ts b/src/__tests__/daemon-composition/request-router-record-runtime-lock.test.ts index faaade6e03..6f7046ce43 100644 --- a/src/__tests__/daemon-composition/request-router-record-runtime-lock.test.ts +++ b/src/__tests__/daemon-composition/request-router-record-runtime-lock.test.ts @@ -11,9 +11,11 @@ import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-r import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createTestDeviceInventoryGateways } from '@agent-device/device-selection/inventory-gateways-fixtures'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { + mkdtempForTestSync, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { createPlatformRuntimeGateway } from '../../platform-runtime.ts'; import { createRequestHandler } from '@agent-device/daemon/testing/__tests__/test-device-runtime-gateway'; diff --git a/src/__tests__/daemon-composition/request-router-recording-health.test.ts b/src/__tests__/daemon-composition/request-router-recording-health.test.ts index 7b519ef1fb..363c87248e 100644 --- a/src/__tests__/daemon-composition/request-router-recording-health.test.ts +++ b/src/__tests__/daemon-composition/request-router-recording-health.test.ts @@ -15,7 +15,7 @@ import type { SessionState } from '@agent-device/daemon/testing/session-state'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { makeTestScreenRecordingResource } from '@agent-device/daemon/testing/__tests__/support/screen-recording-live-handle'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; // The observation spy hangs off the port the router composes with (ADR 0019 section 11), not off // the platform module behind it. diff --git a/src/__tests__/daemon-composition/request-router-replay-scope.test.ts b/src/__tests__/daemon-composition/request-router-replay-scope.test.ts index 7e2b7e1d84..f4739f822e 100644 --- a/src/__tests__/daemon-composition/request-router-replay-scope.test.ts +++ b/src/__tests__/daemon-composition/request-router-replay-scope.test.ts @@ -32,7 +32,7 @@ vi.mock('@agent-device/platform-apple/app-resolution', async (importOriginal) => }; }); -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeIosSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; @@ -46,7 +46,6 @@ import { ensureDeviceReady } from '@agent-device/daemon/testing/device/device-re // Readiness is package-owned; hold the open at the fixture's platform-neutral readiness gate. import { awaitFixtureReadiness } from '@agent-device/daemon/testing/__tests__/application-lifecycle-runtime-fixture'; import { createRequestPlatformProviders } from '../../platform-runtime.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; const mockResolveTargetDevice = vi.mocked(getResolveTargetDeviceMock()); const mockEnsureDeviceReady = vi.mocked(ensureDeviceReady); diff --git a/src/__tests__/daemon-composition/request-router-replay-test-ime.test.ts b/src/__tests__/daemon-composition/request-router-replay-test-ime.test.ts index ea1019362b..2c97fa005d 100644 --- a/src/__tests__/daemon-composition/request-router-replay-test-ime.test.ts +++ b/src/__tests__/daemon-composition/request-router-replay-test-ime.test.ts @@ -36,13 +36,12 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { }; }); -import { ANDROID_DEVICE } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_DEVICE, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { replayScriptSourceBundleFor } from '@agent-device/replay-port/replay-script-source-fixtures'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { createRequestHandler } from '@agent-device/daemon/testing/__tests__/test-device-runtime-gateway'; import { realLifecycleDeviceRuntimeGateway } from './lifecycle-runtime-gateway.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; const mockActivateAndroidTestIme = vi.mocked(activateAndroidTestIme); const mockRestoreAndroidTestIme = vi.mocked(restoreAndroidTestIme); diff --git a/src/__tests__/daemon-composition/request-router-screenshot.test.ts b/src/__tests__/daemon-composition/request-router-screenshot.test.ts index 2aa569a0cf..b5e630b730 100644 --- a/src/__tests__/daemon-composition/request-router-screenshot.test.ts +++ b/src/__tests__/daemon-composition/request-router-screenshot.test.ts @@ -28,10 +28,9 @@ import type { SessionState } from '@agent-device/daemon/testing/session-state'; import { LeaseRegistry } from '@agent-device/daemon/testing/lease-registry'; import { attachRefs } from '@agent-device/kernel/snapshot'; import { PNG } from '@agent-device/capture-kit/png'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { makeSession as makeBaseSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; function makeSession(name: string): SessionState { return makeBaseSession(name, { device: ANDROID_EMULATOR }); diff --git a/src/__tests__/daemon-composition/screenshot-runtime.test.ts b/src/__tests__/daemon-composition/screenshot-runtime.test.ts index 975285885c..6cd5db8e8e 100644 --- a/src/__tests__/daemon-composition/screenshot-runtime.test.ts +++ b/src/__tests__/daemon-composition/screenshot-runtime.test.ts @@ -5,7 +5,7 @@ import path from 'node:path'; import { expect, test } from 'vitest'; import { SCREENSHOT_CROP_REASONS } from '@agent-device/contracts/capture'; import type { RawSnapshotNode } from '@agent-device/kernel/snapshot'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import type { GenericPlatformExecutionParams } from '@agent-device/daemon/testing/generic-leaf-execution'; import { resolveScreenshotGenericExecution } from '@agent-device/daemon/testing/screenshot-runtime'; @@ -15,7 +15,6 @@ import { } from '@agent-device/daemon/testing/__tests__/screenshot-runtime-fixture'; import type { DaemonRequest } from '@agent-device/daemon'; import type { SessionState } from '@agent-device/daemon/testing/session-state'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { testCreateCommandSurface } from './command-surface-fixture.ts'; const unavailableCapture = Object.freeze({ diff --git a/src/__tests__/daemon-composition/selector-runtime-ambiguity-issuance.test.ts b/src/__tests__/daemon-composition/selector-runtime-ambiguity-issuance.test.ts index 427b556645..52206ee5a0 100644 --- a/src/__tests__/daemon-composition/selector-runtime-ambiguity-issuance.test.ts +++ b/src/__tests__/daemon-composition/selector-runtime-ambiguity-issuance.test.ts @@ -6,7 +6,7 @@ import { selectorCaptureFixture } from '@agent-device/daemon/testing/__tests__/s import { refFrameScope, refFrameState } from '@agent-device/daemon/testing/ref-frame'; import type { DaemonRequest } from '@agent-device/daemon'; import { dispatchIsViaRuntime } from '@agent-device/daemon/testing/selector-runtime'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { getRuntimeBindings, mockTapPoint, diff --git a/src/__tests__/daemon-composition/selector-runtime-backend.test.ts b/src/__tests__/daemon-composition/selector-runtime-backend.test.ts index 1d9b592f4d..fdb066e063 100644 --- a/src/__tests__/daemon-composition/selector-runtime-backend.test.ts +++ b/src/__tests__/daemon-composition/selector-runtime-backend.test.ts @@ -8,7 +8,7 @@ import type { import { createSelectorRuntimeForDevice } from '@agent-device/daemon/testing/selector-runtime-backend'; import { SessionStore } from '@agent-device/daemon/testing/session-store'; import type { SessionState } from '@agent-device/daemon/testing/session-state'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { testCreateCommandSurface } from './command-surface-fixture.ts'; diff --git a/src/__tests__/daemon-composition/selector-runtime.test.ts b/src/__tests__/daemon-composition/selector-runtime.test.ts index 6f02ef2487..d92f524b19 100644 --- a/src/__tests__/daemon-composition/selector-runtime.test.ts +++ b/src/__tests__/daemon-composition/selector-runtime.test.ts @@ -10,7 +10,7 @@ import { snapshotRuntimeOperationFacts, type SnapshotResult, } from '@agent-device/contracts/snapshot-runtime'; -import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit/runtime-operation-facts'; +import { createUnavailableRuntimeFactsForTest } from '@agent-device/test-kit'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; import { makeSession as makeStoredSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { dispatchGetViaRuntime } from '@agent-device/daemon/testing/selector-runtime'; diff --git a/src/__tests__/daemon-composition/snapshot-quality-latch.test.ts b/src/__tests__/daemon-composition/snapshot-quality-latch.test.ts index 65e2cf663f..a468902b08 100644 --- a/src/__tests__/daemon-composition/snapshot-quality-latch.test.ts +++ b/src/__tests__/daemon-composition/snapshot-quality-latch.test.ts @@ -16,7 +16,7 @@ import { SessionStore } from '@agent-device/daemon/testing/session-store'; import type { SessionState } from '@agent-device/daemon/testing/session-state'; import { legacyDispatchCapture } from '@agent-device/daemon/testing/__tests__/legacy-snapshot-capture-fixture'; import { snapshotRuntimeFixture } from '@agent-device/daemon/testing/__tests__/snapshot-runtime-fixture'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { testCreateCommandSurface } from './command-surface-fixture.ts'; vi.mock('@agent-device/daemon/testing/snapshot-interactor-capture', async () => { diff --git a/src/__tests__/daemon-composition/snapshot-runtime-disclosure.test.ts b/src/__tests__/daemon-composition/snapshot-runtime-disclosure.test.ts index e7c4d0b521..31654f3234 100644 --- a/src/__tests__/daemon-composition/snapshot-runtime-disclosure.test.ts +++ b/src/__tests__/daemon-composition/snapshot-runtime-disclosure.test.ts @@ -9,7 +9,7 @@ import { makeAndroidSession, makeIosSession, } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { SessionStore } from '@agent-device/daemon/testing/session-store'; import { handleSnapshotCommands } from '@agent-device/daemon/testing/handlers/snapshot'; import { legacyDispatchCapture } from '@agent-device/daemon/testing/__tests__/legacy-snapshot-capture-fixture'; diff --git a/src/__tests__/daemon-composition/sparse-fallback-screenshot.test.ts b/src/__tests__/daemon-composition/sparse-fallback-screenshot.test.ts index dba0f71d14..d2ad407e78 100644 --- a/src/__tests__/daemon-composition/sparse-fallback-screenshot.test.ts +++ b/src/__tests__/daemon-composition/sparse-fallback-screenshot.test.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { expect, test } from 'vitest'; import type { SnapshotQualityVerdict } from '@agent-device/kernel/snapshot'; import { makeIosSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { SessionStore } from '@agent-device/daemon/testing/session-store'; import { dispatchSnapshotViaRuntime } from '@agent-device/daemon/testing/snapshot-runtime'; import type { DownloadableArtifactRegistration } from '@agent-device/daemon/testing/artifact-tracking'; diff --git a/src/__tests__/daemon-composition/wait-runtime.test.ts b/src/__tests__/daemon-composition/wait-runtime.test.ts index d0c7e28cc4..461a38d6f8 100644 --- a/src/__tests__/daemon-composition/wait-runtime.test.ts +++ b/src/__tests__/daemon-composition/wait-runtime.test.ts @@ -23,7 +23,7 @@ import { import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { makeSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/src/__tests__/daemon-registration-owner.test.ts b/src/__tests__/daemon-registration-owner.test.ts index 670cfdf180..618a1bd8d5 100644 --- a/src/__tests__/daemon-registration-owner.test.ts +++ b/src/__tests__/daemon-registration-owner.test.ts @@ -20,13 +20,12 @@ import { } from '@agent-device/daemon-contracts/daemon-resolution'; import { readRegisteredDaemonOwnership } from '@agent-device/daemon-contracts/daemon-registration'; import { readDaemonShutdownReport } from '@agent-device/daemon-contracts/daemon-shutdown-report'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, spawnLegacyDaemonFixture } from '@agent-device/test-kit'; import { registeredDaemonFixtureArgs, spawnRegisteredDaemonFixture, finishRegisteredDaemonFixture, } from './test-utils/registered-daemon-fixture.ts'; -import { spawnLegacyDaemonFixture } from '@agent-device/test-kit/legacy-daemon-fixture'; import { ensureDaemon, resolveClientSettings } from '../daemon-client/daemon-client-lifecycle.ts'; import { inspectProcessLock } from '@agent-device/host-kit/file'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/__tests__/install-source.test.ts b/src/__tests__/install-source.test.ts index 324ed67dcf..182f160ad5 100644 --- a/src/__tests__/install-source.test.ts +++ b/src/__tests__/install-source.test.ts @@ -26,7 +26,7 @@ import { import { prepareIosInstallArtifact } from '@agent-device/platform-apple/install-artifact'; import { AppError } from '@agent-device/kernel/errors'; import { ANDROID_INSTALL_SOURCE_CONTRACT_EVIDENCE } from './install-source.coverage.ts'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import * as networkTransport from '@agent-device/provision-kit/install-source-network-transport'; test('validateDownloadSourceUrl rejects localhost and private literal addresses by default', async () => { diff --git a/src/__tests__/kernel/platform-collapse-parity.test.ts b/src/__tests__/kernel/platform-collapse-parity.test.ts index 8265280e00..ce80128667 100644 --- a/src/__tests__/kernel/platform-collapse-parity.test.ts +++ b/src/__tests__/kernel/platform-collapse-parity.test.ts @@ -20,7 +20,7 @@ import { TVOS_SIMULATOR, VISIONOS_SIMULATOR, WEB_DESKTOP_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { readReplayScriptMetadata } from '@agent-device/ad-script'; // Parity gate for the ios/macos -> apple Platform collapse (issue #979, approach b). diff --git a/src/__tests__/kernel/snapshot-ref-grammar.test.ts b/src/__tests__/kernel/snapshot-ref-grammar.test.ts index 18d0a88388..359b0c1116 100644 --- a/src/__tests__/kernel/snapshot-ref-grammar.test.ts +++ b/src/__tests__/kernel/snapshot-ref-grammar.test.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { expect, test } from 'vitest'; -import { formatRef, refArb } from '@agent-device/test-kit/property-arbitraries'; +import { formatRef, refArb } from '@agent-device/test-kit'; import { PROPERTY_RUNS } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { normalizeRef, splitRefGenerationSuffix } from '@agent-device/kernel/snapshot'; diff --git a/src/__tests__/limrun-runtime.test.ts b/src/__tests__/limrun-runtime.test.ts index 77510b0b48..710ceee496 100644 --- a/src/__tests__/limrun-runtime.test.ts +++ b/src/__tests__/limrun-runtime.test.ts @@ -12,7 +12,7 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { runCmd } from '@agent-device/host-kit/command'; import { readVersion } from '@agent-device/host-kit/version'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type LimrunInstancePage = { getPaginatedItems: () => Array<{ metadata: { id: string } }>; diff --git a/src/__tests__/platform-runtime-claim-recovery.test.ts b/src/__tests__/platform-runtime-claim-recovery.test.ts index 8c3c3ba0fc..09d47bb668 100644 --- a/src/__tests__/platform-runtime-claim-recovery.test.ts +++ b/src/__tests__/platform-runtime-claim-recovery.test.ts @@ -3,17 +3,16 @@ import assert from 'node:assert/strict'; import crypto from 'node:crypto'; import fs from 'node:fs'; import path from 'node:path'; -import { test, vi } from 'vitest'; +import { test } from 'vitest'; +import * as hostProcess from '@agent-device/host-kit/process'; import { readCurrentOwnerIdentity } from '@agent-device/host-kit/process'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { runStaleDeviceClaimRelease } from '../platform-runtime-claim-recovery.ts'; import { runCliCapture } from './cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, pinOwnProcessStartTime } from '@agent-device/test-kit'; -vi.mock('@agent-device/host-kit/process', async (importOriginal) => - (await import('@agent-device/test-kit/host-process-mock')).pinOwnProcessStartTime(importOriginal), -); +pinOwnProcessStartTime(hostProcess); function hashedClaimPath(claimsDir: string, deviceKey: string): string { const hash = crypto.createHash('sha256').update(deviceKey).digest('hex'); diff --git a/src/__tests__/platform-runtime-runtime-hints.fixtures.ts b/src/__tests__/platform-runtime-runtime-hints.fixtures.ts index c54b936e7b..50fcea5c4a 100644 --- a/src/__tests__/platform-runtime-runtime-hints.fixtures.ts +++ b/src/__tests__/platform-runtime-runtime-hints.fixtures.ts @@ -1,7 +1,7 @@ import { promises as fs } from 'node:fs'; import path from 'node:path'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; export const LEGACY_PREFS_PATH = 'shared_prefs/ReactNativeDevPrefs.xml'; diff --git a/src/__tests__/provider-device-runtimes.test.ts b/src/__tests__/provider-device-runtimes.test.ts index 75a87e39cf..2d9f0b0b10 100644 --- a/src/__tests__/provider-device-runtimes.test.ts +++ b/src/__tests__/provider-device-runtimes.test.ts @@ -4,11 +4,7 @@ import { createDefaultProviderRuntimeComposition, createDaemonProviderRuntimeComposition, } from '../provider-device-runtimes.ts'; -import { - pluginHome, - selectPlugin, - registrationSource, -} from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, registrationSource, selectPlugin } from '@agent-device/test-kit'; test('daemon composition registers installed provider runtimes and their lazy platform modules', async () => { const { home, env } = pluginHome(); diff --git a/src/__tests__/remote-connection.fixtures.ts b/src/__tests__/remote-connection.fixtures.ts index 22f0207256..b50fcfc597 100644 --- a/src/__tests__/remote-connection.fixtures.ts +++ b/src/__tests__/remote-connection.fixtures.ts @@ -7,7 +7,7 @@ import { writeRemoteConnectionState, type RemoteConnectionState, } from '../remote/remote-connection-state.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; export const unexpectedCommandCall = async (): Promise => { throw new Error('unexpected call'); diff --git a/src/__tests__/runtime-public.test.ts b/src/__tests__/runtime-public.test.ts index 40623ee370..417a9b9403 100644 --- a/src/__tests__/runtime-public.test.ts +++ b/src/__tests__/runtime-public.test.ts @@ -13,7 +13,7 @@ import type { FileInputRef, FileOutputRef, } from '@agent-device/contracts/artifact-adapter'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createMemorySessionStore } from '../command-runtime/runtime-factory.ts'; const backend = { diff --git a/src/__tests__/selectors-build.test.ts b/src/__tests__/selectors-build.test.ts index cf17ab8329..df91dec9c4 100644 --- a/src/__tests__/selectors-build.test.ts +++ b/src/__tests__/selectors-build.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; +import { buildNodes } from '@agent-device/test-kit'; import { computeTargetEvidence } from '@agent-device/selectors/target-evidence'; import { buildSelectorChainForNode } from '@agent-device/selectors'; diff --git a/src/__tests__/test-utils/daemon-http-fixture.ts b/src/__tests__/test-utils/daemon-http-fixture.ts index 1ec97fae7d..0f104b6354 100644 --- a/src/__tests__/test-utils/daemon-http-fixture.ts +++ b/src/__tests__/test-utils/daemon-http-fixture.ts @@ -1,7 +1,7 @@ import http from 'node:http'; import { computeDaemonCodeSignature } from '@agent-device/host-kit/code-signature'; import { resolveDaemonLaunchSpec } from '../../daemon-client/daemon-launch-spec.ts'; -import { listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { listenOnLoopback } from '@agent-device/test-kit'; // A loopback stand-in for a running daemon: answers `GET /health`, echoes `responseData` as the // result of every `POST /rpc`, and records what it was asked, for the daemon-client tests that diff --git a/src/__tests__/test-utils/fake-adb.ts b/src/__tests__/test-utils/fake-adb.ts index 1a10d47102..342c3987b2 100644 --- a/src/__tests__/test-utils/fake-adb.ts +++ b/src/__tests__/test-utils/fake-adb.ts @@ -6,7 +6,7 @@ import { type AndroidAdbExecutorResult, type AndroidAdbProvider, } from '@agent-device/platform-android/mechanics'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import '../../platform-runtime-android-adb-host.ts'; /** diff --git a/src/__tests__/test-utils/registered-daemon-fixture.test.ts b/src/__tests__/test-utils/registered-daemon-fixture.test.ts index cb0d6f38b8..53e4105d83 100644 --- a/src/__tests__/test-utils/registered-daemon-fixture.test.ts +++ b/src/__tests__/test-utils/registered-daemon-fixture.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import { test } from 'vitest'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { stopDaemonProcess } from '@agent-device/daemon-contracts/daemon-process'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { spawnRegisteredDaemonFixture, waitForRegisteredDaemonFixture, diff --git a/src/cli/__tests__/auth-session.test.ts b/src/cli/__tests__/auth-session.test.ts index bd446c1d3a..5cd89a5eab 100644 --- a/src/cli/__tests__/auth-session.test.ts +++ b/src/cli/__tests__/auth-session.test.ts @@ -11,12 +11,12 @@ import { writeCliSession, } from '../auth-session.ts'; import { normalizeError, type NormalizedError } from '@agent-device/kernel/errors'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { + mkdtempForTestSync, recordCommandSpawns, - withMockedPlatform, type RecordedSpawn, -} from '@agent-device/test-kit/host-execution'; + withMockedPlatform, +} from '@agent-device/test-kit'; const baseFlags = { json: false, diff --git a/src/cli/__tests__/browser-launch.test.ts b/src/cli/__tests__/browser-launch.test.ts index ea2ad72ef0..fc46469558 100644 --- a/src/cli/__tests__/browser-launch.test.ts +++ b/src/cli/__tests__/browser-launch.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { isSafeBrowserUrl, openUrlInBrowser } from '../browser-launch.ts'; -import { recordCommandSpawns, withMockedPlatform } from '@agent-device/test-kit/host-execution'; +import { recordCommandSpawns, withMockedPlatform } from '@agent-device/test-kit'; // A verification URI may carry `&`, `^`, and `%` verbatim, which a shell would re-tokenize. const METACHARACTER_URL = 'https://cloud.example/device?user_code=ABCD-EFGH&calc&next=%2Fstart'; diff --git a/src/cli/__tests__/update-check.test.ts b/src/cli/__tests__/update-check.test.ts index ac3fe7adb2..905902c010 100644 --- a/src/cli/__tests__/update-check.test.ts +++ b/src/cli/__tests__/update-check.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { withCapturedStderr, withStreamTty } from '../../__tests__/test-utils/stream-capture.ts'; vi.mock('@agent-device/host-kit/command', () => ({ diff --git a/src/cli/commands/__tests__/auth.test.ts b/src/cli/commands/__tests__/auth.test.ts index c83eb36ab8..4ea5103835 100644 --- a/src/cli/commands/__tests__/auth.test.ts +++ b/src/cli/commands/__tests__/auth.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import { runCliCapture } from '../../../__tests__/cli-capture.ts'; import { writeCliSession } from '../../auth-session.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; afterEach(() => { vi.unstubAllGlobals(); diff --git a/src/cli/commands/__tests__/connection.test.ts b/src/cli/commands/__tests__/connection.test.ts index 67b9bfe42d..627261c589 100644 --- a/src/cli/commands/__tests__/connection.test.ts +++ b/src/cli/commands/__tests__/connection.test.ts @@ -11,7 +11,7 @@ import { writeRemoteConnectionState, type RemoteConnectionState, } from '../../../remote/remote-connection-state.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type ConnectionFixture = { stateDir: string; diff --git a/src/cli/commands/__tests__/daemon.test.ts b/src/cli/commands/__tests__/daemon.test.ts index b5e4b2a265..7012146f17 100644 --- a/src/cli/commands/__tests__/daemon.test.ts +++ b/src/cli/commands/__tests__/daemon.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import { afterEach, expect, test, vi } from 'vitest'; import type { DaemonStopResult } from '@agent-device/daemon-contracts/daemon-stop'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const mocks = vi.hoisted(() => ({ cleanupDaemonOwner: vi.fn(async () => undefined), diff --git a/src/cli/commands/__tests__/generic.test.ts b/src/cli/commands/__tests__/generic.test.ts index f871474ffc..846b552391 100644 --- a/src/cli/commands/__tests__/generic.test.ts +++ b/src/cli/commands/__tests__/generic.test.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { test } from 'vitest'; import assert from 'node:assert/strict'; import { withCapturedStdoutAsync } from '../../../__tests__/test-utils/stream-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createAgentDeviceClient } from '../../../agent-device-client.ts'; import type { DaemonResponse } from '@agent-device/kernel/contracts'; import type { CliFlags } from '@agent-device/contracts/command'; diff --git a/src/cli/commands/__tests__/plugins.test.ts b/src/cli/commands/__tests__/plugins.test.ts index fa9fba17da..b7dc661b41 100644 --- a/src/cli/commands/__tests__/plugins.test.ts +++ b/src/cli/commands/__tests__/plugins.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import { runCli } from '../../../cli.ts'; -import { pluginHome, selectPlugin } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, selectPlugin } from '@agent-device/test-kit'; import { parseRawArgs, usageForCommand } from '../../parser/args.ts'; import { beginStdoutCapture } from '../../../__tests__/test-utils/stream-capture.ts'; diff --git a/src/cli/commands/__tests__/proxy.test.ts b/src/cli/commands/__tests__/proxy.test.ts index db48639a3c..ef33cd29e5 100644 --- a/src/cli/commands/__tests__/proxy.test.ts +++ b/src/cli/commands/__tests__/proxy.test.ts @@ -6,11 +6,11 @@ import assert from 'node:assert/strict'; import http from 'node:http'; import { afterEach, test, vi } from 'vitest'; import { - skipWhenLoopbackUnavailable, closeLoopbackServer, listenOnLoopback, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; + mkdtempForTestSync, + skipWhenLoopbackUnavailable, +} from '@agent-device/test-kit'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; const mocks = vi.hoisted(() => ({ diff --git a/src/cli/commands/__tests__/replay-maestro-export.test.ts b/src/cli/commands/__tests__/replay-maestro-export.test.ts index 886b78cc5f..438434942d 100644 --- a/src/cli/commands/__tests__/replay-maestro-export.test.ts +++ b/src/cli/commands/__tests__/replay-maestro-export.test.ts @@ -11,7 +11,7 @@ import { import { parseReplayScriptDetailed, readReplayScriptMetadata } from '@agent-device/ad-script'; import { projectSelectorExpression } from '@agent-device/selectors'; import { runCliCapture } from '../../../__tests__/cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; describe('exportReplayScriptToMaestro', () => { test.each([ diff --git a/src/cli/commands/connection-context.test.ts b/src/cli/commands/connection-context.test.ts index c24967e25c..a62b0e3408 100644 --- a/src/cli/commands/connection-context.test.ts +++ b/src/cli/commands/connection-context.test.ts @@ -2,7 +2,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { hashRemoteConfigFile, writeRemoteConnectionState, diff --git a/src/cli/connection/provider-policy.test.ts b/src/cli/connection/provider-policy.test.ts index 42b1c5b3ca..1a4805aa43 100644 --- a/src/cli/connection/provider-policy.test.ts +++ b/src/cli/connection/provider-policy.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import { connectionProviderCapabilities, isConnectProviderName } from './provider-policy.ts'; -import { pluginHome, selectPlugin } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, selectPlugin } from '@agent-device/test-kit'; import { installedPlugins } from '../../plugins/store.ts'; test('provider policy projects provider identity into semantic capabilities', () => { diff --git a/src/cli/replay-test/__tests__/reporting.test.ts b/src/cli/replay-test/__tests__/reporting.test.ts index 58d806f59c..e6b29b8a75 100644 --- a/src/cli/replay-test/__tests__/reporting.test.ts +++ b/src/cli/replay-test/__tests__/reporting.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { test } from 'vitest'; import { runCliCapture } from '../../../__tests__/cli-capture.ts'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; test.each([false, true])('CLI refuses a wrapping reporter exit code (json=%s)', async (json) => { const root = await mkdtempForTest('agent-device-reporter-exit-'); diff --git a/src/cli/replay-test/__tests__/session-test-reporter-values-maestro.test.ts b/src/cli/replay-test/__tests__/session-test-reporter-values-maestro.test.ts index aab45ce77d..6d5e8e5413 100644 --- a/src/cli/replay-test/__tests__/session-test-reporter-values-maestro.test.ts +++ b/src/cli/replay-test/__tests__/session-test-reporter-values-maestro.test.ts @@ -52,7 +52,7 @@ import { runReplayTestReporters, } from '../reporters/registry.ts'; import type { ReplayTestReporter, ReplayTestReporterContext } from '../reporters/types.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type RecordedHook = { hook: 'onSuiteStart' | 'onTestStart' | 'onTestStep' | 'onTestResult' | 'onSuiteEnd'; diff --git a/src/cli/replay-test/__tests__/session-test-reporter-values.test.ts b/src/cli/replay-test/__tests__/session-test-reporter-values.test.ts index e790148a7c..798784e648 100644 --- a/src/cli/replay-test/__tests__/session-test-reporter-values.test.ts +++ b/src/cli/replay-test/__tests__/session-test-reporter-values.test.ts @@ -37,7 +37,7 @@ import { runReplayTestReporters, } from '../reporters/registry.ts'; import type { ReplayTestReporter, ReplayTestReporterContext } from '../reporters/types.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; type RecordedHook = { hook: 'onSuiteStart' | 'onTestStart' | 'onTestStep' | 'onTestResult' | 'onSuiteEnd'; diff --git a/src/cli/replay-test/reporters/__tests__/custom.test.ts b/src/cli/replay-test/reporters/__tests__/custom.test.ts index cbf52d00db..32e850fa0e 100644 --- a/src/cli/replay-test/reporters/__tests__/custom.test.ts +++ b/src/cli/replay-test/reporters/__tests__/custom.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; import { createCustomReplayTestReporter } from '../custom.ts'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; test.each([ { diff --git a/src/cli/replay-test/reporters/__tests__/junit.test.ts b/src/cli/replay-test/reporters/__tests__/junit.test.ts index 46c124a082..1474584284 100644 --- a/src/cli/replay-test/reporters/__tests__/junit.test.ts +++ b/src/cli/replay-test/reporters/__tests__/junit.test.ts @@ -7,7 +7,7 @@ import { parseXmlDocumentSync, type XmlNode } from '@agent-device/xml'; import { createJunitReplayTestReporter } from '../junit.ts'; import { renderReplayTestResponse } from '../../reporting.ts'; import type { ReplayTestReporterContext } from '../types.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const context: ReplayTestReporterContext = { stdout: { isTTY: false, write() {} }, diff --git a/src/cli/resolve-cli-options.test.ts b/src/cli/resolve-cli-options.test.ts index 655aabcea3..24fb10785d 100644 --- a/src/cli/resolve-cli-options.test.ts +++ b/src/cli/resolve-cli-options.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { resolveCliOptions } from './resolve-cli-options.ts'; /** diff --git a/src/client/client-companion-tunnel-worker.fixtures.ts b/src/client/client-companion-tunnel-worker.fixtures.ts index fe4f226378..33a96dd7a4 100644 --- a/src/client/client-companion-tunnel-worker.fixtures.ts +++ b/src/client/client-companion-tunnel-worker.fixtures.ts @@ -1,7 +1,7 @@ import crypto from 'node:crypto'; import http from 'node:http'; import type { Duplex } from 'node:stream'; -import { listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { listenOnLoopback } from '@agent-device/test-kit'; /** * Wire-level doubles for the companion tunnel worker (`src/client/client-companion-tunnel-worker.ts`). diff --git a/src/client/client-companion-tunnel-worker.test.ts b/src/client/client-companion-tunnel-worker.test.ts index e619983b33..f2a339ba94 100644 --- a/src/client/client-companion-tunnel-worker.test.ts +++ b/src/client/client-companion-tunnel-worker.test.ts @@ -26,8 +26,7 @@ import { writeSuccessfulRegistration, type CloseFrame, } from './client-companion-tunnel-worker.fixtures.ts'; -import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { closeLoopbackServer, listenOnLoopback, mkdtempForTestSync } from '@agent-device/test-kit'; type Deferred = { promise: Promise; diff --git a/src/commands/batch/cli.test.ts b/src/commands/batch/cli.test.ts index 750847901e..32d6a2e19b 100644 --- a/src/commands/batch/cli.test.ts +++ b/src/commands/batch/cli.test.ts @@ -9,7 +9,7 @@ import { type CapturedDaemonRequest, type CliCaptureOptions, } from '../../__tests__/cli-capture.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import { createBatchCommandMetadata } from './metadata.ts'; diff --git a/src/commands/capture/runtime/diff-screenshot.test.ts b/src/commands/capture/runtime/diff-screenshot.test.ts index e00b3af83c..82bc00128b 100644 --- a/src/commands/capture/runtime/diff-screenshot.test.ts +++ b/src/commands/capture/runtime/diff-screenshot.test.ts @@ -12,7 +12,7 @@ import { createLocalArtifactAdapter } from '../../../io.ts'; import { createAgentDevice } from '../../../runtime.ts'; import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const sessions = { get: () => undefined, diff --git a/src/commands/management/app.test.ts b/src/commands/management/app.test.ts index e76ac08859..f72538de59 100644 --- a/src/commands/management/app.test.ts +++ b/src/commands/management/app.test.ts @@ -10,12 +10,12 @@ import { createAgentDeviceClient } from '../../agent-device-client.ts'; import type { DaemonRequest, DaemonResponse } from '@agent-device/kernel/contracts'; import { readMetroSessionHints, writeMetroSessionHints } from '../../metro/metro-session-hints.ts'; import { openCommandFacet } from './app.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; function flags(overrides: Partial = {}): CliFlags { return overrides as CliFlags; diff --git a/src/commands/management/output.test.ts b/src/commands/management/output.test.ts index b61b75977c..a7044854c4 100644 --- a/src/commands/management/output.test.ts +++ b/src/commands/management/output.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest'; import { doctorCliOutput, managementCliOutputFormatters, openCliOutput } from './output.ts'; -import { withNoColorAsync } from '@agent-device/test-kit/color'; +import { withNoColorAsync } from '@agent-device/test-kit'; import type { AppOpenResult } from '@agent-device/contracts/client'; describe('openCliOutput', () => { diff --git a/src/commands/output/diff.test.ts b/src/commands/output/diff.test.ts index 3a7133e360..d26a7584ad 100644 --- a/src/commands/output/diff.test.ts +++ b/src/commands/output/diff.test.ts @@ -4,7 +4,7 @@ import { stripVTControlCharacters } from 'node:util'; import path from 'node:path'; import { formatScreenshotDiffText, formatSnapshotDiffText } from './diff.ts'; import { normalizedRect } from '@agent-device/kernel/screenshot-geometry'; -import { withNoColor } from '@agent-device/test-kit/color'; +import { withNoColor } from '@agent-device/test-kit'; const DIFF_DATA = { mode: 'snapshot', diff --git a/src/commands/output/snapshot-android.test.ts b/src/commands/output/snapshot-android.test.ts index 097878292d..fc449169e6 100644 --- a/src/commands/output/snapshot-android.test.ts +++ b/src/commands/output/snapshot-android.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { formatSnapshotText } from './snapshot.ts'; -import { withNoColor } from '@agent-device/test-kit/color'; +import { withNoColor } from '@agent-device/test-kit'; test('formatSnapshotText collapses Android helper nodes in agent-facing output', () => { const nodes = [ diff --git a/src/commands/output/snapshot.test.ts b/src/commands/output/snapshot.test.ts index 7aaba201ea..0aeac447a9 100644 --- a/src/commands/output/snapshot.test.ts +++ b/src/commands/output/snapshot.test.ts @@ -2,7 +2,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import { formatSnapshotText } from './snapshot.ts'; import { formatRole, formatSnapshotLine } from '@agent-device/capture-kit/snapshot-lines'; -import { withNoColor } from '@agent-device/test-kit/color'; +import { withNoColor } from '@agent-device/test-kit'; test('formatRole falls back for object prototype role names', () => { assert.equal(formatRole('constructor'), 'constructor'); diff --git a/src/commands/replay/ad-script-round-trip.test.ts b/src/commands/replay/ad-script-round-trip.test.ts index 198a9f07ff..f8c021a830 100644 --- a/src/commands/replay/ad-script-round-trip.test.ts +++ b/src/commands/replay/ad-script-round-trip.test.ts @@ -1,7 +1,7 @@ import fc from 'fast-check'; import { test } from 'vitest'; import assert from 'node:assert/strict'; -import { replayScriptArb } from '@agent-device/test-kit/property-arbitraries'; +import { replayScriptArb } from '@agent-device/test-kit'; import { PROPERTY_RUNS } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { formatPortableActionLine, diff --git a/src/commands/replay/index.test.ts b/src/commands/replay/index.test.ts index bf05263583..9f62bef8c5 100644 --- a/src/commands/replay/index.test.ts +++ b/src/commands/replay/index.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, describe, expect, test } from 'vitest'; import type { CliFlags } from '@agent-device/contracts/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { REPLAY_ONLY_TEST_FLAG_REJECTIONS } from '@agent-device/replay-port/session-replay-test-policy'; import { replayCommandFamily, diff --git a/src/commands/schema/cli-config.test.ts b/src/commands/schema/cli-config.test.ts index 06f7cd0492..fd92c2900f 100644 --- a/src/commands/schema/cli-config.test.ts +++ b/src/commands/schema/cli-config.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { pluginHome } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome } from '@agent-device/test-kit'; import { resolveConfigBackedFlagDefaults } from './cli-config.ts'; test('AGENT_DEVICE_HOME relocates user defaults; project and explicit config cannot select plugins', () => { diff --git a/src/core/__tests__/device.test.ts b/src/core/__tests__/device.test.ts index 32a10e91df..e3a6f37a28 100644 --- a/src/core/__tests__/device.test.ts +++ b/src/core/__tests__/device.test.ts @@ -19,7 +19,7 @@ import { MACOS_DEVICE, TVOS_SIMULATOR, VISIONOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; test('isTvOsDevice selects only the Apple tvOS leaf, not any TV target', () => { diff --git a/src/core/interactors/android-alert-occlusion.test.ts b/src/core/interactors/android-alert-occlusion.test.ts index e69826dce9..cb0485f9d8 100644 --- a/src/core/interactors/android-alert-occlusion.test.ts +++ b/src/core/interactors/android-alert-occlusion.test.ts @@ -11,7 +11,7 @@ vi.mock('@agent-device/platform-android/mechanics', async (importOriginal) => { }); import { pressAndroid, snapshotAndroid } from '@agent-device/platform-android/mechanics'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR } from '@agent-device/test-kit'; import { createAndroidInteractor } from './android.ts'; import { makeAndroidSnapshotCapture } from '@agent-device/platform-android/snapshot-capture-fixtures'; diff --git a/src/core/press-retarget.test.ts b/src/core/press-retarget.test.ts index 56174e6dcf..18e022cdea 100644 --- a/src/core/press-retarget.test.ts +++ b/src/core/press-retarget.test.ts @@ -1,7 +1,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; -import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; +import { buildNodes } from '@agent-device/test-kit'; import { computeTargetEvidence } from '@agent-device/selectors/target-evidence'; import { buildSelectorChainForNode, resolveRecordedTarget } from '@agent-device/selectors'; import { readNodeLocalIdentity } from '@agent-device/ad-script'; diff --git a/src/daemon-client/__tests__/boundary-fault-acceptance.test.ts b/src/daemon-client/__tests__/boundary-fault-acceptance.test.ts index 4a624209a4..7b0e8b5ef5 100644 --- a/src/daemon-client/__tests__/boundary-fault-acceptance.test.ts +++ b/src/daemon-client/__tests__/boundary-fault-acceptance.test.ts @@ -4,8 +4,7 @@ import http from 'node:http'; import path from 'node:path'; import { test } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { assertRejectsAppError } from '@agent-device/test-kit/app-error'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { assertRejectsAppError, mkdtempForTestSync } from '@agent-device/test-kit'; import type { DaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { sendRequest } from '../daemon-client-transport.ts'; diff --git a/src/daemon-client/__tests__/boundary-fault-transport.test.ts b/src/daemon-client/__tests__/boundary-fault-transport.test.ts index 503e3fae83..3025d1fba0 100644 --- a/src/daemon-client/__tests__/boundary-fault-transport.test.ts +++ b/src/daemon-client/__tests__/boundary-fault-transport.test.ts @@ -10,8 +10,8 @@ import { closeLoopbackServer, listenOnLoopback, type LoopbackServer, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; + mkdtempForTestSync, +} from '@agent-device/test-kit'; import type { DaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { sendRequest } from '../daemon-client-transport.ts'; diff --git a/src/daemon-client/__tests__/daemon-client-abort-default-transport.test.ts b/src/daemon-client/__tests__/daemon-client-abort-default-transport.test.ts index 00acdb29fe..3acd92556c 100644 --- a/src/daemon-client/__tests__/daemon-client-abort-default-transport.test.ts +++ b/src/daemon-client/__tests__/daemon-client-abort-default-transport.test.ts @@ -31,11 +31,11 @@ import { currentDaemonCodeSignature } from '../../__tests__/test-utils/daemon-ht import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, + type SkippableTestContext, skipWhenLoopbackUnavailable, trackLoopbackSockets, - type SkippableTestContext, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; type WireInvokeFn = (req: DaemonWireRequest) => Promise; diff --git a/src/daemon-client/__tests__/daemon-client-abort-timeout.test.ts b/src/daemon-client/__tests__/daemon-client-abort-timeout.test.ts index 1ae35cedef..0115b356bb 100644 --- a/src/daemon-client/__tests__/daemon-client-abort-timeout.test.ts +++ b/src/daemon-client/__tests__/daemon-client-abort-timeout.test.ts @@ -24,11 +24,11 @@ import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolu import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, + type SkippableTestContext, skipWhenLoopbackUnavailable, trackLoopbackSockets, - type SkippableTestContext, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; type WireInvokeFn = (req: DaemonWireRequest) => Promise; diff --git a/src/daemon-client/__tests__/daemon-client-abort.test.ts b/src/daemon-client/__tests__/daemon-client-abort.test.ts index 7802705368..f371736cb1 100644 --- a/src/daemon-client/__tests__/daemon-client-abort.test.ts +++ b/src/daemon-client/__tests__/daemon-client-abort.test.ts @@ -21,10 +21,10 @@ import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolu import { closeLoopbackServer, listenOnLoopback, - trackLoopbackSockets, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; + trackLoopbackSockets, +} from '@agent-device/test-kit'; type WireInvokeFn = (req: DaemonWireRequest) => Promise; diff --git a/src/daemon-client/__tests__/daemon-client-developer-dir.test.ts b/src/daemon-client/__tests__/daemon-client-developer-dir.test.ts index 1167cd6415..3785a285e6 100644 --- a/src/daemon-client/__tests__/daemon-client-developer-dir.test.ts +++ b/src/daemon-client/__tests__/daemon-client-developer-dir.test.ts @@ -11,9 +11,9 @@ import { currentDaemonCodeSignature } from '../../__tests__/test-utils/daemon-ht import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, supportsLoopbackBind, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; const DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'; diff --git a/src/daemon-client/__tests__/daemon-client-health-compat.test.ts b/src/daemon-client/__tests__/daemon-client-health-compat.test.ts index 97a46bc7d8..81a5e082dd 100644 --- a/src/daemon-client/__tests__/daemon-client-health-compat.test.ts +++ b/src/daemon-client/__tests__/daemon-client-health-compat.test.ts @@ -7,7 +7,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; /** * ADR 0006 health compatibility across every link a command RPC crosses. `sendToDaemon` diff --git a/src/daemon-client/__tests__/daemon-client-lease-beat.test.ts b/src/daemon-client/__tests__/daemon-client-lease-beat.test.ts index de8193e0c1..6c2881b2b1 100644 --- a/src/daemon-client/__tests__/daemon-client-lease-beat.test.ts +++ b/src/daemon-client/__tests__/daemon-client-lease-beat.test.ts @@ -3,7 +3,7 @@ import { afterEach, describe, test, vi } from 'vitest'; import assert from 'node:assert/strict'; import net from 'node:net'; import { AppError } from '@agent-device/kernel/errors'; -import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { buildLeaseHeartbeatRequest, diff --git a/src/daemon-client/__tests__/daemon-client-lease-header.test.ts b/src/daemon-client/__tests__/daemon-client-lease-header.test.ts index 6a1baf03a4..69ccb90699 100644 --- a/src/daemon-client/__tests__/daemon-client-lease-header.test.ts +++ b/src/daemon-client/__tests__/daemon-client-lease-header.test.ts @@ -13,9 +13,9 @@ import path from 'node:path'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { sendToDaemon } from '../daemon-client.ts'; import { DAEMON_HTTP_LEASE_HEADER } from '@agent-device/contracts/daemon-http'; diff --git a/src/daemon-client/__tests__/daemon-client-lifecycle.test.ts b/src/daemon-client/__tests__/daemon-client-lifecycle.test.ts index 01c75fed2a..02fa06b0e0 100644 --- a/src/daemon-client/__tests__/daemon-client-lifecycle.test.ts +++ b/src/daemon-client/__tests__/daemon-client-lifecycle.test.ts @@ -5,7 +5,12 @@ import http from 'node:http'; import net from 'node:net'; import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + closeLoopbackServer, + listenOnLoopback, + mkdtempForTestSync, + supportsLoopbackBind, +} from '@agent-device/test-kit'; import { spawnRegisteredDaemonFixture, finishRegisteredDaemonFixture, @@ -25,11 +30,6 @@ vi.mock('@agent-device/host-kit/retry', async (importOriginal) => ({ import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import type { DaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { sendToDaemon } from '../daemon-client.ts'; -import { - closeLoopbackServer, - listenOnLoopback, - supportsLoopbackBind, -} from '@agent-device/test-kit/loopback'; import { startHttpDaemonFixture, type HttpDaemonFixture, diff --git a/src/daemon-client/__tests__/daemon-client-liveness-probe.test.ts b/src/daemon-client/__tests__/daemon-client-liveness-probe.test.ts index e09e3d1940..e8f9c246dc 100644 --- a/src/daemon-client/__tests__/daemon-client-liveness-probe.test.ts +++ b/src/daemon-client/__tests__/daemon-client-liveness-probe.test.ts @@ -20,9 +20,9 @@ import { import { closeLoopbackServer, listenOnLoopback, - skipWhenLoopbackUnavailable, type LoopbackServer, -} from '@agent-device/test-kit/loopback'; + skipWhenLoopbackUnavailable, +} from '@agent-device/test-kit'; function daemonInfo(over: { port?: number; httpPort?: number }): { port?: number; diff --git a/src/daemon-client/__tests__/daemon-client-metadata.test.ts b/src/daemon-client/__tests__/daemon-client-metadata.test.ts index c5fb267be9..63554c782e 100644 --- a/src/daemon-client/__tests__/daemon-client-metadata.test.ts +++ b/src/daemon-client/__tests__/daemon-client-metadata.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import type { DaemonCodeOrigin } from '@agent-device/host-kit/code-signature'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { tryAcquireDaemonRegistration } from '@agent-device/daemon-contracts/daemon-registration-owner'; import { readDaemonInfo, type DaemonInfo } from '../daemon-client-metadata.ts'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; diff --git a/src/daemon-client/__tests__/daemon-client-newer-daemon.test.ts b/src/daemon-client/__tests__/daemon-client-newer-daemon.test.ts index b5cb1971df..d50c07e545 100644 --- a/src/daemon-client/__tests__/daemon-client-newer-daemon.test.ts +++ b/src/daemon-client/__tests__/daemon-client-newer-daemon.test.ts @@ -1,7 +1,11 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import { afterEach, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + closeLoopbackServer, + mkdtempForTestSync, + supportsLoopbackBind, +} from '@agent-device/test-kit'; vi.mock('@agent-device/host-kit/command', async (importOriginal) => ({ ...(await importOriginal()), @@ -12,7 +16,6 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => ({ import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { sendToDaemon } from '../daemon-client.ts'; -import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit/loopback'; import { startHttpDaemonFixture } from '../../__tests__/test-utils/daemon-http-fixture.ts'; import { beginStderrCapture } from '../../__tests__/test-utils/stream-capture.ts'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon-client/__tests__/daemon-client-policy-reuse.test.ts b/src/daemon-client/__tests__/daemon-client-policy-reuse.test.ts index e0e8c8ec62..c6c56bfef9 100644 --- a/src/daemon-client/__tests__/daemon-client-policy-reuse.test.ts +++ b/src/daemon-client/__tests__/daemon-client-policy-reuse.test.ts @@ -16,8 +16,11 @@ import { currentDaemonCodeSignature, startHttpDaemonFixture, } from '../../__tests__/test-utils/daemon-http-fixture.ts'; -import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + closeLoopbackServer, + mkdtempForTestSync, + supportsLoopbackBind, +} from '@agent-device/test-kit'; import { loadDaemonPolicy } from '@agent-device/daemon-contracts/daemon-policy-file'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { sendToDaemon } from '../daemon-client.ts'; diff --git a/src/daemon-client/__tests__/daemon-client-provider-credentials.test.ts b/src/daemon-client/__tests__/daemon-client-provider-credentials.test.ts index 96daa7487a..dd0fcb6a26 100644 --- a/src/daemon-client/__tests__/daemon-client-provider-credentials.test.ts +++ b/src/daemon-client/__tests__/daemon-client-provider-credentials.test.ts @@ -12,9 +12,9 @@ import { import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, supportsLoopbackBind, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { providerCredentialFingerprint } from '../../provider-credential-fingerprint.ts'; import { LIMRUN_CREDENTIAL_VARIABLES } from '../../provider-limrun-credentials.ts'; diff --git a/src/daemon-client/__tests__/daemon-client-stalled-probe.test.ts b/src/daemon-client/__tests__/daemon-client-stalled-probe.test.ts index e574c3b02d..210629a59b 100644 --- a/src/daemon-client/__tests__/daemon-client-stalled-probe.test.ts +++ b/src/daemon-client/__tests__/daemon-client-stalled-probe.test.ts @@ -17,9 +17,9 @@ import { sendToDaemon } from '../daemon-client.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, supportsLoopbackBind, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; const NEWER_DAEMON_VERSION = '999.0.0'; diff --git a/src/daemon-client/__tests__/daemon-client-startup-race.test.ts b/src/daemon-client/__tests__/daemon-client-startup-race.test.ts index 5237e30677..6687da63d3 100644 --- a/src/daemon-client/__tests__/daemon-client-startup-race.test.ts +++ b/src/daemon-client/__tests__/daemon-client-startup-race.test.ts @@ -10,7 +10,11 @@ import { readProcessStartTime, } from '@agent-device/host-kit/process'; import { readVersion } from '@agent-device/host-kit/version'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + closeLoopbackServer, + mkdtempForTestSync, + supportsLoopbackBind, +} from '@agent-device/test-kit'; import { spawnRegisteredDaemonFixture, finishRegisteredDaemonFixtures, @@ -19,7 +23,6 @@ import { startHttpDaemonFixture, currentDaemonCodeSignature, } from '../../__tests__/test-utils/daemon-http-fixture.ts'; -import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit/loopback'; import { beginStderrCapture } from '../../__tests__/test-utils/stream-capture.ts'; import { resolveDaemonPaths, diff --git a/src/daemon-client/__tests__/daemon-client-timeout-route.test.ts b/src/daemon-client/__tests__/daemon-client-timeout-route.test.ts index 7ed4e35c46..619a2e2411 100644 --- a/src/daemon-client/__tests__/daemon-client-timeout-route.test.ts +++ b/src/daemon-client/__tests__/daemon-client-timeout-route.test.ts @@ -41,13 +41,13 @@ import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { sendRequest } from '../daemon-client-transport.ts'; import type { DaemonInfo } from '../daemon-client-metadata.ts'; import type { DaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { closeLoopbackServer, listenOnLoopback, - skipWhenLoopbackUnavailable, type LoopbackServer, -} from '@agent-device/test-kit/loopback'; + mkdtempForTestSync, + skipWhenLoopbackUnavailable, +} from '@agent-device/test-kit'; import { spawnRegisteredDaemonFixture, diff --git a/src/daemon-client/__tests__/daemon-client-transport.test.ts b/src/daemon-client/__tests__/daemon-client-transport.test.ts index 3eb937d8b1..54e4b5e6c5 100644 --- a/src/daemon-client/__tests__/daemon-client-transport.test.ts +++ b/src/daemon-client/__tests__/daemon-client-transport.test.ts @@ -4,7 +4,12 @@ import net from 'node:net'; import fs from 'node:fs'; import path from 'node:path'; import { withDiagnosticsScope } from '@agent-device/host-kit/diagnostics'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { + closeLoopbackServer, + listenOnLoopback, + mkdtempForTestSync, + skipWhenLoopbackUnavailable, +} from '@agent-device/test-kit'; import { test, vi } from 'vitest'; import * as hostTransport from '@agent-device/host-kit/transport'; import { sleep } from '@agent-device/host-kit/retry'; @@ -22,11 +27,6 @@ import { } from '../daemon-client-transport.ts'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { createDaemonProxyServer } from '@agent-device/proxy'; -import { - closeLoopbackServer, - listenOnLoopback, - skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; function sendWithStaleInstance(port: number, timeoutMs: number) { return sendRequest( diff --git a/src/daemon-client/__tests__/daemon-client.test.ts b/src/daemon-client/__tests__/daemon-client.test.ts index 6b4eccca35..79e0ac109c 100644 --- a/src/daemon-client/__tests__/daemon-client.test.ts +++ b/src/daemon-client/__tests__/daemon-client.test.ts @@ -9,8 +9,9 @@ import path from 'node:path'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, supportsLoopbackBind, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { beginStderrCapture, withCapturedStderrAsync, @@ -25,7 +26,6 @@ import { canConnectSocket } from '../daemon-client-transport.ts'; import { DAEMON_RPC_PROTOCOL_VERSION } from '@agent-device/contracts/daemon-http'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { readVersion } from '@agent-device/host-kit/version'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; type MockHttpResponse = EventEmitter & { headers?: Record; diff --git a/src/daemon-composition-credentials.test.ts b/src/daemon-composition-credentials.test.ts index af74299a5b..995f5cf9a8 100644 --- a/src/daemon-composition-credentials.test.ts +++ b/src/daemon-composition-credentials.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import { expect, test, vi } from 'vitest'; import { startDaemonRuntime } from '@agent-device/daemon'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createDaemonRuntimeDeps } from './daemon-composition.ts'; import { providerCredentialFingerprint } from './provider-credential-fingerprint.ts'; diff --git a/src/daemon-composition-web-cleanup.test.ts b/src/daemon-composition-web-cleanup.test.ts index 6d06925d78..bb0c9955a7 100644 --- a/src/daemon-composition-web-cleanup.test.ts +++ b/src/daemon-composition-web-cleanup.test.ts @@ -1,8 +1,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import { beforeEach, test, vi } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { installFakeManagedAgentBrowser } from '@agent-device/test-kit/web-managed-agent-browser'; +import { installFakeManagedAgentBrowser, mkdtempForTestSync } from '@agent-device/test-kit'; const { cleanupManagedAgentBrowserOrphansMock } = vi.hoisted(() => ({ cleanupManagedAgentBrowserOrphansMock: vi.fn(), diff --git a/src/daemon-composition.test.ts b/src/daemon-composition.test.ts index 87e350e18e..71435dfea3 100644 --- a/src/daemon-composition.test.ts +++ b/src/daemon-composition.test.ts @@ -1,8 +1,7 @@ import { afterEach, expect, test, vi } from 'vitest'; import type { ProviderDeviceRuntime } from '@agent-device/contracts/device'; import type { Interactor } from '@agent-device/contracts/interactor-types'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { IOS_SIMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import { createDaemonRuntimeDeps } from './daemon-composition.ts'; import { setActiveProviderDeviceRuntimes } from './provider-device-runtime.ts'; diff --git a/src/daemon-entrypoint.test.ts b/src/daemon-entrypoint.test.ts index 74528a9daf..7f543ea4de 100644 --- a/src/daemon-entrypoint.test.ts +++ b/src/daemon-entrypoint.test.ts @@ -22,9 +22,9 @@ import { screenRecordingDurableResource } from '@agent-device/capture-kit/screen import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, waitForHttpOk, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; type DaemonInfoFile = { httpPort?: number; diff --git a/src/mcp/__tests__/command-tools-operator-inputs.test.ts b/src/mcp/__tests__/command-tools-operator-inputs.test.ts index 3912304ea6..934bc80fea 100644 --- a/src/mcp/__tests__/command-tools-operator-inputs.test.ts +++ b/src/mcp/__tests__/command-tools-operator-inputs.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { test, vi } from 'vitest'; import type { AgentDeviceClient } from '../../client/client-types.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createCommandToolExecutor, listCommandTools } from '../command-tools.ts'; // Operator-owned inputs are never model-writable: the model reads untrusted diff --git a/src/mcp/__tests__/command-tools-parity.test.ts b/src/mcp/__tests__/command-tools-parity.test.ts index 68b3883ad3..75fa38b94d 100644 --- a/src/mcp/__tests__/command-tools-parity.test.ts +++ b/src/mcp/__tests__/command-tools-parity.test.ts @@ -9,7 +9,7 @@ import type { CommandExecutionResult } from '../../commands/command-surface.ts'; import { createCommandToolExecutor, listCommandTools } from '../command-tools.ts'; import { COMMAND_OUTPUT_SCHEMAS } from '../command-output-schemas.ts'; import { validateAgainstSchema } from './output-schema-validator.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; afterEach(() => { if (temporaryDirectory) { diff --git a/src/metro/client-metro-auto-companion.test.ts b/src/metro/client-metro-auto-companion.test.ts index a5ea01df04..7dbb26dd3f 100644 --- a/src/metro/client-metro-auto-companion.test.ts +++ b/src/metro/client-metro-auto-companion.test.ts @@ -2,7 +2,7 @@ import { afterEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; vi.mock('./client-metro-companion.ts', () => ({ diff --git a/src/metro/client-metro-companion.test.ts b/src/metro/client-metro-companion.test.ts index 15c7f48f9d..e336e9f260 100644 --- a/src/metro/client-metro-companion.test.ts +++ b/src/metro/client-metro-companion.test.ts @@ -2,7 +2,7 @@ import { afterEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { AppError } from '@agent-device/kernel/errors'; vi.mock('@agent-device/host-kit/command', async (importOriginal) => ({ diff --git a/src/metro/client-metro-startup-cleanup.test.ts b/src/metro/client-metro-startup-cleanup.test.ts index 715c3d8c06..fe1e921666 100644 --- a/src/metro/client-metro-startup-cleanup.test.ts +++ b/src/metro/client-metro-startup-cleanup.test.ts @@ -2,7 +2,7 @@ import { afterEach, test, vi } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { AppError } from '@agent-device/kernel/errors'; vi.mock('@agent-device/host-kit/command', async (importOriginal) => ({ diff --git a/src/metro/client-metro.test.ts b/src/metro/client-metro.test.ts index 9fb47df213..c191615bdd 100644 --- a/src/metro/client-metro.test.ts +++ b/src/metro/client-metro.test.ts @@ -14,8 +14,7 @@ import { readMetroSessionHints } from './metro-session-hints.ts'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { AppError } from '@agent-device/kernel/errors'; import { isProcessAlive, waitForProcessExit } from '@agent-device/host-kit/process'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, listenOnLoopback, mkdtempForTestSync } from '@agent-device/test-kit'; const TEST_TOKEN = 'agent-device-proxy-test-token'; diff --git a/src/metro/metro-session-hints.test.ts b/src/metro/metro-session-hints.test.ts index 1eff8ebd5b..2b14e6b8a7 100644 --- a/src/metro/metro-session-hints.test.ts +++ b/src/metro/metro-session-hints.test.ts @@ -9,7 +9,7 @@ import { readMetroSessionHints, writeMetroSessionHints, } from './metro-session-hints.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; function tempStateDir(): string { const dir = path.join( diff --git a/src/platform-runtime-android-adb-host.test.ts b/src/platform-runtime-android-adb-host.test.ts index 079409026e..84968eb53c 100644 --- a/src/platform-runtime-android-adb-host.test.ts +++ b/src/platform-runtime-android-adb-host.test.ts @@ -11,8 +11,7 @@ import { parseAndroidAdbArgv, runAndroidHostAdb, } from '@agent-device/platform-android/mechanics'; -import { ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { ANDROID_EMULATOR, mkdtempForTestSync } from '@agent-device/test-kit'; import './platform-runtime-android-adb-host.ts'; const UNGUARDED_DEVICE_SHELL = { diff --git a/src/platform-runtime-app-log-output.test.ts b/src/platform-runtime-app-log-output.test.ts index f03608c261..6be7e1f424 100644 --- a/src/platform-runtime-app-log-output.test.ts +++ b/src/platform-runtime-app-log-output.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, expect, test } from 'vitest'; import { openAppLogOutput, readAppLogOutputTail } from './platform-runtime-app-log-output.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const roots: string[] = []; diff --git a/src/platform-runtime-app-log-process.test.ts b/src/platform-runtime-app-log-process.test.ts index 77de4681f5..66ff00862b 100644 --- a/src/platform-runtime-app-log-process.test.ts +++ b/src/platform-runtime-app-log-process.test.ts @@ -28,7 +28,7 @@ import { createManagedAppLogProcesses, recoverLegacyAppLogMarkersAfterDaemonLock, } from './platform-runtime-app-log-process.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const roots: string[] = []; diff --git a/src/platform-runtime-apple-application-tools-close-alerts.test.ts b/src/platform-runtime-apple-application-tools-close-alerts.test.ts index 794bcaa948..6dcbce5673 100644 --- a/src/platform-runtime-apple-application-tools-close-alerts.test.ts +++ b/src/platform-runtime-apple-application-tools-close-alerts.test.ts @@ -1,6 +1,6 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; import { createAppleApplicationTools } from './platform-runtime-apple-application-tools.ts'; const runMacOsAlertAction = vi.hoisted(() => vi.fn()); diff --git a/src/platform-runtime-daemon-lifecycle.test.ts b/src/platform-runtime-daemon-lifecycle.test.ts index d979d2daf5..9de96bb92d 100644 --- a/src/platform-runtime-daemon-lifecycle.test.ts +++ b/src/platform-runtime-daemon-lifecycle.test.ts @@ -2,8 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; import type { ResourceDiagnostic } from '@agent-device/host-kit/diagnostics'; -import { withMockedPlatform } from '@agent-device/test-kit/host-execution'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync, withMockedPlatform } from '@agent-device/test-kit'; const legacyRedirect = vi.hoisted(() => ({ xctestDeviceSetPath: '' })); diff --git a/src/platform-runtime-device-boot.test.ts b/src/platform-runtime-device-boot.test.ts index b9c5fd9f80..9e97e858d0 100644 --- a/src/platform-runtime-device-boot.test.ts +++ b/src/platform-runtime-device-boot.test.ts @@ -17,13 +17,13 @@ vi.mock('@agent-device/platform-android/device-boot', () => mocks); import { ANDROID_EMULATOR, - IPADOS_SIMULATOR, IOS_SIMULATOR, + IPADOS_SIMULATOR, LINUX_DEVICE, MACOS_DEVICE, TVOS_SIMULATOR, VISIONOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +} from '@agent-device/test-kit'; import { deviceBootObservation } from './platform-runtime-device-boot.ts'; beforeEach(() => { diff --git a/src/platform-runtime-device-ready.test.ts b/src/platform-runtime-device-ready.test.ts index a142399149..a101fbf705 100644 --- a/src/platform-runtime-device-ready.test.ts +++ b/src/platform-runtime-device-ready.test.ts @@ -21,12 +21,7 @@ vi.mock('@agent-device/platform-android/mechanics', () => ({ import { runCmd } from '@agent-device/host-kit/command'; import { waitForAndroidBoot } from '@agent-device/platform-android/mechanics'; import { ensureBootedSimulator } from '@agent-device/platform-apple/simulator'; -import { - ANDROID_EMULATOR, - IOS_DEVICE, - IOS_SIMULATOR, - LINUX_DEVICE, -} from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_DEVICE, IOS_SIMULATOR, LINUX_DEVICE } from '@agent-device/test-kit'; import { ensureLocalPlatformDeviceReady } from './platform-runtime-device-ready.ts'; const mockRunCmd = vi.mocked(runCmd); diff --git a/src/platform-runtime-gateway.fixtures.ts b/src/platform-runtime-gateway.fixtures.ts index 35e16b2d67..f8ee366265 100644 --- a/src/platform-runtime-gateway.fixtures.ts +++ b/src/platform-runtime-gateway.fixtures.ts @@ -23,7 +23,7 @@ import { applySimctlSetting } from '@agent-device/platform-apple/simctl-settings import { createUnavailableRuntimeFactsForTest, unavailableDeploymentSnapshotAndShutdownOperationFacts, -} from '@agent-device/test-kit/runtime-operation-facts'; +} from '@agent-device/test-kit'; import { createComposedPlatformRuntimeGateway, type PlatformRuntimeProviderRegistration, diff --git a/src/platform-runtime-host-diagnostics.test.ts b/src/platform-runtime-host-diagnostics.test.ts index d25091b76c..74f5e5b89b 100644 --- a/src/platform-runtime-host-diagnostics.test.ts +++ b/src/platform-runtime-host-diagnostics.test.ts @@ -1,6 +1,6 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { HostDiagnosticsContext } from '@agent-device/contracts/host-diagnostics'; -import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { createHostDiagnostics } from './platform-runtime-host-diagnostics.ts'; const { mockAppleRunnerWarmupCheck } = vi.hoisted(() => ({ diff --git a/src/platform-runtime-network-host.test.ts b/src/platform-runtime-network-host.test.ts index b4899f7ce8..b4364a0c05 100644 --- a/src/platform-runtime-network-host.test.ts +++ b/src/platform-runtime-network-host.test.ts @@ -5,7 +5,7 @@ import path from 'node:path'; import { readRecentNetworkTrafficFromText } from '@agent-device/capture-kit'; import { afterEach, test } from 'vitest'; import { readRecentAppLogLines } from './platform-runtime-network-host.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const temporaryDirectories: string[] = []; diff --git a/src/platform-runtime-perf-capture-host.test.ts b/src/platform-runtime-perf-capture-host.test.ts index fbb89937db..e00dd8f9c3 100644 --- a/src/platform-runtime-perf-capture-host.test.ts +++ b/src/platform-runtime-perf-capture-host.test.ts @@ -11,7 +11,7 @@ import { startAndroidPerfCapture, startApplePerfCapture, } from './platform-runtime-perf-capture-host.ts'; -import { IOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { IOS_SIMULATOR } from '@agent-device/test-kit'; const androidNative = vi.hoisted(() => ({ startAndroidSimpleperfProfile: vi.fn(), diff --git a/src/platform-runtime-resource-cleanup-retention.test.ts b/src/platform-runtime-resource-cleanup-retention.test.ts index 5d6a188d06..a238358c09 100644 --- a/src/platform-runtime-resource-cleanup-retention.test.ts +++ b/src/platform-runtime-resource-cleanup-retention.test.ts @@ -1,10 +1,6 @@ import { expect, test } from 'vitest'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { - ANDROID_EMULATOR, - IOS_DEVICE, - IOS_SIMULATOR, -} from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_DEVICE, IOS_SIMULATOR } from '@agent-device/test-kit'; import { platformResourceCleanup } from './platform-runtime-resource-cleanup.ts'; const PLAIN_CLOSE = { shutdownRequested: false, hasScreenRecording: false, hasLease: false }; diff --git a/src/platform-runtime-resource-cleanup-sessionless-host.test.ts b/src/platform-runtime-resource-cleanup-sessionless-host.test.ts index 842dbf7f0f..083d4631f3 100644 --- a/src/platform-runtime-resource-cleanup-sessionless-host.test.ts +++ b/src/platform-runtime-resource-cleanup-sessionless-host.test.ts @@ -1,5 +1,5 @@ import { beforeEach, expect, test, vi } from 'vitest'; -import { IOS_SIMULATOR, ANDROID_EMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { ANDROID_EMULATOR, IOS_SIMULATOR } from '@agent-device/test-kit'; import { platformResourceCleanup } from './platform-runtime-resource-cleanup.ts'; const { RUNNER_BUNDLE_ID, closeIosApp, stopIosRunnerSession } = vi.hoisted(() => ({ diff --git a/src/platform-runtime-resource-cleanup.test.ts b/src/platform-runtime-resource-cleanup.test.ts index 2f8891f6b6..a991d58d35 100644 --- a/src/platform-runtime-resource-cleanup.test.ts +++ b/src/platform-runtime-resource-cleanup.test.ts @@ -7,9 +7,12 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { import { runCmd } from '@agent-device/host-kit/command'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { ANDROID_EMULATOR, WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { installFakeManagedAgentBrowser } from '@agent-device/test-kit/web-managed-agent-browser'; +import { + ANDROID_EMULATOR, + installFakeManagedAgentBrowser, + mkdtempForTestSync, + WEB_DESKTOP_DEVICE, +} from '@agent-device/test-kit'; import { platformResourceCleanup } from './platform-runtime-resource-cleanup.ts'; const mockRunCmd = vi.mocked(runCmd); diff --git a/src/platform-runtime-screen-recording-apple-simulator-host.test.ts b/src/platform-runtime-screen-recording-apple-simulator-host.test.ts index b8c2931cc2..d9ef8ce026 100644 --- a/src/platform-runtime-screen-recording-apple-simulator-host.test.ts +++ b/src/platform-runtime-screen-recording-apple-simulator-host.test.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, onTestFinished, test, vi } from 'vitest'; import { normalizeError } from '@agent-device/kernel/errors'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createAppleScreenRecordingHost } from './platform-runtime-screen-recording-apple-host.ts'; import { startAppleSimulatorRecording } from './platform-runtime-screen-recording-apple-simulator-host.ts'; import { withAppleSimulatorScreenRecordingTransport } from './platform-runtime-screen-recording-apple-transport.ts'; diff --git a/src/platform-runtime-screen-recording-output-host.test.ts b/src/platform-runtime-screen-recording-output-host.test.ts index fe463a1e48..4128351366 100644 --- a/src/platform-runtime-screen-recording-output-host.test.ts +++ b/src/platform-runtime-screen-recording-output-host.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createScreenRecordingOutputHost } from './platform-runtime-screen-recording-output-host.ts'; test('prepares the closed recording output path after semantic validation', async () => { diff --git a/src/plugins/load.test.ts b/src/plugins/load.test.ts index ae83608b3b..113a1d9e3e 100644 --- a/src/plugins/load.test.ts +++ b/src/plugins/load.test.ts @@ -5,10 +5,10 @@ import { test } from 'vitest'; import { loadProviderPlugins, withPluginConnection } from './load.ts'; import { pluginHome, - selectPlugin, registrationSource, + selectPlugin, webDriverPluginSource, -} from '@agent-device/test-kit/plugin.fixtures'; +} from '@agent-device/test-kit'; import { AppError } from '@agent-device/kernel/errors'; import type { ProviderPluginHost } from '../sdk/plugins.ts'; import type { DeviceLease, ProviderDeviceRuntime } from '@agent-device/contracts/device'; diff --git a/src/plugins/manifest.test.ts b/src/plugins/manifest.test.ts index dfbac3e776..458dbc6a55 100644 --- a/src/plugins/manifest.test.ts +++ b/src/plugins/manifest.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'vitest'; import { readPluginManifest, RESERVED_PLUGIN_PROVIDERS } from './manifest.ts'; import { DEFAULT_PROVIDER_RUNTIME_REQUIRED_IDS } from '../provider-device-runtimes.ts'; -import { pluginHome, writePlugin } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, writePlugin } from '@agent-device/test-kit'; test('manifest compatibility is checked without evaluating plugin code', () => { const { home } = pluginHome(); diff --git a/src/plugins/store.test.ts b/src/plugins/store.test.ts index f111359af3..247fb2ae53 100644 --- a/src/plugins/store.test.ts +++ b/src/plugins/store.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { afterEach, test, vi } from 'vitest'; import { runCmd } from '@agent-device/host-kit/command'; import { changePlugin, installedPlugins, listPlugins } from './store.ts'; -import { pluginHome, writePlugin, selectPlugin } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, selectPlugin, writePlugin } from '@agent-device/test-kit'; vi.mock('@agent-device/host-kit/command', () => ({ runCmd: vi.fn() })); afterEach(() => vi.mocked(runCmd).mockReset()); diff --git a/src/provider-credential-fingerprint.test.ts b/src/provider-credential-fingerprint.test.ts index ef145944f3..3b093b362b 100644 --- a/src/provider-credential-fingerprint.test.ts +++ b/src/provider-credential-fingerprint.test.ts @@ -5,7 +5,7 @@ import { providerCredentialFingerprint, readDaemonProviderCredentials, } from './provider-credential-fingerprint.ts'; -import { pluginHome, selectPluginManifest } from '@agent-device/test-kit/plugin.fixtures'; +import { pluginHome, selectPluginManifest } from '@agent-device/test-kit'; const BROWSERSTACK_ENV = { BROWSERSTACK_USERNAME: 'user', BROWSERSTACK_ACCESS_KEY: 'key-1' }; diff --git a/src/provider-webdriver.test.ts b/src/provider-webdriver.test.ts index 1c304ce408..e048733061 100644 --- a/src/provider-webdriver.test.ts +++ b/src/provider-webdriver.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'vitest'; import { bundledCloudWebDriverProvider } from '@agent-device/provider-webdriver'; import { createBundledCloudWebDriverHost } from './provider-webdriver.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('bundled AWS artifact lookup runs through the host command adapter', async () => { const tempDir = mkdtempForTestSync('agent-device-provider-webdriver-'); diff --git a/src/remote/__tests__/artifact-download.test.ts b/src/remote/__tests__/artifact-download.test.ts index be09ce1a85..4aa361c051 100644 --- a/src/remote/__tests__/artifact-download.test.ts +++ b/src/remote/__tests__/artifact-download.test.ts @@ -7,9 +7,9 @@ import path from 'node:path'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { downloadRemoteArtifactFromUrl } from '../artifact-download.ts'; import { DAEMON_HTTP_LEASE_HEADER } from '@agent-device/contracts/daemon-http'; diff --git a/src/remote/__tests__/remote-config-public.test.ts b/src/remote/__tests__/remote-config-public.test.ts index ac66edea44..f4c7792f80 100644 --- a/src/remote/__tests__/remote-config-public.test.ts +++ b/src/remote/__tests__/remote-config-public.test.ts @@ -4,7 +4,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { resolveRemoteConfigProfile } from '../remote-config.ts'; import { resolveRemoteConfigPath } from '../remote-config-core.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; test('public remote-config helpers resolve file paths and merged profiles', () => { const root = mkdtempForTestSync('agent-device-remote-config-public-'); diff --git a/src/remote/__tests__/remote-connection-state.test.ts b/src/remote/__tests__/remote-connection-state.test.ts index ec9d851dc9..574c1fce3f 100644 --- a/src/remote/__tests__/remote-connection-state.test.ts +++ b/src/remote/__tests__/remote-connection-state.test.ts @@ -3,7 +3,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { narrowConnectionPlatform, buildConnectionDeviceKey, diff --git a/src/remote/__tests__/remote-request-diagnostics.test.ts b/src/remote/__tests__/remote-request-diagnostics.test.ts index 36a19f75f8..891b861d79 100644 --- a/src/remote/__tests__/remote-request-diagnostics.test.ts +++ b/src/remote/__tests__/remote-request-diagnostics.test.ts @@ -8,9 +8,9 @@ import { localizeRemoteDaemonError } from '../remote-request-diagnostics.ts'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; import { DAEMON_HTTP_LEASE_HEADER } from '@agent-device/contracts/daemon-http'; const DAEMON_LOG_PATH = '/Users/daemon-host/.agent-device/sessions/default/requests/abc123.ndjson'; diff --git a/src/remote/__tests__/upload-client-cancellation.test.ts b/src/remote/__tests__/upload-client-cancellation.test.ts index 0b31fdb4a7..4c961d8b64 100644 --- a/src/remote/__tests__/upload-client-cancellation.test.ts +++ b/src/remote/__tests__/upload-client-cancellation.test.ts @@ -14,7 +14,7 @@ import http, { type IncomingMessage, type ServerResponse } from 'node:http'; import path from 'node:path'; import { once } from 'node:events'; import { uploadArtifact } from '../upload-client.ts'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const TEST_TOKEN = 'agent-device-upload-cancel-token'; const tempDirs: string[] = []; diff --git a/src/remote/__tests__/upload-client.test.ts b/src/remote/__tests__/upload-client.test.ts index 3f32a856f3..4d782b0739 100644 --- a/src/remote/__tests__/upload-client.test.ts +++ b/src/remote/__tests__/upload-client.test.ts @@ -7,8 +7,7 @@ import path from 'node:path'; import { uploadArtifact } from '../upload-client.ts'; import type { UploadProgressEvent } from '../upload-progress.ts'; import { runCmdSync, withCommandExecutorOverride } from '@agent-device/host-kit/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; -import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, listenOnLoopback, mkdtempForTestSync } from '@agent-device/test-kit'; import { DAEMON_HTTP_LEASE_HEADER } from '@agent-device/contracts/daemon-http'; const TEST_TOKEN = 'agent-device-upload-test-token'; diff --git a/src/screenshot-diff/__tests__/screenshot-diff.test.ts b/src/screenshot-diff/__tests__/screenshot-diff.test.ts index dd23a7a4cc..cd9a1ec5b7 100644 --- a/src/screenshot-diff/__tests__/screenshot-diff.test.ts +++ b/src/screenshot-diff/__tests__/screenshot-diff.test.ts @@ -2,7 +2,7 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { hasPngSignature, PNG } from '@agent-device/capture-kit/png'; import { compareScreenshots } from '../screenshot-diff.ts'; diff --git a/src/sdk/limrun-download-file.test.ts b/src/sdk/limrun-download-file.test.ts index ad1a9ab690..2d6e03ef90 100644 --- a/src/sdk/limrun-download-file.test.ts +++ b/src/sdk/limrun-download-file.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import type { AddressInfo } from 'node:net'; import { afterEach, expect, test } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { downloadLimrunFile } from './limrun-download-file.ts'; const servers: http.Server[] = []; diff --git a/src/sdk/selectors.test.ts b/src/sdk/selectors.test.ts index 8d8591cbd9..c1465c3629 100644 --- a/src/sdk/selectors.test.ts +++ b/src/sdk/selectors.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { buildNodes } from '@agent-device/test-kit/snapshot-builders'; +import { buildNodes } from '@agent-device/test-kit'; import { findSelectorChainMatch, listSelectorChainMatches, diff --git a/test/integration/daemon-replace-exit-flush.test.ts b/test/integration/daemon-replace-exit-flush.test.ts index c5cfdf8a25..d8cc357e6a 100644 --- a/test/integration/daemon-replace-exit-flush.test.ts +++ b/test/integration/daemon-replace-exit-flush.test.ts @@ -4,7 +4,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { stopDaemonProcess } from '@agent-device/daemon-contracts/daemon-process'; import { isProcessAlive } from '@agent-device/host-kit/process'; import { assertNoDaemonLeaks } from './support/daemon-leak-oracle.ts'; diff --git a/test/integration/installed-package-metro.test.ts b/test/integration/installed-package-metro.test.ts index 0b7b516119..2157a09273 100644 --- a/test/integration/installed-package-metro.test.ts +++ b/test/integration/installed-package-metro.test.ts @@ -7,7 +7,7 @@ import os from 'node:os'; import path from 'node:path'; import type { Duplex } from 'node:stream'; import { fileURLToPath } from 'node:url'; -import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit/loopback'; +import { closeLoopbackServer, listenOnLoopback } from '@agent-device/test-kit'; import { runCmd, runCmdSync } from '@agent-device/host-kit/command'; const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..'); diff --git a/test/integration/live-device-e2e-runtime.test.ts b/test/integration/live-device-e2e-runtime.test.ts index daabb69655..8a092652ce 100644 --- a/test/integration/live-device-e2e-runtime.test.ts +++ b/test/integration/live-device-e2e-runtime.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import type { CliJsonResult } from './cli-json.ts'; import { createLiveDeviceContext, createLiveDeviceHarness } from './live-device-e2e/runtime.ts'; diff --git a/test/integration/provider-scenarios/cloud-webdriver-lease-http.test.ts b/test/integration/provider-scenarios/cloud-webdriver-lease-http.test.ts index cd97ece723..2958fc569a 100644 --- a/test/integration/provider-scenarios/cloud-webdriver-lease-http.test.ts +++ b/test/integration/provider-scenarios/cloud-webdriver-lease-http.test.ts @@ -9,7 +9,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { createProviderScenarioHarness, withProviderScenarioResource } from './harness.ts'; import { CloudWebDriverTestServer, diff --git a/test/integration/provider-scenarios/daemon-http-server.test.ts b/test/integration/provider-scenarios/daemon-http-server.test.ts index 643ff5a46a..aa4b22b579 100644 --- a/test/integration/provider-scenarios/daemon-http-server.test.ts +++ b/test/integration/provider-scenarios/daemon-http-server.test.ts @@ -25,7 +25,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { restoreEnv } from './harness.ts'; type RpcResponse = { diff --git a/test/integration/provider-scenarios/harness.ts b/test/integration/provider-scenarios/harness.ts index 873d2fa790..41efc6bcef 100644 --- a/test/integration/provider-scenarios/harness.ts +++ b/test/integration/provider-scenarios/harness.ts @@ -290,7 +290,7 @@ async function removeProviderScenarioTempDir(dir: string): Promise { } } -export { restoreEnv } from '@agent-device/test-kit/env'; +export { restoreEnv } from '@agent-device/test-kit'; export function likelyPlayableMp4Container(): Buffer { return Buffer.concat([atom('ftyp', Buffer.from('isom0000isom')), atom('moov')]); diff --git a/test/integration/provider-scenarios/ios-alert-settings.test.ts b/test/integration/provider-scenarios/ios-alert-settings.test.ts index e1051f67fb..b56efec39e 100644 --- a/test/integration/provider-scenarios/ios-alert-settings.test.ts +++ b/test/integration/provider-scenarios/ios-alert-settings.test.ts @@ -9,10 +9,12 @@ import { type RuntimeFacts, } from '@agent-device/contracts/platform-runtime'; import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { + createTestAppLogLiveHandle, + unavailableDeploymentSnapshotAndShutdownOperationFacts, +} from '@agent-device/test-kit'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { createTestAppLogLiveHandle } from '@agent-device/test-kit/app-log-live-handle'; import { applePlugin } from '@agent-device/platform-apple'; import type { AlertRuntimeInput } from '@agent-device/contracts/alert-runtime'; import { assertFlatToolCall } from './assertions.ts'; diff --git a/test/integration/provider-scenarios/ios-wait-selector.test.ts b/test/integration/provider-scenarios/ios-wait-selector.test.ts index 3ba5fb188a..12c0452eb5 100644 --- a/test/integration/provider-scenarios/ios-wait-selector.test.ts +++ b/test/integration/provider-scenarios/ios-wait-selector.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { test } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; import { makeIosAppSession } from '@agent-device/daemon/testing/__tests__/support/session-factories'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { PROVIDER_SCENARIO_IOS_SIMULATOR } from './fixtures.ts'; import { assertRpcOk } from './assertions.ts'; import { createProviderScenarioHarness } from './harness.ts'; diff --git a/test/integration/provider-scenarios/limrun-deployment-cancellation.fixtures.ts b/test/integration/provider-scenarios/limrun-deployment-cancellation.fixtures.ts index 3710cbc659..e4238e7f11 100644 --- a/test/integration/provider-scenarios/limrun-deployment-cancellation.fixtures.ts +++ b/test/integration/provider-scenarios/limrun-deployment-cancellation.fixtures.ts @@ -5,7 +5,7 @@ import type { PlatformRuntimeHost } from '@agent-device/contracts/platform-runti import { createLimrunRuntime, type LimrunRuntimeDependencies } from '@agent-device/provider-limrun'; import { limrunTestDependencies } from '../../../src/platform-runtime-gateway.fixtures.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; export type LimrunDeploymentAsset = { signedDownloadUrl: string; md5: string }; diff --git a/test/integration/provider-scenarios/provider-device-runtime.fixtures.ts b/test/integration/provider-scenarios/provider-device-runtime.fixtures.ts index 908eb221ad..af1a15f125 100644 --- a/test/integration/provider-scenarios/provider-device-runtime.fixtures.ts +++ b/test/integration/provider-scenarios/provider-device-runtime.fixtures.ts @@ -45,7 +45,7 @@ import type { PlatformRuntimeProviderModule, } from '@agent-device/contracts/platform-runtime-operations'; import { bindAdmittedProviderInteractorOperations } from '@agent-device/contracts/interactor-operation-catalog'; -import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit/runtime-operation-facts'; +import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '@agent-device/test-kit'; import { deviceShape, hasAppleActionButton, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { createProviderScenarioHarness } from './harness.ts'; diff --git a/test/integration/provider-scenarios/remote-daemon-client.test.ts b/test/integration/provider-scenarios/remote-daemon-client.test.ts index 9e02135dda..f6e0b61ea9 100644 --- a/test/integration/provider-scenarios/remote-daemon-client.test.ts +++ b/test/integration/provider-scenarios/remote-daemon-client.test.ts @@ -12,7 +12,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const NO_CANCELLATION = new AbortController().signal; diff --git a/test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts b/test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts index fc418f33e2..0b41ed7d57 100644 --- a/test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts +++ b/test/integration/provider-scenarios/remote-proxy-artifact-tenant.test.ts @@ -19,7 +19,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const TENANT = 'local-proxy-tenant'; const OTHER_TENANT = 'other-tenant'; diff --git a/test/integration/provider-scenarios/remote-proxy-parity.test.ts b/test/integration/provider-scenarios/remote-proxy-parity.test.ts index b6d065d569..52db7d4b30 100644 --- a/test/integration/provider-scenarios/remote-proxy-parity.test.ts +++ b/test/integration/provider-scenarios/remote-proxy-parity.test.ts @@ -16,7 +16,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { PROVIDER_SCENARIO_IOS_SIMULATOR } from './fixtures.ts'; import { createProviderScenarioHarness, type ProviderScenarioHarness } from './harness.ts'; import { diff --git a/test/integration/provider-scenarios/remote-proxy-request-diagnostics.test.ts b/test/integration/provider-scenarios/remote-proxy-request-diagnostics.test.ts index 428bfe2aeb..41b405f48c 100644 --- a/test/integration/provider-scenarios/remote-proxy-request-diagnostics.test.ts +++ b/test/integration/provider-scenarios/remote-proxy-request-diagnostics.test.ts @@ -25,9 +25,9 @@ import type { DaemonError } from '@agent-device/kernel/errors'; import { closeLoopbackServer, listenOnLoopback, + mkdtempForTestSync, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +} from '@agent-device/test-kit'; const UPSTREAM_TOKEN = 'upstream-token'; const PROXY_TOKEN = 'proxy-token'; diff --git a/test/integration/provider-scenarios/remote-test-artifacts-directory.test.ts b/test/integration/provider-scenarios/remote-test-artifacts-directory.test.ts index f6997bd234..a804213089 100644 --- a/test/integration/provider-scenarios/remote-test-artifacts-directory.test.ts +++ b/test/integration/provider-scenarios/remote-test-artifacts-directory.test.ts @@ -22,7 +22,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const SUITE_INVOCATION_ID = 'cd5f9c01feec8d70'; diff --git a/test/integration/provider-scenarios/remote-test-artifacts-materialization.test.ts b/test/integration/provider-scenarios/remote-test-artifacts-materialization.test.ts index 52a66e4230..b72e6ce24a 100644 --- a/test/integration/provider-scenarios/remote-test-artifacts-materialization.test.ts +++ b/test/integration/provider-scenarios/remote-test-artifacts-materialization.test.ts @@ -20,7 +20,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; const SUITE_INVOCATION_ID = 'cd5f9c01feec8d70'; diff --git a/test/integration/provider-scenarios/remote-upload-lease-beat.test.ts b/test/integration/provider-scenarios/remote-upload-lease-beat.test.ts index 387793407c..84f71ccac8 100644 --- a/test/integration/provider-scenarios/remote-upload-lease-beat.test.ts +++ b/test/integration/provider-scenarios/remote-upload-lease-beat.test.ts @@ -12,7 +12,7 @@ import { withDiagnosticsScope, } from '@agent-device/host-kit/diagnostics'; import { sendToDaemon } from '../../../src/daemon-client/daemon-client.ts'; -import { listenOnLoopback, skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { listenOnLoopback, skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { PARALLEL_PROVIDER_SCENARIO_TIMEOUT_MS } from './test-timeouts.ts'; const LEASE_ID = 'lease-upload-beat'; diff --git a/test/integration/provider-scenarios/stale-provider-runtime-admission.fixtures.ts b/test/integration/provider-scenarios/stale-provider-runtime-admission.fixtures.ts index e89731b810..307e240d79 100644 --- a/test/integration/provider-scenarios/stale-provider-runtime-admission.fixtures.ts +++ b/test/integration/provider-scenarios/stale-provider-runtime-admission.fixtures.ts @@ -14,7 +14,7 @@ import { handleAppDeploymentCommand } from '@agent-device/daemon/testing/handler import { createRequestRuntimeBindings } from '@agent-device/daemon/testing/request-runtime-binding'; import { createRequestDispatchLedger } from '@agent-device/daemon/testing/request-dispatch-ledger'; import { makeSessionStore } from '@agent-device/daemon/testing/__tests__/support/store-factory'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { createComposedPlatformRuntimeGateway } from '../../../src/platform-runtime-gateway.ts'; function createProviderDeploymentAdmission(params: { diff --git a/test/integration/provider-scenarios/web-provider.test.ts b/test/integration/provider-scenarios/web-provider.test.ts index c9816a8094..4e36b4e5db 100644 --- a/test/integration/provider-scenarios/web-provider.test.ts +++ b/test/integration/provider-scenarios/web-provider.test.ts @@ -1,13 +1,13 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { WEB_DESKTOP_DEVICE } from '@agent-device/test-kit/device-fixtures'; -import { createAgentBrowserWebProvider, type WebProvider } from '@agent-device/platform-web'; -import { withCommandExecutorOverride } from '@agent-device/host-kit/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; import { installFakeManagedAgentBrowser, + mkdtempForTestSync, + WEB_DESKTOP_DEVICE, withNodeRuntime, -} from '@agent-device/test-kit/web-managed-agent-browser'; +} from '@agent-device/test-kit'; +import { createAgentBrowserWebProvider, type WebProvider } from '@agent-device/platform-web'; +import { withCommandExecutorOverride } from '@agent-device/host-kit/command'; import { createProviderScenarioHarness } from './harness.ts'; test('web provider is scoped through the request router and dispatch path', async () => { diff --git a/test/integration/provider-scenarios/web-world.ts b/test/integration/provider-scenarios/web-world.ts index 4982919ba1..d1985af0a0 100644 --- a/test/integration/provider-scenarios/web-world.ts +++ b/test/integration/provider-scenarios/web-world.ts @@ -1,5 +1,5 @@ import fs from 'node:fs'; -import { likelyPlayableWebmContainer } from '@agent-device/test-kit/video-fixtures'; +import { likelyPlayableWebmContainer } from '@agent-device/test-kit'; import type { WebProvider } from '@agent-device/platform-web'; import type { RawSnapshotNode } from '@agent-device/kernel/snapshot'; import { validPng } from './assertions.ts'; diff --git a/test/integration/remote-connection-process-isolation.test.ts b/test/integration/remote-connection-process-isolation.test.ts index ad17b23456..ae80659b79 100644 --- a/test/integration/remote-connection-process-isolation.test.ts +++ b/test/integration/remote-connection-process-isolation.test.ts @@ -2,7 +2,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { readRemoteConnectionState } from '../../src/remote/remote-connection-state.ts'; import { runSourceCliJsonSync } from './cli-json.ts'; diff --git a/test/integration/smoke-daemon-clean.test.ts b/test/integration/smoke-daemon-clean.test.ts index 47db7ef495..017c532faf 100644 --- a/test/integration/smoke-daemon-clean.test.ts +++ b/test/integration/smoke-daemon-clean.test.ts @@ -4,7 +4,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { runCmdSync } from '@agent-device/host-kit/command'; import { isProcessAlive, readProcessStartTime } from '@agent-device/host-kit/process'; import { stopAndRetireDaemon } from '@agent-device/daemon-contracts/daemon-registration-owner'; diff --git a/test/integration/smoke-daemon-http.test.ts b/test/integration/smoke-daemon-http.test.ts index aaf6cdb780..dd8028cc5e 100644 --- a/test/integration/smoke-daemon-http.test.ts +++ b/test/integration/smoke-daemon-http.test.ts @@ -5,7 +5,7 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { DAEMON_RPC_PROTOCOL_VERSION } from '@agent-device/contracts/daemon-http'; -import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit/loopback'; +import { skipWhenLoopbackUnavailable } from '@agent-device/test-kit'; import { stopDaemonProcess } from '@agent-device/daemon-contracts/daemon-process'; import { formatResultDebug } from './cli-json.ts'; import { assertNoDaemonLeaks } from './support/daemon-leak-oracle.ts'; diff --git a/test/integration/smoke-ios-runner-status-visible-transport.test.ts b/test/integration/smoke-ios-runner-status-visible-transport.test.ts index 4f8cccc767..f259ba95f2 100644 --- a/test/integration/smoke-ios-runner-status-visible-transport.test.ts +++ b/test/integration/smoke-ios-runner-status-visible-transport.test.ts @@ -5,7 +5,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; type FixtureCommand = { command: 'status' | 'tap' | 'type'; diff --git a/test/integration/smoke-macos-coverage.test.ts b/test/integration/smoke-macos-coverage.test.ts index 967c0a6abd..cd5bbb6215 100644 --- a/test/integration/smoke-macos-coverage.test.ts +++ b/test/integration/smoke-macos-coverage.test.ts @@ -4,7 +4,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertCoverageClassificationSummaryWiredToManifest, diff --git a/test/integration/smoke-open-remote-config.test.ts b/test/integration/smoke-open-remote-config.test.ts index 1b348f4c40..b24a1afb62 100644 --- a/test/integration/smoke-open-remote-config.test.ts +++ b/test/integration/smoke-open-remote-config.test.ts @@ -8,7 +8,7 @@ import { closeLoopbackServer, listenOnLoopback, skipWhenLoopbackUnavailable, -} from '@agent-device/test-kit/loopback'; +} from '@agent-device/test-kit'; import { runCli } from '../../src/cli.ts'; import { beginStderrCapture, diff --git a/test/integration/smoke-tvos-platform-coverage.test.ts b/test/integration/smoke-tvos-platform-coverage.test.ts index fd66ac124d..63d19f261e 100644 --- a/test/integration/smoke-tvos-platform-coverage.test.ts +++ b/test/integration/smoke-tvos-platform-coverage.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; -import { TVOS_SIMULATOR } from '@agent-device/test-kit/device-fixtures'; +import { TVOS_SIMULATOR } from '@agent-device/test-kit'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertCoverageClassificationSummaryWiredToManifest } from './support/coverage-classification.ts'; import { createPlatformRuntimeGateway } from '../../src/platform-runtime.ts'; diff --git a/test/integration/smoke-web-platform-coverage.test.ts b/test/integration/smoke-web-platform-coverage.test.ts index 4cc462ba53..15c41ba2fe 100644 --- a/test/integration/smoke-web-platform-coverage.test.ts +++ b/test/integration/smoke-web-platform-coverage.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; -import { mkdtempForTest } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTest } from '@agent-device/test-kit'; import { PUBLIC_COMMANDS } from '@agent-device/command-registry/catalog'; import { assertCoverageClassificationSummaryWiredToManifest, diff --git a/test/integration/support/daemon-test-cleanup.test.ts b/test/integration/support/daemon-test-cleanup.test.ts index dc8dd12f6f..a7afd8571b 100644 --- a/test/integration/support/daemon-test-cleanup.test.ts +++ b/test/integration/support/daemon-test-cleanup.test.ts @@ -8,7 +8,7 @@ import { import { cleanupDaemonTestState } from './daemon-test-cleanup.ts'; import { resolveDaemonPaths } from '@agent-device/daemon-contracts/daemon-resolution'; import { stopDaemonProcess } from '@agent-device/daemon-contracts/daemon-process'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; import { spawnRegisteredDaemonFixture, waitForRegisteredDaemonFixture, diff --git a/test/repo-guards/apple-runner-package-source.test.ts b/test/repo-guards/apple-runner-package-source.test.ts index dc27bb1aed..a15b085615 100644 --- a/test/repo-guards/apple-runner-package-source.test.ts +++ b/test/repo-guards/apple-runner-package-source.test.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { onTestFinished, test } from 'vitest'; import { runCmd } from '@agent-device/host-kit/command'; -import { mkdtempForTestSync } from '@agent-device/test-kit/tmp-dir'; +import { mkdtempForTestSync } from '@agent-device/test-kit'; const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); const packageScript = path.join(repoRoot, 'scripts', 'package-apple-runner-source.mjs'); From 6eaf3c34328aa74a420bee84d0764b66506d26a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 16:29:39 +0200 Subject: [PATCH 2/5] refactor(layering): derive test-kit's forbidden set from the workspace and walk the graph The isolation check moves to its own module and now takes the forbidden packages from the packages/platform-*, packages/provider-* and packages/daemon directories (so a provider published as @agent-device/testmu is covered), reads optionalDependencies, walks the workspace dependency graph transitively for both forbidden packages and a cycle back to test-kit, and scans test-kit sources with the shared specifierSites walk so vi.mock literals count. Co-Authored-By: Claude Opus 5.5 --- scripts/layering/check.ts | 2 +- .../layering/package-export-surface.test.ts | 120 ----------- scripts/layering/package-export-surface.ts | 102 +--------- scripts/layering/test-kit-isolation.test.ts | 189 ++++++++++++++++++ scripts/layering/test-kit-isolation.ts | 150 ++++++++++++++ 5 files changed, 341 insertions(+), 222 deletions(-) create mode 100644 scripts/layering/test-kit-isolation.test.ts create mode 100644 scripts/layering/test-kit-isolation.ts diff --git a/scripts/layering/check.ts b/scripts/layering/check.ts index 6b7d5753c0..ea33306b2c 100644 --- a/scripts/layering/check.ts +++ b/scripts/layering/check.ts @@ -140,9 +140,9 @@ import { checkDaemonClientEntry } from './daemon-client-entry.ts'; import { checkDaemonProcessReach } from './daemon-process-reach.ts'; import { checkPackageExportSurface, - checkTestKitIsolation, packageExportSurfaceSummary, } from './package-export-surface.ts'; +import { checkTestKitIsolation } from './test-kit-isolation.ts'; import { checkDaemonLayers, DAEMON_ROOT } from './daemon-layers.ts'; import { checkSessionAuthorityOverlay, handlerOwnedOverlay } from './session-authority-overlay.ts'; import { diff --git a/scripts/layering/package-export-surface.test.ts b/scripts/layering/package-export-surface.test.ts index 56450978db..edda04e9f0 100644 --- a/scripts/layering/package-export-surface.test.ts +++ b/scripts/layering/package-export-surface.test.ts @@ -12,7 +12,6 @@ import { } from './package-boundaries.ts'; import { checkPackageExportSurface, - checkTestKitIsolation, expandExportTarget, isTestOnlyExport, isTestOnlyExportSpecifier, @@ -340,122 +339,3 @@ test('a production subpath of the same package stays importable from production assert.deepEqual(refusals(file, '@agent-device/owner'), [], file); } }); - -function kitManifests(overrides: { - kit?: Record; - kernel?: Record; -}): Map { - return new Map([ - [ - 'packages/test-kit/package.json', - JSON.stringify({ - name: '@agent-device/test-kit', - exports: { '.': entry('./src/index.ts') }, - dependencies: { '@agent-device/kernel': 'workspace:*' }, - ...overrides.kit, - }), - ], - [ - 'packages/kernel/package.json', - JSON.stringify({ - name: '@agent-device/kernel', - exports: { '.': entry('./src/index.ts') }, - ...overrides.kernel, - }), - ], - ]); -} - -const KIT_SOURCE = new Map([ - ['packages/test-kit/src/index.ts', "export { a } from './a.ts';"], - ['packages/test-kit/src/a.ts', "import { x } from '@agent-device/kernel/errors';"], -]); - -test('the test-kit shape holds: one entry, built only on packages below it', () => { - assert.deepEqual(checkTestKitIsolation(kitManifests({}), KIT_SOURCE), []); -}); - -test('test-kit exports exactly "." and nothing else', () => { - const extra = checkTestKitIsolation( - kitManifests({ - kit: { exports: { '.': entry('./src/index.ts'), './tmp-dir': entry('./src/tmp-dir.ts') } }, - }), - KIT_SOURCE, - ); - assert.equal(extra.length, 1); - assert.match(extra[0]!.message, /exports exactly "\."/); - assert.equal( - checkTestKitIsolation( - kitManifests({ kit: { exports: { './tmp-dir': entry('./x.ts') } } }), - KIT_SOURCE, - ).length, - 1, - ); -}); - -test('test-kit may not depend on a platform, provider, daemon or root package', () => { - for (const name of [ - '@agent-device/platform-apple', - '@agent-device/provider-limrun', - '@agent-device/daemon', - 'agent-device', - ]) { - for (const field of ['dependencies', 'devDependencies', 'peerDependencies']) { - const found = checkTestKitIsolation( - kitManifests({ kit: { [field]: { [name]: 'workspace:*' } } }), - KIT_SOURCE, - ); - assert.equal(found.length, 1, `${name} in ${field}`); - assert.match(found[0]!.message, /belongs in it/); - } - } -}); - -test('test-kit may not import a platform, provider, daemon or root module, or reach out of its directory', () => { - for (const spec of [ - '@agent-device/platform-android', - '@agent-device/platform-apple/runner', - '@agent-device/provider-testmu/connection', - '@agent-device/daemon/testing/context', - '@agent-device/daemon', - 'agent-device/commands', - '../../../src/platform-runtime-gateway.ts', - '../../kernel/src/errors.ts', - ]) { - const found = checkTestKitIsolation( - kitManifests({}), - new Map([['packages/test-kit/src/a.ts', `import { x } from '${spec}';`]]), - ); - assert.equal(found.length, 1, spec); - assert.equal(found[0]!.file, 'packages/test-kit/src/a.ts'); - } - // A sibling inside its own directory, and a lookalike package name, are fine. - assert.deepEqual( - checkTestKitIsolation( - kitManifests({}), - new Map([ - [ - 'packages/test-kit/src/a.ts', - "import { b } from './b.ts';\nimport { c } from '@agent-device/daemon-contracts/device-claims';", - ], - ]), - ), - [], - ); -}); - -test('a package test-kit builds on cannot declare test-kit: that is a reference cycle', () => { - for (const field of ['dependencies', 'devDependencies']) { - const found = checkTestKitIsolation( - kitManifests({ kernel: { [field]: { '@agent-device/test-kit': 'workspace:*' } } }), - KIT_SOURCE, - ); - assert.equal(found.length, 1, field); - assert.equal(found[0]!.file, 'packages/kernel/package.json'); - assert.match(found[0]!.message, /project-reference cycle/); - } -}); - -test('a repo without a test-kit package has nothing to isolate', () => { - assert.deepEqual(checkTestKitIsolation(new Map(), new Map()), []); -}); diff --git a/scripts/layering/package-export-surface.ts b/scripts/layering/package-export-surface.ts index 2ed60d2552..f7455b49d7 100644 --- a/scripts/layering/package-export-surface.ts +++ b/scripts/layering/package-export-surface.ts @@ -20,8 +20,7 @@ // fixture. `@agent-device/test-kit` is the one package exempt from the export check. "Production // source" is `isProductionSourceFile` in `tracked-sources.ts`. -import path from 'node:path'; -import { parseImports, resolveWorkspaceSpecifier, type LayeringViolation } from './model.ts'; +import { resolveWorkspaceSpecifier, type LayeringViolation } from './model.ts'; import { isProductionSourceFile } from './tracked-sources.ts'; export const PACKAGE_EXPORT_SURFACE_RULE = 'R83 package-export-surface'; @@ -285,102 +284,3 @@ export function testOnlyImportMessage( `package's production subpath or inject the port.` ); } - -function violation(file: string, message: string): LayeringViolation { - return { rule: PACKAGE_EXPORT_SURFACE_RULE, file, line: 1, message }; -} - -/** - * Packages test-kit may not depend on, import or reach: a platform or provider package, the - * daemon, or the root package. A fixture that needs one of those packages' code is a test of that - * package and belongs in it. - */ -const TEST_KIT_FORBIDDEN_PACKAGE = - /^(?:@agent-device\/(?:platform-[^/]+|provider-[^/]+|daemon)|agent-device)(?:\/|$)/; - -const TEST_KIT_DIR = 'packages/test-kit'; - -type DependencyManifest = { - name?: string; - exports?: unknown; - dependencies?: Record; - devDependencies?: Record; - peerDependencies?: Record; -}; - -function workspaceNames(manifest: DependencyManifest): string[] { - return [ - ...Object.keys(manifest.dependencies ?? {}), - ...Object.keys(manifest.devDependencies ?? {}), - ...Object.keys(manifest.peerDependencies ?? {}), - ]; -} - -/** - * The shape of the one shared test package: a single `.` entry, no dependency on or import of a - * platform, provider, daemon or root module, no relative reach out of its directory, and no - * dependency cycle through the packages it builds on (a package test-kit depends on cannot declare - * test-kit: project references are acyclic, so its tests keep their helpers local). - */ -export function checkTestKitIsolation( - manifests: ReadonlyMap, - sources: ReadonlyMap, -): LayeringViolation[] { - const violations: LayeringViolation[] = []; - const parsed = new Map(); - for (const [file, text] of manifests) parsed.set(file, JSON.parse(text) as DependencyManifest); - const testKitFile = `${TEST_KIT_DIR}/package.json`; - const testKit = parsed.get(testKitFile); - if (!testKit) return violations; - - const exportKeys = Object.keys((testKit.exports as Record | undefined) ?? {}); - if (exportKeys.length !== 1 || exportKeys[0] !== '.') { - violations.push( - violation( - testKitFile, - `${TEST_KIT_PACKAGE} exports exactly "." (found ${exportKeys.join(', ') || 'none'}): a ` + - `shared helper is a named export of src/index.ts, not a subpath.`, - ), - ); - } - for (const name of workspaceNames(testKit)) { - if (!TEST_KIT_FORBIDDEN_PACKAGE.test(name)) continue; - violations.push( - violation( - testKitFile, - `${TEST_KIT_PACKAGE} depends on '${name}'. A fixture that needs a platform, provider, ` + - `daemon or root module's code is a test of that package and belongs in it.`, - ), - ); - } - const builtOn = new Set(workspaceNames(testKit)); - for (const [file, manifest] of parsed) { - if (!manifest.name || !builtOn.has(manifest.name)) continue; - if (!workspaceNames(manifest).includes(TEST_KIT_PACKAGE)) continue; - violations.push( - violation( - file, - `'${manifest.name}' declares ${TEST_KIT_PACKAGE}, which already depends on it: a ` + - `project-reference cycle. Keep that package's test helpers beside its tests.`, - ), - ); - } - for (const [file, source] of sources) { - if (!file.startsWith(`${TEST_KIT_DIR}/`)) continue; - for (const site of parseImports(source)) { - const escapes = - site.spec.startsWith('.') && - !path.posix.join(path.posix.dirname(file), site.spec).startsWith(`${TEST_KIT_DIR}/`); - if (!escapes && !TEST_KIT_FORBIDDEN_PACKAGE.test(site.spec)) continue; - violations.push({ - rule: PACKAGE_EXPORT_SURFACE_RULE, - file, - line: site.line, - message: - `${TEST_KIT_PACKAGE} imports '${site.spec}'. It may build only on the packages below ` + - `it, never on a platform, provider, daemon or root module.`, - }); - } - } - return violations; -} diff --git a/scripts/layering/test-kit-isolation.test.ts b/scripts/layering/test-kit-isolation.test.ts new file mode 100644 index 0000000000..81b4874ce0 --- /dev/null +++ b/scripts/layering/test-kit-isolation.test.ts @@ -0,0 +1,189 @@ +// The shape of test-kit (R83): one entry, built only on packages below its consumers, no platform, +// provider, daemon or root package reached directly or transitively, and no package it reaches +// declaring it back. + +import assert from 'node:assert/strict'; +import { test } from 'node:test'; +import { checkTestKitIsolation } from './test-kit-isolation.ts'; + +type Manifest = Record; + +function entry(target: string) { + return { types: target, default: target }; +} + +/** A workspace of manifests keyed by package directory name; test-kit builds on kernel. */ +function workspace(overrides: Record = {}): Map { + const base: Record = { + 'test-kit': { + name: '@agent-device/test-kit', + exports: { '.': entry('./src/index.ts') }, + dependencies: { '@agent-device/kernel': 'workspace:*' }, + }, + kernel: { name: '@agent-device/kernel', exports: { '.': entry('./src/index.ts') } }, + 'platform-android': { name: '@agent-device/platform-android' }, + 'platform-apple': { name: '@agent-device/platform-apple' }, + 'provider-testmu': { name: '@agent-device/testmu' }, + 'provider-limrun': { name: '@agent-device/provider-limrun' }, + daemon: { name: '@agent-device/daemon' }, + proxy: { name: '@agent-device/proxy' }, + contracts: { name: '@agent-device/contracts' }, + }; + const merged: Record = { ...base }; + for (const [dir, manifest] of Object.entries(overrides)) { + merged[dir] = { ...base[dir], ...manifest }; + } + return new Map( + Object.entries(merged).map(([dir, manifest]) => [ + `packages/${dir}/package.json`, + JSON.stringify(manifest), + ]), + ); +} + +const SOURCE = new Map([ + ['packages/test-kit/src/index.ts', "export { a } from './a.ts';"], + ['packages/test-kit/src/a.ts', "import { x } from '@agent-device/kernel/errors';"], +]); + +function check(overrides: Record = {}, sources = SOURCE) { + return checkTestKitIsolation(workspace(overrides), sources); +} + +test('the test-kit shape holds: one entry, built only on packages below it', () => { + assert.deepEqual(check(), []); +}); + +test('test-kit exports exactly "." and nothing else', () => { + const extra = check({ + 'test-kit': { exports: { '.': entry('./src/index.ts'), './tmp-dir': entry('./src/x.ts') } }, + }); + assert.equal(extra.length, 1); + assert.match(extra[0]!.message, /exports exactly "\."/); + assert.equal(check({ 'test-kit': { exports: { './tmp-dir': entry('./x.ts') } } }).length, 1); +}); + +test('test-kit may not depend on a platform, provider, daemon or root package, in any field', () => { + for (const name of [ + '@agent-device/platform-apple', + '@agent-device/provider-limrun', + '@agent-device/testmu', + '@agent-device/daemon', + 'agent-device', + ]) { + for (const field of [ + 'dependencies', + 'devDependencies', + 'optionalDependencies', + 'peerDependencies', + ]) { + const found = check({ 'test-kit': { [field]: { [name]: 'workspace:*' } } }); + assert.equal(found.length, 1, `${name} in ${field}`); + assert.match(found[0]!.message, /belongs in it/); + } + } +}); + +test('a provider published under a non-provider name is forbidden by its directory', () => { + const found = check({ + 'test-kit': { dependencies: { '@agent-device/testmu': 'workspace:*' } }, + }); + assert.equal(found.length, 1); + assert.match(found[0]!.message, /test-kit -> @agent-device\/testmu/); + // A lookalike name outside those directories is an ordinary package. + assert.deepEqual( + check({ 'test-kit': { dependencies: { '@agent-device/proxy': 'workspace:*' } } }), + [], + ); +}); + +test('a forbidden package reached through another package is refused with its path', () => { + const found = check({ + kernel: { dependencies: { '@agent-device/contracts': 'workspace:*' } }, + contracts: { optionalDependencies: { '@agent-device/platform-apple': 'workspace:*' } }, + }); + assert.equal(found.length, 1); + assert.match( + found[0]!.message, + /test-kit -> @agent-device\/kernel -> @agent-device\/contracts -> @agent-device\/platform-apple/, + ); +}); + +test('a package test-kit reaches directly or transitively cannot declare test-kit', () => { + const direct = check({ + kernel: { devDependencies: { '@agent-device/test-kit': 'workspace:*' } }, + }); + assert.equal(direct.length, 1); + assert.equal(direct[0]!.file, 'packages/kernel/package.json'); + assert.match(direct[0]!.message, /project-reference cycle/); + + const transitive = check({ + kernel: { dependencies: { '@agent-device/contracts': 'workspace:*' } }, + contracts: { optionalDependencies: { '@agent-device/test-kit': 'workspace:*' } }, + }); + assert.equal(transitive.length, 1); + assert.equal(transitive[0]!.file, 'packages/contracts/package.json'); + assert.match( + transitive[0]!.message, + /test-kit -> @agent-device\/kernel -> @agent-device\/contracts -> @agent-device\/test-kit/, + ); +}); + +test('a package outside test-kit reach may declare test-kit', () => { + assert.deepEqual( + check({ proxy: { devDependencies: { '@agent-device/test-kit': 'workspace:*' } } }), + [], + ); +}); + +test('test-kit may not import a platform, provider, daemon or root module, or reach out of its directory', () => { + for (const specifier of [ + '@agent-device/platform-android', + '@agent-device/platform-apple/runner', + '@agent-device/provider-limrun/connection', + '@agent-device/testmu/connection-verification', + '@agent-device/daemon/testing/context', + '@agent-device/daemon', + 'agent-device/commands', + '../../../src/platform-runtime-gateway.ts', + '../../kernel/src/errors.ts', + ]) { + const found = check( + {}, + new Map([['packages/test-kit/src/a.ts', `import { x } from '${specifier}';`]]), + ); + assert.equal(found.length, 1, specifier); + assert.equal(found[0]!.file, 'packages/test-kit/src/a.ts'); + } + // A sibling inside its own directory, and a lookalike package name, are fine. + assert.deepEqual( + check( + {}, + new Map([ + [ + 'packages/test-kit/src/a.ts', + "import { b } from './b.ts';\nimport { c } from '@agent-device/daemon-contracts/device-claims';", + ], + ]), + ), + [], + ); +}); + +test('the shared import walk applies: a vi.mock literal reaches a forbidden package too', () => { + const found = check( + {}, + new Map([ + [ + 'packages/test-kit/src/a.ts', + "import { vi } from 'vitest';\nvi.mock('@agent-device/platform-apple/runner', () => ({}));", + ], + ]), + ); + assert.equal(found.length, 1); + assert.equal(found[0]!.line, 2); +}); + +test('a repo without a test-kit package has nothing to isolate', () => { + assert.deepEqual(checkTestKitIsolation(new Map(), new Map()), []); +}); diff --git a/scripts/layering/test-kit-isolation.ts b/scripts/layering/test-kit-isolation.ts new file mode 100644 index 0000000000..156d5556c1 --- /dev/null +++ b/scripts/layering/test-kit-isolation.ts @@ -0,0 +1,150 @@ +// Catches: `@agent-device/test-kit` growing a dependency on the code it exists to test, or a +// package it builds on declaring it back. test-kit is the one home of test helpers shared across +// packages, so it may build only on the packages below the ones that consume it. A fixture that +// needs a platform, provider, daemon or root module's code is a test of that package and belongs +// in it; and TypeScript project references are acyclic, so a package test-kit reaches (directly or +// through other packages) cannot declare test-kit and keeps its helpers beside its tests. +// Evidence: the single-entry test-kit loads every helper eagerly, so one platform import would put +// that platform's closure into every test's import graph, and a package test-kit builds on that +// declared test-kit would close a reference cycle `tsc -b` rejects. +// Cost: one pass over the tracked manifests and test-kit's sources. +// Kill criterion: a maintainer decision that test-kit may depend on platform, provider, daemon or +// root code. +// +// Part of R83 package-export-surface. The forbidden set is derived from the workspace layout, not +// from name patterns: every package under `packages/platform-*` or `packages/provider-*` (whatever +// name it publishes, e.g. `@agent-device/testmu`), the daemon package, and the root package. + +import path from 'node:path'; +import type { LayeringViolation } from './model.ts'; +import { specifierSites } from './package-boundaries.ts'; +import { PACKAGE_EXPORT_SURFACE_RULE, TEST_KIT_PACKAGE } from './package-export-surface.ts'; + +const TEST_KIT_DIR = 'packages/test-kit'; +const ROOT_PACKAGE = 'agent-device'; +const FORBIDDEN_PACKAGE_DIR = /^packages\/(?:platform-[^/]+|provider-[^/]+|daemon)\/package\.json$/; + +type DependencyManifest = { + name?: string; + exports?: unknown; + dependencies?: Record; + devDependencies?: Record; + optionalDependencies?: Record; + peerDependencies?: Record; +}; + +/** Every package name a manifest declares in any dependency field. */ +function declaredNames(manifest: DependencyManifest): string[] { + return [ + ...Object.keys(manifest.dependencies ?? {}), + ...Object.keys(manifest.devDependencies ?? {}), + ...Object.keys(manifest.optionalDependencies ?? {}), + ...Object.keys(manifest.peerDependencies ?? {}), + ]; +} + +function violation(file: string, message: string, line = 1): LayeringViolation { + return { rule: PACKAGE_EXPORT_SURFACE_RULE, file, line, message }; +} + +/** The package names test-kit may not build on, from the workspace layout. */ +function forbiddenNames(parsed: ReadonlyMap): Set { + const names = new Set([ROOT_PACKAGE]); + for (const [file, manifest] of parsed) { + if (FORBIDDEN_PACKAGE_DIR.test(file) && manifest.name) names.add(manifest.name); + } + return names; +} + +function isForbiddenSpecifier(specifier: string, forbidden: ReadonlySet): boolean { + const parts = specifier.split('/'); + const name = specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]!; + return forbidden.has(name); +} + +/** + * The shape of the one shared test package: a single `.` entry; no dependency, direct or through + * other workspace packages, on a platform, provider, daemon or root package; no import of one or + * relative reach out of its directory (the shared import walk, so `vi.mock` literals count); and no + * package it reaches declaring it back. + */ +export function checkTestKitIsolation( + manifests: ReadonlyMap, + sources: ReadonlyMap, +): LayeringViolation[] { + const violations: LayeringViolation[] = []; + const parsed = new Map(); + for (const [file, text] of manifests) parsed.set(file, JSON.parse(text) as DependencyManifest); + const testKitFile = `${TEST_KIT_DIR}/package.json`; + const testKit = parsed.get(testKitFile); + if (!testKit) return violations; + + const exportKeys = Object.keys((testKit.exports as Record | undefined) ?? {}); + if (exportKeys.length !== 1 || exportKeys[0] !== '.') { + violations.push( + violation( + testKitFile, + `${TEST_KIT_PACKAGE} exports exactly "." (found ${exportKeys.join(', ') || 'none'}): a ` + + `shared helper is a named export of src/index.ts, not a subpath.`, + ), + ); + } + + const fileByName = new Map(); + for (const [file, manifest] of parsed) if (manifest.name) fileByName.set(manifest.name, file); + const forbidden = forbiddenNames(parsed); + + // Breadth-first over the workspace dependency graph from test-kit; `via` is the path to a package. + const via = new Map([[TEST_KIT_PACKAGE, [TEST_KIT_PACKAGE]]]); + const queue = [TEST_KIT_PACKAGE]; + while (queue.length > 0) { + const current = queue.shift()!; + const manifest = parsed.get(fileByName.get(current) ?? ''); + if (!manifest) continue; + for (const name of declaredNames(manifest)) { + const chain = [...via.get(current)!, name]; + if (name === TEST_KIT_PACKAGE && current !== TEST_KIT_PACKAGE) { + violations.push( + violation( + fileByName.get(current)!, + `${chain.join(' -> ')} closes a project-reference cycle: keep '${current}' test helpers ` + + `beside its tests.`, + ), + ); + continue; + } + if (forbidden.has(name)) { + violations.push( + violation( + testKitFile, + `${chain.join(' -> ')}: ${TEST_KIT_PACKAGE} builds on a platform, provider, daemon or root ` + + `package. A fixture that needs that code is a test of that package and belongs in it.`, + ), + ); + continue; + } + if (!fileByName.has(name) || via.has(name)) continue; + via.set(name, chain); + queue.push(name); + } + } + + for (const [file, source] of sources) { + if (!file.startsWith(`${TEST_KIT_DIR}/`)) continue; + for (const site of specifierSites(file, source)) { + const escapes = + site.specifier.startsWith('.') && + !path.posix.join(path.posix.dirname(file), site.specifier).startsWith(`${TEST_KIT_DIR}/`); + if (!escapes && !isForbiddenSpecifier(site.specifier, forbidden)) continue; + violations.push( + violation( + file, + `${TEST_KIT_PACKAGE} imports '${site.specifier}'. It may build only on the packages ` + + `below it, never on a platform, provider, daemon or root module.`, + site.line, + ), + ); + } + } + return violations; +} From 3389b684c5b58691bb38bf65bec031f1c3ea12fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 16:47:43 +0200 Subject: [PATCH 3/5] refactor(layering): require every condition of test-kit's entry to be src/index.ts Co-Authored-By: Claude Opus 5.5 --- scripts/layering/test-kit-isolation.test.ts | 16 ++++++++++++++++ scripts/layering/test-kit-isolation.ts | 21 ++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/scripts/layering/test-kit-isolation.test.ts b/scripts/layering/test-kit-isolation.test.ts index 81b4874ce0..5fd550d88a 100644 --- a/scripts/layering/test-kit-isolation.test.ts +++ b/scripts/layering/test-kit-isolation.test.ts @@ -63,6 +63,22 @@ test('test-kit exports exactly "." and nothing else', () => { assert.equal(check({ 'test-kit': { exports: { './tmp-dir': entry('./x.ts') } } }).length, 1); }); +test('every condition of the "." entry must point at src/index.ts', () => { + for (const exports of [ + { '.': entry('./src/other.ts') }, + { '.': { types: './src/index.ts', default: './src/other.ts' } }, + { '.': { types: './src/other.ts', default: './src/index.ts' } }, + { '.': { node: { import: './src/other.ts' }, default: './src/index.ts' } }, + { '.': './src/other.ts' }, + { '.': {} }, + ]) { + const found = check({ 'test-kit': { exports } }); + assert.equal(found.length, 1, JSON.stringify(exports)); + assert.match(found[0]!.message, /every condition of it is \.\/src\/index\.ts/); + } + assert.deepEqual(check({ 'test-kit': { exports: { '.': './src/index.ts' } } }), []); +}); + test('test-kit may not depend on a platform, provider, daemon or root package, in any field', () => { for (const name of [ '@agent-device/platform-apple', diff --git a/scripts/layering/test-kit-isolation.ts b/scripts/layering/test-kit-isolation.ts index 156d5556c1..7c4eeccab8 100644 --- a/scripts/layering/test-kit-isolation.ts +++ b/scripts/layering/test-kit-isolation.ts @@ -21,6 +21,7 @@ import { specifierSites } from './package-boundaries.ts'; import { PACKAGE_EXPORT_SURFACE_RULE, TEST_KIT_PACKAGE } from './package-export-surface.ts'; const TEST_KIT_DIR = 'packages/test-kit'; +const TEST_KIT_ENTRY = './src/index.ts'; const ROOT_PACKAGE = 'agent-device'; const FORBIDDEN_PACKAGE_DIR = /^packages\/(?:platform-[^/]+|provider-[^/]+|daemon)\/package\.json$/; @@ -43,6 +44,12 @@ function declaredNames(manifest: DependencyManifest): string[] { ]; } +function stringLeaves(value: unknown): string[] { + if (typeof value === 'string') return [value]; + if (value && typeof value === 'object') return Object.values(value).flatMap(stringLeaves); + return []; +} + function violation(file: string, message: string, line = 1): LayeringViolation { return { rule: PACKAGE_EXPORT_SURFACE_RULE, file, line, message }; } @@ -79,12 +86,20 @@ export function checkTestKitIsolation( const testKit = parsed.get(testKitFile); if (!testKit) return violations; - const exportKeys = Object.keys((testKit.exports as Record | undefined) ?? {}); - if (exportKeys.length !== 1 || exportKeys[0] !== '.') { + const exported = (testKit.exports as Record | undefined) ?? {}; + const exportKeys = Object.keys(exported); + const entryTargets = stringLeaves(exported['.']); + if ( + exportKeys.length !== 1 || + exportKeys[0] !== '.' || + entryTargets.length === 0 || + entryTargets.some((target) => target !== TEST_KIT_ENTRY) + ) { violations.push( violation( testKitFile, - `${TEST_KIT_PACKAGE} exports exactly "." (found ${exportKeys.join(', ') || 'none'}): a ` + + `${TEST_KIT_PACKAGE} exports exactly "." and every condition of it is ${TEST_KIT_ENTRY} ` + + `(found ${exportKeys.join(', ') || 'none'} -> ${entryTargets.join(', ') || 'nothing'}): a ` + `shared helper is a named export of src/index.ts, not a subpath.`, ), ); From ec3c93f35979d063a6344a3c25e93eb1b1cd8c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 18:01:03 +0200 Subject: [PATCH 4/5] refactor(test-kit): drop the two property-arbitraries names main removed from the entry Co-Authored-By: Claude Opus 5.5 --- packages/test-kit/src/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/test-kit/src/index.ts b/packages/test-kit/src/index.ts index 28b5022bc5..6075087256 100644 --- a/packages/test-kit/src/index.ts +++ b/packages/test-kit/src/index.ts @@ -64,10 +64,8 @@ export { writePlugin, } from './plugin.fixtures.ts'; export { - COMPACT_VIEWPORTS, formatRef, type GeneratedRef, - gestureInViewportArb, PROPERTY_RUNS_SMALL, rawSnapshotNodesArb, refArb, From f8358eef07792e3bb5328e1ebe2f69f6ac603e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 18:11:14 +0200 Subject: [PATCH 5/5] refactor(test-kit): refuse export * in the entry and fix a stale subpath in an error message Co-Authored-By: Claude Opus 5.5 --- packages/test-kit/src/property-arbitraries.ts | 2 +- scripts/layering/test-kit-isolation.test.ts | 15 +++++++++++++++ scripts/layering/test-kit-isolation.ts | 13 +++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/test-kit/src/property-arbitraries.ts b/packages/test-kit/src/property-arbitraries.ts index 0f446a3898..c6bb33787c 100644 --- a/packages/test-kit/src/property-arbitraries.ts +++ b/packages/test-kit/src/property-arbitraries.ts @@ -283,7 +283,7 @@ function replayScriptLineArbs(): fc.Arbitrary[] { `replay command "${command}" from @agent-device/command-registry/catalog is ` + 'unclassified: ' + 'add a line template or a waiver to REPLAY_SCRIPT_LINE_PLANS in ' + - '@agent-device/test-kit/property-arbitraries', + 'packages/test-kit/src/property-arbitraries.ts', ); } if (!('waived' in plan)) arbitraries.push(plan); diff --git a/scripts/layering/test-kit-isolation.test.ts b/scripts/layering/test-kit-isolation.test.ts index 5fd550d88a..8bd1f8b984 100644 --- a/scripts/layering/test-kit-isolation.test.ts +++ b/scripts/layering/test-kit-isolation.test.ts @@ -63,6 +63,21 @@ test('test-kit exports exactly "." and nothing else', () => { assert.equal(check({ 'test-kit': { exports: { './tmp-dir': entry('./x.ts') } } }).length, 1); }); +test('the entry names its exports: export * is refused', () => { + for (const body of [ + "export * from './a.ts';", + "export { a } from './a.ts';\nexport * as ns from './b.ts';", + ]) { + const found = check({}, new Map([['packages/test-kit/src/index.ts', body]])); + assert.equal(found.length, 1, body); + assert.match(found[0]!.message, /names every export explicitly/); + } + assert.deepEqual( + check({}, new Map([['packages/test-kit/src/index.ts', "export { a } from './a.ts';"]])), + [], + ); +}); + test('every condition of the "." entry must point at src/index.ts', () => { for (const exports of [ { '.': entry('./src/other.ts') }, diff --git a/scripts/layering/test-kit-isolation.ts b/scripts/layering/test-kit-isolation.ts index 7c4eeccab8..42919e4b89 100644 --- a/scripts/layering/test-kit-isolation.ts +++ b/scripts/layering/test-kit-isolation.ts @@ -144,6 +144,19 @@ export function checkTestKitIsolation( } } + const entrySource = sources.get(`${TEST_KIT_DIR}/src/index.ts`); + const starExport = entrySource === undefined ? null : /^[ \t]*export\s*\*/m.exec(entrySource); + if (entrySource !== undefined && starExport) { + const line = entrySource.slice(0, starExport.index).split('\n').length; + violations.push( + violation( + `${TEST_KIT_DIR}/src/index.ts`, + `${TEST_KIT_PACKAGE} names every export explicitly: \`export *\` would publish a module's whole surface.`, + line, + ), + ); + } + for (const [file, source] of sources) { if (!file.startsWith(`${TEST_KIT_DIR}/`)) continue; for (const site of specifierSites(file, source)) {