peachsim 0.1.2438 → 0.1.2440
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 +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8743 -5562
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-B27MTHKJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-4U7IGWPB.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-5CZQZKYU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-6HFWZJ6C.mjs +115 -0
- package/dist-lib/esm-chunks/chunk-6JGALQD5.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-ADE23YGG.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-D4Z36DQQ.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-EATI62W3.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-H6QIEJRC.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HIK3VREC.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-HP7DHONL.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-PRZI3CFF.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-QECVPSP3.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-R5FNLCBO.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-RVMUQQWC.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-SJFNKW3W.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-WQISIGIX.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-X6UKJ5AX.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-ZXNBC3PZ.mjs +18959 -0
- package/dist-lib/esm-chunks/metro-layout-parser-ZOI5PO4E.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7881 -4717
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15685 -11414
- package/dist-lib/host/fetch-proxy-handler.cjs +3928 -343
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +664 -452
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21694 -17393
- package/dist-lib/swift-compile.cjs +1355 -1322
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +9 -0
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h +1 -1
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +21 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/native-slices.ts +1 -1
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/swift-compile.ts +13 -7
- package/src/swift-host.ts +2 -0
- package/src/swift-package-manifest.ts +13 -8
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
|
@@ -1,586 +1,23 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const method = stringValue(step.method, "recorder.method");
|
|
22
|
-
if (method === "available" || method === "stop") return { method };
|
|
23
|
-
if (method === "hold")
|
|
24
|
-
return { method, durationMs: numberValue(step.durationMs, "recorder.durationMs") };
|
|
25
|
-
const options = step.options === void 0 ? {} : recordValue(step.options, "recorder.options");
|
|
26
|
-
const layers = options.layers;
|
|
27
|
-
if (layers !== void 0 && layers !== "full" && layers !== "tenant" && layers !== "shell")
|
|
28
|
-
validationFailure("recorder.options.layers", "must be full, tenant or shell");
|
|
29
|
-
if (method === "getBlobBase64")
|
|
30
|
-
return {
|
|
31
|
-
method,
|
|
32
|
-
options: {
|
|
33
|
-
chunk: optionalNumber(options, "chunk", "recorder.options"),
|
|
34
|
-
offset: optionalNumber(options, "offset", "recorder.options")
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
if (method === "getFrameCaptureResult")
|
|
38
|
-
return {
|
|
39
|
-
method,
|
|
40
|
-
requestId: numberValue(step.requestId, "recorder.requestId"),
|
|
41
|
-
options: step.options === void 0 ? void 0 : {
|
|
42
|
-
offset: numberValue(options.offset, "recorder.options.offset"),
|
|
43
|
-
limit: numberValue(options.limit, "recorder.options.limit")
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
if (method === "startFrameCapture") {
|
|
47
|
-
const observation = options.observation;
|
|
48
|
-
if (observation !== void 0 && observation !== "presented")
|
|
49
|
-
validationFailure("recorder.options.observation", "must be presented");
|
|
50
|
-
return {
|
|
51
|
-
method,
|
|
52
|
-
options: {
|
|
53
|
-
count: numberValue(options.count, "recorder.options.count"),
|
|
54
|
-
durationMs: numberValue(options.durationMs, "recorder.options.durationMs"),
|
|
55
|
-
layers,
|
|
56
|
-
maxWidth: optionalNumber(options, "maxWidth", "recorder.options"),
|
|
57
|
-
observation,
|
|
58
|
-
surfaceId: options.surfaceId === void 0 ? void 0 : stringValue(options.surfaceId, "recorder.options.surfaceId")
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (method === "captureGif")
|
|
63
|
-
return {
|
|
64
|
-
method,
|
|
65
|
-
options: {
|
|
66
|
-
frames: numberValue(options.frames, "recorder.options.frames"),
|
|
67
|
-
durationMs: numberValue(options.durationMs, "recorder.options.durationMs"),
|
|
68
|
-
layers,
|
|
69
|
-
maxWidth: optionalNumber(options, "maxWidth", "recorder.options")
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
if (method === "start") {
|
|
73
|
-
const format = options.format;
|
|
74
|
-
if (format !== void 0 && format !== "webm" && format !== "mp4")
|
|
75
|
-
validationFailure("recorder.options.format", "must be webm or mp4");
|
|
76
|
-
return {
|
|
77
|
-
method,
|
|
78
|
-
options: {
|
|
79
|
-
format,
|
|
80
|
-
layers,
|
|
81
|
-
fps: optionalNumber(options, "fps", "recorder.options"),
|
|
82
|
-
durationMs: optionalNumber(options, "durationMs", "recorder.options"),
|
|
83
|
-
scene: optionalBoolean(options, "scene", "recorder.options"),
|
|
84
|
-
sceneWithVideo: optionalBoolean(options, "sceneWithVideo", "recorder.options")
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
return validationFailure("recorder.method", `is unsupported: ${method}`);
|
|
89
|
-
}
|
|
90
|
-
function validationFailure(path, expectation) {
|
|
91
|
-
throw new BridgeInputError(`${path} ${expectation}`);
|
|
92
|
-
}
|
|
93
|
-
function recordValue(value, path) {
|
|
94
|
-
if (!isRecord(value)) {
|
|
95
|
-
validationFailure(path, "must be an object");
|
|
96
|
-
}
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
function stringValue(value, path) {
|
|
100
|
-
if (typeof value !== "string") validationFailure(path, "must be a string");
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
function numberValue(value, path) {
|
|
104
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
105
|
-
validationFailure(path, "must be a finite number");
|
|
106
|
-
}
|
|
107
|
-
return value;
|
|
108
|
-
}
|
|
109
|
-
function booleanValue(value, path) {
|
|
110
|
-
if (typeof value !== "boolean") validationFailure(path, "must be a boolean");
|
|
111
|
-
return value;
|
|
112
|
-
}
|
|
113
|
-
function optionalNumber(record, key, path) {
|
|
114
|
-
return record[key] === void 0 ? void 0 : numberValue(record[key], `${path}.${key}`);
|
|
115
|
-
}
|
|
116
|
-
function optionalPointerId(record, path) {
|
|
117
|
-
const pointerId = optionalNumber(record, "pointerId", path);
|
|
118
|
-
if (pointerId !== void 0 && !Number.isSafeInteger(pointerId)) {
|
|
119
|
-
validationFailure(`${path}.pointerId`, "must be a safe integer");
|
|
120
|
-
}
|
|
121
|
-
return pointerId;
|
|
122
|
-
}
|
|
123
|
-
function optionalBoolean(record, key, path) {
|
|
124
|
-
return record[key] === void 0 ? void 0 : booleanValue(record[key], `${path}.${key}`);
|
|
125
|
-
}
|
|
126
|
-
function semanticWaitTimeout(record, path) {
|
|
127
|
-
const timeoutMs = optionalNumber(record, "timeoutMs", path);
|
|
128
|
-
if (timeoutMs !== void 0 && timeoutMs > SEMANTIC_WAIT_MAX_TIMEOUT_MS) {
|
|
129
|
-
validationFailure(
|
|
130
|
-
`${path}.timeoutMs`,
|
|
131
|
-
`must be at most ${SEMANTIC_WAIT_MAX_TIMEOUT_MS}`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
return timeoutMs;
|
|
135
|
-
}
|
|
136
|
-
function parsePerformStep(value, index) {
|
|
137
|
-
const path = `perform.steps[${index}]`;
|
|
138
|
-
const step = recordValue(value, path);
|
|
139
|
-
const type = stringValue(step.type, `${path}.type`);
|
|
140
|
-
switch (type) {
|
|
141
|
-
case "touchDown":
|
|
142
|
-
case "touchMove":
|
|
143
|
-
case "touchUp": {
|
|
144
|
-
const pointerId = optionalPointerId(step, path);
|
|
145
|
-
return {
|
|
146
|
-
type,
|
|
147
|
-
x: numberValue(step.x, `${path}.x`),
|
|
148
|
-
y: numberValue(step.y, `${path}.y`),
|
|
149
|
-
...pointerId === void 0 ? {} : { pointerId }
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
case "touchCancel": {
|
|
153
|
-
const pointerId = optionalPointerId(step, path);
|
|
154
|
-
return { type, ...pointerId === void 0 ? {} : { pointerId } };
|
|
155
|
-
}
|
|
156
|
-
case "tap":
|
|
157
|
-
return {
|
|
158
|
-
type,
|
|
159
|
-
target: parseTapTarget(step.target),
|
|
160
|
-
x: numberValue(step.x, `${path}.x`),
|
|
161
|
-
y: numberValue(step.y, `${path}.y`)
|
|
162
|
-
};
|
|
163
|
-
case "tapId":
|
|
164
|
-
return { type, id: stringValue(step.id, `${path}.id`) };
|
|
165
|
-
case "tapText":
|
|
166
|
-
return { type, text: stringValue(step.text, `${path}.text`) };
|
|
167
|
-
case "doubleTap": {
|
|
168
|
-
const gapMs = optionalNumber(step, "gapMs", path);
|
|
169
|
-
return {
|
|
170
|
-
type,
|
|
171
|
-
x: numberValue(step.x, `${path}.x`),
|
|
172
|
-
y: numberValue(step.y, `${path}.y`),
|
|
173
|
-
...gapMs === void 0 ? {} : { gapMs }
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
case "longPress": {
|
|
177
|
-
const durationMs = optionalNumber(step, "durationMs", path);
|
|
178
|
-
if (durationMs !== void 0 && (!Number.isInteger(durationMs) || durationMs < 1 || durationMs > SIM_LONG_PRESS_MAX_MS)) {
|
|
179
|
-
validationFailure(
|
|
180
|
-
`${path}.durationMs`,
|
|
181
|
-
`must be an integer between 1 and ${SIM_LONG_PRESS_MAX_MS}`
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
return {
|
|
185
|
-
type,
|
|
186
|
-
x: numberValue(step.x, `${path}.x`),
|
|
187
|
-
y: numberValue(step.y, `${path}.y`),
|
|
188
|
-
...durationMs === void 0 ? {} : { durationMs }
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
case "drag": {
|
|
192
|
-
const steps = optionalNumber(step, "steps", path);
|
|
193
|
-
const stepMs = optionalNumber(step, "stepMs", path);
|
|
194
|
-
return {
|
|
195
|
-
type,
|
|
196
|
-
fromX: numberValue(step.fromX, `${path}.fromX`),
|
|
197
|
-
fromY: numberValue(step.fromY, `${path}.fromY`),
|
|
198
|
-
toX: numberValue(step.toX, `${path}.toX`),
|
|
199
|
-
toY: numberValue(step.toY, `${path}.toY`),
|
|
200
|
-
...steps === void 0 ? {} : { steps },
|
|
201
|
-
...stepMs === void 0 ? {} : { stepMs }
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
case "pinch": {
|
|
205
|
-
const steps = optionalNumber(step, "steps", path);
|
|
206
|
-
const stepMs = optionalNumber(step, "stepMs", path);
|
|
207
|
-
return {
|
|
208
|
-
type,
|
|
209
|
-
fromX1: numberValue(step.fromX1, `${path}.fromX1`),
|
|
210
|
-
fromY1: numberValue(step.fromY1, `${path}.fromY1`),
|
|
211
|
-
fromX2: numberValue(step.fromX2, `${path}.fromX2`),
|
|
212
|
-
fromY2: numberValue(step.fromY2, `${path}.fromY2`),
|
|
213
|
-
toX1: numberValue(step.toX1, `${path}.toX1`),
|
|
214
|
-
toY1: numberValue(step.toY1, `${path}.toY1`),
|
|
215
|
-
toX2: numberValue(step.toX2, `${path}.toX2`),
|
|
216
|
-
toY2: numberValue(step.toY2, `${path}.toY2`),
|
|
217
|
-
...steps === void 0 ? {} : { steps },
|
|
218
|
-
...stepMs === void 0 ? {} : { stepMs }
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
case "scroll": {
|
|
222
|
-
const x = optionalNumber(step, "x", path);
|
|
223
|
-
const y = optionalNumber(step, "y", path);
|
|
224
|
-
const animated = optionalBoolean(step, "animated", path);
|
|
225
|
-
return {
|
|
226
|
-
type,
|
|
227
|
-
id: stringValue(step.id, `${path}.id`),
|
|
228
|
-
...x === void 0 ? {} : { x },
|
|
229
|
-
...y === void 0 ? {} : { y },
|
|
230
|
-
...animated === void 0 ? {} : { animated }
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
case "type":
|
|
234
|
-
return { type, text: stringValue(step.text, `${path}.text`) };
|
|
235
|
-
case "typeInto": {
|
|
236
|
-
const nodeId = numberValue(step.nodeId, `${path}.nodeId`);
|
|
237
|
-
if (!Number.isSafeInteger(nodeId) || nodeId === 0) {
|
|
238
|
-
validationFailure(`${path}.nodeId`, "must be a nonzero safe integer");
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
type,
|
|
242
|
-
text: stringValue(step.text, `${path}.text`),
|
|
243
|
-
nodeId
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
case "key":
|
|
247
|
-
return { type, key: stringValue(step.key, `${path}.key`) };
|
|
248
|
-
case "dismissKeyboard":
|
|
249
|
-
return { type };
|
|
250
|
-
case "setElementValue": {
|
|
251
|
-
const submit = optionalBoolean(step, "submit", path);
|
|
252
|
-
return {
|
|
253
|
-
type,
|
|
254
|
-
id: stringValue(step.id, `${path}.id`),
|
|
255
|
-
text: stringValue(step.text, `${path}.text`),
|
|
256
|
-
...submit === void 0 ? {} : { submit }
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
case "toggleKeyboard":
|
|
260
|
-
return { type };
|
|
261
|
-
case "openUrl": {
|
|
262
|
-
const url = stringValue(step.url, `${path}.url`);
|
|
263
|
-
if (url.length === 0) validationFailure(`${path}.url`, "must be non-empty");
|
|
264
|
-
return { type, url };
|
|
265
|
-
}
|
|
266
|
-
case "keyDown":
|
|
267
|
-
case "keyUp":
|
|
268
|
-
return { type, key: stringValue(step.key, `${path}.key`) };
|
|
269
|
-
case "setOrientation": {
|
|
270
|
-
const orientation = stringValue(step.orientation, `${path}.orientation`);
|
|
271
|
-
if (orientation !== "portrait" && orientation !== "landscape") {
|
|
272
|
-
validationFailure(`${path}.orientation`, "must be portrait or landscape");
|
|
273
|
-
}
|
|
274
|
-
return { type, orientation };
|
|
275
|
-
}
|
|
276
|
-
case "deviceInfo":
|
|
277
|
-
return { type };
|
|
278
|
-
case "buttonDown":
|
|
279
|
-
case "buttonUp": {
|
|
280
|
-
const button = step.button === void 0 ? void 0 : stringValue(step.button, `${path}.button`);
|
|
281
|
-
return { type, ...button === void 0 ? {} : { button } };
|
|
282
|
-
}
|
|
283
|
-
case "incrementElement":
|
|
284
|
-
case "decrementElement":
|
|
285
|
-
return { type, id: stringValue(step.id, `${path}.id`) };
|
|
286
|
-
case "discoverStoreKitConfig":
|
|
287
|
-
case "clearStoreKitConfig":
|
|
288
|
-
return { type };
|
|
289
|
-
case "wait":
|
|
290
|
-
return { type, ms: numberValue(step.ms, `${path}.ms`) };
|
|
291
|
-
case "waitFor": {
|
|
292
|
-
const timeoutMs = semanticWaitTimeout(step, path);
|
|
293
|
-
const condition = step.condition === void 0 ? void 0 : stringValue(step.condition, `${path}.condition`);
|
|
294
|
-
if (condition !== void 0 && condition !== "present" && condition !== "mounted" && condition !== "absent") {
|
|
295
|
-
return validationFailure(
|
|
296
|
-
`${path}.condition`,
|
|
297
|
-
"must be present, mounted, or absent"
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
const selector = step.testID === void 0 ? { id: stringValue(step.id, `${path}.id`) } : { testID: stringValue(step.testID, `${path}.testID`) };
|
|
301
|
-
return {
|
|
302
|
-
type,
|
|
303
|
-
...selector,
|
|
304
|
-
...condition === void 0 ? {} : { condition },
|
|
305
|
-
...timeoutMs === void 0 ? {} : { timeoutMs }
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
default:
|
|
309
|
-
return validationFailure(`${path}.type`, "is not a supported perform step");
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
function findInvalidPointerSequence(steps) {
|
|
313
|
-
const open = /* @__PURE__ */ new Map();
|
|
314
|
-
for (const [index, step] of steps.entries()) {
|
|
315
|
-
if (step.type !== "touchDown" && step.type !== "touchMove" && step.type !== "touchUp" && step.type !== "touchCancel") {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
const pointerId = step.pointerId ?? 999;
|
|
319
|
-
if (!Number.isSafeInteger(pointerId)) {
|
|
320
|
-
return {
|
|
321
|
-
index,
|
|
322
|
-
error: `perform.steps[${index}] (${step.type}) has an invalid pointer id`
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
if (step.type === "touchDown") {
|
|
326
|
-
if (open.has(pointerId)) {
|
|
327
|
-
return {
|
|
328
|
-
index,
|
|
329
|
-
error: `perform.steps[${index}] (touchDown) starts pointer ${pointerId} before its previous touchUp or touchCancel`
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
open.set(pointerId, index);
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
if (!open.has(pointerId)) {
|
|
336
|
-
return {
|
|
337
|
-
index,
|
|
338
|
-
error: `perform.steps[${index}] (${step.type}) has no matching touchDown for pointer ${pointerId}`
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
if (step.type === "touchUp" || step.type === "touchCancel") {
|
|
342
|
-
open.delete(pointerId);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
const next = open.entries().next();
|
|
346
|
-
if (next.done) return null;
|
|
347
|
-
return {
|
|
348
|
-
index: next.value[1],
|
|
349
|
-
error: `perform.steps[${next.value[1]}] (touchDown) has no matching touchUp or touchCancel for pointer ${next.value[0]}`
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
function diagnosticsChannels(value, path) {
|
|
353
|
-
if (!Array.isArray(value)) validationFailure(path, "must be a list of channel names");
|
|
354
|
-
return value.map((channel) => stringValue(channel, path));
|
|
355
|
-
}
|
|
356
|
-
function parseDiagnosticsResult(value) {
|
|
357
|
-
if (!isRecord(value) || !Array.isArray(value.channels) || !value.channels.every((channel) => typeof channel === "string") || !Array.isArray(value.availableChannels) || !value.availableChannels.every((channel) => typeof channel === "string") || !Array.isArray(value.events)) {
|
|
358
|
-
validationFailure(
|
|
359
|
-
"remote diagnostics",
|
|
360
|
-
"returned an incompatible native host response"
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
return {
|
|
364
|
-
channels: value.channels,
|
|
365
|
-
availableChannels: value.availableChannels,
|
|
366
|
-
runtime: value.runtime,
|
|
367
|
-
found: value.found,
|
|
368
|
-
events: value.events
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
function parseDiagnosticsOptions(value) {
|
|
372
|
-
const options = recordValue(value, "diagnostics");
|
|
373
|
-
const channels = options.channels === void 0 ? void 0 : diagnosticsChannels(options.channels, "diagnostics.channels");
|
|
374
|
-
let channelControl;
|
|
375
|
-
if (options.channelControl !== void 0) {
|
|
376
|
-
if (channels !== void 0) {
|
|
377
|
-
validationFailure("diagnostics.channelControl", "cannot be combined with channels");
|
|
378
|
-
}
|
|
379
|
-
const control = recordValue(options.channelControl, "diagnostics.channelControl");
|
|
380
|
-
const action = control.action;
|
|
381
|
-
if (action !== "enable" && action !== "disable" && action !== "toggle") {
|
|
382
|
-
validationFailure(
|
|
383
|
-
"diagnostics.channelControl.action",
|
|
384
|
-
"must be enable, disable, or toggle"
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
const selected = diagnosticsChannels(
|
|
388
|
-
control.channels,
|
|
389
|
-
"diagnostics.channelControl.channels"
|
|
390
|
-
);
|
|
391
|
-
if (action === "toggle" && (selected.length !== 1 || selected[0] === "all")) {
|
|
392
|
-
validationFailure("diagnostics.channelControl", "toggle requires one channel");
|
|
393
|
-
}
|
|
394
|
-
channelControl = { action, channels: selected };
|
|
395
|
-
}
|
|
396
|
-
const find = options.find;
|
|
397
|
-
if (find !== void 0 && find !== "sheets" && find !== "portals" && find !== "boundaries") {
|
|
398
|
-
validationFailure("diagnostics.find", "must be sheets, portals, or boundaries");
|
|
399
|
-
}
|
|
400
|
-
return {
|
|
401
|
-
...channels === void 0 ? {} : { channels },
|
|
402
|
-
...channelControl === void 0 ? {} : { channelControl },
|
|
403
|
-
...find === void 0 ? {} : { find },
|
|
404
|
-
...options.recentChannel === void 0 ? {} : {
|
|
405
|
-
recentChannel: stringValue(options.recentChannel, "diagnostics.recentChannel")
|
|
406
|
-
},
|
|
407
|
-
...options.recentLimit === void 0 ? {} : {
|
|
408
|
-
recentLimit: numberValue(options.recentLimit, "diagnostics.recentLimit")
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
function parseStateOptions(value) {
|
|
413
|
-
const input = recordValue(value, "state");
|
|
414
|
-
const route = optionalBoolean(input, "route", "state");
|
|
415
|
-
const errors = optionalBoolean(input, "errors", "state");
|
|
416
|
-
const logs = optionalBoolean(input, "logs", "state");
|
|
417
|
-
const depth = optionalNumber(input, "depth", "state");
|
|
418
|
-
const errorLimit = optionalNumber(input, "errorLimit", "state");
|
|
419
|
-
const logLimit = optionalNumber(input, "logLimit", "state");
|
|
420
|
-
const layers = input.layers === void 0 ? void 0 : stringValue(input.layers, "state.layers");
|
|
421
|
-
if (layers !== void 0 && layers !== "full" && layers !== "tenant" && layers !== "shell") {
|
|
422
|
-
return validationFailure("state.layers", "must be full, tenant, or shell");
|
|
423
|
-
}
|
|
424
|
-
return {
|
|
425
|
-
screenshot: optionalBoolean(input, "screenshot", "state") ?? true,
|
|
426
|
-
tree: optionalBoolean(input, "tree", "state") ?? true,
|
|
427
|
-
...route === void 0 ? {} : { route },
|
|
428
|
-
...errors === void 0 ? {} : { errors },
|
|
429
|
-
...logs === void 0 ? {} : { logs },
|
|
430
|
-
...depth === void 0 ? {} : { depth },
|
|
431
|
-
...layers === void 0 ? {} : { layers },
|
|
432
|
-
...errorLimit === void 0 ? {} : { errorLimit },
|
|
433
|
-
...logLimit === void 0 ? {} : { logLimit }
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
function parseSemanticSelector(value, path) {
|
|
437
|
-
const selector = recordValue(value, path);
|
|
438
|
-
if (selector.testID !== void 0) {
|
|
439
|
-
return { testID: stringValue(selector.testID, `${path}.testID`) };
|
|
440
|
-
}
|
|
441
|
-
if (selector.text !== void 0) {
|
|
442
|
-
return { text: stringValue(selector.text, `${path}.text`) };
|
|
443
|
-
}
|
|
444
|
-
if (selector.role !== void 0) {
|
|
445
|
-
return { role: stringValue(selector.role, `${path}.role`) };
|
|
446
|
-
}
|
|
447
|
-
if (selector.type !== void 0) {
|
|
448
|
-
return { type: stringValue(selector.type, `${path}.type`) };
|
|
449
|
-
}
|
|
450
|
-
if (selector.pressable !== void 0) {
|
|
451
|
-
if (booleanValue(selector.pressable, `${path}.pressable`) !== true) {
|
|
452
|
-
return validationFailure(`${path}.pressable`, "must be true");
|
|
453
|
-
}
|
|
454
|
-
return { pressable: true };
|
|
455
|
-
}
|
|
456
|
-
if (selector.visible !== void 0) {
|
|
457
|
-
if (booleanValue(selector.visible, `${path}.visible`) !== true) {
|
|
458
|
-
return validationFailure(`${path}.visible`, "must be true");
|
|
459
|
-
}
|
|
460
|
-
return { visible: true };
|
|
461
|
-
}
|
|
462
|
-
return validationFailure(
|
|
463
|
-
path,
|
|
464
|
-
"must select testID, text, role, type, pressable, or visible"
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
|
-
function parseSemanticQuery(value) {
|
|
468
|
-
const query = recordValue(value, "query");
|
|
469
|
-
const kind = stringValue(query.kind, "query.kind");
|
|
470
|
-
if (kind === "count") return { kind };
|
|
471
|
-
if (kind === "accessibility") return { kind };
|
|
472
|
-
if (kind === "tree") {
|
|
473
|
-
const depth = optionalNumber(query, "depth", "query");
|
|
474
|
-
return { kind, ...depth === void 0 ? {} : { depth } };
|
|
475
|
-
}
|
|
476
|
-
if (kind === "find") {
|
|
477
|
-
return { kind, selector: parseSemanticSelector(query.selector, "query.selector") };
|
|
478
|
-
}
|
|
479
|
-
return validationFailure("query.kind", "must be tree, find, count, or accessibility");
|
|
480
|
-
}
|
|
481
|
-
function semanticResolveSelector(value, path) {
|
|
482
|
-
const selector = recordValue(value, path);
|
|
483
|
-
if (selector.testID !== void 0) {
|
|
484
|
-
return { testID: stringValue(selector.testID, `${path}.testID`) };
|
|
485
|
-
}
|
|
486
|
-
if (selector.text !== void 0) {
|
|
487
|
-
return { text: stringValue(selector.text, `${path}.text`) };
|
|
488
|
-
}
|
|
489
|
-
return validationFailure(path, "must select testID or text");
|
|
490
|
-
}
|
|
491
|
-
function parseSemanticResolveSelector(value) {
|
|
492
|
-
const selector = recordValue(value, "selector");
|
|
493
|
-
if (selector.nodeId !== void 0) {
|
|
494
|
-
const nodeId = numberValue(selector.nodeId, "selector.nodeId");
|
|
495
|
-
if (!Number.isSafeInteger(nodeId)) {
|
|
496
|
-
return validationFailure("selector.nodeId", "must be an integer");
|
|
497
|
-
}
|
|
498
|
-
return { nodeId };
|
|
499
|
-
}
|
|
500
|
-
return semanticResolveSelector(value, "selector");
|
|
501
|
-
}
|
|
502
|
-
function parseSemanticWaitOptions(value) {
|
|
503
|
-
const input = recordValue(value, "waitFor");
|
|
504
|
-
const condition = recordValue(input.condition, "waitFor.condition");
|
|
505
|
-
const type = stringValue(condition.type, "waitFor.condition.type");
|
|
506
|
-
const timeoutMs = semanticWaitTimeout(input, "waitFor");
|
|
507
|
-
if (type === "ready") {
|
|
508
|
-
const stableMs = optionalNumber(condition, "stableMs", "waitFor.condition");
|
|
509
|
-
if (stableMs !== void 0 && stableMs < 0) {
|
|
510
|
-
return validationFailure("waitFor.condition.stableMs", "must not be negative");
|
|
511
|
-
}
|
|
512
|
-
return {
|
|
513
|
-
condition: { type, ...stableMs === void 0 ? {} : { stableMs } },
|
|
514
|
-
...timeoutMs === void 0 ? {} : { timeoutMs }
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
if (type !== "present" && type !== "mounted" && type !== "absent") {
|
|
518
|
-
return validationFailure(
|
|
519
|
-
"waitFor.condition.type",
|
|
520
|
-
"must be ready, present, mounted, or absent"
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
return {
|
|
524
|
-
condition: {
|
|
525
|
-
type,
|
|
526
|
-
selector: semanticResolveSelector(condition.selector, "waitFor.condition.selector")
|
|
527
|
-
},
|
|
528
|
-
...timeoutMs === void 0 ? {} : { timeoutMs }
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
function parseResetOptions(value) {
|
|
532
|
-
const input = recordValue(value, "reset");
|
|
533
|
-
const strategy = input.strategy === void 0 ? "data" : stringValue(input.strategy, "reset.strategy");
|
|
534
|
-
if (strategy !== "data" && strategy !== "full") {
|
|
535
|
-
return validationFailure("reset.strategy", "must be data or full");
|
|
536
|
-
}
|
|
537
|
-
const from = input.from;
|
|
538
|
-
if (from !== void 0 && (typeof from !== "string" || from.length === 0 || from.length > 64)) {
|
|
539
|
-
return validationFailure("reset.from", "must name a simulator");
|
|
540
|
-
}
|
|
541
|
-
return {
|
|
542
|
-
strategy,
|
|
543
|
-
relaunch: optionalBoolean(input, "relaunch", "reset") ?? true,
|
|
544
|
-
...from === void 0 ? {} : { from }
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
function parseScreenshotOptions(value) {
|
|
548
|
-
const input = recordValue(value, "screenshot");
|
|
549
|
-
const layers = input.layers === void 0 ? void 0 : stringValue(input.layers, "screenshot.layers");
|
|
550
|
-
if (layers !== void 0 && layers !== "full" && layers !== "tenant" && layers !== "shell") {
|
|
551
|
-
return validationFailure("screenshot.layers", "must be full, tenant, or shell");
|
|
552
|
-
}
|
|
553
|
-
const crop = input.crop === void 0 ? void 0 : recordValue(input.crop, "screenshot.crop");
|
|
554
|
-
return {
|
|
555
|
-
...layers === void 0 ? {} : { layers },
|
|
556
|
-
...crop === void 0 ? {} : {
|
|
557
|
-
crop: {
|
|
558
|
-
x: numberValue(crop.x, "screenshot.crop.x"),
|
|
559
|
-
y: numberValue(crop.y, "screenshot.crop.y"),
|
|
560
|
-
w: numberValue(crop.w, "screenshot.crop.w"),
|
|
561
|
-
h: numberValue(crop.h, "screenshot.crop.h")
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
function parseTapTarget(value) {
|
|
567
|
-
if (value === void 0) return void 0;
|
|
568
|
-
const input = recordValue(value, "tap.target");
|
|
569
|
-
const target = {};
|
|
570
|
-
if (input.nodeId !== void 0 && input.nodeId !== null) {
|
|
571
|
-
const nodeId = numberValue(input.nodeId, "tap.target.nodeId");
|
|
572
|
-
if (!Number.isSafeInteger(nodeId))
|
|
573
|
-
validationFailure("tap.target.nodeId", "must be an integer");
|
|
574
|
-
target.nodeId = nodeId;
|
|
575
|
-
}
|
|
576
|
-
for (const key of ["id", "testID", "text", "type"]) {
|
|
577
|
-
if (input[key] !== void 0 && input[key] !== null)
|
|
578
|
-
target[key] = stringValue(input[key], `tap.target.${key}`);
|
|
579
|
-
}
|
|
580
|
-
if (target.nodeId === void 0 && !target.testID && !target.id)
|
|
581
|
-
validationFailure("tap.target", "requires nodeId, testID or id");
|
|
582
|
-
return target;
|
|
583
|
-
}
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
BridgeInputError,
|
|
4
|
+
SEMANTIC_WAIT_MAX_TIMEOUT_MS,
|
|
5
|
+
findInvalidPointerSequence,
|
|
6
|
+
parseDiagnosticsOptions,
|
|
7
|
+
parseDiagnosticsResult,
|
|
8
|
+
parsePerformStep,
|
|
9
|
+
parseRecorderCommand,
|
|
10
|
+
parseResetOptions,
|
|
11
|
+
parseScreenshotOptions,
|
|
12
|
+
parseSemanticQuery,
|
|
13
|
+
parseSemanticResolveSelector,
|
|
14
|
+
parseSemanticWaitOptions,
|
|
15
|
+
parseStateOptions,
|
|
16
|
+
parseTapTarget
|
|
17
|
+
} from "./esm-chunks/chunk-HP7DHONL.mjs";
|
|
18
|
+
import "./esm-chunks/chunk-6HFWZJ6C.mjs";
|
|
19
|
+
import "./esm-chunks/chunk-WQISIGIX.mjs";
|
|
20
|
+
import "./esm-chunks/chunk-4U7IGWPB.mjs";
|
|
584
21
|
export {
|
|
585
22
|
BridgeInputError,
|
|
586
23
|
SEMANTIC_WAIT_MAX_TIMEOUT_MS,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|