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
227 changes: 184 additions & 43 deletions packages/daemon/src/__tests__/support/touch-command-surface-fake.ts

Large diffs are not rendered by default.

228 changes: 0 additions & 228 deletions packages/daemon/src/__tests__/support/touch-forwarding-surface-fake.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { legacyDispatchCapture } from '../../../__tests__/support/legacy-snapsho
import { markDeferredInteractionOutcome } from '../../../core/deferred-interaction-outcome.ts';
import { formatPostGestureOutcomeWarning } from '@agent-device/capture-kit/post-gesture-stability';
import { installLegacyCaptureInteractorResolution } from '../../../__tests__/support/legacy-capture-interactor-resolution.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';

installLegacyCaptureInteractorResolution();

Expand Down Expand Up @@ -56,7 +56,7 @@ async function pressSelector(params: {
const sessionStore = makeSessionStore();
sessionStore.publish(params.sessionName, makeSession(params.sessionName));
const response = await handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: {
token: 't',
session: params.sessionName,
Expand Down Expand Up @@ -109,7 +109,7 @@ test('a press that consumes no capture is not disclosed against an older tree',
sessionStore.publish(sessionName, session);

const response = await handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: {
token: 't',
session: sessionName,
Expand Down Expand Up @@ -169,7 +169,7 @@ async function pressAfterUnsettledScroll(selector: string) {
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'] });
let done = false;
const pending = handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: { token: 't', session: 'default', command: 'press', positionals: [selector], flags: {} },
sessionName: 'default',
sessionStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
mockFillPoint,
resetGetRuntimeFixture,
} from '../../__tests__/interaction-get-runtime-fixture.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';

const contextFromFlags = (_flags: CommandFlags | undefined) => ({});

Expand Down Expand Up @@ -163,7 +163,7 @@ test('parameterized fill scrubs concatenated backend values and object keys thro
);

const response = await handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: {
token: 't',
session: sessionName,
Expand Down Expand Up @@ -221,7 +221,7 @@ test('parameterized fill collapses whitespace-only backend echoes through the ha
});

const response = await handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: {
token: 't',
session: sessionName,
Expand Down Expand Up @@ -327,7 +327,7 @@ test('a fill on a @ref acts on the node of the authorized ref frame, not on a ne
mockFillPoint.mockResolvedValue({ filled: true });

const response = await handleInteractionCommands({
createCommandSurface: touchForwardingCreateCommandSurface(),
createCommandSurface: createTouchCommandSurface(),
req: {
token: 't',
session: sessionName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
makeSession,
makeStaleRefSession,
} from './__tests__/interaction-touch-fixtures.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';

// contracts/fixtures/dispatch-disclosure.json, daemon rows: each drives a `press`, `fill`, `get`,
// or `swipe` through the daemon interaction handler, inside the router's dispatch seam, over a
Expand All @@ -62,7 +62,7 @@ const GESTURE_PLAN: GesturePlan = {
],
};

const createCommandSurface = touchForwardingCreateCommandSurface({
const createCommandSurface = createTouchCommandSurface({
members: (config) => ({
selectors: {
get: async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { contextFromFlags as buildDaemonContext } from '../../../core/context.ts
import { installInteractorResolution } from '../../../core/interactor-resolution.ts';
import { handleInteractionCommands } from '../index.ts';
import { getRuntimeBindings } from '../../__tests__/interaction-get-runtime-fixture.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';

// The settle loop pins `private-ax` on its captures once the observation reports that producer; the
// daemon must carry that preference through its capture path to the interactor, which is what the
Expand Down Expand Up @@ -62,7 +62,7 @@ beforeEach(() => {
});

/** The pin the settle loop applies: every settle capture asks for `private-ax` once it is established. */
const pinningSurface = touchForwardingCreateCommandSurface({
const pinningSurface = createTouchCommandSurface({
observeSettle: async ({ settle, baselineQuality, capture }): Promise<SettleObservation> => {
let pinned = baselineQuality?.backend === 'private-ax';
for (let captures = 0; captures < 3; captures += 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '../../__tests__/interaction-get-runtime-fixture.ts';
import { daemonPlatformServicesFixture } from '../../../__tests__/support/platform-services-fixture.ts';
import { installLegacyCaptureInteractorResolution } from '../../../__tests__/support/legacy-capture-interactor-resolution.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';
import type { SettleObservation } from '@agent-device/contracts/interaction';
import type { SnapshotNode } from '@agent-device/kernel/snapshot';

Expand Down Expand Up @@ -145,11 +145,11 @@ function settledDiff(baseline: SnapshotNode[] | undefined, settled: SnapshotNode
}

/**
* The touch-forwarding surface with the post-action observation `--settle` owes: it captures the
* The touch command surface with the post-action observation `--settle` owes: it captures the
* settled tree through the config's backend under the settle budget's deadline and answers with the
* diff, or with the unavailable/stalled verdict the command family reports when that capture fails.
*/
const settlingSurface = touchForwardingCreateCommandSurface({
const settlingSurface = createTouchCommandSurface({
observeSettle: async ({ settle, baseline, capture }): Promise<SettleObservation> => {
const quietMs = settle.quietMs ?? 500;
const timeoutMs = settle.timeoutMs ?? 10_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
SAVE_BUTTON_EVIDENCE,
makeSessionWithSaveButtonSnapshot,
} from '../../../__tests__/support/target-evidence-fixture.ts';
import { touchForwardingCreateCommandSurface } from '../../../__tests__/support/touch-forwarding-surface-fake.ts';
import { createTouchCommandSurface } from '../../../__tests__/support/touch-command-surface-fake.ts';
import {
getRuntimeBindings,
resetGetRuntimeFixture,
Expand Down Expand Up @@ -44,7 +44,7 @@ async function runCommand(
command: string,
positionals: string[],
flags: CommandFlags = {},
createCommandSurface = touchForwardingCreateCommandSurface(),
createCommandSurface = createTouchCommandSurface(),
) {
return await handleInteractionCommands({
createCommandSurface,
Expand Down Expand Up @@ -138,7 +138,7 @@ const IDENTITY_EMPTY_ROW_NODES: RawSnapshotNode[] = [
* The command family's answer for a press on that container: the response describes the dispatched
* container, and the labeled descendant rides the recording-only `recordingTarget` side channel.
*/
const containerPressSurface = touchForwardingCreateCommandSurface({
const containerPressSurface = createTouchCommandSurface({
members: (config) => ({
interactions: {
press: async (target, options) => {
Expand Down
Loading