diff --git a/.fallowrc.json b/.fallowrc.json index 5cfedf379..f37f0e959 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -169,6 +169,11 @@ "file": "packages/provider-limrun/src/index.ts", "exports": ["LimrunIosCommandExecution"] }, + { + "comment": "#1959 gave every contracts vocabulary module its own entry subpath and moved all ~230 value-importers onto them, so `./platform` and `./interaction` now carry zero value consumers — every re-export on them reads as unused. They stay as the compatibility surface for the ~490 type-only importers the granularization deliberately left alone (type imports are erased, so they cost nothing to load). Scoped to these two façades rather than listed symbol-by-symbol because the property is per-file: nothing on them is value-consumed any more. Retiring them entirely — moving the type-only importers too and deleting the files — is the follow-up that makes this entry unnecessary.", + "file": "packages/contracts/src/facades/{platform,interaction}.ts", + "exports": ["*"] + }, { "comment": "Converting the contracts façades from `export *` to explicit named re-exports (the pin-table retirement) made these individually visible to --production analysis for the first time; a bare star previously hid them from this exact check. GESTURE_INITIAL_ANGLE_DEGREES/GESTURE_SAMPLE_INTERVAL_MS/INTERACTION_GUARANTEES/INTERACTION_PATH_IDS/parseAndroidInputMethodPackage/isRecordingExportQuality have same-package test-tree consumers (invisible to --production, mirroring the packages/{ad-script,maestro} entry above); the rest currently have none. Kept rather than narrowed here so the façade's re-export surface stays byte-identical to the symbol set the retired pin table asserted — narrowing the surface is a follow-up with its own review, not a side effect of this mechanical conversion. The last five (COORDINATE_GESTURE_KINDS, normalizePublicGesture, DEFAULT_DRAG_*) are #1567's drag vocabulary, surfaced the same way by the same conversion and kept for the same reason.", "file": "packages/contracts/src/facades/{client,command,divergence,interaction,platform,recording}.ts", diff --git a/packages/ad-script/src/internal/script.ts b/packages/ad-script/src/internal/script.ts index 4c6e74af9..14824602e 100644 --- a/packages/ad-script/src/internal/script.ts +++ b/packages/ad-script/src/internal/script.ts @@ -1,6 +1,6 @@ import { AppError } from '@agent-device/kernel/errors'; import { recordingQualityInputToExportQuality } from '@agent-device/contracts/recording'; -import { describeReplayGestureArityError } from '@agent-device/contracts/interaction'; +import { describeReplayGestureArityError } from '@agent-device/contracts/gesture-normalization'; import { RETIRED_SCREENSHOT_MAX_SIZE, readScreenshotScriptFlag, diff --git a/packages/capture-kit/src/app-log-live-handle.ts b/packages/capture-kit/src/app-log-live-handle.ts index a21fab0eb..0e7e2f252 100644 --- a/packages/capture-kit/src/app-log-live-handle.ts +++ b/packages/capture-kit/src/app-log-live-handle.ts @@ -1,12 +1,14 @@ import { AppError } from '@agent-device/kernel/errors'; +import type { + AppLogCompletion, + AppLogLiveHandle, + AppLogLiveSnapshot, +} from '@agent-device/contracts/app-log-runtime'; import { - isConfirmedCleanup, - type AppLogCompletion, - type AppLogLiveHandle, - type AppLogLiveSnapshot, type CleanupOutcome, type FinishOutcome, -} from '@agent-device/contracts/platform'; + isConfirmedCleanup, +} from '@agent-device/contracts/durable-resource'; type AppLogLiveHandleImplementation = Readonly<{ inspect(): AppLogLiveSnapshot; diff --git a/packages/capture-kit/src/app-log-pid-runtime.test.ts b/packages/capture-kit/src/app-log-pid-runtime.test.ts index ed028093e..ef3294a18 100644 --- a/packages/capture-kit/src/app-log-pid-runtime.test.ts +++ b/packages/capture-kit/src/app-log-pid-runtime.test.ts @@ -1,10 +1,10 @@ import type { DeviceInfo } from '@agent-device/kernel/device'; import { expect, test, vi } from 'vitest'; -import { - type AppLogBackgroundProcess, - type AppLogRuntimeHost, - type DurableDescriptorCodec, -} from '@agent-device/contracts/platform'; +import type { + AppLogBackgroundProcess, + AppLogRuntimeHost, +} from '@agent-device/contracts/app-log-runtime'; +import type { DurableDescriptorCodec } from '@agent-device/contracts/durable-resource-envelope'; import { createDurableResourceEnvelope, encodeDurableDescriptor, diff --git a/packages/capture-kit/src/app-log-pid-runtime.ts b/packages/capture-kit/src/app-log-pid-runtime.ts index ab291b385..f022a2cb4 100644 --- a/packages/capture-kit/src/app-log-pid-runtime.ts +++ b/packages/capture-kit/src/app-log-pid-runtime.ts @@ -16,7 +16,7 @@ import type { RuntimeFacts, RuntimeOwnerRef, } from '@agent-device/contracts/platform'; -import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { LogBackend } from '@agent-device/contracts/observability'; import { createAppLogRecoveryOperations, createAppLogStartResult } from './app-log-runtime.ts'; import { diff --git a/packages/capture-kit/src/app-log-runtime.test.ts b/packages/capture-kit/src/app-log-runtime.test.ts index 0c57dc4e5..ef1989af6 100644 --- a/packages/capture-kit/src/app-log-runtime.test.ts +++ b/packages/capture-kit/src/app-log-runtime.test.ts @@ -1,14 +1,14 @@ import assert from 'node:assert/strict'; import { test, vi } from 'vitest'; import { AppError } from '@agent-device/kernel/errors'; -import { - type AppLogCompletion, - type AppLogBackgroundProcessRequest, - type AppLogProcessOwnership, - type AppLogProcessTransport, - type AppLogRuntimeHost, - type DurableDescriptorCodec, -} from '@agent-device/contracts/platform'; +import type { + AppLogBackgroundProcessRequest, + AppLogCompletion, + AppLogProcessOwnership, + AppLogProcessTransport, + AppLogRuntimeHost, +} from '@agent-device/contracts/app-log-runtime'; +import type { DurableDescriptorCodec } from '@agent-device/contracts/durable-resource-envelope'; import { APP_LOG_ENVELOPE_FIXTURE } from './durable-resource-envelope.fixtures.ts'; import { createAppLogLiveHandle } from './app-log-live-handle.ts'; import { diff --git a/packages/capture-kit/src/app-log-runtime.ts b/packages/capture-kit/src/app-log-runtime.ts index 5075bab4e..0ef38dc44 100644 --- a/packages/capture-kit/src/app-log-runtime.ts +++ b/packages/capture-kit/src/app-log-runtime.ts @@ -1,16 +1,17 @@ -import { - PendingTransferGuard, - type AppLogCompletion, - type AppLogLiveHandle, - type AppLogProcessMarkerReadOutcome, - type AppLogRuntimeOperations, - type AppLogStartResult, - type CleanupOutcome, - type DurableDescriptorCodec, - type DurableResourceEnvelope, - type ReattachOutcome, - type ResourceOwnershipFence, -} from '@agent-device/contracts/platform'; +import type { + AppLogCompletion, + AppLogLiveHandle, + AppLogProcessMarkerReadOutcome, + AppLogRuntimeOperations, + AppLogStartResult, +} from '@agent-device/contracts/app-log-runtime'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +import type { CleanupOutcome, ReattachOutcome } from '@agent-device/contracts/durable-resource'; +import type { + DurableDescriptorCodec, + DurableResourceEnvelope, +} from '@agent-device/contracts/durable-resource-envelope'; +import type { ResourceOwnershipFence } from '@agent-device/contracts/platform-runtime'; import { decodeDurableDescriptor } from './durable-descriptor-codec.ts'; const APP_LOG_RESOURCE_KIND = 'app-log' as const; diff --git a/packages/capture-kit/src/durable-resource-envelope.ts b/packages/capture-kit/src/durable-resource-envelope.ts index a3d34aac6..b7629b3cf 100644 --- a/packages/capture-kit/src/durable-resource-envelope.ts +++ b/packages/capture-kit/src/durable-resource-envelope.ts @@ -9,17 +9,19 @@ import { type Platform, } from '@agent-device/kernel/device'; import type { JsonObject } from '@agent-device/contracts/client'; +import type { + DurableDescriptorCodec, + DurableEnvelopeDecodeOutcome, + DurableResourceEnvelope, + DurableResourceLifecycleState, + EncodedDurableDescriptor, +} from '@agent-device/contracts/durable-resource-envelope'; import { - localRuntimeOwner, - providerRuntimeOwner, - type DurableDescriptorCodec, - type DurableEnvelopeDecodeOutcome, - type DurableResourceEnvelope, - type DurableResourceLifecycleState, - type EncodedDurableDescriptor, type ResourceOwnershipFence, type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + providerRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; import { freezeJsonObject, isBoundedJsonObject } from './durable-json.ts'; const DURABLE_RESOURCE_ENVELOPE_VERSION = 1 as const; diff --git a/packages/capture-kit/src/screen-recording-live-handle.ts b/packages/capture-kit/src/screen-recording-live-handle.ts index f0e3f0058..b4c6f5bae 100644 --- a/packages/capture-kit/src/screen-recording-live-handle.ts +++ b/packages/capture-kit/src/screen-recording-live-handle.ts @@ -1,13 +1,15 @@ import { AppError } from '@agent-device/kernel/errors'; import { - isConfirmedCleanup, type CleanupOutcome, type FinishOutcome, - type RecordingGestureEvent, - type ScreenRecordingCompletion, - type ScreenRecordingLiveHandle, - type ScreenRecordingLiveSnapshot, -} from '@agent-device/contracts/platform'; + isConfirmedCleanup, +} from '@agent-device/contracts/durable-resource'; +import type { + RecordingGestureEvent, + ScreenRecordingCompletion, + ScreenRecordingLiveHandle, + ScreenRecordingLiveSnapshot, +} from '@agent-device/contracts/screen-recording-runtime'; import type { GestureReferenceFrame } from '@agent-device/contracts/interaction'; type ScreenRecordingLiveHandleImplementation = Readonly<{ diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 009add237..5de41a793 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -8,6 +8,82 @@ "@agent-device/kernel": "workspace:*" }, "exports": { + "./alert-contract": { + "types": "./src/alert-contract.ts", + "default": "./src/alert-contract.ts" + }, + "./android-input-ownership": { + "types": "./src/android-input-ownership.ts", + "default": "./src/android-input-ownership.ts" + }, + "./android-snapshot-quality": { + "types": "./src/android-snapshot-quality.ts", + "default": "./src/android-snapshot-quality.ts" + }, + "./android-system-chrome": { + "types": "./src/android-system-chrome.ts", + "default": "./src/android-system-chrome.ts" + }, + "./app-deployment-runtime": { + "types": "./src/app-deployment-runtime.ts", + "default": "./src/app-deployment-runtime.ts" + }, + "./app-deployment-runtime-plan": { + "types": "./src/app-deployment-runtime-plan.ts", + "default": "./src/app-deployment-runtime-plan.ts" + }, + "./app-inventory-runtime": { + "types": "./src/app-inventory-runtime.ts", + "default": "./src/app-inventory-runtime.ts" + }, + "./app-log-runtime": { + "types": "./src/app-log-runtime.ts", + "default": "./src/app-log-runtime.ts" + }, + "./app-state-runtime": { + "types": "./src/app-state-runtime.ts", + "default": "./src/app-state-runtime.ts" + }, + "./apple-multitouch-support": { + "types": "./src/apple-multitouch-support.ts", + "default": "./src/apple-multitouch-support.ts" + }, + "./application-lifecycle-interaction": { + "types": "./src/application-lifecycle-interaction.ts", + "default": "./src/application-lifecycle-interaction.ts" + }, + "./application-lifecycle-runtime": { + "types": "./src/application-lifecycle-runtime.ts", + "default": "./src/application-lifecycle-runtime.ts" + }, + "./application-lifecycle-runtime-plan": { + "types": "./src/application-lifecycle-runtime-plan.ts", + "default": "./src/application-lifecycle-runtime-plan.ts" + }, + "./async-lifecycle": { + "types": "./src/async-lifecycle.ts", + "default": "./src/async-lifecycle.ts" + }, + "./audio-probe-result": { + "types": "./src/audio-probe-result.ts", + "default": "./src/audio-probe-result.ts" + }, + "./audio-probe-support": { + "types": "./src/audio-probe-support.ts", + "default": "./src/audio-probe-support.ts" + }, + "./back-mode": { + "types": "./src/back-mode.ts", + "default": "./src/back-mode.ts" + }, + "./capture": { + "types": "./src/facades/capture.ts", + "default": "./src/facades/capture.ts" + }, + "./click-button": { + "types": "./src/click-button.ts", + "default": "./src/click-button.ts" + }, "./client": { "types": "./src/facades/client.ts", "default": "./src/facades/client.ts" @@ -16,38 +92,130 @@ "types": "./src/facades/command.ts", "default": "./src/facades/command.ts" }, + "./command-platform-execution": { + "types": "./src/command-platform-execution.ts", + "default": "./src/command-platform-execution.ts" + }, "./device": { "types": "./src/facades/device.ts", "default": "./src/facades/device.ts" }, + "./device-readiness-runtime": { + "types": "./src/device-readiness-runtime.ts", + "default": "./src/device-readiness-runtime.ts" + }, + "./device-shutdown-runtime": { + "types": "./src/device-shutdown-runtime.ts", + "default": "./src/device-shutdown-runtime.ts" + }, + "./divergence": { + "types": "./src/facades/divergence.ts", + "default": "./src/facades/divergence.ts" + }, + "./durable-resource": { + "types": "./src/durable-resource.ts", + "default": "./src/durable-resource.ts" + }, + "./durable-resource-envelope": { + "types": "./src/durable-resource-envelope.ts", + "default": "./src/durable-resource-envelope.ts" + }, + "./element-text-runtime": { + "types": "./src/element-text-runtime.ts", + "default": "./src/element-text-runtime.ts" + }, + "./focus-runtime": { + "types": "./src/focus-runtime.ts", + "default": "./src/focus-runtime.ts" + }, + "./gesture-input": { + "types": "./src/gesture-input.ts", + "default": "./src/gesture-input.ts" + }, + "./gesture-normalization": { + "types": "./src/gesture-normalization.ts", + "default": "./src/gesture-normalization.ts" + }, + "./gesture-plan": { + "types": "./src/gesture-plan.ts", + "default": "./src/gesture-plan.ts" + }, + "./gesture-plan-types": { + "types": "./src/gesture-plan-types.ts", + "default": "./src/gesture-plan-types.ts" + }, "./interaction": { "types": "./src/facades/interaction.ts", "default": "./src/facades/interaction.ts" }, - "./capture": { - "types": "./src/facades/capture.ts", - "default": "./src/facades/capture.ts" + "./interaction-error": { + "types": "./src/interaction-error.ts", + "default": "./src/interaction-error.ts" + }, + "./interaction-guarantees": { + "types": "./src/interaction-guarantees.ts", + "default": "./src/interaction-guarantees.ts" + }, + "./interactor-types": { + "types": "./src/interactor-types.ts", + "default": "./src/interactor-types.ts" + }, + "./logs-runtime-plan": { + "types": "./src/logs-runtime-plan.ts", + "default": "./src/logs-runtime-plan.ts" + }, + "./navigation": { + "types": "./src/navigation.ts", + "default": "./src/navigation.ts" + }, + "./network-runtime": { + "types": "./src/network-runtime.ts", + "default": "./src/network-runtime.ts" + }, + "./network-runtime-plan": { + "types": "./src/network-runtime-plan.ts", + "default": "./src/network-runtime-plan.ts" + }, + "./observability": { + "types": "./src/facades/observability.ts", + "default": "./src/facades/observability.ts" }, "./platform": { "types": "./src/facades/platform.ts", "default": "./src/facades/platform.ts" }, - "./settings": { - "types": "./src/settings.ts", - "default": "./src/settings.ts" + "./platform-module": { + "types": "./src/platform-module.ts", + "default": "./src/platform-module.ts" }, - "./session": { - "types": "./src/facades/session.ts", - "default": "./src/facades/session.ts" + "./platform-runtime": { + "types": "./src/platform-runtime.ts", + "default": "./src/platform-runtime.ts" + }, + "./platform-runtime-host": { + "types": "./src/platform-runtime-host.ts", + "default": "./src/platform-runtime-host.ts" + }, + "./platform-runtime-operations": { + "types": "./src/platform-runtime-operations.ts", + "default": "./src/platform-runtime-operations.ts" + }, + "./platform-runtime-unavailable": { + "types": "./src/platform-runtime-unavailable.ts", + "default": "./src/platform-runtime-unavailable.ts" + }, + "./progress": { + "types": "./src/facades/progress.ts", + "default": "./src/facades/progress.ts" + }, + "./record-runtime-cutover": { + "types": "./src/record-runtime-cutover.ts", + "default": "./src/record-runtime-cutover.ts" }, "./recording": { "types": "./src/facades/recording.ts", "default": "./src/facades/recording.ts" }, - "./observability": { - "types": "./src/facades/observability.ts", - "default": "./src/facades/observability.ts" - }, "./remote": { "types": "./src/facades/remote.ts", "default": "./src/facades/remote.ts" @@ -56,17 +224,69 @@ "types": "./src/facades/replay.ts", "default": "./src/facades/replay.ts" }, + "./screen-recording-runtime": { + "types": "./src/screen-recording-runtime.ts", + "default": "./src/screen-recording-runtime.ts" + }, + "./screen-recording-runtime-plan": { + "types": "./src/screen-recording-runtime-plan.ts", + "default": "./src/screen-recording-runtime-plan.ts" + }, + "./screenshot-runtime": { + "types": "./src/screenshot-runtime.ts", + "default": "./src/screenshot-runtime.ts" + }, + "./scroll-command": { + "types": "./src/scroll-command.ts", + "default": "./src/scroll-command.ts" + }, + "./scroll-gesture": { + "types": "./src/scroll-gesture.ts", + "default": "./src/scroll-gesture.ts" + }, + "./selector-observation-runtime": { + "types": "./src/selector-observation-runtime.ts", + "default": "./src/selector-observation-runtime.ts" + }, + "./session": { + "types": "./src/facades/session.ts", + "default": "./src/facades/session.ts" + }, + "./settings": { + "types": "./src/settings.ts", + "default": "./src/settings.ts" + }, "./snapshot": { "types": "./src/facades/snapshot.ts", "default": "./src/facades/snapshot.ts" }, - "./divergence": { - "types": "./src/facades/divergence.ts", - "default": "./src/facades/divergence.ts" + "./snapshot-runtime": { + "types": "./src/snapshot-runtime.ts", + "default": "./src/snapshot-runtime.ts" }, - "./progress": { - "types": "./src/facades/progress.ts", - "default": "./src/facades/progress.ts" + "./startup-recovery-fence": { + "types": "./src/startup-recovery-fence.ts", + "default": "./src/startup-recovery-fence.ts" + }, + "./tv-remote": { + "types": "./src/tv-remote.ts", + "default": "./src/tv-remote.ts" + }, + "./type-text-runtime": { + "types": "./src/type-text-runtime.ts", + "default": "./src/type-text-runtime.ts" + }, + "./viewport-runtime": { + "types": "./src/viewport-runtime.ts", + "default": "./src/viewport-runtime.ts" + }, + "./wait": { + "types": "./src/wait.ts", + "default": "./src/wait.ts" + }, + "./wait-runtime-plan": { + "types": "./src/wait-runtime-plan.ts", + "default": "./src/wait-runtime-plan.ts" } } } diff --git a/packages/contracts/src/client-gesture.ts b/packages/contracts/src/client-gesture.ts index 48a796ff4..8206c6e76 100644 --- a/packages/contracts/src/client-gesture.ts +++ b/packages/contracts/src/client-gesture.ts @@ -1,7 +1,7 @@ // The public API vocabulary for the gesture and text-entry commands. import type { ClickButton } from './click-button.ts'; -import type { GesturePointerCount } from './gesture-plan.ts'; +import type { GesturePointerCount } from './gesture-plan-types.ts'; import type { ScrollDirection, ScrollInputDirection, diff --git a/packages/contracts/src/gesture-plan.ts b/packages/contracts/src/gesture-plan.ts index 5ae2b9e8a..d992643c0 100644 --- a/packages/contracts/src/gesture-plan.ts +++ b/packages/contracts/src/gesture-plan.ts @@ -23,8 +23,6 @@ import type { SinglePointerTrajectory, } from './gesture-plan-types.ts'; -export * from './gesture-plan-types.ts'; - export const GESTURE_SAMPLE_INTERVAL_MS = 16; export const GESTURE_INITIAL_ANGLE_DEGREES = -90; const GESTURE_FLING_DEFAULT_DISTANCE = 180; diff --git a/packages/maestro/src/internal/export-flow.ts b/packages/maestro/src/internal/export-flow.ts index ddbe27701..c3924cdd6 100644 --- a/packages/maestro/src/internal/export-flow.ts +++ b/packages/maestro/src/internal/export-flow.ts @@ -1,5 +1,5 @@ import type { SessionAction } from '@agent-device/contracts/session'; -import { GESTURE_FLING_DURATION_MS } from '@agent-device/contracts/interaction'; +import { GESTURE_FLING_DURATION_MS } from '@agent-device/contracts/gesture-plan'; import { AppError } from '@agent-device/kernel/errors'; import { selectorContainsKey } from '@agent-device/selectors'; import { formatMaestroPoint } from './export-points.ts'; diff --git a/packages/maestro/src/internal/runtime-port-geometry.ts b/packages/maestro/src/internal/runtime-port-geometry.ts index 300e0f430..27d7ca51f 100644 --- a/packages/maestro/src/internal/runtime-port-geometry.ts +++ b/packages/maestro/src/internal/runtime-port-geometry.ts @@ -1,5 +1,5 @@ import { AppError } from '@agent-device/kernel/errors'; -import { buildInPageSwipeGesturePlan } from '@agent-device/contracts/interaction'; +import { buildInPageSwipeGesturePlan } from '@agent-device/contracts/scroll-gesture'; import { isPositiveFiniteRect } from '@agent-device/kernel/rect'; import type { Rect, SnapshotState } from '@agent-device/kernel/snapshot'; import { pointInsideRect } from './shared.ts'; diff --git a/packages/platform-android/src/lifecycle.ts b/packages/platform-android/src/lifecycle.ts index 559857b4f..2486ceb51 100644 --- a/packages/platform-android/src/lifecycle.ts +++ b/packages/platform-android/src/lifecycle.ts @@ -7,10 +7,10 @@ import type { import { bindLocalApplicationLifecycleInteractor, followUpRuntimeLaunchUrl, - hasRuntimeTransportHintValues, invokeApplicationClose, invokeApplicationOpen, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; +import { hasRuntimeTransportHintValues } from '@agent-device/contracts/application-lifecycle-runtime'; import { ensureAndroidReady } from './readiness/runtime.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/packages/platform-android/src/logs/descriptor.ts b/packages/platform-android/src/logs/descriptor.ts index 1551c77e1..1974075a1 100644 --- a/packages/platform-android/src/logs/descriptor.ts +++ b/packages/platform-android/src/logs/descriptor.ts @@ -4,7 +4,7 @@ import type { DurableResourceEnvelope, RuntimeOwnerRef, } from '@agent-device/contracts/platform'; -import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/app-log-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type AndroidAppLogDescriptor = Readonly<{ diff --git a/packages/platform-android/src/recording/chunks.test.ts b/packages/platform-android/src/recording/chunks.test.ts index a66f6adcd..e65c3476c 100644 --- a/packages/platform-android/src/recording/chunks.test.ts +++ b/packages/platform-android/src/recording/chunks.test.ts @@ -1,5 +1,5 @@ import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, diff --git a/packages/platform-android/src/recording/launch-boundary.test.ts b/packages/platform-android/src/recording/launch-boundary.test.ts index 62e567c34..5c39dcf05 100644 --- a/packages/platform-android/src/recording/launch-boundary.test.ts +++ b/packages/platform-android/src/recording/launch-boundary.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, diff --git a/packages/platform-android/src/recording/launch.test.ts b/packages/platform-android/src/recording/launch.test.ts index 67f3c06c1..9b0105efb 100644 --- a/packages/platform-android/src/recording/launch.test.ts +++ b/packages/platform-android/src/recording/launch.test.ts @@ -1,6 +1,6 @@ import { expect, test } from 'vitest'; import type { AndroidScreenRecordingTransport } from '@agent-device/contracts/platform'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, diff --git a/packages/platform-android/src/recording/manifest.ts b/packages/platform-android/src/recording/manifest.ts index cf3a25132..50902ce14 100644 --- a/packages/platform-android/src/recording/manifest.ts +++ b/packages/platform-android/src/recording/manifest.ts @@ -4,7 +4,7 @@ import type { ScreenRecordingRuntimeOperations, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { completionMatchesDescriptor, isValidAndroidRecordingDescriptor, diff --git a/packages/platform-android/src/recording/recovery-cleanup.test.ts b/packages/platform-android/src/recording/recovery-cleanup.test.ts index 727d9a438..c1157217f 100644 --- a/packages/platform-android/src/recording/recovery-cleanup.test.ts +++ b/packages/platform-android/src/recording/recovery-cleanup.test.ts @@ -1,5 +1,5 @@ import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, recordingInput } from './fixtures.ts'; import { bindAndroidScreenRecordingRuntime } from './runtime.ts'; diff --git a/packages/platform-android/src/recording/recovery.test.ts b/packages/platform-android/src/recording/recovery.test.ts index 8183106dc..0353d7ecb 100644 --- a/packages/platform-android/src/recording/recovery.test.ts +++ b/packages/platform-android/src/recording/recovery.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, recordingInput } from './fixtures.ts'; import { bindAndroidScreenRecordingRuntime } from './runtime.ts'; diff --git a/packages/platform-android/src/recording/runtime.test.ts b/packages/platform-android/src/recording/runtime.test.ts index 4f0e1853b..f40d97148 100644 --- a/packages/platform-android/src/recording/runtime.test.ts +++ b/packages/platform-android/src/recording/runtime.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, diff --git a/packages/platform-android/src/recording/runtime.ts b/packages/platform-android/src/recording/runtime.ts index 330938fda..fbe1522a5 100644 --- a/packages/platform-android/src/recording/runtime.ts +++ b/packages/platform-android/src/recording/runtime.ts @@ -6,10 +6,8 @@ import type { ScreenRecordingRuntimeOperations, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { - PendingTransferGuard, - SCREEN_RECORDING_RESOURCE_KIND, -} from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope, createScreenRecordingLiveHandle, diff --git a/packages/platform-android/src/recording/start-reconciliation.test.ts b/packages/platform-android/src/recording/start-reconciliation.test.ts index 0ab1bf3c3..da71ece0e 100644 --- a/packages/platform-android/src/recording/start-reconciliation.test.ts +++ b/packages/platform-android/src/recording/start-reconciliation.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { androidRecordingDevice, recordingHost, diff --git a/packages/platform-android/src/runtime.ts b/packages/platform-android/src/runtime.ts index 1f326a0fa..baf8e3413 100644 --- a/packages/platform-android/src/runtime.ts +++ b/packages/platform-android/src/runtime.ts @@ -9,20 +9,30 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - bindLocalFocusInteractor, - bindLocalScreenshotInteractor, - bindLocalTypeTextInteractor, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { bindElementTextRuntime, - bindLocalSnapshotInteractor, elementTextRuntimeOperationFacts, +} from '@agent-device/contracts/element-text-runtime'; +import { + bindLocalFocusInteractor, focusRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - localRuntimeOwner, +} from '@agent-device/contracts/focus-runtime'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { + bindLocalScreenshotInteractor, screenshotRuntimeOperationFacts, - selectorObservationRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { selectorObservationRuntimeOperationFacts } from '@agent-device/contracts/selector-observation-runtime'; +import { + bindLocalSnapshotInteractor, snapshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/snapshot-runtime'; +import { + bindLocalTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createAndroidAppLogRuntime } from './logs/runtime.ts'; import { dumpAndroidNetworkTraffic } from './network/runtime.ts'; diff --git a/packages/platform-apple/src/lifecycle.ts b/packages/platform-apple/src/lifecycle.ts index 98f696f10..6a994c5bb 100644 --- a/packages/platform-apple/src/lifecycle.ts +++ b/packages/platform-apple/src/lifecycle.ts @@ -10,10 +10,10 @@ import type { } from '@agent-device/contracts/platform'; import { bindLocalApplicationLifecycleInteractor, - hasRuntimeTransportHintValues, invokeApplicationClose, invokeApplicationOpen, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; +import { hasRuntimeTransportHintValues } from '@agent-device/contracts/application-lifecycle-runtime'; import { isDeepLinkTarget } from '@agent-device/contracts/command'; import { ensureAppleReady } from './readiness/runtime.ts'; import { isApplePlatform, isIosFamily, type DeviceInfo } from '@agent-device/kernel/device'; diff --git a/packages/platform-apple/src/logs/descriptor.ts b/packages/platform-apple/src/logs/descriptor.ts index 2d5c8ea57..d1777dc49 100644 --- a/packages/platform-apple/src/logs/descriptor.ts +++ b/packages/platform-apple/src/logs/descriptor.ts @@ -4,7 +4,7 @@ import type { DurableResourceEnvelope, RuntimeOwnerRef, } from '@agent-device/contracts/platform'; -import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/app-log-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type AppleAppLogDescriptor = Readonly<{ diff --git a/packages/platform-apple/src/logs/runtime.ts b/packages/platform-apple/src/logs/runtime.ts index 70d234fbe..de7f9128c 100644 --- a/packages/platform-apple/src/logs/runtime.ts +++ b/packages/platform-apple/src/logs/runtime.ts @@ -13,7 +13,7 @@ import { createAppLogRecoveryOperations, reattachCleanupOnlyAppLogProcess, } from '@agent-device/capture-kit'; -import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { APPLE_XCTEST_LOGS_HINT, backendForAppleDevice } from './backend.ts'; import { appleAppLogDescriptorCodec } from './descriptor.ts'; import { doctorAppleAppLogs } from './doctor.ts'; diff --git a/packages/platform-apple/src/logs/start.test.ts b/packages/platform-apple/src/logs/start.test.ts index 8fcf5e68d..78b4f8ad4 100644 --- a/packages/platform-apple/src/logs/start.test.ts +++ b/packages/platform-apple/src/logs/start.test.ts @@ -1,4 +1,4 @@ -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { expect, test, vi } from 'vitest'; import { startAppleAppLogs } from './start.ts'; import { appleDevice, hostFixture } from './runtime.fixtures.ts'; diff --git a/packages/platform-apple/src/logs/start.ts b/packages/platform-apple/src/logs/start.ts index 284b3adb3..5116f887d 100644 --- a/packages/platform-apple/src/logs/start.ts +++ b/packages/platform-apple/src/logs/start.ts @@ -11,7 +11,7 @@ import type { RuntimeOwnerRef, } from '@agent-device/contracts/platform'; import type { LogBackend } from '@agent-device/contracts/observability'; -import { AsyncCleanupStack } from '@agent-device/contracts/platform'; +import { AsyncCleanupStack } from '@agent-device/contracts/async-lifecycle'; import { assertAppLogSessionArtifacts, createAppLogLiveHandleFromFinish, diff --git a/packages/platform-apple/src/recording/recovery.test.ts b/packages/platform-apple/src/recording/recovery.test.ts index 9fd9a4430..3c64cf26c 100644 --- a/packages/platform-apple/src/recording/recovery.test.ts +++ b/packages/platform-apple/src/recording/recovery.test.ts @@ -1,5 +1,5 @@ import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createAppleScreenRecordingOperations } from './runtime.ts'; import { appleRecordingHost, diff --git a/packages/platform-apple/src/recording/recovery.ts b/packages/platform-apple/src/recording/recovery.ts index f28daf87d..3432292e9 100644 --- a/packages/platform-apple/src/recording/recovery.ts +++ b/packages/platform-apple/src/recording/recovery.ts @@ -7,7 +7,7 @@ import type { ScreenRecordingRuntimeHost, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type AppleScreenRecordingOperationHost = Readonly<{ diff --git a/packages/platform-apple/src/recording/runtime.test.ts b/packages/platform-apple/src/recording/runtime.test.ts index 29a3dbcbc..178e1efbe 100644 --- a/packages/platform-apple/src/recording/runtime.test.ts +++ b/packages/platform-apple/src/recording/runtime.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import { expect, test, vi } from 'vitest'; import type { AppleScreenRecordingRunnerRequest } from '@agent-device/contracts/platform'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createAppleScreenRecordingOperations, appleScreenRecordingFacts } from './runtime.ts'; import { appleRecordingHost as appleHost, diff --git a/packages/platform-apple/src/recording/runtime.ts b/packages/platform-apple/src/recording/runtime.ts index 881a96fcd..cd874844d 100644 --- a/packages/platform-apple/src/recording/runtime.ts +++ b/packages/platform-apple/src/recording/runtime.ts @@ -8,7 +8,7 @@ import type { ScreenRecordingRuntimeOperations, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { PendingTransferGuard } from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; import { createScreenRecordingLiveHandle } from '@agent-device/capture-kit'; import { completeAppleRecording as completion } from './completion.ts'; import { diff --git a/packages/platform-apple/src/runtime-snapshot.ts b/packages/platform-apple/src/runtime-snapshot.ts index d61d5095a..0165ddd95 100644 --- a/packages/platform-apple/src/runtime-snapshot.ts +++ b/packages/platform-apple/src/runtime-snapshot.ts @@ -10,7 +10,7 @@ import type { import { bindLocalSnapshotInteractor, captureSnapshotSignal, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/snapshot-runtime'; import { isMacOs, type DeviceInfo } from '@agent-device/kernel/device'; /** Apple-owned selection between app snapshots and explicit macOS surface snapshots. */ diff --git a/packages/platform-apple/src/runtime.ts b/packages/platform-apple/src/runtime.ts index 47f71cbcd..91512a4f1 100644 --- a/packages/platform-apple/src/runtime.ts +++ b/packages/platform-apple/src/runtime.ts @@ -9,19 +9,27 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - bindLocalFocusInteractor, - bindLocalScreenshotInteractor, - bindLocalTypeTextInteractor, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { bindElementTextRuntime, elementTextRuntimeOperationFacts, +} from '@agent-device/contracts/element-text-runtime'; +import { + bindLocalFocusInteractor, focusRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - localRuntimeOwner, +} from '@agent-device/contracts/focus-runtime'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { + bindLocalScreenshotInteractor, screenshotRuntimeOperationFacts, - selectorObservationRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/screenshot-runtime'; +import { selectorObservationRuntimeOperationFacts } from '@agent-device/contracts/selector-observation-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; +import { + bindLocalTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import { isIosFamily, isMacOs, diff --git a/packages/platform-harmonyos/src/lifecycle.ts b/packages/platform-harmonyos/src/lifecycle.ts index e012ede9c..9cfe486bb 100644 --- a/packages/platform-harmonyos/src/lifecycle.ts +++ b/packages/platform-harmonyos/src/lifecycle.ts @@ -5,7 +5,7 @@ import type { import { bindDirectApplicationLifecycle, bindLocalApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { DeviceInfo } from '@agent-device/kernel/device'; type HarmonyLifecycleParams = Readonly<{ diff --git a/packages/platform-harmonyos/src/logs/descriptor.ts b/packages/platform-harmonyos/src/logs/descriptor.ts index b6eec5d29..d35c38db3 100644 --- a/packages/platform-harmonyos/src/logs/descriptor.ts +++ b/packages/platform-harmonyos/src/logs/descriptor.ts @@ -4,7 +4,7 @@ import type { DurableResourceEnvelope, RuntimeOwnerRef, } from '@agent-device/contracts/platform'; -import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/app-log-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type HarmonyAppLogDescriptor = Readonly<{ diff --git a/packages/platform-harmonyos/src/recording/recovery.test.ts b/packages/platform-harmonyos/src/recording/recovery.test.ts index 0eff6db35..2857d0e4d 100644 --- a/packages/platform-harmonyos/src/recording/recovery.test.ts +++ b/packages/platform-harmonyos/src/recording/recovery.test.ts @@ -1,5 +1,5 @@ import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createHarmonyScreenRecordingOperations } from './runtime.ts'; import { harmonyCommandSuccess, diff --git a/packages/platform-harmonyos/src/recording/recovery.ts b/packages/platform-harmonyos/src/recording/recovery.ts index 13585d551..5cc2a69b5 100644 --- a/packages/platform-harmonyos/src/recording/recovery.ts +++ b/packages/platform-harmonyos/src/recording/recovery.ts @@ -5,7 +5,7 @@ import type { RuntimeOwnerRef, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type HarmonyRecordingDescriptor = Readonly<{ diff --git a/packages/platform-harmonyos/src/recording/runtime.test.ts b/packages/platform-harmonyos/src/recording/runtime.test.ts index 92ca12830..41fd6e625 100644 --- a/packages/platform-harmonyos/src/recording/runtime.test.ts +++ b/packages/platform-harmonyos/src/recording/runtime.test.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createHarmonyScreenRecordingOperations, harmonyScreenRecordingFacts } from './runtime.ts'; import { harmonyCommandSuccess as success, diff --git a/packages/platform-harmonyos/src/recording/runtime.ts b/packages/platform-harmonyos/src/recording/runtime.ts index c08abc68a..e12515835 100644 --- a/packages/platform-harmonyos/src/recording/runtime.ts +++ b/packages/platform-harmonyos/src/recording/runtime.ts @@ -10,7 +10,7 @@ import type { ScreenRecordingRuntimeOperations, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { PendingTransferGuard } from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; import { createScreenRecordingCompletion, createScreenRecordingLiveHandle, diff --git a/packages/platform-harmonyos/src/runtime.ts b/packages/platform-harmonyos/src/runtime.ts index 6b0b0a3fb..1d817d93a 100644 --- a/packages/platform-harmonyos/src/runtime.ts +++ b/packages/platform-harmonyos/src/runtime.ts @@ -8,19 +8,27 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { elementTextRuntimeOperationFacts } from '@agent-device/contracts/element-text-runtime'; +import { bindLocalFocusInteractor, - bindLocalScreenshotInteractor, - bindLocalTypeTextInteractor, - bindLocalSnapshotInteractor, - elementTextRuntimeOperationFacts, focusRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - localRuntimeOwner, +} from '@agent-device/contracts/focus-runtime'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { + bindLocalScreenshotInteractor, screenshotRuntimeOperationFacts, - selectorObservationRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { selectorObservationRuntimeOperationFacts } from '@agent-device/contracts/selector-observation-runtime'; +import { + bindLocalSnapshotInteractor, snapshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/snapshot-runtime'; +import { + bindLocalTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createHarmonyAppLogRuntime } from './logs/runtime.ts'; import { diff --git a/packages/platform-linux/src/lifecycle.ts b/packages/platform-linux/src/lifecycle.ts index 7e779d736..fb2e487c9 100644 --- a/packages/platform-linux/src/lifecycle.ts +++ b/packages/platform-linux/src/lifecycle.ts @@ -5,7 +5,7 @@ import type { import { bindDirectApplicationLifecycle, bindLocalApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { DeviceInfo } from '@agent-device/kernel/device'; type LinuxLifecycleParams = Readonly<{ diff --git a/packages/platform-linux/src/runtime.ts b/packages/platform-linux/src/runtime.ts index 01e6558b5..9730cd338 100644 --- a/packages/platform-linux/src/runtime.ts +++ b/packages/platform-linux/src/runtime.ts @@ -10,20 +10,29 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - bindLocalFocusInteractor, - bindLocalScreenshotInteractor, - bindLocalTypeTextInteractor, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { bindElementTextRuntime, - captureSnapshotSignal, - createUnavailablePlatformRuntimeFacts, elementTextRuntimeOperationFacts, +} from '@agent-device/contracts/element-text-runtime'; +import { + bindLocalFocusInteractor, focusRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - localRuntimeOwner, - sameRuntimeOwner, +} from '@agent-device/contracts/focus-runtime'; +import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; +import { + bindLocalScreenshotInteractor, screenshotRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { + captureSnapshotSignal, snapshotRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/snapshot-runtime'; +import { + bindLocalTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { bindLinuxApplicationLifecycle } from './lifecycle.ts'; diff --git a/packages/platform-vega/src/lifecycle.ts b/packages/platform-vega/src/lifecycle.ts index 6890f154d..313a201f5 100644 --- a/packages/platform-vega/src/lifecycle.ts +++ b/packages/platform-vega/src/lifecycle.ts @@ -5,7 +5,7 @@ import type { import { bindDirectApplicationLifecycle, bindLocalApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { DeviceInfo } from '@agent-device/kernel/device'; type VegaLifecycleParams = Readonly<{ diff --git a/packages/platform-vega/src/runtime.ts b/packages/platform-vega/src/runtime.ts index c071e08f3..7669d39ef 100644 --- a/packages/platform-vega/src/runtime.ts +++ b/packages/platform-vega/src/runtime.ts @@ -9,10 +9,9 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - createUnavailablePlatformRuntimeFacts, - localRuntimeOwner, - sameRuntimeOwner, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { bindVegaApplicationLifecycle } from './lifecycle.ts'; diff --git a/packages/platform-web/src/lifecycle.ts b/packages/platform-web/src/lifecycle.ts index 83b24ccf8..933621a9c 100644 --- a/packages/platform-web/src/lifecycle.ts +++ b/packages/platform-web/src/lifecycle.ts @@ -5,7 +5,7 @@ import type { import { bindDirectApplicationLifecycle, bindLocalApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { DeviceInfo } from '@agent-device/kernel/device'; type WebLifecycleParams = Readonly<{ diff --git a/packages/platform-web/src/recording/runtime.test.ts b/packages/platform-web/src/recording/runtime.test.ts index e04ab8659..c0dba73e3 100644 --- a/packages/platform-web/src/recording/runtime.test.ts +++ b/packages/platform-web/src/recording/runtime.test.ts @@ -3,7 +3,7 @@ import { join } from 'node:path'; import { tmpdir } from 'node:os'; import { expect, test, vi } from 'vitest'; import type { ScreenRecordingRuntimeHost } from '@agent-device/contracts/platform'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { bindWebScreenRecordingRuntime } from './runtime.ts'; const device = { diff --git a/packages/platform-web/src/recording/runtime.ts b/packages/platform-web/src/recording/runtime.ts index 94605e04c..ae382e91f 100644 --- a/packages/platform-web/src/recording/runtime.ts +++ b/packages/platform-web/src/recording/runtime.ts @@ -7,10 +7,8 @@ import type { ScreenRecordingRuntimeOperations, ScreenRecordingStartInput, } from '@agent-device/contracts/platform'; -import { - PendingTransferGuard, - SCREEN_RECORDING_RESOURCE_KIND, -} from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { assertScreenRecordingOptionsSupported, createScreenRecordingCompletion, diff --git a/packages/platform-web/src/runtime.ts b/packages/platform-web/src/runtime.ts index c14e9086f..9631816b4 100644 --- a/packages/platform-web/src/runtime.ts +++ b/packages/platform-web/src/runtime.ts @@ -8,20 +8,27 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { elementTextRuntimeOperationFacts } from '@agent-device/contracts/element-text-runtime'; +import { bindLocalFocusInteractor, - bindLocalScreenshotInteractor, - bindLocalTypeTextInteractor, - bindLocalSnapshotInteractor, - elementTextRuntimeOperationFacts, focusRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - localRuntimeOwner, +} from '@agent-device/contracts/focus-runtime'; +import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { + bindLocalScreenshotInteractor, screenshotRuntimeOperationFacts, - selectorObservationRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { selectorObservationRuntimeOperationFacts } from '@agent-device/contracts/selector-observation-runtime'; +import { + bindLocalSnapshotInteractor, snapshotRuntimeOperationFacts, - sameRuntimeOwner, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/snapshot-runtime'; +import { + bindLocalTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { bindWebScreenRecordingRuntime } from './recording/runtime.ts'; diff --git a/packages/provider-limrun/src/app-log-descriptor.ts b/packages/provider-limrun/src/app-log-descriptor.ts index ef28144e5..495d1d671 100644 --- a/packages/provider-limrun/src/app-log-descriptor.ts +++ b/packages/provider-limrun/src/app-log-descriptor.ts @@ -4,7 +4,7 @@ import type { DurableResourceEnvelope, RuntimeOwnerRef, } from '@agent-device/contracts/platform'; -import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { APP_LOG_RESOURCE_KIND } from '@agent-device/contracts/app-log-runtime'; import { createDurableResourceEnvelope, encodeDurableDescriptor } from '@agent-device/capture-kit'; export type LimrunAppLogDescriptor = Readonly<{ diff --git a/packages/provider-limrun/src/app-log-poller.ts b/packages/provider-limrun/src/app-log-poller.ts index b03156878..43d230875 100644 --- a/packages/provider-limrun/src/app-log-poller.ts +++ b/packages/provider-limrun/src/app-log-poller.ts @@ -5,7 +5,7 @@ import type { AppLogRuntimeHost, FinishOutcome, } from '@agent-device/contracts/platform'; -import { AsyncCleanupStack } from '@agent-device/contracts/platform'; +import { AsyncCleanupStack } from '@agent-device/contracts/async-lifecycle'; import { createAppLogLiveHandleFromFinish } from '@agent-device/capture-kit'; import type { LogBackend } from '@agent-device/contracts/observability'; import { awaitLimrunOperation } from './request-cancellation.ts'; diff --git a/packages/provider-limrun/src/app-log-reconnect.ts b/packages/provider-limrun/src/app-log-reconnect.ts index 9cfaa9e17..a9fd2f2fd 100644 --- a/packages/provider-limrun/src/app-log-reconnect.ts +++ b/packages/provider-limrun/src/app-log-reconnect.ts @@ -2,7 +2,7 @@ import type Limrun from '@limrun/api'; import { NotFoundError } from '@limrun/api'; import { createInstanceClient as createAndroidInstanceClient } from '@limrun/api/instance-client'; import { createInstanceClient as createIosInstanceClient } from '@limrun/api/ios-client'; -import { AsyncCleanupStack } from '@agent-device/contracts/platform'; +import { AsyncCleanupStack } from '@agent-device/contracts/async-lifecycle'; import type { LimrunAppLogDescriptor } from './app-log-descriptor.ts'; import type { LimrunAppLogReader } from './app-log-poller.ts'; import type { LimrunAppLogReconnectOutcome } from './app-log-runtime.ts'; diff --git a/packages/provider-limrun/src/app-log-runtime.test.ts b/packages/provider-limrun/src/app-log-runtime.test.ts index 7ec574758..b7224d82d 100644 --- a/packages/provider-limrun/src/app-log-runtime.test.ts +++ b/packages/provider-limrun/src/app-log-runtime.test.ts @@ -1,9 +1,9 @@ +import { narrowDeviceBinding } from '@agent-device/contracts/platform-runtime'; import { appStateUse, appsRuntimeUse, bootTargetUse, - narrowDeviceBinding, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { expect, test, vi } from 'vitest'; import { createLimrunAppLogEnvelope } from './app-log-descriptor.ts'; diff --git a/packages/provider-limrun/src/app-log-runtime.ts b/packages/provider-limrun/src/app-log-runtime.ts index e6a78c47d..f6e45ad07 100644 --- a/packages/provider-limrun/src/app-log-runtime.ts +++ b/packages/provider-limrun/src/app-log-runtime.ts @@ -25,15 +25,14 @@ import { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - createUnavailablePlatformRuntimeFacts, - providerRuntimeOwner, - sameRuntimeOwner, - screenshotRuntimeOperationFacts, - elementTextRuntimeOperationFacts, - selectorObservationRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { elementTextRuntimeOperationFacts } from '@agent-device/contracts/element-text-runtime'; +import { providerRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { selectorObservationRuntimeOperationFacts } from '@agent-device/contracts/selector-observation-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import { createLimrunAppLogEnvelope, limrunAppLogDescriptorCodec, diff --git a/packages/provider-limrun/src/interaction-operations.ts b/packages/provider-limrun/src/interaction-operations.ts index 5f9247ffc..e4a21abf4 100644 --- a/packages/provider-limrun/src/interaction-operations.ts +++ b/packages/provider-limrun/src/interaction-operations.ts @@ -1,11 +1,13 @@ import { bindProviderFocusInteractor, - bindProviderScreenshotInteractor, - bindProviderSnapshotInteractor, - bindProviderTypeTextInteractor, focusRuntimeOperationFacts, +} from '@agent-device/contracts/focus-runtime'; +import { bindProviderScreenshotInteractor } from '@agent-device/contracts/screenshot-runtime'; +import { bindProviderSnapshotInteractor } from '@agent-device/contracts/snapshot-runtime'; +import { + bindProviderTypeTextInteractor, typeTextRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/type-text-runtime'; import type { Interactor, RunnerContext } from '@agent-device/contracts/interaction'; import type { RuntimeOperationUnavailability } from '@agent-device/contracts/platform'; import type { DeviceInfo } from '@agent-device/kernel/device'; diff --git a/packages/provider-limrun/src/lifecycle.ts b/packages/provider-limrun/src/lifecycle.ts index f4ae328f7..259a219bf 100644 --- a/packages/provider-limrun/src/lifecycle.ts +++ b/packages/provider-limrun/src/lifecycle.ts @@ -2,7 +2,7 @@ import type { ApplicationLifecycleRuntimeOperations } from '@agent-device/contra import { bindDirectApplicationLifecycle, bindProviderApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { Interactor, RunnerContext } from '@agent-device/contracts/interaction'; import type { ProviderPortReverseOptions } from '@agent-device/contracts/device'; import type { DeviceInfo } from '@agent-device/kernel/device'; diff --git a/packages/provider-limrun/src/runtime.ts b/packages/provider-limrun/src/runtime.ts index e47a6173c..81f4e37e4 100644 --- a/packages/provider-limrun/src/runtime.ts +++ b/packages/provider-limrun/src/runtime.ts @@ -39,7 +39,7 @@ import type { PlatformRuntimeOwner, PlatformRuntimeProviderModule, } from '@agent-device/contracts/platform'; -import { providerRuntimeOwner } from '@agent-device/contracts/platform'; +import { providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { LimrunAppLogDescriptor } from './app-log-descriptor.ts'; import type { LimrunAppLogReader } from './app-log-poller.ts'; import { buildLimrunClientOptions, LIMRUN_CLIENT_HEADER } from './client-options.ts'; diff --git a/packages/provider-webdriver/src/lifecycle.ts b/packages/provider-webdriver/src/lifecycle.ts index 8540dd2a8..026e983c7 100644 --- a/packages/provider-webdriver/src/lifecycle.ts +++ b/packages/provider-webdriver/src/lifecycle.ts @@ -2,7 +2,7 @@ import type { ApplicationLifecycleRuntimeOperations } from '@agent-device/contra import { bindDirectApplicationLifecycle, bindProviderApplicationLifecycleInteractor, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-interaction'; import type { Interactor, RunnerContext } from '@agent-device/contracts/interaction'; import type { DeviceInfo } from '@agent-device/kernel/device'; diff --git a/packages/provider-webdriver/src/platform-runtime.test.ts b/packages/provider-webdriver/src/platform-runtime.test.ts index 1d9d26f01..794c2459f 100644 --- a/packages/provider-webdriver/src/platform-runtime.test.ts +++ b/packages/provider-webdriver/src/platform-runtime.test.ts @@ -1,6 +1,6 @@ import { expect, test, vi } from 'vitest'; import type { PlatformRuntimeHost } from '@agent-device/contracts/platform'; -import { providerRuntimeOwner } from '@agent-device/contracts/platform'; +import { providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { Interactor } from '@agent-device/contracts/interaction'; import { createWebDriverPlatformRuntimeOwner } from './platform-runtime.ts'; diff --git a/packages/provider-webdriver/src/platform-runtime.ts b/packages/provider-webdriver/src/platform-runtime.ts index dfdcf7659..1db4051e6 100644 --- a/packages/provider-webdriver/src/platform-runtime.ts +++ b/packages/provider-webdriver/src/platform-runtime.ts @@ -1,30 +1,44 @@ +import type { + AppDeploymentInput, + DeployMaterializedAppInput, + MaterializeAppSourceInput, + MaterializedAppSource, +} from '@agent-device/contracts/app-deployment-runtime'; import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { bindProviderFocusInteractor, - bindProviderScreenshotInteractor, - bindProviderTypeTextInteractor, - bindProviderSnapshotInteractor, - createUnavailablePlatformRuntimeFacts, - sameRuntimeOwner, focusRuntimeOperationFacts, - screenshotRuntimeOperationFacts, - typeTextRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, - type AppDeploymentInput, - type DeployMaterializedAppInput, +} from '@agent-device/contracts/focus-runtime'; +import { type DeviceBinding, - type MaterializeAppSourceInput, - type MaterializedAppSource, - type PlatformRuntimeHost, - type PlatformRuntimeOperations, - type PlatformRuntimeOwner, type RuntimeFacts, type RuntimeOperationFact, type RuntimeOperationUnavailability, type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; + sameRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { + PlatformRuntimeHost, + PlatformRuntimeOperations, + PlatformRuntimeOwner, +} from '@agent-device/contracts/platform-runtime-operations'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; +import { + bindProviderScreenshotInteractor, + screenshotRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { + bindProviderSnapshotInteractor, + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; +import { + bindProviderTypeTextInteractor, + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import type { Interactor, RunnerContext } from '@agent-device/contracts/interaction'; import { readRecentNetworkTrafficFromText } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; diff --git a/packages/provider-webdriver/src/runtime.ts b/packages/provider-webdriver/src/runtime.ts index 34d3d7a56..d7977ce9f 100644 --- a/packages/provider-webdriver/src/runtime.ts +++ b/packages/provider-webdriver/src/runtime.ts @@ -17,7 +17,7 @@ import type { PlatformRuntimeOwner, PlatformRuntimeProviderModule, } from '@agent-device/contracts/platform'; -import { providerRuntimeOwner } from '@agent-device/contracts/platform'; +import { providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createCloudWebDriverCapabilities, diff --git a/packages/provider-webdriver/src/webdriver-interactor.test.ts b/packages/provider-webdriver/src/webdriver-interactor.test.ts index 56a4355eb..c26da0b62 100644 --- a/packages/provider-webdriver/src/webdriver-interactor.test.ts +++ b/packages/provider-webdriver/src/webdriver-interactor.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test, vi } from 'vitest'; -import { buildGesturePlan } from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import { AppError } from '@agent-device/kernel/errors'; import { createCloudWebDriverCapabilities } from './capabilities.ts'; import type { WebDriverClient, W3CActionSequence } from './webdriver-client.ts'; diff --git a/packages/provider-webdriver/src/webdriver-interactor.ts b/packages/provider-webdriver/src/webdriver-interactor.ts index 7867ff676..0b699483d 100644 --- a/packages/provider-webdriver/src/webdriver-interactor.ts +++ b/packages/provider-webdriver/src/webdriver-interactor.ts @@ -10,7 +10,7 @@ import type { SnapshotResult, TvRemoteButton, } from '@agent-device/contracts/interaction'; -import { buildScrollGesturePlan } from '@agent-device/contracts/interaction'; +import { buildScrollGesturePlan } from '@agent-device/contracts/scroll-gesture'; import type { SettingOptions } from '@agent-device/contracts/settings'; import { AppError } from '@agent-device/kernel/errors'; import { diff --git a/scripts/layering/package-boundaries.test.ts b/scripts/layering/package-boundaries.test.ts index 7fbca25b0..3ad04b620 100644 --- a/scripts/layering/package-boundaries.test.ts +++ b/scripts/layering/package-boundaries.test.ts @@ -44,21 +44,76 @@ const contracts: WorkspacePackage = { const ALL = [kernel, contracts]; const CONTRACT_EXPORTS = [ + '@agent-device/contracts/alert-contract', + '@agent-device/contracts/android-input-ownership', + '@agent-device/contracts/android-snapshot-quality', + '@agent-device/contracts/android-system-chrome', + '@agent-device/contracts/app-deployment-runtime', + '@agent-device/contracts/app-deployment-runtime-plan', + '@agent-device/contracts/app-inventory-runtime', + '@agent-device/contracts/app-log-runtime', + '@agent-device/contracts/app-state-runtime', + '@agent-device/contracts/apple-multitouch-support', + '@agent-device/contracts/application-lifecycle-interaction', + '@agent-device/contracts/application-lifecycle-runtime', + '@agent-device/contracts/application-lifecycle-runtime-plan', + '@agent-device/contracts/async-lifecycle', + '@agent-device/contracts/audio-probe-result', + '@agent-device/contracts/audio-probe-support', + '@agent-device/contracts/back-mode', '@agent-device/contracts/capture', + '@agent-device/contracts/click-button', '@agent-device/contracts/client', '@agent-device/contracts/command', + '@agent-device/contracts/command-platform-execution', '@agent-device/contracts/device', + '@agent-device/contracts/device-readiness-runtime', + '@agent-device/contracts/device-shutdown-runtime', '@agent-device/contracts/divergence', + '@agent-device/contracts/durable-resource', + '@agent-device/contracts/durable-resource-envelope', + '@agent-device/contracts/element-text-runtime', + '@agent-device/contracts/focus-runtime', + '@agent-device/contracts/gesture-input', + '@agent-device/contracts/gesture-normalization', + '@agent-device/contracts/gesture-plan', + '@agent-device/contracts/gesture-plan-types', '@agent-device/contracts/interaction', + '@agent-device/contracts/interaction-error', + '@agent-device/contracts/interaction-guarantees', + '@agent-device/contracts/interactor-types', + '@agent-device/contracts/logs-runtime-plan', + '@agent-device/contracts/navigation', + '@agent-device/contracts/network-runtime', + '@agent-device/contracts/network-runtime-plan', '@agent-device/contracts/observability', '@agent-device/contracts/platform', + '@agent-device/contracts/platform-module', + '@agent-device/contracts/platform-runtime', + '@agent-device/contracts/platform-runtime-host', + '@agent-device/contracts/platform-runtime-operations', + '@agent-device/contracts/platform-runtime-unavailable', '@agent-device/contracts/progress', + '@agent-device/contracts/record-runtime-cutover', '@agent-device/contracts/recording', '@agent-device/contracts/remote', '@agent-device/contracts/replay', + '@agent-device/contracts/screen-recording-runtime', + '@agent-device/contracts/screen-recording-runtime-plan', + '@agent-device/contracts/screenshot-runtime', + '@agent-device/contracts/scroll-command', + '@agent-device/contracts/scroll-gesture', + '@agent-device/contracts/selector-observation-runtime', '@agent-device/contracts/session', '@agent-device/contracts/settings', '@agent-device/contracts/snapshot', + '@agent-device/contracts/snapshot-runtime', + '@agent-device/contracts/startup-recovery-fence', + '@agent-device/contracts/tv-remote', + '@agent-device/contracts/type-text-runtime', + '@agent-device/contracts/viewport-runtime', + '@agent-device/contracts/wait', + '@agent-device/contracts/wait-runtime-plan', ] as const; function rules(violations: { rule: string }[]): string[] { @@ -540,7 +595,7 @@ test('Node resolution enforces the exports map at runtime', () => { '@agent-device/kernel/src/errors.ts', '@agent-device/kernel/internal-not-exported', '@agent-device/kernel', - '@agent-device/contracts/gesture-plan', + '@agent-device/contracts/clipboard', '@agent-device/contracts/src/gesture-plan.ts', '@agent-device/contracts', '@agent-device/contracts/src/snapshot-text.ts', diff --git a/scripts/layering/record-runtime-registry-policy.ts b/scripts/layering/record-runtime-registry-policy.ts index 0168ea334..855046517 100644 --- a/scripts/layering/record-runtime-registry-policy.ts +++ b/scripts/layering/record-runtime-registry-policy.ts @@ -31,7 +31,14 @@ function importedRecordRuntimeAssertionName(node: unknown): string | undefined { visitAst(node, (candidate) => { if (candidate.type !== 'ImportDeclaration') return; const source = candidate.source as Record | undefined; - if (source?.type !== 'Literal' || source.value !== '@agent-device/contracts/platform') return; + // Any contracts entry, not one named subpath: the assertion's provenance is what + // this rule pins, and #1959 splits that vocabulary across per-module entries. + if ( + source?.type !== 'Literal' || + !String(source.value).startsWith('@agent-device/contracts/') + ) { + return; + } const specifiers = candidate.specifiers as readonly Record[] | undefined; const assertion = specifiers?.find((specifier) => { const imported = specifier.imported as Record | undefined; diff --git a/src/__tests__/contracts-entry-closure.test.ts b/src/__tests__/contracts-entry-closure.test.ts new file mode 100644 index 000000000..4e4fce386 --- /dev/null +++ b/src/__tests__/contracts-entry-closure.test.ts @@ -0,0 +1,98 @@ +import { expect, test } from 'vitest'; +import fs from 'node:fs'; +import path from 'node:path'; +import { eagerClosureOf, eagerlyEvaluatedModules } from './eager-import-closure.fixtures.ts'; + +/** + * `@agent-device/contracts/platform` and `/interaction` union 32 and 18 vocabulary + * modules. A file that value-imports either one evaluates the whole union to reach a + * single function, and because permanent hubs sat behind them (#1959) that union rode + * into ~470 of the suite's ~970 test graphs. + * + * Every one of those modules now has its own entry subpath, so the narrow import is + * always available. These two tests keep it that way from both directions: the first + * pins the four hubs the issue named, and the second closes the general case so the + * clump cannot re-form behind a hub nobody thought to list. + * + * Type-only importers are untouched and stay legal — `import type` is erased, so it + * evaluates nothing. That is the same distinction the walker itself draws, which is + * why this reads the AST through it rather than matching specifier text. + */ + +const repoRoot = path.resolve(import.meta.dirname, '../..'); +const CLUMP_ENTRIES = [ + '@agent-device/contracts/platform', + '@agent-device/contracts/interaction', +] as const; +const CLUMP_FACADES = [ + 'packages/contracts/src/facades/platform.ts', + 'packages/contracts/src/facades/interaction.ts', +].map((file) => path.resolve(repoRoot, file)); + +const HUBS = [ + 'src/core/command-descriptor/registry.ts', + 'src/core/capabilities.ts', + 'src/core/interactors/register-builtins.ts', + 'src/core/command-descriptor/platform-execution-entry.ts', +]; + +function sourceFiles(): string[] { + const found: string[] = []; + const walk = (dir: string): void => { + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + const full = path.join(dir, entry.name); + if (entry.isDirectory()) { + if (entry.name !== 'node_modules') walk(full); + } else if (entry.name.endsWith('.ts')) found.push(full); + } + }; + walk(path.join(repoRoot, 'src')); + for (const pkg of fs.readdirSync(path.join(repoRoot, 'packages'))) { + const src = path.join(repoRoot, 'packages', pkg, 'src'); + if (fs.existsSync(src)) walk(src); + } + return found; +} + +test('the hubs behind the contracts clump never evaluate either wide facade', () => { + const offenders = HUBS.flatMap((hub) => { + const carried = eagerClosureOf(path.resolve(repoRoot, hub)).filter((file) => + CLUMP_FACADES.includes(file), + ); + return carried.map((file) => `${hub} -> ${path.relative(repoRoot, file)}`); + }); + + expect( + offenders, + 'These hubs sit in hundreds of test graphs, so whatever they evaluate, the suite pays for ' + + 'everywhere. Import the symbol from the vocabulary module that owns it ' + + '(@agent-device/contracts/) instead of the wide facade.', + ).toEqual([]); +}); + +test('no source file value-imports the wide contracts facades', () => { + const offenders: string[] = []; + let typeOnlyImporters = 0; + for (const file of sourceFiles()) { + const source = fs.readFileSync(file, 'utf8'); + // Text-filter before parsing: a file that never names the specifier cannot import + // it, and parsing all ~3000 sources costs more than the unit lane's budget allows. + const mentions = CLUMP_ENTRIES.filter((entry) => source.includes(`${entry}'`)); + if (mentions.length === 0) continue; + const evaluated = new Set(eagerlyEvaluatedModules(file, source)); + for (const entry of mentions) { + if (evaluated.has(entry)) offenders.push(`${path.relative(repoRoot, file)} -> ${entry}`); + else typeOnlyImporters += 1; + } + } + + // Non-vacuity: an empty offender list also describes a scan that parsed nothing, so + // require that the surviving type-only importers were seen and classified as erased. + expect(typeOnlyImporters).toBeGreaterThan(300); + expect( + offenders.sort(), + 'Value-importing these facades evaluates every module they re-export from. Each of those ' + + 'modules has its own entry subpath in packages/contracts/package.json — import from that. ' + + '`import type` from the facades stays fine: it is erased, so it evaluates nothing.', + ).toEqual([]); +}); diff --git a/src/__tests__/contracts/apple-os-capability-table-parity.test.ts b/src/__tests__/contracts/apple-os-capability-table-parity.test.ts index 8f7d8b34a..265a2302c 100644 --- a/src/__tests__/contracts/apple-os-capability-table-parity.test.ts +++ b/src/__tests__/contracts/apple-os-capability-table-parity.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { isAudioProbeSupportedDevice } from '@agent-device/contracts/platform'; +import { isAudioProbeSupportedDevice } from '@agent-device/contracts/audio-probe-support'; import { isIosFamily, isMacOs, diff --git a/src/__tests__/contracts/interaction-contract-coverage.test.ts b/src/__tests__/contracts/interaction-contract-coverage.test.ts index 1f9378f68..7918d5b83 100644 --- a/src/__tests__/contracts/interaction-contract-coverage.test.ts +++ b/src/__tests__/contracts/interaction-contract-coverage.test.ts @@ -4,7 +4,7 @@ import { INTERACTION_DISPATCH_PATHS, INTERACTION_GUARANTEES, INTERACTION_PATH_IDS, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/interaction-guarantees'; import { CONTRACT_COVERAGE } from '../../../test/integration/interaction-contract/index.ts'; // ADR 0011 Layer-3 root gate: the contract scenario suite is registry-driven. Every diff --git a/src/__tests__/contracts/interaction-guarantees.test.ts b/src/__tests__/contracts/interaction-guarantees.test.ts index edffe8aa2..fb7833b13 100644 --- a/src/__tests__/contracts/interaction-guarantees.test.ts +++ b/src/__tests__/contracts/interaction-guarantees.test.ts @@ -7,7 +7,7 @@ import { INTERACTION_DISPATCH_PATHS, INTERACTION_GUARANTEES, INTERACTION_PATH_IDS, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/interaction-guarantees'; // ADR 0011 Layer-1 root gate: the matrix must stay complete (typed) AND honest // (referenced implementations exist, waivers carry reasons). A cell that diff --git a/src/__tests__/test-utils/device-inventory-gateways.ts b/src/__tests__/test-utils/device-inventory-gateways.ts index 57ab0b8fc..e76333610 100644 --- a/src/__tests__/test-utils/device-inventory-gateways.ts +++ b/src/__tests__/test-utils/device-inventory-gateways.ts @@ -10,7 +10,7 @@ import type { InventoryPlatformModule, PlatformRequestScope, } from '@agent-device/contracts/platform'; -import { createPlatformModuleRegistry } from '@agent-device/contracts/platform'; +import { createPlatformModuleRegistry } from '@agent-device/contracts/platform-module'; import type { DeviceInfo, Platform } from '@agent-device/kernel/device'; import { withDeviceInventoryContext } from '../../core/device-inventory-context.ts'; import { createComposedDeviceInventoryGateways } from '../../platform-runtime-device-inventory.ts'; diff --git a/src/__tests__/test-utils/property-arbitraries.ts b/src/__tests__/test-utils/property-arbitraries.ts index 0e283c547..4dada8f5f 100644 --- a/src/__tests__/test-utils/property-arbitraries.ts +++ b/src/__tests__/test-utils/property-arbitraries.ts @@ -1,9 +1,8 @@ import { COORDINATE_GESTURE_KINDS, - SCROLL_DIRECTIONS, - SWIPE_PRESETS, type GesturePayload, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-input'; +import { SCROLL_DIRECTIONS, SWIPE_PRESETS } from '@agent-device/contracts/scroll-gesture'; import { attachRefs, type Point, diff --git a/src/__tests__/test-utils/runtime-operation-facts.ts b/src/__tests__/test-utils/runtime-operation-facts.ts index a0eb209a3..196509a8f 100644 --- a/src/__tests__/test-utils/runtime-operation-facts.ts +++ b/src/__tests__/test-utils/runtime-operation-facts.ts @@ -1,10 +1,8 @@ -import { - applicationLifecycleOperationFacts, - screenshotRuntimeOperationFacts, - elementTextRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - type RuntimeOperationFact, -} from '@agent-device/contracts/platform'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import { elementTextRuntimeOperationFacts } from '@agent-device/contracts/element-text-runtime'; +import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; const unavailable: RuntimeOperationFact = Object.freeze({ available: false, diff --git a/src/__tests__/test-utils/screen-recording-live-handle.ts b/src/__tests__/test-utils/screen-recording-live-handle.ts index 1e97a6822..c79181782 100644 --- a/src/__tests__/test-utils/screen-recording-live-handle.ts +++ b/src/__tests__/test-utils/screen-recording-live-handle.ts @@ -2,10 +2,8 @@ import { createDurableResourceEnvelope, createScreenRecordingLiveHandle, } from '@agent-device/capture-kit'; -import { - localRuntimeOwner, - type ScreenRecordingLiveSnapshot, -} from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import type { ScreenRecordingLiveSnapshot } from '@agent-device/contracts/screen-recording-runtime'; import { deviceIdentity } from '@agent-device/kernel/device'; import type { SessionState } from '../../daemon/types.ts'; diff --git a/src/commands/capture/alert.ts b/src/commands/capture/alert.ts index 679ee7794..0c229afe8 100644 --- a/src/commands/capture/alert.ts +++ b/src/commands/capture/alert.ts @@ -1,4 +1,4 @@ -import { ALERT_ACTIONS, type AlertAction } from '@agent-device/contracts/interaction'; +import { ALERT_ACTIONS, type AlertAction } from '@agent-device/contracts/alert-contract'; import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; import type { AlertCommandOptions } from '@agent-device/contracts/client'; import { compactRecord, enumField, integerField } from '../command-input.ts'; diff --git a/src/commands/interaction/gesture.ts b/src/commands/interaction/gesture.ts index 9bdf7d4fe..e515c2599 100644 --- a/src/commands/interaction/gesture.ts +++ b/src/commands/interaction/gesture.ts @@ -4,7 +4,7 @@ import type { CliFlags } from '@agent-device/contracts/command'; import { commonInputFromFlags, request } from '../cli-grammar/common.ts'; import type { CliReader, DaemonWriter } from '../cli-grammar/types.ts'; import { readGestureInput } from './metadata.ts'; -import { gesturePayloadFromPositionals } from '@agent-device/contracts/interaction'; +import { gesturePayloadFromPositionals } from '@agent-device/contracts/gesture-normalization'; export const gestureCliReaders = { gesture: gestureInputFromCli, diff --git a/src/commands/interaction/interactions.ts b/src/commands/interaction/interactions.ts index 1750d32c9..1543f6e4e 100644 --- a/src/commands/interaction/interactions.ts +++ b/src/commands/interaction/interactions.ts @@ -8,7 +8,7 @@ import type { import { assertNoRemovedSwipeInput, swipePayloadFromPositionals, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-normalization'; import { AppError } from '@agent-device/kernel/errors'; import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; import { diff --git a/src/commands/interaction/metadata.ts b/src/commands/interaction/metadata.ts index 262524079..c8c4537a8 100644 --- a/src/commands/interaction/metadata.ts +++ b/src/commands/interaction/metadata.ts @@ -1,21 +1,23 @@ +import { CLICK_BUTTONS } from '@agent-device/contracts/click-button'; import { - CLICK_BUTTONS, + type DragGesturePayload, + type FlingGesturePayload, GESTURE_KINDS, + type PanGesturePayload, + type PinchGesturePayload, + type RotateGesturePayload, + type SwipeGesturePayload, + type TransformGesturePayload, readGesturePayload, +} from '@agent-device/contracts/gesture-input'; +import { SCROLL_DURATION_MAX_MS } from '@agent-device/contracts/scroll-command'; +import { SCROLL_DIRECTIONS, - SCROLL_DURATION_MAX_MS, SWIPE_PATTERNS, SWIPE_PAUSE_MAX_MS, SWIPE_PRESETS, SWIPE_REPETITION_MAX, - type FlingGesturePayload, - type DragGesturePayload, - type PanGesturePayload, - type PinchGesturePayload, - type RotateGesturePayload, - type SwipeGesturePayload, - type TransformGesturePayload, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/scroll-gesture'; import { FIND_LOCATORS } from '@agent-device/selectors'; import { defineCommandMetadata } from '../command-contract.ts'; import { diff --git a/src/commands/interaction/runtime/gesture-command.ts b/src/commands/interaction/runtime/gesture-command.ts index 4a542b92a..12cbe5233 100644 --- a/src/commands/interaction/runtime/gesture-command.ts +++ b/src/commands/interaction/runtime/gesture-command.ts @@ -4,7 +4,7 @@ import type { GestureIntent, GestureSemanticInput, } from '@agent-device/contracts/interaction'; -import { buildGesturePlan } from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import type { Point } from '@agent-device/kernel/snapshot'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '../../../utils/success-text.ts'; diff --git a/src/commands/interaction/runtime/gestures.ts b/src/commands/interaction/runtime/gestures.ts index 30d68c778..bc57edc63 100644 --- a/src/commands/interaction/runtime/gestures.ts +++ b/src/commands/interaction/runtime/gestures.ts @@ -7,13 +7,15 @@ import type { ScrollInputDirection, } from '@agent-device/contracts/interaction'; import { - assertExclusiveScrollDistanceInputs, buildDragGesturePlan, + singlePointerPlanEndpoints, +} from '@agent-device/contracts/gesture-plan'; +import { + assertExclusiveScrollDistanceInputs, honoredScrollDurationMs, normalizeScrollDurationMs, resolveScrollExecutionOptions, - singlePointerPlanEndpoints, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/scroll-command'; import { AppError } from '@agent-device/kernel/errors'; import { SELECTOR_PIPELINE_POLICIES } from '../../../core/selector-pipeline-policy.ts'; import type { Point, Rect, SnapshotNode } from '@agent-device/kernel/snapshot'; @@ -130,7 +132,7 @@ export type GestureDirection = ScrollDirection; export { SCROLL_INPUT_DIRECTIONS, type ScrollInputDirection, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/scroll-gesture'; export type ScrollTarget = | InteractionTarget diff --git a/src/commands/interaction/runtime/resolution.test.ts b/src/commands/interaction/runtime/resolution.test.ts index aa744b95c..74956e7ae 100644 --- a/src/commands/interaction/runtime/resolution.test.ts +++ b/src/commands/interaction/runtime/resolution.test.ts @@ -10,7 +10,7 @@ import { import { resolveRecordedTarget } from '@agent-device/selectors'; import { makeSnapshotState } from '../../../__tests__/test-utils/snapshot-builders.ts'; import type { Point } from '@agent-device/kernel/snapshot'; -import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction'; +import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction-error'; import { clickRefE2, coveredByTabBarSnapshot, diff --git a/src/commands/interaction/runtime/resolution.ts b/src/commands/interaction/runtime/resolution.ts index 0ad652415..741a7d145 100644 --- a/src/commands/interaction/runtime/resolution.ts +++ b/src/commands/interaction/runtime/resolution.ts @@ -48,7 +48,7 @@ import type { ResolutionDisclosure, ResolvedInteractionTarget, } from '@agent-device/contracts/interaction'; -import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction'; +import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction-error'; import type { BackendActionResult, BackendCommandContext, diff --git a/src/commands/interaction/runtime/selector-read.ts b/src/commands/interaction/runtime/selector-read.ts index 2990e51a4..a074724c6 100644 --- a/src/commands/interaction/runtime/selector-read.ts +++ b/src/commands/interaction/runtime/selector-read.ts @@ -28,7 +28,7 @@ import type { ResolvedTarget, SelectorTarget, } from '@agent-device/contracts/interaction'; -import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction'; +import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction-error'; import type { RuntimeCommand } from '../../runtime-types.ts'; import { assertExpectedResolvedTarget, type ExpectedResolvedTarget } from './resolution.ts'; import { diff --git a/src/commands/interaction/runtime/selector-wait.ts b/src/commands/interaction/runtime/selector-wait.ts index 2b72e560e..38ef28f0b 100644 --- a/src/commands/interaction/runtime/selector-wait.ts +++ b/src/commands/interaction/runtime/selector-wait.ts @@ -1,5 +1,5 @@ import { AppError } from '@agent-device/kernel/errors'; -import { WAIT_REASONS } from '@agent-device/contracts/interaction'; +import { WAIT_REASONS } from '@agent-device/contracts/wait'; import { findNodeByRef, normalizeRef, type SnapshotNode } from '@agent-device/kernel/snapshot'; import { annotationLocalIdentity, readNodeLocalIdentity } from '@agent-device/ad-script'; import { diff --git a/src/commands/interaction/runtime/wait-polling.ts b/src/commands/interaction/runtime/wait-polling.ts index be817b8a8..bdc1f04c8 100644 --- a/src/commands/interaction/runtime/wait-polling.ts +++ b/src/commands/interaction/runtime/wait-polling.ts @@ -1,6 +1,6 @@ import { AppError } from '@agent-device/kernel/errors'; -import { WAIT_REASONS } from '@agent-device/contracts/interaction'; -import { isUnreadableCaptureContentError } from '@agent-device/contracts/platform'; +import { WAIT_REASONS } from '@agent-device/contracts/wait'; +import { isUnreadableCaptureContentError } from '@agent-device/contracts/android-snapshot-quality'; import { selectorPollBudget } from '../../../core/selector-pipeline.ts'; import { SELECTOR_PIPELINE_POLICIES, diff --git a/src/commands/system/index.ts b/src/commands/system/index.ts index 054a07305..0dfebf016 100644 --- a/src/commands/system/index.ts +++ b/src/commands/system/index.ts @@ -1,13 +1,13 @@ import type { ClipboardCommandOptions } from '@agent-device/contracts/client'; import { DEVICE_ROTATIONS, parseDeviceRotation } from '@agent-device/contracts/device'; import type { BackMode } from '@agent-device/contracts/interaction'; +import { BACK_MODES } from '@agent-device/contracts/back-mode'; import { - BACK_MODES, - parseTvRemoteButton, - TV_REMOTE_BUTTON_USAGE, TV_REMOTE_BUTTONS, + TV_REMOTE_BUTTON_USAGE, + parseTvRemoteButton, tvRemoteDurationMode, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/tv-remote'; import { AppError } from '@agent-device/kernel/errors'; import type { CommandSchemaOverride } from '../../cli-schema/types.ts'; import { diff --git a/src/commands/system/navigation-projection.ts b/src/commands/system/navigation-projection.ts index 56ab54b85..61a0e9669 100644 --- a/src/commands/system/navigation-projection.ts +++ b/src/commands/system/navigation-projection.ts @@ -1,15 +1,13 @@ import { DEVICE_ROTATIONS, type DeviceRotation } from '@agent-device/contracts/device'; -import { - BACK_MODES, - TV_REMOTE_BUTTONS, - type AppSwitcherCommandResult, - type BackCommandResult, - type HomeCommandResult, - type OrientationCommandResult, - type TvRemoteCommandResult, - type BackMode, - type TvRemoteButton, -} from '@agent-device/contracts/interaction'; +import { BACK_MODES, type BackMode } from '@agent-device/contracts/back-mode'; +import type { + AppSwitcherCommandResult, + BackCommandResult, + HomeCommandResult, + OrientationCommandResult, + TvRemoteCommandResult, +} from '@agent-device/contracts/navigation'; +import { TV_REMOTE_BUTTONS, type TvRemoteButton } from '@agent-device/contracts/tv-remote'; import type { SettleCommandOptions } from '@agent-device/contracts/client'; import type { ExecutableCommandProjection } from '../command-contract.ts'; diff --git a/src/commands/system/runtime/system.ts b/src/commands/system/runtime/system.ts index 1473a3fef..c3f8f8fed 100644 --- a/src/commands/system/runtime/system.ts +++ b/src/commands/system/runtime/system.ts @@ -8,7 +8,7 @@ import type { } from '../../../backend.ts'; import type { CommandContext } from '../../../runtime-contract.ts'; import type { BackMode } from '@agent-device/contracts/interaction'; -import { parseTvRemoteButton } from '@agent-device/contracts/interaction'; +import { parseTvRemoteButton } from '@agent-device/contracts/tv-remote'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '../../../utils/success-text.ts'; import { requireIntInRange } from '../../../utils/validation.ts'; diff --git a/src/core/__tests__/gesture-capabilities.test.ts b/src/core/__tests__/gesture-capabilities.test.ts index 28e37b767..ab9962c88 100644 --- a/src/core/__tests__/gesture-capabilities.test.ts +++ b/src/core/__tests__/gesture-capabilities.test.ts @@ -7,7 +7,7 @@ import type { import { normalizePublicGesture, normalizePublicSwipeMotion, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-normalization'; import { requireGestureSupported } from '../capabilities.ts'; import { AppError } from '@agent-device/kernel/errors'; import type { DeviceInfo } from '@agent-device/kernel/device'; diff --git a/src/core/__tests__/gesture-plan-test-utils.ts b/src/core/__tests__/gesture-plan-test-utils.ts index bd4df18c5..fca81fc7a 100644 --- a/src/core/__tests__/gesture-plan-test-utils.ts +++ b/src/core/__tests__/gesture-plan-test-utils.ts @@ -1,10 +1,10 @@ import assert from 'node:assert/strict'; import type { Point, Rect } from '@agent-device/kernel/snapshot'; -import { - buildGesturePlan, - type GesturePlan, - type MultiTouchGesturePlan, -} from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; +import type { + GesturePlan, + MultiTouchGesturePlan, +} from '@agent-device/contracts/gesture-plan-types'; export const PORTRAIT: Rect = { x: 0, y: 0, width: 390, height: 844 }; export const LANDSCAPE: Rect = { x: 0, y: 0, width: 844, height: 390 }; diff --git a/src/core/__tests__/gesture-plan-viewport.test.ts b/src/core/__tests__/gesture-plan-viewport.test.ts index 79151d98d..4394c2191 100644 --- a/src/core/__tests__/gesture-plan-viewport.test.ts +++ b/src/core/__tests__/gesture-plan-viewport.test.ts @@ -1,9 +1,8 @@ import { - buildGesturePlan, - GESTURE_SAMPLE_INTERVAL_MS, gesturePayloadFromPositionals, normalizePublicGesture, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-normalization'; +import { GESTURE_SAMPLE_INTERVAL_MS, buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import { PUBLIC_PLATFORMS } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import fc from 'fast-check'; diff --git a/src/core/__tests__/gesture-plan.test.ts b/src/core/__tests__/gesture-plan.test.ts index 5fc71465a..2c9ab6643 100644 --- a/src/core/__tests__/gesture-plan.test.ts +++ b/src/core/__tests__/gesture-plan.test.ts @@ -1,9 +1,9 @@ import assert from 'node:assert/strict'; import { describe, test } from 'vitest'; import { - buildGesturePlan, GESTURE_INITIAL_ANGLE_DEGREES, -} from '@agent-device/contracts/interaction'; + buildGesturePlan, +} from '@agent-device/contracts/gesture-plan'; import { centroid, distance, diff --git a/src/core/__tests__/snapshot-chrome-android-statusbar.test.ts b/src/core/__tests__/snapshot-chrome-android-statusbar.test.ts index 13d3df2f5..84e56e680 100644 --- a/src/core/__tests__/snapshot-chrome-android-statusbar.test.ts +++ b/src/core/__tests__/snapshot-chrome-android-statusbar.test.ts @@ -8,7 +8,7 @@ import { walkInteractiveOnlyAndroidFixture, walkNonRawAndroidFixture, } from '../../__tests__/test-utils/android-ui-hierarchy-fixtures.ts'; -import { isAndroidSystemChromeWindowResourceId } from '@agent-device/contracts/platform'; +import { isAndroidSystemChromeWindowResourceId } from '@agent-device/contracts/android-system-chrome'; /** * The `walk*AndroidFixture` helpers run a real `--raw` device capture through diff --git a/src/core/capabilities.ts b/src/core/capabilities.ts index 9b801bd0c..256f2a9fe 100644 --- a/src/core/capabilities.ts +++ b/src/core/capabilities.ts @@ -8,7 +8,7 @@ import type { GestureCommandInput, GestureSemanticInput, } from '@agent-device/contracts/interaction'; -import { assertAppleMultiTouchSupported } from '@agent-device/contracts/platform'; +import { assertAppleMultiTouchSupported } from '@agent-device/contracts/apple-multitouch-support'; // Populate the PlatformPlugin registry once at module load (idempotent; registers // only lazy closures, so no leaf code is imported and CLI cold-start is unaffected diff --git a/src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts index 209ec3d6f..7e728a9a8 100644 --- a/src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/application-lifecycle-runtime-execution.test.ts @@ -2,7 +2,7 @@ import { closeApplicationRuntimePlanUses, closeApplicationRuntimeUse, closeApplicationWithRuntimeHintClearUse, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts index 27e11a8fd..eccd932b2 100644 --- a/src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/apps-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { appsRuntimeUse } from '@agent-device/contracts/platform'; +import { appsRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; test('apps declares the complete request-scoped runtime use', () => { diff --git a/src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts index 780e4d0ff..18933aafc 100644 --- a/src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/appstate-runtime-execution.test.ts @@ -1,4 +1,7 @@ -import { appStateRuntimeUses, appStateUse } from '@agent-device/contracts/platform'; +import { + appStateRuntimeUses, + appStateUse, +} from '@agent-device/contracts/platform-runtime-operations'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts index 95714954d..04391b610 100644 --- a/src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/boot-runtime-execution.test.ts @@ -2,7 +2,7 @@ import { bootTargetHeadlessUse, bootTargetUse, deviceBootRuntimeUses, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime-operations'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/find-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/find-runtime-execution.test.ts index cfba8a76d..acbeee88a 100644 --- a/src/core/command-descriptor/__tests__/find-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/find-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { findRuntimePlanUses } from '@agent-device/contracts/platform'; +import { findRuntimePlanUses } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; import { BASE_COMMAND_CAPABILITY_MATRIX } from '../../capabilities.ts'; diff --git a/src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts index bb2332adb..0c93bb596 100644 --- a/src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/focus-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { focusRuntimeUse } from '@agent-device/contracts/platform'; +import { focusRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; import { BASE_COMMAND_CAPABILITY_MATRIX, diff --git a/src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts index 3f8736d35..bfccc60a9 100644 --- a/src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/logs-runtime-execution.test.ts @@ -1,4 +1,4 @@ -import { appLogRuntimePlanUses } from '@agent-device/contracts/platform'; +import { appLogRuntimePlanUses } from '@agent-device/contracts/logs-runtime-plan'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/network-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/network-runtime-execution.test.ts index 41133f58d..3139d8783 100644 --- a/src/core/command-descriptor/__tests__/network-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/network-runtime-execution.test.ts @@ -1,4 +1,7 @@ -import { networkDumpUse, resolveNetworkRuntimePlan } from '@agent-device/contracts/platform'; +import { + networkDumpUse, + resolveNetworkRuntimePlan, +} from '@agent-device/contracts/network-runtime-plan'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/platform-execution.test.ts b/src/core/command-descriptor/__tests__/platform-execution.test.ts index 2bd4e8e1e..9dcd4b971 100644 --- a/src/core/command-descriptor/__tests__/platform-execution.test.ts +++ b/src/core/command-descriptor/__tests__/platform-execution.test.ts @@ -1,4 +1,4 @@ -import { inventoryUse } from '@agent-device/contracts/platform'; +import { inventoryUse } from '@agent-device/contracts/platform-module'; import { describe, expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; import { deriveDaemonCommandDescriptors } from '../derive.ts'; diff --git a/src/core/command-descriptor/__tests__/record-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/record-runtime-execution.test.ts index 060e20a7c..53e784ffa 100644 --- a/src/core/command-descriptor/__tests__/record-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/record-runtime-execution.test.ts @@ -1,8 +1,6 @@ import { expect, test } from 'vitest'; -import { - assertRecordRuntimeExecution, - screenRecordingRuntimePlanUses, -} from '@agent-device/contracts/platform'; +import { assertRecordRuntimeExecution } from '@agent-device/contracts/record-runtime-cutover'; +import { screenRecordingRuntimePlanUses } from '@agent-device/contracts/screen-recording-runtime-plan'; import { commandDescriptors } from '../registry.ts'; test('record descriptor declares exactly the distinct uses selected by all three plans', () => { diff --git a/src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts index 98d5b9f2f..504609015 100644 --- a/src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/screenshot-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { screenshotRuntimePlanUses } from '@agent-device/contracts/platform'; +import { screenshotRuntimePlanUses } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; test('screenshot descriptor declares its complete runtime uses with no legacy projection', () => { diff --git a/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts index e6603e7e4..5f7f1360a 100644 --- a/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/shutdown-runtime-execution.test.ts @@ -1,6 +1,6 @@ import { readFileSync } from 'node:fs'; import { expect, test } from 'vitest'; -import { shutdownTargetUse } from '@agent-device/contracts/platform'; +import { shutdownTargetUse } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; const sessionStateSource = readFileSync( diff --git a/src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts index 92d26488e..646189792 100644 --- a/src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/snapshot-runtime-execution.test.ts @@ -1,4 +1,4 @@ -import { snapshotRuntimePlanUses } from '@agent-device/contracts/platform'; +import { snapshotRuntimePlanUses } from '@agent-device/contracts/platform-runtime-operations'; import { expect, test } from 'vitest'; import { commandDescriptors } from '../registry.ts'; diff --git a/src/core/command-descriptor/__tests__/type-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/type-runtime-execution.test.ts index edf54dd5c..ca84d4458 100644 --- a/src/core/command-descriptor/__tests__/type-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/type-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { typeTextRuntimeUse } from '@agent-device/contracts/platform'; +import { typeTextRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; import { BASE_COMMAND_CAPABILITY_MATRIX, isCommandSupportedOnDevice } from '../../capabilities.ts'; diff --git a/src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts index f70e0eeb9..c7ad6e47f 100644 --- a/src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/viewport-runtime-execution.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { viewportRuntimeUse } from '@agent-device/contracts/platform'; +import { viewportRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import { commandDescriptors } from '../registry.ts'; test('viewport descriptor declares its complete runtime use with no legacy projection', () => { diff --git a/src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts b/src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts index 8dadc591c..ed14cf6fb 100644 --- a/src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts +++ b/src/core/command-descriptor/__tests__/wait-runtime-execution.test.ts @@ -1,8 +1,6 @@ import { expect, test } from 'vitest'; -import { - waitSelectorCaptureRuntimePlanUses, - waitObservesDevice, -} from '@agent-device/contracts/platform'; +import { waitSelectorCaptureRuntimePlanUses } from '@agent-device/contracts/platform-runtime-operations'; +import { waitObservesDevice } from '@agent-device/contracts/wait-runtime-plan'; import { commandDescriptors } from '../registry.ts'; test('wait descriptor declares its complete runtime use with no capability bucket', () => { diff --git a/src/core/command-descriptor/platform-execution-entry.ts b/src/core/command-descriptor/platform-execution-entry.ts index 46b5c3066..ffa8f3382 100644 --- a/src/core/command-descriptor/platform-execution-entry.ts +++ b/src/core/command-descriptor/platform-execution-entry.ts @@ -1,7 +1,7 @@ import { assertCommandPlatformExecution, type CommandPlatformExecution, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/command-platform-execution'; /** * Structural on purpose: the gate must see an *absent* discriminator, and the diff --git a/src/core/command-descriptor/registry.ts b/src/core/command-descriptor/registry.ts index 091a4183e..fe85766a8 100644 --- a/src/core/command-descriptor/registry.ts +++ b/src/core/command-descriptor/registry.ts @@ -15,31 +15,35 @@ import { resolvePostActionObservationSupport } from './post-action-observation.t import type { PostActionObservationSupport } from './post-action-observation.ts'; import { deployAppUse, - appLogRuntimePlanUses, - appsRuntimeUse, - appStateRuntimeUses, - assertRecordRuntimeExecution, - deviceBootRuntimeUses, - inventoryUse, - networkDumpUse, readyMaterializeAndDeployAppUse, readySendPushNotificationUse, - openApplicationRuntimePlanUses, +} from '@agent-device/contracts/app-deployment-runtime-plan'; +import { closeApplicationRuntimePlanUses, - selectorCaptureRuntimePlanUses, - selectorTextCaptureRuntimePlanUses, - waitSelectorCaptureRuntimePlanUses, - snapshotRuntimePlanUses, + openApplicationRuntimePlanUses, prepareAppleRunnerRuntimeUse, runtimeCommandRuntimePlanUses, - screenRecordingRuntimePlanUses, - screenshotRuntimePlanUses, - shutdownTargetUse, +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import { appLogRuntimePlanUses } from '@agent-device/contracts/logs-runtime-plan'; +import { networkDumpUse } from '@agent-device/contracts/network-runtime-plan'; +import { inventoryUse } from '@agent-device/contracts/platform-module'; +import { + appsRuntimeUse, + appStateRuntimeUses, + deviceBootRuntimeUses, findRuntimePlanUses, focusRuntimeUse, + screenshotRuntimePlanUses, + selectorCaptureRuntimePlanUses, + selectorTextCaptureRuntimePlanUses, + shutdownTargetUse, + snapshotRuntimePlanUses, typeTextRuntimeUse, viewportRuntimeUse, -} from '@agent-device/contracts/platform'; + waitSelectorCaptureRuntimePlanUses, +} from '@agent-device/contracts/platform-runtime-operations'; +import { assertRecordRuntimeExecution } from '@agent-device/contracts/record-runtime-cutover'; +import { screenRecordingRuntimePlanUses } from '@agent-device/contracts/screen-recording-runtime-plan'; import { readDeclaredPlatformExecution } from './platform-execution-entry.ts'; import type { CommandCatalogGroup, diff --git a/src/core/device-inventory-context.ts b/src/core/device-inventory-context.ts index 41d62115b..75c0dba19 100644 --- a/src/core/device-inventory-context.ts +++ b/src/core/device-inventory-context.ts @@ -1,11 +1,11 @@ import { AppError, isRequestCanceledError } from '@agent-device/kernel/errors'; import type { DeviceInventoryRequest } from '@agent-device/contracts/device'; -import { - type DeviceInventoryDiscovery, - type DeviceInventoryGateway, - type PlatformRequestScope, - type ProviderAwareDeviceInventoryGateway, -} from '@agent-device/contracts/platform'; +import type { + DeviceInventoryDiscovery, + DeviceInventoryGateway, + ProviderAwareDeviceInventoryGateway, +} from '@agent-device/contracts/platform-module'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AsyncLocalStorage } from 'node:async_hooks'; diff --git a/src/core/dispatch-interactions.ts b/src/core/dispatch-interactions.ts index 6d790e87f..9bfebb4e9 100644 --- a/src/core/dispatch-interactions.ts +++ b/src/core/dispatch-interactions.ts @@ -1,19 +1,22 @@ import { - assertExclusiveScrollDistanceInputs, + type ClickButton, getClickButtonValidationError, - honoredScrollDurationMs, - MAESTRO_NON_HITTABLE_FALLBACK_MESSAGE, - normalizeScrollDurationMs, - parseScrollDirection, - resolveScrollExecutionOptions, resolveClickButton, - type ClickButton, +} from '@agent-device/contracts/click-button'; +import { type Interactor, + MAESTRO_NON_HITTABLE_FALLBACK_MESSAGE, type RunnerCallOptions, - type ScrollCommandOptions, - type ScrollDirection, +} from '@agent-device/contracts/interactor-types'; +import { type ResolvedScrollExecutionOptions, -} from '@agent-device/contracts/interaction'; + type ScrollCommandOptions, + assertExclusiveScrollDistanceInputs, + honoredScrollDurationMs, + normalizeScrollDurationMs, + resolveScrollExecutionOptions, +} from '@agent-device/contracts/scroll-command'; +import { type ScrollDirection, parseScrollDirection } from '@agent-device/contracts/scroll-gesture'; import { readFillBackendResult } from './fill-backend-result.ts'; import { isIosFamily, diff --git a/src/core/dispatch.ts b/src/core/dispatch.ts index b71fbb31a..19525d749 100644 --- a/src/core/dispatch.ts +++ b/src/core/dispatch.ts @@ -1,6 +1,6 @@ import { parseDeviceRotation } from '@agent-device/contracts/device'; import type { GesturePlan, Interactor, RunnerContext } from '@agent-device/contracts/interaction'; -import { parseTvRemoteButton } from '@agent-device/contracts/interaction'; +import { parseTvRemoteButton } from '@agent-device/contracts/tv-remote'; import { isIosFamily, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import type { Rect } from '@agent-device/kernel/snapshot'; diff --git a/src/core/fill-backend-result.ts b/src/core/fill-backend-result.ts index fbbce054c..518201074 100644 --- a/src/core/fill-backend-result.ts +++ b/src/core/fill-backend-result.ts @@ -3,7 +3,7 @@ import { type CloudTextEntryReadiness, type FillBackendResult, type FillVerificationTarget, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/interactor-types'; type RawUnconfirmedVerification = Record & { requested: string; diff --git a/src/core/interactors/linux.ts b/src/core/interactors/linux.ts index 5d7f21f16..244ede70e 100644 --- a/src/core/interactors/linux.ts +++ b/src/core/interactors/linux.ts @@ -17,7 +17,7 @@ import { swipeLinux, typeLinux, } from '../../platforms/linux/input-actions.ts'; -import { singlePointerPlanEndpoints } from '@agent-device/contracts/interaction'; +import { singlePointerPlanEndpoints } from '@agent-device/contracts/gesture-plan'; import { screenshotLinux } from '../../platforms/linux/screenshot.ts'; import { captureLinuxSurfaceSnapshot } from '../../snapshot/snapshot-desktop-surface.ts'; import type { Interactor } from '@agent-device/contracts/interaction'; diff --git a/src/core/interactors/register-builtins.ts b/src/core/interactors/register-builtins.ts index ba5fcfb65..d8ba145f5 100644 --- a/src/core/interactors/register-builtins.ts +++ b/src/core/interactors/register-builtins.ts @@ -4,7 +4,7 @@ import { registerPlatformPlugin } from '../platform-plugin-registry.ts'; import { applePlugin } from '../../platforms/apple/plugin.ts'; import { vegaPlugin } from '../../platforms/vega/plugin.ts'; import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; -import { isAudioProbeSupportedDevice } from '@agent-device/contracts/platform'; +import { isAudioProbeSupportedDevice } from '@agent-device/contracts/audio-probe-support'; import type { Platform, DeviceInfo } from '@agent-device/kernel/device'; // The builtin-plugin wiring lives at the interactor seam (src/core/interactors/) — diff --git a/src/core/snapshot-chrome.ts b/src/core/snapshot-chrome.ts index b7d8f14e6..0cbf915b6 100644 --- a/src/core/snapshot-chrome.ts +++ b/src/core/snapshot-chrome.ts @@ -1,9 +1,9 @@ +import { isAndroidInputMethodNode } from '@agent-device/contracts/android-input-ownership'; import { ANDROID_SYSTEM_CHROME_PACKAGE, hasAndroidSystemChromeProvenance, - isAndroidInputMethodNode, isAndroidSystemChromeWindowResourceId, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/android-system-chrome'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { normalizeType } from '@agent-device/contracts/snapshot'; diff --git a/src/daemon/__tests__/app-log-resource-recovery.test.ts b/src/daemon/__tests__/app-log-resource-recovery.test.ts index 98f0abc64..a86192fde 100644 --- a/src/daemon/__tests__/app-log-resource-recovery.test.ts +++ b/src/daemon/__tests__/app-log-resource-recovery.test.ts @@ -1,15 +1,14 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import type { CleanupOutcome, ReattachOutcome } from '@agent-device/contracts/durable-resource'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - type CleanupOutcome, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, - type ReattachOutcome, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} 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 '../../__tests__/test-utils/app-log-live-handle.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../__tests__/test-utils/runtime-operation-facts.ts'; diff --git a/src/daemon/__tests__/app-log-resource-store.test.ts b/src/daemon/__tests__/app-log-resource-store.test.ts index 04b66090c..a305e1105 100644 --- a/src/daemon/__tests__/app-log-resource-store.test.ts +++ b/src/daemon/__tests__/app-log-resource-store.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; import { appLogResourceStore } from '../app-log-resource-store.ts'; diff --git a/src/daemon/__tests__/app-log-session-resource.test.ts b/src/daemon/__tests__/app-log-session-resource.test.ts index 9a266aae0..bbc318f17 100644 --- a/src/daemon/__tests__/app-log-session-resource.test.ts +++ b/src/daemon/__tests__/app-log-session-resource.test.ts @@ -1,7 +1,8 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner, type CleanupOutcome } from '@agent-device/contracts/platform'; +import type { CleanupOutcome } from '@agent-device/contracts/durable-resource'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { createTestAppLogLiveHandle } from '../../__tests__/test-utils/app-log-live-handle.ts'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/__tests__/app-log-start-preflight.test.ts b/src/daemon/__tests__/app-log-start-preflight.test.ts index 0edd2fe1b..cc2968557 100644 --- a/src/daemon/__tests__/app-log-start-preflight.test.ts +++ b/src/daemon/__tests__/app-log-start-preflight.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { deviceIdentity, type DeviceInfo } from '@agent-device/kernel/device'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/application-lifecycle-recovery.test.ts b/src/daemon/__tests__/application-lifecycle-recovery.test.ts index 1d2bbece6..1d4d9e0fb 100644 --- a/src/daemon/__tests__/application-lifecycle-recovery.test.ts +++ b/src/daemon/__tests__/application-lifecycle-recovery.test.ts @@ -1,15 +1,15 @@ import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - providerRuntimeOwner, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRequestScope, - type PlatformRuntimeOperations, - type RuntimeOperationFact, type RuntimeFacts, -} from '@agent-device/contracts/platform'; + type RuntimeOperationFact, + localRuntimeOwner, + providerRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +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 '../../__tests__/test-utils/runtime-operation-facts.ts'; import type { SessionState } from '../types.ts'; diff --git a/src/daemon/__tests__/daemon-runtime-app-log.test.ts b/src/daemon/__tests__/daemon-runtime-app-log.test.ts index e2b92bdee..91623160b 100644 --- a/src/daemon/__tests__/daemon-runtime-app-log.test.ts +++ b/src/daemon/__tests__/daemon-runtime-app-log.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { createTestAppLogLiveHandle } from '../../__tests__/test-utils/app-log-live-handle.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/device-claim-admission.test.ts b/src/daemon/__tests__/device-claim-admission.test.ts index 568cb719c..8540a0740 100644 --- a/src/daemon/__tests__/device-claim-admission.test.ts +++ b/src/daemon/__tests__/device-claim-admission.test.ts @@ -1,7 +1,7 @@ import { expect, test } from 'vitest'; import fs from 'node:fs'; import path from 'node:path'; -import { localRuntimeOwner, providerRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner, providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { asAppError } from '@agent-device/kernel/errors'; import { ANDROID_EMULATOR } from '../../__tests__/test-utils/device-fixtures.ts'; import { diff --git a/src/daemon/__tests__/device-claim-reconciliation.test.ts b/src/daemon/__tests__/device-claim-reconciliation.test.ts index a3da86544..0bf97edd0 100644 --- a/src/daemon/__tests__/device-claim-reconciliation.test.ts +++ b/src/daemon/__tests__/device-claim-reconciliation.test.ts @@ -2,12 +2,12 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { createTestAppLogLiveHandle } from '../../__tests__/test-utils/app-log-live-handle.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../__tests__/test-utils/runtime-operation-facts.ts'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; diff --git a/src/daemon/__tests__/durable-capture-recovery-authority.test.ts b/src/daemon/__tests__/durable-capture-recovery-authority.test.ts index fc96ba023..8e6b017e4 100644 --- a/src/daemon/__tests__/durable-capture-recovery-authority.test.ts +++ b/src/daemon/__tests__/durable-capture-recovery-authority.test.ts @@ -1,6 +1,7 @@ import { expect, test, vi } from 'vitest'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { localRuntimeOwner, type AppLogLiveHandle } from '@agent-device/contracts/platform'; +import type { AppLogLiveHandle } from '@agent-device/contracts/app-log-runtime'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createTestAppLogLiveHandle } from '../../__tests__/test-utils/app-log-live-handle.ts'; import { acquireDurableCaptureRecoveryAuthorityBeforeDeadline, diff --git a/src/daemon/__tests__/durable-capture-resource-fence.test.ts b/src/daemon/__tests__/durable-capture-resource-fence.test.ts index edba2e525..63b20b0b4 100644 --- a/src/daemon/__tests__/durable-capture-resource-fence.test.ts +++ b/src/daemon/__tests__/durable-capture-resource-fence.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { expect, test, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; import { withDurableCaptureResourceFence } from '../durable-capture-resource-fence.ts'; diff --git a/src/daemon/__tests__/durable-capture-resource-recovery.test.ts b/src/daemon/__tests__/durable-capture-resource-recovery.test.ts index 8d6d5d530..20085195d 100644 --- a/src/daemon/__tests__/durable-capture-resource-recovery.test.ts +++ b/src/daemon/__tests__/durable-capture-resource-recovery.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import { expect, test, vi } from 'vitest'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; import { appLogDurableResource } from '../app-log-session-resource.ts'; diff --git a/src/daemon/__tests__/durable-capture-resource-store.test.ts b/src/daemon/__tests__/durable-capture-resource-store.test.ts index bd17dc714..2563e7680 100644 --- a/src/daemon/__tests__/durable-capture-resource-store.test.ts +++ b/src/daemon/__tests__/durable-capture-resource-store.test.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; import { createDurableCaptureResourceStore } from '../durable-capture-resource-store.ts'; diff --git a/src/daemon/__tests__/durable-capture-resource.fixtures.ts b/src/daemon/__tests__/durable-capture-resource.fixtures.ts index bef36fdd5..946b23a3d 100644 --- a/src/daemon/__tests__/durable-capture-resource.fixtures.ts +++ b/src/daemon/__tests__/durable-capture-resource.fixtures.ts @@ -1,11 +1,7 @@ import { vi } from 'vitest'; -import { - localRuntimeOwner, - type AppLogCompletion, - type AppLogLiveHandle, - type CleanupOutcome, - type FinishOutcome, -} from '@agent-device/contracts/platform'; +import type { AppLogCompletion, AppLogLiveHandle } from '@agent-device/contracts/app-log-runtime'; +import type { CleanupOutcome, FinishOutcome } from '@agent-device/contracts/durable-resource'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/filesystem-boundary-faults.test.ts b/src/daemon/__tests__/filesystem-boundary-faults.test.ts index bb9184f6f..f8a7a852b 100644 --- a/src/daemon/__tests__/filesystem-boundary-faults.test.ts +++ b/src/daemon/__tests__/filesystem-boundary-faults.test.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import crypto from 'node:crypto'; import path from 'node:path'; import { afterEach, vi } from 'vitest'; -import { localRuntimeOwner } from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { acquireDeviceClaim } from '../device-claims.ts'; diff --git a/src/daemon/__tests__/focus-runtime.test.ts b/src/daemon/__tests__/focus-runtime.test.ts index 236f13c53..f8e86b0f1 100644 --- a/src/daemon/__tests__/focus-runtime.test.ts +++ b/src/daemon/__tests__/focus-runtime.test.ts @@ -1,15 +1,17 @@ import { expect, test, vi } from 'vitest'; +import { focusRuntimeOperationFacts } from '@agent-device/contracts/focus-runtime'; import { - focusRuntimeOperationFacts, - focusRuntimeUse, - localRuntimeOwner, - narrowDeviceBinding, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, type RuntimeFacts, type RuntimeOperationFact, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { + type PlatformRuntimeOperations, + focusRuntimeUse, +} from '@agent-device/contracts/platform-runtime-operations'; import { deviceShape } from '@agent-device/kernel/device'; import { makeSession } from '../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/request-router-lock-policy.test.ts b/src/daemon/__tests__/request-router-lock-policy.test.ts index f33551ba4..a78c0750c 100644 --- a/src/daemon/__tests__/request-router-lock-policy.test.ts +++ b/src/daemon/__tests__/request-router-lock-policy.test.ts @@ -25,11 +25,11 @@ import { snapshotRuntimeFixture } from './snapshot-runtime-fixture.ts'; import type { SessionState } from '../types.ts'; import { LeaseRegistry } from '../lease-registry.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; +import type { DeviceRuntimeGateway } from '@agent-device/contracts/platform-runtime'; import { - snapshotRuntimePlanUses, - type DeviceRuntimeGateway, type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + snapshotRuntimePlanUses, +} from '@agent-device/contracts/platform-runtime-operations'; const mockDispatch = vi.mocked(dispatchCommand); diff --git a/src/daemon/__tests__/request-router-record-runtime-lock.test.ts b/src/daemon/__tests__/request-router-record-runtime-lock.test.ts index dfcd59bfd..aa523fc98 100644 --- a/src/daemon/__tests__/request-router-record-runtime-lock.test.ts +++ b/src/daemon/__tests__/request-router-record-runtime-lock.test.ts @@ -1,13 +1,13 @@ import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - PendingTransferGuard, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createTestDeviceInventoryGateways } from '../../__tests__/test-utils/device-inventory-gateways.ts'; diff --git a/src/daemon/__tests__/request-runtime-binding-router.test.ts b/src/daemon/__tests__/request-runtime-binding-router.test.ts index 27bfd3c55..19253287f 100644 --- a/src/daemon/__tests__/request-runtime-binding-router.test.ts +++ b/src/daemon/__tests__/request-runtime-binding-router.test.ts @@ -1,12 +1,12 @@ import fs from 'node:fs'; import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} 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 '../../__tests__/test-utils/app-log-live-handle.ts'; import { createTestDeviceInventoryGateways } from '../../__tests__/test-utils/device-inventory-gateways.ts'; diff --git a/src/daemon/__tests__/request-runtime-binding.test.ts b/src/daemon/__tests__/request-runtime-binding.test.ts index e05d624a6..f36b54516 100644 --- a/src/daemon/__tests__/request-runtime-binding.test.ts +++ b/src/daemon/__tests__/request-runtime-binding.test.ts @@ -1,15 +1,17 @@ import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, appLogAdmissionUse, - localRuntimeOwner, - networkDumpUse, resolveLogsRuntimePlan, - screenRecordingRecoveryUse, +} from '@agent-device/contracts/logs-runtime-plan'; +import { networkDumpUse } from '@agent-device/contracts/network-runtime-plan'; +import { type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +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 '../../__tests__/test-utils/runtime-operation-facts.ts'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; diff --git a/src/daemon/__tests__/screen-recording-boundary-faults.test.ts b/src/daemon/__tests__/screen-recording-boundary-faults.test.ts index c21ab7024..c02f48988 100644 --- a/src/daemon/__tests__/screen-recording-boundary-faults.test.ts +++ b/src/daemon/__tests__/screen-recording-boundary-faults.test.ts @@ -4,14 +4,13 @@ import { createDurableResourceEnvelope, createScreenRecordingLiveHandle, } from '@agent-device/capture-kit'; -import { - localRuntimeOwner, - PendingTransferGuard, - type CleanupOutcome, - type ReattachOutcome, - type ScreenRecordingCompletion, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +import type { CleanupOutcome, ReattachOutcome } from '@agent-device/contracts/durable-resource'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import type { + ScreenRecordingCompletion, + ScreenRecordingLiveHandle, +} from '@agent-device/contracts/screen-recording-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/screen-recording-resource-recovery.test.ts b/src/daemon/__tests__/screen-recording-resource-recovery.test.ts index 4ac64cf75..7acac80aa 100644 --- a/src/daemon/__tests__/screen-recording-resource-recovery.test.ts +++ b/src/daemon/__tests__/screen-recording-resource-recovery.test.ts @@ -1,11 +1,11 @@ import path from 'node:path'; import { expect, test, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { makeTestScreenRecordingResource } from '../../__tests__/test-utils/screen-recording-live-handle.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../__tests__/test-utils/runtime-operation-facts.ts'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; diff --git a/src/daemon/__tests__/screen-recording-session-resource.test.ts b/src/daemon/__tests__/screen-recording-session-resource.test.ts index 00acc46bb..f7152918d 100644 --- a/src/daemon/__tests__/screen-recording-session-resource.test.ts +++ b/src/daemon/__tests__/screen-recording-session-resource.test.ts @@ -1,9 +1,7 @@ import { expect, test, vi } from 'vitest'; -import { - localRuntimeOwner, - PendingTransferGuard, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +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 { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; import { createScreenRecordingAdmissionLedger } from '../screen-recording-admission-ledger.ts'; diff --git a/src/daemon/__tests__/screenshot-runtime-fixture.ts b/src/daemon/__tests__/screenshot-runtime-fixture.ts index d41e0eee7..b10daced2 100644 --- a/src/daemon/__tests__/screenshot-runtime-fixture.ts +++ b/src/daemon/__tests__/screenshot-runtime-fixture.ts @@ -1,16 +1,20 @@ import { + type DeviceRuntimeGateway, + type RuntimeFacts, + type RuntimeOperationFact, localRuntimeOwner, narrowDeviceBinding, - screenshotRuntimeOperationFacts, - snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { type CaptureScreenshotInput, + screenshotRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { type CaptureSnapshotInput, - type DeviceRuntimeGateway, - type PlatformRuntimeOperations, - type RuntimeFacts, - type RuntimeOperationFact, type SnapshotResult, -} from '@agent-device/contracts/platform'; + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import fs from 'node:fs'; import { vi, type Mock } from 'vitest'; diff --git a/src/daemon/__tests__/selector-capture-fixture.ts b/src/daemon/__tests__/selector-capture-fixture.ts index 71fe9037f..65eccf84f 100644 --- a/src/daemon/__tests__/selector-capture-fixture.ts +++ b/src/daemon/__tests__/selector-capture-fixture.ts @@ -1,14 +1,16 @@ import { + type RuntimeFacts, + type RuntimeOperationFact, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { type CaptureSnapshotInput, - type PlatformRuntimeOperations, - type RuntimeFacts, - type RuntimeOperationFact, type SnapshotResult, -} from '@agent-device/contracts/platform'; + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { isActiveProviderDevice } from '../../provider-device-runtime.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; diff --git a/src/daemon/__tests__/snapshot-custom-actions-platform-guard.test.ts b/src/daemon/__tests__/snapshot-custom-actions-platform-guard.test.ts index 619925a02..129f6aae5 100644 --- a/src/daemon/__tests__/snapshot-custom-actions-platform-guard.test.ts +++ b/src/daemon/__tests__/snapshot-custom-actions-platform-guard.test.ts @@ -15,11 +15,11 @@ import { createRequestHandler } from './test-device-runtime-gateway.ts'; import { LeaseRegistry } from '../lease-registry.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; import type { SessionState } from '../types.ts'; +import type { DeviceRuntimeGateway } from '@agent-device/contracts/platform-runtime'; import { - captureSnapshotUse, - type DeviceRuntimeGateway, type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + captureSnapshotUse, +} from '@agent-device/contracts/platform-runtime-operations'; import { snapshotRuntimeFixture } from './snapshot-runtime-fixture.ts'; function snapshotDeviceRuntimeGateway(): DeviceRuntimeGateway { diff --git a/src/daemon/__tests__/snapshot-diff-runtime.test.ts b/src/daemon/__tests__/snapshot-diff-runtime.test.ts index 35f687c59..97792a2aa 100644 --- a/src/daemon/__tests__/snapshot-diff-runtime.test.ts +++ b/src/daemon/__tests__/snapshot-diff-runtime.test.ts @@ -1,14 +1,16 @@ import { expect, test, vi } from 'vitest'; import { + type DeviceBinding, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, - snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { type CaptureSnapshotInput, - type DeviceBinding, - type PlatformRuntimeOperations, - type RuntimeFacts, type SnapshotResult, -} from '@agent-device/contracts/platform'; + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; import { deviceShape } from '@agent-device/kernel/device'; import { makeAndroidSession } from '../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/snapshot-runtime-fixture.ts b/src/daemon/__tests__/snapshot-runtime-fixture.ts index 29da54ce7..e86693a38 100644 --- a/src/daemon/__tests__/snapshot-runtime-fixture.ts +++ b/src/daemon/__tests__/snapshot-runtime-fixture.ts @@ -1,15 +1,19 @@ import { + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - screenshotRuntimeOperationFacts, - snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { type CaptureScreenshotInput, + screenshotRuntimeOperationFacts, +} from '@agent-device/contracts/screenshot-runtime'; +import { type CaptureSnapshotInput, - type PlatformRuntimeOperations, - type RuntimeFacts, type SnapshotResult, -} from '@agent-device/contracts/platform'; + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; import { deviceShape, isIosFamily, type DeviceInfo } from '@agent-device/kernel/device'; import { dispatchCommand, type DispatchContext } from '../../core/dispatch.ts'; import { getRequestSignal } from '../../request/cancel.ts'; diff --git a/src/daemon/__tests__/test-device-runtime-gateway.ts b/src/daemon/__tests__/test-device-runtime-gateway.ts index a81599525..d1826d520 100644 --- a/src/daemon/__tests__/test-device-runtime-gateway.ts +++ b/src/daemon/__tests__/test-device-runtime-gateway.ts @@ -1,12 +1,14 @@ import { + type ApplicationLifecycleOperationFacts, applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { + type DeviceRuntimeGateway, localRuntimeOwner, narrowDeviceBinding, - type ApplicationLifecycleOperationFacts, - type DeviceRuntimeGateway, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { createRequestHandler as createProductionRequestHandler, type RequestRouterDeps, diff --git a/src/daemon/__tests__/type-text-runtime.test.ts b/src/daemon/__tests__/type-text-runtime.test.ts index a70d850cd..a6ff457b3 100644 --- a/src/daemon/__tests__/type-text-runtime.test.ts +++ b/src/daemon/__tests__/type-text-runtime.test.ts @@ -1,15 +1,19 @@ import { expect, test, vi } from 'vitest'; import { - localRuntimeOwner, - narrowDeviceBinding, - typeTextRuntimeOperationFacts, - typeTextRuntimeUse, type DeviceBinding, - type PlatformRuntimeOperations, type RuntimeFacts, type RuntimeOperationFact, + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { + type PlatformRuntimeOperations, + typeTextRuntimeUse, +} from '@agent-device/contracts/platform-runtime-operations'; +import { type TypeTextInput, -} from '@agent-device/contracts/platform'; + typeTextRuntimeOperationFacts, +} from '@agent-device/contracts/type-text-runtime'; import { deviceShape } from '@agent-device/kernel/device'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; import { resolveBoundTypeTextRuntime } from '../type-text-runtime.ts'; diff --git a/src/daemon/__tests__/viewport-runtime.test.ts b/src/daemon/__tests__/viewport-runtime.test.ts index 0fd1c502f..09170bc40 100644 --- a/src/daemon/__tests__/viewport-runtime.test.ts +++ b/src/daemon/__tests__/viewport-runtime.test.ts @@ -1,15 +1,17 @@ import { expect, test, vi } from 'vitest'; import { - localRuntimeOwner, - narrowDeviceBinding, - viewportRuntimeOperationFacts, - viewportRuntimeUse, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, type RuntimeFacts, type RuntimeOperationFact, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { + type PlatformRuntimeOperations, + viewportRuntimeUse, +} from '@agent-device/contracts/platform-runtime-operations'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import { deviceShape } from '@agent-device/kernel/device'; import { makeSession } from '../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/__tests__/wait-conditional-selector.test.ts b/src/daemon/__tests__/wait-conditional-selector.test.ts index a007e1117..f6fb86aba 100644 --- a/src/daemon/__tests__/wait-conditional-selector.test.ts +++ b/src/daemon/__tests__/wait-conditional-selector.test.ts @@ -1,15 +1,17 @@ import { expect, test, vi } from 'vitest'; import { - localRuntimeOwner, - narrowDeviceBinding, - snapshotRuntimeOperationFacts, type DeviceBinding, - type FindSelectorInput, - type PlatformRuntimeOperations, type RuntimeFacts, type RuntimeOperationFact, + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { + type PlatformRuntimeOperations, waitSelectorCaptureRuntimePlanUses, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime-operations'; +import type { FindSelectorInput } from '@agent-device/contracts/selector-observation-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; import { deviceShape } from '@agent-device/kernel/device'; import { IOS_SIMULATOR } from '../../__tests__/test-utils/device-fixtures.ts'; import { diff --git a/src/daemon/__tests__/wait-runtime.test.ts b/src/daemon/__tests__/wait-runtime.test.ts index 221baec71..cd1bdc4be 100644 --- a/src/daemon/__tests__/wait-runtime.test.ts +++ b/src/daemon/__tests__/wait-runtime.test.ts @@ -1,19 +1,23 @@ import { expect, test, vi } from 'vitest'; -import { WAIT_REASONS } from '@agent-device/contracts/interaction'; +import { WAIT_REASONS } from '@agent-device/contracts/wait'; import { + type DeviceBinding, + type RuntimeFacts, + type RuntimeOperationFact, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - snapshotRuntimeOperationFacts, - type CaptureSnapshotInput, - type DeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { type PlatformRuntimeOperations, - type RuntimeFacts, - type RuntimeOperationFact, waitSelectorCaptureRuntimePlanUses, - type FindTextInput, +} from '@agent-device/contracts/platform-runtime-operations'; +import type { FindTextInput } from '@agent-device/contracts/selector-observation-runtime'; +import { + type CaptureSnapshotInput, type SnapshotResult, -} from '@agent-device/contracts/platform'; + snapshotRuntimeOperationFacts, +} from '@agent-device/contracts/snapshot-runtime'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { makeSession } from '../../__tests__/test-utils/session-factories.ts'; import { makeSessionStore } from '../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/adapters/maestro/__tests__/daemon-runtime-port-selector-fallback.test.ts b/src/daemon/adapters/maestro/__tests__/daemon-runtime-port-selector-fallback.test.ts index b960e8696..ed77dde96 100644 --- a/src/daemon/adapters/maestro/__tests__/daemon-runtime-port-selector-fallback.test.ts +++ b/src/daemon/adapters/maestro/__tests__/daemon-runtime-port-selector-fallback.test.ts @@ -1,4 +1,4 @@ -import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction'; +import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction-error'; import type { DaemonError } from '@agent-device/kernel/errors'; import { expect, test } from 'vitest'; import type { DaemonRequest } from '../../../types.ts'; diff --git a/src/daemon/adapters/maestro/__tests__/daemon-runtime-public-operation.test.ts b/src/daemon/adapters/maestro/__tests__/daemon-runtime-public-operation.test.ts index aff939628..d197db08b 100644 --- a/src/daemon/adapters/maestro/__tests__/daemon-runtime-public-operation.test.ts +++ b/src/daemon/adapters/maestro/__tests__/daemon-runtime-public-operation.test.ts @@ -1,8 +1,6 @@ -import { - buildGesturePlan, - normalizePublicGesture, - readGesturePayload, -} from '@agent-device/contracts/interaction'; +import { readGesturePayload } from '@agent-device/contracts/gesture-input'; +import { normalizePublicGesture } from '@agent-device/contracts/gesture-normalization'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import assert from 'node:assert/strict'; import { describe, expect, test } from 'vitest'; import { diff --git a/src/daemon/adapters/maestro/daemon-runtime-tap.ts b/src/daemon/adapters/maestro/daemon-runtime-tap.ts index 29f2c380f..222052158 100644 --- a/src/daemon/adapters/maestro/daemon-runtime-tap.ts +++ b/src/daemon/adapters/maestro/daemon-runtime-tap.ts @@ -1,5 +1,5 @@ import { AppError, asAppError } from '@agent-device/kernel/errors'; -import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction'; +import { INTERACTION_ERROR_REASONS } from '@agent-device/contracts/interaction-error'; import type { Rect } from '@agent-device/kernel/snapshot'; import { MAESTRO_RUNTIME_ADAPTER_POLICY, diff --git a/src/daemon/app-log-resource-recovery.ts b/src/daemon/app-log-resource-recovery.ts index 92719aed0..866dd4aab 100644 --- a/src/daemon/app-log-resource-recovery.ts +++ b/src/daemon/app-log-resource-recovery.ts @@ -1,13 +1,14 @@ +import type { AppLogCompletion, AppLogLiveHandle } from '@agent-device/contracts/app-log-runtime'; +import type { DurableResourceEnvelope } from '@agent-device/contracts/durable-resource-envelope'; import { - defineUse, - narrowDeviceBinding, - type AppLogCompletion, - type AppLogLiveHandle, type DeviceRuntimeGateway, - type DurableResourceEnvelope, - type PlatformRequestScope, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; +import { type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + defineUse, +} from '@agent-device/contracts/platform-runtime-operations'; import { appLogDurableResource } from './app-log-session-resource.ts'; import { acquireExactDurableCaptureRecoveryControl } from './durable-capture-runtime-recovery.ts'; import type { DurableCaptureRecoveryControl } from './durable-capture-recovery-authority.ts'; diff --git a/src/daemon/application-lifecycle-recovery.ts b/src/daemon/application-lifecycle-recovery.ts index de00dc944..8a6e416f2 100644 --- a/src/daemon/application-lifecycle-recovery.ts +++ b/src/daemon/application-lifecycle-recovery.ts @@ -1,16 +1,20 @@ import { - finalizeApplicationCloseWithRuntimeHintClearUse, - finalizeApplicationCloseRuntimeUse, + type RuntimeHintValues, hasRuntimeTransportHintValues, - narrowDeviceBinding, +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { + finalizeApplicationCloseRuntimeUse, + finalizeApplicationCloseWithRuntimeHintClearUse, +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import { type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRequestScope, - type PlatformRuntimeOperations, type RuntimeFacts, - type RuntimeHintValues, type RuntimeOperationKey, -} from '@agent-device/contracts/platform'; + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { AppError } from '@agent-device/kernel/errors'; import type { SessionState } from './types.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; diff --git a/src/daemon/apps-runtime.ts b/src/daemon/apps-runtime.ts index b6000acdc..96d21600a 100644 --- a/src/daemon/apps-runtime.ts +++ b/src/daemon/apps-runtime.ts @@ -1,10 +1,8 @@ import type { AppsFilter } from '@agent-device/contracts/device'; -import { - appsRuntimeUse, - type BoundDeviceRuntime, - type EnsureReadyInput, - type InstalledAppInfo, -} from '@agent-device/contracts/platform'; +import type { InstalledAppInfo } from '@agent-device/contracts/app-inventory-runtime'; +import type { EnsureReadyInput } from '@agent-device/contracts/device-readiness-runtime'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; +import { appsRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; export function ensureAppsRuntimeReady( diff --git a/src/daemon/audio-probe.ts b/src/daemon/audio-probe.ts index e5da65cb8..fe97984ad 100644 --- a/src/daemon/audio-probe.ts +++ b/src/daemon/audio-probe.ts @@ -1,10 +1,10 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { + type AudioProbeResult, emptyAudioProbeResult, normalizeAudioProbeRecord, - type AudioProbeResult, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/audio-probe-result'; import type { HostAudioProbeBackend } from '../platforms/audio-probe-backend.ts'; import { AppError } from '@agent-device/kernel/errors'; import { sleep } from '../utils/timeouts.ts'; diff --git a/src/daemon/context.ts b/src/daemon/context.ts index 5ad1b0235..b10991c29 100644 --- a/src/daemon/context.ts +++ b/src/daemon/context.ts @@ -1,6 +1,6 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { DispatchContext } from '../core/dispatch-context.ts'; -import { resolveClickButton } from '@agent-device/contracts/interaction'; +import { resolveClickButton } from '@agent-device/contracts/click-button'; import { screenshotFlagsFromOptions, type ScreenshotRuntimeFlags, diff --git a/src/daemon/durable-capture-resource-adoption.ts b/src/daemon/durable-capture-resource-adoption.ts index 5d65c86ea..1d84f7775 100644 --- a/src/daemon/durable-capture-resource-adoption.ts +++ b/src/daemon/durable-capture-resource-adoption.ts @@ -1,10 +1,10 @@ +import type { LiveResourceHandle } from '@agent-device/contracts/durable-resource'; +import type { DurableResourceEnvelope } from '@agent-device/contracts/durable-resource-envelope'; import { - runtimeOwnerKey, - type DurableResourceEnvelope, - type LiveResourceHandle, type ResourceOwnershipFence, type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; + runtimeOwnerKey, +} from '@agent-device/contracts/platform-runtime'; import { createDurableResourceEnvelope, decodeDurableResourceEnvelope, diff --git a/src/daemon/durable-capture-resource-recovery.ts b/src/daemon/durable-capture-resource-recovery.ts index fa4316997..07b4c0755 100644 --- a/src/daemon/durable-capture-resource-recovery.ts +++ b/src/daemon/durable-capture-resource-recovery.ts @@ -5,7 +5,7 @@ import type { PlatformRequestScope, ResourceUnreattachableReason, } from '@agent-device/contracts/platform'; -import { isConfirmedCleanup } from '@agent-device/contracts/platform'; +import { isConfirmedCleanup } from '@agent-device/contracts/durable-resource'; import { emitDiagnostic } from '../utils/diagnostics.ts'; import { acquireDurableCaptureRecoveryAuthorityBeforeDeadline, diff --git a/src/daemon/durable-capture-resource-transitions.ts b/src/daemon/durable-capture-resource-transitions.ts index 4dda94cd6..6e6368de9 100644 --- a/src/daemon/durable-capture-resource-transitions.ts +++ b/src/daemon/durable-capture-resource-transitions.ts @@ -1,9 +1,9 @@ import { - isConfirmedCleanup, type CleanupOutcome, type FinishOutcome, type LiveResourceHandle, -} from '@agent-device/contracts/platform'; + isConfirmedCleanup, +} from '@agent-device/contracts/durable-resource'; import { AppError } from '@agent-device/kernel/errors'; import { emitDiagnostic } from '../utils/diagnostics.ts'; import { diff --git a/src/daemon/focus-runtime.ts b/src/daemon/focus-runtime.ts index 80aca77d1..8a28a576c 100644 --- a/src/daemon/focus-runtime.ts +++ b/src/daemon/focus-runtime.ts @@ -1,4 +1,5 @@ -import { focusRuntimeUse, type FocusPointInput } from '@agent-device/contracts/platform'; +import type { FocusPointInput } from '@agent-device/contracts/focus-runtime'; +import { focusRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { Point } from '@agent-device/kernel/snapshot'; import { successText } from '../utils/success-text.ts'; diff --git a/src/daemon/handlers/__tests__/application-lifecycle-runtime-harness.ts b/src/daemon/handlers/__tests__/application-lifecycle-runtime-harness.ts index 812b38263..6acc8cd26 100644 --- a/src/daemon/handlers/__tests__/application-lifecycle-runtime-harness.ts +++ b/src/daemon/handlers/__tests__/application-lifecycle-runtime-harness.ts @@ -1,15 +1,17 @@ import { - applicationLifecycleOperationFacts, bindProviderApplicationLifecycleInteractor, invokeApplicationClose, invokeApplicationOpen, +} from '@agent-device/contracts/application-lifecycle-interaction'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import { + type DeviceBinding, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - type DeviceBinding, - type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { vi } from 'vitest'; diff --git a/src/daemon/handlers/__tests__/install-source.test.ts b/src/daemon/handlers/__tests__/install-source.test.ts index 910f8f4e2..2f0f33194 100644 --- a/src/daemon/handlers/__tests__/install-source.test.ts +++ b/src/daemon/handlers/__tests__/install-source.test.ts @@ -1,18 +1,20 @@ import { readFileSync } from 'node:fs'; import path from 'node:path'; import { expect, test, vi } from 'vitest'; +import type { + AppDeploymentResult, + MaterializedAppSource, +} from '@agent-device/contracts/app-deployment-runtime'; import { + type DeviceBinding, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - screenshotRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - type AppDeploymentResult, - type DeviceBinding, - type MaterializedAppSource, - type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; diff --git a/src/daemon/handlers/__tests__/interaction-get-runtime-fixture.ts b/src/daemon/handlers/__tests__/interaction-get-runtime-fixture.ts index 3140a1e66..e5117d8ce 100644 --- a/src/daemon/handlers/__tests__/interaction-get-runtime-fixture.ts +++ b/src/daemon/handlers/__tests__/interaction-get-runtime-fixture.ts @@ -1,19 +1,21 @@ import { vi } from 'vitest'; import type { TypeTextBackendResult } from '@agent-device/contracts/interaction'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import type { + ElementTextReadOutcome, + ReadTextAtPointInput, +} from '@agent-device/contracts/element-text-runtime'; +import type { FocusPointInput } from '@agent-device/contracts/focus-runtime'; import { - createUnavailablePlatformRuntimeFacts, - localRuntimeOwner, - narrowDeviceBinding, - applicationLifecycleOperationFacts, - type CaptureSnapshotInput, type DeviceBinding, - type PlatformRuntimeOperations, - type ElementTextReadOutcome, - type FocusPointInput, - type TypeTextInput, - type ReadTextAtPointInput, type RuntimeFacts, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; +import type { CaptureSnapshotInput } from '@agent-device/contracts/snapshot-runtime'; +import type { TypeTextInput } from '@agent-device/contracts/type-text-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime, diff --git a/src/daemon/handlers/__tests__/interaction-read.test.ts b/src/daemon/handlers/__tests__/interaction-read.test.ts index 46f808ea9..f19c55bad 100644 --- a/src/daemon/handlers/__tests__/interaction-read.test.ts +++ b/src/daemon/handlers/__tests__/interaction-read.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { - elementTextRead, type ElementTextReadOutcome, type ReadTextAtPointInput, -} from '@agent-device/contracts/platform'; + elementTextRead, +} from '@agent-device/contracts/element-text-runtime'; import { readTextForNode } from '../interaction-read.ts'; /** diff --git a/src/daemon/handlers/__tests__/interaction.test.ts b/src/daemon/handlers/__tests__/interaction.test.ts index 4b30900b9..b9ef9411c 100644 --- a/src/daemon/handlers/__tests__/interaction.test.ts +++ b/src/daemon/handlers/__tests__/interaction.test.ts @@ -57,7 +57,7 @@ vi.mock('../../../platforms/apple/core/runner/runner-client.ts', async (importOr }; }); -import { elementTextRead } from '@agent-device/contracts/platform'; +import { elementTextRead } from '@agent-device/contracts/element-text-runtime'; import { elementReadFixtureState, getRuntimeBindings, diff --git a/src/daemon/handlers/__tests__/network-runtime-harness.ts b/src/daemon/handlers/__tests__/network-runtime-harness.ts index 1bf5b1487..bf369df10 100644 --- a/src/daemon/handlers/__tests__/network-runtime-harness.ts +++ b/src/daemon/handlers/__tests__/network-runtime-harness.ts @@ -1,14 +1,13 @@ import { vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import type { NetworkDumpInput, NetworkDumpResult } from '@agent-device/contracts/network-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - narrowDeviceBinding, - type NetworkDumpInput, - type NetworkDumpResult, - type PlatformRuntimeOperations, type RuntimeOperationFact, type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime } from '../../request-runtime-binding.ts'; diff --git a/src/daemon/handlers/__tests__/record-runtime.fixtures.ts b/src/daemon/handlers/__tests__/record-runtime.fixtures.ts index 8737a987d..73e42af6f 100644 --- a/src/daemon/handlers/__tests__/record-runtime.fixtures.ts +++ b/src/daemon/handlers/__tests__/record-runtime.fixtures.ts @@ -1,15 +1,15 @@ import { expect, vi } from 'vitest'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import { PendingTransferGuard } from '@agent-device/contracts/async-lifecycle'; +import type { CleanupOutcome } from '@agent-device/contracts/durable-resource'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - narrowDeviceBinding, - PendingTransferGuard, - type CleanupOutcome, type DeviceBinding, - type PlatformRuntimeOperations, type RuntimeOperationUnavailability, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { makeSessionStore } from '../../../__tests__/test-utils/store-factory.ts'; diff --git a/src/daemon/handlers/__tests__/session-capabilities.fixtures.ts b/src/daemon/handlers/__tests__/session-capabilities.fixtures.ts index 6b646a26c..6ba4f233a 100644 --- a/src/daemon/handlers/__tests__/session-capabilities.fixtures.ts +++ b/src/daemon/handlers/__tests__/session-capabilities.fixtures.ts @@ -1,15 +1,15 @@ import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import { - localRuntimeOwner, - narrowDeviceBinding, - providerRuntimeOwner, - screenshotRuntimeOperationFacts, - snapshotRuntimeOperationFacts, type DeviceBinding, - type PlatformRuntimeOperations, type RuntimeFacts, type RuntimeProviderMode, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, + providerRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/src/daemon/handlers/__tests__/session-capabilities.test.ts b/src/daemon/handlers/__tests__/session-capabilities.test.ts index db187241d..e30e105e0 100644 --- a/src/daemon/handlers/__tests__/session-capabilities.test.ts +++ b/src/daemon/handlers/__tests__/session-capabilities.test.ts @@ -11,17 +11,17 @@ import { makeSessionStore } from '../../../__tests__/test-utils/store-factory.ts import { withTestDeviceInventoryProvider as withTargetDeviceResolutionScope } from '../../../__tests__/test-utils/device-inventory-gateways.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - narrowDeviceBinding, - providerRuntimeOwner, - screenshotRuntimeOperationFacts, type DeviceBinding, - type PlatformRuntimeOperations, type RuntimeOperationFact, type RuntimeProviderMode, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, + providerRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, diff --git a/src/daemon/handlers/__tests__/session-close-shutdown.fixtures.ts b/src/daemon/handlers/__tests__/session-close-shutdown.fixtures.ts index aa44b4c4d..8a4edf46a 100644 --- a/src/daemon/handlers/__tests__/session-close-shutdown.fixtures.ts +++ b/src/daemon/handlers/__tests__/session-close-shutdown.fixtures.ts @@ -68,13 +68,13 @@ import { acquireDeviceClaim } from '../../device-claims.ts'; import { inspectDeviceClaims } from '../../device-claim-inspection.ts'; import { flushDiagnosticsToSessionFile, withDiagnosticsScope } from '../../../utils/diagnostics.ts'; import { + type DeviceBinding, localRuntimeOwner, narrowDeviceBinding, providerRuntimeOwner, - type DeviceBinding, - type PlatformRuntimeOperations, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { screenRecordingResourceStore } from '../../screen-recording-resource-store.ts'; import { lifecycleRuntimeFacts } from './application-lifecycle-runtime-harness.ts'; diff --git a/src/daemon/handlers/__tests__/session-command-harness.ts b/src/daemon/handlers/__tests__/session-command-harness.ts index aa4684886..d9fe8876c 100644 --- a/src/daemon/handlers/__tests__/session-command-harness.ts +++ b/src/daemon/handlers/__tests__/session-command-harness.ts @@ -2,25 +2,27 @@ import { handleSessionCommands as handleProductionSessionCommands, type SessionCommandInput, } from '../session.ts'; +import type { + AppDeploymentInput, + AppDeploymentResult, + DeployMaterializedAppInput, + MaterializeAppSourceInput, + MaterializedAppSource, + PushNotificationInput, + PushNotificationResult, +} from '@agent-device/contracts/app-deployment-runtime'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import type { EnsureReadyInput } from '@agent-device/contracts/device-readiness-runtime'; import { - applicationLifecycleOperationFacts, - localRuntimeOwner, - narrowDeviceBinding, - screenshotRuntimeOperationFacts, - snapshotRuntimeOperationFacts, - type AppDeploymentInput, - type AppDeploymentResult, type DeviceBinding, type DeviceRuntimeGateway, - type DeployMaterializedAppInput, - type EnsureReadyInput, - type MaterializeAppSourceInput, - type MaterializedAppSource, - type PlatformRuntimeOperations, - type PushNotificationInput, - type PushNotificationResult, type RuntimeFacts, -} from '@agent-device/contracts/platform'; + localRuntimeOwner, + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { snapshotRuntimeOperationFacts } from '@agent-device/contracts/snapshot-runtime'; import type { TargetShutdownResult } from '@agent-device/contracts/device'; import { deviceShape, isIosFamily, type DeviceInfo } from '@agent-device/kernel/device'; import { beforeEach, vi } from 'vitest'; diff --git a/src/daemon/handlers/__tests__/session-doctor-app-runtime.test.ts b/src/daemon/handlers/__tests__/session-doctor-app-runtime.test.ts index 853936375..00be1a563 100644 --- a/src/daemon/handlers/__tests__/session-doctor-app-runtime.test.ts +++ b/src/daemon/handlers/__tests__/session-doctor-app-runtime.test.ts @@ -6,13 +6,13 @@ import type { BindDeviceRuntime, InspectDeviceRuntimeFacts, } from '../../request-runtime-binding.ts'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, - type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import { handleDoctorCommand } from '../session-doctor.ts'; diff --git a/src/daemon/handlers/__tests__/session-inventory-apps-runtime.test.ts b/src/daemon/handlers/__tests__/session-inventory-apps-runtime.test.ts index 08c21647c..2f71c204a 100644 --- a/src/daemon/handlers/__tests__/session-inventory-apps-runtime.test.ts +++ b/src/daemon/handlers/__tests__/session-inventory-apps-runtime.test.ts @@ -2,13 +2,13 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { DaemonRequest } from '../../types.ts'; import { makeSession, makeSessionStore } from './session-test-harness.ts'; import { handleSessionInventoryCommands } from '../session-inventory.ts'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, - type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import type { BindDeviceRuntime, diff --git a/src/daemon/handlers/__tests__/session-inventory-harmonyos.test.ts b/src/daemon/handlers/__tests__/session-inventory-harmonyos.test.ts index 75d62876b..ad32ffc4b 100644 --- a/src/daemon/handlers/__tests__/session-inventory-harmonyos.test.ts +++ b/src/daemon/handlers/__tests__/session-inventory-harmonyos.test.ts @@ -2,13 +2,13 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { DaemonRequest, DaemonResponse } from '../../types.ts'; import { makeSession, makeSessionStore } from './session-test-harness.ts'; import { handleSessionInventoryCommands } from '../session-inventory.ts'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, - type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import type { BindDeviceRuntime, diff --git a/src/daemon/handlers/__tests__/session-logs.test.ts b/src/daemon/handlers/__tests__/session-logs.test.ts index 8822a7d19..cd4a4e682 100644 --- a/src/daemon/handlers/__tests__/session-logs.test.ts +++ b/src/daemon/handlers/__tests__/session-logs.test.ts @@ -1,13 +1,13 @@ import { beforeEach, expect, test, vi } from 'vitest'; +import type { AppLogRuntimeOperations } from '@agent-device/contracts/app-log-runtime'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import type { CleanupOutcome } from '@agent-device/contracts/durable-resource'; import { - applicationLifecycleOperationFacts, + type DeviceBinding, localRuntimeOwner, narrowDeviceBinding, - type AppLogRuntimeOperations, - type CleanupOutcome, - type DeviceBinding, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; import { createAppLogStartResult, createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { createTestAppLogLiveHandle } from '../../../__tests__/test-utils/app-log-live-handle.ts'; diff --git a/src/daemon/handlers/__tests__/session-network-runtime-parity.test.ts b/src/daemon/handlers/__tests__/session-network-runtime-parity.test.ts index d3e6e5929..18e0beb89 100644 --- a/src/daemon/handlers/__tests__/session-network-runtime-parity.test.ts +++ b/src/daemon/handlers/__tests__/session-network-runtime-parity.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { expect, test } from 'vitest'; -import { providerRuntimeOwner } from '@agent-device/contracts/platform'; +import { providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { BindDeviceRuntime } from '../../request-runtime-binding.ts'; import { handleSessionCommands } from './session-command-harness.ts'; import { diff --git a/src/daemon/handlers/__tests__/session-runtime-admission.test.ts b/src/daemon/handlers/__tests__/session-runtime-admission.test.ts index 2e00b1c71..79bde1e81 100644 --- a/src/daemon/handlers/__tests__/session-runtime-admission.test.ts +++ b/src/daemon/handlers/__tests__/session-runtime-admission.test.ts @@ -1,4 +1,4 @@ -import { resolveSnapshotRuntimePlan } from '@agent-device/contracts/platform'; +import { resolveSnapshotRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; import { expect, test } from 'vitest'; import { ANDROID_EMULATOR, IOS_SIMULATOR } from '../../../__tests__/test-utils/device-fixtures.ts'; import { snapshotRuntimeFixture } from '../../__tests__/snapshot-runtime-fixture.ts'; diff --git a/src/daemon/handlers/__tests__/session-state.test.ts b/src/daemon/handlers/__tests__/session-state.test.ts index 95f9b21be..1f671311a 100644 --- a/src/daemon/handlers/__tests__/session-state.test.ts +++ b/src/daemon/handlers/__tests__/session-state.test.ts @@ -4,16 +4,18 @@ import { handleSessionStateCommands } from '../session-state.ts'; import { makeSessionStore } from '../../../__tests__/test-utils/store-factory.ts'; import { withTestDeviceInventory } from '../../../__tests__/test-utils/device-inventory-gateways.ts'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../../__tests__/test-utils/runtime-operation-facts.ts'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - appStateUse, - applicationLifecycleOperationFacts, - createUnavailablePlatformRuntimeFacts, + type DeviceBinding, + type RuntimeFacts, localRuntimeOwner, narrowDeviceBinding, - type DeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import { type PlatformRuntimeOperations, - type RuntimeFacts, -} from '@agent-device/contracts/platform'; + appStateUse, +} from '@agent-device/contracts/platform-runtime-operations'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; import { deviceShape, type DeviceInfo } from '@agent-device/kernel/device'; import type { BindDeviceRuntime } from '../../request-runtime-binding.ts'; diff --git a/src/daemon/handlers/__tests__/session-test-harness.ts b/src/daemon/handlers/__tests__/session-test-harness.ts index 4d0b882b6..8e7a6c083 100644 --- a/src/daemon/handlers/__tests__/session-test-harness.ts +++ b/src/daemon/handlers/__tests__/session-test-harness.ts @@ -1,7 +1,8 @@ import { isMacOs } from '@agent-device/kernel/device'; import { expect, vi, beforeEach } from 'vitest'; import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; -import { localRuntimeOwner, type AppLogLiveState } from '@agent-device/contracts/platform'; +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 '../../../__tests__/test-utils/app-log-live-handle.ts'; import type { LogBackend } from '@agent-device/contracts/observability'; diff --git a/src/daemon/handlers/__tests__/session-test-suite-command-video.test.ts b/src/daemon/handlers/__tests__/session-test-suite-command-video.test.ts index 3fef937ee..14a786fe4 100644 --- a/src/daemon/handlers/__tests__/session-test-suite-command-video.test.ts +++ b/src/daemon/handlers/__tests__/session-test-suite-command-video.test.ts @@ -21,10 +21,8 @@ import { import { createScreenRecordingAdmissionLedger } from '../../screen-recording-admission-ledger.ts'; import type { RecordRuntimeHandlerParams } from '../record-runtime.ts'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; -import { - localRuntimeOwner, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; const recordRuntimeMocks = vi.hoisted(() => ({ handleRecordCommand: vi.fn(), diff --git a/src/daemon/handlers/find.ts b/src/daemon/handlers/find.ts index 9d8dd9f41..0b2400f6d 100644 --- a/src/daemon/handlers/find.ts +++ b/src/daemon/handlers/find.ts @@ -22,11 +22,9 @@ import { executeFocusPoint } from '../focus-runtime.ts'; import { executeBoundTypeText } from '../type-text-runtime.ts'; import { dispatchFindReadOnlyViaRuntime } from '../selector-runtime.ts'; import { admitAndBindSnapshotCapture } from '../snapshot-runtime-binding.ts'; -import { - resolveSelectorCaptureRuntimePlan, - type FocusPointInput, - type TypeTextRuntimeOperations, -} from '@agent-device/contracts/platform'; +import type { FocusPointInput } from '@agent-device/contracts/focus-runtime'; +import { resolveSelectorCaptureRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; +import type { TypeTextRuntimeOperations } from '@agent-device/contracts/type-text-runtime'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; import { createFindTargetCapture, sparseFindSnapshotResponse } from './find-target-capture.ts'; import { isSparseSnapshotQualityVerdict } from '../../snapshot-quality/verdict.ts'; diff --git a/src/daemon/handlers/interaction-gesture.ts b/src/daemon/handlers/interaction-gesture.ts index 88a82c3a6..b572f418e 100644 --- a/src/daemon/handlers/interaction-gesture.ts +++ b/src/daemon/handlers/interaction-gesture.ts @@ -1,19 +1,22 @@ import { readOptionalInteger } from '@agent-device/contracts/command'; +import { type GesturePayload, readGesturePayload } from '@agent-device/contracts/gesture-input'; import { + type SwipePayload, assertNoRemovedSwipeInput, - GESTURE_FLING_DURATION_MS, gesturePayloadToPositionals, normalizeGestureCommandInput, normalizePublicSwipeMotion, - readGesturePayload, +} from '@agent-device/contracts/gesture-normalization'; +import { GESTURE_FLING_DURATION_MS } from '@agent-device/contracts/gesture-plan'; +import type { + GestureCommandInput, + GestureExecutionProfile, +} from '@agent-device/contracts/gesture-plan-types'; +import { SWIPE_PAUSE_MAX_MS, SWIPE_REPETITION_MAX, SWIPE_SERIES_MAX_SCHEDULED_DURATION_MS, - type GestureExecutionProfile, - type GesturePayload, - type GestureCommandInput, - type SwipePayload, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/scroll-gesture'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { REF_GRAMMAR_HINT, diff --git a/src/daemon/handlers/interaction-touch-press-admission.ts b/src/daemon/handlers/interaction-touch-press-admission.ts index 66a18d572..a68310b3b 100644 --- a/src/daemon/handlers/interaction-touch-press-admission.ts +++ b/src/daemon/handlers/interaction-touch-press-admission.ts @@ -4,7 +4,7 @@ import { buttonTag, getClickButtonValidationError, resolveClickButton, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/click-button'; import { publicPlatformString } from '@agent-device/kernel/device'; import { resolveRefStalenessWarning } from '../session-snapshot.ts'; import type { DaemonResponse, SessionState } from '../types.ts'; diff --git a/src/daemon/handlers/record-runtime.ts b/src/daemon/handlers/record-runtime.ts index f6f0fb86a..91d5b73c3 100644 --- a/src/daemon/handlers/record-runtime.ts +++ b/src/daemon/handlers/record-runtime.ts @@ -1,12 +1,12 @@ import path from 'node:path'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; +import type { ScreenRecordingStartInput } from '@agent-device/contracts/screen-recording-runtime'; import { resolveScreenRecordingRuntimePlan, screenRecordingAdmissionUse, - screenRecordingStartUse, screenRecordingRecoveryUse, - type PlatformRequestScope, - type ScreenRecordingStartInput, -} from '@agent-device/contracts/platform'; + screenRecordingStartUse, +} from '@agent-device/contracts/screen-recording-runtime-plan'; import { isWholeScreenRecordingScope } from '@agent-device/contracts/recording'; import { deviceIdentity, sameDeviceIdentity } from '@agent-device/kernel/device'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/handlers/session-app-deployment.ts b/src/daemon/handlers/session-app-deployment.ts index 211dfeca8..adde3e6ae 100644 --- a/src/daemon/handlers/session-app-deployment.ts +++ b/src/daemon/handlers/session-app-deployment.ts @@ -1,9 +1,9 @@ import fs from 'node:fs'; +import type { AppDeploymentResult } from '@agent-device/contracts/app-deployment-runtime'; import { deployAppUse, readySendPushNotificationUse, - type AppDeploymentResult, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/app-deployment-runtime-plan'; import { isIosFamily, publicPlatformString } from '@agent-device/kernel/device'; import { readNotificationPayload } from '../../core/dispatch-payload.ts'; import { cleanupUploadedArtifact, prepareUploadedArtifact } from '../artifact-tracking.ts'; diff --git a/src/daemon/handlers/session-app-source-deployment.ts b/src/daemon/handlers/session-app-source-deployment.ts index 848832263..043dbf74e 100644 --- a/src/daemon/handlers/session-app-source-deployment.ts +++ b/src/daemon/handlers/session-app-source-deployment.ts @@ -1,6 +1,6 @@ import type { AppDeploymentResult, MaterializedAppSource } from '@agent-device/contracts/platform'; import type { CommandFlags } from '@agent-device/contracts/command'; -import { readyMaterializeAndDeployAppUse } from '@agent-device/contracts/platform'; +import { readyMaterializeAndDeployAppUse } from '@agent-device/contracts/app-deployment-runtime-plan'; import { isIosFamily } from '@agent-device/kernel/device'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { diff --git a/src/daemon/handlers/session-close-runtime-admission.ts b/src/daemon/handlers/session-close-runtime-admission.ts index b673d1e00..8adaa4ea0 100644 --- a/src/daemon/handlers/session-close-runtime-admission.ts +++ b/src/daemon/handlers/session-close-runtime-admission.ts @@ -1,8 +1,8 @@ import { closeApplicationRuntimeUse, closeApplicationWithRuntimeHintClearUse, - type BoundDeviceRuntime, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonResponse } from '../types.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; diff --git a/src/daemon/handlers/session-doctor.ts b/src/daemon/handlers/session-doctor.ts index a086dd821..9645bd6bc 100644 --- a/src/daemon/handlers/session-doctor.ts +++ b/src/daemon/handlers/session-doctor.ts @@ -36,11 +36,9 @@ import { } from '../../platforms/apple/core/runner/runner-client.ts'; import { appendWebBrowserLifecycleCheck } from './session-doctor-web.ts'; import { resolveAndroidSerialAllowlist } from '../../utils/device-isolation.ts'; -import { - appsRuntimeUse, - type BoundDeviceRuntime, - type InstalledAppInfo, -} from '@agent-device/contracts/platform'; +import type { InstalledAppInfo } from '@agent-device/contracts/app-inventory-runtime'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; +import { appsRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; import { ensureAppsRuntimeReady, listAppsFromRuntime } from '../apps-runtime.ts'; diff --git a/src/daemon/handlers/session-install-capability-projection.ts b/src/daemon/handlers/session-install-capability-projection.ts index ae81903a1..cd299cd2f 100644 --- a/src/daemon/handlers/session-install-capability-projection.ts +++ b/src/daemon/handlers/session-install-capability-projection.ts @@ -1,9 +1,9 @@ import { INTERNAL_COMMANDS, PUBLIC_COMMANDS } from '../../command-catalog.ts'; import { commandDescriptors } from '../../core/command-descriptor/registry.ts'; -import { - type RuntimeOperationFact, - type RuntimeUseDeclaration, -} from '@agent-device/contracts/platform'; +import type { + RuntimeOperationFact, + RuntimeUseDeclaration, +} from '@agent-device/contracts/platform-runtime'; import type { InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; type InstallFamilyRuntimeUse = RuntimeUseDeclaration; diff --git a/src/daemon/handlers/session-inventory.ts b/src/daemon/handlers/session-inventory.ts index 5abc002e7..2c5bbf384 100644 --- a/src/daemon/handlers/session-inventory.ts +++ b/src/daemon/handlers/session-inventory.ts @@ -25,16 +25,18 @@ import { } from './session-device-utils.ts'; import { errorResponse } from './response.ts'; import { resolveImplicitSessionScope, sessionMatchesScope } from '../session-routing.ts'; +import { appLogAdmissionUse } from '@agent-device/contracts/logs-runtime-plan'; +import { networkAdmissionUse } from '@agent-device/contracts/network-runtime-plan'; +import type { + BoundDeviceRuntime, + RuntimeFacts, + RuntimeOperationKey, +} from '@agent-device/contracts/platform-runtime'; import { - appLogAdmissionUse, - appsRuntimeUse, - networkAdmissionUse, - screenRecordingAdmissionUse, type PlatformRuntimeOperations, - type RuntimeFacts, - type BoundDeviceRuntime, - type RuntimeOperationKey, -} from '@agent-device/contracts/platform'; + appsRuntimeUse, +} from '@agent-device/contracts/platform-runtime-operations'; +import { screenRecordingAdmissionUse } from '@agent-device/contracts/screen-recording-runtime-plan'; import { ensureAppsRuntimeReady, listAppsFromRuntime } from '../apps-runtime.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; import { installFamilyCapabilityAvailable } from './session-install-capability-projection.ts'; diff --git a/src/daemon/handlers/session-network.ts b/src/daemon/handlers/session-network.ts index 657b27d7c..d9bb32a63 100644 --- a/src/daemon/handlers/session-network.ts +++ b/src/daemon/handlers/session-network.ts @@ -1,8 +1,8 @@ +import type { NetworkDumpResult } from '@agent-device/contracts/network-runtime'; import { networkAdmissionUse, resolveNetworkRuntimePlan, - type NetworkDumpResult, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/network-runtime-plan'; import { NETWORK_INCLUDE_MODES, type NetworkIncludeMode } from '@agent-device/kernel/contracts'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import type { BindDeviceRuntime } from '../request-runtime-binding.ts'; diff --git a/src/daemon/handlers/session-observability.ts b/src/daemon/handlers/session-observability.ts index 9b4713106..124215eb5 100644 --- a/src/daemon/handlers/session-observability.ts +++ b/src/daemon/handlers/session-observability.ts @@ -12,14 +12,16 @@ import { type PerfArea, type PerfKind, } from '@agent-device/contracts/observability'; +import type { + AppLogFailure, + AppLogRuntimeOperations, +} from '@agent-device/contracts/app-log-runtime'; import { + type LogsRuntimePlan, appLogAdmissionUse, resolveLogsRuntimePlan, - type AppLogFailure, - type AppLogRuntimeOperations, - type LogsRuntimePlan, - type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/logs-runtime-plan'; +import type { RuntimeOwnerRef } from '@agent-device/contracts/platform-runtime'; import { uniqueStrings } from '@agent-device/kernel/collections'; import { AppError, normalizeError } from '@agent-device/kernel/errors'; import type { AndroidAdbExecutor } from '../../platforms/android/adb-executor.ts'; diff --git a/src/daemon/handlers/session-open-execution.ts b/src/daemon/handlers/session-open-execution.ts index f5fc22721..862cdc860 100644 --- a/src/daemon/handlers/session-open-execution.ts +++ b/src/daemon/handlers/session-open-execution.ts @@ -2,8 +2,8 @@ import { openApplicationRuntimeUse, openApplicationWithRuntimeHintApplyUse, openApplicationWithRuntimeHintClearUse, - type BoundDeviceRuntime, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { SessionSurface } from '@agent-device/contracts/session'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts'; diff --git a/src/daemon/handlers/session-open-prepare.ts b/src/daemon/handlers/session-open-prepare.ts index c3525bfb1..83081aae9 100644 --- a/src/daemon/handlers/session-open-prepare.ts +++ b/src/daemon/handlers/session-open-prepare.ts @@ -1,9 +1,7 @@ import { isDeepLinkTarget } from '@agent-device/contracts/command'; -import { - openApplicationRuntimeUse, - type BoundDeviceRuntime, - type RuntimeHintsApplicationInput, -} from '@agent-device/contracts/platform'; +import type { RuntimeHintsApplicationInput } from '@agent-device/contracts/application-lifecycle-runtime'; +import { openApplicationRuntimeUse } from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest, DaemonResponse, SessionRuntimeHints, SessionState } from '../types.ts'; import { SessionStore } from '../session-store.ts'; diff --git a/src/daemon/handlers/session-open.ts b/src/daemon/handlers/session-open.ts index 26b99ffb8..3b36d056b 100644 --- a/src/daemon/handlers/session-open.ts +++ b/src/daemon/handlers/session-open.ts @@ -5,7 +5,7 @@ import { openApplicationWithRuntimeHintApplyUse, openApplicationWithRuntimeHintClearUse, resolveOpenApplicationRuntimePlan, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime-plan'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts'; import { SessionStore } from '../session-store.ts'; diff --git a/src/daemon/handlers/session-prepare.ts b/src/daemon/handlers/session-prepare.ts index 19264b40c..8e0d31bbb 100644 --- a/src/daemon/handlers/session-prepare.ts +++ b/src/daemon/handlers/session-prepare.ts @@ -1,7 +1,5 @@ -import { - prepareAppleRunnerRuntimeUse, - type BoundDeviceRuntime, -} from '@agent-device/contracts/platform'; +import { prepareAppleRunnerRuntimeUse } from '@agent-device/contracts/application-lifecycle-runtime-plan'; +import type { BoundDeviceRuntime } from '@agent-device/contracts/platform-runtime'; import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; import { PREPARE_REQUEST_TIMEOUT_MS } from '../../core/command-descriptor/timeout-policy.ts'; import { publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; diff --git a/src/daemon/handlers/session-replay-action-runtime.ts b/src/daemon/handlers/session-replay-action-runtime.ts index f3b87a025..2a08f2700 100644 --- a/src/daemon/handlers/session-replay-action-runtime.ts +++ b/src/daemon/handlers/session-replay-action-runtime.ts @@ -6,7 +6,7 @@ import { AppError, normalizeError } from '@agent-device/kernel/errors'; import { gesturePayloadFromPositionals, swipePayloadFromPositionals, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-normalization'; import { buildDisplayPositionals } from '../session-event-action.ts'; import { appendReplayTraceEvent } from './session-replay-trace.ts'; import { inferFillText } from '../action-utils.ts'; diff --git a/src/daemon/handlers/session-replay-divergence.ts b/src/daemon/handlers/session-replay-divergence.ts index 6d9fc7311..f760eba2c 100644 --- a/src/daemon/handlers/session-replay-divergence.ts +++ b/src/daemon/handlers/session-replay-divergence.ts @@ -1,7 +1,7 @@ import type { SessionAction } from '@agent-device/contracts/session'; import type { CommandFlags } from '@agent-device/contracts/command'; import { sleep } from '../../utils/timeouts.ts'; -import { isUnreadableCaptureContentError } from '@agent-device/contracts/platform'; +import { isUnreadableCaptureContentError } from '@agent-device/contracts/android-snapshot-quality'; import { isSparseSnapshotQualityVerdict } from '../../snapshot-quality/verdict.ts'; import { displayLabel, formatRole } from '../../snapshot/snapshot-lines.ts'; import type { ResponseLevel } from '@agent-device/kernel/contracts'; diff --git a/src/daemon/handlers/session-replay-target-token.ts b/src/daemon/handlers/session-replay-target-token.ts index 5bb5fa1cf..216cc5589 100644 --- a/src/daemon/handlers/session-replay-target-token.ts +++ b/src/daemon/handlers/session-replay-target-token.ts @@ -1,6 +1,6 @@ import type { SessionAction } from '@agent-device/contracts/session'; import { isTouchTargetCommand } from '@agent-device/ad-script'; -import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/interaction'; +import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/gesture-normalization'; import { readSelectorExpression } from '@agent-device/selectors'; /** Returns the resolved-target token carried by an eligible replay action. */ diff --git a/src/daemon/handlers/session-runtime-command.ts b/src/daemon/handlers/session-runtime-command.ts index 734a48628..f2d17c55f 100644 --- a/src/daemon/handlers/session-runtime-command.ts +++ b/src/daemon/handlers/session-runtime-command.ts @@ -1,6 +1,6 @@ import type { DaemonRequest, DaemonResponse } from '../types.ts'; import { publicPlatformString } from '@agent-device/kernel/device'; -import { clearRuntimeHintsRuntimeUse } from '@agent-device/contracts/platform'; +import { clearRuntimeHintsRuntimeUse } from '@agent-device/contracts/application-lifecycle-runtime-plan'; import { SessionStore } from '../session-store.ts'; import { errorResponse } from './response.ts'; import { expireRefFrame } from '../ref-frame.ts'; diff --git a/src/daemon/handlers/session-runtime-port-reverse.ts b/src/daemon/handlers/session-runtime-port-reverse.ts index dcb3768e5..7e787e9dd 100644 --- a/src/daemon/handlers/session-runtime-port-reverse.ts +++ b/src/daemon/handlers/session-runtime-port-reverse.ts @@ -1,5 +1,5 @@ import type { ProviderPortReverseOptions } from '@agent-device/contracts/device'; -import { configureProviderPortReverseRuntimeUse } from '@agent-device/contracts/platform'; +import { configureProviderPortReverseRuntimeUse } from '@agent-device/contracts/application-lifecycle-runtime-plan'; import type { DaemonRequest, DaemonResponse } from '../types.ts'; import type { SessionStore } from '../session-store.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from '../request-runtime-binding.ts'; diff --git a/src/daemon/handlers/session-runtime.ts b/src/daemon/handlers/session-runtime.ts index 7c8a0fff7..5da503b3f 100644 --- a/src/daemon/handlers/session-runtime.ts +++ b/src/daemon/handlers/session-runtime.ts @@ -1,8 +1,8 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import { - hasRuntimeTransportHintValues, type RuntimeHintValues, -} from '@agent-device/contracts/platform'; + hasRuntimeTransportHintValues, +} from '@agent-device/contracts/application-lifecycle-runtime'; import { AppError, asAppError } from '@agent-device/kernel/errors'; import { publicPlatformString, type DeviceInfo } from '@agent-device/kernel/device'; import type { DaemonRequest, SessionRuntimeHints, SessionState } from '../types.ts'; diff --git a/src/daemon/handlers/session-state.ts b/src/daemon/handlers/session-state.ts index 798a59152..7fa1eff83 100644 --- a/src/daemon/handlers/session-state.ts +++ b/src/daemon/handlers/session-state.ts @@ -1,11 +1,11 @@ import { AppError, asAppError } from '@agent-device/kernel/errors'; import type { TargetShutdownResult } from '@agent-device/contracts/device'; +import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime'; import { - resolveDeviceReadinessRuntimePlan, appStateUse, + resolveDeviceReadinessRuntimePlan, shutdownTargetUse, - type RuntimeOperationFact, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/platform-runtime-operations'; import { isApplePlatform, isIosFamily, diff --git a/src/daemon/handlers/snapshot-alert.ts b/src/daemon/handlers/snapshot-alert.ts index c63c0756b..fc8b3e831 100644 --- a/src/daemon/handlers/snapshot-alert.ts +++ b/src/daemon/handlers/snapshot-alert.ts @@ -2,9 +2,9 @@ import { isIosFamily, isMacOs } from '@agent-device/kernel/device'; import { ALERT_ACTION_RETRY_MS, ALERT_POLL_INTERVAL_MS as POLL_INTERVAL_MS, - DEFAULT_ALERT_TIMEOUT_MS as DEFAULT_TIMEOUT_MS, type AlertAction, -} from '@agent-device/contracts/interaction'; + DEFAULT_ALERT_TIMEOUT_MS as DEFAULT_TIMEOUT_MS, +} from '@agent-device/contracts/alert-contract'; import { sleep } from '../../utils/timeouts.ts'; import { runAppleRunnerCommand } from '../../platforms/apple/core/runner/runner-client.ts'; import { runMacOsAlertAction } from '../../platforms/apple/os/macos/helper.ts'; diff --git a/src/daemon/recording-gestures.ts b/src/daemon/recording-gestures.ts index 6bc560a27..a3e92705a 100644 --- a/src/daemon/recording-gestures.ts +++ b/src/daemon/recording-gestures.ts @@ -8,12 +8,12 @@ import { resolveTapVisualizationOffsetMs, } from './recording-timing.ts'; import { emitDiagnostic } from '../utils/diagnostics.ts'; +import { DEFAULT_MOBILE_SCROLL_DURATION_MS } from '@agent-device/contracts/scroll-command'; import { - buildScrollGesturePlan, - DEFAULT_MOBILE_SCROLL_DURATION_MS, type ScrollDirection, type SwipePattern, -} from '@agent-device/contracts/interaction'; + buildScrollGesturePlan, +} from '@agent-device/contracts/scroll-gesture'; import { getSnapshotReferenceFrame, type TouchReferenceFrame as ReferenceFrame, diff --git a/src/daemon/request-runtime-binding.ts b/src/daemon/request-runtime-binding.ts index ec3108e0d..b17f465b8 100644 --- a/src/daemon/request-runtime-binding.ts +++ b/src/daemon/request-runtime-binding.ts @@ -1,18 +1,18 @@ import { deviceIdentity, deviceIdentityKey, type DeviceInfo } from '@agent-device/kernel/device'; +import { AsyncCleanupStack } from '@agent-device/contracts/async-lifecycle'; import { - AsyncCleanupStack, - narrowDeviceBinding, type BoundDeviceRuntime, type DeviceBinding, type DeviceRuntimeGateway, - type PlatformRuntimeOperations, - type PlatformRequestScope, type ResourceOwnershipFence, + type RuntimeFacts, type RuntimeOperationKey, type RuntimeOwnerRef, - type RuntimeFacts, type RuntimeUse, -} from '@agent-device/contracts/platform'; + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; export type BindDeviceRuntime = < const Required extends readonly RuntimeOperationKey[], diff --git a/src/daemon/screen-recording-resource-recovery.ts b/src/daemon/screen-recording-resource-recovery.ts index 279a77afe..fe313a241 100644 --- a/src/daemon/screen-recording-resource-recovery.ts +++ b/src/daemon/screen-recording-resource-recovery.ts @@ -1,14 +1,16 @@ +import type { DurableResourceEnvelope } from '@agent-device/contracts/durable-resource-envelope'; import { - narrowDeviceBinding, - screenRecordingRecoveryUse, type BoundDeviceRuntime, type DeviceRuntimeGateway, - type DurableResourceEnvelope, - type PlatformRequestScope, - type PlatformRuntimeOperations, - type ScreenRecordingCompletion, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; + narrowDeviceBinding, +} from '@agent-device/contracts/platform-runtime'; +import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host'; +import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations'; +import type { + ScreenRecordingCompletion, + ScreenRecordingLiveHandle, +} from '@agent-device/contracts/screen-recording-runtime'; +import { screenRecordingRecoveryUse } from '@agent-device/contracts/screen-recording-runtime-plan'; import type { DurableCaptureRecoveryControl } from './durable-capture-recovery-authority.ts'; import { acquireExactDurableCaptureRecoveryControl } from './durable-capture-runtime-recovery.ts'; import type { DurableCaptureRecoveryDiagnostic } from './durable-capture-resource-recovery.ts'; diff --git a/src/daemon/screen-recording-resource-store.ts b/src/daemon/screen-recording-resource-store.ts index f33de339b..3fff95c8a 100644 --- a/src/daemon/screen-recording-resource-store.ts +++ b/src/daemon/screen-recording-resource-store.ts @@ -1,4 +1,4 @@ -import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/platform'; +import { SCREEN_RECORDING_RESOURCE_KIND } from '@agent-device/contracts/screen-recording-runtime'; import { createDurableCaptureResourceStore } from './durable-capture-resource-store.ts'; export const screenRecordingResourceStore = createDurableCaptureResourceStore({ diff --git a/src/daemon/screenshot-runtime-binding.ts b/src/daemon/screenshot-runtime-binding.ts index ce69a66ef..d32fd0be5 100644 --- a/src/daemon/screenshot-runtime-binding.ts +++ b/src/daemon/screenshot-runtime-binding.ts @@ -1,13 +1,17 @@ +import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime'; import { - resolveScreenshotRuntimePlan, - type CaptureScreenshotInput, - type CaptureSnapshotInput, - type RuntimeOperationFact, - type ScreenshotRuntimeOperations, type ScreenshotRuntimePlan, - type SnapshotResult, - type SnapshotRuntimeOperations, -} from '@agent-device/contracts/platform'; + resolveScreenshotRuntimePlan, +} from '@agent-device/contracts/platform-runtime-operations'; +import type { + CaptureScreenshotInput, + ScreenshotRuntimeOperations, +} from '@agent-device/contracts/screenshot-runtime'; +import type { + CaptureSnapshotInput, + SnapshotResult, + SnapshotRuntimeOperations, +} from '@agent-device/contracts/snapshot-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { errorResponse } from './handlers/response.ts'; import { diff --git a/src/daemon/selector-capture-binding.ts b/src/daemon/selector-capture-binding.ts index 915d7b6e7..e9375d03d 100644 --- a/src/daemon/selector-capture-binding.ts +++ b/src/daemon/selector-capture-binding.ts @@ -1,11 +1,13 @@ -import { - resolveSelectorCaptureRuntimePlan, - type CaptureSnapshotInput, - type ElementTextRuntimeOperations, - type FindTextRuntimeOperations, - type FindSelectorRuntimeOperations, - type SnapshotResult, -} from '@agent-device/contracts/platform'; +import type { ElementTextRuntimeOperations } from '@agent-device/contracts/element-text-runtime'; +import { resolveSelectorCaptureRuntimePlan } from '@agent-device/contracts/platform-runtime-operations'; +import type { + FindSelectorRuntimeOperations, + FindTextRuntimeOperations, +} from '@agent-device/contracts/selector-observation-runtime'; +import type { + CaptureSnapshotInput, + SnapshotResult, +} from '@agent-device/contracts/snapshot-runtime'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; import { admitAndBindSnapshotCapture } from './snapshot-runtime-binding.ts'; import type { DaemonResponse, SessionState } from './types.ts'; diff --git a/src/daemon/selector-recording.ts b/src/daemon/selector-recording.ts index cc7913834..e319960b1 100644 --- a/src/daemon/selector-recording.ts +++ b/src/daemon/selector-recording.ts @@ -1,7 +1,7 @@ import type { DaemonRequest } from './types.ts'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import type { FindReadResult } from '@agent-device/contracts/interaction'; -import { stripAndroidSystemChromeProvenanceFromNode } from '@agent-device/contracts/platform'; +import { stripAndroidSystemChromeProvenanceFromNode } from '@agent-device/contracts/android-system-chrome'; import { SessionStore } from './session-store.ts'; import { isInteractiveObservation } from './session-action-recorder.ts'; import { isSessionRecording } from './session-script-publication-capability.ts'; diff --git a/src/daemon/selector-runtime.ts b/src/daemon/selector-runtime.ts index a7ddd1a98..800efc2dc 100644 --- a/src/daemon/selector-runtime.ts +++ b/src/daemon/selector-runtime.ts @@ -1,4 +1,4 @@ -import { waitObservesDevice } from '@agent-device/contracts/platform'; +import { waitObservesDevice } from '@agent-device/contracts/wait-runtime-plan'; import { parseWaitPositionals } from '../core/wait-positionals.ts'; import type { WaitParsed } from '../core/wait-positionals.ts'; import { AppError, asAppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/server/daemon-runtime-recording-teardown.test.ts b/src/daemon/server/daemon-runtime-recording-teardown.test.ts index a7ffd767c..892bae6e5 100644 --- a/src/daemon/server/daemon-runtime-recording-teardown.test.ts +++ b/src/daemon/server/daemon-runtime-recording-teardown.test.ts @@ -1,10 +1,10 @@ import path from 'node:path'; import { afterEach, expect, test, vi } from 'vitest'; -import { - localRuntimeOwner, - type ScreenRecordingCompletion, - type ScreenRecordingLiveHandle, -} from '@agent-device/contracts/platform'; +import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import type { + ScreenRecordingCompletion, + ScreenRecordingLiveHandle, +} from '@agent-device/contracts/screen-recording-runtime'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; import { screenRecordingResourceStore } from '../screen-recording-resource-store.ts'; diff --git a/src/daemon/session-event-action-presentation.ts b/src/daemon/session-event-action-presentation.ts index b3cd278d7..eb4c95614 100644 --- a/src/daemon/session-event-action-presentation.ts +++ b/src/daemon/session-event-action-presentation.ts @@ -1,6 +1,7 @@ import type { SessionAction } from '@agent-device/contracts/session'; import { DEVICE_ROTATIONS } from '@agent-device/contracts/device'; -import { BACK_MODES, TV_REMOTE_BUTTONS } from '@agent-device/contracts/interaction'; +import { BACK_MODES } from '@agent-device/contracts/back-mode'; +import { TV_REMOTE_BUTTONS } from '@agent-device/contracts/tv-remote'; import { PUBLIC_COMMANDS } from '../command-catalog.ts'; import { isKeyboardAction } from '../utils/keyboard-actions.ts'; import { diff --git a/src/daemon/session-event-action.ts b/src/daemon/session-event-action.ts index fec09b570..b9a64e28e 100644 --- a/src/daemon/session-event-action.ts +++ b/src/daemon/session-event-action.ts @@ -1,4 +1,6 @@ -import { BACK_MODES, CLICK_BUTTONS, SWIPE_PATTERNS } from '@agent-device/contracts/interaction'; +import { BACK_MODES } from '@agent-device/contracts/back-mode'; +import { CLICK_BUTTONS } from '@agent-device/contracts/click-button'; +import { SWIPE_PATTERNS } from '@agent-device/contracts/scroll-gesture'; import { RECORDING_SCOPE_VALUES } from '@agent-device/contracts/recording'; import { SESSION_SURFACES, type SessionAction } from '@agent-device/contracts/session'; import { DEVICE_TARGETS, PLATFORM_SELECTORS, PUBLIC_PLATFORMS } from '@agent-device/kernel/device'; diff --git a/src/daemon/session-script-active-publication.ts b/src/daemon/session-script-active-publication.ts index 34051cbc9..303d457c6 100644 --- a/src/daemon/session-script-active-publication.ts +++ b/src/daemon/session-script-active-publication.ts @@ -3,7 +3,7 @@ import { resolveCommandRecordingEffect } from '../core/command-descriptor/regist import { parseWaitPositionals } from '../core/wait-positionals.ts'; import { AppError } from '@agent-device/kernel/errors'; import { isTouchTargetCommand } from '@agent-device/ad-script'; -import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/interaction'; +import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/gesture-normalization'; import { isValidSelectorExpression } from '@agent-device/selectors'; export function validateActivePublicationActions(actions: SessionAction[]): void { diff --git a/src/daemon/session-script-writer.ts b/src/daemon/session-script-writer.ts index ea5022693..1eb5bbbf3 100644 --- a/src/daemon/session-script-writer.ts +++ b/src/daemon/session-script-writer.ts @@ -2,7 +2,7 @@ import type { SessionAction } from '@agent-device/contracts/session'; import fs from 'node:fs'; import path from 'node:path'; import { publicPlatformString } from '@agent-device/kernel/device'; -import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/interaction'; +import { dragGesturePayloadFromPositionals } from '@agent-device/contracts/gesture-normalization'; import { inferFillText } from './action-utils.ts'; import { emitDiagnostic } from '../utils/diagnostics.ts'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/snapshot-runtime-binding.ts b/src/daemon/snapshot-runtime-binding.ts index 041cb32a0..aa3ad8ecf 100644 --- a/src/daemon/snapshot-runtime-binding.ts +++ b/src/daemon/snapshot-runtime-binding.ts @@ -1,12 +1,14 @@ +import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime'; import { - resolveSnapshotRuntimePlan, - type CaptureSnapshotInput, - type RuntimeOperationFact, type SelectorCaptureRuntimePlan, - type SnapshotResult, - type SnapshotRuntimeOperations, type SnapshotRuntimePlan, -} from '@agent-device/contracts/platform'; + resolveSnapshotRuntimePlan, +} from '@agent-device/contracts/platform-runtime-operations'; +import type { + CaptureSnapshotInput, + SnapshotResult, + SnapshotRuntimeOperations, +} from '@agent-device/contracts/snapshot-runtime'; import { buildIosOpenCommandHint } from './ios-app-session-hint.ts'; import { buildRuntimeCaptureInput } from './snapshot-runtime-capture-input.ts'; import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-runtime-binding.ts'; diff --git a/src/daemon/snapshot-runtime.ts b/src/daemon/snapshot-runtime.ts index c12a26d8a..574191d5c 100644 --- a/src/daemon/snapshot-runtime.ts +++ b/src/daemon/snapshot-runtime.ts @@ -1,4 +1,4 @@ -import { stripAndroidSystemChromeProvenance } from '@agent-device/contracts/platform'; +import { stripAndroidSystemChromeProvenance } from '@agent-device/contracts/android-system-chrome'; import { copySnapshotClickabilityEvidence } from '@agent-device/contracts/capture'; import { dispatchSnapshotRuntimeCommand } from './snapshot-command-runtime.ts'; import { captureSparseFallbackScreenshot } from './sparse-fallback-screenshot.ts'; diff --git a/src/daemon/snapshot-state.ts b/src/daemon/snapshot-state.ts index b0eef0286..9d5e14ed7 100644 --- a/src/daemon/snapshot-state.ts +++ b/src/daemon/snapshot-state.ts @@ -1,6 +1,6 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import { snapshotCaptureAnnotationsFrom } from '@agent-device/contracts/capture'; -import { isAndroidInputMethodNode } from '@agent-device/contracts/platform'; +import { isAndroidInputMethodNode } from '@agent-device/contracts/android-input-ownership'; import { attachRefs, buildSnapshotPresentationKey, diff --git a/src/daemon/touch-reference-frame.ts b/src/daemon/touch-reference-frame.ts index eed4c8fb2..949e5564e 100644 --- a/src/daemon/touch-reference-frame.ts +++ b/src/daemon/touch-reference-frame.ts @@ -1,7 +1,7 @@ import { - inferGestureReferenceFrame, type GestureReferenceFrame, -} from '@agent-device/contracts/interaction'; + inferGestureReferenceFrame, +} from '@agent-device/contracts/scroll-gesture'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; export type TouchReferenceFrame = GestureReferenceFrame; diff --git a/src/daemon/type-text-runtime.ts b/src/daemon/type-text-runtime.ts index e34ef8c14..d1caf430f 100644 --- a/src/daemon/type-text-runtime.ts +++ b/src/daemon/type-text-runtime.ts @@ -1,8 +1,8 @@ -import { - typeTextRuntimeUse, - type TypeTextInput, - type TypeTextRuntimeOperations, -} from '@agent-device/contracts/platform'; +import { typeTextRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; +import type { + TypeTextInput, + TypeTextRuntimeOperations, +} from '@agent-device/contracts/type-text-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '../utils/success-text.ts'; diff --git a/src/daemon/viewport-runtime.ts b/src/daemon/viewport-runtime.ts index 838d548db..2c99d977d 100644 --- a/src/daemon/viewport-runtime.ts +++ b/src/daemon/viewport-runtime.ts @@ -1,5 +1,5 @@ import { readViewportDimensions } from '@agent-device/contracts/capture'; -import { viewportRuntimeUse } from '@agent-device/contracts/platform'; +import { viewportRuntimeUse } from '@agent-device/contracts/platform-runtime-operations'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { ResolvedGenericExecution } from './request-generic-dispatch.ts'; import { admitRuntimeUse, type RuntimeAdmissionBindings } from './runtime-admission.ts'; diff --git a/src/daemon/wait-current-surface.ts b/src/daemon/wait-current-surface.ts index 1ea7098d6..950946671 100644 --- a/src/daemon/wait-current-surface.ts +++ b/src/daemon/wait-current-surface.ts @@ -1,4 +1,4 @@ -import { WAIT_REASONS } from '@agent-device/contracts/interaction'; +import { WAIT_REASONS } from '@agent-device/contracts/wait'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import type { DaemonRequest, DaemonResponse, SessionState } from './types.ts'; import { captureSnapshot } from './handlers/snapshot-capture.ts'; diff --git a/src/platform-runtime-device-inventory.test.ts b/src/platform-runtime-device-inventory.test.ts index e0dfaa576..cf00729ae 100644 --- a/src/platform-runtime-device-inventory.test.ts +++ b/src/platform-runtime-device-inventory.test.ts @@ -3,12 +3,14 @@ import type { ProviderDeviceInventorySource, } from '@agent-device/contracts/device'; import { - createPlatformModuleRegistry, - type DeviceInventoryHost, type DeviceInventorySource, type InventoryPlatformModule, - type PlatformRequestScope, -} from '@agent-device/contracts/platform'; + createPlatformModuleRegistry, +} from '@agent-device/contracts/platform-module'; +import type { + DeviceInventoryHost, + PlatformRequestScope, +} from '@agent-device/contracts/platform-runtime-host'; import { PLATFORMS, type DeviceInfo, type Platform } from '@agent-device/kernel/device'; import { describe, expect, test, vi } from 'vitest'; import { createComposedDeviceInventoryGateways } from './platform-runtime-device-inventory.ts'; diff --git a/src/platform-runtime-device-inventory.ts b/src/platform-runtime-device-inventory.ts index 16ee8381f..906e88f85 100644 --- a/src/platform-runtime-device-inventory.ts +++ b/src/platform-runtime-device-inventory.ts @@ -4,17 +4,19 @@ import { projectProviderDeviceInventoryRequest, type ProviderDeviceInventorySource, } from '@agent-device/contracts/device'; -import { - type ComposedDeviceInventoryGateways, - type DeviceInventoryGateway, - type DeviceInventoryHost, - type DeviceInventoryHostFor, - type DeviceInventorySource, - type InventoryPlatformModule, - type PlatformModuleRegistry, - type PlatformRequestScope, - type ProviderAwareDeviceInventoryGateway, -} from '@agent-device/contracts/platform'; +import type { + ComposedDeviceInventoryGateways, + DeviceInventoryGateway, + DeviceInventorySource, + InventoryPlatformModule, + PlatformModuleRegistry, + ProviderAwareDeviceInventoryGateway, +} from '@agent-device/contracts/platform-module'; +import type { + DeviceInventoryHost, + DeviceInventoryHostFor, + PlatformRequestScope, +} from '@agent-device/contracts/platform-runtime-host'; import { isApplePlatform, type DeviceInfo, diff --git a/src/platform-runtime-gateway.fixtures.ts b/src/platform-runtime-gateway.fixtures.ts index 6be191c90..ea3b4ab90 100644 --- a/src/platform-runtime-gateway.fixtures.ts +++ b/src/platform-runtime-gateway.fixtures.ts @@ -13,8 +13,8 @@ import type { import { applicationLifecycleOperationFacts, availableApplicationLifecycleOperations, - providerRuntimeOwner, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/application-lifecycle-runtime'; +import { providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { LimrunRuntimeDependencies } from '@agent-device/provider-limrun'; import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from './__tests__/test-utils/runtime-operation-facts.ts'; diff --git a/src/platform-runtime-gateway.test.ts b/src/platform-runtime-gateway.test.ts index 5661eea4c..83915a444 100644 --- a/src/platform-runtime-gateway.test.ts +++ b/src/platform-runtime-gateway.test.ts @@ -4,14 +4,11 @@ import type { PlatformRuntimeOperations, PlatformRuntimeOwner, } from '@agent-device/contracts/platform'; -import { - applicationLifecycleOperationFacts, - createUnavailablePlatformRuntimeFacts, - localRuntimeOwner, - providerRuntimeOwner, - screenshotRuntimeOperationFacts, - viewportRuntimeOperationFacts, -} from '@agent-device/contracts/platform'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; +import { localRuntimeOwner, providerRuntimeOwner } from '@agent-device/contracts/platform-runtime'; +import { createUnavailablePlatformRuntimeFacts } from '@agent-device/contracts/platform-runtime-unavailable'; +import { screenshotRuntimeOperationFacts } from '@agent-device/contracts/screenshot-runtime'; +import { viewportRuntimeOperationFacts } from '@agent-device/contracts/viewport-runtime'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { createLimrunRuntime } from '@agent-device/provider-limrun'; import { describe, expect, test, vi } from 'vitest'; diff --git a/src/platform-runtime-gateway.ts b/src/platform-runtime-gateway.ts index 76eeaedcf..a3a2a6e24 100644 --- a/src/platform-runtime-gateway.ts +++ b/src/platform-runtime-gateway.ts @@ -1,22 +1,26 @@ import type { ProviderDeviceRuntime } from '@agent-device/contracts/device'; +import { applicationLifecycleOperationFacts } from '@agent-device/contracts/application-lifecycle-runtime'; import { - applicationLifecycleOperationFacts, - createUnavailablePlatformRuntimeBinding, - createUnavailablePlatformRuntimeFacts, - providerRuntimeOwner, - runStartupRecoveryFence, - runtimeOwnerKey, - sameRuntimeOwner, type DeviceBinding, type DeviceBindingRequest, type DeviceRuntimeGateway, - type PlatformRuntimeHost, - type PlatformRuntimeModule, - type PlatformRuntimeOperations, - type PlatformRuntimeOwner, - type PlatformRuntimeProviderModule, type RuntimeOwnerRef, -} from '@agent-device/contracts/platform'; + providerRuntimeOwner, + runtimeOwnerKey, + sameRuntimeOwner, +} from '@agent-device/contracts/platform-runtime'; +import type { + PlatformRuntimeHost, + PlatformRuntimeModule, + PlatformRuntimeOperations, + PlatformRuntimeOwner, + PlatformRuntimeProviderModule, +} from '@agent-device/contracts/platform-runtime-operations'; +import { + createUnavailablePlatformRuntimeBinding, + createUnavailablePlatformRuntimeFacts, +} from '@agent-device/contracts/platform-runtime-unavailable'; +import { runStartupRecoveryFence } from '@agent-device/contracts/startup-recovery-fence'; import { deviceIdentity, deviceShape, diff --git a/src/platform-runtime.ts b/src/platform-runtime.ts index a381cb174..9abd7d453 100644 --- a/src/platform-runtime.ts +++ b/src/platform-runtime.ts @@ -2,17 +2,21 @@ import type { ProviderDeviceInventorySource, ProviderDeviceRuntime, } from '@agent-device/contracts/device'; +import type { AppLogSessionArtifacts } from '@agent-device/contracts/app-log-runtime'; +import type { + AppStateRuntimeHost, + AppStateRuntimeResult, +} from '@agent-device/contracts/app-state-runtime'; +import type { DeviceShutdownRuntimeDependencies } from '@agent-device/contracts/device-shutdown-runtime'; import { - createPlatformModuleRegistry, - type AppLogSessionArtifacts, - type AppStateRuntimeHost, - type AppStateRuntimeResult, type ComposedDeviceInventoryGateways, - type DeviceRuntimeGateway, - type DeviceShutdownRuntimeDependencies, - type PlatformRuntimeModule, - type PlatformRuntimeOperations, -} from '@agent-device/contracts/platform'; + createPlatformModuleRegistry, +} from '@agent-device/contracts/platform-module'; +import type { DeviceRuntimeGateway } from '@agent-device/contracts/platform-runtime'; +import type { + PlatformRuntimeModule, + PlatformRuntimeOperations, +} from '@agent-device/contracts/platform-runtime-operations'; import { inventoryModule as appleInventoryModule, loadShutdownRuntime as loadAppleShutdownRuntime, diff --git a/src/platforms/android/__tests__/ime-lifecycle-race.test.ts b/src/platforms/android/__tests__/ime-lifecycle-race.test.ts index 05394783c..837c8da6e 100644 --- a/src/platforms/android/__tests__/ime-lifecycle-race.test.ts +++ b/src/platforms/android/__tests__/ime-lifecycle-race.test.ts @@ -11,7 +11,7 @@ import { import { resetStartupRecoveryFencesForTests, runStartupRecoveryFence, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/startup-recovery-fence'; const HELPER_SERVICE = 'com.callstack.agentdevice.imehelper/.TestInputMethodService'; const LATIN_IME = 'com.google.android.inputmethod.latin/.LatinIME'; diff --git a/src/platforms/android/__tests__/ime-lifecycle.test.ts b/src/platforms/android/__tests__/ime-lifecycle.test.ts index c9a6c69e1..132ef0f05 100644 --- a/src/platforms/android/__tests__/ime-lifecycle.test.ts +++ b/src/platforms/android/__tests__/ime-lifecycle.test.ts @@ -48,7 +48,7 @@ import { import { resetStartupRecoveryFencesForTests, runStartupRecoveryFence, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/startup-recovery-fence'; import { readAndroidTestImeRecoveryMarkers, writeAndroidTestImeRecoveryMarker, diff --git a/src/platforms/android/__tests__/input-ownership.test.ts b/src/platforms/android/__tests__/input-ownership.test.ts index 09226767f..2ccaf3c19 100644 --- a/src/platforms/android/__tests__/input-ownership.test.ts +++ b/src/platforms/android/__tests__/input-ownership.test.ts @@ -5,7 +5,7 @@ import { isAndroidInputMethodNode, parseAndroidInputMethodPackage, readAndroidActiveInputMethodPackage, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/android-input-ownership'; test('classifies raw snapshot nodes through the node-shaped IME predicate', () => { assert.equal( diff --git a/src/platforms/android/__tests__/touch-executor.test.ts b/src/platforms/android/__tests__/touch-executor.test.ts index cfac48b12..bdb54b9aa 100644 --- a/src/platforms/android/__tests__/touch-executor.test.ts +++ b/src/platforms/android/__tests__/touch-executor.test.ts @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; import { ANDROID_EMULATOR } from '../../../__tests__/test-utils/device-fixtures.ts'; -import { buildGesturePlan } from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import { withAndroidAdbProvider } from '../adb-executor.ts'; import { executeAndroidTouchPlan, readAndroidGestureViewport } from '../touch-executor.ts'; diff --git a/src/platforms/android/__tests__/touch-helper.fixtures.ts b/src/platforms/android/__tests__/touch-helper.fixtures.ts index a26e4a2a9..bbf3b0575 100644 --- a/src/platforms/android/__tests__/touch-helper.fixtures.ts +++ b/src/platforms/android/__tests__/touch-helper.fixtures.ts @@ -1,5 +1,5 @@ import { ANDROID_EMULATOR } from '../../../__tests__/test-utils/device-fixtures.ts'; -import { buildGesturePlan } from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { AndroidAdbExecutor } from '../adb-executor.ts'; import type { AndroidLongPressTouchPlan } from '../touch-plan.ts'; diff --git a/src/platforms/android/__tests__/touch-helper.test.ts b/src/platforms/android/__tests__/touch-helper.test.ts index 2a5bd4c2b..1c1ebd967 100644 --- a/src/platforms/android/__tests__/touch-helper.test.ts +++ b/src/platforms/android/__tests__/touch-helper.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { afterEach, beforeEach, test, vi } from 'vitest'; -import { buildGesturePlan } from '@agent-device/contracts/interaction'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; import { AppError } from '@agent-device/kernel/errors'; import { withAndroidAdbProvider } from '../adb-executor.ts'; import { resetAndroidSnapshotHelperSessions } from '../snapshot-helper-session.ts'; diff --git a/src/platforms/android/__tests__/touch-plan.test.ts b/src/platforms/android/__tests__/touch-plan.test.ts index 004cf779c..b511b0b89 100644 --- a/src/platforms/android/__tests__/touch-plan.test.ts +++ b/src/platforms/android/__tests__/touch-plan.test.ts @@ -1,10 +1,7 @@ import assert from 'node:assert/strict'; import { expectTypeOf, test } from 'vitest'; -import { - buildDragGesturePlan, - buildGesturePlan, - type SinglePointerGesturePlan, -} from '@agent-device/contracts/interaction'; +import { buildDragGesturePlan, buildGesturePlan } from '@agent-device/contracts/gesture-plan'; +import type { SinglePointerGesturePlan } from '@agent-device/contracts/gesture-plan-types'; import { lowerAndroidTouchPlan, type AndroidLoweredTouchPlan } from '../touch-plan.ts'; import { longPressPlan } from './touch-helper.fixtures.ts'; diff --git a/src/platforms/android/alert.ts b/src/platforms/android/alert.ts index f621e8c5b..0d138908a 100644 --- a/src/platforms/android/alert.ts +++ b/src/platforms/android/alert.ts @@ -3,7 +3,7 @@ import { ALERT_ACTION_RETRY_MS, ALERT_POLL_INTERVAL_MS, DEFAULT_ALERT_TIMEOUT_MS, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/alert-contract'; import { AppError } from '@agent-device/kernel/errors'; import { withDiagnosticTimer } from '../../utils/diagnostics.ts'; import { successText } from '../../utils/success-text.ts'; diff --git a/src/platforms/android/device-input-state.ts b/src/platforms/android/device-input-state.ts index cec37ffd6..362cc8bb6 100644 --- a/src/platforms/android/device-input-state.ts +++ b/src/platforms/android/device-input-state.ts @@ -9,12 +9,12 @@ import { type AndroidAdbExecutor, } from './adb-executor.ts'; import { + type AndroidInputOwner, classifyAndroidInputOwner, isFallbackAndroidInputMethodPackage, isFallbackAndroidInputMethodResource, readAndroidActiveInputMethodPackage, - type AndroidInputOwner, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/android-input-ownership'; const ANDROID_INPUT_TYPE_CLASS_MASK = 0x0000000f; const ANDROID_INPUT_TYPE_CLASS_TEXT = 0x00000001; diff --git a/src/platforms/android/fill-verification.ts b/src/platforms/android/fill-verification.ts index e4d8049c0..f4a6fcd66 100644 --- a/src/platforms/android/fill-verification.ts +++ b/src/platforms/android/fill-verification.ts @@ -11,7 +11,7 @@ import { } from './fill-diagnostics.ts'; import { sleep } from './adb.ts'; import { getAndroidKeyboardState } from './device-input-state.ts'; -import { isAndroidInputMethodOwnedNode } from '@agent-device/contracts/platform'; +import { isAndroidInputMethodOwnedNode } from '@agent-device/contracts/android-input-ownership'; import { captureAndroidUiHierarchyXml } from './snapshot.ts'; import { androidUiNodes, type AndroidUiNodeMetadata } from './ui-hierarchy.ts'; import type { diff --git a/src/platforms/android/ime-lifecycle.ts b/src/platforms/android/ime-lifecycle.ts index bc89d9a67..d5a97cb53 100644 --- a/src/platforms/android/ime-lifecycle.ts +++ b/src/platforms/android/ime-lifecycle.ts @@ -16,7 +16,7 @@ import { readAndroidTestImeRecoveryMarkers, writeAndroidTestImeRecoveryMarker, } from './ime-recovery-marker.ts'; -import { waitForStartupRecoveryFence } from '@agent-device/contracts/platform'; +import { waitForStartupRecoveryFence } from '@agent-device/contracts/startup-recovery-fence'; // Previous-IME record lives on the device (a custom `settings secure` key), not in a host-side // file, so any daemon/state-dir can recover it. diff --git a/src/platforms/android/input-actions.ts b/src/platforms/android/input-actions.ts index daab592f2..d9eb7a887 100644 --- a/src/platforms/android/input-actions.ts +++ b/src/platforms/android/input-actions.ts @@ -1,14 +1,13 @@ import { DEVICE_ROTATION_SURFACE_INDEX, type DeviceRotation } from '@agent-device/contracts/device'; +import { buildGesturePlan } from '@agent-device/contracts/gesture-plan'; +import { GESTURE_DURATION_MIN_MS } from '@agent-device/contracts/gesture-plan-types'; +import type { FillUnconfirmedVerification } from '@agent-device/contracts/interactor-types'; +import { DEFAULT_MOBILE_SCROLL_DURATION_MS } from '@agent-device/contracts/scroll-command'; import { - buildGesturePlan, - buildScrollGesturePlan, - DEFAULT_MOBILE_SCROLL_DURATION_MS, - GESTURE_DURATION_MIN_MS, - toAndroidTvRemoteKeyevent, - type FillUnconfirmedVerification, type ScrollDirection, - type TvRemoteButton, -} from '@agent-device/contracts/interaction'; + buildScrollGesturePlan, +} from '@agent-device/contracts/scroll-gesture'; +import { type TvRemoteButton, toAndroidTvRemoteKeyevent } from '@agent-device/contracts/tv-remote'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { emitDiagnostic } from '../../utils/diagnostics.ts'; diff --git a/src/platforms/android/snapshot-content-recovery.ts b/src/platforms/android/snapshot-content-recovery.ts index 93f19d69e..9adbf3fdb 100644 --- a/src/platforms/android/snapshot-content-recovery.ts +++ b/src/platforms/android/snapshot-content-recovery.ts @@ -1,8 +1,6 @@ -import { - hasAndroidSystemChromeProvenance, - isAndroidInputMethodOwnedNode, - type AndroidContentRecoveryReason, -} from '@agent-device/contracts/platform'; +import { isAndroidInputMethodOwnedNode } from '@agent-device/contracts/android-input-ownership'; +import type { AndroidContentRecoveryReason } from '@agent-device/contracts/android-snapshot-quality'; +import { hasAndroidSystemChromeProvenance } from '@agent-device/contracts/android-system-chrome'; import { classifyAndroidAlertIdentifier } from './alert-detection.ts'; import type { AndroidSnapshotBackendMetadata } from './snapshot-types.ts'; import { androidUiNodes, type AndroidUiNodeMetadata } from './ui-hierarchy.ts'; diff --git a/src/platforms/android/touch-plan.ts b/src/platforms/android/touch-plan.ts index 3321e2b65..20a621425 100644 --- a/src/platforms/android/touch-plan.ts +++ b/src/platforms/android/touch-plan.ts @@ -1,12 +1,14 @@ import { interpolateGesturePoint, sampleGestureOffsets, - type GesturePlan, - type MultiTouchGesturePlan, - type PointerTrajectory, - type PointerTrajectorySample, - type SinglePointerGesturePlan, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/gesture-plan'; +import type { + GesturePlan, + MultiTouchGesturePlan, + PointerTrajectory, + PointerTrajectorySample, + SinglePointerGesturePlan, +} from '@agent-device/contracts/gesture-plan-types'; import type { Rect } from '@agent-device/kernel/snapshot'; export type AndroidLongPressTouchPlan = { diff --git a/src/platforms/android/ui-hierarchy.ts b/src/platforms/android/ui-hierarchy.ts index 020b106f5..4b38767f4 100644 --- a/src/platforms/android/ui-hierarchy.ts +++ b/src/platforms/android/ui-hierarchy.ts @@ -15,7 +15,7 @@ export type { AndroidUiHierarchy } from './ui-hierarchy-node.ts'; import { type AndroidSystemChromeProvenance, isAndroidSystemChromeWindowResourceId, -} from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/android-system-chrome'; type AndroidRawSnapshotNode = RawSnapshotNode & AndroidSystemChromeProvenance; diff --git a/src/platforms/apple/core/__tests__/interactions.test.ts b/src/platforms/apple/core/__tests__/interactions.test.ts index 9a05e78d0..c155d95f3 100644 --- a/src/platforms/apple/core/__tests__/interactions.test.ts +++ b/src/platforms/apple/core/__tests__/interactions.test.ts @@ -5,7 +5,8 @@ import path from 'node:path'; import { iosRunnerOverrides, performGestureApple } from '../../interactions.ts'; import { runAppleRunnerCommand } from '../runner/runner-client.ts'; import { AppError } from '@agent-device/kernel/errors'; -import { TEXT_ENTRY_ROUTES, type GesturePlan } from '@agent-device/contracts/interaction'; +import type { GesturePlan } from '@agent-device/contracts/gesture-plan-types'; +import { TEXT_ENTRY_ROUTES } from '@agent-device/contracts/interactor-types'; import { requireGestureSupported } from '../../../../core/capabilities.ts'; import { IOS_TEST_DEVICE, diff --git a/src/platforms/apple/core/scroll.ts b/src/platforms/apple/core/scroll.ts index a8aabe715..daeb70dd4 100644 --- a/src/platforms/apple/core/scroll.ts +++ b/src/platforms/apple/core/scroll.ts @@ -1,11 +1,13 @@ import { - buildScrollGesturePlan, DEFAULT_IOS_SCROLL_AMOUNT, DEFAULT_IOS_SCROLL_DURATION_MS, - type ScrollDirection, type ScrollExecutionOptions, type ScrollReleaseBehavior, -} from '@agent-device/contracts/interaction'; +} from '@agent-device/contracts/scroll-command'; +import { + type ScrollDirection, + buildScrollGesturePlan, +} from '@agent-device/contracts/scroll-gesture'; export type NormalizedScrollOptions = { amount?: number; diff --git a/src/platforms/apple/interactions.ts b/src/platforms/apple/interactions.ts index bd0d26db1..0afa3e46c 100644 --- a/src/platforms/apple/interactions.ts +++ b/src/platforms/apple/interactions.ts @@ -1,19 +1,23 @@ +import type { BackMode } from '@agent-device/contracts/back-mode'; +import { singlePointerPlanEndpoints } from '@agent-device/contracts/gesture-plan'; +import type { GesturePlan } from '@agent-device/contracts/gesture-plan-types'; import { - assertScrollGestureInput, - normalizeScrollDurationMs, - SCROLL_DURATION_MAX_MS, - singlePointerPlanEndpoints, - TEXT_ENTRY_ROUTES, - type BackMode, - type GesturePlan, type Interactor, type RunnerCallOptions, type RunnerContext, - type ScrollDirection, + TEXT_ENTRY_ROUTES, type TextEntryRoute, type TypeTextBackendResult, -} from '@agent-device/contracts/interaction'; -import { assertAppleMultiTouchSupported } from '@agent-device/contracts/platform'; +} from '@agent-device/contracts/interactor-types'; +import { + SCROLL_DURATION_MAX_MS, + normalizeScrollDurationMs, +} from '@agent-device/contracts/scroll-command'; +import { + type ScrollDirection, + assertScrollGestureInput, +} from '@agent-device/contracts/scroll-gesture'; +import { assertAppleMultiTouchSupported } from '@agent-device/contracts/apple-multitouch-support'; import { isIosFamily, isMacOs, isTvOsDevice, type DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { runAppleRunnerCommand } from './core/runner/runner-client.ts'; diff --git a/src/platforms/apple/interactor.ts b/src/platforms/apple/interactor.ts index 62b44ef15..fe293f2d8 100644 --- a/src/platforms/apple/interactor.ts +++ b/src/platforms/apple/interactor.ts @@ -18,7 +18,7 @@ import { type AppleRunnerCommandExecutor, type AppleRunnerProvider, } from './core/runner/runner-provider.ts'; -import { toAppleTvRemoteButton } from '@agent-device/contracts/interaction'; +import { toAppleTvRemoteButton } from '@agent-device/contracts/tv-remote'; import type { SessionSurface } from '@agent-device/contracts/session'; import { DEVICE_ROTATIONS, type DeviceRotation } from '@agent-device/contracts/device'; import { normalizeSnapshotScope } from '@agent-device/contracts/snapshot'; diff --git a/src/platforms/apple/plugin.ts b/src/platforms/apple/plugin.ts index a77c4704c..d992087ec 100644 --- a/src/platforms/apple/plugin.ts +++ b/src/platforms/apple/plugin.ts @@ -1,7 +1,7 @@ import { appleOsCapabilities } from './capabilities.ts'; import type { PlatformPlugin } from '@agent-device/contracts/platform'; import { PUBLIC_COMMANDS } from '../../command-catalog.ts'; -import { isAudioProbeSupportedDevice } from '@agent-device/contracts/platform'; +import { isAudioProbeSupportedDevice } from '@agent-device/contracts/audio-probe-support'; import { isTvOsDevice, resolveDeviceAppleOs, type DeviceInfo } from '@agent-device/kernel/device'; import type { RunnerContext } from '@agent-device/contracts/interaction'; diff --git a/src/platforms/audio-probe-backend.ts b/src/platforms/audio-probe-backend.ts index b105a587c..e34ae8dae 100644 --- a/src/platforms/audio-probe-backend.ts +++ b/src/platforms/audio-probe-backend.ts @@ -1,5 +1,5 @@ import type { AudioProbeSource } from '@agent-device/contracts/platform'; -import { isHostSystemAudioProbeDevice } from '@agent-device/contracts/platform'; +import { isHostSystemAudioProbeDevice } from '@agent-device/contracts/audio-probe-support'; import type { DeviceInfo } from '@agent-device/kernel/device'; import type { ExecBackgroundResult } from '../utils/exec.ts'; diff --git a/src/platforms/harmonyos/input-actions.ts b/src/platforms/harmonyos/input-actions.ts index 1be441bef..38e235aff 100644 --- a/src/platforms/harmonyos/input-actions.ts +++ b/src/platforms/harmonyos/input-actions.ts @@ -1,10 +1,10 @@ import type { DeviceRotation } from '@agent-device/contracts/device'; +import type { GesturePlan } from '@agent-device/contracts/gesture-plan-types'; +import { DEFAULT_MOBILE_SCROLL_DURATION_MS } from '@agent-device/contracts/scroll-command'; import { - buildScrollGesturePlan, - DEFAULT_MOBILE_SCROLL_DURATION_MS, - type GesturePlan, type ScrollDirection, -} from '@agent-device/contracts/interaction'; + buildScrollGesturePlan, +} from '@agent-device/contracts/scroll-gesture'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; import { sleep } from '../../utils/timeouts.ts'; diff --git a/src/platforms/vega/input-actions.ts b/src/platforms/vega/input-actions.ts index 6dec8dc14..92937f282 100644 --- a/src/platforms/vega/input-actions.ts +++ b/src/platforms/vega/input-actions.ts @@ -1,4 +1,4 @@ -import { toVegaTvRemoteKey, type TvRemoteButton } from '@agent-device/contracts/interaction'; +import { type TvRemoteButton, toVegaTvRemoteKey } from '@agent-device/contracts/tv-remote'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { requireExecSuccess } from '../../utils/exec.ts'; import { resolveVegaToolProvider } from './tool-provider.ts'; diff --git a/src/platforms/web/agent-browser-audio-probe.ts b/src/platforms/web/agent-browser-audio-probe.ts index 5eaf7fa7e..f1cbeedb0 100644 --- a/src/platforms/web/agent-browser-audio-probe.ts +++ b/src/platforms/web/agent-browser-audio-probe.ts @@ -1,4 +1,7 @@ -import { normalizeAudioProbeRecord, type AudioProbeResult } from '@agent-device/contracts/platform'; +import { + type AudioProbeResult, + normalizeAudioProbeRecord, +} from '@agent-device/contracts/audio-probe-result'; import { isJsonObject, type JsonObject } from './json-utils.ts'; import type { WebAudioProbeOptions, WebAudioProbeResult } from './provider.ts';