stim 1.31.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acquire-artifact-P84h3ssa.mjs → acquire-artifact-DTh_LxrE.mjs} +2 -2
- package/dist/{act-lcOIEy32.mjs → act-Cur4YKtK.mjs} +74 -25
- package/dist/{activity-Dw4N_RFe.mjs → activity-C8kBq9w0.mjs} +6 -6
- package/dist/{agent-device-usage-output-Boie2yB-.mjs → agent-device-usage-output-BTRaK_up.mjs} +5 -5
- package/dist/{android-BeeC15Ve.mjs → android-B2DSKg-A.mjs} +2 -2
- package/dist/{android-DhiWSOFU.mjs → android-BL-QqHjc.mjs} +87 -53
- package/dist/{android-aIuJZoDu.mjs → android-D5mCdVl2.mjs} +5 -5
- package/dist/{android-DsEj2CCs.mjs → android-Iq0M2t2d.mjs} +27 -15
- package/dist/{android-cas-CbumHXIq.mjs → android-cas-Dhcjkys1.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/android-image-DFk26aY6.mjs +254 -0
- package/dist/{android-project-CCEQyYJK.d.mts → android-project-BDlPnfmL.d.mts} +1 -1
- package/dist/api.d.mts +2 -1
- package/dist/api.mjs +28 -28
- package/dist/{apk-signed-tail-B9Usseps.mjs → apk-signed-tail-CPpA-3vu.mjs} +2 -2
- package/dist/{artifact-ta3xA0c4.mjs → artifact-BMjubIP2.mjs} +13 -13
- package/dist/{artifact-Cr34-Yyy.mjs → artifact-BufzdGbT.mjs} +34 -21
- package/dist/{artifact-platform-BO2Uvk_A.mjs → artifact-platform-DqCWUieN.mjs} +1 -1
- package/dist/{auto-placement-DtTRG0rk.mjs → auto-placement-D7P98glJ.mjs} +11 -9
- package/dist/{browser-web-DuULNZrS.mjs → browser-web-C74et-Nv.mjs} +15 -15
- package/dist/{build-BpFFbdXD.mjs → build-DFBGWOTc.mjs} +23 -23
- package/dist/{build-cache-BsKim4V7.mjs → build-cache-Cqj4FGnX.mjs} +20 -8
- package/dist/{build-plan-DH1rT11x.mjs → build-plan-T3Hi24ax.mjs} +7 -7
- package/dist/{cache-manifest-CfiEny4T.mjs → cache-manifest-8JX9S1QJ.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-DVDO2ocE.mjs → ccache-BXtzEL6M.mjs} +34 -24
- package/dist/{cdp-C3svvXiE.mjs → cdp-C216kOAn.mjs} +1 -1
- package/dist/{chrome-DyDWurWG.mjs → chrome-C8sC5tdl.mjs} +1 -1
- package/dist/{cli-C0jjwTuM.mjs → cli-B2YSjc9s.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-DhJOvSvh.mjs → client-0_Mnfz0a.mjs} +29 -9
- package/dist/collector-run.mjs +7 -7
- package/dist/{command-output-VrXd6qPX.mjs → command-output-DWI9tGPU.mjs} +1 -1
- package/dist/{config-D5qNWJEP.mjs → config-BW0fAtoK.mjs} +256 -246
- package/dist/{dependencies-DIU-5rnG.mjs → dependencies-CgvBZbXD.mjs} +39 -39
- package/dist/{dependency-state-DZVln1P9.mjs → dependency-state-mL5g4H6K.mjs} +2 -2
- package/dist/{detached-entry-BPlSaCwC.mjs → detached-entry-tfrgGVWb.mjs} +1 -1
- package/dist/{dev-client-DeAg0fso.mjs → dev-client-ChsHwgrn.mjs} +2 -2
- package/dist/{device-C2WsPgFt.mjs → device-B0htCt2u.mjs} +13 -13
- package/dist/{device-DuNLOlR6.mjs → device-DOehZpyx.mjs} +11 -11
- package/dist/{device-android-BjhH0Ru3.mjs → device-android-B8TQP5AX.mjs} +10 -10
- package/dist/{device-capacity-Du5wBTNJ.mjs → device-capacity-BAkETfIl.mjs} +9 -9
- package/dist/device-host-worker.mjs +58 -17
- package/dist/{device-ios-CUYUhSYO.mjs → device-ios-DFaYFdar.mjs} +9 -9
- package/dist/{device-lease-run-CHXQEn-7.mjs → device-lease-run-DpiCnRbZ.mjs} +5 -5
- package/dist/{device-pool-kUHO7MHO.mjs → device-pool-DP4sCeCC.mjs} +3 -3
- package/dist/{device-provision-e7bKS7lx.mjs → device-provision-CnNOIxCF.mjs} +10 -10
- package/dist/{doctor-BGcsAgAV.mjs → doctor-9GrW5YSP.mjs} +30 -17
- package/dist/{doctor-B6kIVgU9.mjs → doctor-C6Xn96RS.mjs} +1 -1
- package/dist/{doctor-fingerprint-o7ZI9YLn.mjs → doctor-fingerprint-DqWvIhMb.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-hva3sd9f.mjs → doctor-nRLBoajo.mjs} +54 -25
- package/dist/{doctor-watchman-DJY550yz.mjs → doctor-watchman-CDhpC3Oh.mjs} +5 -5
- package/dist/{eas-build-CBFgseh1.mjs → eas-build-CpJ4h9tG.mjs} +4 -4
- package/dist/{eas-fallback-DFXdz4d6.mjs → eas-fallback-B3z5nL1g.mjs} +6 -6
- package/dist/{eas-session-ledger-aFBLTZr2.mjs → eas-session-ledger-Bspy-VJQ.mjs} +6 -6
- package/dist/{error-diagnostics-CCsq_3uG.mjs → error-diagnostics-DoLGklYX.mjs} +10 -10
- package/dist/{exec-aULwtNly.mjs → exec-CGuDzt40.mjs} +103 -103
- package/dist/{gc-DASUa3Z_.mjs → gc-BWoOp9q7.mjs} +2 -2
- package/dist/{gc-B0K4d_PL.mjs → gc-DolXpMSB.mjs} +25 -54
- package/dist/{guide-Civo5-zV.mjs → guide-CmZB0GtP.mjs} +194 -50
- package/dist/{hosted-android-CH1Sm4wo.mjs → hosted-android-ByG-ICuh.mjs} +4 -4
- package/dist/{hosted-client-5ur3YpxY.mjs → hosted-client-D19Lv0tg.mjs} +6 -5
- package/dist/{hosted-logs-BYg4yeti.mjs → hosted-logs-D7anR6Dk.mjs} +17 -11
- package/dist/{hosted-logs-sync-BPe8xnMu.mjs → hosted-logs-sync-D182b1eJ.mjs} +5 -5
- package/dist/{hosted-macos-BagT0Gn3.mjs → hosted-macos-D0DDQxvl.mjs} +6 -6
- package/dist/{hosted-native-kaR4nUHk.mjs → hosted-native-BzXIy97W.mjs} +15 -11
- package/dist/{idle-shutdown-BWHQ7mQG.mjs → idle-shutdown-6i8CHoNq.mjs} +6 -6
- package/dist/{ios-BKR-Dq46.mjs → ios-AdhPKXO3.mjs} +8 -8
- package/dist/{ios-CdAV4-1E.mjs → ios-BdZdNsAj.mjs} +6 -6
- package/dist/{ios-CsRVik64.mjs → ios-Qam0bT9n.mjs} +1 -1
- package/dist/{ios-DUL68MI5.mjs → ios-dbXzjTxx.mjs} +28 -28
- package/dist/{ios-device-CiBA-er9.mjs → ios-device-DLdEDWJj.mjs} +1 -1
- package/dist/{ios-device-Dz8gFZ0K.mjs → ios-device-DXbHZfFe.mjs} +3 -3
- package/dist/{ios-project-Br1tVYWX.mjs → ios-project-BzfLigfh.mjs} +7 -7
- package/dist/{ios-signing-BJzvDPfU.mjs → ios-signing-D-tSX1iF.mjs} +2 -2
- package/dist/{ios-state-BEIJRJ7P.mjs → ios-state-CWsBysyN.mjs} +1 -1
- package/dist/{js-swap-BfG8XpyS.mjs → js-swap-EDVOJmqx.mjs} +6 -6
- package/dist/{launch-CrGndh8T.mjs → launch-CKHpthsw.mjs} +20 -20
- package/dist/{lightened-DZ9Ip0T3.mjs → lightened-Cv4ToJRX.mjs} +5 -5
- package/dist/{logs-C-hfMsxK.mjs → logs-DCQ3_tGS.mjs} +6 -6
- package/dist/{logs-DpIKWT3A.mjs → logs-IagR9dWI.mjs} +7 -7
- package/dist/{macos-DZ9ZSolN.mjs → macos-Ch7vuM-G.mjs} +22 -22
- package/dist/{macos-DNmKwfDy.mjs → macos-pc0aVVbN.mjs} +1 -1
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +6 -6
- package/dist/{metro-mKHEMO-a.mjs → metro-B5PVz0Wv.mjs} +4 -4
- package/dist/{metro-request-RDhyx85c.mjs → metro-request-2LmFpC1z.mjs} +9 -3
- package/dist/{named-ports-B0hCk2v-.mjs → named-ports-CA0nB9Yw.mjs} +3 -3
- package/dist/{native-android-DExhFqR6.mjs → native-android-B3CEDq4R.mjs} +29 -19
- package/dist/{native-gradle-artifact-inputs-Bcmbdc23.mjs → native-gradle-artifact-inputs-BLnO2hHR.mjs} +5 -5
- package/dist/{native-runtime-D4qgnjK_.mjs → native-runtime-e1OU8gEN.mjs} +6 -6
- package/dist/{native-source-D1AzWiuP.mjs → native-source-ChAGj7R1.mjs} +1 -1
- package/dist/{native-xcode-inputs-EWma1lXh.mjs → native-xcode-inputs-DL3ETb8s.mjs} +3 -3
- package/dist/{native-xcode-ios-Y6rzmWTc.mjs → native-xcode-ios-D4e8k2Jy.mjs} +17 -17
- package/dist/offload-worker.d.mts +3 -1
- package/dist/offload-worker.mjs +37 -23
- package/dist/{operation-exec-Dp4FuIGR.mjs → operation-exec-DKlBcKAL.mjs} +1 -1
- package/dist/{ownership-CCfiBfOP.mjs → ownership-hC7xvvxF.mjs} +3 -3
- package/dist/{page-CQJlcj3x.mjs → page-Dj8IqvGM.mjs} +2 -2
- package/dist/{phone-reverses-Drj5QQCh.mjs → phone-reverses-rvyxW1Fl.mjs} +4 -4
- package/dist/{placement-log-CFT8SnlS.mjs → placement-log-nnGnu8mo.mjs} +1 -1
- package/dist/{plan-placement-DhKCH_wF.mjs → plan-placement-D3JD-T-K.mjs} +6 -6
- package/dist/{ports-BNtJ5DCj.mjs → ports-CZJJfJ8Q.mjs} +3 -3
- package/dist/{prebuild-D0hvmO4j.mjs → prebuild-Bhs7TTcz.mjs} +12 -12
- package/dist/{project-DCLkDM8C.mjs → project-DWEXiBA9.mjs} +16 -16
- package/dist/{pull-request-BzLmzAIQ.mjs → pull-request-BpMTNkMB.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-Dp7vctEA.mjs → react-native-android-C6Y270GS.mjs} +37 -33
- package/dist/{react-native-build-vK2lFYfN.mjs → react-native-build-DaPfzf_e.mjs} +10 -10
- package/dist/{react-native-doctor-BtWzwZHU.mjs → react-native-doctor-DGMPxkPS.mjs} +6 -6
- package/dist/{react-native-ios-DW1Ax3Yv.mjs → react-native-ios-dX48_92n.mjs} +21 -17
- package/dist/{recordings-BWnIlhZH.mjs → recordings-AKZfsW2W.mjs} +1 -1
- package/dist/{registration-BwCe64PH.mjs → registration-DKjJGQ6p.mjs} +1 -1
- package/dist/{reload-BS_ntVV_.mjs → reload-BGwblBJ9.mjs} +1 -1
- package/dist/{reload-B-d7-CsI.mjs → reload-DsOByDfy.mjs} +17 -17
- package/dist/{remote-DScVlaMz.mjs → remote-D0uJZ76R.mjs} +9 -9
- package/dist/{result-Epkl6gyG.mjs → result-DuimMZKJ.mjs} +24 -20
- package/dist/{run-2CHAJ9Oj.mjs → run-N-BbRxnC.mjs} +2 -2
- package/dist/{selection-C95m--1_.mjs → selection-xS50Mt0V.mjs} +5 -4
- package/dist/{server-bare-CFyVFZXJ.mjs → server-bare-BTlICuaX.mjs} +2 -2
- package/dist/{server-command-B1gDRJB2.mjs → server-command-BC0EgMfY.mjs} +5 -5
- package/dist/{server-expo-CP4dURQp.mjs → server-expo-15RjL0ir.mjs} +3 -3
- package/dist/server-expo-gYIypb0-.mjs +2 -0
- package/dist/{settings-C6UTYW2K.mjs → settings-B5IBDfTx.mjs} +4 -4
- package/dist/{settings-CjTRNCi3.mjs → settings-CuP55ieT.mjs} +2 -2
- package/dist/{settings-payload-zf5EnCTg.mjs → settings-payload-BIGGQ3or.mjs} +5 -5
- package/dist/{settings-write-Fe0K6BeC.mjs → settings-write-D85j8mej.mjs} +6 -6
- package/dist/settings.schema.json +40 -2
- package/dist/{simslim-93xmPh-d.mjs → simslim-DKdJx0LL.mjs} +2 -2
- package/dist/{slot-launch-B4MHzVX2.mjs → slot-launch-D4oREwhx.mjs} +6 -6
- package/dist/{stage-DDrnM0CY.mjs → stage-DKC6tDXu.mjs} +2 -2
- package/dist/{start-LSwIFlBv.mjs → start-BsEV4S-s.mjs} +12 -12
- package/dist/{start-BXl5tkv8.mjs → start-DfPSLc__.mjs} +1 -1
- package/dist/{state-CM_HvvkS.mjs → state-CtmYTRWm.mjs} +4 -4
- package/dist/{state-CiflgxTP.mjs → state-DSOUqO-o.mjs} +2 -2
- package/dist/{stats-EgpYD536.mjs → stats-ByEUblPr.mjs} +5 -5
- package/dist/{stats-report-B86Cv7Uc.mjs → stats-report-BVRCqwWA.mjs} +1 -1
- package/dist/{status-BLDvhatv.mjs → status-C6hLlDqW.mjs} +37 -28
- package/dist/{status-GQ-JqvRi.mjs → status-DTFhDnd1.mjs} +1 -1
- package/dist/{status-DBMD7ZQT.mjs → status-FP1MH9qn.mjs} +1 -1
- package/dist/{status-watch-BwG4lJ1q.mjs → status-watch-D8s823CZ.mjs} +5 -5
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-1XxET4S8.mjs → stim-desktop-_WTria-r.mjs} +2 -2
- package/dist/{stop-4SAV_RR8.mjs → stop-5LKfVv-0.mjs} +2 -2
- package/dist/{stop-WyrZQuX6.mjs → stop-BVI2-L7s.mjs} +16 -16
- package/dist/{stop-BfNhzvXO.mjs → stop-CpTy6bod.mjs} +5 -5
- package/dist/supervisor-run.mjs +137 -45
- package/dist/{support-Cffz6_Ft.mjs → support-CqyWfZZI.mjs} +18 -8
- package/dist/{support-Cs24xRQa.mjs → support-D8OH0z98.mjs} +9 -9
- package/dist/{swiftpm-artifact-inputs-yp8D5LE4.mjs → swiftpm-artifact-inputs-uq5oV7xR.mjs} +4 -4
- package/dist/{swiftpm-macos-D0CzQtpp.mjs → swiftpm-macos-BuhqYB3n.mjs} +11 -11
- package/dist/{toolchain-BEra9AIX.mjs → toolchain-D_jotUG7.mjs} +1 -1
- package/dist/{toolchain-CGdgD4x4.mjs → toolchain-s5ZmG42Z.mjs} +25 -14
- package/dist/{trigger-CfnOfpDd.mjs → trigger-BtB4kbe0.mjs} +2 -2
- package/dist/trigger-D8B7QR0q.mjs +2 -0
- package/dist/{warm-progress-_aTMvkIH.mjs → warm-progress-q11Vdvhh.mjs} +6 -6
- package/dist/{web-BE89ONcc.mjs → web-DwYCTFdh.mjs} +9 -9
- package/dist/web-cCfM8kwV.mjs +2 -0
- package/dist/web-run.mjs +8 -8
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-3bF4TB8P.mjs → workspace-state-BdZ-QgmB.mjs} +3 -3
- package/dist/{workspaces-BNEyJ1B_.mjs → workspaces-B3ahAHZc.mjs} +18 -17
- package/dist/{worktree-BTrii9e_.mjs → worktree-BhsML6GV.mjs} +77 -31
- package/dist/{worktree-DB3Ypdj6.mjs → worktree-CrjsPIs2.mjs} +1 -1
- package/package.json +7 -7
- package/dist/server-expo-D3k9mvP8.mjs +0 -2
- package/dist/trigger-DBZ-GBrl.mjs +0 -2
- package/dist/web-DQPxvFVD.mjs +0 -2
|
@@ -1,15 +1,266 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as runOperationFile } from "./operation-exec-
|
|
1
|
+
import { D as ownership_claim_exports, T as process_identity_exports, a as trackReportResource, f as WorkspaceProcessCleanupError, r as reportSignal, t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { t as runOperationFile } from "./operation-exec-DKlBcKAL.mjs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { ambientEnv, configDir, ensurePrivateDir } from "@stim-cli/core";
|
|
5
5
|
import { DEFAULT_SERVER_PORT, allMetroPorts, cannotHost, clientIdentity, configCorruptRepair, endpoint, endpoint as endpoint$1, findEnclosingWorktreeRoot, findPeer, findPeer as findPeer$1, getConcurrencyLimits, getConfigPath, getConfigPath as getConfigPath$1, getPlatformDeviceLimits, getProject, getProjectSettings, getRepoSettings, isJsonObject, isPathPrefix as isPathPrefix$1, loadConfig, loadConfig as loadConfig$1, machineEndpoint, parseMachine, parseMachine as parseMachine$1, validateAutomaticPool, withConfigLock, withConfigLock as withConfigLock$1, withConfigLockAsync, withConfigLockAsync as withConfigLockAsync$1 } from "@stim-cli/core/state";
|
|
6
6
|
import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize, parse, sep as sep$1 } from "path";
|
|
7
|
+
import { existsSync, lstatSync, readdirSync, readlinkSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
8
|
+
import { InvalidArgumentError } from "commander";
|
|
7
9
|
import { request } from "node:http";
|
|
8
10
|
import { request as request$1 } from "node:https";
|
|
9
11
|
import { WebSocket } from "ws";
|
|
10
12
|
import { HandshakeRefusal, MAX_SERVER_MESSAGE_BYTES, TRANSPORT_OVERHEAD_BYTES, decodeSecret, initiateNoise, keyFingerprint, newSecret } from "@stim-cli/core/noise-session";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
//#region src/devices/device-slots.ts
|
|
14
|
+
const DEFAULT_DEVICE_SLOT = "default";
|
|
15
|
+
const DEVICE_SLOT_RULE = "A device slot must be 1-64 letters, digits, underscores or hyphens, starting with a letter or digit.";
|
|
16
|
+
function isDeviceSlot(slot) {
|
|
17
|
+
return /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(slot) && ![
|
|
18
|
+
"constructor",
|
|
19
|
+
"prototype",
|
|
20
|
+
"__proto__"
|
|
21
|
+
].includes(slot);
|
|
22
|
+
}
|
|
23
|
+
function validateDeviceSlot(slot = "default") {
|
|
24
|
+
if (!isDeviceSlot(slot)) {
|
|
25
|
+
const error = /* @__PURE__ */ new Error(DEVICE_SLOT_RULE);
|
|
26
|
+
Object.assign(error, { code: "STIM_BAD_ARG" });
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
return slot;
|
|
30
|
+
}
|
|
31
|
+
function parseDeviceSlotOption(slot) {
|
|
32
|
+
if (!isDeviceSlot(slot)) throw new InvalidArgumentError(DEVICE_SLOT_RULE);
|
|
33
|
+
if (slot === "web") throw new InvalidArgumentError(`web names this workspace's owned Chrome (stim stop --slot web); choose another device slot name.`);
|
|
34
|
+
return slot;
|
|
35
|
+
}
|
|
36
|
+
function deviceSlotPlatforms(project, slot = DEFAULT_DEVICE_SLOT) {
|
|
37
|
+
validateDeviceSlot(slot);
|
|
38
|
+
if (slot === DEFAULT_DEVICE_SLOT) return project?.platforms;
|
|
39
|
+
return project?.deviceSlots && Object.hasOwn(project.deviceSlots, slot) ? project.deviceSlots[slot] : void 0;
|
|
40
|
+
}
|
|
41
|
+
function projectDeviceSlots(project) {
|
|
42
|
+
const slots = [{
|
|
43
|
+
slot: DEFAULT_DEVICE_SLOT,
|
|
44
|
+
platforms: project?.platforms ?? {}
|
|
45
|
+
}];
|
|
46
|
+
for (const [slot, platforms] of Object.entries(project?.deviceSlots ?? {})) {
|
|
47
|
+
validateDeviceSlot(slot);
|
|
48
|
+
if (slot === DEFAULT_DEVICE_SLOT) throw new Error("The default device slot must use the existing platforms record.");
|
|
49
|
+
if (!platforms || typeof platforms !== "object" || Array.isArray(platforms)) throw new Error(`Invalid device slot record: ${slot}`);
|
|
50
|
+
slots.push({
|
|
51
|
+
slot,
|
|
52
|
+
platforms
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return slots;
|
|
56
|
+
}
|
|
57
|
+
function assignSlotDevice(project, platform, device, slot = DEFAULT_DEVICE_SLOT) {
|
|
58
|
+
validateDeviceSlot(slot);
|
|
59
|
+
if (platform !== "ios" && platform !== "android") throw new Error(`Unknown device platform: ${platform}`);
|
|
60
|
+
if (slot === DEFAULT_DEVICE_SLOT) project.platforms = {
|
|
61
|
+
...project.platforms,
|
|
62
|
+
[platform]: device
|
|
63
|
+
};
|
|
64
|
+
else project.deviceSlots = {
|
|
65
|
+
...project.deviceSlots,
|
|
66
|
+
[slot]: {
|
|
67
|
+
...deviceSlotPlatforms(project, slot),
|
|
68
|
+
[platform]: device
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function removeSlotDevice(project, platform, slot = DEFAULT_DEVICE_SLOT) {
|
|
73
|
+
const platforms = deviceSlotPlatforms(project, slot);
|
|
74
|
+
if (!platforms) return;
|
|
75
|
+
delete platforms[platform];
|
|
76
|
+
if (slot !== DEFAULT_DEVICE_SLOT && Object.keys(platforms).length === 0) {
|
|
77
|
+
delete project.deviceSlots[slot];
|
|
78
|
+
if (Object.keys(project.deviceSlots).length === 0) delete project.deviceSlots;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function deviceSlotKey(platform, slot = "default") {
|
|
82
|
+
validateDeviceSlot(slot);
|
|
83
|
+
if (platform !== "ios" && platform !== "android") throw new Error(`Unknown device platform: ${platform}`);
|
|
84
|
+
return slot === "default" ? platform : `${platform}:${slot}`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The slot key in a form that is legal as a file name. NTFS reads a colon in a file name as an
|
|
88
|
+
* alternate data stream: the write and the read of the exact path both succeed while `readdirSync`
|
|
89
|
+
* cannot see the file, so every non-default slot's logs would be invisible to `stim logs`. A slot
|
|
90
|
+
* name can contain neither a colon nor a dot, so the two forms stay one-to-one.
|
|
91
|
+
*/
|
|
92
|
+
function deviceSlotFileKey(platform, slot = "default") {
|
|
93
|
+
return deviceSlotKey(platform, slot).replace(":", ".");
|
|
94
|
+
}
|
|
95
|
+
function parseDeviceSlotKey(key) {
|
|
96
|
+
const [platform, slot = "default", extra] = key.split(":");
|
|
97
|
+
if (platform !== "ios" && platform !== "android" || extra !== void 0) return null;
|
|
98
|
+
try {
|
|
99
|
+
validateDeviceSlot(slot);
|
|
100
|
+
} catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
if (key !== deviceSlotKey(platform, slot)) return null;
|
|
104
|
+
return {
|
|
105
|
+
platform,
|
|
106
|
+
slot
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/fs-util.ts
|
|
111
|
+
const WINDOWS = process.platform === "win32";
|
|
112
|
+
const DRIVE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
113
|
+
function volumeRootFor(path) {
|
|
114
|
+
const normalized = normalize(String(path));
|
|
115
|
+
if (WINDOWS) return parse(normalized).root.replace(/^[a-z]:/, (drive) => drive.toUpperCase());
|
|
116
|
+
const m = normalized.match(/^\/volumes\/([^/]+)/i);
|
|
117
|
+
return m ? `/Volumes/${m[1]}` : "/";
|
|
118
|
+
}
|
|
119
|
+
function resolveWorkspaceRealish(workspacePath) {
|
|
120
|
+
const raw = String(workspacePath);
|
|
121
|
+
if (!isAbsolute$1(raw)) return null;
|
|
122
|
+
let current = raw;
|
|
123
|
+
const MAX_HOPS = 40;
|
|
124
|
+
for (let hops = 0; hops < MAX_HOPS; hops++) {
|
|
125
|
+
const normalized = normalize(current);
|
|
126
|
+
const root = parse(normalized).root;
|
|
127
|
+
const segments = normalized.slice(root.length).split(sep$1).filter(Boolean);
|
|
128
|
+
let prefix = root.endsWith(sep$1) ? root.slice(0, -sep$1.length) : root;
|
|
129
|
+
let followedSymlink = false;
|
|
130
|
+
for (const segment of segments) {
|
|
131
|
+
prefix += `${sep$1}${segment}`;
|
|
132
|
+
let st;
|
|
133
|
+
try {
|
|
134
|
+
st = lstatSync(prefix);
|
|
135
|
+
} catch (err) {
|
|
136
|
+
if (err && err.code === "ENOENT") return normalized;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
if (st.isSymbolicLink()) {
|
|
140
|
+
let target;
|
|
141
|
+
try {
|
|
142
|
+
target = readlinkSync(prefix);
|
|
143
|
+
} catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
current = `${isAbsolute$1(target) ? target : normalize(join$1(dirname$1(prefix), target))}${normalized.slice(prefix.length)}`;
|
|
147
|
+
followedSymlink = true;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!followedSymlink) return normalized;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
function isRealMount(entryDev, rootDev) {
|
|
156
|
+
return entryDev != null && rootDev != null && entryDev !== rootDev;
|
|
157
|
+
}
|
|
158
|
+
function listWindowsVolumeRoots(statFn) {
|
|
159
|
+
const roots = [];
|
|
160
|
+
for (const letter of DRIVE_LETTERS) {
|
|
161
|
+
const root = `${letter}:${sep$1}`;
|
|
162
|
+
try {
|
|
163
|
+
statFn(root);
|
|
164
|
+
} catch {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
roots.push(root);
|
|
168
|
+
}
|
|
169
|
+
return roots;
|
|
170
|
+
}
|
|
171
|
+
function listMountedVolumes({ statFn = statSync } = {}) {
|
|
172
|
+
if (WINDOWS) return listWindowsVolumeRoots(statFn);
|
|
173
|
+
const roots = ["/"];
|
|
174
|
+
let rootDev;
|
|
175
|
+
try {
|
|
176
|
+
rootDev = statFn("/").dev;
|
|
177
|
+
} catch {
|
|
178
|
+
return roots;
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
for (const name of readdirSync("/Volumes")) {
|
|
182
|
+
const path = join$1("/Volumes", name);
|
|
183
|
+
let entryDev;
|
|
184
|
+
try {
|
|
185
|
+
entryDev = statFn(path).dev;
|
|
186
|
+
} catch {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (isRealMount(entryDev, rootDev)) roots.push(path);
|
|
190
|
+
}
|
|
191
|
+
} catch {}
|
|
192
|
+
return roots;
|
|
193
|
+
}
|
|
194
|
+
function resolveVolumeRoot(path) {
|
|
195
|
+
const realish = resolveWorkspaceRealish(path);
|
|
196
|
+
return realish === null ? null : volumeRootFor(realish);
|
|
197
|
+
}
|
|
198
|
+
function uncShareIsReachable(volume, statFn) {
|
|
199
|
+
if (!WINDOWS || !volume.startsWith(`${sep$1}${sep$1}`)) return false;
|
|
200
|
+
try {
|
|
201
|
+
return statFn(volume).isDirectory();
|
|
202
|
+
} catch {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/** Whether `stat` proves `path` absent: ENOENT or ENOTDIR. Any other failure, such as EACCES, proves nothing. */
|
|
207
|
+
function isAbsentPath(path) {
|
|
208
|
+
try {
|
|
209
|
+
statSync(path);
|
|
210
|
+
return false;
|
|
211
|
+
} catch (error) {
|
|
212
|
+
const code = typeof error === "object" && error !== null && "code" in error ? error.code : null;
|
|
213
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function isOnMountedVolume(path, mountedVolumes, { statFn = statSync } = {}) {
|
|
217
|
+
const mounted = new Set(mountedVolumes || listMountedVolumes());
|
|
218
|
+
const volume = resolveVolumeRoot(path);
|
|
219
|
+
if (volume === null) return false;
|
|
220
|
+
return mounted.has(volume) || uncShareIsReachable(volume, statFn);
|
|
221
|
+
}
|
|
222
|
+
function directorySize(dir, { timeoutMs }) {
|
|
223
|
+
return measuredDirectorySize(dir, { timeoutMs }) ?? 0;
|
|
224
|
+
}
|
|
225
|
+
async function directorySizeAsync(dir, options) {
|
|
226
|
+
return await measuredDirectorySizeAsync(dir, options) ?? 0;
|
|
227
|
+
}
|
|
228
|
+
async function measuredDirectorySizeAsync(dir, { timeoutMs, signal, operation }) {
|
|
229
|
+
let out;
|
|
230
|
+
try {
|
|
231
|
+
out = await runOperationFile(operation, getExecutor(), "du", ["-sk", dir], {
|
|
232
|
+
timeoutMs,
|
|
233
|
+
killSignal: "SIGKILL",
|
|
234
|
+
signal,
|
|
235
|
+
cwd: operation?.cwd
|
|
236
|
+
});
|
|
237
|
+
} catch (error) {
|
|
238
|
+
if (error instanceof WorkspaceProcessCleanupError) throw error;
|
|
239
|
+
signal?.throwIfAborted();
|
|
240
|
+
operation?.signal.throwIfAborted();
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
if (!out) return 0;
|
|
244
|
+
const kb = parseInt(out.split(/\s+/)[0] ?? "", 10);
|
|
245
|
+
return isNaN(kb) ? 0 : kb * 1024;
|
|
246
|
+
}
|
|
247
|
+
function measuredDirectorySize(dir, { timeoutMs }) {
|
|
248
|
+
let out;
|
|
249
|
+
try {
|
|
250
|
+
out = getExecutor().runFile("du", ["-sk", dir], { timeoutMs });
|
|
251
|
+
} catch {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
if (!out) return 0;
|
|
255
|
+
const kb = parseInt(out.split(/\s+/)[0] ?? "", 10);
|
|
256
|
+
return isNaN(kb) ? 0 : kb * 1024;
|
|
257
|
+
}
|
|
258
|
+
function formatBytes(bytes) {
|
|
259
|
+
if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)}G`;
|
|
260
|
+
if (bytes >= 1024 ** 2) return `${Math.round(bytes / 1024 ** 2)}M`;
|
|
261
|
+
return `${Math.round(bytes / 1024)}K`;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
13
264
|
//#region src/offload/access-ticket.ts
|
|
14
265
|
/** The setup ticket in `STIM_ACCESS_TICKET`, which Stim Desktop's Add Machine flow sets, or undefined. */
|
|
15
266
|
function readAccessTicket() {
|
|
@@ -827,247 +1078,6 @@ async function reachMachine(input) {
|
|
|
827
1078
|
return firstContact(credential);
|
|
828
1079
|
}
|
|
829
1080
|
//#endregion
|
|
830
|
-
//#region src/devices/device-slots.ts
|
|
831
|
-
const DEFAULT_DEVICE_SLOT = "default";
|
|
832
|
-
const DEVICE_SLOT_RULE = "A device slot must be 1-64 letters, digits, underscores or hyphens, starting with a letter or digit.";
|
|
833
|
-
function isDeviceSlot(slot) {
|
|
834
|
-
return /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(slot) && ![
|
|
835
|
-
"constructor",
|
|
836
|
-
"prototype",
|
|
837
|
-
"__proto__"
|
|
838
|
-
].includes(slot);
|
|
839
|
-
}
|
|
840
|
-
function validateDeviceSlot(slot = "default") {
|
|
841
|
-
if (!isDeviceSlot(slot)) {
|
|
842
|
-
const error = /* @__PURE__ */ new Error(DEVICE_SLOT_RULE);
|
|
843
|
-
Object.assign(error, { code: "STIM_BAD_ARG" });
|
|
844
|
-
throw error;
|
|
845
|
-
}
|
|
846
|
-
return slot;
|
|
847
|
-
}
|
|
848
|
-
function parseDeviceSlotOption(slot) {
|
|
849
|
-
if (!isDeviceSlot(slot)) throw new InvalidArgumentError(DEVICE_SLOT_RULE);
|
|
850
|
-
if (slot === "web") throw new InvalidArgumentError(`web names this workspace's owned Chrome (stim stop --slot web); choose another device slot name.`);
|
|
851
|
-
return slot;
|
|
852
|
-
}
|
|
853
|
-
function deviceSlotPlatforms(project, slot = DEFAULT_DEVICE_SLOT) {
|
|
854
|
-
validateDeviceSlot(slot);
|
|
855
|
-
if (slot === DEFAULT_DEVICE_SLOT) return project?.platforms;
|
|
856
|
-
return project?.deviceSlots && Object.hasOwn(project.deviceSlots, slot) ? project.deviceSlots[slot] : void 0;
|
|
857
|
-
}
|
|
858
|
-
function projectDeviceSlots(project) {
|
|
859
|
-
const slots = [{
|
|
860
|
-
slot: DEFAULT_DEVICE_SLOT,
|
|
861
|
-
platforms: project?.platforms ?? {}
|
|
862
|
-
}];
|
|
863
|
-
for (const [slot, platforms] of Object.entries(project?.deviceSlots ?? {})) {
|
|
864
|
-
validateDeviceSlot(slot);
|
|
865
|
-
if (slot === DEFAULT_DEVICE_SLOT) throw new Error("The default device slot must use the existing platforms record.");
|
|
866
|
-
if (!platforms || typeof platforms !== "object" || Array.isArray(platforms)) throw new Error(`Invalid device slot record: ${slot}`);
|
|
867
|
-
slots.push({
|
|
868
|
-
slot,
|
|
869
|
-
platforms
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
return slots;
|
|
873
|
-
}
|
|
874
|
-
function assignSlotDevice(project, platform, device, slot = DEFAULT_DEVICE_SLOT) {
|
|
875
|
-
validateDeviceSlot(slot);
|
|
876
|
-
if (platform !== "ios" && platform !== "android") throw new Error(`Unknown device platform: ${platform}`);
|
|
877
|
-
if (slot === DEFAULT_DEVICE_SLOT) project.platforms = {
|
|
878
|
-
...project.platforms,
|
|
879
|
-
[platform]: device
|
|
880
|
-
};
|
|
881
|
-
else project.deviceSlots = {
|
|
882
|
-
...project.deviceSlots,
|
|
883
|
-
[slot]: {
|
|
884
|
-
...deviceSlotPlatforms(project, slot),
|
|
885
|
-
[platform]: device
|
|
886
|
-
}
|
|
887
|
-
};
|
|
888
|
-
}
|
|
889
|
-
function removeSlotDevice(project, platform, slot = DEFAULT_DEVICE_SLOT) {
|
|
890
|
-
const platforms = deviceSlotPlatforms(project, slot);
|
|
891
|
-
if (!platforms) return;
|
|
892
|
-
delete platforms[platform];
|
|
893
|
-
if (slot !== DEFAULT_DEVICE_SLOT && Object.keys(platforms).length === 0) {
|
|
894
|
-
delete project.deviceSlots[slot];
|
|
895
|
-
if (Object.keys(project.deviceSlots).length === 0) delete project.deviceSlots;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
function deviceSlotKey(platform, slot = "default") {
|
|
899
|
-
validateDeviceSlot(slot);
|
|
900
|
-
if (platform !== "ios" && platform !== "android") throw new Error(`Unknown device platform: ${platform}`);
|
|
901
|
-
return slot === "default" ? platform : `${platform}:${slot}`;
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* The slot key in a form that is legal as a file name. NTFS reads a colon in a file name as an
|
|
905
|
-
* alternate data stream: the write and the read of the exact path both succeed while `readdirSync`
|
|
906
|
-
* cannot see the file, so every non-default slot's logs would be invisible to `stim logs`. A slot
|
|
907
|
-
* name can contain neither a colon nor a dot, so the two forms stay one-to-one.
|
|
908
|
-
*/
|
|
909
|
-
function deviceSlotFileKey(platform, slot = "default") {
|
|
910
|
-
return deviceSlotKey(platform, slot).replace(":", ".");
|
|
911
|
-
}
|
|
912
|
-
function parseDeviceSlotKey(key) {
|
|
913
|
-
const [platform, slot = "default", extra] = key.split(":");
|
|
914
|
-
if (platform !== "ios" && platform !== "android" || extra !== void 0) return null;
|
|
915
|
-
try {
|
|
916
|
-
validateDeviceSlot(slot);
|
|
917
|
-
} catch {
|
|
918
|
-
return null;
|
|
919
|
-
}
|
|
920
|
-
if (key !== deviceSlotKey(platform, slot)) return null;
|
|
921
|
-
return {
|
|
922
|
-
platform,
|
|
923
|
-
slot
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
//#endregion
|
|
927
|
-
//#region src/fs-util.ts
|
|
928
|
-
const WINDOWS = process.platform === "win32";
|
|
929
|
-
const DRIVE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
930
|
-
function volumeRootFor(path) {
|
|
931
|
-
const normalized = normalize(String(path));
|
|
932
|
-
if (WINDOWS) return parse(normalized).root.replace(/^[a-z]:/, (drive) => drive.toUpperCase());
|
|
933
|
-
const m = normalized.match(/^\/volumes\/([^/]+)/i);
|
|
934
|
-
return m ? `/Volumes/${m[1]}` : "/";
|
|
935
|
-
}
|
|
936
|
-
function resolveWorkspaceRealish(workspacePath) {
|
|
937
|
-
const raw = String(workspacePath);
|
|
938
|
-
if (!isAbsolute$1(raw)) return null;
|
|
939
|
-
let current = raw;
|
|
940
|
-
const MAX_HOPS = 40;
|
|
941
|
-
for (let hops = 0; hops < MAX_HOPS; hops++) {
|
|
942
|
-
const normalized = normalize(current);
|
|
943
|
-
const root = parse(normalized).root;
|
|
944
|
-
const segments = normalized.slice(root.length).split(sep$1).filter(Boolean);
|
|
945
|
-
let prefix = root.endsWith(sep$1) ? root.slice(0, -sep$1.length) : root;
|
|
946
|
-
let followedSymlink = false;
|
|
947
|
-
for (const segment of segments) {
|
|
948
|
-
prefix += `${sep$1}${segment}`;
|
|
949
|
-
let st;
|
|
950
|
-
try {
|
|
951
|
-
st = lstatSync(prefix);
|
|
952
|
-
} catch (err) {
|
|
953
|
-
if (err && err.code === "ENOENT") return normalized;
|
|
954
|
-
return null;
|
|
955
|
-
}
|
|
956
|
-
if (st.isSymbolicLink()) {
|
|
957
|
-
let target;
|
|
958
|
-
try {
|
|
959
|
-
target = readlinkSync(prefix);
|
|
960
|
-
} catch {
|
|
961
|
-
return null;
|
|
962
|
-
}
|
|
963
|
-
current = `${isAbsolute$1(target) ? target : normalize(join$1(dirname$1(prefix), target))}${normalized.slice(prefix.length)}`;
|
|
964
|
-
followedSymlink = true;
|
|
965
|
-
break;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
if (!followedSymlink) return normalized;
|
|
969
|
-
}
|
|
970
|
-
return null;
|
|
971
|
-
}
|
|
972
|
-
function isRealMount(entryDev, rootDev) {
|
|
973
|
-
return entryDev != null && rootDev != null && entryDev !== rootDev;
|
|
974
|
-
}
|
|
975
|
-
function listWindowsVolumeRoots(statFn) {
|
|
976
|
-
const roots = [];
|
|
977
|
-
for (const letter of DRIVE_LETTERS) {
|
|
978
|
-
const root = `${letter}:${sep$1}`;
|
|
979
|
-
try {
|
|
980
|
-
statFn(root);
|
|
981
|
-
} catch {
|
|
982
|
-
continue;
|
|
983
|
-
}
|
|
984
|
-
roots.push(root);
|
|
985
|
-
}
|
|
986
|
-
return roots;
|
|
987
|
-
}
|
|
988
|
-
function listMountedVolumes({ statFn = statSync } = {}) {
|
|
989
|
-
if (WINDOWS) return listWindowsVolumeRoots(statFn);
|
|
990
|
-
const roots = ["/"];
|
|
991
|
-
let rootDev;
|
|
992
|
-
try {
|
|
993
|
-
rootDev = statFn("/").dev;
|
|
994
|
-
} catch {
|
|
995
|
-
return roots;
|
|
996
|
-
}
|
|
997
|
-
try {
|
|
998
|
-
for (const name of readdirSync("/Volumes")) {
|
|
999
|
-
const path = join$1("/Volumes", name);
|
|
1000
|
-
let entryDev;
|
|
1001
|
-
try {
|
|
1002
|
-
entryDev = statFn(path).dev;
|
|
1003
|
-
} catch {
|
|
1004
|
-
continue;
|
|
1005
|
-
}
|
|
1006
|
-
if (isRealMount(entryDev, rootDev)) roots.push(path);
|
|
1007
|
-
}
|
|
1008
|
-
} catch {}
|
|
1009
|
-
return roots;
|
|
1010
|
-
}
|
|
1011
|
-
function resolveVolumeRoot(path) {
|
|
1012
|
-
const realish = resolveWorkspaceRealish(path);
|
|
1013
|
-
return realish === null ? null : volumeRootFor(realish);
|
|
1014
|
-
}
|
|
1015
|
-
function uncShareIsReachable(volume, statFn) {
|
|
1016
|
-
if (!WINDOWS || !volume.startsWith(`${sep$1}${sep$1}`)) return false;
|
|
1017
|
-
try {
|
|
1018
|
-
return statFn(volume).isDirectory();
|
|
1019
|
-
} catch {
|
|
1020
|
-
return false;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
function isOnMountedVolume(path, mountedVolumes, { statFn = statSync } = {}) {
|
|
1024
|
-
const mounted = new Set(mountedVolumes || listMountedVolumes());
|
|
1025
|
-
const volume = resolveVolumeRoot(path);
|
|
1026
|
-
if (volume === null) return false;
|
|
1027
|
-
return mounted.has(volume) || uncShareIsReachable(volume, statFn);
|
|
1028
|
-
}
|
|
1029
|
-
function directorySize(dir, { timeoutMs }) {
|
|
1030
|
-
return measuredDirectorySize(dir, { timeoutMs }) ?? 0;
|
|
1031
|
-
}
|
|
1032
|
-
async function directorySizeAsync(dir, options) {
|
|
1033
|
-
return await measuredDirectorySizeAsync(dir, options) ?? 0;
|
|
1034
|
-
}
|
|
1035
|
-
async function measuredDirectorySizeAsync(dir, { timeoutMs, signal, operation }) {
|
|
1036
|
-
let out;
|
|
1037
|
-
try {
|
|
1038
|
-
out = await runOperationFile(operation, getExecutor(), "du", ["-sk", dir], {
|
|
1039
|
-
timeoutMs,
|
|
1040
|
-
killSignal: "SIGKILL",
|
|
1041
|
-
signal,
|
|
1042
|
-
cwd: operation?.cwd
|
|
1043
|
-
});
|
|
1044
|
-
} catch (error) {
|
|
1045
|
-
if (error instanceof WorkspaceProcessCleanupError) throw error;
|
|
1046
|
-
signal?.throwIfAborted();
|
|
1047
|
-
operation?.signal.throwIfAborted();
|
|
1048
|
-
return null;
|
|
1049
|
-
}
|
|
1050
|
-
if (!out) return 0;
|
|
1051
|
-
const kb = parseInt(out.split(/\s+/)[0] ?? "", 10);
|
|
1052
|
-
return isNaN(kb) ? 0 : kb * 1024;
|
|
1053
|
-
}
|
|
1054
|
-
function measuredDirectorySize(dir, { timeoutMs }) {
|
|
1055
|
-
let out;
|
|
1056
|
-
try {
|
|
1057
|
-
out = getExecutor().runFile("du", ["-sk", dir], { timeoutMs });
|
|
1058
|
-
} catch {
|
|
1059
|
-
return null;
|
|
1060
|
-
}
|
|
1061
|
-
if (!out) return 0;
|
|
1062
|
-
const kb = parseInt(out.split(/\s+/)[0] ?? "", 10);
|
|
1063
|
-
return isNaN(kb) ? 0 : kb * 1024;
|
|
1064
|
-
}
|
|
1065
|
-
function formatBytes(bytes) {
|
|
1066
|
-
if (bytes >= 1024 ** 3) return `${(bytes / 1024 ** 3).toFixed(1)}G`;
|
|
1067
|
-
if (bytes >= 1024 ** 2) return `${Math.round(bytes / 1024 ** 2)}M`;
|
|
1068
|
-
return `${Math.round(bytes / 1024)}K`;
|
|
1069
|
-
}
|
|
1070
|
-
//#endregion
|
|
1071
1081
|
//#region src/devices/avd-claim.ts
|
|
1072
1082
|
function acquireAvdClaim(avdName) {
|
|
1073
1083
|
const root = join(configDir(), "avd-locks", `${encodeURIComponent(avdName.toLowerCase())}.lock`);
|
|
@@ -1379,4 +1389,4 @@ function allConsolePortsAndSerials({ isMounted = isOnMountedVolume } = {}) {
|
|
|
1379
1389
|
return result;
|
|
1380
1390
|
}
|
|
1381
1391
|
//#endregion
|
|
1382
|
-
export {
|
|
1392
|
+
export { unconfirmedKeyFinding as $, writeConfigSetting as A, keyConfirmer as B, removeProject as C, upsertProject as D, setSupervisor as E, diagnoseOutcome as F, realIo as G, outdatedServer as H, diagnoseTailscale as I, setupRemedy as J, resolveEndpoint as K, doctorIo as L, acquireAvdClaim as M, SERVER_OUTDATED as N, withConfigLock$1 as O, diagnoseConnectFailure as P, notOnTailnetDiagnosis as Q, endpoint$1 as R, releaseMetroPort as S, setDevice as T, parseMachine$1 as U, openAuthenticated as V, reachMachine as W, diagnoseLocalUnreachable as X, tailscaleStatusAsync as Y, diagnosisFinding as Z, isPathPrefix$1 as _, validateDeviceSlot as _t, clearDevice as a, isOnMountedVolume as at, refuseRelativeStimPaths as b, ensureConfig as c, volumeRootFor as ct, getConfigDir as d, deviceSlotKey as dt, readHostPermissions as et, getConfigPath$1 as f, deviceSlotPlatforms as ft, getRepoSettings as g, removeSlotDevice as gt, getProjectSettings as h, projectDeviceSlots as ht, clearAndroidBootPending as i, isAbsentPath as it, writeConfigSettingAsync as j, withConfigLockAsync$1 as k, findEnclosingWorktreeRoot as l, assignSlotDevice as lt, getProject as m, parseDeviceSlotOption as mt, allMetroPorts as n, directorySizeAsync as nt, clearSupervisor as o, listMountedVolumes as ot, getPlatformDeviceLimits as p, parseDeviceSlotKey as pt, sayHello as q, claimMetroPort as r, formatBytes as rt, configCorruptRepair as s, measuredDirectorySizeAsync as st, allConsolePortsAndSerials as t, directorySize as tt, getConcurrencyLimits as u, deviceSlotFileKey as ut, loadConfig$1 as v, saveConfig as w, releaseAndroidConsolePort as x, recordIosSchemeApprovals as y, findPeer$1 as z };
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as writeWorkspaceStateAsync, k as workspaceLogsDir, r as readWorkspaceState } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { J as resolveCacheProviderConfig, Q as resolveSettings, St as gitCommonDirAsync, Vt as repoRootAsync, an as makeTemporaryDirectory, at as settingsLayers, dt as detectProviders, nt as settingOriginScope, on as removeTemporaryEntry } from "./settings-
|
|
6
|
-
import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunchAsync } from "./project-
|
|
7
|
-
import { o as workspaceLinks } from "./stim-desktop-
|
|
8
|
-
import { c as pidExists, d as resolveProjectMetro, f as signalProcessTree } from "./metro-
|
|
1
|
+
import { l as cancellableSleep, t as getExecutor, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { f as writeWorkspaceStateAsync, k as workspaceLogsDir, r as readWorkspaceState } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { D as upsertProject, dt as deviceSlotKey, k as withConfigLockAsync, m as getProject, u as getConcurrencyLimits, ut as deviceSlotFileKey, y as recordIosSchemeApprovals } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { J as resolveCacheProviderConfig, Q as resolveSettings, St as gitCommonDirAsync, Vt as repoRootAsync, an as makeTemporaryDirectory, at as settingsLayers, dt as detectProviders, nt as settingOriginScope, on as removeTemporaryEntry } from "./settings-B5IBDfTx.mjs";
|
|
6
|
+
import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunchAsync } from "./project-DWEXiBA9.mjs";
|
|
7
|
+
import { o as workspaceLinks } from "./stim-desktop-_WTria-r.mjs";
|
|
8
|
+
import { c as pidExists, d as resolveProjectMetro, f as signalProcessTree } from "./metro-B5PVz0Wv.mjs";
|
|
9
9
|
import { i as createNdjsonWriter } from "./ndjson-CrjIsGzw.mjs";
|
|
10
|
-
import { An as checkEasAuth, At as ensureRemoteBootOwned, Bt as RELEASE_VERIFY_WAIT_MS, Cn as gateMetroOrigin, Dt as bundleEntryPoint, Gt as unattributedLaunchLines, Ht as isBundleProof, It as LAUNCH_BUNDLING, Jt as verifyLaunch, Kt as unverifiedLaunchLines, Ln as resolveEasCliBin, Lt as LAUNCH_FATAL, Nn as loadProjectProvider, Nt as remoteIosDeps, Pt as resolveRemoteContext, Rn as resolveRemote, Rt as LAUNCH_UNVERIFIED, Sn as readRemoteSimulatorArch, Ut as readCollectorRecords, Wt as readMetroRecords, Yt as verifyReleaseLaunch, an as devClientUrl, c as budgetGate, dn as installIosApp, en as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, fn as iosAppProcess, gn as restartedAppNote, hn as launchIosApp, in as clearOtherUserApps, kt as ensureMetroReachable, zn as uploadRemote } from "./ccache-
|
|
11
|
-
import { St as acquireBuildSlot, Tt as releaseBuildSlot, ct as recordRunStats, it as readRunEstimates, ot as recordCapacityRefusal } from "./workspaces-
|
|
12
|
-
import { E as readPodState, H as readBundleId, T as podsAreStale, U as resolveScheme, V as readBundleExecutable, c as iosToolchainAsync, k as runPodInstall } from "./toolchain-
|
|
13
|
-
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-
|
|
14
|
-
import {
|
|
15
|
-
import { d as listAllIosSims, h as listIosRuntimesAsync, r as clearIosAppData } from "./ios-
|
|
16
|
-
import { n as readHostedIos, o as writeHostedIosAsync } from "./ios-state-
|
|
17
|
-
import { n as hostedMetroPortProbe } from "./hosted-native-
|
|
18
|
-
import { i as prepareHostedIos, r as placeHostedIos } from "./phone-reverses-
|
|
19
|
-
import { n as verifyCollectorOwnership } from "./ownership-
|
|
20
|
-
import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-
|
|
21
|
-
import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-
|
|
22
|
-
import { c as startDevServer, g as detectBundleId } from "./start-
|
|
10
|
+
import { An as checkEasAuth, At as ensureRemoteBootOwned, Bt as RELEASE_VERIFY_WAIT_MS, Cn as gateMetroOrigin, Dt as bundleEntryPoint, Gt as unattributedLaunchLines, Ht as isBundleProof, It as LAUNCH_BUNDLING, Jt as verifyLaunch, Kt as unverifiedLaunchLines, Ln as resolveEasCliBin, Lt as LAUNCH_FATAL, Nn as loadProjectProvider, Nt as remoteIosDeps, Pt as resolveRemoteContext, Rn as resolveRemote, Rt as LAUNCH_UNVERIFIED, Sn as readRemoteSimulatorArch, Ut as readCollectorRecords, Wt as readMetroRecords, Yt as verifyReleaseLaunch, an as devClientUrl, c as budgetGate, dn as installIosApp, en as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, fn as iosAppProcess, gn as restartedAppNote, hn as launchIosApp, in as clearOtherUserApps, kt as ensureMetroReachable, zn as uploadRemote } from "./ccache-BXtzEL6M.mjs";
|
|
11
|
+
import { St as acquireBuildSlot, Tt as releaseBuildSlot, ct as recordRunStats, it as readRunEstimates, ot as recordCapacityRefusal } from "./workspaces-B3ahAHZc.mjs";
|
|
12
|
+
import { E as readPodState, H as readBundleId, T as podsAreStale, U as resolveScheme, V as readBundleExecutable, c as iosToolchainAsync, k as runPodInstall } from "./toolchain-s5ZmG42Z.mjs";
|
|
13
|
+
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-C8kBq9w0.mjs";
|
|
14
|
+
import { T as storeBuild, h as fingerprintProject, j as untrackedNativeFiles, l as evictBuild, w as resolveBuild } from "./build-cache-Cqj4FGnX.mjs";
|
|
15
|
+
import { d as listAllIosSims, h as listIosRuntimesAsync, r as clearIosAppData } from "./ios-BdZdNsAj.mjs";
|
|
16
|
+
import { n as readHostedIos, o as writeHostedIosAsync } from "./ios-state-CWsBysyN.mjs";
|
|
17
|
+
import { n as hostedMetroPortProbe } from "./hosted-native-BzXIy97W.mjs";
|
|
18
|
+
import { i as prepareHostedIos, r as placeHostedIos } from "./phone-reverses-rvyxW1Fl.mjs";
|
|
19
|
+
import { n as verifyCollectorOwnership } from "./ownership-hC7xvvxF.mjs";
|
|
20
|
+
import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-D4oREwhx.mjs";
|
|
21
|
+
import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-DaPfzf_e.mjs";
|
|
22
|
+
import { c as startDevServer, g as detectBundleId } from "./start-BsEV4S-s.mjs";
|
|
23
23
|
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
24
|
-
import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnAbort } from "./device-lease-run-
|
|
25
|
-
import { r as checkDeviceCapacity } from "./device-capacity-
|
|
26
|
-
import { n as clearIosAdoptionPending } from "./device-ios-
|
|
27
|
-
import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-
|
|
28
|
-
import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-
|
|
29
|
-
import { a as resolveEasDevelopmentBuild } from "./eas-build-
|
|
30
|
-
import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-
|
|
31
|
-
import { a as captureNativeCrashes, c as simulatorConsolePaths, i as bundleBindFailure, n as IOS_CRASH_REPORT_RETRY, s as printNativeCrashReport, t as errorDiagnostics } from "./error-diagnostics-
|
|
32
|
-
import { t as followHostedLaunchLogs } from "./hosted-logs-sync-
|
|
33
|
-
import { a as runPrebuild, d as memoizedFingerprint, n as planPrebuildAsync } from "./prebuild-
|
|
34
|
-
import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
35
|
-
import { n as devClientTakesDevMenuParams, r as hasDevClient, t as devClientScheme } from "./dev-client-
|
|
36
|
-
import { t as automaticDevicePlacement } from "./auto-placement-
|
|
37
|
-
import { t as checkEasFallback } from "./eas-fallback-
|
|
38
|
-
import { i as warmMetro, n as ensureBooted, r as ensureOwnedDevice } from "./device-
|
|
39
|
-
import { t as selectFromPool } from "./device-pool-
|
|
40
|
-
import { s as reportIosResult } from "./ios-project-
|
|
41
|
-
import { i as swapJsBundle } from "./js-swap-
|
|
24
|
+
import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnAbort } from "./device-lease-run-DpiCnRbZ.mjs";
|
|
25
|
+
import { r as checkDeviceCapacity } from "./device-capacity-BAkETfIl.mjs";
|
|
26
|
+
import { n as clearIosAdoptionPending } from "./device-ios-DFaYFdar.mjs";
|
|
27
|
+
import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-D8OH0z98.mjs";
|
|
28
|
+
import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-D-tSX1iF.mjs";
|
|
29
|
+
import { a as resolveEasDevelopmentBuild } from "./eas-build-CpJ4h9tG.mjs";
|
|
30
|
+
import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-DXbHZfFe.mjs";
|
|
31
|
+
import { a as captureNativeCrashes, c as simulatorConsolePaths, i as bundleBindFailure, n as IOS_CRASH_REPORT_RETRY, s as printNativeCrashReport, t as errorDiagnostics } from "./error-diagnostics-DoLGklYX.mjs";
|
|
32
|
+
import { t as followHostedLaunchLogs } from "./hosted-logs-sync-D182b1eJ.mjs";
|
|
33
|
+
import { a as runPrebuild, d as memoizedFingerprint, n as planPrebuildAsync } from "./prebuild-Bhs7TTcz.mjs";
|
|
34
|
+
import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-e1OU8gEN.mjs";
|
|
35
|
+
import { n as devClientTakesDevMenuParams, r as hasDevClient, t as devClientScheme } from "./dev-client-ChsHwgrn.mjs";
|
|
36
|
+
import { t as automaticDevicePlacement } from "./auto-placement-D7P98glJ.mjs";
|
|
37
|
+
import { t as checkEasFallback } from "./eas-fallback-B3z5nL1g.mjs";
|
|
38
|
+
import { i as warmMetro, n as ensureBooted, r as ensureOwnedDevice } from "./device-DOehZpyx.mjs";
|
|
39
|
+
import { t as selectFromPool } from "./device-pool-DP4sCeCC.mjs";
|
|
40
|
+
import { s as reportIosResult } from "./ios-project-BzfLigfh.mjs";
|
|
41
|
+
import { i as swapJsBundle } from "./js-swap-EDVOJmqx.mjs";
|
|
42
42
|
import { mkdirSync, openSync, writeFileSync } from "node:fs";
|
|
43
43
|
import { networkInterfaces } from "node:os";
|
|
44
44
|
import { basename, join } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { Bt as repoRoot } from "./settings-
|
|
1
|
+
import { t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { Bt as repoRoot } from "./settings-B5IBDfTx.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { dirname, join, relative } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as resolvePackageJson, b as isPackageResolvable } from "./project-
|
|
2
|
-
import { bn as readBundleSchemes, yn as pickDevClientScheme } from "./ccache-
|
|
1
|
+
import { C as resolvePackageJson, b as isPackageResolvable } from "./project-DWEXiBA9.mjs";
|
|
2
|
+
import { bn as readBundleSchemes, yn as pickDevClientScheme } from "./ccache-BXtzEL6M.mjs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { isJsonObject, readJsonObject } from "@stim-cli/core/state";
|
|
5
5
|
//#region src/commands/dev-client.ts
|