agent-device 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +4 -1
  2. package/dist/src/331.js +3 -3
  3. package/dist/src/425.js +1 -0
  4. package/dist/src/bin.js +28 -28
  5. package/dist/src/core/dispatch.d.ts +2 -0
  6. package/dist/src/core/session-surface.d.ts +3 -0
  7. package/dist/src/core/settings-contract.d.ts +2 -1
  8. package/dist/src/daemon/app-log-ios.d.ts +2 -1
  9. package/dist/src/daemon/app-log-process.d.ts +1 -1
  10. package/dist/src/daemon/app-log.d.ts +1 -1
  11. package/dist/src/daemon/context.d.ts +2 -0
  12. package/dist/src/daemon/handlers/interaction-common.d.ts +30 -1
  13. package/dist/src/daemon/handlers/interaction-read.d.ts +14 -0
  14. package/dist/src/daemon/handlers/interaction-touch.d.ts +2 -3
  15. package/dist/src/daemon/handlers/interaction.d.ts +5 -12
  16. package/dist/src/daemon/handlers/snapshot-capture.d.ts +11 -4
  17. package/dist/src/daemon/snapshot-processing.d.ts +1 -0
  18. package/dist/src/daemon/types.d.ts +3 -1
  19. package/dist/src/daemon.js +39 -39
  20. package/dist/src/platforms/android/index.d.ts +1 -1
  21. package/dist/src/platforms/android/input-actions.d.ts +1 -0
  22. package/dist/src/platforms/android/settings.d.ts +1 -1
  23. package/dist/src/platforms/ios/apps.d.ts +1 -1
  24. package/dist/src/platforms/ios/macos-helper.d.ts +69 -0
  25. package/dist/src/platforms/ios/runner-client.d.ts +1 -1
  26. package/dist/src/utils/command-schema.d.ts +1 -0
  27. package/dist/src/utils/interactors.d.ts +1 -1
  28. package/dist/src/utils/snapshot-lines.d.ts +5 -2
  29. package/dist/src/utils/snapshot.d.ts +8 -1
  30. package/dist/src/utils/text-surface.d.ts +19 -0
  31. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +8 -0
  32. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +60 -0
  33. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +1 -1
  34. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +4 -0
  35. package/macos-helper/Package.swift +18 -0
  36. package/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +543 -0
  37. package/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +545 -0
  38. package/package.json +4 -1
  39. package/skills/agent-device/SKILL.md +25 -334
  40. package/skills/agent-device/references/bootstrap-install.md +167 -0
  41. package/skills/agent-device/references/coordinate-system.md +24 -4
  42. package/skills/agent-device/references/debugging.md +115 -0
  43. package/skills/agent-device/references/exploration.md +193 -0
  44. package/skills/agent-device/references/macos-desktop.md +55 -57
  45. package/skills/agent-device/references/remote-tenancy.md +56 -47
  46. package/skills/agent-device/references/verification.md +103 -0
  47. package/dist/src/274.js +0 -1
  48. package/dist/src/daemon/handlers/interaction-fill.d.ts +0 -3
  49. package/dist/src/daemon/handlers/interaction-press.d.ts +0 -3
  50. package/skills/agent-device/references/batching.md +0 -79
  51. package/skills/agent-device/references/logs-and-debug.md +0 -113
  52. package/skills/agent-device/references/perf-metrics.md +0 -53
  53. package/skills/agent-device/references/permissions.md +0 -70
  54. package/skills/agent-device/references/session-management.md +0 -101
  55. package/skills/agent-device/references/snapshot-refs.md +0 -102
  56. package/skills/agent-device/references/video-recording.md +0 -49
@@ -1,4 +1,5 @@
1
1
  import type { CommandFlags } from '../core/dispatch.ts';
2
+ import type { SessionSurface } from '../core/session-surface.ts';
2
3
  export type DaemonCommandContext = {
3
4
  requestId?: string;
4
5
  appBundleId?: string;
@@ -19,5 +20,6 @@ export type DaemonCommandContext = {
19
20
  clickButton?: 'primary' | 'secondary' | 'middle';
20
21
  pauseMs?: number;
21
22
  pattern?: 'one-way' | 'ping-pong';
23
+ surface?: SessionSurface;
22
24
  };
23
25
  export declare function contextFromFlags(logPath: string, flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string, requestId?: string): DaemonCommandContext;
@@ -1,6 +1,6 @@
1
1
  import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
2
  import type { DaemonCommandContext } from '../context.ts';
3
- import type { DaemonRequest } from '../types.ts';
3
+ import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
4
4
  import { SessionStore } from '../session-store.ts';
5
5
  export type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
6
6
  export type InteractionHandlerParams = {
@@ -10,3 +10,32 @@ export type InteractionHandlerParams = {
10
10
  contextFromFlags: ContextFromFlags;
11
11
  dispatch: typeof dispatchCommand;
12
12
  };
13
+ export declare function buildTouchVisualizationResult(params: {
14
+ data: Record<string, unknown> | undefined;
15
+ fallbackX: number;
16
+ fallbackY: number;
17
+ referenceFrame?: {
18
+ referenceWidth: number;
19
+ referenceHeight: number;
20
+ };
21
+ extra?: Record<string, unknown>;
22
+ }): Record<string, unknown>;
23
+ export declare function dispatchRecordedTouchInteraction(params: {
24
+ session: SessionState;
25
+ sessionStore: SessionStore;
26
+ requestCommand: string;
27
+ requestPositionals: string[];
28
+ flags: CommandFlags | undefined;
29
+ contextFromFlags: ContextFromFlags;
30
+ dispatch: typeof dispatchCommand;
31
+ interactionCommand: string;
32
+ interactionPositionals: string[];
33
+ outPath: string | undefined;
34
+ buildPayloads: (data: Record<string, unknown> | undefined) => {
35
+ result: Record<string, unknown>;
36
+ responseData?: Record<string, unknown>;
37
+ } | Promise<{
38
+ result: Record<string, unknown>;
39
+ responseData?: Record<string, unknown>;
40
+ }>;
41
+ }): Promise<DaemonResponse>;
@@ -0,0 +1,14 @@
1
+ import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
+ import type { SessionState } from '../types.ts';
3
+ import type { SnapshotNode } from '../../utils/snapshot.ts';
4
+ import type { ContextFromFlags } from './interaction-common.ts';
5
+ export declare function readTextForNode(params: {
6
+ device: SessionState['device'];
7
+ node: SnapshotNode;
8
+ flags: CommandFlags | undefined;
9
+ appBundleId?: string;
10
+ traceOutPath?: string;
11
+ surface?: SessionState['surface'];
12
+ contextFromFlags: ContextFromFlags;
13
+ dispatch: typeof dispatchCommand;
14
+ }): Promise<string>;
@@ -1,17 +1,16 @@
1
1
  import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
2
  import { type SnapshotNode } from '../../utils/snapshot.ts';
3
- import type { DaemonCommandContext } from '../context.ts';
4
3
  import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
5
4
  import { SessionStore } from '../session-store.ts';
6
5
  import { getAndroidScreenSize } from '../../platforms/android/index.ts';
7
- type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
6
+ import { type ContextFromFlags } from './interaction-common.ts';
8
7
  type CaptureSnapshotForSession = (session: SessionState, flags: CommandFlags | undefined, sessionStore: SessionStore, contextFromFlags: ContextFromFlags, options: {
9
8
  interactiveOnly: boolean;
10
9
  }, dispatch?: typeof dispatchCommand) => Promise<{
11
10
  nodes: SnapshotNode[];
12
11
  truncated?: boolean;
13
12
  createdAt: number;
14
- backend?: 'xctest' | 'android';
13
+ backend?: 'xctest' | 'android' | 'macos-helper';
15
14
  }>;
16
15
  type ResolveRefTarget = ((params: {
17
16
  session: SessionState;
@@ -1,16 +1,9 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { DaemonCommandContext } from '../context.ts';
3
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
1
+ import { dispatchCommand } from '../../core/dispatch.ts';
2
+ import type { DaemonResponse } from '../types.ts';
5
3
  import { getAndroidScreenSize } from '../../platforms/android/index.ts';
6
- type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
7
- export declare function handleInteractionCommands(params: {
8
- req: DaemonRequest;
9
- sessionName: string;
10
- sessionStore: SessionStore;
11
- contextFromFlags: ContextFromFlags;
4
+ import type { InteractionHandlerParams } from './interaction-common.ts';
5
+ export { unsupportedRefSnapshotFlags } from './interaction-flags.ts';
6
+ export declare function handleInteractionCommands(params: Omit<InteractionHandlerParams, 'dispatch'> & {
12
7
  dispatch?: typeof dispatchCommand;
13
8
  readAndroidScreenSize?: typeof getAndroidScreenSize;
14
9
  }): Promise<DaemonResponse | null>;
15
- export declare function unsupportedRefSnapshotFlags(flags: CommandFlags | undefined): string[];
16
- export {};
@@ -1,21 +1,28 @@
1
- import { dispatchCommand } from '../../core/dispatch.ts';
1
+ import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
2
  import { type RawSnapshotNode, type SnapshotState } from '../../utils/snapshot.ts';
3
- import type { DaemonResponse, DaemonRequest, SessionState } from '../types.ts';
3
+ import type { DaemonResponse, SessionState } from '../types.ts';
4
4
  type CaptureSnapshotParams = {
5
5
  dispatchSnapshotCommand: typeof dispatchCommand;
6
6
  device: SessionState['device'];
7
7
  session: SessionState | undefined;
8
- req: DaemonRequest;
8
+ flags: CommandFlags | undefined;
9
+ outPath?: string;
9
10
  logPath: string;
10
11
  snapshotScope?: string;
11
12
  };
13
+ type SnapshotData = {
14
+ nodes?: RawSnapshotNode[];
15
+ truncated?: boolean;
16
+ backend?: 'xctest' | 'android' | 'macos-helper';
17
+ };
12
18
  export declare function captureSnapshot(params: CaptureSnapshotParams): Promise<{
13
19
  snapshot: SnapshotState;
14
20
  }>;
21
+ export declare function captureSnapshotData(params: CaptureSnapshotParams): Promise<SnapshotData>;
15
22
  export declare function buildSnapshotState(data: {
16
23
  nodes?: RawSnapshotNode[];
17
24
  truncated?: boolean;
18
- backend?: 'xctest' | 'android';
25
+ backend?: 'xctest' | 'android' | 'macos-helper';
19
26
  }, snapshotRaw: boolean | undefined): SnapshotState;
20
27
  export declare function resolveSnapshotScope(snapshotScope: string | undefined, session: SessionState | undefined): {
21
28
  ok: true;
@@ -7,3 +7,4 @@ export declare function normalizeType(type: string): string;
7
7
  export declare function isFillableType(type: string, platform: Platform): boolean;
8
8
  export declare function findNearestHittableAncestor(nodes: SnapshotState['nodes'], node: SnapshotState['nodes'][number]): SnapshotState['nodes'][number] | null;
9
9
  export declare function extractNodeText(node: SnapshotState['nodes'][number]): string;
10
+ export declare function extractNodeReadText(node: SnapshotState['nodes'][number]): string;
@@ -1,5 +1,6 @@
1
1
  import type { MaterializeInstallSource } from '../platforms/install-source.ts';
2
2
  import type { CommandFlags } from '../core/dispatch.ts';
3
+ import type { SessionSurface } from '../core/session-surface.ts';
3
4
  import type { DeviceInfo, Platform, PlatformSelector } from '../utils/device.ts';
4
5
  import type { ExecResult } from '../utils/exec.ts';
5
6
  import type { SnapshotState } from '../utils/snapshot.ts';
@@ -113,6 +114,7 @@ export type SessionState = {
113
114
  name: string;
114
115
  device: DeviceInfo;
115
116
  createdAt: number;
117
+ surface?: SessionSurface;
116
118
  appBundleId?: string;
117
119
  appName?: string;
118
120
  snapshot?: SnapshotState;
@@ -144,7 +146,7 @@ export type SessionState = {
144
146
  /** Session-scoped app log stream; logs written to outPath for agent to grep */
145
147
  appLog?: {
146
148
  platform: Platform;
147
- backend: 'ios-simulator' | 'ios-device' | 'android';
149
+ backend: 'ios-simulator' | 'ios-device' | 'android' | 'macos';
148
150
  outPath: string;
149
151
  startedAt: number;
150
152
  getState: () => 'active' | 'failed';