agent-device 0.20.5 → 0.20.7
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 +5 -3
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.5.apk → agent-device-android-ime-helper-0.20.7.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.20.7.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.5.manifest.json → agent-device-android-ime-helper-0.20.7.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.20.5.apk → agent-device-android-snapshot-helper-0.20.7.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.7.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.20.5.manifest.json → agent-device-android-snapshot-helper-0.20.7.manifest.json} +6 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +48 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests-Bridging-Header.h +1 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +108 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +630 -89
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSelectorMatchPolicy.swift +78 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +126 -187
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedTextEntry.h +32 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedTextEntry.m +212 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +149 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +161 -32
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CoordinateTextEntryTests.swift +4 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +36 -28
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +23 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +10 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+LifecycleCacheTests.swift +0 -67
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +18 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +2 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SelectorMatchPolicyTests.swift +4 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +2 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +145 -20
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTraversalIdentityTests.swift +0 -20
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +4 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +234 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +106 -448
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +4 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +602 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +18 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +72 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +89 -0
- package/dist/src/agent-browser-tool.js +1 -1
- package/dist/src/agent-device-client.js +2 -2
- package/dist/src/android-adb.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-helpers.js +1 -1
- package/dist/src/app-lifecycle.js +7 -7
- package/dist/src/app-lifecycle2.js +2 -0
- package/dist/src/app-log-files.js +1 -0
- package/dist/src/app-log-reconnect.js +1 -0
- package/dist/src/app-log-runtime.js +4 -0
- package/dist/src/app-resolution.js +2 -1
- package/dist/src/apps.js +5 -5
- package/dist/src/audio-probe.js +1 -1
- package/dist/src/auth-session.js +1 -0
- package/dist/src/auth.js +2 -0
- package/dist/src/boot-diagnostics.js +2 -2
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-grammar.js +1 -0
- package/dist/src/cli-help.js +204 -254
- package/dist/src/cli-output.js +1 -0
- package/dist/src/cli-runner.js +1 -2
- package/dist/src/cli.js +6 -16
- package/dist/src/client-metro.js +1 -1
- package/dist/src/cloud-artifacts.d.ts +2 -137
- package/dist/src/command-metadata.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/connection-runtime.js +1 -0
- package/dist/src/connection.js +5 -0
- package/dist/src/context.js +1 -1
- package/dist/src/daemon-shutdown-report.js +1 -0
- package/dist/src/daemon.js +2 -0
- package/dist/src/debug-symbols.js +3 -3
- package/dist/src/device-claim-inspection.js +1 -0
- package/dist/src/device-input-state.js +2 -2
- package/dist/src/device.js +1 -1
- package/dist/src/device2.js +2 -0
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/generic-settle.js +1 -0
- package/dist/src/generic.js +1 -1
- package/dist/src/harmonyos.js +1 -0
- package/dist/src/helper.js +1 -1
- package/dist/src/host-process.js +2 -2
- package/dist/src/ime-lifecycle.js +7 -7
- package/dist/src/index.d.ts +69 -18
- package/dist/src/input-actions.js +4 -4
- package/dist/src/input-actions2.js +1 -1
- package/dist/src/input-actions3.js +1 -0
- package/dist/src/install-artifact.js +1 -5
- package/dist/src/install-artifact2.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-runtime.js +1 -0
- package/dist/src/interaction-snapshot.js +1 -1
- package/dist/src/interaction-touch-reference-frame.js +1 -0
- package/dist/src/interaction.js +1 -1
- package/dist/src/interactor.js +2 -2
- package/dist/src/interactor2.js +1 -1
- package/dist/src/internal/bin.js +2 -2
- package/dist/src/internal/daemon.js +9 -16
- package/dist/src/inventory.js +5 -0
- package/dist/src/inventory2.js +1 -0
- package/dist/src/inventory3.js +2 -0
- package/dist/src/inventory4.js +1 -0
- package/dist/src/inventory5.js +1 -0
- package/dist/src/inventory6.js +1 -0
- package/dist/src/lease-context.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -0
- package/dist/src/limrun.d.ts +10 -104
- package/dist/src/limrun.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/logcat.js +1 -1
- package/dist/src/manifest.js +1 -1
- package/dist/src/owner-identity.js +1 -0
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-runtime-app-log-android-transport.js +1 -0
- package/dist/src/platform-runtime-app-log-process.js +1 -0
- package/dist/src/platform-runtime-host.js +1 -0
- package/dist/src/platform-runtime-network-web-transport.js +1 -0
- package/dist/src/platform-runtime-operation-host.js +5 -0
- package/dist/src/platform-runtime-toolchain-host.js +1 -0
- package/dist/src/platform-runtime.js +1 -0
- package/dist/src/prepare-kind.js +15 -0
- package/dist/src/process-entry.js +1 -0
- package/dist/src/process-exit.js +1 -0
- package/dist/src/process-lock.js +1 -1
- package/dist/src/provider-webdriver.js +1 -0
- package/dist/src/provider.js +1 -0
- package/dist/src/proxy.js +2 -0
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/registry.js +25 -24
- package/dist/src/remote-config.js +1 -1
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay.js +3 -0
- package/dist/src/reporting.js +4 -4
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-lease.js +1 -1
- package/dist/src/runtime.js +3 -3
- package/dist/src/runtime2.js +4 -0
- package/dist/src/runtime3.js +3 -0
- package/dist/src/runtime4.js +1 -0
- package/dist/src/runtime5.js +1 -0
- package/dist/src/runtime6.js +1 -0
- package/dist/src/runtime7.js +1 -0
- package/dist/src/screenshot-result.js +4 -4
- package/dist/src/screenshot.js +1 -0
- package/dist/src/sdk-android-adb.d.ts +20 -2
- package/dist/src/sdk-android-adb.js +2 -2
- package/dist/src/sdk-batch-runner.js +3 -3
- package/dist/src/sdk-contracts.d.ts +47 -6
- package/dist/src/sdk-contracts.js +1 -1
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.d.ts +4 -20
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +601 -0
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selector-vocabulary.js +1 -1
- package/dist/src/selectors.d.ts +1 -46
- package/dist/src/selectors.js +1 -1
- package/dist/src/server.js +3 -3
- package/dist/src/session-target-evidence.js +1 -1
- package/dist/src/session.js +10 -9
- package/dist/src/shared.js +2 -0
- package/dist/src/shell-quote.js +1 -0
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -0
- package/dist/src/snapshot-session.js +1 -0
- package/dist/src/snapshot.js +1 -1
- package/dist/src/snapshot2.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src2.js +2 -0
- package/dist/src/src3.js +1 -0
- package/dist/src/text-surface.js +1 -0
- package/dist/src/timing-safe-equal.js +1 -0
- package/dist/src/tool-provider.js +3 -3
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/tool-provider3.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/web.js +1 -1
- package/package.json +72 -50
- package/server.json +3 -3
- package/skills/agent-device/SKILL.md +6 -31
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.20.5.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.5.apk.sha256 +0 -1
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-resize.swift +0 -225
- package/dist/src/app-log-request-scope.js +0 -1
- package/dist/src/devices.js +0 -1
- package/dist/src/devices2.js +0 -1
- package/dist/src/devices3.js +0 -1
- package/dist/src/devices4.js +0 -1
- package/dist/src/interaction.d.ts +0 -230
- package/dist/src/provider-limrun-runtime.js +0 -1
- package/dist/src/register-builtins.js +0 -1
- package/dist/src/screenshot-geometry.js +0 -1
- package/dist/src/viewport-dimension.js +0 -14
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-device",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.7",
|
|
4
4
|
"description": "Agent-native CLI for AI app automation across iOS, Android, tvOS, Android TV, macOS, Linux, and web.",
|
|
5
|
-
"mcpName": "io.github.
|
|
5
|
+
"mcpName": "io.github.callstack/agent-device",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Callstack",
|
|
8
8
|
"homepage": "https://agent-device.dev/",
|
|
@@ -19,52 +19,52 @@
|
|
|
19
19
|
"types": "dist/src/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"types": "./dist/src/index.d.ts",
|
|
23
|
+
"import": "./dist/src/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./io": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"types": "./dist/src/io.d.ts",
|
|
27
|
+
"import": "./dist/src/io.js"
|
|
28
28
|
},
|
|
29
29
|
"./artifacts": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"types": "./dist/src/artifacts.d.ts",
|
|
31
|
+
"import": "./dist/src/artifacts.js"
|
|
32
32
|
},
|
|
33
33
|
"./metro": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"types": "./dist/src/metro.d.ts",
|
|
35
|
+
"import": "./dist/src/metro.js"
|
|
36
36
|
},
|
|
37
37
|
"./batch": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
38
|
+
"types": "./dist/src/batch.d.ts",
|
|
39
|
+
"import": "./dist/src/batch.js"
|
|
40
40
|
},
|
|
41
41
|
"./remote-config": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"types": "./dist/src/remote-config.d.ts",
|
|
43
|
+
"import": "./dist/src/remote-config.js"
|
|
44
44
|
},
|
|
45
45
|
"./install-source": {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
46
|
+
"types": "./dist/src/install-source.d.ts",
|
|
47
|
+
"import": "./dist/src/install-source.js"
|
|
48
48
|
},
|
|
49
49
|
"./android-adb": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"types": "./dist/src/android-adb.d.ts",
|
|
51
|
+
"import": "./dist/src/android-adb.js"
|
|
52
52
|
},
|
|
53
53
|
"./limrun": {
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"types": "./dist/src/limrun.d.ts",
|
|
55
|
+
"import": "./dist/src/limrun.js"
|
|
56
56
|
},
|
|
57
57
|
"./contracts": {
|
|
58
|
-
"
|
|
59
|
-
"
|
|
58
|
+
"types": "./dist/src/contracts.d.ts",
|
|
59
|
+
"import": "./dist/src/contracts.js"
|
|
60
60
|
},
|
|
61
61
|
"./selectors": {
|
|
62
|
-
"
|
|
63
|
-
"
|
|
62
|
+
"types": "./dist/src/selectors.d.ts",
|
|
63
|
+
"import": "./dist/src/selectors.js"
|
|
64
64
|
},
|
|
65
65
|
"./finders": {
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"types": "./dist/src/finders.d.ts",
|
|
67
|
+
"import": "./dist/src/finders.js"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
@@ -101,23 +101,24 @@
|
|
|
101
101
|
"build:android-ime-helper": "AGENT_DEVICE_ANDROID_HELPER=ime sh ./scripts/build-android-helper.sh $(node -p \"require('./package.json').version\") .tmp/android-ime-helper",
|
|
102
102
|
"package:android-ime-helper": "AGENT_DEVICE_ANDROID_HELPER=ime sh ./scripts/package-android-helper.sh $(node -p \"require('./package.json').version\") .tmp/android-ime-helper",
|
|
103
103
|
"package:android-ime-helper:npm": "rm -rf android/ime-helper/dist && AGENT_DEVICE_ANDROID_HELPER=ime sh ./scripts/package-android-helper.sh $(node -p \"require('./package.json').version\") android/ime-helper/dist",
|
|
104
|
-
"build:macos-helper": "swift build -c release --package-path apple/macos-helper",
|
|
105
|
-
"build:macos-helper:clean": "swift package --package-path apple/macos-helper clean && pnpm build:macos-helper",
|
|
106
|
-
"package
|
|
104
|
+
"build:macos-helper": "node --experimental-strip-types scripts/swift-toolchain-tmpdir.ts swift build -c release --package-path apple/macos-helper",
|
|
105
|
+
"build:macos-helper:clean": "node --experimental-strip-types scripts/swift-toolchain-tmpdir.ts swift package --package-path apple/macos-helper clean && pnpm build:macos-helper",
|
|
106
|
+
"build:package": "pnpm build && pnpm build:xcuitest:ios && pnpm build:xcuitest:macos && pnpm build:xcuitest:tvos && pnpm build:xcuitest:visionos && pnpm build:macos-helper:clean && pnpm package:apple-runner:npm && pnpm build:android",
|
|
107
|
+
"package:npm": "pnpm build:package && pnpm check:package",
|
|
108
|
+
"release:prepare": "rm -rf .tmp/release && pnpm check:mcp-metadata && pnpm build:package && pnpm check:package -- --pack-destination .tmp/release",
|
|
109
|
+
"release:publish": "pnpm release:prepare && npm publish --ignore-scripts .tmp/release/*.tgz",
|
|
107
110
|
"ad": "node bin/agent-device.mjs",
|
|
108
111
|
"bench:help-conformance": "node scripts/help-conformance-bench.mjs",
|
|
109
|
-
"maestro:conformance": "node --experimental-strip-types --test packages/maestro/test/conformance/verify.test.ts packages/maestro/test/conformance/differential/run.test.ts packages/maestro/test/conformance/differential/invariants.test.ts",
|
|
112
|
+
"maestro:conformance": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test packages/maestro/test/conformance/verify.test.ts packages/maestro/test/conformance/differential/run.test.ts packages/maestro/test/conformance/differential/invariants.test.ts",
|
|
110
113
|
"maestro:conformance:regenerate": "node --experimental-strip-types scripts/maestro-conformance/regenerate.mjs",
|
|
111
114
|
"maestro:conformance:differential": "node --experimental-strip-types packages/maestro/test/conformance/differential/run.ts",
|
|
112
|
-
"prototype:program-boundary": "node --experimental-strip-types scripts/prototypes/daemon-boundaries/program-boundary.ts",
|
|
113
|
-
"prototype:session-boundary": "node --experimental-strip-types scripts/prototypes/daemon-boundaries/session-boundary.ts",
|
|
114
115
|
"size": "node scripts/size-report.mjs",
|
|
115
116
|
"perf": "node --experimental-strip-types scripts/perf/run.ts",
|
|
116
117
|
"mutation:run": "node --experimental-strip-types scripts/mutation/run.ts",
|
|
117
118
|
"mutation:baseline": "node --experimental-strip-types scripts/mutation/run.ts --update",
|
|
118
119
|
"mutation:check": "node --experimental-strip-types scripts/mutation/run.ts --no-run",
|
|
119
120
|
"mutation:affected": "node --experimental-strip-types scripts/mutation/run.ts --affected",
|
|
120
|
-
"mutation:test": "node --experimental-strip-types --test scripts/mutation/*.test.ts",
|
|
121
|
+
"mutation:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/mutation/*.test.ts",
|
|
121
122
|
"lint": "oxlint . --deny-warnings",
|
|
122
123
|
"format": "node ./node_modules/oxfmt/bin/oxfmt --write",
|
|
123
124
|
"format:check": "node ./node_modules/oxfmt/bin/oxfmt --check",
|
|
@@ -126,27 +127,31 @@
|
|
|
126
127
|
"fallow:baseline": "fallow dead-code --save-baseline fallow-baselines/dead-code.json --summary && fallow health --report-only --save-baseline fallow-baselines/health.json --summary",
|
|
127
128
|
"check:fallow": "fallow audit",
|
|
128
129
|
"check:affected": "node --experimental-strip-types scripts/check-affected/run.ts",
|
|
129
|
-
"check:affected:test": "node --experimental-strip-types --test scripts/check-affected/model.test.ts scripts/check-affected/run.test.ts",
|
|
130
|
+
"check:affected:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/check-affected/model.test.ts scripts/check-affected/platform-packages.test.ts scripts/check-affected/run.test.ts",
|
|
130
131
|
"check:coverage-changed": "node --experimental-strip-types scripts/coverage-changed/run.ts",
|
|
131
|
-
"check:coverage-changed:test": "node --experimental-strip-types --test scripts/coverage-changed/model.test.ts scripts/coverage-changed/run.test.ts",
|
|
132
|
-
"check:layering": "node --experimental-strip-types --test scripts/layering/model.test.ts scripts/layering/zone-policy.test.ts scripts/layering/daemon-modularity.test.ts scripts/layering/package-boundaries.test.ts && node --experimental-strip-types scripts/layering/check.ts",
|
|
132
|
+
"check:coverage-changed:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/coverage-changed/model.test.ts scripts/coverage-changed/run.test.ts",
|
|
133
|
+
"check:layering": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/layering/model.test.ts scripts/layering/zone-policy.test.ts scripts/layering/daemon-modularity.test.ts scripts/layering/package-boundaries.test.ts scripts/layering/platform-package-policy.test.ts scripts/layering/platform-package-repository.test.ts scripts/layering/platform-package-source-policy.test.ts scripts/layering/device-inventory-cutover-policy.test.ts scripts/layering/logs-runtime-cutover-policy.test.ts scripts/layering/network-runtime-cutover-policy.test.ts scripts/layering/contracts-implementation-policy.test.ts scripts/layering/facade-exports.test.ts scripts/layering/bin-alias-fast-path.test.ts && node --experimental-strip-types scripts/layering/check.ts",
|
|
133
134
|
"depgraph": "node --experimental-strip-types scripts/depgraph/build.ts",
|
|
134
|
-
"depgraph:test": "node --experimental-strip-types --test scripts/depgraph/model.test.ts scripts/depgraph/affected.test.ts",
|
|
135
|
+
"depgraph:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/depgraph/model.test.ts scripts/depgraph/affected.test.ts",
|
|
135
136
|
"check:production-exports": "fallow dead-code --config fallow-production-exports.json --production --unused-exports --fail-on-issues",
|
|
136
137
|
"check:bundle-owner-files": "node --experimental-strip-types scripts/check-bundle-owner-files.ts",
|
|
137
|
-
"check:
|
|
138
|
+
"check:package": "node --experimental-strip-types scripts/check-package.ts",
|
|
138
139
|
"check:command-docs": "vitest run --project unit-core src/__tests__/command-doc-coverage.test.ts",
|
|
139
140
|
"check:replay-compat": "node --experimental-strip-types scripts/check-replay-compat-provenance.ts",
|
|
141
|
+
"check:daemon-wire-compat": "node --experimental-strip-types scripts/wire-compat/run.ts",
|
|
142
|
+
"check:daemon-wire-compat:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/wire-compat/model.test.ts",
|
|
143
|
+
"check:tmpdir-leaks": "node --experimental-strip-types scripts/check-tmpdir-leaks.ts",
|
|
144
|
+
"check:tmpdir-leaks:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/check-tmpdir-leaks-model.test.ts scripts/vitest-tmpdir-global-setup.test.ts scripts/node-test-tmpdir.test.ts scripts/swift-toolchain-tmpdir.test.ts",
|
|
140
145
|
"check:freerange": "fr",
|
|
141
146
|
"check:quick": "pnpm lint && pnpm typecheck",
|
|
142
147
|
"sync:mcp-metadata": "node scripts/sync-mcp-metadata.mjs",
|
|
143
148
|
"check:mcp-metadata": "node scripts/sync-mcp-metadata.mjs --check",
|
|
144
149
|
"version": "pnpm sync:mcp-metadata && git add server.json",
|
|
145
|
-
"check:tooling": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm check:layering && pnpm depgraph:test && pnpm check:production-exports && pnpm check:mcp-metadata && pnpm build && pnpm check:bundle-owner-files && pnpm check:
|
|
146
|
-
"check:unit": "pnpm check:contention-retry && pnpm test:unit && pnpm test:smoke",
|
|
150
|
+
"check:tooling": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm check:layering && pnpm depgraph:test && pnpm check:production-exports && pnpm check:tmpdir-leaks:test && pnpm check:mcp-metadata && pnpm build && pnpm check:bundle-owner-files && pnpm check:package",
|
|
151
|
+
"check:unit": "pnpm check:contention-retry && pnpm test:unit && pnpm check:tmpdir-leaks && pnpm test:smoke",
|
|
147
152
|
"check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit",
|
|
148
153
|
"prepack": "pnpm check:mcp-metadata && pnpm package:npm",
|
|
149
|
-
"typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/ad-script packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json",
|
|
154
|
+
"typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/capture-kit packages/platform-apple packages/platform-android packages/platform-harmonyos packages/platform-vega packages/platform-linux packages/platform-web packages/ad-script packages/selectors packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json",
|
|
150
155
|
"test-app:install": "pnpm install --dir examples/test-app",
|
|
151
156
|
"test-app:start": "pnpm --dir examples/test-app start",
|
|
152
157
|
"test-app:ios": "pnpm --dir examples/test-app ios",
|
|
@@ -162,17 +167,17 @@
|
|
|
162
167
|
"test:maestro-compat": "vitest run --project unit-core packages/maestro src/daemon/adapters/maestro src/compat/__tests__/replay-input.test.ts",
|
|
163
168
|
"test:coverage": "vitest run --coverage",
|
|
164
169
|
"test:coverage:ci": "node --experimental-strip-types scripts/lib/contention-retry-run.ts --coverage",
|
|
165
|
-
"check:contention-retry": "node --experimental-strip-types --test scripts/lib/contention-retry-policy.test.ts",
|
|
170
|
+
"check:contention-retry": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/lib/contention-retry-policy.test.ts",
|
|
166
171
|
"test:integration:provider": "vitest run --project provider-integration",
|
|
167
172
|
"test:integration:progress": "node --experimental-strip-types scripts/integration-progress.ts",
|
|
168
173
|
"test:integration:progress:check": "node --experimental-strip-types scripts/integration-progress.ts --check",
|
|
169
|
-
"test:fixture-cache": "node --test test/ci/trusted-fixture-artifact.test.mjs",
|
|
174
|
+
"test:fixture-cache": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/ci/trusted-fixture-artifact.test.mjs",
|
|
170
175
|
"test:output-economy": "vitest run --project output-economy",
|
|
171
|
-
"test:smoke:web": "pnpm build && node --test test/integration/smoke-web-platform.test.ts",
|
|
172
|
-
"test:smoke": "node --test test/integration/smoke-*.test.ts",
|
|
173
|
-
"test:integration:node": "node --test test/integration/*.test.ts",
|
|
176
|
+
"test:smoke:web": "pnpm build && node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/smoke-web-platform.test.ts",
|
|
177
|
+
"test:smoke": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/smoke-*.test.ts",
|
|
178
|
+
"test:integration:node": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test --experimental-test-isolation=none test/integration/*.test.ts",
|
|
174
179
|
"test:integration": "pnpm test:integration:node && pnpm test:integration:provider",
|
|
175
|
-
"test:concurrency-torture": "node --test test/integration/nightly/concurrency-torture.test.ts",
|
|
180
|
+
"test:concurrency-torture": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/nightly/concurrency-torture.test.ts",
|
|
176
181
|
"test:replay:ios": "node --experimental-strip-types src/bin.ts test test/integration/replays/ios/simulator",
|
|
177
182
|
"test:replay:ios-device": "node --experimental-strip-types src/bin.ts test test/integration/replays/ios/device",
|
|
178
183
|
"test:replay:android": "node --experimental-strip-types src/bin.ts test test/integration/replays/android",
|
|
@@ -191,7 +196,8 @@
|
|
|
191
196
|
"!android/ime-helper/dist/*.idsig",
|
|
192
197
|
"!android/ime-helper/README.md",
|
|
193
198
|
"linux/atspi-dump.py",
|
|
194
|
-
"skills",
|
|
199
|
+
"skills/agent-device",
|
|
200
|
+
"skills/dogfood",
|
|
195
201
|
"server.json",
|
|
196
202
|
"smithery.yaml",
|
|
197
203
|
"README.md",
|
|
@@ -242,30 +248,46 @@
|
|
|
242
248
|
],
|
|
243
249
|
"dependencies": {
|
|
244
250
|
"@limrun/api": "^0.24.5",
|
|
245
|
-
"
|
|
246
|
-
"
|
|
251
|
+
"ipaddr.js": "^2.5.0",
|
|
252
|
+
"tar-stream": "^3.2.0",
|
|
253
|
+
"undici": "7.29.0",
|
|
254
|
+
"yaml": "^2.9.0",
|
|
255
|
+
"yauzl": "^3.4.0"
|
|
247
256
|
},
|
|
248
257
|
"devDependencies": {
|
|
258
|
+
"@agent-device/capture-kit": "workspace:*",
|
|
249
259
|
"@agent-device/ad-replay": "workspace:*",
|
|
250
260
|
"@agent-device/ad-script": "workspace:*",
|
|
251
261
|
"@agent-device/contracts": "workspace:*",
|
|
252
262
|
"@agent-device/kernel": "workspace:*",
|
|
253
263
|
"@agent-device/maestro": "workspace:*",
|
|
264
|
+
"@agent-device/platform-android": "workspace:*",
|
|
265
|
+
"@agent-device/platform-apple": "workspace:*",
|
|
266
|
+
"@agent-device/platform-harmonyos": "workspace:*",
|
|
267
|
+
"@agent-device/platform-linux": "workspace:*",
|
|
268
|
+
"@agent-device/platform-vega": "workspace:*",
|
|
269
|
+
"@agent-device/platform-web": "workspace:*",
|
|
254
270
|
"@agent-device/provider-limrun": "workspace:*",
|
|
255
271
|
"@agent-device/provider-webdriver": "workspace:*",
|
|
256
272
|
"@agent-device/replay-test": "workspace:*",
|
|
273
|
+
"@agent-device/selectors": "workspace:*",
|
|
257
274
|
"@agent-device/xml": "workspace:*",
|
|
275
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
258
276
|
"@chenglou/freerange": "^0.0.1",
|
|
259
277
|
"@stryker-mutator/core": "9.6.1",
|
|
260
278
|
"@stryker-mutator/vitest-runner": "9.6.1",
|
|
261
279
|
"@types/node": "^22.19.21",
|
|
262
280
|
"@types/pngjs": "^6.0.5",
|
|
281
|
+
"@types/tar-stream": "^3.1.4",
|
|
282
|
+
"@types/yauzl": "^2.10.3",
|
|
263
283
|
"@vitest/coverage-v8": "4.1.8",
|
|
264
284
|
"fallow": "^2.95.0",
|
|
265
285
|
"fast-check": "^4.9.0",
|
|
266
286
|
"oxc-parser": "^0.138.0",
|
|
267
287
|
"oxfmt": "^0.42.0",
|
|
268
288
|
"oxlint": "^1.69.0",
|
|
289
|
+
"pngjs": "^7.0.0",
|
|
290
|
+
"publint": "^0.3.22",
|
|
269
291
|
"tsdown": "^0.22.4",
|
|
270
292
|
"typescript": "^7.0.2",
|
|
271
293
|
"vite": "^8.0.16",
|
package/server.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
-
"name": "io.github.
|
|
3
|
+
"name": "io.github.callstack/agent-device",
|
|
4
4
|
"title": "agent-device",
|
|
5
5
|
"description": "Let AI agents inspect, control, and debug real iOS, Android, desktop, and TV apps",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/callstack/agent-device",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.20.
|
|
10
|
+
"version": "0.20.7",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "agent-device",
|
|
15
|
-
"version": "0.20.
|
|
15
|
+
"version": "0.20.7",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
|
@@ -5,41 +5,16 @@ description: Automates Apple-platform apps (iOS, tvOS, macOS), Android devices,
|
|
|
5
5
|
|
|
6
6
|
# agent-device
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
For a normal app-driving task, start immediately. Do not probe first with `--help`, `--version`, `devices`, `appstate`, `snapshot`, or `screenshot`:
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
agent-device --
|
|
11
|
+
agent-device open <app> --foreground
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
That starts the session and returns the initial interactive snapshot with `@refs`.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Loop: act with `press|click|fill|longpress <target> ... --settle`, `scroll <direction> --settle`, or `back --settle`; continue from the printed diff, verify the named expectation (`wait text "..."`, `is`, `get`, or `find`), then run `agent-device close`.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Copy refs byte-for-byte: `@e12`, `@e12~s4` — keep the `@` and any `~sN`. Prefer current refs, then `id`/`label`/`role` selectors; coordinates are a last resort. If snapshot reports sparse/AX-unavailable, its refs and selectors are invalid: run `agent-device screenshot`, inspect the image, use coordinates, then retry `snapshot -i` after navigating. Otherwise run `snapshot -i` only when the diff lacks the next target.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
agent-device help manual-qa # scripted/manual QA, acceptance checks, checklist execution
|
|
22
|
-
agent-device help validate # code/runtime validation, stale build or daemon risk
|
|
23
|
-
agent-device help dogfood # exploratory app dogfooding and evidence collection
|
|
24
|
-
agent-device help workflow # fallback reference for general app driving or mixed tasks
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Read additional topics only when relevant:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
agent-device help debugging
|
|
31
|
-
agent-device help react-native
|
|
32
|
-
agent-device help react-devtools
|
|
33
|
-
agent-device help cdp
|
|
34
|
-
agent-device help remote
|
|
35
|
-
agent-device help macos
|
|
36
|
-
agent-device help dogfood
|
|
37
|
-
agent-device help tv
|
|
38
|
-
agent-device help ios-system-ui # iOS SpringBoard, widgets, and system-UI surfaces
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Default loop: `open -> snapshot/-i -> get/is/find or press/fill/scroll/wait -> verify -> close`. When target-specific help says capture or selectors are unsupported, use its control-only loop and the device display as visual truth.
|
|
42
|
-
|
|
43
|
-
Use this skill only to route into version-matched CLI help. Let the selected help topic provide exact command shapes, platform limits, and current workflow guidance; use `help workflow` as the full reference when a task-specific topic is too narrow.
|
|
44
|
-
|
|
45
|
-
For precise location workflows, read the installed `settings` help before planning so coordinate support and platform limits come from the active CLI version.
|
|
20
|
+
Error output includes corrective hints; follow them instead of re-planning. Only when the task is specialized (for example gestures, scripting, TV, macOS, remote, or debugging) or a command shape is unclear, run `agent-device help <topic>`. `agent-device --help` lists topics, but is not a startup step.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1f5a95fcf0c6d668a11453644b2e897147932b528c1aa6c74883eaf9d73a5e7f agent-device-android-ime-helper-0.20.5.apk
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ce370af9f1c97e7c812cb93772f864596731c10f3d0b7cadc1c88b772a062970 agent-device-android-snapshot-helper-0.20.5.apk
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import AVFoundation
|
|
2
|
-
import Foundation
|
|
3
|
-
|
|
4
|
-
enum ResizeError: Error, CustomStringConvertible {
|
|
5
|
-
case invalidArgs(String)
|
|
6
|
-
case missingVideoTrack
|
|
7
|
-
case exportFailed(String)
|
|
8
|
-
|
|
9
|
-
var description: String {
|
|
10
|
-
switch self {
|
|
11
|
-
case .invalidArgs(let message):
|
|
12
|
-
return message
|
|
13
|
-
case .missingVideoTrack:
|
|
14
|
-
return "Input video does not contain a video track."
|
|
15
|
-
case .exportFailed(let message):
|
|
16
|
-
return message
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
do {
|
|
22
|
-
try run()
|
|
23
|
-
} catch {
|
|
24
|
-
fputs("recording-resize: \(error)\n", stderr)
|
|
25
|
-
exit(1)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
func run() throws {
|
|
29
|
-
let arguments = Array(CommandLine.arguments.dropFirst())
|
|
30
|
-
let parsedArgs = try parseArguments(arguments)
|
|
31
|
-
let inputURL = URL(fileURLWithPath: parsedArgs.inputPath)
|
|
32
|
-
let outputURL = URL(fileURLWithPath: parsedArgs.outputPath)
|
|
33
|
-
|
|
34
|
-
if FileManager.default.fileExists(atPath: outputURL.path) {
|
|
35
|
-
try FileManager.default.removeItem(at: outputURL)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let asset = AVURLAsset(url: inputURL)
|
|
39
|
-
guard let sourceVideoTrack = asset.tracks(withMediaType: .video).first else {
|
|
40
|
-
throw ResizeError.missingVideoTrack
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let sourceRenderSize = resolvedRenderSize(for: sourceVideoTrack)
|
|
44
|
-
if max(sourceRenderSize.width, sourceRenderSize.height) <= CGFloat(parsedArgs.maxSize) {
|
|
45
|
-
try FileManager.default.copyItem(at: inputURL, to: outputURL)
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let renderSize = scaledRenderSize(sourceRenderSize, maxSize: parsedArgs.maxSize)
|
|
50
|
-
let composition = AVMutableComposition()
|
|
51
|
-
let fullRange = CMTimeRange(start: .zero, duration: asset.duration)
|
|
52
|
-
|
|
53
|
-
guard let compositionVideoTrack = composition.addMutableTrack(
|
|
54
|
-
withMediaType: .video,
|
|
55
|
-
preferredTrackID: kCMPersistentTrackID_Invalid
|
|
56
|
-
) else {
|
|
57
|
-
throw ResizeError.exportFailed("Failed to create composition video track.")
|
|
58
|
-
}
|
|
59
|
-
try compositionVideoTrack.insertTimeRange(fullRange, of: sourceVideoTrack, at: .zero)
|
|
60
|
-
|
|
61
|
-
if let sourceAudioTrack = asset.tracks(withMediaType: .audio).first,
|
|
62
|
-
let compositionAudioTrack = composition.addMutableTrack(
|
|
63
|
-
withMediaType: .audio,
|
|
64
|
-
preferredTrackID: kCMPersistentTrackID_Invalid
|
|
65
|
-
) {
|
|
66
|
-
try? compositionAudioTrack.insertTimeRange(fullRange, of: sourceAudioTrack, at: .zero)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let scale = renderSize.width / sourceRenderSize.width
|
|
70
|
-
let videoComposition = AVMutableVideoComposition()
|
|
71
|
-
videoComposition.renderSize = renderSize
|
|
72
|
-
videoComposition.frameDuration = resolvedFrameDuration(for: sourceVideoTrack)
|
|
73
|
-
|
|
74
|
-
let instruction = AVMutableVideoCompositionInstruction()
|
|
75
|
-
instruction.timeRange = fullRange
|
|
76
|
-
let layerInstruction = AVMutableVideoCompositionLayerInstruction(assetTrack: compositionVideoTrack)
|
|
77
|
-
// Scale the full preferred transform (including translation) to match the smaller render canvas.
|
|
78
|
-
let scaledTransform = scaledPreferredTransform(sourceVideoTrack.preferredTransform, scale: scale)
|
|
79
|
-
layerInstruction.setTransform(scaledTransform, at: .zero)
|
|
80
|
-
instruction.layerInstructions = [layerInstruction]
|
|
81
|
-
videoComposition.instructions = [instruction]
|
|
82
|
-
|
|
83
|
-
let presetName = exportPresetName(for: parsedArgs.exportQuality, compatibleWith: composition)
|
|
84
|
-
guard let exporter = AVAssetExportSession(asset: composition, presetName: presetName) else {
|
|
85
|
-
throw ResizeError.exportFailed("Failed to create export session.")
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
exporter.outputURL = outputURL
|
|
89
|
-
exporter.outputFileType = .mp4
|
|
90
|
-
exporter.videoComposition = videoComposition
|
|
91
|
-
exporter.shouldOptimizeForNetworkUse = true
|
|
92
|
-
|
|
93
|
-
let semaphore = DispatchSemaphore(value: 0)
|
|
94
|
-
exporter.exportAsynchronously {
|
|
95
|
-
semaphore.signal()
|
|
96
|
-
}
|
|
97
|
-
if semaphore.wait(timeout: .now() + 120) == .timedOut {
|
|
98
|
-
exporter.cancelExport()
|
|
99
|
-
throw ResizeError.exportFailed("Resize export timed out.")
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if exporter.status != .completed {
|
|
103
|
-
throw ResizeError.exportFailed(exporter.error?.localizedDescription ?? "Resize export failed.")
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
enum ExportQuality: String {
|
|
108
|
-
case medium
|
|
109
|
-
case high
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
func parseArguments(
|
|
113
|
-
_ arguments: [String]
|
|
114
|
-
) throws -> (inputPath: String, outputPath: String, maxSize: Int, exportQuality: ExportQuality) {
|
|
115
|
-
var inputPath: String?
|
|
116
|
-
var outputPath: String?
|
|
117
|
-
var maxSize: Int?
|
|
118
|
-
// Export quality defaults to medium so re-encoded recordings stay fast by default.
|
|
119
|
-
// Pass --quality high to opt into a slower highest-quality export.
|
|
120
|
-
var exportQuality: ExportQuality = .medium
|
|
121
|
-
var index = 0
|
|
122
|
-
|
|
123
|
-
while index < arguments.count {
|
|
124
|
-
let argument = arguments[index]
|
|
125
|
-
let nextIndex = index + 1
|
|
126
|
-
switch argument {
|
|
127
|
-
case "--input":
|
|
128
|
-
guard nextIndex < arguments.count else { throw ResizeError.invalidArgs("--input requires a value") }
|
|
129
|
-
inputPath = arguments[nextIndex]
|
|
130
|
-
index += 2
|
|
131
|
-
case "--output":
|
|
132
|
-
guard nextIndex < arguments.count else { throw ResizeError.invalidArgs("--output requires a value") }
|
|
133
|
-
outputPath = arguments[nextIndex]
|
|
134
|
-
index += 2
|
|
135
|
-
case "--max-size":
|
|
136
|
-
guard nextIndex < arguments.count else { throw ResizeError.invalidArgs("--max-size requires a value") }
|
|
137
|
-
guard let parsed = Int(arguments[nextIndex]), parsed >= 1 else {
|
|
138
|
-
throw ResizeError.invalidArgs("--max-size must be a positive integer")
|
|
139
|
-
}
|
|
140
|
-
maxSize = parsed
|
|
141
|
-
index += 2
|
|
142
|
-
case "--quality":
|
|
143
|
-
guard nextIndex < arguments.count else {
|
|
144
|
-
throw ResizeError.invalidArgs("--quality requires a value")
|
|
145
|
-
}
|
|
146
|
-
guard let parsed = ExportQuality(rawValue: arguments[nextIndex]) else {
|
|
147
|
-
throw ResizeError.invalidArgs("--quality must be one of: medium, high")
|
|
148
|
-
}
|
|
149
|
-
exportQuality = parsed
|
|
150
|
-
index += 2
|
|
151
|
-
default:
|
|
152
|
-
throw ResizeError.invalidArgs("Unknown argument: \(argument)")
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
guard let inputPath, let outputPath, let maxSize else {
|
|
157
|
-
throw ResizeError.invalidArgs(
|
|
158
|
-
"Usage: recording-resize.swift --input <video> --output <video> --max-size <px> [--quality <medium|high>]"
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
return (inputPath, outputPath, maxSize, exportQuality)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
func exportPresetName(
|
|
165
|
-
for exportQuality: ExportQuality,
|
|
166
|
-
compatibleWith asset: AVAsset
|
|
167
|
-
) -> String {
|
|
168
|
-
switch exportQuality {
|
|
169
|
-
case .high:
|
|
170
|
-
return AVAssetExportPresetHighestQuality
|
|
171
|
-
case .medium:
|
|
172
|
-
// Mirror the touch-overlay export: prefer the faster medium preset, falling back to
|
|
173
|
-
// highest quality only when medium is not available for this composition.
|
|
174
|
-
let compatible = AVAssetExportSession.exportPresets(compatibleWith: asset)
|
|
175
|
-
return compatible.contains(AVAssetExportPresetMediumQuality)
|
|
176
|
-
? AVAssetExportPresetMediumQuality
|
|
177
|
-
: AVAssetExportPresetHighestQuality
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
func resolvedRenderSize(for track: AVAssetTrack) -> CGSize {
|
|
182
|
-
let transformed = track.naturalSize.applying(track.preferredTransform)
|
|
183
|
-
return CGSize(width: abs(transformed.width), height: abs(transformed.height))
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
func scaledRenderSize(_ renderSize: CGSize, maxSize: Int) -> CGSize {
|
|
187
|
-
let longest = max(renderSize.width, renderSize.height)
|
|
188
|
-
guard longest > CGFloat(maxSize) else { return renderSize }
|
|
189
|
-
let scale = CGFloat(maxSize) / longest
|
|
190
|
-
return CGSize(
|
|
191
|
-
width: scaledDimension(renderSize.width, scale: scale),
|
|
192
|
-
height: scaledDimension(renderSize.height, scale: scale)
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
func scaledDimension(_ value: CGFloat, scale: CGFloat) -> CGFloat {
|
|
197
|
-
let evenValue = Int((Double(value * scale) / 2.0).rounded()) * 2
|
|
198
|
-
return CGFloat(max(2, evenValue))
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
func resolvedFrameDuration(for track: AVAssetTrack) -> CMTime {
|
|
202
|
-
let minFrameDuration = track.minFrameDuration
|
|
203
|
-
if minFrameDuration.isValid && !minFrameDuration.isIndefinite && minFrameDuration.seconds > 0 {
|
|
204
|
-
return minFrameDuration
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
let nominalFrameRate = track.nominalFrameRate
|
|
208
|
-
if nominalFrameRate > 0 {
|
|
209
|
-
let timescale = Int32(max(1, round(nominalFrameRate)))
|
|
210
|
-
return CMTime(value: 1, timescale: timescale)
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return CMTime(value: 1, timescale: 60)
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
func scaledPreferredTransform(_ transform: CGAffineTransform, scale: CGFloat) -> CGAffineTransform {
|
|
217
|
-
CGAffineTransform(
|
|
218
|
-
a: transform.a * scale,
|
|
219
|
-
b: transform.b * scale,
|
|
220
|
-
c: transform.c * scale,
|
|
221
|
-
d: transform.d * scale,
|
|
222
|
-
tx: transform.tx * scale,
|
|
223
|
-
ty: transform.ty * scale
|
|
224
|
-
)
|
|
225
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e}from"./internal/daemon.js";export{e as withAppLogProvider};
|
package/dist/src/devices.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:os";function t(){return{platform:`apple`,id:`host-macos-local`,name:e.hostname(),kind:`device`,target:`desktop`,appleOs:`macos`,booted:!0}}async function n(){return[t()]}export{t as buildHostMacDevice,n as listMacosDevices};
|
package/dist/src/devices2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./sdk-contracts.js";import{b as t,s as n}from"./sdk-device.js";import{o as r}from"./boot-diagnostics.js";import{a as i,r as a}from"./tool-provider.js";import{I as o}from"./physical-device-control.js";import{r as s}from"./simulator.js";import{buildHostMacDevice as c}from"./devices.js";import l from"node:path";import{promises as u}from"node:fs";import d from"node:os";const f=/^(iphone|ipad|ipod|appletv|realitydevice)/i,p=/ipad/i,m=/\b(apple vision|vision pro|xros|visionos|realitydevice)\b/i,h=/\b(iphone|ipad|ipod)\b/i,g=/^appletv/i,_=[`apple tv`,`appletv`,`tvos`],v=/^==\s*(.+?)\s*==$/,y=/^(?<name>.+?)\s+(?:\[(?<idBracket>[^[\]]+)\]|\((?<osVersion>[^)]+)\)\s+\((?<idParen>[^)]+)\))\s*$/;function b(e){return(e??``).trim().toLowerCase()}function x(e){return b(e)}function S(e){return b(e.hardwareProperties?.platform)}function C(e){return e.includes(`tvos`)}function w(e){return e.includes(`xros`)||e.includes(`visionos`)}function T(e){return C(x(e))?`tv`:`mobile`}function E(e){let t=x(e);return t.includes(`ios`)||t.includes(`tvos`)||t.includes(`xros`)||t.includes(`visionos`)}function D(e){let t=b(e);return _.some(e=>t.includes(e))}function O(e){return h.test(e.trim())}function k(e){return D(e)?`tv`:O(e)||m.test(e)?`mobile`:null}function A(e,t){return e===`tv`?`tvos`:t.some(e=>m.test(e))?`visionos`:t.some(e=>p.test(e))?`ipados`:`ios`}function j(e){return f.test(e.trim())}function M(e){return g.test(e.trim())}function N(e){return[e.name??``,e.deviceProperties?.name??``,e.deviceProperties?.deviceType??``]}function P(e){return e.hardwareProperties?.productType??e.deviceProperties?.productType??``}function F(e){return C(S(e))||M(P(e))||N(e).some(D)?`tv`:`mobile`}function I(e){let t=S(e);return t.includes(`ios`)||t.includes(`tvos`)||w(t)||j(P(e))?!0:N(e).some(D)}async function L(e={}){let n=r(e.simulatorSetPath),a=e.target,s;try{s=await i(o([`list`,`devices`,`-j`],{simulatorSetPath:n}))}catch{return null}let c;try{c=JSON.parse(s.stdout)}catch{return null}return t(R(c,n)).find(e=>!a||e.target===a)??null}function R(e,t){let n=[];for(let[r,i]of Object.entries(e.devices))if(E(r))for(let e of i){if(!e.isAvailable)continue;let i=T(r),a={platform:`apple`,id:e.udid,name:e.name,kind:`simulator`,target:i,appleOs:A(i,[e.deviceTypeIdentifier??``,e.name]),booted:e.state===`Booted`,...t?{simulatorSetPath:t}:{}};a.booted&&s(a),n.push(a)}return n}function z(e){let t=[];for(let n of e.result?.devices??[]){if(!I(n))continue;let e=n.hardwareProperties?.udid??n.identifier??``,r=n.name??n.deviceProperties?.name??e;if(!e)continue;let i=F(n);t.push({platform:`apple`,id:e,name:r,kind:`device`,target:i,appleOs:A(i,[P(n),...N(n)]),iosPhysicalDeviceBackend:`coredevice`,booted:!0})}return t}function B(e){let t=y.exec(e);if(!t?.groups)return null;let n=t.groups.name?.trim()??``,r=t.groups.idBracket?.trim()??t.groups.idParen?.trim()??``,i=t.groups.osVersion?.trim();return!n||!r?null:{name:n,id:r,osVersion:i}}function V(e,t,n){let r=k(e);return r?{platform:`apple`,id:t,name:e,kind:`device`,target:r,appleOs:A(r,n?[e,n]:[e]),iosPhysicalDeviceBackend:`xctest`,booted:!0}:null}function H(e){let t=[],n=null;for(let r of e.split(/\r?\n/)){let e=r.trim();if(!e)continue;let i=v.exec(e);if(i){n=i[1]?.trim()??null;continue}if(n!==`Devices`)continue;let a=B(e);if(!a)continue;let o=V(a.name,a.id,a.osVersion);o&&t.push(o)}return t}function U(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r}async function W(){let e=null;try{if(e=l.join(d.tmpdir(),`agent-device-devicectl-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2)}.json`),(await i([`devicectl`,`list`,`devices`,`--json-output`,e],{allowFailure:!0,timeoutMs:8e3})).exitCode!==0)return[];let t=await u.readFile(e,`utf8`);return z(JSON.parse(t))}catch{return[]}finally{e&&await u.rm(e,{force:!0}).catch(()=>{})}}async function G(){try{let e=await i([`xctrace`,`list`,`devices`],{allowFailure:!0});return e.exitCode===0?H(e.stdout):[]}catch{return[]}}async function K(s={}){if(process.platform!==`darwin`)throw new e(`UNSUPPORTED_PLATFORM`,`Apple tools are only available on macOS`);if(!await a().whichCommand(`xcrun`))throw new e(`TOOL_MISSING`,`xcrun not found in PATH`);let l=r(s.simulatorSetPath),u=await i(o([`list`,`devices`,`-j`],{simulatorSetPath:l})),d=[];try{d=R(JSON.parse(u.stdout),l)}catch(t){throw new e(`COMMAND_FAILED`,`Failed to parse simctl devices JSON`,void 0,t)}if(d.push(c()),s.udid&&d.some(e=>n(e)&&e.id===s.udid))return d;if(l)return t(d);let[f,p]=await Promise.all([W(),G()]);return d=U(d,f),t(U(d,p))}export{L as findBootableIosSimulator,K as listAppleDevices};
|
package/dist/src/devices3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hostname as e}from"node:os";async function t(){return process.platform===`linux`?[{platform:`linux`,id:`local`,name:e(),kind:`device`,target:`desktop`,booted:!0}]:[]}export{t as listLinuxDevices};
|
package/dist/src/devices4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./sdk-contracts.js";import{h as t}from"./sdk-android-adb.js";import{t as n}from"./tool-provider3.js";const r=`VirtualDevice`;async function i(){let r=n();if(!await r.isAvailable())throw new e(`TOOL_MISSING`,`Vega CLI not found in PATH`,{hint:`Install Vega Developer Tools, source ~/vega/env, and retry devices.`});let i=t(await r.listDevices({allowFailure:!0,timeoutMs:1e4}),`Failed to list Vega devices`),o=a(i.stdout),c=s(i.stdout);if(o.length===0&&c.length>0)throw new e(`DEVICE_NOT_FOUND`,`Vega CLI found devices, but no supported Vega Virtual Device is running.`,{listedSerials:c,hint:`Start the Vega Virtual Device, then retry with --platform vega --target tv.`});return o}function a(e){return s(e).some(o)?[{platform:`vega`,id:r,name:`Vega Virtual Device (${r})`,kind:`emulator`,target:`tv`,booted:!0}]:[]}function o(e){return e.toLowerCase()===`virtualdevice`}function s(e){let t=new Set;for(let n of e.split(/\r?\n/)){let e=/^\s*([^\s:]+)\s*:\s*\S/.exec(n)?.[1]?.trim();e&&t.add(e)}return[...t]}export{i as listVegaDevices,a as parseVegaDeviceList};
|