From 7092b765e18a63da10279877ae6b376d4c41e532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 10 Oct 2026 21:21:38 +0200 Subject: [PATCH 1/3] refactor(contracts): move the command-runtime contracts the daemon reads into @agent-device/contracts Lift the pure declarations out of the root command-runtime zone so no daemon file type-imports it: the backend surface (src/backend.ts), the runtime vocabulary (src/runtime-contract.ts), the artifact-adapter vocabulary (split from src/io.ts, whose node:fs implementation stays), the routed snapshot-option flags (src/backend-snapshot-options.ts), and the local/restricted CommandPolicy presets (from src/command-runtime/runtime-factory.ts). The io.ts type/impl split keeps the published agent-device/io surface unchanged through the public src/sdk/io.ts entry. Consumers now import the vocabulary from @agent-device/contracts directly. --- packages/contracts/src/artifact-adapter.ts | 95 ++++++++++++++++++ .../src}/backend-snapshot-options.test.ts | 0 .../src}/backend-snapshot-options.ts | 0 {src => packages/contracts/src}/backend.ts | 35 ++++--- packages/contracts/src/command-policy.test.ts | 9 ++ packages/contracts/src/command-policy.ts | 23 +++++ .../contracts/src}/runtime-contract.ts | 2 +- src/__tests__/runtime-public.test.ts | 32 +++--- src/cli/commands/recording.ts | 7 +- src/cli/commands/screenshot.ts | 9 +- .../runtime-command-surface.ts | 5 +- src/command-runtime/runtime-factory.ts | 22 +---- .../capture/runtime/diff-screenshot.test.ts | 10 +- .../capture/runtime/diff-screenshot.ts | 9 +- src/commands/capture/runtime/index.ts | 2 +- src/commands/capture/runtime/screenshot.ts | 2 +- src/commands/capture/runtime/snapshot.test.ts | 10 +- src/commands/capture/runtime/snapshot.ts | 7 +- src/commands/index.ts | 2 +- .../__tests__/settle-device-fixtures.ts | 5 +- .../runtime/__tests__/test-utils/index.ts | 10 +- .../interaction/runtime/gesture-command.ts | 2 +- .../interaction/runtime/gestures.test.ts | 4 +- src/commands/interaction/runtime/gestures.ts | 2 +- src/commands/interaction/runtime/index.ts | 2 +- .../runtime/interaction-snapshot-capture.ts | 2 +- .../interaction/runtime/interactions.test.ts | 5 +- .../interaction/runtime/interactions.ts | 2 +- .../runtime/native-ref-interaction.ts | 4 +- .../runtime/post-action-observation.ts | 2 +- .../runtime/ref-target-resolution.ts | 2 +- .../runtime/resolution-disclosure.ts | 2 +- .../interaction/runtime/resolution.test.ts | 2 +- .../interaction/runtime/resolution.ts | 2 +- .../interaction/runtime/selector-is.test.ts | 5 +- .../interaction/runtime/selector-is.ts | 2 +- .../runtime/selector-read-shared.ts | 4 +- .../interaction/runtime/selector-read.test.ts | 10 +- .../interaction/runtime/selector-read.ts | 2 +- .../interaction/runtime/selector-readiness.ts | 2 +- .../selector-wait-cancellation.test.ts | 5 +- .../settle-transition-baseline.test.ts | 5 +- .../interaction/runtime/settle.test.ts | 6 +- src/commands/interaction/runtime/settle.ts | 2 +- .../runtime/stable-capture.test.ts | 5 +- .../interaction/runtime/stable-capture.ts | 2 +- .../runtime/target-visibility-stages.ts | 2 +- .../interaction/runtime/wait-absent.test.ts | 5 +- .../interaction/runtime/wait-polling.test.ts | 2 +- .../interaction/runtime/wait-selector.test.ts | 5 +- .../interaction/runtime/wait-stable.test.ts | 5 +- src/commands/io-policy.ts | 4 +- .../management/runtime/admin-router.test.ts | 11 ++- src/commands/management/runtime/admin.ts | 4 +- src/commands/management/runtime/apps.test.ts | 9 +- src/commands/management/runtime/apps.ts | 6 +- src/commands/management/runtime/index.ts | 2 +- src/commands/observability/output.ts | 2 +- .../runtime/diagnostics-format.ts | 2 +- .../runtime/diagnostics-router.test.ts | 10 +- .../runtime/diagnostics-types.ts | 2 +- .../observability/runtime/diagnostics.ts | 4 +- .../recording/runtime/contact-sheet.test.ts | 13 ++- .../recording/runtime/contact-sheet.ts | 4 +- .../recording/runtime/recording.test.ts | 9 +- src/commands/recording/runtime/recording.ts | 6 +- src/commands/runtime-common.ts | 4 +- src/commands/runtime-types.ts | 4 +- src/commands/system/runtime/system.test.ts | 5 +- src/commands/system/runtime/system.ts | 4 +- src/daemon/__tests__/runtime-session.test.ts | 2 +- .../internal/interaction-runtime.ts | 2 +- .../internal/interaction-snapshot.ts | 2 +- src/daemon/interaction/internal/types.ts | 2 +- src/daemon/runtime-artifacts.ts | 2 +- src/daemon/runtime-policy.ts | 4 +- src/daemon/runtime-session.ts | 5 +- src/daemon/screenshot-runtime.ts | 6 +- src/daemon/selector-capture-runtime.ts | 2 +- src/daemon/selector-runtime-backend.ts | 4 +- src/daemon/snapshot-command-runtime.ts | 4 +- src/io.ts | 99 +------------------ src/runtime.ts | 10 +- src/sdk/io.ts | 17 ++++ .../interaction-contract/runtime-harness.ts | 5 +- 85 files changed, 362 insertions(+), 307 deletions(-) create mode 100644 packages/contracts/src/artifact-adapter.ts rename {src => packages/contracts/src}/backend-snapshot-options.test.ts (100%) rename {src => packages/contracts/src}/backend-snapshot-options.ts (100%) rename {src => packages/contracts/src}/backend.ts (93%) create mode 100644 packages/contracts/src/command-policy.test.ts create mode 100644 packages/contracts/src/command-policy.ts rename {src => packages/contracts/src}/runtime-contract.ts (97%) diff --git a/packages/contracts/src/artifact-adapter.ts b/packages/contracts/src/artifact-adapter.ts new file mode 100644 index 0000000000..b00d8303ae --- /dev/null +++ b/packages/contracts/src/artifact-adapter.ts @@ -0,0 +1,95 @@ +import type { DaemonArtifactType } from '@agent-device/kernel/contracts'; + +export type FileInputRef = + | { + kind: 'path'; + path: string; + } + | { + kind: 'uploadedArtifact'; + id: string; + }; + +export type FileOutputRef = + | { + kind: 'path'; + path: string; + } + | { + kind: 'downloadableArtifact'; + clientPath?: string; + fileName?: string; + }; + +export type ArtifactDescriptor = + | { + kind: 'localPath'; + field: string; + artifactType: DaemonArtifactType | undefined; + path: string; + fileName?: string; + metadata?: Record; + } + | { + kind: 'artifact'; + field: string; + artifactType: DaemonArtifactType | undefined; + artifactId: string; + fileName?: string; + url?: string; + clientPath?: string; + metadata?: Record; + }; + +export type OutputVisibility = 'client-visible' | 'internal'; + +export type ResolvedInputFile = { + path: string; + cleanup?: () => Promise; +}; + +export type ReservedOutputFile = { + path: string; + visibility: OutputVisibility; + publish: () => Promise; + cleanup?: () => Promise; +}; + +export type TemporaryFile = { + path: string; + visibility: 'internal'; + cleanup: () => Promise; +}; + +export type ResolveInputOptions = { + usage: string; + field?: string; +}; + +export type ReserveOutputOptions = { + field: string; + ext: string; + artifactType: DaemonArtifactType | undefined; + requestedClientPath?: string; + visibility?: OutputVisibility; +}; + +export type CreateTempFileOptions = { + prefix: string; + ext: string; +}; + +export type ArtifactAdapter = { + resolveInput(ref: FileInputRef, options: ResolveInputOptions): Promise; + reserveOutput( + ref: FileOutputRef | undefined, + options: ReserveOutputOptions, + ): Promise; + createTempFile(options: CreateTempFileOptions): Promise; +}; + +export type LocalArtifactAdapterOptions = { + cwd?: string; + tempDir?: string; + rootDir?: string; +}; diff --git a/src/backend-snapshot-options.test.ts b/packages/contracts/src/backend-snapshot-options.test.ts similarity index 100% rename from src/backend-snapshot-options.test.ts rename to packages/contracts/src/backend-snapshot-options.test.ts diff --git a/src/backend-snapshot-options.ts b/packages/contracts/src/backend-snapshot-options.ts similarity index 100% rename from src/backend-snapshot-options.ts rename to packages/contracts/src/backend-snapshot-options.ts diff --git a/src/backend.ts b/packages/contracts/src/backend.ts similarity index 93% rename from src/backend.ts rename to packages/contracts/src/backend.ts index 53a542f4e8..ec47635b75 100644 --- a/src/backend.ts +++ b/packages/contracts/src/backend.ts @@ -1,20 +1,19 @@ -import type { - ScreenshotResultData, - SnapshotCaptureAnnotations, - SnapshotDiagnosticsSummary, -} from '@agent-device/contracts/capture'; -import type { JsonObject } from '@agent-device/contracts/client'; -import type { AppsFilter, DeviceRotation } from '@agent-device/contracts/device'; -import type { AlertAction, AlertInfo } from '@agent-device/contracts/alert-contract'; -import type { BackMode } from '@agent-device/contracts/back-mode'; -import type { ClickButton } from '@agent-device/contracts/click-button'; -import type { GesturePlan } from '@agent-device/contracts/gesture-plan-types'; -import type { RepeatedInput } from '@agent-device/contracts/interaction'; -import type { ScrollDirection } from '@agent-device/contracts/scroll-gesture'; -import type { ResolvedScrollExecutionOptions } from '@agent-device/contracts/scroll-command'; -import type { TvRemoteButton } from '@agent-device/contracts/tv-remote'; -import type { RecordingExportQuality } from '@agent-device/contracts/recording'; -import type { SessionSurface } from '@agent-device/contracts/session'; +import type { ScreenshotResultData } from './snapshot-types.ts'; +import type { SnapshotCaptureAnnotations } from './snapshot-capture-annotations.ts'; +import type { SnapshotDiagnosticsSummary } from './snapshot-diagnostics.ts'; +import type { JsonObject } from './json.ts'; +import type { AppsFilter } from './app-inventory.ts'; +import type { DeviceRotation } from './device-rotation.ts'; +import type { AlertAction, AlertInfo } from './alert-contract.ts'; +import type { BackMode } from './back-mode.ts'; +import type { ClickButton } from './click-button.ts'; +import type { GesturePlan } from './gesture-plan-types.ts'; +import type { RepeatedInput } from './interaction.ts'; +import type { ScrollDirection } from './scroll-gesture.ts'; +import type { ResolvedScrollExecutionOptions } from './scroll-command.ts'; +import type { TvRemoteButton } from './tv-remote.ts'; +import type { RecordingExportQuality } from './recording-export-quality.ts'; +import type { SessionSurface } from './session-surface.ts'; import type { DeviceTarget, Platform, @@ -327,7 +326,7 @@ import type { BackendDumpNetworkResult, BackendNetworkEntry, BackendNetworkIncludeMode, -} from '@agent-device/contracts/backend-diagnostics'; +} from './backend-diagnostics.ts'; export type { BackendDiagnosticsPageOptions, diff --git a/packages/contracts/src/command-policy.test.ts b/packages/contracts/src/command-policy.test.ts new file mode 100644 index 0000000000..3b571ffd78 --- /dev/null +++ b/packages/contracts/src/command-policy.test.ts @@ -0,0 +1,9 @@ +import { expect, test } from 'vitest'; +import { localCommandPolicy, restrictedCommandPolicy } from './command-policy.ts'; + +test('command policy presets expose local and restricted defaults', () => { + expect(localCommandPolicy().allowLocalInputPaths).toBe(true); + expect(localCommandPolicy().allowLocalOutputPaths).toBe(true); + expect(restrictedCommandPolicy().allowLocalInputPaths).toBe(false); + expect(restrictedCommandPolicy({ allowLocalInputPaths: true }).allowLocalInputPaths).toBe(true); +}); diff --git a/packages/contracts/src/command-policy.ts b/packages/contracts/src/command-policy.ts new file mode 100644 index 0000000000..b53e0aba3b --- /dev/null +++ b/packages/contracts/src/command-policy.ts @@ -0,0 +1,23 @@ +import type { CommandPolicy } from './runtime-contract.ts'; + +/** + * The command policy presets. Pure literal factories: the caller decides which + * local-path permissions a runtime gets, and these name the two default stances. + */ +export function localCommandPolicy(overrides: Partial = {}): CommandPolicy { + return { + allowLocalInputPaths: true, + allowLocalOutputPaths: true, + maxImagePixels: 20_000_000, + ...overrides, + }; +} + +export function restrictedCommandPolicy(overrides: Partial = {}): CommandPolicy { + return { + allowLocalInputPaths: false, + allowLocalOutputPaths: false, + maxImagePixels: 20_000_000, + ...overrides, + }; +} diff --git a/src/runtime-contract.ts b/packages/contracts/src/runtime-contract.ts similarity index 97% rename from src/runtime-contract.ts rename to packages/contracts/src/runtime-contract.ts index 34ab992598..f35d994f71 100644 --- a/src/runtime-contract.ts +++ b/packages/contracts/src/runtime-contract.ts @@ -1,5 +1,5 @@ import type { AgentDeviceBackend } from './backend.ts'; -import type { ArtifactAdapter } from './io.ts'; +import type { ArtifactAdapter } from './artifact-adapter.ts'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; export type CommandPolicy = { diff --git a/src/__tests__/runtime-public.test.ts b/src/__tests__/runtime-public.test.ts index a7a0d34096..31c129c068 100644 --- a/src/__tests__/runtime-public.test.ts +++ b/src/__tests__/runtime-public.test.ts @@ -2,25 +2,19 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; -import { - createAgentDevice, - localCommandPolicy, - type AgentDevice, - type CommandSessionStore, -} from '../runtime.ts'; -import type { AgentDeviceBackend } from '../backend.ts'; +import { createAgentDevice, type AgentDevice } from '../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import type { ScreenshotCommandOptions } from '../commands/index.ts'; -import { - createLocalArtifactAdapter, - type ArtifactAdapter, - type FileInputRef, - type FileOutputRef, -} from '../io.ts'; +import { createLocalArtifactAdapter } from '../io.ts'; +import type { + ArtifactAdapter, + FileInputRef, + FileOutputRef, +} from '@agent-device/contracts/artifact-adapter'; import { mkdtempForTestSync } from './test-utils/tmp-dir.ts'; -import { - createMemorySessionStore, - restrictedCommandPolicy, -} from '../command-runtime/runtime-factory.ts'; +import { createMemorySessionStore } from '../command-runtime/runtime-factory.ts'; const backend = { platform: 'ios', @@ -104,10 +98,6 @@ test('runtime screenshot command cleans reserved output when publish fails', asy test('runtime policy helpers expose local and restricted defaults', async () => { assert.equal(typeof createLocalArtifactAdapter, 'function'); - assert.equal(localCommandPolicy().allowLocalInputPaths, true); - assert.equal(localCommandPolicy().allowLocalOutputPaths, true); - assert.equal(restrictedCommandPolicy().allowLocalInputPaths, false); - assert.equal(restrictedCommandPolicy({ allowLocalInputPaths: true }).allowLocalInputPaths, true); const store = createMemorySessionStore([{ name: 'default' }]); assert.equal((await store.get('default'))?.name, 'default'); }); diff --git a/src/cli/commands/recording.ts b/src/cli/commands/recording.ts index 286abfb649..27311d9515 100644 --- a/src/cli/commands/recording.ts +++ b/src/cli/commands/recording.ts @@ -1,4 +1,5 @@ import { AppError } from '@agent-device/kernel/errors'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import type { RecordingContactSheetCommandResult } from '../../commands/recording/runtime/contact-sheet.ts'; import { resolveUserPath } from '@agent-device/host-kit/file'; import { writeCommandOutput } from './shared.ts'; @@ -20,8 +21,10 @@ export const recordingCommand: ClientCommandHandler = async ({ positionals, flag const outputPath = typeof flags.out === 'string' ? resolveUserPath(flags.out) : undefined; // Lazy: createAgentDevice pulls in the client-side command runtime, which only this action needs. - const [{ createAgentDevice, localCommandPolicy }, { createLocalArtifactAdapter }] = - await Promise.all([import('../../runtime.ts'), import('../../io.ts')]); + const [{ createAgentDevice }, { createLocalArtifactAdapter }] = await Promise.all([ + import('../../runtime.ts'), + import('../../io.ts'), + ]); const runtime = createAgentDevice({ backend: { platform: 'ios' }, artifacts: createLocalArtifactAdapter(), diff --git a/src/cli/commands/screenshot.ts b/src/cli/commands/screenshot.ts index c319540c63..8cff127c59 100644 --- a/src/cli/commands/screenshot.ts +++ b/src/cli/commands/screenshot.ts @@ -1,9 +1,10 @@ +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { formatScreenshotDiffText, formatSnapshotDiffText } from '../../commands/output/diff.ts'; import type { ScreenshotDiffResult } from '../../screenshot-diff/screenshot-diff.ts'; import { AppError } from '@agent-device/kernel/errors'; import { isNonDefaultResponseLevel } from '@agent-device/kernel/contracts'; import { resolveUserPath } from '@agent-device/host-kit/file'; -import type { AgentDeviceBackend } from '../../backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import type { AgentDeviceClient, CaptureScreenshotResult } from '../../agent-device-client.ts'; import { runCliCommand } from '../../commands/cli-runner.ts'; import { pickScreenshotResultData } from '../../client/screenshot-result.ts'; @@ -62,8 +63,10 @@ export const diffCommand: ClientCommandHandler = async ({ positionals, flags, cl // Lazy: createAgentDevice pulls the whole client-side command runtime // (including screenshot pixel diffing), which only `diff screenshot` needs. - const [{ createAgentDevice, localCommandPolicy }, { createLocalArtifactAdapter }] = - await Promise.all([import('../../runtime.ts'), import('../../io.ts')]); + const [{ createAgentDevice }, { createLocalArtifactAdapter }] = await Promise.all([ + import('../../runtime.ts'), + import('../../io.ts'), + ]); const runtime = createAgentDevice({ backend: createClientScreenshotBackend(client, flags), artifacts: createLocalArtifactAdapter(), diff --git a/src/command-runtime/runtime-command-surface.ts b/src/command-runtime/runtime-command-surface.ts index 49bc122ab6..51d65cb64f 100644 --- a/src/command-runtime/runtime-command-surface.ts +++ b/src/command-runtime/runtime-command-surface.ts @@ -9,7 +9,10 @@ import { type BoundCaptureCommands, } from '../commands/capture/runtime/index.ts'; import { createAgentDeviceRuntime } from './runtime-factory.ts'; -import type { AgentDeviceRuntime, AgentDeviceRuntimeConfig } from '../runtime-contract.ts'; +import type { + AgentDeviceRuntime, + AgentDeviceRuntimeConfig, +} from '@agent-device/contracts/runtime-contract'; /** * The command surface an in-process executor dispatches through: capture, selector reads and diff --git a/src/command-runtime/runtime-factory.ts b/src/command-runtime/runtime-factory.ts index 7491257576..b5069c4db0 100644 --- a/src/command-runtime/runtime-factory.ts +++ b/src/command-runtime/runtime-factory.ts @@ -1,10 +1,10 @@ import type { AgentDeviceRuntime, AgentDeviceRuntimeConfig, - CommandPolicy, CommandSessionRecord, CommandSessionStore, -} from '../runtime-contract.ts'; +} from '@agent-device/contracts/runtime-contract'; +import { restrictedCommandPolicy } from '@agent-device/contracts/command-policy'; /** * Assembles an in-process runtime from its backend, artifact adapter, session store, policy and @@ -63,21 +63,3 @@ function cloneMetadata(metadata: Record): Record = {}): CommandPolicy { - return { - allowLocalInputPaths: true, - allowLocalOutputPaths: true, - maxImagePixels: 20_000_000, - ...overrides, - }; -} - -export function restrictedCommandPolicy(overrides: Partial = {}): CommandPolicy { - return { - allowLocalInputPaths: false, - allowLocalOutputPaths: false, - maxImagePixels: 20_000_000, - ...overrides, - }; -} diff --git a/src/commands/capture/runtime/diff-screenshot.test.ts b/src/commands/capture/runtime/diff-screenshot.test.ts index 0c8a329319..7a429e6cb8 100644 --- a/src/commands/capture/runtime/diff-screenshot.test.ts +++ b/src/commands/capture/runtime/diff-screenshot.test.ts @@ -7,13 +7,11 @@ import type { AgentDeviceBackend, BackendScreenshotOptions, BackendScreenshotResult, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { - createAgentDevice, - localCommandPolicy, - type CommandSessionStore, -} from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; const sessions = { diff --git a/src/commands/capture/runtime/diff-screenshot.ts b/src/commands/capture/runtime/diff-screenshot.ts index 24c310f256..ffeef99376 100644 --- a/src/commands/capture/runtime/diff-screenshot.ts +++ b/src/commands/capture/runtime/diff-screenshot.ts @@ -1,14 +1,17 @@ import { promises as fs } from 'node:fs'; import path from 'node:path'; -import type { BackendScreenshotOptions, BackendScreenshotResult } from '../../../backend.ts'; +import type { + BackendScreenshotOptions, + BackendScreenshotResult, +} from '@agent-device/contracts/backend'; import type { ArtifactDescriptor, FileInputRef, FileOutputRef, ReservedOutputFile, ResolvedInputFile, -} from '../../../io.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/artifact-adapter'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError } from '@agent-device/kernel/errors'; import { compareScreenshots, diff --git a/src/commands/capture/runtime/index.ts b/src/commands/capture/runtime/index.ts index b65774eec9..1f33f8776a 100644 --- a/src/commands/capture/runtime/index.ts +++ b/src/commands/capture/runtime/index.ts @@ -7,7 +7,7 @@ import type { ScreenshotCommandOptions, SnapshotCommandOptions, } from '../../runtime-types.ts'; -import type { AgentDeviceRuntime } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { diffScreenshotCommand, type DiffScreenshotCommandOptions, diff --git a/src/commands/capture/runtime/screenshot.ts b/src/commands/capture/runtime/screenshot.ts index 399eace261..33a2f03cff 100644 --- a/src/commands/capture/runtime/screenshot.ts +++ b/src/commands/capture/runtime/screenshot.ts @@ -3,7 +3,7 @@ import { validateScreenshotScale } from '@agent-device/contracts/capture'; import { successText } from '@agent-device/kernel/success-text'; import { resizePngFileToScale } from '@agent-device/capture-kit/png-resize'; import type { DeviceRotation } from '@agent-device/contracts/device'; -import type { ArtifactDescriptor } from '../../../io.ts'; +import type { ArtifactDescriptor } from '@agent-device/contracts/artifact-adapter'; import type { RuntimeCommand, ScreenshotCommandOptions } from '../../runtime-types.ts'; import { reserveCommandOutput } from '../../io-policy.ts'; diff --git a/src/commands/capture/runtime/snapshot.test.ts b/src/commands/capture/runtime/snapshot.test.ts index 0e1bd4d683..892001de73 100644 --- a/src/commands/capture/runtime/snapshot.test.ts +++ b/src/commands/capture/runtime/snapshot.test.ts @@ -4,14 +4,12 @@ import type { AgentDeviceBackend, BackendSnapshotOptions, BackendSnapshotResult, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import type { IosSnapshotProducer } from '@agent-device/contracts/ios-snapshot'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { - createAgentDevice, - localCommandPolicy, - type CommandSessionStore, -} from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import type { PostGestureOutcome } from '@agent-device/kernel/snapshot'; import { snapshotViewportSizeFrom } from '@agent-device/kernel/rect'; diff --git a/src/commands/capture/runtime/snapshot.ts b/src/commands/capture/runtime/snapshot.ts index db847b3b66..f50af7e9e5 100644 --- a/src/commands/capture/runtime/snapshot.ts +++ b/src/commands/capture/runtime/snapshot.ts @@ -17,8 +17,11 @@ import type { SnapshotViewportSize, SnapshotVisibility, } from '@agent-device/kernel/snapshot'; -import type { BackendSnapshotResult } from '../../../backend.ts'; -import type { AgentDeviceRuntime, CommandSessionRecord } from '../../../runtime-contract.ts'; +import type { BackendSnapshotResult } from '@agent-device/contracts/backend'; +import type { + AgentDeviceRuntime, + CommandSessionRecord, +} from '@agent-device/contracts/runtime-contract'; import { buildSnapshotDiff, countSnapshotComparableLines, diff --git a/src/commands/index.ts b/src/commands/index.ts index 99d8b23e12..426e684010 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1,4 +1,4 @@ -import type { AgentDeviceRuntime } from '../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { bindRuntimeCommands } from './runtime-types.ts'; import { bindCaptureCommands, type BoundCaptureCommands } from './capture/runtime/index.ts'; import { diff --git a/src/commands/interaction/runtime/__tests__/settle-device-fixtures.ts b/src/commands/interaction/runtime/__tests__/settle-device-fixtures.ts index c90c7f6651..82f0882250 100644 --- a/src/commands/interaction/runtime/__tests__/settle-device-fixtures.ts +++ b/src/commands/interaction/runtime/__tests__/settle-device-fixtures.ts @@ -5,10 +5,11 @@ // // Budgets are injected (fake clock) — no real waiting. -import type { AgentDeviceBackend, BackendSnapshotResult } from '../../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotResult } from '@agent-device/contracts/backend'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { createLocalArtifactAdapter } from '../../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../../runtime.ts'; +import { createAgentDevice } from '../../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { createMemorySessionStore } from '../../../../command-runtime/runtime-factory.ts'; diff --git a/src/commands/interaction/runtime/__tests__/test-utils/index.ts b/src/commands/interaction/runtime/__tests__/test-utils/index.ts index fb93699eb1..3472f0cfe6 100644 --- a/src/commands/interaction/runtime/__tests__/test-utils/index.ts +++ b/src/commands/interaction/runtime/__tests__/test-utils/index.ts @@ -1,11 +1,9 @@ -import type { AgentDeviceBackend, BackendSnapshotResult } from '../../../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotResult } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../../../io.ts'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import { - createAgentDevice, - localCommandPolicy, - type CommandSessionStore, -} from '../../../../../runtime.ts'; +import { createAgentDevice } from '../../../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; import { ref } from '../../selector-read-utils.ts'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { diff --git a/src/commands/interaction/runtime/gesture-command.ts b/src/commands/interaction/runtime/gesture-command.ts index abfef1120a..145edf25c4 100644 --- a/src/commands/interaction/runtime/gesture-command.ts +++ b/src/commands/interaction/runtime/gesture-command.ts @@ -1,4 +1,4 @@ -import type { CommandContext } from '../../../runtime-contract.ts'; +import type { CommandContext } from '@agent-device/contracts/runtime-contract'; import type { GestureCommandInput, GestureIntent, diff --git a/src/commands/interaction/runtime/gestures.test.ts b/src/commands/interaction/runtime/gestures.test.ts index 97655ce402..52251be64f 100644 --- a/src/commands/interaction/runtime/gestures.test.ts +++ b/src/commands/interaction/runtime/gestures.test.ts @@ -39,7 +39,9 @@ test('runtime focus and longPress share selector/ref target resolution', async ( test('runtime drag resolves generic selector endpoints before one continuous pointer plan', async () => { let capturedPlan: - | Parameters>[1] + | Parameters< + NonNullable + >[1] | undefined; const snapshot = dragTargetSnapshot(); const device = createInteractionDevice(snapshot, { diff --git a/src/commands/interaction/runtime/gestures.ts b/src/commands/interaction/runtime/gestures.ts index df71ea3095..0f468f669f 100644 --- a/src/commands/interaction/runtime/gestures.ts +++ b/src/commands/interaction/runtime/gestures.ts @@ -11,7 +11,7 @@ import { import { AppError } from '@agent-device/kernel/errors'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import type { Point, Rect, SnapshotNode } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { successText } from '@agent-device/kernel/success-text'; import { requireIntInRange } from '@agent-device/kernel/validation'; import { toBackendContext } from '../../runtime-common.ts'; diff --git a/src/commands/interaction/runtime/index.ts b/src/commands/interaction/runtime/index.ts index 297d8b51d6..cc850cf286 100644 --- a/src/commands/interaction/runtime/index.ts +++ b/src/commands/interaction/runtime/index.ts @@ -1,4 +1,4 @@ -import type { AgentDeviceRuntime } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import type { BoundRuntimeCommand, RuntimeCommand } from '../../runtime-types.ts'; import { clickCommand, diff --git a/src/commands/interaction/runtime/interaction-snapshot-capture.ts b/src/commands/interaction/runtime/interaction-snapshot-capture.ts index 5ec85592d0..a5a68747d4 100644 --- a/src/commands/interaction/runtime/interaction-snapshot-capture.ts +++ b/src/commands/interaction/runtime/interaction-snapshot-capture.ts @@ -1,6 +1,6 @@ import { AppError } from '@agent-device/kernel/errors'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { now, toBackendContext } from '../../runtime-common.ts'; /** diff --git a/src/commands/interaction/runtime/interactions.test.ts b/src/commands/interaction/runtime/interactions.test.ts index 4d5e16851c..6d41283f83 100644 --- a/src/commands/interaction/runtime/interactions.test.ts +++ b/src/commands/interaction/runtime/interactions.test.ts @@ -1,9 +1,10 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend } from '../../../backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import { ref, selector } from './selector-read-utils.ts'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import type { Point, SnapshotState } from '@agent-device/kernel/snapshot'; import { summarizeAxEvidence } from '@agent-device/capture-kit/snapshot-evidence'; import { iosSystemSurfaceDisclosure } from '@agent-device/contracts/ios-system-surface'; diff --git a/src/commands/interaction/runtime/interactions.ts b/src/commands/interaction/runtime/interactions.ts index 270cee3231..85d502e458 100644 --- a/src/commands/interaction/runtime/interactions.ts +++ b/src/commands/interaction/runtime/interactions.ts @@ -9,7 +9,7 @@ import type { import { AppError } from '@agent-device/kernel/errors'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import type { Point } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { isFillableType } from '@agent-device/contracts/snapshot'; import { attachResolvedInteractionTarget } from '@agent-device/host-kit/interaction-outcome'; import { toBackendContext } from '../../runtime-common.ts'; diff --git a/src/commands/interaction/runtime/native-ref-interaction.ts b/src/commands/interaction/runtime/native-ref-interaction.ts index 85fac76355..d1e0f1efe4 100644 --- a/src/commands/interaction/runtime/native-ref-interaction.ts +++ b/src/commands/interaction/runtime/native-ref-interaction.ts @@ -1,7 +1,7 @@ import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { normalizeRef } from '@agent-device/kernel/snapshot'; import { resolveRectCenter } from '@agent-device/kernel/rect-center'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import { surfaceScopedNodes } from './post-action-surface.ts'; import type { @@ -13,7 +13,7 @@ import type { BackendActionResult, BackendCommandContext, BackendRefTarget, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import { toBackendContext } from '../../runtime-common.ts'; import { toBackendResult } from '../../runtime-types.ts'; import type { InteractionAction } from './interaction-resolution-request.ts'; diff --git a/src/commands/interaction/runtime/post-action-observation.ts b/src/commands/interaction/runtime/post-action-observation.ts index a0b513f192..6db4baf870 100644 --- a/src/commands/interaction/runtime/post-action-observation.ts +++ b/src/commands/interaction/runtime/post-action-observation.ts @@ -1,4 +1,4 @@ -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import type { InteractionEvidence, ResolvedInteractionTarget, diff --git a/src/commands/interaction/runtime/ref-target-resolution.ts b/src/commands/interaction/runtime/ref-target-resolution.ts index ae117d9eb1..f3c0143e1e 100644 --- a/src/commands/interaction/runtime/ref-target-resolution.ts +++ b/src/commands/interaction/runtime/ref-target-resolution.ts @@ -10,7 +10,7 @@ import type { AgentDeviceRuntime, CommandContext, CommandSessionRecord, -} from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/runtime-contract'; import { STALE_REF_HINT } from '@agent-device/selectors'; import type { InteractionSnapshot } from './interaction-snapshot-capture.ts'; import { requireSnapshotSession } from './selector-read-shared.ts'; diff --git a/src/commands/interaction/runtime/resolution-disclosure.ts b/src/commands/interaction/runtime/resolution-disclosure.ts index 34b25c298e..bcebe03b0b 100644 --- a/src/commands/interaction/runtime/resolution-disclosure.ts +++ b/src/commands/interaction/runtime/resolution-disclosure.ts @@ -1,5 +1,5 @@ import type { SnapshotNode, SnapshotState } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceRuntime } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { type SelectorResolution, buildSelectorChainForNode } from '@agent-device/selectors'; import { resolvePressRecordingTarget } from '@agent-device/selectors/press-retarget'; import { resolveRefLabel } from '@agent-device/capture-kit/snapshot-node-lookup'; diff --git a/src/commands/interaction/runtime/resolution.test.ts b/src/commands/interaction/runtime/resolution.test.ts index 166ac26f96..9d8844d2d1 100644 --- a/src/commands/interaction/runtime/resolution.test.ts +++ b/src/commands/interaction/runtime/resolution.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { BackendSnapshotOptions } from '../../../backend.ts'; +import type { BackendSnapshotOptions } from '@agent-device/contracts/backend'; import { ref, selector } from './selector-read-utils.ts'; import { resolveRecordedTarget } from '@agent-device/selectors'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; diff --git a/src/commands/interaction/runtime/resolution.ts b/src/commands/interaction/runtime/resolution.ts index 24c3c5af3b..a2255c6569 100644 --- a/src/commands/interaction/runtime/resolution.ts +++ b/src/commands/interaction/runtime/resolution.ts @@ -1,5 +1,5 @@ import { AppError } from '@agent-device/kernel/errors'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import type { SelectorResolution } from '@agent-device/selectors'; import { readinessScheduleFor } from '@agent-device/selectors/selector-pipeline-policy'; import { diff --git a/src/commands/interaction/runtime/selector-is.test.ts b/src/commands/interaction/runtime/selector-is.test.ts index a790158a61..429406a1de 100644 --- a/src/commands/interaction/runtime/selector-is.test.ts +++ b/src/commands/interaction/runtime/selector-is.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendSnapshotOptions } from '../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotOptions } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { selector } from './selector-read-utils.ts'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { createSelectorDevice, selectorReadSnapshot } from './__tests__/test-utils/index.ts'; diff --git a/src/commands/interaction/runtime/selector-is.ts b/src/commands/interaction/runtime/selector-is.ts index ebc692a6fa..72bb5ef97d 100644 --- a/src/commands/interaction/runtime/selector-is.ts +++ b/src/commands/interaction/runtime/selector-is.ts @@ -11,7 +11,7 @@ import { resolveSelectorPipeline } from '@agent-device/selectors/selector-pipeli import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { createSnapshotVisibility } from '@agent-device/contracts/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError, isRequestCanceledError } from '@agent-device/kernel/errors'; import type { SelectorTarget } from '@agent-device/contracts/interaction'; import { INTERACTION_ERROR_REASONS } from '@agent-device/selectors/interaction-error'; diff --git a/src/commands/interaction/runtime/selector-read-shared.ts b/src/commands/interaction/runtime/selector-read-shared.ts index 24e0a44ca6..6dfdc989a8 100644 --- a/src/commands/interaction/runtime/selector-read-shared.ts +++ b/src/commands/interaction/runtime/selector-read-shared.ts @@ -2,8 +2,8 @@ import type { AgentDeviceRuntime, CommandContext, CommandSessionRecord, -} from '../../../runtime-contract.ts'; -import type { BackendSnapshotResult } from '../../../backend.ts'; +} from '@agent-device/contracts/runtime-contract'; +import type { BackendSnapshotResult } from '@agent-device/contracts/backend'; import { AppError, discloseDispatch, diff --git a/src/commands/interaction/runtime/selector-read.test.ts b/src/commands/interaction/runtime/selector-read.test.ts index 6017496dc5..3f165f0a65 100644 --- a/src/commands/interaction/runtime/selector-read.test.ts +++ b/src/commands/interaction/runtime/selector-read.test.ts @@ -1,12 +1,10 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendSnapshotOptions } from '../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotOptions } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { - createAgentDevice, - localCommandPolicy, - type CommandSessionStore, -} from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; import { ref, selector } from './selector-read-utils.ts'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { diff --git a/src/commands/interaction/runtime/selector-read.ts b/src/commands/interaction/runtime/selector-read.ts index ad5fe740cc..03847d857c 100644 --- a/src/commands/interaction/runtime/selector-read.ts +++ b/src/commands/interaction/runtime/selector-read.ts @@ -14,7 +14,7 @@ import { import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import type { SnapshotNode } from '@agent-device/kernel/snapshot'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError } from '@agent-device/kernel/errors'; import type { ElementTarget, diff --git a/src/commands/interaction/runtime/selector-readiness.ts b/src/commands/interaction/runtime/selector-readiness.ts index 0c33bb0347..1380c41bff 100644 --- a/src/commands/interaction/runtime/selector-readiness.ts +++ b/src/commands/interaction/runtime/selector-readiness.ts @@ -11,7 +11,7 @@ import { INTERACTION_ERROR_REASONS } from '@agent-device/selectors/interaction-e import { observeUntil } from '@agent-device/capture-kit/observe-until'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; import { isUnreadableCaptureContentError } from '@agent-device/contracts/android-snapshot-quality'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { captureInteractionSnapshot, type InteractionSnapshot, diff --git a/src/commands/interaction/runtime/selector-wait-cancellation.test.ts b/src/commands/interaction/runtime/selector-wait-cancellation.test.ts index eeba5552a4..2063216d9b 100644 --- a/src/commands/interaction/runtime/selector-wait-cancellation.test.ts +++ b/src/commands/interaction/runtime/selector-wait-cancellation.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend } from '../../../backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { createMemorySessionStore } from '../../../command-runtime/runtime-factory.ts'; type Deferred = { diff --git a/src/commands/interaction/runtime/settle-transition-baseline.test.ts b/src/commands/interaction/runtime/settle-transition-baseline.test.ts index 7426e54702..b3b7cf01b9 100644 --- a/src/commands/interaction/runtime/settle-transition-baseline.test.ts +++ b/src/commands/interaction/runtime/settle-transition-baseline.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend } from '../../../backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { elementSettledRoomSnapshot, elementThreadsNoticeSnapshot, diff --git a/src/commands/interaction/runtime/settle.test.ts b/src/commands/interaction/runtime/settle.test.ts index 53226a8e16..de5e1afb53 100644 --- a/src/commands/interaction/runtime/settle.test.ts +++ b/src/commands/interaction/runtime/settle.test.ts @@ -1,9 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend } from '../../../backend.ts'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { ref, selector } from './selector-read-utils.ts'; import { buildSettleTailEntries, NEVER_SETTLED_HINT } from './settle.ts'; @@ -156,7 +156,7 @@ test('press --settle pins an already-established private-ax observation backend' tap: async () => ({ ok: true }), fill: async () => ({ ok: true }), longPress: async () => ({ ok: true }), - } satisfies AgentDeviceBackend, + } satisfies import('@agent-device/contracts/backend').AgentDeviceBackend, artifacts: createLocalArtifactAdapter(), sessions: createMemorySessionStore([{ name: 'default', snapshot: established }]), policy: localCommandPolicy(), diff --git a/src/commands/interaction/runtime/settle.ts b/src/commands/interaction/runtime/settle.ts index 475fd0df03..1dac8af721 100644 --- a/src/commands/interaction/runtime/settle.ts +++ b/src/commands/interaction/runtime/settle.ts @@ -3,7 +3,7 @@ import type { AgentDeviceRuntime, CommandContext, CommandSessionRecord, -} from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/runtime-contract'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; import { buildSnapshotDiff } from '@agent-device/capture-kit/snapshot-diff'; import { displayLabel, formatRole } from '@agent-device/capture-kit/snapshot-lines'; diff --git a/src/commands/interaction/runtime/stable-capture.test.ts b/src/commands/interaction/runtime/stable-capture.test.ts index 2775c78494..5a48eb150c 100644 --- a/src/commands/interaction/runtime/stable-capture.test.ts +++ b/src/commands/interaction/runtime/stable-capture.test.ts @@ -1,9 +1,10 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceBackend } from '../../../backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { runStableCaptureLoop } from './stable-capture.ts'; import { elementSettingsSnapshot, diff --git a/src/commands/interaction/runtime/stable-capture.ts b/src/commands/interaction/runtime/stable-capture.ts index 1e7fcb5415..91ee51abbd 100644 --- a/src/commands/interaction/runtime/stable-capture.ts +++ b/src/commands/interaction/runtime/stable-capture.ts @@ -4,7 +4,7 @@ import type { SnapshotQualityVerdict, } from '@agent-device/kernel/snapshot'; import { isViewportRootNode } from '@agent-device/contracts/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { now, sleep } from '../../runtime-common.ts'; import { captureSelectorSnapshot, diff --git a/src/commands/interaction/runtime/target-visibility-stages.ts b/src/commands/interaction/runtime/target-visibility-stages.ts index 2c24cc58a1..8f27ee11f9 100644 --- a/src/commands/interaction/runtime/target-visibility-stages.ts +++ b/src/commands/interaction/runtime/target-visibility-stages.ts @@ -6,7 +6,7 @@ import type { SnapshotState, } from '@agent-device/kernel/snapshot'; import { normalizeRef } from '@agent-device/kernel/snapshot'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { runNodePipelineStages, type SelectorPipelineHooks, diff --git a/src/commands/interaction/runtime/wait-absent.test.ts b/src/commands/interaction/runtime/wait-absent.test.ts index d8b7beb04c..79ae16eabe 100644 --- a/src/commands/interaction/runtime/wait-absent.test.ts +++ b/src/commands/interaction/runtime/wait-absent.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendSnapshotResult } from '../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotResult } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { createFakeClock } from './__tests__/test-utils/index.ts'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/commands/interaction/runtime/wait-polling.test.ts b/src/commands/interaction/runtime/wait-polling.test.ts index 727ce910f8..0a6eab58aa 100644 --- a/src/commands/interaction/runtime/wait-polling.test.ts +++ b/src/commands/interaction/runtime/wait-polling.test.ts @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceRuntime } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import { AppError } from '@agent-device/kernel/errors'; import { createWaitPolling, waitTimeoutError } from './wait-polling.ts'; diff --git a/src/commands/interaction/runtime/wait-selector.test.ts b/src/commands/interaction/runtime/wait-selector.test.ts index 4464bfd5e4..adba0ebfb5 100644 --- a/src/commands/interaction/runtime/wait-selector.test.ts +++ b/src/commands/interaction/runtime/wait-selector.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendSnapshotOptions } from '../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotOptions } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { createFakeClock } from './__tests__/test-utils/index.ts'; import { computeTargetEvidence } from '@agent-device/selectors/target-evidence'; diff --git a/src/commands/interaction/runtime/wait-stable.test.ts b/src/commands/interaction/runtime/wait-stable.test.ts index 7f0da4c051..9e55cae284 100644 --- a/src/commands/interaction/runtime/wait-stable.test.ts +++ b/src/commands/interaction/runtime/wait-stable.test.ts @@ -1,8 +1,9 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendSnapshotResult } from '../../../backend.ts'; +import type { AgentDeviceBackend, BackendSnapshotResult } from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { createFakeClock, selectorReadSnapshot } from './__tests__/test-utils/index.ts'; import { createMemorySessionStore } from '../../../command-runtime/runtime-factory.ts'; diff --git a/src/commands/io-policy.ts b/src/commands/io-policy.ts index 3240ce83ba..7931a117dd 100644 --- a/src/commands/io-policy.ts +++ b/src/commands/io-policy.ts @@ -7,8 +7,8 @@ import type { ResolvedInputFile, ResolveInputOptions, TemporaryFile, -} from '../io.ts'; -import type { AgentDeviceRuntime } from '../runtime-contract.ts'; +} from '@agent-device/contracts/artifact-adapter'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { AppError, asAppError } from '@agent-device/kernel/errors'; export async function resolveCommandInput( diff --git a/src/commands/management/runtime/admin-router.test.ts b/src/commands/management/runtime/admin-router.test.ts index 75dbad6cc9..20f6b053da 100644 --- a/src/commands/management/runtime/admin-router.test.ts +++ b/src/commands/management/runtime/admin-router.test.ts @@ -1,9 +1,12 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendInstallSource } from '../../../backend.ts'; -import type { ArtifactAdapter, FileInputRef } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; -import { restrictedCommandPolicy } from '../../../command-runtime/runtime-factory.ts'; +import type { AgentDeviceBackend, BackendInstallSource } from '@agent-device/contracts/backend'; +import type { ArtifactAdapter, FileInputRef } from '@agent-device/contracts/artifact-adapter'; +import { createAgentDevice } from '../../../runtime.ts'; +import { + localCommandPolicy, + restrictedCommandPolicy, +} from '@agent-device/contracts/command-policy'; const artifacts = { resolveInput: async (ref: FileInputRef) => ({ diff --git a/src/commands/management/runtime/admin.ts b/src/commands/management/runtime/admin.ts index 0613b7ba72..2270011c33 100644 --- a/src/commands/management/runtime/admin.ts +++ b/src/commands/management/runtime/admin.ts @@ -5,8 +5,8 @@ import type { BackendDeviceTarget, BackendInstallResult, BackendInstallSource, -} from '../../../backend.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/backend'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '@agent-device/kernel/success-text'; import { diff --git a/src/commands/management/runtime/apps.test.ts b/src/commands/management/runtime/apps.test.ts index 80cb85c8ea..6d83fd456c 100644 --- a/src/commands/management/runtime/apps.test.ts +++ b/src/commands/management/runtime/apps.test.ts @@ -5,11 +5,14 @@ import type { BackendAppEvent, BackendOpenTarget, BackendPushInput, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import type { JsonObject } from '@agent-device/contracts/client'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; -import { restrictedCommandPolicy } from '../../../command-runtime/runtime-factory.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { + localCommandPolicy, + restrictedCommandPolicy, +} from '@agent-device/contracts/command-policy'; test('runtime app commands call typed backend lifecycle primitives', async () => { const calls: unknown[] = []; diff --git a/src/commands/management/runtime/apps.ts b/src/commands/management/runtime/apps.ts index c131a2e5fa..a7c2da5b72 100644 --- a/src/commands/management/runtime/apps.ts +++ b/src/commands/management/runtime/apps.ts @@ -5,10 +5,10 @@ import type { BackendCommandContext, BackendOpenTarget, BackendPushInput, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import type { JsonObject } from '@agent-device/contracts/client'; -import type { FileInputRef } from '../../../io.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +import type { FileInputRef } from '@agent-device/contracts/artifact-adapter'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { assertResolvedAppsFilter } from '../app-inventory-contract.ts'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '@agent-device/kernel/success-text'; diff --git a/src/commands/management/runtime/index.ts b/src/commands/management/runtime/index.ts index 40ec7d8ce3..26ca68e288 100644 --- a/src/commands/management/runtime/index.ts +++ b/src/commands/management/runtime/index.ts @@ -1,4 +1,4 @@ -import type { AgentDeviceRuntime } from '../../../runtime-contract.ts'; +import type { AgentDeviceRuntime } from '@agent-device/contracts/runtime-contract'; import { bindRuntimeCommands, type BoundOf, type RuntimeCommand } from '../../runtime-types.ts'; import { resolveAppsFilter } from '../app-inventory-contract.ts'; import { diff --git a/src/commands/observability/output.ts b/src/commands/observability/output.ts index 168f90d41b..2f08b8e929 100644 --- a/src/commands/observability/output.ts +++ b/src/commands/observability/output.ts @@ -1,4 +1,4 @@ -import type { BackendNetworkEntry } from '../../backend.ts'; +import type { BackendNetworkEntry } from '@agent-device/contracts/backend'; import type { NetworkIncludeMode } from '@agent-device/kernel/contracts'; import type { NetworkEntry } from '@agent-device/contracts/observability'; import type { CliOutput } from '../command-contract.ts'; diff --git a/src/commands/observability/runtime/diagnostics-format.ts b/src/commands/observability/runtime/diagnostics-format.ts index 9d752ffa84..e511e67333 100644 --- a/src/commands/observability/runtime/diagnostics-format.ts +++ b/src/commands/observability/runtime/diagnostics-format.ts @@ -3,7 +3,7 @@ import type { BackendMeasurePerfResult, BackendNetworkIncludeMode, BackendReadLogsResult, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import type { DiagnosticsLogsCommandResult, DiagnosticsNetworkCommandResult, diff --git a/src/commands/observability/runtime/diagnostics-router.test.ts b/src/commands/observability/runtime/diagnostics-router.test.ts index 62edf2336b..9d0290504c 100644 --- a/src/commands/observability/runtime/diagnostics-router.test.ts +++ b/src/commands/observability/runtime/diagnostics-router.test.ts @@ -1,12 +1,10 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { AgentDeviceBackend, BackendCommandContext } from '../../../backend.ts'; -import type { ArtifactAdapter } from '../../../io.ts'; +import type { AgentDeviceBackend, BackendCommandContext } from '@agent-device/contracts/backend'; +import type { ArtifactAdapter } from '@agent-device/contracts/artifact-adapter'; import { createAgentDevice } from '../../../runtime.ts'; -import { - createMemorySessionStore, - restrictedCommandPolicy, -} from '../../../command-runtime/runtime-factory.ts'; +import { restrictedCommandPolicy } from '@agent-device/contracts/command-policy'; +import { createMemorySessionStore } from '../../../command-runtime/runtime-factory.ts'; const artifacts = { resolveInput: async () => ({ path: '/tmp/input' }), diff --git a/src/commands/observability/runtime/diagnostics-types.ts b/src/commands/observability/runtime/diagnostics-types.ts index b0e01ce6c9..fc4da711c2 100644 --- a/src/commands/observability/runtime/diagnostics-types.ts +++ b/src/commands/observability/runtime/diagnostics-types.ts @@ -3,7 +3,7 @@ import type { BackendLogEntry, BackendNetworkEntry, BackendPerfMetric, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; export type DiagnosticsLogsCommandResult = { kind: 'diagnosticsLogs'; diff --git a/src/commands/observability/runtime/diagnostics.ts b/src/commands/observability/runtime/diagnostics.ts index 75260b4cc3..639e692f53 100644 --- a/src/commands/observability/runtime/diagnostics.ts +++ b/src/commands/observability/runtime/diagnostics.ts @@ -6,8 +6,8 @@ import type { BackendMeasurePerfOptions, BackendNetworkIncludeMode, BackendReadLogsOptions, -} from '../../../backend.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/backend'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError } from '@agent-device/kernel/errors'; import { requireIntInRange } from '@agent-device/kernel/validation'; import { formatLogsResult, formatNetworkResult, formatPerfResult } from './diagnostics-format.ts'; diff --git a/src/commands/recording/runtime/contact-sheet.test.ts b/src/commands/recording/runtime/contact-sheet.test.ts index 49260d7593..67bfc2b48b 100644 --- a/src/commands/recording/runtime/contact-sheet.test.ts +++ b/src/commands/recording/runtime/contact-sheet.test.ts @@ -4,9 +4,16 @@ import { buildRecordingContactSheet, CONTACT_SHEET_THRESHOLD_REASON, } from '@agent-device/capture-kit/recording-contact-sheet'; -import type { ArtifactAdapter, ArtifactDescriptor, FileInputRef } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; -import { restrictedCommandPolicy } from '../../../command-runtime/runtime-factory.ts'; +import type { + ArtifactAdapter, + ArtifactDescriptor, + FileInputRef, +} from '@agent-device/contracts/artifact-adapter'; +import { createAgentDevice } from '../../../runtime.ts'; +import { + localCommandPolicy, + restrictedCommandPolicy, +} from '@agent-device/contracts/command-policy'; vi.mock('@agent-device/capture-kit/recording-contact-sheet', async (importOriginal) => ({ ...(await importOriginal()), diff --git a/src/commands/recording/runtime/contact-sheet.ts b/src/commands/recording/runtime/contact-sheet.ts index fd0173b2d6..d11a28433d 100644 --- a/src/commands/recording/runtime/contact-sheet.ts +++ b/src/commands/recording/runtime/contact-sheet.ts @@ -11,8 +11,8 @@ import type { FileInputRef, FileOutputRef, ReservedOutputFile, -} from '../../../io.ts'; -import type { CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/artifact-adapter'; +import type { CommandContext } from '@agent-device/contracts/runtime-contract'; import type { RuntimeCommand } from '../../runtime-types.ts'; import { reserveCommandOutput, resolveCommandInput } from '../../io-policy.ts'; diff --git a/src/commands/recording/runtime/recording.test.ts b/src/commands/recording/runtime/recording.test.ts index 599d75bbd8..4265029db0 100644 --- a/src/commands/recording/runtime/recording.test.ts +++ b/src/commands/recording/runtime/recording.test.ts @@ -1,8 +1,11 @@ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import type { ArtifactAdapter, FileInputRef } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; -import { restrictedCommandPolicy } from '../../../command-runtime/runtime-factory.ts'; +import type { ArtifactAdapter, FileInputRef } from '@agent-device/contracts/artifact-adapter'; +import { createAgentDevice } from '../../../runtime.ts'; +import { + localCommandPolicy, + restrictedCommandPolicy, +} from '@agent-device/contracts/command-policy'; const artifacts = { resolveInput: async (ref: FileInputRef) => ({ diff --git a/src/commands/recording/runtime/recording.ts b/src/commands/recording/runtime/recording.ts index efeaf40e66..703e0675ae 100644 --- a/src/commands/recording/runtime/recording.ts +++ b/src/commands/recording/runtime/recording.ts @@ -3,9 +3,9 @@ import type { BackendRecordingResult, BackendTraceOptions, BackendTraceResult, -} from '../../../backend.ts'; -import type { ArtifactDescriptor, FileOutputRef } from '../../../io.ts'; -import type { CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/backend'; +import type { ArtifactDescriptor, FileOutputRef } from '@agent-device/contracts/artifact-adapter'; +import type { CommandContext } from '@agent-device/contracts/runtime-contract'; import { AppError } from '@agent-device/kernel/errors'; import { successText } from '@agent-device/kernel/success-text'; import { requireIntInRange } from '@agent-device/kernel/validation'; diff --git a/src/commands/runtime-common.ts b/src/commands/runtime-common.ts index 9b5eecc7e6..afc2844a20 100644 --- a/src/commands/runtime-common.ts +++ b/src/commands/runtime-common.ts @@ -1,5 +1,5 @@ -import type { BackendCommandContext } from '../backend.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../runtime-contract.ts'; +import type { BackendCommandContext } from '@agent-device/contracts/backend'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; export function toBackendContext( runtime: Pick, diff --git a/src/commands/runtime-types.ts b/src/commands/runtime-types.ts index 3e1ca063d9..5268cb5a4e 100644 --- a/src/commands/runtime-types.ts +++ b/src/commands/runtime-types.ts @@ -1,5 +1,5 @@ -import type { FileOutputRef } from '../io.ts'; -import type { AgentDeviceRuntime, CommandContext } from '../runtime-contract.ts'; +import type { FileOutputRef } from '@agent-device/contracts/artifact-adapter'; +import type { AgentDeviceRuntime, CommandContext } from '@agent-device/contracts/runtime-contract'; import type { SessionSurface } from '@agent-device/contracts/session'; import type { SnapshotCommandOptionFields } from '@agent-device/kernel/snapshot'; diff --git a/src/commands/system/runtime/system.test.ts b/src/commands/system/runtime/system.test.ts index e101dd25ac..dee2d3feb3 100644 --- a/src/commands/system/runtime/system.test.ts +++ b/src/commands/system/runtime/system.test.ts @@ -6,9 +6,10 @@ import type { BackendDeviceOrientation, BackendKeyboardOptions, BackendTvRemoteOptions, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import { createLocalArtifactAdapter } from '../../../io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../runtime.ts'; +import { createAgentDevice } from '../../../runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; test('runtime system commands call typed backend primitives', async () => { const calls: unknown[] = []; diff --git a/src/commands/system/runtime/system.ts b/src/commands/system/runtime/system.ts index 72d847cb79..592215c4d7 100644 --- a/src/commands/system/runtime/system.ts +++ b/src/commands/system/runtime/system.ts @@ -5,8 +5,8 @@ import type { BackendDeviceOrientation, BackendKeyboardResult, BackendTvRemoteOptions, -} from '../../../backend.ts'; -import type { CommandContext } from '../../../runtime-contract.ts'; +} from '@agent-device/contracts/backend'; +import type { CommandContext } from '@agent-device/contracts/runtime-contract'; import type { BackMode } from '@agent-device/contracts/back-mode'; import { parseTvRemoteButton } from '@agent-device/contracts/tv-remote'; import { AppError } from '@agent-device/kernel/errors'; diff --git a/src/daemon/__tests__/runtime-session.test.ts b/src/daemon/__tests__/runtime-session.test.ts index 8c70b3e82f..e103260e07 100644 --- a/src/daemon/__tests__/runtime-session.test.ts +++ b/src/daemon/__tests__/runtime-session.test.ts @@ -7,7 +7,7 @@ import { withDiagnosticsScope, } from '@agent-device/host-kit/diagnostics'; import { createDaemonRuntimeSessionStore } from '../runtime-session.ts'; -import type { CommandSessionRecord } from '../../runtime-contract.ts'; +import type { CommandSessionRecord } from '@agent-device/contracts/runtime-contract'; import { mkdtempForTestSync } from '../../__tests__/test-utils/tmp-dir.ts'; test('createDaemonRuntimeSessionStore hides non-matching sessions and scopes writes', async () => { diff --git a/src/daemon/interaction/internal/interaction-runtime.ts b/src/daemon/interaction/internal/interaction-runtime.ts index e0afccc1fe..5fcf085b9b 100644 --- a/src/daemon/interaction/internal/interaction-runtime.ts +++ b/src/daemon/interaction/internal/interaction-runtime.ts @@ -5,7 +5,7 @@ import type { AgentDeviceBackend, BackendActionResult, BackendSnapshotResult, -} from '../../../backend.ts'; +} from '@agent-device/contracts/backend'; import { createCommandSurfaceAgentDevice } from '../../../command-runtime/runtime-command-surface.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; import type { Rect, SnapshotState } from '@agent-device/kernel/snapshot'; diff --git a/src/daemon/interaction/internal/interaction-snapshot.ts b/src/daemon/interaction/internal/interaction-snapshot.ts index cbf6633a2b..32af84964c 100644 --- a/src/daemon/interaction/internal/interaction-snapshot.ts +++ b/src/daemon/interaction/internal/interaction-snapshot.ts @@ -2,7 +2,7 @@ import type { CommandFlags } from '@agent-device/contracts/command'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import type { DaemonCommandContext } from '../../context.ts'; import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapshot-quality-verdict'; -import { snapshotOptionsToFlags } from '../../../backend-snapshot-options.ts'; +import { snapshotOptionsToFlags } from '@agent-device/contracts/backend-snapshot-options'; import type { BoundContextFromFlags, InteractionSessionView, diff --git a/src/daemon/interaction/internal/types.ts b/src/daemon/interaction/internal/types.ts index 9db9629d36..31125cc7c0 100644 --- a/src/daemon/interaction/internal/types.ts +++ b/src/daemon/interaction/internal/types.ts @@ -4,7 +4,7 @@ import type { AndroidObservationAdapter } from '@agent-device/contracts/android- import type { Rect, SnapshotPreferredBackend, SnapshotState } from '@agent-device/kernel/snapshot'; import type { RequestCaptureProof } from '../../capture-disclosure.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; -import type { CommandSessionStore } from '../../../runtime-contract.ts'; +import type { CommandSessionStore } from '@agent-device/contracts/runtime-contract'; import type { DeferredInteractionOutcomeMark } from '../../deferred-interaction-outcome.ts'; import type { RecordActionEntry } from '../../session-action-recorder.ts'; import type { BoundContextFromFlags } from '../../context.ts'; diff --git a/src/daemon/runtime-artifacts.ts b/src/daemon/runtime-artifacts.ts index 4ac008d2b4..dc154f67f9 100644 --- a/src/daemon/runtime-artifacts.ts +++ b/src/daemon/runtime-artifacts.ts @@ -1,4 +1,4 @@ -import type { ArtifactAdapter } from '../io.ts'; +import type { ArtifactAdapter } from '@agent-device/contracts/artifact-adapter'; import { AppError } from '@agent-device/kernel/errors'; export function createUnsupportedArtifactAdapter( diff --git a/src/daemon/runtime-policy.ts b/src/daemon/runtime-policy.ts index 0c5b8fd252..0d85d3ac11 100644 --- a/src/daemon/runtime-policy.ts +++ b/src/daemon/runtime-policy.ts @@ -1,5 +1,5 @@ -import type { AgentDeviceRuntimeConfig } from '../runtime-contract.ts'; -import { localCommandPolicy } from '../command-runtime/runtime-factory.ts'; +import type { AgentDeviceRuntimeConfig } from '@agent-device/contracts/runtime-contract'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { createUnsupportedArtifactAdapter } from './runtime-artifacts.ts'; export function createDaemonRuntimePolicy( diff --git a/src/daemon/runtime-session.ts b/src/daemon/runtime-session.ts index f781c49fd3..7685156899 100644 --- a/src/daemon/runtime-session.ts +++ b/src/daemon/runtime-session.ts @@ -1,4 +1,7 @@ -import type { CommandSessionRecord, CommandSessionStore } from '../runtime-contract.ts'; +import type { + CommandSessionRecord, + CommandSessionStore, +} from '@agent-device/contracts/runtime-contract'; import { emitDiagnostic } from '@agent-device/host-kit/diagnostics'; import { refFrameTree } from './ref-frame.ts'; import type { SessionRef, SessionState } from './session-state.ts'; diff --git a/src/daemon/screenshot-runtime.ts b/src/daemon/screenshot-runtime.ts index 76723d292a..ae842c3c1d 100644 --- a/src/daemon/screenshot-runtime.ts +++ b/src/daemon/screenshot-runtime.ts @@ -13,9 +13,9 @@ import type { ScreenshotOverlayRef } from '@agent-device/kernel/snapshot'; import { promises as fs } from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import type { AgentDeviceBackend } from '../backend.ts'; -import type { ArtifactAdapter } from '../io.ts'; -import { localCommandPolicy } from '../command-runtime/runtime-factory.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; +import type { ArtifactAdapter } from '@agent-device/contracts/artifact-adapter'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { createCommandSurfaceAgentDevice } from '../command-runtime/runtime-command-surface.ts'; import { assertSupportedScreenshotPixelDensity, diff --git a/src/daemon/selector-capture-runtime.ts b/src/daemon/selector-capture-runtime.ts index 20b24c4b9f..26b95f3555 100644 --- a/src/daemon/selector-capture-runtime.ts +++ b/src/daemon/selector-capture-runtime.ts @@ -1,5 +1,5 @@ import type { CommandFlags } from '@agent-device/contracts/command'; -import type { BackendSnapshotResult } from '../backend.ts'; +import type { BackendSnapshotResult } from '@agent-device/contracts/backend'; import { buildSnapshotPresentationKey, inheritPostGestureOutcome, diff --git a/src/daemon/selector-runtime-backend.ts b/src/daemon/selector-runtime-backend.ts index c7428d6eeb..59d6a28f4b 100644 --- a/src/daemon/selector-runtime-backend.ts +++ b/src/daemon/selector-runtime-backend.ts @@ -3,7 +3,7 @@ import type { AgentDeviceBackend, BackendCommandContext, BackendSnapshotResult, -} from '../backend.ts'; +} from '@agent-device/contracts/backend'; import { resolveTargetDevice } from '@agent-device/device-selection/dispatch-resolve'; import { createCommandSurfaceAgentDevice } from '../command-runtime/runtime-command-surface.ts'; import { publicPlatformString } from '@agent-device/kernel/device'; @@ -28,7 +28,7 @@ import type { BindDeviceRuntime, InspectDeviceRuntimeFacts } from './request-run import type { AndroidObservationAdapter } from '@agent-device/contracts/android-observation'; import type { PlatformResourceCleanup } from './platform-resource-cleanup.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; -import { snapshotOptionsToFlags } from '../backend-snapshot-options.ts'; +import { snapshotOptionsToFlags } from '@agent-device/contracts/backend-snapshot-options'; import type { RequestCaptureProof } from './capture-disclosure.ts'; import { checkIsArgs } from '@agent-device/selectors'; import { noActiveSessionError } from '@agent-device/kernel/contracts'; diff --git a/src/daemon/snapshot-command-runtime.ts b/src/daemon/snapshot-command-runtime.ts index 8b1b04456b..a2ff55db18 100644 --- a/src/daemon/snapshot-command-runtime.ts +++ b/src/daemon/snapshot-command-runtime.ts @@ -7,8 +7,8 @@ import { import type { SnapshotResult } from '@agent-device/contracts/snapshot-runtime'; import { publicPlatformString } from '@agent-device/kernel/device'; import { AppError } from '@agent-device/kernel/errors'; -import type { AgentDeviceBackend, BackendSnapshotResult } from '../backend.ts'; -import type { CommandSessionRecord } from '../runtime-contract.ts'; +import type { AgentDeviceBackend, BackendSnapshotResult } from '@agent-device/contracts/backend'; +import type { CommandSessionRecord } from '@agent-device/contracts/runtime-contract'; import { createCommandSurfaceAgentDevice } from '../command-runtime/runtime-command-surface.ts'; import { getRequestSignal } from '@agent-device/host-kit/request'; import { maybeBuildAndroidSnapshotTimeoutFailure } from './android-snapshot-timeout-evidence.ts'; diff --git a/src/io.ts b/src/io.ts index 714e4dc65f..12c2d8ff06 100644 --- a/src/io.ts +++ b/src/io.ts @@ -2,101 +2,10 @@ import { promises as fs } from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { AppError } from '@agent-device/kernel/errors'; -import type { DaemonArtifactType } from '@agent-device/kernel/contracts'; - -export type FileInputRef = - | { - kind: 'path'; - path: string; - } - | { - kind: 'uploadedArtifact'; - id: string; - }; - -export type FileOutputRef = - | { - kind: 'path'; - path: string; - } - | { - kind: 'downloadableArtifact'; - clientPath?: string; - fileName?: string; - }; - -export type ArtifactDescriptor = - | { - kind: 'localPath'; - field: string; - artifactType: DaemonArtifactType | undefined; - path: string; - fileName?: string; - metadata?: Record; - } - | { - kind: 'artifact'; - field: string; - artifactType: DaemonArtifactType | undefined; - artifactId: string; - fileName?: string; - url?: string; - clientPath?: string; - metadata?: Record; - }; - -export type OutputVisibility = 'client-visible' | 'internal'; - -export type ResolvedInputFile = { - path: string; - cleanup?: () => Promise; -}; - -export type ReservedOutputFile = { - path: string; - visibility: OutputVisibility; - publish: () => Promise; - cleanup?: () => Promise; -}; - -export type TemporaryFile = { - path: string; - visibility: 'internal'; - cleanup: () => Promise; -}; - -export type ResolveInputOptions = { - usage: string; - field?: string; -}; - -export type ReserveOutputOptions = { - field: string; - ext: string; - artifactType: DaemonArtifactType | undefined; - requestedClientPath?: string; - visibility?: OutputVisibility; -}; - -export type CreateTempFileOptions = { - prefix: string; - ext: string; -}; - -export type ArtifactAdapter = { - resolveInput(ref: FileInputRef, options: ResolveInputOptions): Promise; - reserveOutput( - ref: FileOutputRef | undefined, - options: ReserveOutputOptions, - ): Promise; - createTempFile(options: CreateTempFileOptions): Promise; -}; - -export type LocalArtifactAdapterOptions = { - cwd?: string; - tempDir?: string; - rootDir?: string; -}; +import type { + ArtifactAdapter, + LocalArtifactAdapterOptions, +} from '@agent-device/contracts/artifact-adapter'; export function createLocalArtifactAdapter( options: LocalArtifactAdapterOptions = {}, diff --git a/src/runtime.ts b/src/runtime.ts index 8e02198479..b9f308fdfa 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -1,15 +1,9 @@ import { bindCommands, type BoundAgentDeviceCommands } from './commands/index.ts'; import { createAgentDeviceRuntime } from './command-runtime/runtime-factory.ts'; -import type { AgentDeviceRuntime, AgentDeviceRuntimeConfig } from './runtime-contract.ts'; - -export type { +import type { AgentDeviceRuntime, AgentDeviceRuntimeConfig, - CommandPolicy, - CommandSessionRecord, - CommandSessionStore, -} from './runtime-contract.ts'; -export { localCommandPolicy } from './command-runtime/runtime-factory.ts'; +} from '@agent-device/contracts/runtime-contract'; export type AgentDevice = AgentDeviceRuntime & BoundAgentDeviceCommands; diff --git a/src/sdk/io.ts b/src/sdk/io.ts index 54269c252c..acfbae9cda 100644 --- a/src/sdk/io.ts +++ b/src/sdk/io.ts @@ -1 +1,18 @@ +// The published `agent-device/io` façade. The artifact-adapter vocabulary now lives in +// @agent-device/contracts/artifact-adapter; re-exporting it here keeps the published surface +// unchanged for consumers (a public package entry may re-export its package boundary). export * from '../io.ts'; +export type { + ArtifactAdapter, + ArtifactDescriptor, + CreateTempFileOptions, + FileInputRef, + FileOutputRef, + LocalArtifactAdapterOptions, + OutputVisibility, + ReserveOutputOptions, + ReservedOutputFile, + ResolveInputOptions, + ResolvedInputFile, + TemporaryFile, +} from '@agent-device/contracts/artifact-adapter'; diff --git a/test/integration/interaction-contract/runtime-harness.ts b/test/integration/interaction-contract/runtime-harness.ts index 2e980149d5..7e708cf206 100644 --- a/test/integration/interaction-contract/runtime-harness.ts +++ b/test/integration/interaction-contract/runtime-harness.ts @@ -1,7 +1,8 @@ -import type { AgentDeviceBackend } from '../../../src/backend.ts'; +import type { AgentDeviceBackend } from '@agent-device/contracts/backend'; import type { SnapshotState } from '@agent-device/kernel/snapshot'; import { createLocalArtifactAdapter } from '../../../src/io.ts'; -import { createAgentDevice, localCommandPolicy } from '../../../src/runtime.ts'; +import { createAgentDevice } from '../../../src/runtime.ts'; +import { localCommandPolicy } from '@agent-device/contracts/command-policy'; import { createMemorySessionStore } from '../../../src/command-runtime/runtime-factory.ts'; type ContractBackendOverrides = Partial< From c05bd6b60ff1aa0522b63c7b8acc0e7a1f96f996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 10 Oct 2026 21:21:39 +0200 Subject: [PATCH 2/3] chore(gates): retarget ownership tables to the moved command-runtime contracts Delete the moved modules' ROOT_MODULE_ZONES rows (command-runtime keeps src/io.ts and src/runtime.ts), pin the contracts exports snapshot for the five new subpaths (generate-contracts-exports-snapshot.ts), refresh the root-module and tracked-sources path examples, drop the retired src/runtime.ts re-export suppressions from .fallowrc, and drop the retired src/backend*.ts clause from ADR 0019's not-migration-target list. --- .fallowrc.json | 9 ++------- .../0019-request-bound-platform-runtime.md | 4 ++-- packages/contracts/package.json | 20 +++++++++++++++++++ .../layering/contracts-exports.snapshot.json | 5 +++++ scripts/layering/model.test.ts | 2 +- scripts/layering/root-module-zones.ts | 13 ++++-------- scripts/layering/tracked-sources.ts | 2 +- 7 files changed, 35 insertions(+), 20 deletions(-) diff --git a/.fallowrc.json b/.fallowrc.json index 575941efea..8c434cdb43 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -287,9 +287,9 @@ "exports": ["applyRuntimeHintValues", "clearRuntimeHintValues"] }, { - // createAgentDevice and localCommandPolicy are consumed by the lazy imports in src/cli/commands/{recording,screenshot}.ts; Fallow cannot connect the dynamic member reads. + // createAgentDevice is consumed by the lazy imports in src/cli/commands/{recording,screenshot}.ts; Fallow cannot connect the dynamic member reads. "file": "src/runtime.ts", - "exports": ["createAgentDevice", "localCommandPolicy"] + "exports": ["createAgentDevice"] }, { // The contracts snapshot façade must re-export every symbol of ../snapshot-scope.ts (scripts/layering/package-boundaries.test.ts, façade exhaustiveness); callers import it from @agent-device/contracts/snapshot-scope, so the façade copy has no consumer. @@ -576,11 +576,6 @@ "summarizeAgentBrowserProcesses", "summarizeManagedAgentBrowserProcesses" ] - }, - { - // src/runtime.ts keeps its published type surface while its implementation moves to src/command-runtime/runtime-factory.ts (#2540, #3294). These two re-exports have no in-repo consumer; they stay so the module's exported shape is unchanged. - "file": "src/runtime.ts", - "exports": ["CommandPolicy", "CommandSessionRecord"] } ], "usedClassMembers": [ diff --git a/docs/adr/0019-request-bound-platform-runtime.md b/docs/adr/0019-request-bound-platform-runtime.md index 62bd6c9063..a9b82fa75d 100644 --- a/docs/adr/0019-request-bound-platform-runtime.md +++ b/docs/adr/0019-request-bound-platform-runtime.md @@ -982,8 +982,8 @@ anchor, not as a proposed commitment. `packages/provider-limrun/src/`; these root files are the composition-time wiring, comparable in role to `src/platform-runtime.ts` itself. - `src/core` (R13-governed consumer seams), `src/commands`, `src/cli`, `src/cli-schema`, - `src/mcp`, `src/client`, `src/sdk`, `src/ai-sdk`, `src/remote`, `src/request`, `src/metro`, - `src/backend*.ts`. Not migration targets: these are command-surface, protocol-projection, and + `src/mcp`, `src/client`, `src/sdk`, `src/ai-sdk`, `src/remote`, `src/request`, `src/metro`. + Not migration targets: these are command-surface, protocol-projection, and daemon-owned zones this ADR keeps in `src/` by design, not residue awaiting a package. Neither number has an owning issue, gate, or accepted budget yet. Treat both as inputs to a diff --git a/packages/contracts/package.json b/packages/contracts/package.json index e3e124afc2..17f3424e02 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -84,6 +84,10 @@ "types": "./src/application-lifecycle-runtime-plan.ts", "default": "./src/application-lifecycle-runtime-plan.ts" }, + "./artifact-adapter": { + "types": "./src/artifact-adapter.ts", + "default": "./src/artifact-adapter.ts" + }, "./async-lifecycle": { "types": "./src/async-lifecycle.ts", "default": "./src/async-lifecycle.ts" @@ -116,10 +120,18 @@ "types": "./src/back-runtime.ts", "default": "./src/back-runtime.ts" }, + "./backend": { + "types": "./src/backend.ts", + "default": "./src/backend.ts" + }, "./backend-diagnostics": { "types": "./src/backend-diagnostics.ts", "default": "./src/backend-diagnostics.ts" }, + "./backend-snapshot-options": { + "types": "./src/backend-snapshot-options.ts", + "default": "./src/backend-snapshot-options.ts" + }, "./boot-failure": { "types": "./src/boot-failure.ts", "default": "./src/boot-failure.ts" @@ -152,6 +164,10 @@ "types": "./src/command-platform-execution.ts", "default": "./src/command-platform-execution.ts" }, + "./command-policy": { + "types": "./src/command-policy.ts", + "default": "./src/command-policy.ts" + }, "./daemon-http": { "types": "./src/daemon-http.ts", "default": "./src/daemon-http.ts" @@ -360,6 +376,10 @@ "types": "./src/platform-runtime-unavailable.ts", "default": "./src/platform-runtime-unavailable.ts" }, + "./runtime-contract": { + "types": "./src/runtime-contract.ts", + "default": "./src/runtime-contract.ts" + }, "./runtime-contract-error": { "types": "./src/runtime-contract-error.ts", "default": "./src/runtime-contract-error.ts" diff --git a/scripts/layering/contracts-exports.snapshot.json b/scripts/layering/contracts-exports.snapshot.json index 267d240055..00486cfb44 100644 --- a/scripts/layering/contracts-exports.snapshot.json +++ b/scripts/layering/contracts-exports.snapshot.json @@ -18,6 +18,7 @@ "@agent-device/contracts/application-lifecycle-interaction", "@agent-device/contracts/application-lifecycle-runtime", "@agent-device/contracts/application-lifecycle-runtime-plan", + "@agent-device/contracts/artifact-adapter", "@agent-device/contracts/async-lifecycle", "@agent-device/contracts/audio-probe-result", "@agent-device/contracts/audio-probe-runtime", @@ -26,7 +27,9 @@ "@agent-device/contracts/audio-runtime-plan", "@agent-device/contracts/back-mode", "@agent-device/contracts/back-runtime", + "@agent-device/contracts/backend", "@agent-device/contracts/backend-diagnostics", + "@agent-device/contracts/backend-snapshot-options", "@agent-device/contracts/boot-failure", "@agent-device/contracts/capture", "@agent-device/contracts/click-button", @@ -35,6 +38,7 @@ "@agent-device/contracts/clipboard-runtime", "@agent-device/contracts/command", "@agent-device/contracts/command-platform-execution", + "@agent-device/contracts/command-policy", "@agent-device/contracts/daemon-http", "@agent-device/contracts/deploy-result-target", "@agent-device/contracts/device", @@ -98,6 +102,7 @@ "@agent-device/contracts/remote", "@agent-device/contracts/replay", "@agent-device/contracts/runner-lease-context", + "@agent-device/contracts/runtime-contract", "@agent-device/contracts/runtime-contract-error", "@agent-device/contracts/runtime-operation-names", "@agent-device/contracts/screen-capture-contract", diff --git a/scripts/layering/model.test.ts b/scripts/layering/model.test.ts index a7a693fb8c..9c23544fbe 100644 --- a/scripts/layering/model.test.ts +++ b/scripts/layering/model.test.ts @@ -548,7 +548,7 @@ test('every production zone is deliberately classified as ranked or unranked', ( test('listSourceFiles includes root-level src/*.ts production files', () => { const files = new Set(listSourceFiles()); - for (const rootFile of ['src/cli.ts', 'src/runtime.ts', 'src/backend.ts']) { + for (const rootFile of ['src/cli.ts', 'src/runtime.ts', 'src/io.ts']) { assert.ok(files.has(rootFile), `expected ${rootFile} in analyzed source files`); } assert.ok(![...files].some((file) => file.endsWith('.test.ts'))); diff --git a/scripts/layering/root-module-zones.ts b/scripts/layering/root-module-zones.ts index e25608a69e..6826894b45 100644 --- a/scripts/layering/root-module-zones.ts +++ b/scripts/layering/root-module-zones.ts @@ -21,15 +21,10 @@ export const ROOT_MODULE_ZONES: Readonly> = { '(root)': ['src/bin.ts', 'src/cli.ts', 'src/daemon.ts'], // Imported by core's interactor resolution, so they sit at core's rank. core: ['src/platform-runtime-android-adb-host.ts', 'src/provider-device-runtime.ts'], - // The in-process command runtime: the backend and artifact contracts it drives and the - // assemblies that bind command families onto it. The daemon executes commands through it. - 'command-runtime': [ - 'src/backend-snapshot-options.ts', - 'src/backend.ts', - 'src/io.ts', - 'src/runtime-contract.ts', - 'src/runtime.ts', - ], + // The in-process command runtime: the local artifact-adapter implementation and the assembly + // that binds command families onto it. The backend and runtime contracts it drives moved to + // @agent-device/contracts, so the daemon reads that vocabulary from below the daemon. + 'command-runtime': ['src/io.ts', 'src/runtime.ts'], // The platform composition the daemon, CLI and SDK import eagerly. It shares the zone with its // private `src/platform-runtime/` submodule. 'platform-runtime': [ diff --git a/scripts/layering/tracked-sources.ts b/scripts/layering/tracked-sources.ts index b895d51462..ebe3e81c6f 100644 --- a/scripts/layering/tracked-sources.ts +++ b/scripts/layering/tracked-sources.ts @@ -20,7 +20,7 @@ import { execFileSync } from 'node:child_process'; // `src/**/*.ts` only matches NESTED files, so root-level `src/*.ts` (src/cli.ts, -// src/backend.ts) needs its own pathspec or it silently drops out of every scan. +// src/io.ts) needs its own pathspec or it silently drops out of every scan. // Workspace package sources are production files too (#1490 W0). const TRACKED_SOURCE_PATHSPECS = [ 'src/*.ts', From c28b046f28804e3157f02ffb327fae838c4f78c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sun, 11 Oct 2026 08:43:31 +0200 Subject: [PATCH 3/3] test(contracts): pin the restricted command-policy output denial Address #3394 review: assert restrictedCommandPolicy() refuses local output paths, and cut the src/sdk/io.ts header to what the entry exports. Co-Authored-By: Claude Opus 5.5 --- packages/contracts/src/command-policy.test.ts | 1 + src/sdk/io.ts | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/contracts/src/command-policy.test.ts b/packages/contracts/src/command-policy.test.ts index 3b571ffd78..2743028df0 100644 --- a/packages/contracts/src/command-policy.test.ts +++ b/packages/contracts/src/command-policy.test.ts @@ -5,5 +5,6 @@ test('command policy presets expose local and restricted defaults', () => { expect(localCommandPolicy().allowLocalInputPaths).toBe(true); expect(localCommandPolicy().allowLocalOutputPaths).toBe(true); expect(restrictedCommandPolicy().allowLocalInputPaths).toBe(false); + expect(restrictedCommandPolicy().allowLocalOutputPaths).toBe(false); expect(restrictedCommandPolicy({ allowLocalInputPaths: true }).allowLocalInputPaths).toBe(true); }); diff --git a/src/sdk/io.ts b/src/sdk/io.ts index acfbae9cda..a49a458843 100644 --- a/src/sdk/io.ts +++ b/src/sdk/io.ts @@ -1,6 +1,4 @@ -// The published `agent-device/io` façade. The artifact-adapter vocabulary now lives in -// @agent-device/contracts/artifact-adapter; re-exporting it here keeps the published surface -// unchanged for consumers (a public package entry may re-export its package boundary). +// Published `agent-device/io` entry: local artifact I/O plus the contracts artifact-adapter types. export * from '../io.ts'; export type { ArtifactAdapter,