agent-device 0.21.22 → 0.21.24
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 +6 -6
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.22.apk → agent-device-android-ime-helper-0.21.24.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.24.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.22.manifest.json → agent-device-android-ime-helper-0.21.24.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.22.manifest.json → agent-device-android-snapshot-helper-0.21.24.manifest.json} +6 -6
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +12 -6
- package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/RectResponseTests.swift +21 -0
- package/apple/snapshot-bridge/README.md +9 -7
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +56 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +14 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +8 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +12 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +29 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +34 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +19 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +3 -3
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb.js +1 -1
- package/dist/src/agent-browser-lifecycle.js +1 -1
- package/dist/src/agent-browser-process-record.js +1 -1
- package/dist/src/agent-browser-provider.js +1 -1
- package/dist/src/agent-device-client.js +2 -2
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/alert.js +1 -1
- package/dist/src/android-adb.d.ts +3 -2
- package/dist/src/android-input-ownership.js +1 -1
- package/dist/src/app-backend.js +1 -1
- package/dist/src/app-inventory.d.ts +4 -0
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +1 -1
- package/dist/src/app-log-reconnect.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/app-state-runtime.d.ts +15 -0
- package/dist/src/apple-runner-platform.js +1 -1
- package/dist/src/application-lifecycle-interaction.js +1 -1
- package/dist/src/aws-device-farm-connection.js +1 -0
- package/dist/src/back-mode.js +1 -1
- package/dist/src/backend-snapshot-options.js +1 -1
- package/dist/src/browserstack-connection.js +1 -0
- package/dist/src/browserstack-device-features.js +1 -0
- package/dist/src/browserstack.js +1 -0
- package/dist/src/cache.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +35 -19
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +3 -4
- package/dist/src/client-companion-tunnel.js +1 -0
- package/dist/src/client-metro-companion.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-options.js +3 -3
- package/dist/src/client-types.d.ts +7 -5
- package/dist/src/cloud-artifacts.d.ts +9 -2
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/command-metadata.js +1 -1
- package/dist/src/command-schema.js +1 -1
- package/dist/src/command-tools.js +2 -2
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection-verification.js +1 -0
- package/dist/src/connection.js +5 -5
- package/dist/src/contracts.d.ts +1 -1
- package/dist/src/daemon-client-lease-beat.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon-client-transport.js +1 -1
- package/dist/src/daemon-http.js +1 -1
- package/dist/src/daemon-policy-file.js +1 -1
- package/dist/src/daemon-registration-owner.js +1 -1
- package/dist/src/device-claim-inspection.js +1 -1
- package/dist/src/device-input-state.d.ts +2 -15
- package/dist/src/device-readiness-runtime.js +1 -1
- package/dist/src/device-selection-resolver.js +1 -1
- package/dist/src/device-session.js +3 -1
- package/dist/src/device.js +1 -1
- package/dist/src/device2.js +1 -1
- package/dist/src/device3.js +1 -1
- package/dist/src/dispatch-resolve.js +3 -3
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -1
- package/dist/src/durable-resource.js +1 -1
- package/dist/src/exec.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/format.js +2 -1
- package/dist/src/gesture-admission.js +1 -1
- package/dist/src/gesture-plan-types.d.ts +2 -5
- package/dist/src/gesture-runtime.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/human-control.js +1 -1
- package/dist/src/ime-rebind.js +1 -0
- package/dist/src/ime-settings-record.js +1 -0
- package/dist/src/ime-state.js +1 -0
- package/dist/src/index.d.ts +3 -3
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/instance-client.js +1 -1
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction-ref-policy.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor.js +5 -5
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +1 -1
- package/dist/src/inventory2.js +1 -1
- package/dist/src/ios-client.js +4 -4
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/launch-confirmation.js +1 -1
- package/dist/src/lease-scope.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun.d.ts +4 -555
- package/dist/src/load.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/log-stream.js +33 -0
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/manifest.js +1 -0
- package/dist/src/mechanics.js +16 -16
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/node-http.js +1 -0
- package/dist/src/observation.js +1 -2
- package/dist/src/overlay.js +3 -3
- package/dist/src/owner-identity.js +3 -3
- package/dist/src/perf-facade.js +1 -1
- package/dist/src/perf-runtime-plan.js +1 -1
- package/dist/src/perf-target.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-request-scope.js +1 -1
- package/dist/src/platform-runtime-app-log-process.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +4 -4
- package/dist/src/platform-runtime-runtime-hints.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
- package/dist/src/platform-runtime-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/plugin.js +1 -0
- package/dist/src/plugins/webdriver.d.ts +111 -0
- package/dist/src/plugins/webdriver.js +1 -0
- package/dist/src/plugins.d.ts +2 -1
- package/dist/src/plugins2.js +1 -1
- package/dist/src/process-exit.js +1 -1
- package/dist/src/process.js +1 -1
- package/dist/src/provider-credential-fingerprint.js +1 -1
- package/dist/src/provider-device-admission.js +1 -1
- package/dist/src/provider-device-runtime.d.ts +556 -0
- package/dist/src/provider-policy.js +1 -0
- package/dist/src/provider-profile-fields.js +1 -1
- package/dist/src/provider-webdriver.js +1 -2
- package/dist/src/providers.js +1 -1
- package/dist/src/proxy.js +2 -2
- package/dist/src/react-devtools.js +2 -0
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/recording.js +1 -1
- package/dist/src/registry.js +24 -24
- package/dist/src/remote-bridge.js +1 -0
- package/dist/src/remote-config-core.js +1 -0
- package/dist/src/remote-config.js +1 -1
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/remote-connection-state.js +1 -0
- package/dist/src/replay.js +2 -2
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/retry2.js +1 -0
- package/dist/src/runner-artifact-manifest.js +1 -1
- package/dist/src/runner-cache-metadata.js +2 -3
- package/dist/src/runner-cache-retention.js +1 -0
- package/dist/src/runner-cache-trim.js +1 -0
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-dev-tools-security.js +1 -1
- package/dist/src/runner-device-readiness.js +1 -1
- package/dist/src/runner-device-set.js +1 -0
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-error-classification.js +1 -1
- package/dist/src/runner-exchange.js +1 -1
- package/dist/src/runner-lease.js +1 -0
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-session-types.js +1 -1
- package/dist/src/runner-start-budget.js +1 -1
- package/dist/src/runner-toolchain-probe.js +2 -0
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime-deployment.js +1 -0
- package/dist/src/runtime.js +1 -1
- package/dist/src/runtime10.js +1 -2
- package/dist/src/runtime11.js +2 -0
- package/dist/src/runtime2.js +2 -5
- package/dist/src/runtime3.js +5 -1
- package/dist/src/runtime4.js +1 -5
- package/dist/src/runtime5.js +5 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +1 -1
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +1 -1
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-overlay-draw.js +1 -1
- package/dist/src/screenshot3.js +2 -2
- package/dist/src/script.js +1 -1
- package/dist/src/scroll-gesture.js +1 -1
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +25 -33
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.d.ts +1 -1
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-remote-config.d.ts +4 -0
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +1 -1
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-pipeline-policy.js +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/server.js +2 -2
- package/dist/src/session-snapshot.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-boot.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-capture-annotations.js +1 -1
- package/dist/src/snapshot-desktop-projection.js +1 -1
- package/dist/src/snapshot-private-evidence.js +1 -0
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-state.js +1 -1
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/src2.js +1 -1
- package/dist/src/src3.js +1 -1
- package/dist/src/src4.js +1 -1
- package/dist/src/src5.js +1 -1
- package/dist/src/src6.js +1 -1
- package/dist/src/src7.js +1 -1
- package/dist/src/src8.js +20 -20
- package/dist/src/store.js +1 -1
- package/dist/src/target-evidence.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/touch-runtime2.js +1 -1
- package/dist/src/tree.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/video.js +1 -1
- package/package.json +24 -16
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.22.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.22.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.22.apk.sha256 +0 -1
- package/dist/src/capabilities.js +0 -1
- package/dist/src/compatibility-policy.js +0 -1
- package/dist/src/daemon-artifacts.js +0 -1
- package/dist/src/device-claim-rule.js +0 -1
- package/dist/src/human-control-contract.js +0 -1
- package/dist/src/prepare-kind.js +0 -1
- package/dist/src/provider-device-runtimes.js +0 -1
- package/dist/src/screen-recording-admission-ledger.js +0 -1
- package/dist/src/screenshot-runtime.js +0 -1
- package/dist/src/session-routing.js +0 -1
- package/dist/src/session-runtime-admission.js +0 -1
- package/dist/src/session-stream.js +0 -27
- package/dist/src/timeouts.js +0 -1
- package/dist/src/touch-reference-frame.js +0 -1
- package/dist/src/vars.js +0 -2
- package/dist/src/viewport.js +0 -1
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { A as RawSnapshotNode, I as SnapshotOptions$1, L as SnapshotProvenance, O as IosTargetActivation, P as SnapshotKeyboardBandFact, S as DeviceTarget, b as DeviceInfo, f as LeaseBackend, j as Rect, k as Point, w as PlatformSelector, x as DeviceKind } from "./sdk-contracts.js";
|
|
2
|
+
import { t as AppStateRuntimeResult } from "./app-state-runtime.js";
|
|
3
|
+
import { D as DeviceRotation, S as ScrollDirection, _ as SettingOptions, g as ReadableSetting, h as ReadSettingResult, j as BackMode, n as CloudArtifactProvider, o as BackendSnapshotResult, u as SessionSurface, x as ScrollExecutionOptions, y as TvRemoteButton } from "./cloud-artifacts.js";
|
|
4
|
+
import { t as GesturePlan } from "./gesture-plan-types.js";
|
|
5
|
+
//#region packages/contracts/src/device-inventory.d.ts
|
|
6
|
+
type DeviceInventoryRequest = {
|
|
7
|
+
platform?: PlatformSelector;
|
|
8
|
+
target?: DeviceTarget;
|
|
9
|
+
deviceName?: string;
|
|
10
|
+
udid?: string;
|
|
11
|
+
serial?: string;
|
|
12
|
+
leaseId?: string;
|
|
13
|
+
leaseProvider?: string;
|
|
14
|
+
deviceKey?: string;
|
|
15
|
+
clientId?: string;
|
|
16
|
+
iosSimulatorSetPath?: string;
|
|
17
|
+
androidSerialAllowlist?: string[];
|
|
18
|
+
/** Internal local-inventory projection filters; not public command grammar. */
|
|
19
|
+
kind?: DeviceKind;
|
|
20
|
+
booted?: boolean;
|
|
21
|
+
/** Internal target-resolution policy; ordinary inventory leaves this absent and lists all AVDs. */
|
|
22
|
+
androidAvdSelection?: 'running-only' | 'include-stopped';
|
|
23
|
+
};
|
|
24
|
+
type ProviderDeviceInventoryRequest = Omit<DeviceInventoryRequest, 'booted' | 'kind'>;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region packages/contracts/src/ios-system-surface.d.ts
|
|
27
|
+
/**
|
|
28
|
+
* iOS out-of-process system surfaces that agent-device observes and drives IN PLACE, never by
|
|
29
|
+
* activation: launching or activating the host cancels what it presents (issue #2438), so the
|
|
30
|
+
* runner addresses the host process while it is foreground and the `open` path refuses it. The set
|
|
31
|
+
* is deliberately closed and tiny; add a host only with live evidence that it presents out of
|
|
32
|
+
* process and dies on activation. Rationale per host lives in the canonical fixture
|
|
33
|
+
* `contracts/fixtures/ios-system-surface-hosts.json` (see also docs/adr/0004); this module and the
|
|
34
|
+
* Swift `SystemSurfaceHostRegistry` both mirror it, each guarded by a parity test.
|
|
35
|
+
*/
|
|
36
|
+
/** Why a system surface is served in place; carried at snapshot-response level as provenance. */
|
|
37
|
+
type IosSystemSurfaceKind = 'web-auth' | 'payment';
|
|
38
|
+
/**
|
|
39
|
+
* Whole-snapshot provenance: the capture describes a system surface presented over the session app,
|
|
40
|
+
* not the app itself. Carried at response level (it applies to the entire snapshot) and folded into
|
|
41
|
+
* iOS snapshot lineage so `--verify`/`--settle` never compare an app baseline against a sheet
|
|
42
|
+
* capture. Mirrors the Android system-chrome/system-surface provenance model.
|
|
43
|
+
*/
|
|
44
|
+
type IosSystemSurfaceProvenance = Readonly<{
|
|
45
|
+
bundleId: string;
|
|
46
|
+
kind: IosSystemSurfaceKind;
|
|
47
|
+
}>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region packages/contracts/src/runner-lease-context.d.ts
|
|
50
|
+
type RunnerLogicalLeaseContext = {
|
|
51
|
+
leaseId?: string;
|
|
52
|
+
clientId?: string;
|
|
53
|
+
tenantId?: string;
|
|
54
|
+
runId?: string;
|
|
55
|
+
leaseProvider?: string;
|
|
56
|
+
deviceKey?: string;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region packages/contracts/src/ios-snapshot.d.ts
|
|
60
|
+
type IosSnapshotProducer = 'apple-runner' | 'simulator-ax-bridge' | 'appium-source' | 'limrun-ios-tree';
|
|
61
|
+
type IosAcquisitionProducer = Exclude<IosSnapshotProducer, 'apple-runner'>;
|
|
62
|
+
type IosAcquisitionIntent = 'full' | 'surface-observation';
|
|
63
|
+
type IosSnapshotProjection = 'regular' | 'raw';
|
|
64
|
+
type IosSnapshotGeneration = string;
|
|
65
|
+
type IosSnapshotLineage = Readonly<{
|
|
66
|
+
targetId?: string;
|
|
67
|
+
generation?: IosSnapshotGeneration;
|
|
68
|
+
}>;
|
|
69
|
+
type IosSnapshotPresentationKey = Readonly<{
|
|
70
|
+
projection: IosSnapshotProjection;
|
|
71
|
+
interactiveOnly: boolean;
|
|
72
|
+
depth: number | null;
|
|
73
|
+
scope: string | null;
|
|
74
|
+
customActions: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
type CaptureHint = Readonly<{
|
|
77
|
+
projection: IosSnapshotProjection;
|
|
78
|
+
rawTraversalDepth: number | null;
|
|
79
|
+
regularPresentedDepth: number | null;
|
|
80
|
+
interactiveOnly: boolean;
|
|
81
|
+
customActions: boolean;
|
|
82
|
+
acquisitionIntent: IosAcquisitionIntent;
|
|
83
|
+
}>;
|
|
84
|
+
type IosSnapshotFact = 'acquisition-depth' | 'scope' | 'interactive-query' | 'viewport' | 'hittability' | 'generation' | 'truncation';
|
|
85
|
+
type IosViewportEvidence = Readonly<{
|
|
86
|
+
kind: 'reported';
|
|
87
|
+
rect: Rect;
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
kind: 'derived';
|
|
90
|
+
rect: Rect;
|
|
91
|
+
}> | Readonly<{
|
|
92
|
+
kind: 'missing';
|
|
93
|
+
reason: 'not-provided' | 'not-supported' | 'invalid';
|
|
94
|
+
}>;
|
|
95
|
+
type IosProviderPrunedField = 'nodes' | 'depth' | 'scope' | 'interactive-only';
|
|
96
|
+
type IosAcquisitionResidue = Readonly<{
|
|
97
|
+
kind: 'provider-pruned';
|
|
98
|
+
fields: readonly IosProviderPrunedField[];
|
|
99
|
+
}> | Readonly<{
|
|
100
|
+
kind: 'missing-viewport';
|
|
101
|
+
reason: 'not-provided' | 'not-supported' | 'invalid';
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
kind: 'truncated';
|
|
104
|
+
}> | Readonly<{
|
|
105
|
+
kind: 'stale-generation';
|
|
106
|
+
expected?: IosSnapshotGeneration;
|
|
107
|
+
observed?: IosSnapshotGeneration;
|
|
108
|
+
}> | Readonly<{
|
|
109
|
+
kind: 'unknown-generation';
|
|
110
|
+
captureId: string;
|
|
111
|
+
}> | Readonly<{
|
|
112
|
+
kind: 'unavailable-fact';
|
|
113
|
+
fact: IosSnapshotFact;
|
|
114
|
+
}> | Readonly<{
|
|
115
|
+
kind: 'fallback-source';
|
|
116
|
+
producer: IosSnapshotProducer;
|
|
117
|
+
}>;
|
|
118
|
+
type IosSnapshotAcquisitionForIntent<Intent extends IosAcquisitionIntent> = Readonly<{
|
|
119
|
+
producer: IosAcquisitionProducer;
|
|
120
|
+
intent: Intent;
|
|
121
|
+
hint: CaptureHint & Readonly<{
|
|
122
|
+
acquisitionIntent: Intent;
|
|
123
|
+
}>;
|
|
124
|
+
nodes: readonly RawSnapshotNode[];
|
|
125
|
+
truncated?: boolean;
|
|
126
|
+
viewport: IosViewportEvidence;
|
|
127
|
+
lineage: IosSnapshotLineage;
|
|
128
|
+
residue: readonly IosAcquisitionResidue[];
|
|
129
|
+
}>;
|
|
130
|
+
type IosSnapshotAcquisition = IosSnapshotAcquisitionForIntent<'full'> | IosSnapshotAcquisitionForIntent<'surface-observation'>;
|
|
131
|
+
type IosSnapshotAcquisitionFacts = Omit<IosSnapshotAcquisition, 'hint'>;
|
|
132
|
+
type IosSnapshotComparisonIdentity = Readonly<{
|
|
133
|
+
producer: IosSnapshotProducer;
|
|
134
|
+
intent: IosAcquisitionIntent;
|
|
135
|
+
lineage: IosSnapshotLineage;
|
|
136
|
+
presentationKey: IosSnapshotPresentationKey;
|
|
137
|
+
residue: readonly IosAcquisitionResidue[];
|
|
138
|
+
}>;
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region packages/contracts/src/interactor-types.d.ts
|
|
141
|
+
type RunnerContext = {
|
|
142
|
+
requestId?: string;
|
|
143
|
+
signal?: AbortSignal;
|
|
144
|
+
appBundleId?: string;
|
|
145
|
+
verbose?: boolean;
|
|
146
|
+
logPath?: string;
|
|
147
|
+
traceLogPath?: string;
|
|
148
|
+
iosXctestrunFile?: string;
|
|
149
|
+
iosXctestDerivedDataPath?: string;
|
|
150
|
+
iosXctestEnvDir?: string;
|
|
151
|
+
runnerLeaseContext?: RunnerLogicalLeaseContext;
|
|
152
|
+
};
|
|
153
|
+
type ScreenshotOptions = {
|
|
154
|
+
appBundleId?: string;
|
|
155
|
+
pixelDensity?: number;
|
|
156
|
+
fullscreen?: boolean;
|
|
157
|
+
normalizeStatusBar?: boolean;
|
|
158
|
+
stabilize?: boolean;
|
|
159
|
+
surface?: SessionSurface;
|
|
160
|
+
skipIosSimulatorBootCheck?: boolean;
|
|
161
|
+
captureBackend?: 'runner';
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* What the capture owner observed while writing the image. `displayRotation` is the rotation the display
|
|
165
|
+
* rendered the pixels in, so a landscape value pairs with a landscape image; it is absent when the
|
|
166
|
+
* owner has no rotation reading it can stand behind for this capture.
|
|
167
|
+
*/
|
|
168
|
+
type ScreenshotCaptureFacts = Readonly<{
|
|
169
|
+
displayRotation?: DeviceRotation;
|
|
170
|
+
}>;
|
|
171
|
+
type ElementSelectorKey = 'id' | 'label' | 'text' | 'value';
|
|
172
|
+
type ElementSelectorTapOptions = {
|
|
173
|
+
key: ElementSelectorKey;
|
|
174
|
+
value: string;
|
|
175
|
+
allowNonHittableCoordinateFallback?: boolean;
|
|
176
|
+
expectedPoint?: Point;
|
|
177
|
+
};
|
|
178
|
+
type PressPointOptions = Readonly<{
|
|
179
|
+
button: 'primary' | 'secondary' | 'middle';
|
|
180
|
+
count: number;
|
|
181
|
+
intervalMs: number;
|
|
182
|
+
holdMs: number;
|
|
183
|
+
jitterPx: number;
|
|
184
|
+
doubleTap: boolean;
|
|
185
|
+
surface?: SessionSurface;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* The channel the XCTest runner actually entered text through — the Swift
|
|
189
|
+
* `TextEntryResult.textEntryRoute` (RunnerTests+TextTyping.swift,
|
|
190
|
+
* RunnerTests+SynthesizedTextEntry.swift). Closed set, because the runner is
|
|
191
|
+
* its only producer and the boundary that narrows it
|
|
192
|
+
* (readTypeTextBackendResult, packages/platform-apple/src/interactions.ts) drops a
|
|
193
|
+
* route it cannot name — so a Swift-side addition would silently vanish. The
|
|
194
|
+
* route-parity test in packages/platform-apple/src/core/__tests__/interactions.test.ts
|
|
195
|
+
* reads the Swift sources and fails instead.
|
|
196
|
+
*/
|
|
197
|
+
declare const TEXT_ENTRY_ROUTES: readonly ['xctest-element', 'synthesized-first-responder', 'synthesized-first-responder-replacement', 'xctest-application-fallback'];
|
|
198
|
+
type TextEntryRoute = (typeof TEXT_ENTRY_ROUTES)[number];
|
|
199
|
+
/**
|
|
200
|
+
* What `Interactor.type` reports back about the entry it performed. Only the
|
|
201
|
+
* Apple runner populates it; every other platform types blind and returns void.
|
|
202
|
+
*/
|
|
203
|
+
type TypeTextBackendResult = {
|
|
204
|
+
textEntryRoute?: TextEntryRoute;
|
|
205
|
+
};
|
|
206
|
+
type SnapshotOptions = SnapshotOptions$1 & {
|
|
207
|
+
appBundleId?: string;
|
|
208
|
+
signal?: AbortSignal;
|
|
209
|
+
includeRects?: boolean;
|
|
210
|
+
includeHiddenContentHints?: boolean;
|
|
211
|
+
surface?: SessionSurface;
|
|
212
|
+
/** Internal capture purpose; action outcomes always require the full tree. */
|
|
213
|
+
acquisitionIntent?: 'full' | 'surface-observation';
|
|
214
|
+
/**
|
|
215
|
+
* A one-off read, such as an open's launch observation. It may use a capture host the session
|
|
216
|
+
* already keeps warm, but it never installs one or leaves running one that it started. It starts
|
|
217
|
+
* no re-capture after `settleBy` (epoch ms); only `signal` cancels work already started.
|
|
218
|
+
*/
|
|
219
|
+
transient?: Readonly<{
|
|
220
|
+
settleBy: number;
|
|
221
|
+
}>;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Android's live IME status read. Optional on {@link Interactor}: parity with the retired leaf,
|
|
225
|
+
* which refused `status`/`get` on every other family (no other platform's runner exposes one).
|
|
226
|
+
* A single-member discriminated union rather than a bare object so the daemon can derive its wire
|
|
227
|
+
* `platform` label from `kind` the same way it does for dismiss and enter — an owner can only ever
|
|
228
|
+
* produce its own result shape.
|
|
229
|
+
*/
|
|
230
|
+
type KeyboardStatusResult = Readonly<{
|
|
231
|
+
kind: 'ime-probe';
|
|
232
|
+
visible: boolean;
|
|
233
|
+
inputType?: string;
|
|
234
|
+
type?: string;
|
|
235
|
+
inputMethodPackage?: string;
|
|
236
|
+
focusedPackage?: string;
|
|
237
|
+
focusedResourceId?: string;
|
|
238
|
+
inputOwner?: string;
|
|
239
|
+
}>;
|
|
240
|
+
/**
|
|
241
|
+
* Owner-shaped dismiss evidence, discriminated by which owner produced it: Android's IME probe
|
|
242
|
+
* fields, or iOS's `mechanism` disclosure (#1598), or HarmonyOS's bare acknowledgment (its HDC
|
|
243
|
+
* key press reports nothing beyond success). The daemon derives the wire `platform` label from
|
|
244
|
+
* `kind` rather than re-deriving it from the device, so an owner can only ever produce its own
|
|
245
|
+
* result shape — an android-probe result under an `ios` label is unrepresentable.
|
|
246
|
+
*/
|
|
247
|
+
type KeyboardDismissResult = Readonly<{
|
|
248
|
+
kind: 'ime-probe';
|
|
249
|
+
attempts?: number;
|
|
250
|
+
wasVisible?: boolean;
|
|
251
|
+
dismissed?: boolean;
|
|
252
|
+
visible?: boolean;
|
|
253
|
+
inputType?: string;
|
|
254
|
+
type?: string;
|
|
255
|
+
inputMethodPackage?: string;
|
|
256
|
+
focusedPackage?: string;
|
|
257
|
+
focusedResourceId?: string;
|
|
258
|
+
inputOwner?: string;
|
|
259
|
+
}> | Readonly<{
|
|
260
|
+
kind: 'mechanism';
|
|
261
|
+
wasVisible?: boolean;
|
|
262
|
+
dismissed?: boolean;
|
|
263
|
+
visible?: boolean;
|
|
264
|
+
mechanism?: string;
|
|
265
|
+
}> | Readonly<{
|
|
266
|
+
kind: 'acknowledged';
|
|
267
|
+
}>;
|
|
268
|
+
/**
|
|
269
|
+
* Only the Apple runner echoes visibility around the return-key press; Android and HarmonyOS
|
|
270
|
+
* acknowledge with no fields beyond success. Kind is owner-specific, not just content-shaped —
|
|
271
|
+
* Android's and HarmonyOS's acknowledgments are structurally identical, so only the discriminant
|
|
272
|
+
* itself tells the daemon which owner actually pressed enter.
|
|
273
|
+
*/
|
|
274
|
+
type KeyboardEnterResult = Readonly<{
|
|
275
|
+
kind: 'visibility-echo';
|
|
276
|
+
visible?: boolean;
|
|
277
|
+
wasVisible?: boolean;
|
|
278
|
+
}> | Readonly<{
|
|
279
|
+
kind: 'android-acknowledged';
|
|
280
|
+
}> | Readonly<{
|
|
281
|
+
kind: 'harmonyos-acknowledged';
|
|
282
|
+
}>;
|
|
283
|
+
/**
|
|
284
|
+
* Every acquisition carries its provenance pair atomically: the channel alone cannot say who
|
|
285
|
+
* acquired the tree or which guarantees it carries, and `SnapshotProvenance`
|
|
286
|
+
* (`@agent-device/kernel/snapshot`) makes a cross-channel `backend`/`producer` combination
|
|
287
|
+
* fail to compile.
|
|
288
|
+
*/
|
|
289
|
+
type SnapshotResult = Omit<BackendSnapshotResult, 'backend' | 'nodes'> & {
|
|
290
|
+
nodes?: RawSnapshotNode[];
|
|
291
|
+
comparisonIdentity?: IosSnapshotComparisonIdentity;
|
|
292
|
+
/**
|
|
293
|
+
* Set when the capture describes an in-place iOS system surface (a web sign-in sheet) presented
|
|
294
|
+
* over the session app rather than the app itself (#2438).
|
|
295
|
+
*/
|
|
296
|
+
systemSurface?: IosSystemSurfaceProvenance;
|
|
297
|
+
/**
|
|
298
|
+
* The keyboard band the producer measured while capturing, when it can measure one (#2660). A
|
|
299
|
+
* producer that publishes nothing measured nothing, so the tap-path guard keeps deriving the band
|
|
300
|
+
* from `nodes`; see {@link SnapshotKeyboardBandFact}.
|
|
301
|
+
*/
|
|
302
|
+
keyboard?: SnapshotKeyboardBandFact;
|
|
303
|
+
/**
|
|
304
|
+
* Set when this capture's own command had to bring the session app back to the foreground, i.e.
|
|
305
|
+
* something else held it and an earlier observation described that instead (#2682).
|
|
306
|
+
*/
|
|
307
|
+
targetActivation?: IosTargetActivation;
|
|
308
|
+
} & SnapshotProvenance;
|
|
309
|
+
type SnapshotRuntimeAcquiredResult = Readonly<{
|
|
310
|
+
stage: 'acquired';
|
|
311
|
+
acquisition: IosSnapshotAcquisitionFacts & Readonly<{
|
|
312
|
+
producer: IosAcquisitionProducer;
|
|
313
|
+
}>;
|
|
314
|
+
}>;
|
|
315
|
+
type SnapshotRuntimeResult = SnapshotResult | SnapshotRuntimeAcquiredResult;
|
|
316
|
+
type Interactor = {
|
|
317
|
+
open(app: string, options?: {
|
|
318
|
+
activity?: string;
|
|
319
|
+
appBundleId?: string;
|
|
320
|
+
launchConsole?: string;
|
|
321
|
+
launchArgs?: string[];
|
|
322
|
+
terminateRunningApp?: boolean;
|
|
323
|
+
url?: string;
|
|
324
|
+
}): Promise<void>;
|
|
325
|
+
openDevice(): Promise<void>;
|
|
326
|
+
close(app: string): Promise<void>;
|
|
327
|
+
tap(x: number, y: number): Promise<Record<string, unknown> | void>;
|
|
328
|
+
/** Complete point-press semantics for owners with fused series, alternate buttons, or surfaces. */
|
|
329
|
+
pressPoint?(point: Point, options: PressPointOptions): Promise<Record<string, unknown> | void>;
|
|
330
|
+
/** Alternate mouse buttons for owners that otherwise use the shared point-press series. */
|
|
331
|
+
alternateClick?(point: Point, button: 'secondary' | 'middle'): Promise<Record<string, unknown> | void>;
|
|
332
|
+
/** Owner-native ref routes; currently the managed web runtime is their only local owner. */
|
|
333
|
+
tapRef?(ref: string): Promise<Record<string, unknown> | void>;
|
|
334
|
+
tapElementSelector?(selector: ElementSelectorTapOptions): Promise<Record<string, unknown> | void>;
|
|
335
|
+
/**
|
|
336
|
+
* Fused double-click for owners that have one. The shared `--count` series cannot stand in for it —
|
|
337
|
+
* it spaces and jitters independent presses rather than firing one pair the target reads as a
|
|
338
|
+
* double — so an owner with no such mechanic leaves this undefined and `press --double` reports the
|
|
339
|
+
* gap instead of resolving a denial.
|
|
340
|
+
*/
|
|
341
|
+
doubleTap?(x: number, y: number): Promise<Record<string, unknown> | void>;
|
|
342
|
+
longPress(x: number, y: number, durationMs?: number): Promise<Record<string, unknown> | void>;
|
|
343
|
+
/**
|
|
344
|
+
* How the app the runner context names is running, as the platform reports it. The Apple runner
|
|
345
|
+
* reads `XCUIApplication.state`; owners that read the foreground elsewhere leave it undefined.
|
|
346
|
+
*/
|
|
347
|
+
appState?(): Promise<AppStateRuntimeResult>;
|
|
348
|
+
/**
|
|
349
|
+
* Move the pointer to a point without pressing. Only pointer-driven
|
|
350
|
+
* platforms (web today) implement it; touch platforms have no hover state
|
|
351
|
+
* and leave it undefined, which the `hover` command reports as unsupported.
|
|
352
|
+
*/
|
|
353
|
+
hover?(x: number, y: number): Promise<Record<string, unknown> | void>;
|
|
354
|
+
hoverRef?(ref: string): Promise<Record<string, unknown> | void>;
|
|
355
|
+
focus(x: number, y: number): Promise<Record<string, unknown> | void>;
|
|
356
|
+
type(text: string, delayMs?: number): Promise<TypeTextBackendResult | void>;
|
|
357
|
+
/**
|
|
358
|
+
* Replace the target's text with `text`. The empty string is the clear request (#2063), not a
|
|
359
|
+
* no-op: an implementation must empty the field or fail — never report success over an
|
|
360
|
+
* untouched value. A backend with no clear mechanism refuses the empty text up front (see the
|
|
361
|
+
* webdriver interactor).
|
|
362
|
+
*/
|
|
363
|
+
fill(x: number, y: number, text: string, delayMs?: number, options?: {
|
|
364
|
+
allowNonHittableCoordinateFallback?: boolean;
|
|
365
|
+
}): Promise<Record<string, unknown> | void>;
|
|
366
|
+
fillRef?(ref: string, text: string, delayMs?: number): Promise<Record<string, unknown> | void>;
|
|
367
|
+
scroll(direction: ScrollDirection, options?: ScrollExecutionOptions): Promise<Record<string, unknown> | void>;
|
|
368
|
+
screenshot(outPath: string, options?: ScreenshotOptions): Promise<ScreenshotCaptureFacts | void>;
|
|
369
|
+
setViewport?(width: number, height: number): Promise<Record<string, unknown> | void>;
|
|
370
|
+
snapshot(options?: SnapshotOptions): Promise<SnapshotRuntimeResult>;
|
|
371
|
+
/**
|
|
372
|
+
* Native reading of the live text at a point, when the backend has one. Answers the text the
|
|
373
|
+
* owner can see right now, which can exceed what an already-captured node carries (an editable
|
|
374
|
+
* field whose value is longer than its label). Optional: a backend without it leaves the
|
|
375
|
+
* captured tree as the complete answer.
|
|
376
|
+
*/
|
|
377
|
+
readTextAtPoint?(point: Point, options?: {
|
|
378
|
+
appBundleId?: string;
|
|
379
|
+
surface?: SessionSurface;
|
|
380
|
+
signal?: AbortSignal;
|
|
381
|
+
}): Promise<string | undefined>;
|
|
382
|
+
/**
|
|
383
|
+
* Native text-presence reading, when the backend has one that does not require a tree capture.
|
|
384
|
+
* A `true` answer is authoritative; anything else means "not proven here" and the caller
|
|
385
|
+
* consults the canonical tree (see `FindTextResult`).
|
|
386
|
+
*/
|
|
387
|
+
findText?(text: string, options?: {
|
|
388
|
+
appBundleId?: string;
|
|
389
|
+
signal?: AbortSignal;
|
|
390
|
+
}): Promise<{
|
|
391
|
+
found: boolean;
|
|
392
|
+
}>;
|
|
393
|
+
gestureViewport?(): Promise<Rect>;
|
|
394
|
+
back(mode?: BackMode): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* Optional (parity with `actionButton`): opens the springboard, a control not every owner
|
|
397
|
+
* carries. An owner without it leaves it undefined; its fact refuses the press before binding,
|
|
398
|
+
* and the system-button binder fails closed rather than resolving an absent member as a
|
|
399
|
+
* successful no-op.
|
|
400
|
+
*/
|
|
401
|
+
home?(): Promise<void>;
|
|
402
|
+
setOrientation(orientation: DeviceRotation): Promise<{
|
|
403
|
+
orientation?: DeviceRotation;
|
|
404
|
+
} | void>;
|
|
405
|
+
performGesture?(plan: GesturePlan): Promise<Record<string, unknown> | void>;
|
|
406
|
+
/**
|
|
407
|
+
* Optional (parity with `home`): opens the recents surface, a control not every owner carries.
|
|
408
|
+
* An owner without it leaves it undefined; its fact refuses the press before binding, and the
|
|
409
|
+
* system-button binder fails closed rather than resolving an absent member as a successful
|
|
410
|
+
* no-op.
|
|
411
|
+
*/
|
|
412
|
+
appSwitcher?(): Promise<void>;
|
|
413
|
+
/**
|
|
414
|
+
* Optional (parity with `home`): presses one TV remote key, a control only TV-capable owners
|
|
415
|
+
* carry. An owner without it leaves it undefined; its fact refuses the press before binding,
|
|
416
|
+
* and the TV remote binder fails closed rather than resolving an absent member as a silent
|
|
417
|
+
* no-op.
|
|
418
|
+
*/
|
|
419
|
+
tvRemote?(button: TvRemoteButton, durationMs?: number): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Optional (parity with `keyboardDismiss`): presses the iPhone/iPad Action Button, hardware only
|
|
422
|
+
* the Apple owner carries. An owner without the button leaves it undefined; its fact refuses the
|
|
423
|
+
* press before binding, and the system-button binder fails closed rather than resolving an
|
|
424
|
+
* absent member as a successful no-op.
|
|
425
|
+
*/
|
|
426
|
+
actionButton?(): Promise<void>;
|
|
427
|
+
/** Optional: only Android implements a live status read (see {@link KeyboardStatusResult}). */
|
|
428
|
+
keyboardStatus?(): Promise<KeyboardStatusResult>;
|
|
429
|
+
/** Optional: platforms with no keyboard-dismiss concept leave it undefined. */
|
|
430
|
+
keyboardDismiss?(): Promise<KeyboardDismissResult>;
|
|
431
|
+
/** Optional: platforms with no keyboard-return concept leave it undefined. */
|
|
432
|
+
keyboardEnter?(): Promise<KeyboardEnterResult>;
|
|
433
|
+
/**
|
|
434
|
+
* Optional (parity with `readSetting`): the owner's pasteboard read. An owner with no clipboard
|
|
435
|
+
* surface leaves both halves undefined; its fact refuses the half before binding, and the
|
|
436
|
+
* clipboard binder fails closed rather than resolving an absent member as an empty answer.
|
|
437
|
+
*/
|
|
438
|
+
readClipboard?(): Promise<string>;
|
|
439
|
+
/**
|
|
440
|
+
* Optional (parity with `readClipboard`): the owner's pasteboard write, with the same
|
|
441
|
+
* fact-then-guard contract as the read.
|
|
442
|
+
*/
|
|
443
|
+
writeClipboard?(text: string): Promise<void>;
|
|
444
|
+
setSetting(setting: string, state: string, appId?: string, options?: SettingOptions): Promise<Record<string, unknown> | void>;
|
|
445
|
+
/**
|
|
446
|
+
* Optional: reads back the value a device holds for one readable setting. The name is narrowed to
|
|
447
|
+
* `READABLE_SETTINGS`, which is not every setting the write switch serves, and an owner's dispatch
|
|
448
|
+
* is exhaustive over it — a setting joins the list only with an owner that answers it. An owner with
|
|
449
|
+
* no read path leaves the member undefined; its fact refuses the read before binding, so an absent
|
|
450
|
+
* method can never resolve into an empty answer.
|
|
451
|
+
*/
|
|
452
|
+
readSetting?(setting: ReadableSetting): Promise<ReadSettingResult>;
|
|
453
|
+
/**
|
|
454
|
+
* The four alert legs. Each owner runs its own observation and, where it needs one, its own
|
|
455
|
+
* poll: an alert is a transient device surface, and how long to look for it — and how to press
|
|
456
|
+
* its buttons — is family mechanics, not something a caller can supply. `timeoutMs` is the
|
|
457
|
+
* whole window the caller allows; the owner spends it however its backend requires.
|
|
458
|
+
*
|
|
459
|
+
* Optional: an owner with no alert surface leaves all four undefined. Its facts refuse every leg
|
|
460
|
+
* before binding, so the absent members are never resolved, and a fact that admitted a leg the
|
|
461
|
+
* interactor cannot serve fails closed instead of answering empty.
|
|
462
|
+
*/
|
|
463
|
+
readAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
|
|
464
|
+
awaitAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
|
|
465
|
+
acceptAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
|
|
466
|
+
dismissAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* The session-derived target one alert leg acts on. `appBundleId` is separate from the runner
|
|
470
|
+
* context's because the macOS helper reads a frontmost-app surface with no bundle at all, and
|
|
471
|
+
* the two must not collapse into one field that means both.
|
|
472
|
+
*/
|
|
473
|
+
type AlertInteractorOptions = {
|
|
474
|
+
timeoutMs?: number;
|
|
475
|
+
appBundleId?: string;
|
|
476
|
+
surface?: SessionSurface;
|
|
477
|
+
};
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region packages/contracts/src/device-provider.d.ts
|
|
480
|
+
type DeviceLease = {
|
|
481
|
+
leaseId: string;
|
|
482
|
+
tenantId: string;
|
|
483
|
+
runId: string;
|
|
484
|
+
backend: LeaseBackend;
|
|
485
|
+
leaseProvider?: string;
|
|
486
|
+
deviceKey?: string;
|
|
487
|
+
clientId?: string;
|
|
488
|
+
retainOnClose?: true;
|
|
489
|
+
createdAt: number;
|
|
490
|
+
heartbeatAt: number;
|
|
491
|
+
expiresAt: number;
|
|
492
|
+
};
|
|
493
|
+
type LeaseLifecycleContext = {
|
|
494
|
+
flags?: Readonly<Record<string, unknown>>;
|
|
495
|
+
initialApp?: string;
|
|
496
|
+
cwd?: string;
|
|
497
|
+
publicNetworkOnly?: boolean;
|
|
498
|
+
/** Request-bound cancellation (explicit cancel or client disconnect). */
|
|
499
|
+
signal?: AbortSignal;
|
|
500
|
+
/**
|
|
501
|
+
* Epoch-ms deadline by which `allocate` must have settled; derived from the
|
|
502
|
+
* same budget as the client's `lease_allocate` envelope, so a provider that
|
|
503
|
+
* fits its remote phases within it is never abandoned by a client first.
|
|
504
|
+
*/
|
|
505
|
+
deadline?: number;
|
|
506
|
+
};
|
|
507
|
+
type LeaseLifecycleProvider = {
|
|
508
|
+
allocate?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
|
|
509
|
+
heartbeat?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
|
|
510
|
+
release?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
|
|
511
|
+
};
|
|
512
|
+
type DeviceInventoryProvider = (request: ProviderDeviceInventoryRequest, signal?: AbortSignal) => Promise<DeviceInfo[] | null | undefined>;
|
|
513
|
+
type ProviderAppCatalogQuery = Readonly<{
|
|
514
|
+
provider: string;
|
|
515
|
+
platform: 'android' | 'ios';
|
|
516
|
+
publicNetworkOnly?: boolean;
|
|
517
|
+
}>;
|
|
518
|
+
type ProviderAppCatalogHandler = (query: ProviderAppCatalogQuery, signal?: AbortSignal) => Promise<readonly string[]>;
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region packages/contracts/src/provider-device-runtime.d.ts
|
|
521
|
+
type ProviderDeviceInstallResult = {
|
|
522
|
+
bundleId?: string;
|
|
523
|
+
packageName?: string;
|
|
524
|
+
appName?: string;
|
|
525
|
+
launchTarget?: string;
|
|
526
|
+
};
|
|
527
|
+
type ProviderDeviceInstallOptions = {
|
|
528
|
+
relaunch?: boolean;
|
|
529
|
+
appIdentifierHint?: string;
|
|
530
|
+
packageNameHint?: string;
|
|
531
|
+
};
|
|
532
|
+
type ProviderPortReverseOptions = {
|
|
533
|
+
leaseId: string;
|
|
534
|
+
provider?: string;
|
|
535
|
+
devicePort: number;
|
|
536
|
+
hostPort: number;
|
|
537
|
+
name: string;
|
|
538
|
+
};
|
|
539
|
+
type ProviderExpiredLeaseRecovery = (lease: DeviceLease) => Promise<void>;
|
|
540
|
+
/** Provider adapter contract; root owns active-runtime and request composition. */
|
|
541
|
+
type ProviderDeviceRuntime = {
|
|
542
|
+
provider: string;
|
|
543
|
+
leaseLifecycle: LeaseLifecycleProvider;
|
|
544
|
+
recoverExpiredLease?: ProviderExpiredLeaseRecovery;
|
|
545
|
+
cloudArtifacts?: CloudArtifactProvider;
|
|
546
|
+
appCatalog?: ProviderAppCatalogHandler;
|
|
547
|
+
deviceInventoryProvider: DeviceInventoryProvider;
|
|
548
|
+
ownsDevice(device: DeviceInfo): boolean;
|
|
549
|
+
getInteractor(device: DeviceInfo, runnerContext?: RunnerContext): Interactor | undefined;
|
|
550
|
+
installApp?(device: DeviceInfo, app: string, appPath: string, options?: ProviderDeviceInstallOptions): Promise<ProviderDeviceInstallResult | undefined>;
|
|
551
|
+
installInstallablePath?(device: DeviceInfo, installablePath: string, options?: ProviderDeviceInstallOptions): Promise<ProviderDeviceInstallResult | undefined>;
|
|
552
|
+
configurePortReverse?(options: ProviderPortReverseOptions): Promise<Record<string, unknown> | undefined>;
|
|
553
|
+
shutdown(): Promise<void>;
|
|
554
|
+
};
|
|
555
|
+
//#endregion
|
|
556
|
+
export { ProviderPortReverseOptions as a, LeaseLifecycleContext as c, ProviderExpiredLeaseRecovery as i, LeaseLifecycleProvider as l, ProviderDeviceInstallResult as n, DeviceInventoryProvider as o, ProviderDeviceRuntime as r, DeviceLease as s, ProviderDeviceInstallOptions as t, Interactor as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./base-url.js";import{n as t,t as n}from"./client-companion-tunnel.js";import{i as r}from"./providers.js";import{t as i}from"./manifest.js";import{n as a}from"./store.js";const o={slug:`react-devtools-companion`,runArg:e,displayName:`React DevTools companion`};async function s(e){return await n({...e,definition:o,localBaseUrl:e.localBaseUrl??`http://127.0.0.1:8097`,registerPath:`/api/react-devtools/companion/register`,unregisterPath:`/api/react-devtools/companion/unregister`,devicePort:e.devicePort??8097})}async function c(e){return await t({...e,definition:o})}function l(e,t=process.env){return e===void 0?void 0:a(t).find(t=>t.agentDevicePlugin.provider===e)?.agentDevicePlugin.connection}function u(e=process.env){return a(e).filter(e=>e.agentDevicePlugin.connection).map(e=>e.agentDevicePlugin.provider)}const d={leaseKind:`direct-device-provider`,requiresAppAttachment:!1,requiresRemoteDaemon:!1,supportsArtifacts:!1,supportsDeferredAppSelection:!0,supportsDirectPortReverse:!0,usesCloudWebDriverLease:!1};function f(e){return{leaseKind:e,requiresAppAttachment:!1,requiresRemoteDaemon:!0,supportsArtifacts:!1,supportsDeferredAppSelection:!1,supportsDirectPortReverse:!1,usesCloudWebDriverLease:!1}}function p(e,t=process.env){return e===`cloud`||e===`proxy`||e===`limrun`||r(e)!==void 0||l(e,t)!==void 0}function m(){return[...i,...u()].join(`, `)}function h(e,t=process.env){return e===`limrun`?d:e===`proxy`?f(`proxy`):r(e)?.connection??(e===`cloud`?void 0:l(e,t))??f(`remote-provider`)}export{c as a,s as i,h as n,p as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{d as n,u as r}from"./sdk-remote-config.js";var i=e({rejectRefusedProviderProfileFields:()=>a,requireResolvedProfilePlatform:()=>s,requireResolvedProfileValue:()=>o});function a(e,n){let i=Object.keys(n.fields).filter(t=>n.fields[t]===`refused`&&l(e?.[t]));if(i.length===0)return;let a=i.length!==1;throw new t(`INVALID_ARGS`,`${i.map(c).join(`, `)} ${a?`are`:`is`} not supported by ${n.label}.`,{hint:`Drop ${a?`those flags`:`the flag`} or use a provider that supports ${a?`them`:`it`}.`,provider:n.provider,flags:i.map(e=>r[e])})}function o(e,n){if(e!==void 0)return e;throw new t(`COMMAND_FAILED`,n,{hint:`Reconnect to regenerate and validate the provider profile.`})}function s(e,n){if(e===`android`||e===`ios`)return e;throw new t(`COMMAND_FAILED`,`${n} profile missed a mobile platform.`,{hint:`Reconnect with --platform ios|android.`})}function c(e){let t=n[e],i=r[e];return t?.length?`${i} (${t.join(`, `)})`:i}function l(e){return e!=null&&e!==!1&&e!==``}export{o as i,a as n,s as r,i as t};
|