agent-device 0.7.21 → 0.8.0
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.
- package/README.md +86 -0
- package/dist/src/224.js +2 -0
- package/dist/src/274.js +1 -0
- package/dist/src/331.js +3 -0
- package/dist/src/bin.d.ts +1 -0
- package/dist/src/bin.js +65 -61
- package/dist/src/cli-client-commands.d.ts +8 -0
- package/dist/src/cli.d.ts +6 -0
- package/dist/src/client-normalizers.d.ts +21 -0
- package/dist/src/client-types.d.ts +267 -0
- package/dist/src/client.d.ts +5 -0
- package/dist/src/core/app-events.d.ts +8 -0
- package/dist/src/core/batch.d.ts +17 -0
- package/dist/src/core/capabilities.d.ts +3 -0
- package/dist/src/core/dispatch-payload.d.ts +1 -0
- package/dist/src/core/dispatch-resolve.d.ts +28 -0
- package/dist/src/core/dispatch-series.d.ts +7 -0
- package/dist/src/core/dispatch.d.ts +34 -0
- package/dist/src/core/open-target.d.ts +4 -0
- package/dist/src/core/settings-contract.d.ts +8 -0
- package/dist/src/daemon/action-utils.d.ts +3 -0
- package/dist/src/daemon/app-log-android.d.ts +4 -0
- package/dist/src/daemon/app-log-ios.d.ts +6 -0
- package/dist/src/daemon/app-log-process.d.ts +15 -0
- package/dist/src/daemon/app-log-stream.d.ts +19 -0
- package/dist/src/daemon/app-log.d.ts +28 -0
- package/dist/src/daemon/artifact-archive.d.ts +12 -0
- package/dist/src/daemon/artifact-download.d.ts +12 -0
- package/dist/src/daemon/artifact-materialization.d.ts +17 -0
- package/dist/src/daemon/artifact-registry.d.ts +12 -0
- package/dist/src/daemon/config.d.ts +16 -0
- package/dist/src/daemon/context.d.ts +22 -0
- package/dist/src/daemon/device-ready.d.ts +6 -0
- package/dist/src/daemon/handlers/find.d.ts +40 -0
- package/dist/src/daemon/handlers/install-source.d.ts +10 -0
- package/dist/src/daemon/handlers/interaction.d.ts +14 -0
- package/dist/src/daemon/handlers/lease.d.ts +8 -0
- package/dist/src/daemon/handlers/parse-utils.d.ts +3 -0
- package/dist/src/daemon/handlers/record-trace.d.ts +15 -0
- package/dist/src/daemon/handlers/session-replay-heal.d.ts +8 -0
- package/dist/src/daemon/handlers/session-replay-script.d.ts +3 -0
- package/dist/src/daemon/handlers/session.d.ts +67 -0
- package/dist/src/daemon/handlers/snapshot.d.ts +32 -0
- package/dist/src/daemon/http-server.d.ts +26 -0
- package/dist/src/daemon/is-predicates.d.ts +14 -0
- package/dist/src/daemon/lease-context.d.ts +9 -0
- package/dist/src/daemon/lease-registry.d.ts +63 -0
- package/dist/src/daemon/materialized-path-registry.d.ts +15 -0
- package/dist/src/daemon/network-log.d.ts +32 -0
- package/dist/src/daemon/request-cancel.d.ts +9 -0
- package/dist/src/daemon/request-lock-policy.d.ts +2 -0
- package/dist/src/daemon/request-router.d.ts +17 -0
- package/dist/src/daemon/runtime-hints.d.ts +19 -0
- package/dist/src/daemon/script-utils.d.ts +15 -0
- package/dist/src/daemon/scroll-planner.d.ts +12 -0
- package/dist/src/daemon/selectors.d.ts +65 -0
- package/dist/src/daemon/server-lifecycle.d.ts +23 -0
- package/dist/src/daemon/session-routing.d.ts +3 -0
- package/dist/src/daemon/session-selector.d.ts +10 -0
- package/dist/src/daemon/session-store.d.ts +32 -0
- package/dist/src/daemon/snapshot-diff.d.ts +20 -0
- package/dist/src/daemon/snapshot-processing.d.ts +8 -0
- package/dist/src/daemon/transport.d.ts +6 -0
- package/dist/src/daemon/types.d.ts +118 -0
- package/dist/src/daemon/upload-registry.d.ts +7 -0
- package/dist/src/daemon/upload.d.ts +5 -0
- package/dist/src/daemon-client.d.ts +40 -0
- package/dist/src/daemon.d.ts +1 -0
- package/dist/src/daemon.js +36 -36
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +1 -0
- package/dist/src/platforms/android/adb.d.ts +5 -0
- package/dist/src/platforms/android/app-lifecycle.d.ts +30 -0
- package/dist/src/platforms/android/device-input-state.d.ts +19 -0
- package/dist/src/platforms/android/devices.d.ts +22 -0
- package/dist/src/platforms/android/index.d.ts +7 -0
- package/dist/src/platforms/android/input-actions.d.ts +12 -0
- package/dist/src/platforms/android/install-artifact.d.ts +11 -0
- package/dist/src/platforms/android/manifest.d.ts +1 -0
- package/dist/src/platforms/android/notifications.d.ts +11 -0
- package/dist/src/platforms/android/open-target.d.ts +4 -0
- package/dist/src/platforms/android/settings.d.ts +3 -0
- package/dist/src/platforms/android/snapshot.d.ts +8 -0
- package/dist/src/platforms/android/ui-hierarchy.d.ts +21 -0
- package/dist/src/platforms/appearance.d.ts +2 -0
- package/dist/src/platforms/boot-diagnostics.d.ts +14 -0
- package/dist/src/platforms/install-source.d.ts +26 -0
- package/dist/src/platforms/ios/apps.d.ts +34 -0
- package/dist/src/platforms/ios/config.d.ts +9 -0
- package/dist/src/platforms/ios/devicectl.d.ts +13 -0
- package/dist/src/platforms/ios/devices.d.ts +39 -0
- package/dist/src/platforms/ios/ensure-simulator.d.ts +18 -0
- package/dist/src/platforms/ios/index.d.ts +3 -0
- package/dist/src/platforms/ios/install-artifact.d.ts +18 -0
- package/dist/src/platforms/ios/launch-diagnostics.d.ts +11 -0
- package/dist/src/platforms/ios/plist.d.ts +1 -0
- package/dist/src/platforms/ios/runner-client.d.ts +36 -0
- package/dist/src/platforms/ios/runner-errors.d.ts +20 -0
- package/dist/src/platforms/ios/runner-session.d.ts +25 -0
- package/dist/src/platforms/ios/runner-transport.d.ts +10 -0
- package/dist/src/platforms/ios/runner-xctestrun.d.ts +18 -0
- package/dist/src/platforms/ios/screenshot.d.ts +13 -0
- package/dist/src/platforms/ios/simctl.d.ts +7 -0
- package/dist/src/platforms/ios/simulator.d.ts +11 -0
- package/dist/src/platforms/permission-utils.d.ts +9 -0
- package/dist/src/upload-client.d.ts +7 -0
- package/dist/src/utils/args.d.ts +27 -0
- package/dist/src/utils/cli-config.d.ts +9 -0
- package/dist/src/utils/cli-option-schema.d.ts +19 -0
- package/dist/src/utils/cli-options.d.ts +13 -0
- package/dist/src/utils/command-schema.d.ts +98 -0
- package/dist/src/utils/device-isolation.d.ts +3 -0
- package/dist/src/utils/device.d.ts +27 -0
- package/dist/src/utils/diagnostics.d.ts +30 -0
- package/dist/src/utils/errors.d.ts +26 -0
- package/dist/src/utils/exec.d.ts +32 -0
- package/dist/src/utils/finders.d.ts +12 -0
- package/dist/src/utils/interactive.d.ts +1 -0
- package/dist/src/utils/interactors.d.ts +31 -0
- package/dist/src/utils/json-input.d.ts +1 -0
- package/dist/src/utils/keyed-lock.d.ts +1 -0
- package/dist/src/utils/output.d.ts +25 -0
- package/dist/src/utils/payload-input.d.ts +12 -0
- package/dist/src/utils/process-identity.d.ts +11 -0
- package/dist/src/utils/retry.d.ts +54 -0
- package/dist/src/utils/session-binding.d.ts +18 -0
- package/dist/src/utils/snapshot-lines.d.ts +12 -0
- package/dist/src/utils/snapshot.d.ts +42 -0
- package/dist/src/utils/timeouts.d.ts +3 -0
- package/dist/src/utils/version.d.ts +2 -0
- package/package.json +9 -1
- package/skills/agent-device/SKILL.md +36 -0
- package/skills/agent-device/references/remote-tenancy.md +11 -0
- package/skills/agent-device/references/session-management.md +37 -1
- package/dist/src/678.js +0 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { MaterializeInstallSource } from '../platforms/install-source.ts';
|
|
2
|
+
import type { CommandFlags } from '../core/dispatch.ts';
|
|
3
|
+
import type { DeviceInfo } from '../utils/device.ts';
|
|
4
|
+
import type { ExecResult } from '../utils/exec.ts';
|
|
5
|
+
import type { SnapshotState } from '../utils/snapshot.ts';
|
|
6
|
+
export type DaemonInstallSource = MaterializeInstallSource;
|
|
7
|
+
export type DaemonLockPolicy = 'reject' | 'strip';
|
|
8
|
+
export type DaemonRequest = {
|
|
9
|
+
token: string;
|
|
10
|
+
session: string;
|
|
11
|
+
command: string;
|
|
12
|
+
positionals: string[];
|
|
13
|
+
flags?: CommandFlags;
|
|
14
|
+
runtime?: SessionRuntimeHints;
|
|
15
|
+
meta?: {
|
|
16
|
+
requestId?: string;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
cwd?: string;
|
|
19
|
+
tenantId?: string;
|
|
20
|
+
runId?: string;
|
|
21
|
+
leaseId?: string;
|
|
22
|
+
leaseTtlMs?: number;
|
|
23
|
+
leaseBackend?: 'ios-simulator';
|
|
24
|
+
sessionIsolation?: 'none' | 'tenant';
|
|
25
|
+
uploadedArtifactId?: string;
|
|
26
|
+
clientArtifactPaths?: Record<string, string>;
|
|
27
|
+
installSource?: DaemonInstallSource;
|
|
28
|
+
retainMaterializedPaths?: boolean;
|
|
29
|
+
materializedPathRetentionMs?: number;
|
|
30
|
+
materializationId?: string;
|
|
31
|
+
lockPolicy?: DaemonLockPolicy;
|
|
32
|
+
lockPlatform?: 'ios' | 'android' | 'apple';
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type SessionRuntimeHints = {
|
|
36
|
+
platform?: 'ios' | 'android';
|
|
37
|
+
metroHost?: string;
|
|
38
|
+
metroPort?: number;
|
|
39
|
+
bundleUrl?: string;
|
|
40
|
+
launchUrl?: string;
|
|
41
|
+
};
|
|
42
|
+
export type DaemonArtifact = {
|
|
43
|
+
field: string;
|
|
44
|
+
artifactId?: string;
|
|
45
|
+
fileName?: string;
|
|
46
|
+
localPath?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
};
|
|
49
|
+
export type DaemonResponseData = Record<string, unknown> & {
|
|
50
|
+
artifacts?: DaemonArtifact[];
|
|
51
|
+
};
|
|
52
|
+
export type DaemonResponse = {
|
|
53
|
+
ok: true;
|
|
54
|
+
data?: DaemonResponseData;
|
|
55
|
+
} | {
|
|
56
|
+
ok: false;
|
|
57
|
+
error: {
|
|
58
|
+
code: string;
|
|
59
|
+
message: string;
|
|
60
|
+
hint?: string;
|
|
61
|
+
diagnosticId?: string;
|
|
62
|
+
logPath?: string;
|
|
63
|
+
details?: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export type SessionState = {
|
|
67
|
+
name: string;
|
|
68
|
+
device: DeviceInfo;
|
|
69
|
+
createdAt: number;
|
|
70
|
+
appBundleId?: string;
|
|
71
|
+
appName?: string;
|
|
72
|
+
snapshot?: SnapshotState;
|
|
73
|
+
trace?: {
|
|
74
|
+
outPath: string;
|
|
75
|
+
startedAt: number;
|
|
76
|
+
};
|
|
77
|
+
recordSession?: boolean;
|
|
78
|
+
saveScriptPath?: string;
|
|
79
|
+
actions: SessionAction[];
|
|
80
|
+
recording?: {
|
|
81
|
+
platform: 'ios' | 'android';
|
|
82
|
+
outPath: string;
|
|
83
|
+
clientOutPath?: string;
|
|
84
|
+
remotePath?: string;
|
|
85
|
+
child: ReturnType<typeof import('node:child_process').spawn>;
|
|
86
|
+
wait: Promise<ExecResult>;
|
|
87
|
+
} | {
|
|
88
|
+
platform: 'ios-device-runner';
|
|
89
|
+
outPath: string;
|
|
90
|
+
clientOutPath?: string;
|
|
91
|
+
remotePath: string;
|
|
92
|
+
};
|
|
93
|
+
/** Session-scoped app log stream; logs written to outPath for agent to grep */
|
|
94
|
+
appLog?: {
|
|
95
|
+
platform: 'ios' | 'android';
|
|
96
|
+
backend: 'ios-simulator' | 'ios-device' | 'android';
|
|
97
|
+
outPath: string;
|
|
98
|
+
startedAt: number;
|
|
99
|
+
getState: () => 'active' | 'failed';
|
|
100
|
+
stop: () => Promise<void>;
|
|
101
|
+
wait: Promise<ExecResult>;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export type SessionAction = {
|
|
105
|
+
ts: number;
|
|
106
|
+
command: string;
|
|
107
|
+
positionals: string[];
|
|
108
|
+
flags: Partial<CommandFlags> & {
|
|
109
|
+
snapshotInteractiveOnly?: boolean;
|
|
110
|
+
snapshotCompact?: boolean;
|
|
111
|
+
snapshotDepth?: number;
|
|
112
|
+
snapshotScope?: string;
|
|
113
|
+
snapshotRaw?: boolean;
|
|
114
|
+
saveScript?: boolean | string;
|
|
115
|
+
noRecord?: boolean;
|
|
116
|
+
};
|
|
117
|
+
result?: Record<string, unknown>;
|
|
118
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function trackUploadedArtifact(params: {
|
|
2
|
+
artifactPath: string;
|
|
3
|
+
tempDir: string;
|
|
4
|
+
tenantId?: string;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function prepareUploadedArtifact(uploadId: string, tenantId?: string): string;
|
|
7
|
+
export declare function cleanupUploadedArtifact(uploadId: string): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DaemonRequest as SharedDaemonRequest, DaemonResponse as SharedDaemonResponse } from './daemon/types.ts';
|
|
2
|
+
import { type DaemonPaths } from './daemon/config.ts';
|
|
3
|
+
export type DaemonRequest = SharedDaemonRequest;
|
|
4
|
+
export type DaemonResponse = SharedDaemonResponse;
|
|
5
|
+
export type OpenAppOptions = {
|
|
6
|
+
session?: string;
|
|
7
|
+
app?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
lockPolicy?: NonNullable<DaemonRequest['meta']>['lockPolicy'];
|
|
10
|
+
lockPlatform?: NonNullable<DaemonRequest['meta']>['lockPlatform'];
|
|
11
|
+
platform?: NonNullable<DaemonRequest['flags']>['platform'];
|
|
12
|
+
target?: NonNullable<DaemonRequest['flags']>['target'];
|
|
13
|
+
device?: NonNullable<DaemonRequest['flags']>['device'];
|
|
14
|
+
udid?: NonNullable<DaemonRequest['flags']>['udid'];
|
|
15
|
+
serial?: NonNullable<DaemonRequest['flags']>['serial'];
|
|
16
|
+
activity?: NonNullable<DaemonRequest['flags']>['activity'];
|
|
17
|
+
out?: NonNullable<DaemonRequest['flags']>['out'];
|
|
18
|
+
saveScript?: NonNullable<DaemonRequest['flags']>['saveScript'];
|
|
19
|
+
relaunch?: boolean;
|
|
20
|
+
runtime?: DaemonRequest['runtime'];
|
|
21
|
+
meta?: Omit<NonNullable<DaemonRequest['meta']>, 'uploadedArtifactId' | 'clientArtifactPaths'>;
|
|
22
|
+
};
|
|
23
|
+
export declare function sendToDaemon(req: Omit<DaemonRequest, 'token'>): Promise<DaemonResponse>;
|
|
24
|
+
export declare function openApp(options?: OpenAppOptions): Promise<DaemonResponse>;
|
|
25
|
+
export declare function computeDaemonCodeSignature(entryPath: string, root?: string): string;
|
|
26
|
+
export declare function downloadRemoteArtifact(params: {
|
|
27
|
+
baseUrl: string;
|
|
28
|
+
token: string;
|
|
29
|
+
artifactId: string;
|
|
30
|
+
destinationPath: string;
|
|
31
|
+
requestId?: string;
|
|
32
|
+
timeoutMs?: number;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
export declare function resolveDaemonRequestTimeoutMs(raw?: string | undefined): number;
|
|
35
|
+
export declare function resolveDaemonStartupTimeoutMs(raw?: string | undefined): number;
|
|
36
|
+
export declare function resolveDaemonStartupAttempts(raw?: string | undefined): number;
|
|
37
|
+
export declare function resolveDaemonStartupHint(state: {
|
|
38
|
+
hasInfo: boolean;
|
|
39
|
+
hasLock: boolean;
|
|
40
|
+
}, paths?: Pick<DaemonPaths, 'infoPath' | 'lockPath'>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|