agent-device 0.12.8 → 0.12.9
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/dist/src/1974.js +2 -2
- package/dist/src/3883.js +1 -1
- package/dist/src/3918.js +28 -28
- package/dist/src/4829.js +1 -0
- package/dist/src/4993.js +1 -0
- package/dist/src/7847.js +1 -1
- package/dist/src/8564.js +1 -1
- package/dist/src/9076.js +1 -1
- package/dist/src/9152.js +1 -1
- package/dist/src/9323.js +5 -5
- package/dist/src/9542.js +2 -2
- package/dist/src/989.js +1 -1
- package/dist/src/backend.js +1 -1
- package/dist/src/bin.js +18 -18
- package/dist/src/commands/index.d.ts +4 -1
- package/dist/src/contracts.d.ts +3 -1
- package/dist/src/daemon.js +15 -15
- package/dist/src/index.d.ts +17 -11
- package/dist/src/metro.d.ts +9 -11
- package/package.json +9 -1
- package/skills/agent-device/references/exploration.md +1 -0
- package/skills/agent-device/references/remote-tenancy.md +9 -6
- package/skills/agent-device/references/verification.md +3 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -414,7 +414,7 @@ export declare class AppError extends Error {
|
|
|
414
414
|
constructor(code: AppErrorCode, message: string, details?: AppErrorDetails, cause?: unknown);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
export declare type AppErrorCode =
|
|
417
|
+
export declare type AppErrorCode = KnownAppErrorCode | (string & {});
|
|
418
418
|
|
|
419
419
|
declare type AppErrorDetails = Record<string, unknown> & {
|
|
420
420
|
hint?: string;
|
|
@@ -1053,6 +1053,7 @@ export declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
|
|
|
1053
1053
|
path?: string;
|
|
1054
1054
|
overlayRefs?: boolean;
|
|
1055
1055
|
fullscreen?: boolean;
|
|
1056
|
+
maxSize?: number;
|
|
1056
1057
|
surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
|
|
1057
1058
|
};
|
|
1058
1059
|
|
|
@@ -1082,6 +1083,8 @@ export declare type CaptureSnapshotResult = {
|
|
|
1082
1083
|
|
|
1083
1084
|
export declare function centerOfRect(rect: Rect): Point;
|
|
1084
1085
|
|
|
1086
|
+
declare type ClickButton = 'primary' | 'secondary' | 'middle';
|
|
1087
|
+
|
|
1085
1088
|
declare type ClickCommandOptions = PressCommandOptions;
|
|
1086
1089
|
|
|
1087
1090
|
export declare type ClickOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
|
|
@@ -1645,8 +1648,6 @@ declare type FindBaseOptions = ClientCommandBaseOptions & FindSnapshotCommandOpt
|
|
|
1645
1648
|
|
|
1646
1649
|
export declare type FindLocator = 'any' | 'text' | 'label' | 'value' | 'role' | 'id';
|
|
1647
1650
|
|
|
1648
|
-
declare type FindLocator_2 = 'any' | 'text' | 'label' | 'value' | 'role' | 'id';
|
|
1649
|
-
|
|
1650
1651
|
export declare type FindOptions = (FindBaseOptions & {
|
|
1651
1652
|
action?: 'click' | 'focus' | 'exists' | 'getText' | 'getAttrs';
|
|
1652
1653
|
}) | (FindBaseOptions & {
|
|
@@ -1658,7 +1659,7 @@ export declare type FindOptions = (FindBaseOptions & {
|
|
|
1658
1659
|
});
|
|
1659
1660
|
|
|
1660
1661
|
declare type FindReadCommandOptions = CommandContext & {
|
|
1661
|
-
locator?:
|
|
1662
|
+
locator?: FindLocator;
|
|
1662
1663
|
query: string;
|
|
1663
1664
|
action: Extract<FindAction['kind'], 'exists' | 'wait' | 'get_text' | 'get_attrs'>;
|
|
1664
1665
|
timeoutMs?: number;
|
|
@@ -1796,6 +1797,8 @@ export declare type KeyboardCommandResult = DaemonResponseData & {
|
|
|
1796
1797
|
attempts?: number;
|
|
1797
1798
|
};
|
|
1798
1799
|
|
|
1800
|
+
declare type KnownAppErrorCode = 'INVALID_ARGS' | 'DEVICE_NOT_FOUND' | 'DEVICE_IN_USE' | 'TOOL_MISSING' | 'APP_NOT_INSTALLED' | 'UNSUPPORTED_PLATFORM' | 'UNSUPPORTED_OPERATION' | 'NOT_IMPLEMENTED' | 'COMMAND_FAILED' | 'SESSION_NOT_FOUND' | 'UNAUTHORIZED' | 'AMBIGUOUS_MATCH' | 'UNKNOWN';
|
|
1801
|
+
|
|
1799
1802
|
declare type Lease = {
|
|
1800
1803
|
leaseId: string;
|
|
1801
1804
|
tenantId: string;
|
|
@@ -1899,19 +1902,21 @@ declare type MetroBridgeResult = {
|
|
|
1899
1902
|
};
|
|
1900
1903
|
};
|
|
1901
1904
|
|
|
1905
|
+
declare type MetroBridgeScope = {
|
|
1906
|
+
tenantId: string;
|
|
1907
|
+
runId: string;
|
|
1908
|
+
leaseId: string;
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1902
1911
|
declare type MetroPrepareKind = 'auto' | 'react-native' | 'expo';
|
|
1903
1912
|
|
|
1904
1913
|
export declare type MetroPrepareOptions = {
|
|
1905
1914
|
projectRoot?: string;
|
|
1906
1915
|
kind?: MetroPrepareKind;
|
|
1907
|
-
publicBaseUrl
|
|
1916
|
+
publicBaseUrl?: string;
|
|
1908
1917
|
proxyBaseUrl?: string;
|
|
1909
1918
|
bearerToken?: string;
|
|
1910
|
-
bridgeScope?:
|
|
1911
|
-
tenantId: string;
|
|
1912
|
-
runId: string;
|
|
1913
|
-
leaseId: string;
|
|
1914
|
-
};
|
|
1919
|
+
bridgeScope?: MetroBridgeScope;
|
|
1915
1920
|
launchUrl?: string;
|
|
1916
1921
|
companionProfileKey?: string;
|
|
1917
1922
|
companionConsumerKey?: string;
|
|
@@ -2030,7 +2035,7 @@ declare type PrepareMetroRuntimeResult = {
|
|
|
2030
2035
|
|
|
2031
2036
|
declare type PressCommandOptions = CommandContext & {
|
|
2032
2037
|
target: InteractionTarget_2;
|
|
2033
|
-
button?:
|
|
2038
|
+
button?: ClickButton;
|
|
2034
2039
|
count?: number;
|
|
2035
2040
|
intervalMs?: number;
|
|
2036
2041
|
holdMs?: number;
|
|
@@ -2244,6 +2249,7 @@ declare type ScreenshotCommandOptions = CommandContext & {
|
|
|
2244
2249
|
out?: FileOutputRef;
|
|
2245
2250
|
fullscreen?: boolean;
|
|
2246
2251
|
overlayRefs?: boolean;
|
|
2252
|
+
maxSize?: number;
|
|
2247
2253
|
appId?: string;
|
|
2248
2254
|
appBundleId?: string;
|
|
2249
2255
|
surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
|
package/dist/src/metro.d.ts
CHANGED
|
@@ -11,11 +11,7 @@ export declare type EnsureMetroTunnelOptions = {
|
|
|
11
11
|
serverBaseUrl: string;
|
|
12
12
|
bearerToken: string;
|
|
13
13
|
localBaseUrl: string;
|
|
14
|
-
bridgeScope:
|
|
15
|
-
tenantId: string;
|
|
16
|
-
runId: string;
|
|
17
|
-
leaseId: string;
|
|
18
|
-
};
|
|
14
|
+
bridgeScope: MetroBridgeScope;
|
|
19
15
|
launchUrl?: string;
|
|
20
16
|
profileKey?: string;
|
|
21
17
|
consumerKey?: string;
|
|
@@ -79,6 +75,12 @@ export declare type MetroBridgeRuntimePayload = {
|
|
|
79
75
|
launch_url?: string;
|
|
80
76
|
};
|
|
81
77
|
|
|
78
|
+
declare type MetroBridgeScope = {
|
|
79
|
+
tenantId: string;
|
|
80
|
+
runId: string;
|
|
81
|
+
leaseId: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
82
84
|
/** Re-export of {@link SessionRuntimeHints} under the Metro-specific alias used by public API consumers. */
|
|
83
85
|
export declare type MetroRuntimeHints = SessionRuntimeHints;
|
|
84
86
|
|
|
@@ -157,14 +159,10 @@ export declare function prepareRemoteMetro(options: PrepareRemoteMetroOptions):
|
|
|
157
159
|
export declare type PrepareRemoteMetroOptions = {
|
|
158
160
|
projectRoot: string;
|
|
159
161
|
kind: 'auto' | 'react-native' | 'expo';
|
|
160
|
-
publicBaseUrl
|
|
162
|
+
publicBaseUrl?: string;
|
|
161
163
|
proxyBaseUrl?: string;
|
|
162
164
|
proxyBearerToken?: string;
|
|
163
|
-
bridgeScope?:
|
|
164
|
-
tenantId: string;
|
|
165
|
-
runId: string;
|
|
166
|
-
leaseId: string;
|
|
167
|
-
};
|
|
165
|
+
bridgeScope?: MetroBridgeScope;
|
|
168
166
|
launchUrl?: string;
|
|
169
167
|
profileKey?: string;
|
|
170
168
|
consumerKey?: string;
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-device",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.9",
|
|
4
4
|
"description": "Unified control plane for physical and virtual devices via an agent-driven CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Callstack",
|
|
7
|
+
"homepage": "https://agent-device.dev/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/callstackincubator/agent-device.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/callstackincubator/agent-device/issues"
|
|
14
|
+
},
|
|
7
15
|
"type": "module",
|
|
8
16
|
"main": "dist/src/index.js",
|
|
9
17
|
"types": "dist/src/index.d.ts",
|
|
@@ -338,6 +338,7 @@ Common batch error categories:
|
|
|
338
338
|
- `SESSION_NOT_FOUND`: open or select the correct session, then retry.
|
|
339
339
|
- `UNSUPPORTED_OPERATION`: switch to a supported command or surface.
|
|
340
340
|
- `AMBIGUOUS_MATCH`: refine the selector or locator, then retry the failed step.
|
|
341
|
+
- `DEVICE_IN_USE`: the device is held by another session — close or reuse the existing session before retrying.
|
|
341
342
|
- `COMMAND_FAILED`: add sync guards and retry from the failing step.
|
|
342
343
|
|
|
343
344
|
## Stop conditions
|
|
@@ -103,8 +103,8 @@ Example `remote-config.json` shape:
|
|
|
103
103
|
"tenant": "acme",
|
|
104
104
|
"runId": "run-123",
|
|
105
105
|
"sessionIsolation": "tenant",
|
|
106
|
-
"platform": "
|
|
107
|
-
"
|
|
106
|
+
"platform": "ios",
|
|
107
|
+
"metroProxyBaseUrl": "https://bridge.example.com"
|
|
108
108
|
}
|
|
109
109
|
```
|
|
110
110
|
|
|
@@ -112,11 +112,11 @@ Optional overrides stay available for advanced cases:
|
|
|
112
112
|
|
|
113
113
|
```json
|
|
114
114
|
{
|
|
115
|
-
"session": "adc-
|
|
116
|
-
"leaseBackend": "
|
|
115
|
+
"session": "adc-ios",
|
|
116
|
+
"leaseBackend": "ios-instance",
|
|
117
117
|
"metroProjectRoot": ".",
|
|
118
118
|
"metroKind": "expo",
|
|
119
|
-
"
|
|
119
|
+
"metroPublicBaseUrl": "http://127.0.0.1:8081"
|
|
120
120
|
}
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -124,7 +124,10 @@ Optional overrides stay available for advanced cases:
|
|
|
124
124
|
- Omit Metro fields for non-React Native flows.
|
|
125
125
|
- Put `tenant`, `runId`, and `sessionIsolation` in the remote profile so agents can run `agent-device connect --remote-config ./remote-config.json` without extra scope flags. Add `platform`, `leaseBackend`, `session`, or Metro overrides only when the default inference is not enough for that flow.
|
|
126
126
|
- Explicit command-line flags override connected defaults. Use them intentionally when switching session, platform, target, tenant, run, or lease scope.
|
|
127
|
-
- For React Native Metro runs with `metroProxyBaseUrl`, `agent-device >= 0.11.12` can manage the local companion tunnel, but Metro itself still needs to be running locally.
|
|
127
|
+
- For React Native Metro runs with `metroProxyBaseUrl`, `agent-device >= 0.11.12` can manage the local companion tunnel, but Metro itself still needs to be running locally. `metroProxyBaseUrl` is the bridge origin, not a prebuilt `/api/metro/...` route.
|
|
128
|
+
- For cloud stock React Native iOS, use the bridge descriptor's wildcard HTTPS Metro hints directly; do not install or launch the XCTest runner just to make Metro reachable.
|
|
129
|
+
- Android keeps using bridge-provided `/api/metro/runtimes/<runtimeId>/...` Metro routes.
|
|
130
|
+
- `metroPublicBaseUrl` is only needed for direct/non-bridge bundle hints. Bridged profiles can omit it.
|
|
128
131
|
- Use a lease backend that matches the bridge target platform, for example `android-instance`, `ios-instance`, or an explicit `--lease-backend` override.
|
|
129
132
|
|
|
130
133
|
## Transport prerequisites
|
|
@@ -46,7 +46,10 @@ agent-device diff snapshot -i
|
|
|
46
46
|
|
|
47
47
|
Use `screenshot` when the proof needs a rendered image instead of a structural tree.
|
|
48
48
|
|
|
49
|
+
- Add `--max-size 1024` when a full-resolution screenshot is too large for an agent, model, or chat attachment.
|
|
49
50
|
- Add `--overlay-refs` when you want the saved PNG to show fresh `@eN` refs burned into the screenshot.
|
|
51
|
+
- Combine them as `screenshot /tmp/proof.png --max-size 1024 --overlay-refs` when you need a smaller visual proof that still includes tappable refs.
|
|
52
|
+
- Avoid very small `--max-size` values when text, icons, or labels need to remain readable.
|
|
50
53
|
|
|
51
54
|
## Visual regression with diff screenshot
|
|
52
55
|
|