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
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import fs from 'node:fs';
import path from 'node:path';
import { expect, test } from 'vitest';
import { stringify } from 'yaml';
import { runTypedMaestroReplay } from '../session-replay-maestro-runtime.ts';
import { SessionStore } from '../../../session-store.ts';
import { replayCommandForTest } from '../../__tests__/replay-command-fixture.ts';
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../../daemon-request.ts';
import { runTypedMaestroReplay } from '../../replay/internal/session-replay-maestro-runtime.ts';
import { SessionStore } from '../../session-store.ts';
import { replayCommandForTest } from '../../replay/__tests__/replay-command-fixture.ts';
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../daemon-request.ts';

// A replay error raised before any step runs carries no `failure`, so the route
// projects the normalized error directly instead of through the divergence
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { noMaestroIncludeSources } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { noMaestroIncludeSources } from '../../../__tests__/test-utils/replay-script-source.ts';
import { beforeEach, expect, test, vi } from 'vitest';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';

vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => {
const actual =
await importOriginal<typeof import('@agent-device/device-selection/dispatch-resolve')>();
return { ...actual, resolveTargetDevice: vi.fn() };
});
vi.mock('../../../snapshot-interactor-capture.ts', () => ({
vi.mock('../../snapshot-interactor-capture.ts', () => ({
captureSnapshotWithInteractor: vi.fn(),
}));
import fs from 'node:fs';
Expand All @@ -23,19 +23,19 @@ import {
import {
buildTypedMaestroFailureReportProjection,
buildTypedMaestroFailureResponse,
} from '../session-replay-maestro-failure.ts';
import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts';
import { SessionStore } from '../../../session-store.ts';
import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts';
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
import { baseReplayRequest as baseReq } from '../../__tests__/session-replay-runtime.fixtures.ts';
import { replaySessionForTest } from './replay-session-fixture.ts';
} from '../../replay/internal/session-replay-maestro-failure.ts';
import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts';
import { SessionStore } from '../../session-store.ts';
import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts';
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
import { baseReplayRequest as baseReq } from '../../replay/__tests__/session-replay-runtime.fixtures.ts';
import { replaySessionForTest } from '../../replay/internal/__tests__/replay-session-fixture.ts';
import type { SnapshotNode } from '@agent-device/kernel/snapshot';
import {
captureSnapshotThroughLegacyDispatchFixture,
legacyDispatchCapture,
} from '../../../__tests__/legacy-snapshot-capture-fixture.ts';
import { refFrameScope } from '../../../ref-frame.ts';
} from '../legacy-snapshot-capture-fixture.ts';
import { refFrameScope } from '../../ref-frame.ts';

const mockDispatchCommand = legacyDispatchCapture;
const mockCaptureSnapshotWithInteractor = vi.mocked(captureSnapshotWithInteractor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import fs from 'node:fs';
import path from 'node:path';
import { describe, expect, test, vi } from 'vitest';
import { createScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/screen-recording-admission-ledger';
import { LeaseRegistry } from '../../../lease-registry.ts';
import { platformResourceCleanup } from '../../../../platform-runtime-resource-cleanup.ts';
import { SessionStore } from '../../../session-store.ts';
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../../daemon-request.ts';
import { LeaseRegistry } from '../../lease-registry.ts';
import { platformResourceCleanup } from '../../../platform-runtime-resource-cleanup.ts';
import { SessionStore } from '../../session-store.ts';
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../daemon-request.ts';
import {
unavailableBindDevice,
unavailableBindExactDevice,
} from '../../../__tests__/test-device-runtime-gateway.ts';
} from '../test-device-runtime-gateway.ts';
import {
handleReplayCommand,
handleReplayTestCommand,
} from '../../../handlers/session-replay-command.ts';
import type { SessionCommandParams } from '../../../handlers/session-command-input.ts';
} from '../../handlers/session-replay-command.ts';
import type { SessionCommandParams } from '../../handlers/session-command-input.ts';
import * as maestro from '@agent-device/maestro';

const spy = vi.spyOn(maestro, 'executeMaestroFlow');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import fs from 'node:fs';
import path from 'node:path';
import { expect, test } from 'vitest';
import { stringify } from 'yaml';
import { runTypedMaestroReplay } from '../session-replay-maestro-runtime.ts';
import { SessionStore } from '../../../session-store.ts';
import { replayCommandForTest } from '../../__tests__/replay-command-fixture.ts';
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../../daemon-request.ts';
import { runTypedMaestroReplay } from '../../replay/internal/session-replay-maestro-runtime.ts';
import { SessionStore } from '../../session-store.ts';
import { replayCommandForTest } from '../../replay/__tests__/replay-command-fixture.ts';
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';
import { maestroScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest } from '../../daemon-request.ts';

// The Maestro replay route resolves the store key upstream and then validates the session's
// selectors, so its conflict recovery must name that key too — an implicitly cwd-scoped session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { test } from 'vitest';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest, DaemonResponse } from '../../../daemon-request.ts';
import { SessionStore } from '../../../session-store.ts';
import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts';
import { SessionStore } from '../../session-store.ts';
import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';
import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts';

const { runReplayFixture, runReplayForTest, assertNoUnresolvedInterpolation } =
maestroReplayFixture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { test } from 'vitest';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import { SessionStore } from '../../../session-store.ts';
import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import { SessionStore } from '../../session-store.ts';
import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts';

const { runReplayFixture, runReplayForTest } = maestroReplayFixture;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal
};
});

vi.mock('../../../snapshot-interactor-capture.ts', () => ({
vi.mock('../../snapshot-interactor-capture.ts', () => ({
captureSnapshotWithInteractor: vi.fn(),
}));

import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import type { CommandFlags } from '@agent-device/contracts/command';
import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../../daemon-request.ts';
import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts';
import { SessionStore } from '../../../session-store.ts';
import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts';
import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../daemon-request.ts';
import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts';
import { SessionStore } from '../../session-store.ts';
import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts';
import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay';
import {
maestroScriptSourceBundleFor,
replayScriptSourceBundleFor,
} from '../../../../__tests__/test-utils/replay-script-source.ts';
import { captureSnapshotThroughLegacyDispatchFixture } from '../../../__tests__/legacy-snapshot-capture-fixture.ts';
import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts';
import { seedReplayFixtureSession } from '../../__tests__/session-replay-runtime.fixtures.ts';
} from '../../../__tests__/test-utils/replay-script-source.ts';
import { captureSnapshotThroughLegacyDispatchFixture } from '../legacy-snapshot-capture-fixture.ts';
import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts';
import { seedReplayFixtureSession } from '../../replay/__tests__/session-replay-runtime.fixtures.ts';

vi.mocked(captureSnapshotWithInteractor).mockImplementation(
captureSnapshotThroughLegacyDispatchFixture,
Expand Down
Loading