stim 1.20.2 → 1.22.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/README.md +141 -8
- package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
- package/dist/act-DsuqEkiM.mjs +2801 -0
- package/dist/activity-CMLmzp7o.mjs +1397 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
- package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
- package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
- package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
- package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/android-project-DVWyCbWU.d.mts +391 -0
- package/dist/api.d.mts +810 -64
- package/dist/api.mjs +782 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
- package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
- package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
- package/dist/budget-Cvwn54qV.mjs +9285 -0
- package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
- package/dist/build-cache-Dv7RN200.mjs +602 -0
- package/dist/build-plan-DUC8Ka9y.mjs +248 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-OyRoEuSr.mjs +1577 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
- package/dist/config-DlrsduwG.mjs +955 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
- package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
- package/dist/device-DklWZLqb.mjs +1068 -0
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
- package/dist/device-host-worker.mjs +76 -79
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
- package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
- package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
- package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/doctor-thjWAV0z.mjs +2 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
- package/dist/exec-DEoAhcze.mjs +858 -0
- package/dist/exec-DnYc4HGH.d.mts +78 -0
- package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
- package/dist/gc-DnNDQyaP.mjs +3 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
- package/dist/idle-C4cZ757K.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
- package/dist/ios-CDvlmUs7.d.mts +24 -0
- package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
- package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
- package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
- package/dist/ios-signing-BtAffm0A.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
- package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
- package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
- package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
- package/dist/logs-BfwwadsZ.mjs +479 -0
- package/dist/logs-jTS_lHSo.mjs +248 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
- package/dist/macos-NfV2D7dO.mjs +694 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +123 -248
- package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
- package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
- package/dist/native-android-CqgnOgsT.mjs +645 -0
- package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-NwUuxbkg.mjs +276 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
- package/dist/native-source-Y0yLhFyQ.mjs +133 -0
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +59 -41
- package/dist/offload-worker.mjs +478 -115
- package/dist/operation-exec-BW0em61G.mjs +171 -0
- package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
- package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
- package/dist/prebuild-D4JoEAEs.mjs +484 -0
- package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
- package/dist/pull-request-eODyIqZF.d.mts +124 -0
- package/dist/pull-requests.d.mts +2 -120
- package/dist/pull-requests.mjs +2 -2
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
- package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
- package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
- package/dist/registration-BcRgF6Ox.mjs +51 -0
- package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
- package/dist/reload-D7AVlb8N.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
- package/dist/result-D2Ykz_iD.mjs +435 -0
- package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
- package/dist/selection-DSMbWEX2.mjs +620 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
- package/dist/server-expo-D58c9L0M.mjs +2 -0
- package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
- package/dist/settings-DpR-1Wnn.mjs +114 -0
- package/dist/settings-write-CzD60rOD.mjs +360 -0
- package/dist/settings.schema.json +176 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-Bps5oius.mjs +200 -0
- package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
- package/dist/start-EojN4WFz.mjs +1364 -0
- package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
- package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
- package/dist/stats-report-BzaPrRm6.mjs +16 -0
- package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
- package/dist/status-EvrK72L2.mjs +2 -0
- package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
- package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
- package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +56 -28
- package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
- package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
- package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
- package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
- package/dist/toolchain-BY8X8HXx.mjs +2 -0
- package/dist/toolchain-DpJMHq0n.mjs +876 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
- package/dist/trigger-yb_nFzPF.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
- package/dist/web-CZ07gd77.mjs +2 -0
- package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
- package/dist/web-run.mjs +13 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
- package/dist/worktree-ZqZVjD9K.mjs +2 -0
- package/dist/xcode-BXn9-xYx.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-audio/Main.java +24 -0
- package/shim/android-audio/README.md +17 -0
- package/shim/android-audio.jar +0 -0
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/macos-Ch5VJmcS.mjs +0 -584
- package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/settings-vk3mJGSm.d.mts +0 -13
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/start-BWqzODpb.mjs +0 -1116
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { m as operationState, r as WorkspaceProcessCleanupError, t as getExecutor } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { sep } from "node:path";
|
|
3
|
+
//#region src/cancellation.ts
|
|
4
|
+
function cancelledError(what, cause) {
|
|
5
|
+
return Object.assign(new Error(`The ${what} was cancelled.`, cause === void 0 ? void 0 : { cause }), { code: "STIM_CANCELLED" });
|
|
6
|
+
}
|
|
7
|
+
function throwIfCancelled(signal, what) {
|
|
8
|
+
if (signal?.aborted) throw cancelledError(what);
|
|
9
|
+
}
|
|
10
|
+
function cancellableSleep(ms, { signal, what = "wait", ref = true } = {}) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
if (signal?.aborted) return reject(cancelledError(what));
|
|
13
|
+
const onAbort = () => {
|
|
14
|
+
clearTimeout(timer);
|
|
15
|
+
reject(cancelledError(what));
|
|
16
|
+
};
|
|
17
|
+
const timer = setTimeout(() => {
|
|
18
|
+
signal?.removeEventListener("abort", onAbort);
|
|
19
|
+
resolve();
|
|
20
|
+
}, ms);
|
|
21
|
+
if (!ref) timer.unref();
|
|
22
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/workspace/git.ts
|
|
27
|
+
const GIT_TIMEOUT_MS = 1e4;
|
|
28
|
+
const GIT_CONCURRENCY = 6;
|
|
29
|
+
function gitCall(cwd, args, { write, signal: _signal, timeoutMs = GIT_TIMEOUT_MS, ...opts }) {
|
|
30
|
+
return {
|
|
31
|
+
args: [
|
|
32
|
+
...write ? [] : ["--no-optional-locks"],
|
|
33
|
+
"-C",
|
|
34
|
+
cwd,
|
|
35
|
+
...args
|
|
36
|
+
],
|
|
37
|
+
opts: {
|
|
38
|
+
cwd,
|
|
39
|
+
...opts,
|
|
40
|
+
timeoutMs
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Runs git in `cwd`, bounded by `timeoutMs` (10 s by default); throws like `runFile`. */
|
|
45
|
+
function git(cwd, args, opts = {}) {
|
|
46
|
+
const call = gitCall(cwd, args, opts);
|
|
47
|
+
return getExecutor().runFile("git", call.args, call.opts);
|
|
48
|
+
}
|
|
49
|
+
/** `git`, returning null instead of throwing. */
|
|
50
|
+
function gitQuiet(cwd, args, opts = {}) {
|
|
51
|
+
const call = gitCall(cwd, args, opts);
|
|
52
|
+
return getExecutor().runFileQuiet("git", call.args, call.opts);
|
|
53
|
+
}
|
|
54
|
+
const queue = [];
|
|
55
|
+
let running = 0;
|
|
56
|
+
/** `git` without blocking the event loop, at most six at a time; the budget starts when the call leaves the queue. */
|
|
57
|
+
async function gitAsync(cwd, args, opts = {}) {
|
|
58
|
+
const signal = opts.signal ?? getExecutor().reportSignal?.();
|
|
59
|
+
signal?.throwIfAborted();
|
|
60
|
+
if (running < GIT_CONCURRENCY) running++;
|
|
61
|
+
else await new Promise((resolve, reject) => {
|
|
62
|
+
const proceed = () => {
|
|
63
|
+
signal?.removeEventListener("abort", cancel);
|
|
64
|
+
resolve();
|
|
65
|
+
};
|
|
66
|
+
const cancel = () => {
|
|
67
|
+
const index = queue.indexOf(proceed);
|
|
68
|
+
if (index !== -1) queue.splice(index, 1);
|
|
69
|
+
reject(signal?.reason);
|
|
70
|
+
};
|
|
71
|
+
queue.push(proceed);
|
|
72
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
73
|
+
if (signal?.aborted) cancel();
|
|
74
|
+
});
|
|
75
|
+
let cleanupFailed = false;
|
|
76
|
+
try {
|
|
77
|
+
signal?.throwIfAborted();
|
|
78
|
+
const call = gitCall(cwd, args, opts);
|
|
79
|
+
return await getExecutor().runFileAsync("git", call.args, {
|
|
80
|
+
...call.opts,
|
|
81
|
+
signal
|
|
82
|
+
});
|
|
83
|
+
} catch (error) {
|
|
84
|
+
cleanupFailed = error instanceof WorkspaceProcessCleanupError || error instanceof Error && "reportCleanup" in error;
|
|
85
|
+
throw error;
|
|
86
|
+
} finally {
|
|
87
|
+
const next = queue.shift();
|
|
88
|
+
if (next) next();
|
|
89
|
+
else running--;
|
|
90
|
+
if (!cleanupFailed) signal?.throwIfAborted();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** `gitAsync`, returning null for ordinary failures; cancellation and unresolved cleanup reject. */
|
|
94
|
+
async function gitQuietAsync(cwd, args, opts = {}) {
|
|
95
|
+
try {
|
|
96
|
+
return await gitAsync(cwd, args, opts);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
if (error instanceof WorkspaceProcessCleanupError || error instanceof Error && "reportCleanup" in error) throw error;
|
|
99
|
+
(opts.signal ?? getExecutor().reportSignal?.())?.throwIfAborted();
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/workspace/git-read.ts
|
|
105
|
+
function childEnvironment(env) {
|
|
106
|
+
return {
|
|
107
|
+
env: Object.fromEntries(Object.entries(env).flatMap(([name, value]) => value === void 0 ? [] : [[name, value]])),
|
|
108
|
+
omitEnv: Object.keys(process.env).filter((name) => env[name] === void 0)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function killOnAbort(signal) {
|
|
112
|
+
return (child) => {
|
|
113
|
+
if (!signal || getExecutor().reportSignal?.()) return;
|
|
114
|
+
if (signal.aborted) return void child.kill("SIGKILL");
|
|
115
|
+
const kill = () => child.kill("SIGKILL");
|
|
116
|
+
signal.addEventListener("abort", kill, { once: true });
|
|
117
|
+
child.once("close", () => signal.removeEventListener("abort", kill));
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** `git rev-parse <args>` in `cwd` as a native path, or null; Git runs with exactly `env` and dies when `signal` aborts. */
|
|
121
|
+
function gitPath(cwd, args, env, signal) {
|
|
122
|
+
return gitAsync(cwd, ["rev-parse", ...args], {
|
|
123
|
+
...childEnvironment(env),
|
|
124
|
+
signal
|
|
125
|
+
}).then((out) => {
|
|
126
|
+
const path = out.trim();
|
|
127
|
+
if (!path) return null;
|
|
128
|
+
return sep === "/" ? path : path.replaceAll("/", sep);
|
|
129
|
+
}, () => null);
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/engine/operation-exec.ts
|
|
133
|
+
async function runOperationFile(context, executor, file, args, options) {
|
|
134
|
+
const signal = context ? operationState(context).runSignal ?? context.signal : options.signal;
|
|
135
|
+
throwIfCancelled(signal, file);
|
|
136
|
+
const environment = context ? childEnvironment(context.env) : {
|
|
137
|
+
env: {},
|
|
138
|
+
omitEnv: []
|
|
139
|
+
};
|
|
140
|
+
const output = await executor.runFileAsync(file, args, {
|
|
141
|
+
...environment,
|
|
142
|
+
...options,
|
|
143
|
+
...context ? { env: {
|
|
144
|
+
...environment.env,
|
|
145
|
+
...options.env
|
|
146
|
+
} } : {},
|
|
147
|
+
omitEnv: [...environment.omitEnv.filter((name) => options.env?.[name] === void 0), ...options.omitEnv ?? []],
|
|
148
|
+
declareFor: context,
|
|
149
|
+
signal
|
|
150
|
+
});
|
|
151
|
+
throwIfCancelled(signal, file);
|
|
152
|
+
return output;
|
|
153
|
+
}
|
|
154
|
+
/** Contextual probes return null for ordinary failures and propagate cancellation or unresolved cleanup; other calls retain the executor's quiet behavior. */
|
|
155
|
+
async function runOperationFileQuiet(context, executor, file, args, options) {
|
|
156
|
+
const signal = context ? operationState(context).runSignal ?? context.signal : options.signal;
|
|
157
|
+
signal?.throwIfAborted();
|
|
158
|
+
try {
|
|
159
|
+
const output = context ? await runOperationFile(context, executor, file, args, options) : await executor.runFileQuietAsync(file, args, options);
|
|
160
|
+
options.signal?.throwIfAborted();
|
|
161
|
+
signal?.throwIfAborted();
|
|
162
|
+
return output;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
if (error instanceof WorkspaceProcessCleanupError || error instanceof Error && "reportCleanup" in error) throw error;
|
|
165
|
+
options.signal?.throwIfAborted();
|
|
166
|
+
signal?.throwIfAborted();
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { killOnAbort as a, gitQuiet as c, cancelledError as d, throwIfCancelled as f, gitPath as i, gitQuietAsync as l, runOperationFileQuiet as n, git as o, childEnvironment as r, gitAsync as s, runOperationFile as t, cancellableSleep as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
1
|
+
import { g as process_identity_exports } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { c as withWorkspaceStateLock, d as writeWorkspaceState, r as readWorkspaceState } from "./workspace-state-U08dEzhG.mjs";
|
|
3
|
+
import { c as pidExists } from "./metro-DiXtA3Ty.mjs";
|
|
4
4
|
import { realpathSync } from "node:fs";
|
|
5
5
|
//#region src/collector/state.ts
|
|
6
6
|
function collectorRoot(root) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { g as process_identity_exports } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { f as throwIfCancelled } from "./operation-exec-BW0em61G.mjs";
|
|
3
|
+
import { t as connectOwnedBrowser } from "./cdp-3fwICjzi.mjs";
|
|
3
4
|
//#region src/web/page.ts
|
|
4
5
|
/** The record of a verified live browser: its supervisor and Chrome are the processes the record names. */
|
|
5
6
|
function liveWebRecord(record) {
|
|
@@ -12,21 +13,27 @@ const NAVIGATE_ACK_MS = 1e3;
|
|
|
12
13
|
* Sends one page-level DevTools command to the owned page, through a connection verified to reach its Chrome.
|
|
13
14
|
* Resolves to the URL the page was on when the command was sent.
|
|
14
15
|
*/
|
|
15
|
-
async function sendToOwnedPage(record, method, params = {}) {
|
|
16
|
-
const cdp = await connectOwnedBrowser(record.cdpPort, record.chromeProcess.pid);
|
|
16
|
+
async function sendToOwnedPage(record, method, params = {}, signal) {
|
|
17
|
+
const cdp = await connectOwnedBrowser(record.cdpPort, record.chromeProcess.pid, signal);
|
|
18
|
+
let navigateTimer;
|
|
17
19
|
try {
|
|
18
20
|
const { targetInfo } = await cdp.send("Target.getTargetInfo", { targetId: record.targetId });
|
|
21
|
+
throwIfCancelled(signal, "browser operation");
|
|
19
22
|
const { sessionId } = await cdp.send("Target.attachToTarget", {
|
|
20
23
|
targetId: record.targetId,
|
|
21
24
|
flatten: true
|
|
22
25
|
});
|
|
26
|
+
throwIfCancelled(signal, "browser operation");
|
|
23
27
|
const reply = cdp.send(method, params, sessionId);
|
|
24
28
|
if (method === "Page.navigate") {
|
|
25
29
|
reply.catch(() => {});
|
|
26
|
-
await Promise.race([reply, new Promise((resolve) =>
|
|
30
|
+
await Promise.race([reply, new Promise((resolve) => {
|
|
31
|
+
navigateTimer = setTimeout(resolve, NAVIGATE_ACK_MS);
|
|
32
|
+
})]);
|
|
27
33
|
} else await reply;
|
|
28
34
|
return targetInfo.url;
|
|
29
35
|
} finally {
|
|
36
|
+
clearTimeout(navigateTimer);
|
|
30
37
|
cdp.close();
|
|
31
38
|
}
|
|
32
39
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { realpathSync } from "fs";
|
|
3
|
+
//#region src/commands/gc/paths.ts
|
|
4
|
+
function canonicalPath(p) {
|
|
5
|
+
try {
|
|
6
|
+
return realpathSync(p);
|
|
7
|
+
} catch {
|
|
8
|
+
return resolve(p);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { canonicalPath as t };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { existsSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { buildCacheRoot as sharedBuildCache, ensurePrivateDir, withDirLock as withDirLock$1, withDirLockAsync as withDirLockAsync$1, workspaceId as workspaceId$1, workspaceName as workspaceName$1, workspaceStateDir as workspaceDir } from "@stim-cli/core";
|
|
3
|
+
import { emulatorLogFile, readJsonObject, sharedCcache as sharedCcache$1, sharedCompilationCache as sharedCompilationCache$1, supervisorLogFile, supervisorPidFile, workspaceAgentDeviceDir, workspaceDerivedData, workspaceLogErrorIndex, workspaceLogsDir as workspaceLogsDir$1, workspaceMetadataFile, workspaceStateFile as workspaceStateFile$1, workspaceStateLock } from "@stim-cli/core/state";
|
|
4
|
+
import { join, resolve } from "path";
|
|
5
|
+
//#region src/workspace/paths.ts
|
|
6
|
+
function ensureWorkspaceStorage(projectRoot) {
|
|
7
|
+
const canonicalRoot = resolve(projectRoot);
|
|
8
|
+
const dir = workspaceDir(canonicalRoot);
|
|
9
|
+
const file = workspaceMetadataFile(canonicalRoot);
|
|
10
|
+
ensurePrivateDir(dir);
|
|
11
|
+
return withDirLock$1(join(dir, "metadata.lock"), () => {
|
|
12
|
+
if (!existsSync(file)) {
|
|
13
|
+
const metadata = {
|
|
14
|
+
projectRoot: canonicalRoot,
|
|
15
|
+
workspace: workspaceName$1(canonicalRoot),
|
|
16
|
+
version: 1
|
|
17
|
+
};
|
|
18
|
+
const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
19
|
+
writeFileSync(tmp, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
20
|
+
try {
|
|
21
|
+
renameSync(tmp, file);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
rmSync(tmp, { force: true });
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
return dir;
|
|
27
|
+
}
|
|
28
|
+
if (readJsonObject(file)?.projectRoot === canonicalRoot) return dir;
|
|
29
|
+
const error = /* @__PURE__ */ new Error(`Stim workspace collision at ${dir}: its workspace.json does not belong to ${canonicalRoot}.`);
|
|
30
|
+
error.code = "STIM_WORKSPACE_COLLISION";
|
|
31
|
+
throw error;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Initializes or validates workspace storage after asynchronously acquiring its metadata lock. */
|
|
35
|
+
function ensureWorkspaceStorageAsync(projectRoot, signal) {
|
|
36
|
+
signal?.throwIfAborted();
|
|
37
|
+
const dir = workspaceDir(resolve(projectRoot));
|
|
38
|
+
ensurePrivateDir(dir);
|
|
39
|
+
return withDirLockAsync$1(join(dir, "metadata.lock"), () => ensureWorkspaceStorage(projectRoot), { signal });
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { workspaceStateLock as _, sharedCcache$1 as a, supervisorPidFile as c, workspaceDir as d, workspaceId$1 as f, workspaceStateFile$1 as g, workspaceName$1 as h, sharedBuildCache as i, workspaceAgentDeviceDir as l, workspaceLogsDir$1 as m, ensureWorkspaceStorage as n, sharedCompilationCache$1 as o, workspaceLogErrorIndex as p, ensureWorkspaceStorageAsync as r, supervisorLogFile as s, emulatorLogFile as t, workspaceDerivedData as u, withDirLock$1 as v, withDirLockAsync$1 as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as buildPlacementSettings } from "./selection-DSMbWEX2.mjs";
|
|
2
2
|
//#region src/placement-log.ts
|
|
3
|
-
/** `machine` is `local` when the run stays on this
|
|
3
|
+
/** `machine` is `local` when the run stays on this machine. */
|
|
4
4
|
function placementRecord(input) {
|
|
5
5
|
const { choice, fallback } = input;
|
|
6
6
|
const event = input.event ?? (input.kind === "build" ? "build_placement" : "device_placement");
|
|
@@ -42,8 +42,8 @@ function devicePlacementRecord({ platform, fromFlag, easFallback = false, placed
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* The record for where a build runs. `stays` is the reason this
|
|
46
|
-
* and `fallback` why a remote
|
|
45
|
+
* The record for where a build runs. `stays` is the reason this machine builds it, `chose` the remote machine that takes it,
|
|
46
|
+
* and `fallback` why a remote machine that was meant to build it did not.
|
|
47
47
|
*/
|
|
48
48
|
function buildPlacementRecord({ platform, buildMachine, candidates = [], ...outcome }) {
|
|
49
49
|
const base = {
|
|
@@ -75,7 +75,7 @@ function buildPlacementRecord({ platform, buildMachine, candidates = [], ...outc
|
|
|
75
75
|
choice: {
|
|
76
76
|
machine: "local",
|
|
77
77
|
code,
|
|
78
|
-
msg: "building on this
|
|
78
|
+
msg: "building on this machine"
|
|
79
79
|
},
|
|
80
80
|
fallback: {
|
|
81
81
|
code,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as readHostedNative } from "./ios-state-
|
|
3
|
-
import {
|
|
1
|
+
import { d as hostingMachines } from "./selection-DSMbWEX2.mjs";
|
|
2
|
+
import { r as readHostedNative } from "./ios-state-Dtw5K2aI.mjs";
|
|
3
|
+
import { i as probeHost, n as automaticDevicePlacement } from "./eas-fallback-CSgAulr5.mjs";
|
|
4
4
|
import { automaticMachineEnabled } from "@stim-cli/core/state";
|
|
5
5
|
//#region src/device-host/plan-placement.ts
|
|
6
6
|
/**
|
|
7
7
|
* Where `--plan` assumes the next run puts its simulator or emulator, with no session, reservation or state write.
|
|
8
8
|
* A named Mac, or the Mac a recorded session already holds, answers with the device its `device-host.offer` would
|
|
9
|
-
* give; `auto` repeats the placement decision a run makes now and, when that stays on this
|
|
9
|
+
* give; `auto` repeats the placement decision a run makes now and, when that stays on this machine, notes any Mac
|
|
10
10
|
* whose device would key differently. The result predicts the cache key only; a run reads its own device.
|
|
11
11
|
*/
|
|
12
|
-
async function planHostedDevice({ root, slot, platform, machine, selectors, sameKey, eas, deps = {} }) {
|
|
13
|
-
const { automatic = automaticDevicePlacement, probe = probeHost, machines = hostingMachines } = deps;
|
|
12
|
+
async function planHostedDevice({ root, slot, platform, machine, selectors, sameKey, eas, deps = {}, operation }) {
|
|
13
|
+
const { automatic = automaticDevicePlacement, probe = probeHost, machines = () => hostingMachines(void 0, operation?.signal) } = deps;
|
|
14
14
|
const named = async (name) => {
|
|
15
|
-
const result = await probe(name, platform, selectors);
|
|
15
|
+
const result = await probe(name, platform, selectors, void 0, operation?.signal);
|
|
16
16
|
if ("failure" in result.probe) return {
|
|
17
17
|
kind: "unknown",
|
|
18
18
|
reason: `${name} did not give a ${platform} device (${result.probe.failure})`
|
|
@@ -38,6 +38,7 @@ async function planHostedDevice({ root, slot, platform, machine, selectors, same
|
|
|
38
38
|
platform,
|
|
39
39
|
selectors,
|
|
40
40
|
noWait: false,
|
|
41
|
+
signal: operation?.signal,
|
|
41
42
|
...eas ? { eas } : {}
|
|
42
43
|
}, {
|
|
43
44
|
read: () => ({}),
|
|
@@ -52,17 +53,20 @@ async function planHostedDevice({ root, slot, platform, machine, selectors, same
|
|
|
52
53
|
choice: placed.target.choice,
|
|
53
54
|
placement: `on ${placed.target.host.machine}, as auto would now`
|
|
54
55
|
};
|
|
55
|
-
const names = (machines() ?? []).filter((name) => automaticMachineEnabled("device", name));
|
|
56
|
-
|
|
56
|
+
const names = (await machines() ?? []).filter((name) => automaticMachineEnabled("device", name));
|
|
57
|
+
operation?.signal.throwIfAborted();
|
|
58
|
+
const offers = await Promise.all(names.map((name) => probe(name, platform, selectors, void 0, operation?.signal)));
|
|
59
|
+
const differs = (await Promise.all(offers.map(async ({ probe: each }) => "offer" in each && each.offer.choice && await sameKey(each.offer.choice) === false ? [each.machine] : []))).flat();
|
|
57
60
|
if (differs.length) return {
|
|
58
61
|
kind: "local",
|
|
59
|
-
placement: `this
|
|
62
|
+
placement: `this machine; auto may use ${differs.join(", ")}, which builds for another architecture, so its key differs`
|
|
60
63
|
};
|
|
61
64
|
return {
|
|
62
65
|
kind: "local",
|
|
63
|
-
placement: names.length ? `this
|
|
66
|
+
placement: names.length ? `this machine; auto may use ${names.join(", ")}` : "this machine"
|
|
64
67
|
};
|
|
65
68
|
} catch (error) {
|
|
69
|
+
operation?.signal.throwIfAborted();
|
|
66
70
|
return {
|
|
67
71
|
kind: "unknown",
|
|
68
72
|
reason: error.message
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as getProject } from "./config-
|
|
2
|
-
import { n as findCommandWorkspace } from "./project-
|
|
3
|
-
import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-
|
|
1
|
+
import { p as getProject } from "./config-DlrsduwG.mjs";
|
|
2
|
+
import { n as findCommandWorkspace } from "./project-wM_XFTvE.mjs";
|
|
3
|
+
import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-DkEzOfzO.mjs";
|
|
4
4
|
//#region src/commands/ports.ts
|
|
5
5
|
async function inProject(action) {
|
|
6
6
|
try {
|