Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/replay-port/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
"@agent-device/capture-kit": "workspace:*",
"@agent-device/contracts": "workspace:*",
"@agent-device/kernel": "workspace:*",
"@agent-device/replay-test": "workspace:*",
"@agent-device/selectors": "workspace:*"
},
"exports": {
"./command-types": {
"types": "./src/daemon-port/command-types.ts",
"default": "./src/daemon-port/command-types.ts"
},
"./repair-hint": {
"types": "./src/daemon-port/repair-hint.ts",
"default": "./src/daemon-port/repair-hint.ts"
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions scripts/layering/architecture-ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export type LogicalModulePolicy = Readonly<{
const DAEMON_REPLAY_FACADE = {
root: 'src/daemon/replay/index.ts',
exports: [
'ReplayCoordinator',
'ReplayDaemonDependencies',
'ReplayResumeStamper',
'ReplaySession',
'ReplaySessionView',
'ReplayTestVideoOwner',
'appTargetResolutionOptions',
'bindReplaySession',
'buildMaestroReplayTargetDeviceResolutionOptions',
Expand Down
6 changes: 4 additions & 2 deletions src/daemon/handlers/session-replay-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import {
runReplayCommand,
runReplayTestCommand,
splitReplayCommandRequest,
type ReplayDaemonDependencies,
type ReplaySession,
} from '../replay/index.ts';
import type {
ReplayDaemonDependencies,
ReplaySession,
} from '@agent-device/replay-port/command-types';
import { createReplayCoordinator } from '../session-replay-coordinator.ts';
import { assertSessionSelectorMatches } from '../session-selector.ts';
import { resolveSessionScope } from '../session-routing.ts';
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/handlers/session-replay-video-owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type ScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/s
import type { PlatformRequestScope } from '@agent-device/contracts/platform-runtime-host';
import type { DaemonRequest } from '../daemon-request.ts';
import type { SessionStore } from '../session-store.ts';
import type { ReplayTestVideoOwner } from '../replay/index.ts';
import type { ReplayTestVideoOwner } from '@agent-device/replay-port/command-types';

type ReplayRecordVideoRequest = Parameters<ReplayTestVideoOwner['record']>[0];

Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/__tests__/application.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
runReplayTestCommand,
splitReplayCommandRequest,
} from '../index.ts';
import type { ReplayCommand, ReplayTestCommand } from '../internal/command-types.ts';
import type { ReplayCommand, ReplayTestCommand } from '@agent-device/replay-port/command-types';
import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts';
import {
legacyDispatchCapture,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/__tests__/replay-command-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
replayDaemonDependencies,
} from '../../handlers/session-replay-command.ts';
import { replayInvokeOverDispatch, runReplayCommand, splitReplayCommandRequest } from '../index.ts';
import type { ReplayCommand } from '../internal/command-types.ts';
import type { ReplayCommand } from '@agent-device/replay-port/command-types';

export type ReplayCommandTestInput = Readonly<{
req: DaemonRequest;
Expand Down
8 changes: 0 additions & 8 deletions src/daemon/replay/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
/** Public replay application seam for daemon handlers and their admitted owner capabilities. */
export { runReplayCommand } from './internal/native-command.ts';
export { runReplayTestCommand } from './internal/test-command.ts';
export type {
ReplayCoordinator,
ReplayDaemonDependencies,
ReplayResumeStamper,
ReplaySession,
ReplaySessionView,
ReplayTestVideoOwner,
} from './internal/command-types.ts';
export { bindReplaySession } from './internal/replay-session-binding.ts';
export {
replayInvokeOverDispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest';
import type { ReplayDispatchRequest } from '../command-types.ts';
import type { ReplayDispatchRequest } from '@agent-device/replay-port/command-types';
import { maestroOperationDispatchRequest } from '../session-replay-maestro-request.ts';

const replay: ReplayDispatchRequest = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
replayDaemonDependencies,
} from '../../../handlers/session-replay-command.ts';
import { runReplayTestCommand } from '../../index.ts';
import type { ReplayCommand, ReplayTestCommand } from '../command-types.ts';
import type { ReplayCommand, ReplayTestCommand } from '@agent-device/replay-port/command-types';
import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonInvokeFn, DaemonRequest } from '../../../daemon-request.ts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
runReplayTestCommand,
splitReplayCommandRequest,
} from '../../index.ts';
import type { ReplayTestCommand } from '../command-types.ts';
import type { ReplayTestCommand } from '@agent-device/replay-port/command-types';
import { REPLAY_ONLY_TEST_FLAG_REJECTIONS } from '../session-replay-test-policy.ts';
import { replayCommandFamily } from '../../../../commands/replay/index.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/native-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
ReplayCoordinator,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import { errorResponse, type DaemonResponse } from '@agent-device/kernel/contracts';

/**
Expand Down
6 changes: 5 additions & 1 deletion src/daemon/replay/internal/replay-dispatch-envelope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import type { DaemonWireRequest } from '@agent-device/contracts/command';
import type { ReplayDispatchOptions } from '@agent-device/contracts/replay';
import { stripUndefined } from '@agent-device/kernel/record';
import type { DaemonResponse } from '@agent-device/kernel/contracts';
import type { ReplayCommand, ReplayDispatchRequest, ReplayInvoke } from './command-types.ts';
import type {
ReplayCommand,
ReplayDispatchRequest,
ReplayInvoke,
} from '@agent-device/replay-port/command-types';

/** The request-private facts replay's own decisions read, as the daemon resolves them. */
export type ReplayPrivateAdmission = Readonly<{
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/replay-session-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
ReplaySessionObservation,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';

/**
* The live session record reached through the reads replay binds over. The daemon implements it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
ReplayDaemonDependencies,
ReplayDispatchRequest,
ReplayInvoke,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import { mergeParentFlags } from '@agent-device/command-registry/batch';
import { AppError, normalizeError } from '@agent-device/kernel/errors';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReplayDispatchRequest } from './command-types.ts';
import type { ReplayDispatchRequest } from '@agent-device/replay-port/command-types';
import type {
AdReplayDispatchGuard,
AdReplayDispatchOutcome,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { redactDiagnosticData } from '@agent-device/kernel/redaction';
import { type ReplayDivergence } from '@agent-device/contracts/divergence';
import { boundReplayDivergence } from '@agent-device/ad-replay/divergence';
import type { ReplayObservationEvidence } from '@agent-device/contracts/replay';
import type { ReplaySessionObservation, ReplaySessionStore } from './command-types.ts';
import type {
ReplaySessionObservation,
ReplaySessionStore,
} from '@agent-device/replay-port/command-types';

/**
* Daemon-owned replay projection and publication boundary. The response or
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/session-replay-divergence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
ReplaySessionObservation,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';

import type { ReplayObservationEvidence } from '@agent-device/contracts/replay';
import { boundReplayDivergenceForSession } from './session-replay-divergence-publication.ts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
ReplaySessionObservation,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import type { ReplayReportAction } from './session-replay-report-action.ts';
import { rankAndDedupeReplaySuggestions } from './session-replay-suggestion-ranking.ts';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
} from '@agent-device/maestro/daemon-runtime-port';
import type { ReplayDispatchOptions } from '@agent-device/contracts/replay';
import { stripUndefined } from '@agent-device/kernel/record';
import type { ReplayDispatchRequest } from './command-types.ts';
import type { ReplayDispatchRequest } from '@agent-device/replay-port/command-types';

/**
* The daemon half of the Maestro runtime port. The port projects a flow step onto one public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { MaestroExecutionOutcome } from '@agent-device/maestro';
import { normalizeError } from '@agent-device/kernel/errors';
import { summarizeSnapshotTimingSamples } from '@agent-device/contracts/capture';
import { buildTypedMaestroFailureResponse } from './session-replay-maestro-failure.ts';
import type { ReplayCommand, ReplaySessionStore } from './command-types.ts';
import type { ReplayCommand, ReplaySessionStore } from '@agent-device/replay-port/command-types';
import { type DaemonResponse } from '@agent-device/kernel/contracts';

type TypedMaestroSuccessResponseParams = Readonly<{
Expand Down
6 changes: 5 additions & 1 deletion src/daemon/replay/internal/session-replay-maestro-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ import {
REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE,
} from '@agent-device/replay-port/script-source';
import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay';
import type { ReplayCommand, ReplayDispatchRequest, ReplaySessionStore } from './command-types.ts';
import type {
ReplayCommand,
ReplayDispatchRequest,
ReplaySessionStore,
} from '@agent-device/replay-port/command-types';
import {
errorResponse,
type DaemonResponse,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/session-replay-resume.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SessionAction } from '@agent-device/contracts/session';
import type { ReplayDivergenceResume, ReplayRepairHint } from '@agent-device/contracts/divergence';
import type { ReplayResumeStamper } from './command-types.ts';
import type { ReplayResumeStamper } from '@agent-device/replay-port/command-types';

/**
* Builds the `resume` object and, through the caller's `ReplayResumeStamper` — the narrow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ReplayInvoke,
ReplaySessionObservation,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import { readReplaySelectorDisplayValue } from '@agent-device/selectors';
import {
type DaemonResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ReplayResumeStamper,
ReplaySessionObservation,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import { type DaemonResponse } from '@agent-device/kernel/contracts';

export async function withReplayFailureDiagnostics(params: {
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/session-replay-runtime-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ReplayDispatchRequest,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import { buildReplayScriptPlatformFlags } from './replay-script-selection.ts';
import {
inspectAdReplay,
Expand Down
6 changes: 5 additions & 1 deletion src/daemon/replay/internal/session-replay-runtime-session.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import fs from 'node:fs';
import type { DaemonWireRequest } from '@agent-device/contracts/command';
import type { ReplayCoordinator, ReplaySessionStore, ReplaySessionView } from './command-types.ts';
import type {
ReplayCoordinator,
ReplaySessionStore,
ReplaySessionView,
} from '@agent-device/replay-port/command-types';
import { expandSessionPath } from '@agent-device/host-kit/session-paths';
import { healedScriptSiblingPath } from './session-replay-heal.ts';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import type {
ReplaySessionObservation,
ReplaySessionState,
ReplaySessionStore,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import {
computeReplayRepairHint,
type ReplayRepairHintCapture,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ReplayRecordVideoRequest,
ReplaySessionStore,
ReplayTestVideoOwner,
} from './command-types.ts';
} from '@agent-device/replay-port/command-types';
import {
defaultRecordingPath,
recordingExtensionForPlatform,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/test-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '@agent-device/replay-port/script-source';
import type { ReplayScriptMetadata } from '@agent-device/ad-script';
import { expandSessionPath } from '@agent-device/host-kit/session-paths';
import type { ReplayCommand, ReplayTestCommand } from './command-types.ts';
import type { ReplayCommand, ReplayTestCommand } from '@agent-device/replay-port/command-types';
import {
runReplayTestSuite,
type ReplayTestBindAttemptCancellation,
Expand Down
12 changes: 6 additions & 6 deletions src/daemon/session-replay-coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import {
scriptTargetPath,
type SessionScriptPublicationState,
} from './session-script-publication-state.ts';
import {
healedScriptSiblingPath,
type ReplayCoordinator,
type ReplayResumeStamper,
type ReplaySessionView,
} from './replay/index.ts';
import { healedScriptSiblingPath } from './replay/index.ts';
import type {
ReplayCoordinator,
ReplayResumeStamper,
ReplaySessionView,
} from '@agent-device/replay-port/command-types';

/**
* `ReplayCoordinator` (#1478 P4b): the single daemon-owned gateway a native `.ad` replay request
Expand Down
Loading