peachsim 0.1.570 → 0.1.572
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/LICENSE +1 -1
- package/README.md +108 -108
- package/cli/app-config.ts +1 -1
- package/cli/app-fonts.ts +4 -4
- package/cli/auth.ts +11 -11
- package/cli/bin.ts +4 -4
- package/cli/bridge-flow-runner.ts +28 -20
- package/cli/browser-evals.ts +2 -2
- package/cli/cli-update.ts +6 -6
- package/cli/cloud-client.ts +16 -16
- package/cli/cloud-dispatch.ts +3 -2
- package/cli/cloud-session.ts +12 -12
- package/cli/cloud-test-result-files.ts +97 -0
- package/cli/cloud-test-tunnel.ts +4 -4
- package/cli/command-registry.ts +7 -7
- package/cli/commands/agent-wrapper.ts +7 -7
- package/cli/commands/agent.ts +16 -16
- package/cli/commands/app-fonts.ts +3 -3
- package/cli/commands/assert.ts +10 -10
- package/cli/commands/auth.ts +5 -5
- package/cli/commands/box/checkout-plane.ts +1 -1
- package/cli/commands/box/plane-share.ts +2 -2
- package/cli/commands/box/rnx-command.ts +5 -5
- package/cli/commands/box.ts +38 -38
- package/cli/commands/camera.ts +13 -13
- package/cli/commands/cleanup.ts +13 -13
- package/cli/commands/compat.ts +7 -7
- package/cli/commands/config.ts +5 -5
- package/cli/commands/control.ts +63 -63
- package/cli/commands/cpu-profile.ts +11 -11
- package/cli/commands/daemon-mac-app.ts +10 -10
- package/cli/commands/daemon.ts +29 -27
- package/cli/commands/debug.ts +35 -35
- package/cli/commands/desktop.ts +3 -3
- package/cli/commands/detox.ts +33 -33
- package/cli/commands/device.ts +9 -9
- package/cli/commands/diagnose.ts +17 -17
- package/cli/commands/do-chain.ts +4 -4
- package/cli/commands/electron.ts +9 -9
- package/cli/commands/film.ts +9 -9
- package/cli/commands/flow.ts +49 -49
- package/cli/commands/inspect/core.ts +12 -12
- package/cli/commands/inspect/count.ts +1 -1
- package/cli/commands/inspect/describe.ts +1 -1
- package/cli/commands/inspect/env.ts +2 -2
- package/cli/commands/inspect/find.ts +2 -2
- package/cli/commands/inspect/get-layout.ts +2 -2
- package/cli/commands/inspect/keyboard.ts +1 -1
- package/cli/commands/inspect/list.ts +4 -4
- package/cli/commands/inspect/memory.ts +1 -1
- package/cli/commands/inspect/resolve-target.ts +1 -1
- package/cli/commands/inspect/screens.ts +1 -1
- package/cli/commands/inspect/shared.ts +1 -1
- package/cli/commands/inspect/tree.ts +1 -1
- package/cli/commands/inspect/url.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +5 -5
- package/cli/commands/inspect.ts +82 -82
- package/cli/commands/install-cli.ts +16 -16
- package/cli/commands/install-desktop.ts +26 -26
- package/cli/commands/login.ts +11 -11
- package/cli/commands/maestro-generate.ts +10 -10
- package/cli/commands/maestro.ts +173 -71
- package/cli/commands/mode.ts +4 -4
- package/cli/commands/no-bridge-hint.ts +12 -12
- package/cli/commands/perf.ts +11 -11
- package/cli/commands/permissions.ts +5 -5
- package/cli/commands/platform.ts +21 -21
- package/cli/commands/preview.ts +5 -5
- package/cli/commands/profile.ts +12 -12
- package/cli/commands/react.ts +15 -15
- package/cli/commands/record.ts +31 -31
- package/cli/commands/report-issue.ts +4 -4
- package/cli/commands/reset.ts +2 -2
- package/cli/commands/runtime.ts +23 -23
- package/cli/commands/screenshot-command.ts +2 -2
- package/cli/commands/screenshot-layers.ts +5 -5
- package/cli/commands/screenshot-mode.ts +7 -7
- package/cli/commands/screenshot.ts +24 -24
- package/cli/commands/screenshots-capture.ts +13 -13
- package/cli/commands/screenshots.ts +6 -6
- package/cli/commands/serve.ts +12 -12
- package/cli/commands/setup.ts +25 -25
- package/cli/commands/skills.ts +30 -23
- package/cli/commands/slides.ts +20 -20
- package/cli/commands/state.ts +2 -2
- package/cli/commands/storage.ts +3 -3
- package/cli/commands/telemetry.ts +2 -2
- package/cli/commands/test.ts +176 -18
- package/cli/commands/three-mode.ts +17 -17
- package/cli/commands/timeline.ts +12 -12
- package/cli/commands/upgrade.ts +11 -11
- package/cli/commands/upload.ts +26 -26
- package/cli/commands/version.ts +7 -7
- package/cli/commands/what-happened.ts +20 -20
- package/cli/current-sim.ts +3 -3
- package/cli/desktop-companion.ts +16 -16
- package/cli/drivers/electron.ts +4 -4
- package/cli/drivers/playwright-sim-host.ts +7 -7
- package/cli/drivers/playwright.ts +4 -4
- package/cli/drivers/registry.ts +1 -1
- package/cli/drivers/types.ts +5 -5
- package/cli/flow-export.ts +1 -1
- package/cli/flow-file.ts +5 -5
- package/cli/flow-session.ts +1 -1
- package/cli/help-core.ts +13 -13
- package/cli/hints.ts +14 -14
- package/cli/inspect-notice-state.ts +1 -1
- package/cli/internal-child.ts +2 -2
- package/cli/maestro-js.ts +4 -4
- package/cli/maestro-report.ts +4 -2
- package/cli/main.ts +14 -14
- package/cli/outbound-endpoints.ts +32 -30
- package/cli/parse-args.ts +7 -7
- package/cli/privacy.ts +1 -1
- package/cli/recording-access.ts +10 -10
- package/cli/resolve-assets.ts +2 -2
- package/cli/rnx-in-process.ts +5 -5
- package/cli/run-registry.ts +3 -2
- package/cli/run-rnx-core.ts +3 -3
- package/cli/run-rnx.ts +1 -1
- package/cli/runtime-notes.ts +1 -1
- package/cli/self-invocation.ts +1 -1
- package/cli/send-to-box.ts +1 -1
- package/cli/shell-init.ts +40 -40
- package/cli/ui.ts +1 -1
- package/cli/ws-bridge.ts +22 -22
- package/detox/config-loader.ts +1 -1
- package/detox/index.ts +28 -28
- package/detox/jest-preset.cjs +2 -2
- package/detox/navigation.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +12 -12
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +2 -2
- package/dist-lib/agent-sessions.cjs +12 -12
- package/dist-lib/attached-projects.cjs +4 -4
- package/dist-lib/auth/shared-session.cjs +4 -4
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +4 -4
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +2 -2
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +116 -0
- package/dist-lib/cloud-test-args.mjs +86 -0
- package/dist-lib/cloud.cjs +42 -42
- package/dist-lib/cloud.mjs +42 -42
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/detox/index.cjs +29 -29
- package/dist-lib/detox/jest-preset.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +12 -12
- package/dist-lib/host/bridge-host.cjs +87 -77
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +6 -6
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +63 -73
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/menu.cjs +5 -5
- package/dist-lib/menu.mjs +5 -5
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +15 -15
- package/dist-lib/profiles.cjs +4 -4
- package/dist-lib/public-brand.cjs +3 -3
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +2 -1
- package/dist-lib/sdk.cjs +9 -9
- package/dist-lib/sdk.mjs +9 -9
- package/dist-lib/skills.cjs +534 -520
- package/dist-lib/swift-compile.cjs +372 -0
- package/dist-lib/swift-compile.mjs +339 -0
- package/dist-lib/swift-package.cjs +78 -0
- package/dist-lib/swift-package.mjs +52 -0
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite.cjs +479 -161
- package/package.json +22 -1
- package/scripts/dev-server-scanner.ts +4 -3
- package/skills/contrast/SKILL.md +75 -75
- package/skills/{rnx-debug → peach-debug}/SKILL.md +90 -90
- package/skills/{rnx-perf → peach-perf}/SKILL.md +13 -13
- package/skills/{rnx-setup → peach-setup}/SKILL.md +60 -60
- package/skills/{rnx-test → peach-test}/SKILL.md +47 -47
- package/skills/{rnx-visual → peach-visual}/SKILL.md +26 -26
- package/src/agent-daemon-client.ts +5 -5
- package/src/agent-events.ts +1 -1
- package/src/agent-identity.ts +1 -1
- package/src/agent-sessions.ts +13 -13
- package/src/attached-projects.ts +1 -1
- package/src/auth/shared-session.ts +1 -1
- package/src/bridge-constants.ts +3 -3
- package/src/bridge-contract-input.ts +1 -1
- package/src/bridge-contract.ts +3 -3
- package/src/cli-version.ts +6 -6
- package/src/cloud-test-args.ts +100 -0
- package/src/cloud.ts +40 -40
- package/src/config.ts +1 -1
- package/src/connect.ts +6 -6
- package/src/dev-server-open.ts +8 -8
- package/src/disk-cleanup.ts +3 -3
- package/src/home-paths.ts +26 -26
- package/src/host/agent-host.ts +3 -3
- package/src/host/bridge-host.ts +33 -33
- package/src/host/fetch-proxy-handler.ts +1 -1
- package/src/host/plane-host.ts +2 -2
- package/src/host/replacement-module-handler.ts +2 -2
- package/src/menu.ts +2 -2
- package/src/metro-plugin.ts +7 -7
- package/src/metro-production-bundle.ts +2 -2
- package/src/native-dev-bundle-url.ts +2 -2
- package/src/playwright-host-log.ts +1 -1
- package/src/public-brand.ts +2 -2
- package/src/react-native-host-modules.ts +1 -1
- package/src/rolldown-plugin-swift.ts +11 -10
- package/src/runtime-assets.ts +11 -11
- package/src/runtime-delivery.ts +6 -6
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/org-deck.ts +1 -1
- package/src/screenshots/schema.ts +2 -2
- package/src/sim-client.ts +1 -1
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/swift-compile.ts +359 -0
- package/src/swift-package.ts +69 -0
- package/src/swift-submit.ts +3 -2
- package/src/vite-plugin-one.ts +8 -8
- package/src/vite-plugin-swift.ts +106 -110
- package/src/vite-plugin.ts +6 -19
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*! rnx v0.1.572 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/cloud-test-args.ts
|
|
23
|
+
var cloud_test_args_exports = {};
|
|
24
|
+
__export(cloud_test_args_exports, {
|
|
25
|
+
CLOUD_TEST_ARGS_MAX_BYTES: () => CLOUD_TEST_ARGS_MAX_BYTES,
|
|
26
|
+
CLOUD_TEST_ARGS_MAX_COUNT: () => CLOUD_TEST_ARGS_MAX_COUNT,
|
|
27
|
+
CLOUD_TEST_ARG_MAX_LENGTH: () => CLOUD_TEST_ARG_MAX_LENGTH,
|
|
28
|
+
CLOUD_TEST_VALUE_FLAGS: () => CLOUD_TEST_VALUE_FLAGS,
|
|
29
|
+
isCloudTestValueFlag: () => isCloudTestValueFlag,
|
|
30
|
+
parseCloudTestArgs: () => parseCloudTestArgs
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(cloud_test_args_exports);
|
|
33
|
+
var CLOUD_TEST_ARGS_MAX_COUNT = 32;
|
|
34
|
+
var CLOUD_TEST_ARG_MAX_LENGTH = 1e3;
|
|
35
|
+
var CLOUD_TEST_ARGS_MAX_BYTES = 16 * 1024;
|
|
36
|
+
var CLOUD_TEST_VALUE_FLAGS = [
|
|
37
|
+
"-t",
|
|
38
|
+
"--testNamePattern",
|
|
39
|
+
"--testPathPattern",
|
|
40
|
+
"--include-tags",
|
|
41
|
+
"--exclude-tags",
|
|
42
|
+
"--grep"
|
|
43
|
+
];
|
|
44
|
+
var CLOUD_TEST_VALUE_FLAG_SET = new Set(CLOUD_TEST_VALUE_FLAGS);
|
|
45
|
+
function isCloudTestValueFlag(name) {
|
|
46
|
+
return CLOUD_TEST_VALUE_FLAG_SET.has(name);
|
|
47
|
+
}
|
|
48
|
+
function parseCloudTestArgs(value) {
|
|
49
|
+
if (value === void 0 || value === null) return { ok: true, args: [] };
|
|
50
|
+
if (!Array.isArray(value)) {
|
|
51
|
+
return { ok: false, message: "testArgs must be an array of strings" };
|
|
52
|
+
}
|
|
53
|
+
if (value.length > CLOUD_TEST_ARGS_MAX_COUNT) {
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
message: `testArgs may contain at most ${CLOUD_TEST_ARGS_MAX_COUNT} entries`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const encoder = new TextEncoder();
|
|
60
|
+
let bytes = 0;
|
|
61
|
+
const entries = [];
|
|
62
|
+
for (const entry of value) {
|
|
63
|
+
if (typeof entry !== "string" || entry.length === 0) {
|
|
64
|
+
return { ok: false, message: "testArgs entries must be non-empty strings" };
|
|
65
|
+
}
|
|
66
|
+
if (entry.length > CLOUD_TEST_ARG_MAX_LENGTH || entry.includes("\0")) {
|
|
67
|
+
return { ok: false, message: `testArgs entry is too long or carries a NUL byte: ${entry.slice(0, 60)}` };
|
|
68
|
+
}
|
|
69
|
+
bytes += encoder.encode(entry).length;
|
|
70
|
+
if (bytes > CLOUD_TEST_ARGS_MAX_BYTES) {
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
message: `testArgs may contain at most ${CLOUD_TEST_ARGS_MAX_BYTES} bytes`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
entries.push(entry);
|
|
77
|
+
}
|
|
78
|
+
const args = [];
|
|
79
|
+
for (let i = 0; i < entries.length; i++) {
|
|
80
|
+
const entry = entries[i];
|
|
81
|
+
if (!entry.startsWith("-")) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
message: `testArgs carries a positional argument (selection flags only): ${entry.slice(0, 60)}`
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const eq = entry.indexOf("=");
|
|
88
|
+
const head = eq > 0 ? entry.slice(0, eq) : entry;
|
|
89
|
+
if (!isCloudTestValueFlag(head)) {
|
|
90
|
+
return { ok: false, message: `testArgs carries an unknown flag: ${head.slice(0, 60)}` };
|
|
91
|
+
}
|
|
92
|
+
if (eq > 0) {
|
|
93
|
+
if (!entry.slice(eq + 1)) {
|
|
94
|
+
return { ok: false, message: `${head} expects a value` };
|
|
95
|
+
}
|
|
96
|
+
args.push(entry);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const val = entries[i + 1];
|
|
100
|
+
if (val === void 0 || val.startsWith("-")) {
|
|
101
|
+
return { ok: false, message: `${head} expects a value` };
|
|
102
|
+
}
|
|
103
|
+
args.push(entry, val);
|
|
104
|
+
i += 1;
|
|
105
|
+
}
|
|
106
|
+
return { ok: true, args };
|
|
107
|
+
}
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
CLOUD_TEST_ARGS_MAX_BYTES,
|
|
111
|
+
CLOUD_TEST_ARGS_MAX_COUNT,
|
|
112
|
+
CLOUD_TEST_ARG_MAX_LENGTH,
|
|
113
|
+
CLOUD_TEST_VALUE_FLAGS,
|
|
114
|
+
isCloudTestValueFlag,
|
|
115
|
+
parseCloudTestArgs
|
|
116
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*! rnx v0.1.572 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
|
|
3
|
+
// src/cloud-test-args.ts
|
|
4
|
+
var CLOUD_TEST_ARGS_MAX_COUNT = 32;
|
|
5
|
+
var CLOUD_TEST_ARG_MAX_LENGTH = 1e3;
|
|
6
|
+
var CLOUD_TEST_ARGS_MAX_BYTES = 16 * 1024;
|
|
7
|
+
var CLOUD_TEST_VALUE_FLAGS = [
|
|
8
|
+
"-t",
|
|
9
|
+
"--testNamePattern",
|
|
10
|
+
"--testPathPattern",
|
|
11
|
+
"--include-tags",
|
|
12
|
+
"--exclude-tags",
|
|
13
|
+
"--grep"
|
|
14
|
+
];
|
|
15
|
+
var CLOUD_TEST_VALUE_FLAG_SET = new Set(CLOUD_TEST_VALUE_FLAGS);
|
|
16
|
+
function isCloudTestValueFlag(name) {
|
|
17
|
+
return CLOUD_TEST_VALUE_FLAG_SET.has(name);
|
|
18
|
+
}
|
|
19
|
+
function parseCloudTestArgs(value) {
|
|
20
|
+
if (value === void 0 || value === null) return { ok: true, args: [] };
|
|
21
|
+
if (!Array.isArray(value)) {
|
|
22
|
+
return { ok: false, message: "testArgs must be an array of strings" };
|
|
23
|
+
}
|
|
24
|
+
if (value.length > CLOUD_TEST_ARGS_MAX_COUNT) {
|
|
25
|
+
return {
|
|
26
|
+
ok: false,
|
|
27
|
+
message: `testArgs may contain at most ${CLOUD_TEST_ARGS_MAX_COUNT} entries`
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const encoder = new TextEncoder();
|
|
31
|
+
let bytes = 0;
|
|
32
|
+
const entries = [];
|
|
33
|
+
for (const entry of value) {
|
|
34
|
+
if (typeof entry !== "string" || entry.length === 0) {
|
|
35
|
+
return { ok: false, message: "testArgs entries must be non-empty strings" };
|
|
36
|
+
}
|
|
37
|
+
if (entry.length > CLOUD_TEST_ARG_MAX_LENGTH || entry.includes("\0")) {
|
|
38
|
+
return { ok: false, message: `testArgs entry is too long or carries a NUL byte: ${entry.slice(0, 60)}` };
|
|
39
|
+
}
|
|
40
|
+
bytes += encoder.encode(entry).length;
|
|
41
|
+
if (bytes > CLOUD_TEST_ARGS_MAX_BYTES) {
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
message: `testArgs may contain at most ${CLOUD_TEST_ARGS_MAX_BYTES} bytes`
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
entries.push(entry);
|
|
48
|
+
}
|
|
49
|
+
const args = [];
|
|
50
|
+
for (let i = 0; i < entries.length; i++) {
|
|
51
|
+
const entry = entries[i];
|
|
52
|
+
if (!entry.startsWith("-")) {
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
message: `testArgs carries a positional argument (selection flags only): ${entry.slice(0, 60)}`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const eq = entry.indexOf("=");
|
|
59
|
+
const head = eq > 0 ? entry.slice(0, eq) : entry;
|
|
60
|
+
if (!isCloudTestValueFlag(head)) {
|
|
61
|
+
return { ok: false, message: `testArgs carries an unknown flag: ${head.slice(0, 60)}` };
|
|
62
|
+
}
|
|
63
|
+
if (eq > 0) {
|
|
64
|
+
if (!entry.slice(eq + 1)) {
|
|
65
|
+
return { ok: false, message: `${head} expects a value` };
|
|
66
|
+
}
|
|
67
|
+
args.push(entry);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const val = entries[i + 1];
|
|
71
|
+
if (val === void 0 || val.startsWith("-")) {
|
|
72
|
+
return { ok: false, message: `${head} expects a value` };
|
|
73
|
+
}
|
|
74
|
+
args.push(entry, val);
|
|
75
|
+
i += 1;
|
|
76
|
+
}
|
|
77
|
+
return { ok: true, args };
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
CLOUD_TEST_ARGS_MAX_BYTES,
|
|
81
|
+
CLOUD_TEST_ARGS_MAX_COUNT,
|
|
82
|
+
CLOUD_TEST_ARG_MAX_LENGTH,
|
|
83
|
+
CLOUD_TEST_VALUE_FLAGS,
|
|
84
|
+
isCloudTestValueFlag,
|
|
85
|
+
parseCloudTestArgs
|
|
86
|
+
};
|
package/dist-lib/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.572 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -170,11 +170,11 @@ function rnxCloudScopesAllowCommand(scopes, type) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// src/public-brand.ts
|
|
173
|
-
var name = "
|
|
173
|
+
var name = "Peach";
|
|
174
174
|
var rnxPublicBrand = Object.freeze({
|
|
175
175
|
name,
|
|
176
176
|
packageName: "peachsim",
|
|
177
|
-
commandName: "
|
|
177
|
+
commandName: "peach",
|
|
178
178
|
domain: "rnxsim.com",
|
|
179
179
|
origin: "https://rnxsim.com"
|
|
180
180
|
});
|
|
@@ -192,18 +192,18 @@ function normalizeCloudOrigin(source) {
|
|
|
192
192
|
try {
|
|
193
193
|
parsed = new URL(source);
|
|
194
194
|
} catch {
|
|
195
|
-
throw new Error(`invalid
|
|
195
|
+
throw new Error(`invalid Peach Cloud origin: ${source}`);
|
|
196
196
|
}
|
|
197
197
|
if (parsed.protocol !== "https:" && parsed.protocol !== "http:" || parsed.username || parsed.password || parsed.pathname !== "/" || parsed.search || parsed.hash) {
|
|
198
|
-
throw new Error(`
|
|
198
|
+
throw new Error(`Peach Cloud origin must be an HTTP(S) origin: ${source}`);
|
|
199
199
|
}
|
|
200
200
|
if (parsed.protocol === "http:" && !isLoopbackHost(parsed.hostname)) {
|
|
201
|
-
throw new Error(`
|
|
201
|
+
throw new Error(`Peach Cloud origin requires HTTPS outside loopback: ${source}`);
|
|
202
202
|
}
|
|
203
203
|
return parsed.origin;
|
|
204
204
|
}
|
|
205
205
|
function resolveOrigin(value) {
|
|
206
|
-
const configured = value?.trim() || process.env.
|
|
206
|
+
const configured = value?.trim() || process.env.PEACH_CLOUD_ORIGIN?.trim();
|
|
207
207
|
return normalizeCloudOrigin(configured || rnxPublicBrand.origin);
|
|
208
208
|
}
|
|
209
209
|
function responseError(status, text) {
|
|
@@ -212,13 +212,13 @@ function responseError(status, text) {
|
|
|
212
212
|
const parsed = JSON.parse(text);
|
|
213
213
|
const error = isRecord(parsed) ? parsed.error : null;
|
|
214
214
|
if (isRecord(error) && typeof error.message === "string") {
|
|
215
|
-
return new Error(`
|
|
215
|
+
return new Error(`Peach Cloud request failed (${status}): ${error.message}`);
|
|
216
216
|
}
|
|
217
217
|
} catch {
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
return new Error(
|
|
221
|
-
`
|
|
221
|
+
`Peach Cloud request failed (${status})${text.trim() ? `: ${text.trim()}` : ""}`
|
|
222
222
|
);
|
|
223
223
|
}
|
|
224
224
|
function readCloudErrorCode(text) {
|
|
@@ -294,16 +294,16 @@ function readJsArtifact(bytes) {
|
|
|
294
294
|
try {
|
|
295
295
|
source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
296
296
|
} catch {
|
|
297
|
-
throw new Error("
|
|
297
|
+
throw new Error("peach Cloud artifact must be valid UTF-8 JavaScript, not bytecode");
|
|
298
298
|
}
|
|
299
299
|
if (source.includes("\0") || !source.includes("__d(") || !source.includes("__r(")) {
|
|
300
|
-
throw new Error("
|
|
300
|
+
throw new Error("peach Cloud artifact must be a Metro JavaScript bundle");
|
|
301
301
|
}
|
|
302
302
|
return source;
|
|
303
303
|
}
|
|
304
304
|
function readClaim(value) {
|
|
305
305
|
if (!isRecord(value) || typeof value.id !== "string" || !value.id || typeof value.expiresAt !== "number") {
|
|
306
|
-
throw new Error("
|
|
306
|
+
throw new Error("Peach Cloud returned an invalid claim");
|
|
307
307
|
}
|
|
308
308
|
return { id: value.id, expiresAt: value.expiresAt };
|
|
309
309
|
}
|
|
@@ -312,15 +312,15 @@ function artifactDigestId(sha256) {
|
|
|
312
312
|
}
|
|
313
313
|
function readArtifact(value, expectedId, expectedBytes) {
|
|
314
314
|
if (!isRecord(value) || value.id !== expectedId || typeof value.bytes !== "number" || !Number.isInteger(value.bytes) || value.bytes !== expectedBytes) {
|
|
315
|
-
throw new Error("
|
|
315
|
+
throw new Error("Peach Cloud returned an invalid artifact receipt");
|
|
316
316
|
}
|
|
317
317
|
return { id: expectedId, bytes: expectedBytes };
|
|
318
318
|
}
|
|
319
319
|
function readSimulatorCreate(value, expectedId, expectedBytes) {
|
|
320
|
-
if (!isRecord(value)) throw new Error("
|
|
320
|
+
if (!isRecord(value)) throw new Error("Peach Cloud create returned an invalid simulator");
|
|
321
321
|
const claim = readClaim(value.claim);
|
|
322
322
|
if (typeof value.simId !== "string" || !value.simId || typeof value.token !== "string") {
|
|
323
|
-
throw new Error("
|
|
323
|
+
throw new Error("Peach Cloud create returned an invalid simulator");
|
|
324
324
|
}
|
|
325
325
|
return {
|
|
326
326
|
simId: value.simId,
|
|
@@ -331,10 +331,10 @@ function readSimulatorCreate(value, expectedId, expectedBytes) {
|
|
|
331
331
|
}
|
|
332
332
|
function readBoxCreate(value, expectedBytes, expectedSha256) {
|
|
333
333
|
const artifactId = artifactDigestId(expectedSha256);
|
|
334
|
-
if (!isRecord(value)) throw new Error("
|
|
334
|
+
if (!isRecord(value)) throw new Error("Peach Cloud create returned invalid JSON");
|
|
335
335
|
const simulator = readSimulatorCreate(value.simulator, artifactId, expectedBytes);
|
|
336
336
|
if (typeof value.boxId !== "string" || !value.boxId || value.size !== "nano" || typeof value.token !== "string" || !value.token) {
|
|
337
|
-
throw new Error("
|
|
337
|
+
throw new Error("Peach Cloud create returned an invalid box receipt");
|
|
338
338
|
}
|
|
339
339
|
return {
|
|
340
340
|
receipt: {
|
|
@@ -357,11 +357,11 @@ function cloudCommand(command, scopes) {
|
|
|
357
357
|
if (key !== "id" && key !== "simId") clean[key] = value;
|
|
358
358
|
}
|
|
359
359
|
if (!isRnxCloudCommandType(command.type)) {
|
|
360
|
-
throw new Error(`
|
|
360
|
+
throw new Error(`Peach Cloud does not support bridge command type ${command.type}`);
|
|
361
361
|
}
|
|
362
362
|
if (!rnxCloudScopesAllowCommand(scopes, command.type)) {
|
|
363
363
|
throw new Error(
|
|
364
|
-
`
|
|
364
|
+
`Peach Cloud command ${command.type} requires the ${rnxCloudCommandScope(command.type)} scope`
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
return { ...clean, type: command.type };
|
|
@@ -395,23 +395,23 @@ var RemoteSimulator = class {
|
|
|
395
395
|
layers: options?.layers ?? "tenant"
|
|
396
396
|
});
|
|
397
397
|
if (typeof result !== "string" || !result.startsWith("data:image/")) {
|
|
398
|
-
throw new Error("
|
|
398
|
+
throw new Error("Peach Cloud screenshot did not return an image data url");
|
|
399
399
|
}
|
|
400
400
|
return result;
|
|
401
401
|
},
|
|
402
402
|
capture: async () => {
|
|
403
403
|
const result = await this.sendCommand({ type: "capture" });
|
|
404
404
|
if (!isRnxScreenCapture(result)) {
|
|
405
|
-
throw new Error("
|
|
405
|
+
throw new Error("Peach Cloud capture returned an invalid screen capture");
|
|
406
406
|
}
|
|
407
407
|
return result;
|
|
408
408
|
},
|
|
409
409
|
reset: (options) => {
|
|
410
410
|
if (options?.strategy !== void 0 && options.strategy !== "data" && options.strategy !== "full") {
|
|
411
|
-
throw new Error("
|
|
411
|
+
throw new Error("Peach Cloud reset strategy must be data or full");
|
|
412
412
|
}
|
|
413
413
|
if (options?.from !== void 0 && (typeof options.from !== "string" || options.from.length === 0)) {
|
|
414
|
-
throw new Error("
|
|
414
|
+
throw new Error("Peach Cloud reset from must name a simulator");
|
|
415
415
|
}
|
|
416
416
|
return this.sendCommand(
|
|
417
417
|
options === void 0 ? { type: "reset" } : {
|
|
@@ -471,7 +471,7 @@ var RemoteSimulator = class {
|
|
|
471
471
|
);
|
|
472
472
|
} catch (error) {
|
|
473
473
|
throw new Error(
|
|
474
|
-
`could not reach
|
|
474
|
+
`could not reach Peach Cloud at ${this.session.origin}: ${error instanceof Error ? error.message : String(error)}`
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
477
|
const text = await response.text();
|
|
@@ -480,14 +480,14 @@ var RemoteSimulator = class {
|
|
|
480
480
|
try {
|
|
481
481
|
parsed = JSON.parse(text);
|
|
482
482
|
} catch {
|
|
483
|
-
throw new Error("
|
|
483
|
+
throw new Error("Peach Cloud command returned unreadable JSON");
|
|
484
484
|
}
|
|
485
485
|
if (!isRecord(parsed) || parsed.id !== body.id) {
|
|
486
|
-
throw new Error("
|
|
486
|
+
throw new Error("Peach Cloud command returned an invalid command receipt");
|
|
487
487
|
}
|
|
488
488
|
if (typeof parsed.error === "string" && parsed.error) throw new Error(parsed.error);
|
|
489
489
|
if (!Object.hasOwn(parsed, "result")) {
|
|
490
|
-
throw new Error("
|
|
490
|
+
throw new Error("Peach Cloud command receipt has no result");
|
|
491
491
|
}
|
|
492
492
|
return parsed.result;
|
|
493
493
|
}
|
|
@@ -513,11 +513,11 @@ var RemoteSimulator = class {
|
|
|
513
513
|
try {
|
|
514
514
|
parsed = JSON.parse(text);
|
|
515
515
|
} catch {
|
|
516
|
-
throw new Error("
|
|
516
|
+
throw new Error("Peach Cloud claim returned unreadable JSON");
|
|
517
517
|
}
|
|
518
518
|
const claim = readClaim(isRecord(parsed) ? parsed.claim : null);
|
|
519
519
|
if (claim.id !== claimId) {
|
|
520
|
-
throw new Error("
|
|
520
|
+
throw new Error("Peach Cloud confirmation replaced the initial claim");
|
|
521
521
|
}
|
|
522
522
|
this.session = { ...this.session, claim };
|
|
523
523
|
return claim;
|
|
@@ -543,17 +543,17 @@ var RemoteSimulator = class {
|
|
|
543
543
|
async function createRemoteSimulator(input) {
|
|
544
544
|
if (input.artifact.byteLength > RNX_CLOUD_MAX_ARTIFACT_BYTES) {
|
|
545
545
|
throw new Error(
|
|
546
|
-
`
|
|
546
|
+
`peach Cloud artifact is ${input.artifact.byteLength} bytes and exceeds the ${RNX_CLOUD_MAX_ARTIFACT_BYTES}-byte limit`
|
|
547
547
|
);
|
|
548
548
|
}
|
|
549
549
|
if (input.artifact.byteLength <= 0) {
|
|
550
|
-
throw new Error("
|
|
550
|
+
throw new Error("peach Cloud artifact is empty");
|
|
551
551
|
}
|
|
552
552
|
readJsArtifact(input.artifact);
|
|
553
553
|
const origin = resolveOrigin(input.origin);
|
|
554
554
|
const sha256 = await sha256Hex(input.artifact);
|
|
555
555
|
if (input.sha256 && input.sha256 !== sha256) {
|
|
556
|
-
throw new Error("
|
|
556
|
+
throw new Error("peach Cloud artifact sha256 does not match the provided digest");
|
|
557
557
|
}
|
|
558
558
|
const device = input.device?.trim() || DEFAULT_DEVICE;
|
|
559
559
|
let response;
|
|
@@ -572,7 +572,7 @@ async function createRemoteSimulator(input) {
|
|
|
572
572
|
});
|
|
573
573
|
} catch (error) {
|
|
574
574
|
throw new Error(
|
|
575
|
-
`could not reach
|
|
575
|
+
`could not reach Peach Cloud at ${origin}: ${error instanceof Error ? error.message : String(error)}`
|
|
576
576
|
);
|
|
577
577
|
}
|
|
578
578
|
const responseText = await response.text();
|
|
@@ -581,7 +581,7 @@ async function createRemoteSimulator(input) {
|
|
|
581
581
|
try {
|
|
582
582
|
parsed = JSON.parse(responseText);
|
|
583
583
|
} catch {
|
|
584
|
-
throw new Error("
|
|
584
|
+
throw new Error("Peach Cloud create returned unreadable JSON");
|
|
585
585
|
}
|
|
586
586
|
const created = readBoxCreate(parsed, input.artifact.byteLength, sha256);
|
|
587
587
|
const simulator = new RemoteSimulator({
|
|
@@ -599,7 +599,7 @@ async function createRemoteSimulator(input) {
|
|
|
599
599
|
}
|
|
600
600
|
function readSimArtifact(value) {
|
|
601
601
|
if (!isRecord(value) || typeof value.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.sha256) || typeof value.bytes !== "number" || !Number.isInteger(value.bytes) || value.bytes <= 0) {
|
|
602
|
-
throw new Error("
|
|
602
|
+
throw new Error("Peach Cloud returned an invalid simulator artifact");
|
|
603
603
|
}
|
|
604
604
|
return { id: `sha256:${value.sha256}`, bytes: value.bytes };
|
|
605
605
|
}
|
|
@@ -612,13 +612,13 @@ function readConnectScopes(value, token) {
|
|
|
612
612
|
if (!isRecord(value) || typeof value.id !== "string" || !value.id || !Array.isArray(value.scopes) || value.scopes.length === 0 || !value.scopes.every(
|
|
613
613
|
(scope) => typeof scope === "string" && isRnxCloudCommandScope(scope)
|
|
614
614
|
) || typeof value.expiresAt !== "number") {
|
|
615
|
-
throw new Error("
|
|
615
|
+
throw new Error("Peach Cloud returned an invalid scoped token");
|
|
616
616
|
}
|
|
617
617
|
return Object.freeze([...value.scopes]);
|
|
618
618
|
}
|
|
619
619
|
async function connect(input) {
|
|
620
|
-
if (!input.id) throw new Error("
|
|
621
|
-
if (!input.token) throw new Error("
|
|
620
|
+
if (!input.id) throw new Error("Peach Cloud connect needs a simulator id");
|
|
621
|
+
if (!input.token) throw new Error("Peach Cloud connect needs a token");
|
|
622
622
|
const origin = resolveOrigin(input.origin);
|
|
623
623
|
let response;
|
|
624
624
|
try {
|
|
@@ -628,7 +628,7 @@ async function connect(input) {
|
|
|
628
628
|
);
|
|
629
629
|
} catch (error) {
|
|
630
630
|
throw new Error(
|
|
631
|
-
`could not reach
|
|
631
|
+
`could not reach Peach Cloud at ${origin}: ${error instanceof Error ? error.message : String(error)}`
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
634
|
const text = await response.text();
|
|
@@ -637,14 +637,14 @@ async function connect(input) {
|
|
|
637
637
|
try {
|
|
638
638
|
parsed = JSON.parse(text);
|
|
639
639
|
} catch {
|
|
640
|
-
throw new Error("
|
|
640
|
+
throw new Error("Peach Cloud connect returned unreadable JSON");
|
|
641
641
|
}
|
|
642
642
|
if (!isRecord(parsed) || !isRecord(parsed.sim)) {
|
|
643
|
-
throw new Error("
|
|
643
|
+
throw new Error("Peach Cloud connect returned an invalid simulator");
|
|
644
644
|
}
|
|
645
645
|
const sim = parsed.sim;
|
|
646
646
|
if (typeof sim.simId !== "string" || !sim.simId) {
|
|
647
|
-
throw new Error("
|
|
647
|
+
throw new Error("Peach Cloud connect returned an invalid simulator");
|
|
648
648
|
}
|
|
649
649
|
return new RemoteSimulator({
|
|
650
650
|
origin,
|