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,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { M as withDirLock$1, N as withDirLockAsync$1, w as workspaceAgentDeviceDir } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as isInsideProject } from "./metro-
|
|
6
|
-
import { r as cdpEndpoint } from "./state-
|
|
1
|
+
import { r as reportSignal, t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { M as withDirLock$1, N as withDirLockAsync$1, w as workspaceAgentDeviceDir } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { a as formatElapsed, o as formatLongDuration, r as clockTime, u as plural } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { dt as deviceSlotKey, ht as projectDeviceSlots } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { n as isInsideProject } from "./metro-B5PVz0Wv.mjs";
|
|
6
|
+
import { r as cdpEndpoint } from "./state-CtmYTRWm.mjs";
|
|
7
7
|
import { accessSync, constants, existsSync, mkdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { delimiter, dirname, join, resolve } from "node:path";
|
|
9
9
|
import { workspaceId } from "@stim-cli/core";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { r as readWorkspaceState$1 } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { I as readWorkspaceLaunches } from "./project-
|
|
6
|
-
import { o as androidHome, u as androidToolCwd } from "./android-
|
|
7
|
-
import { d as resolveProjectMetro } from "./metro-
|
|
8
|
-
import { i as parseLogcatLine, n as androidLogGroups, r as isAndroidCrashText } from "./android-
|
|
9
|
-
import { S as parseLease, v as deviceLeasePath, y as fileLeaseIo } from "./activity-
|
|
10
|
-
import { r as deviceConsoleLevel } from "./ios-device-
|
|
1
|
+
import { t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { r as readWorkspaceState$1 } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { v as launchErrorPreview } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { dt as deviceSlotKey, ft as deviceSlotPlatforms, m as getProject } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { I as readWorkspaceLaunches } from "./project-DWEXiBA9.mjs";
|
|
6
|
+
import { o as androidHome, u as androidToolCwd } from "./android-Iq0M2t2d.mjs";
|
|
7
|
+
import { d as resolveProjectMetro } from "./metro-B5PVz0Wv.mjs";
|
|
8
|
+
import { i as parseLogcatLine, n as androidLogGroups, r as isAndroidCrashText } from "./android-B2DSKg-A.mjs";
|
|
9
|
+
import { S as parseLease, v as deviceLeasePath, y as fileLeaseIo } from "./activity-C8kBq9w0.mjs";
|
|
10
|
+
import { r as deviceConsoleLevel } from "./ios-device-DLdEDWJj.mjs";
|
|
11
11
|
import { createHash, randomUUID } from "node:crypto";
|
|
12
12
|
import { existsSync, readFileSync, renameSync } from "node:fs";
|
|
13
13
|
import { homedir } from "node:os";
|
|
@@ -47,108 +47,6 @@ __reExport(ownership_claim_exports, import__stim_cli_core_ownership_claim);
|
|
|
47
47
|
//#region src/debug-log.ts
|
|
48
48
|
const debugLog = createDebugLog("cli", { base: () => ({ runId: runId() }) });
|
|
49
49
|
//#endregion
|
|
50
|
-
//#region src/report-runtime.ts
|
|
51
|
-
const reports = /* @__PURE__ */ new WeakMap();
|
|
52
|
-
function reportSignal(context) {
|
|
53
|
-
return context && reports.has(context) ? context.signal : void 0;
|
|
54
|
-
}
|
|
55
|
-
function trackReportResource(context, closed, cancel, signal = context?.signal, cleanupFailure) {
|
|
56
|
-
const state = context && reports.get(context);
|
|
57
|
-
if (!context || !state || !signal) return;
|
|
58
|
-
const { pending } = state;
|
|
59
|
-
const abort = () => {
|
|
60
|
-
const cancelled = Promise.resolve().then(cancel);
|
|
61
|
-
pending.set(cancelled, cleanupFailure);
|
|
62
|
-
cancelled.then(() => pending.delete(cancelled), (error) => {
|
|
63
|
-
state.failure ??= error;
|
|
64
|
-
pending.delete(cancelled);
|
|
65
|
-
pending.delete(closed);
|
|
66
|
-
signal.removeEventListener("abort", abort);
|
|
67
|
-
state.abort(error);
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
pending.set(closed, cleanupFailure);
|
|
71
|
-
const settled = () => {
|
|
72
|
-
signal.removeEventListener("abort", abort);
|
|
73
|
-
pending.delete(closed);
|
|
74
|
-
};
|
|
75
|
-
closed.then(settled, (error) => {
|
|
76
|
-
state.failure ??= error;
|
|
77
|
-
settled();
|
|
78
|
-
state.abort(error);
|
|
79
|
-
});
|
|
80
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
81
|
-
if (signal.aborted) abort();
|
|
82
|
-
}
|
|
83
|
-
async function runReport(context, work, timeoutMs = 6e4) {
|
|
84
|
-
const controller = new AbortController();
|
|
85
|
-
const signal = AbortSignal.any([context.signal, controller.signal]);
|
|
86
|
-
const operation = {
|
|
87
|
-
...context,
|
|
88
|
-
signal,
|
|
89
|
-
output: ((stream, text) => {
|
|
90
|
-
if (!signal.aborted) context.output(stream, text);
|
|
91
|
-
})
|
|
92
|
-
};
|
|
93
|
-
const pending = /* @__PURE__ */ new Map();
|
|
94
|
-
const state = {
|
|
95
|
-
pending,
|
|
96
|
-
abort: (reason) => controller.abort(reason)
|
|
97
|
-
};
|
|
98
|
-
reports.set(operation, state);
|
|
99
|
-
const deadline = performance.now() + timeoutMs;
|
|
100
|
-
const expire = () => {
|
|
101
|
-
controller.abort(Object.assign(/* @__PURE__ */ new Error(`The report exceeded its ${timeoutMs / 1e3} second budget.`), { code: "STIM_REPORT_TIMEOUT" }));
|
|
102
|
-
};
|
|
103
|
-
const timer = setTimeout(expire, timeoutMs);
|
|
104
|
-
let rejectCancellation;
|
|
105
|
-
const cancelled = new Promise((_, reject) => {
|
|
106
|
-
rejectCancellation = reject;
|
|
107
|
-
});
|
|
108
|
-
const abort = () => rejectCancellation(signal.reason);
|
|
109
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
110
|
-
const outcome = await (async () => {
|
|
111
|
-
try {
|
|
112
|
-
signal.throwIfAborted();
|
|
113
|
-
const result = await Promise.race([work(operation), cancelled]);
|
|
114
|
-
if (performance.now() >= deadline) expire();
|
|
115
|
-
signal.throwIfAborted();
|
|
116
|
-
return { result };
|
|
117
|
-
} catch (error) {
|
|
118
|
-
return { error };
|
|
119
|
-
}
|
|
120
|
-
})().finally(async () => {
|
|
121
|
-
clearTimeout(timer);
|
|
122
|
-
signal.removeEventListener("abort", abort);
|
|
123
|
-
controller.abort();
|
|
124
|
-
const cleanupDeadline = performance.now() + 35e3;
|
|
125
|
-
const expireCleanup = () => {
|
|
126
|
-
state.failure ??= [...pending.values()].find((failure) => failure !== void 0) ?? Object.assign(/* @__PURE__ */ new Error("Report cleanup did not finish within 35 seconds."), {
|
|
127
|
-
code: "STIM_CLAIM_UNAVAILABLE",
|
|
128
|
-
reportCleanup: true,
|
|
129
|
-
remedy: "Check that the child processes the report started and their descendants have stopped"
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
let cleanupTimer;
|
|
133
|
-
try {
|
|
134
|
-
await Promise.race([(async () => {
|
|
135
|
-
while (pending.size) await Promise.allSettled(pending.keys());
|
|
136
|
-
})(), new Promise((resolve) => {
|
|
137
|
-
cleanupTimer = setTimeout(() => {
|
|
138
|
-
expireCleanup();
|
|
139
|
-
resolve();
|
|
140
|
-
}, 35e3);
|
|
141
|
-
})]);
|
|
142
|
-
if (performance.now() >= cleanupDeadline) expireCleanup();
|
|
143
|
-
} finally {
|
|
144
|
-
clearTimeout(cleanupTimer);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
if ("failure" in state) throw state.failure;
|
|
148
|
-
if ("error" in outcome) throw outcome.error;
|
|
149
|
-
return outcome.result;
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
50
|
//#region src/process-identity.ts
|
|
153
51
|
var process_identity_exports = /* @__PURE__ */ __exportAll({});
|
|
154
52
|
import * as import__stim_cli_core_process_identity from "@stim-cli/core/process-identity";
|
|
@@ -391,6 +289,108 @@ async function waitForGroupExit(pid, budgetMs) {
|
|
|
391
289
|
return true;
|
|
392
290
|
}
|
|
393
291
|
//#endregion
|
|
292
|
+
//#region src/report-runtime.ts
|
|
293
|
+
const reports = /* @__PURE__ */ new WeakMap();
|
|
294
|
+
function reportSignal(context) {
|
|
295
|
+
return context && reports.has(context) ? context.signal : void 0;
|
|
296
|
+
}
|
|
297
|
+
function trackReportResource(context, closed, cancel, signal = context?.signal, cleanupFailure) {
|
|
298
|
+
const state = context && reports.get(context);
|
|
299
|
+
if (!context || !state || !signal) return;
|
|
300
|
+
const { pending } = state;
|
|
301
|
+
const abort = () => {
|
|
302
|
+
const cancelled = Promise.resolve().then(cancel);
|
|
303
|
+
pending.set(cancelled, cleanupFailure);
|
|
304
|
+
cancelled.then(() => pending.delete(cancelled), (error) => {
|
|
305
|
+
state.failure ??= error;
|
|
306
|
+
pending.delete(cancelled);
|
|
307
|
+
pending.delete(closed);
|
|
308
|
+
signal.removeEventListener("abort", abort);
|
|
309
|
+
state.abort(error);
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
pending.set(closed, cleanupFailure);
|
|
313
|
+
const settled = () => {
|
|
314
|
+
signal.removeEventListener("abort", abort);
|
|
315
|
+
pending.delete(closed);
|
|
316
|
+
};
|
|
317
|
+
closed.then(settled, (error) => {
|
|
318
|
+
state.failure ??= error;
|
|
319
|
+
settled();
|
|
320
|
+
state.abort(error);
|
|
321
|
+
});
|
|
322
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
323
|
+
if (signal.aborted) abort();
|
|
324
|
+
}
|
|
325
|
+
async function runReport(context, work, timeoutMs = 6e4) {
|
|
326
|
+
const controller = new AbortController();
|
|
327
|
+
const signal = AbortSignal.any([context.signal, controller.signal]);
|
|
328
|
+
const operation = {
|
|
329
|
+
...context,
|
|
330
|
+
signal,
|
|
331
|
+
output: ((stream, text) => {
|
|
332
|
+
if (!signal.aborted) context.output(stream, text);
|
|
333
|
+
})
|
|
334
|
+
};
|
|
335
|
+
const pending = /* @__PURE__ */ new Map();
|
|
336
|
+
const state = {
|
|
337
|
+
pending,
|
|
338
|
+
abort: (reason) => controller.abort(reason)
|
|
339
|
+
};
|
|
340
|
+
reports.set(operation, state);
|
|
341
|
+
const deadline = performance.now() + timeoutMs;
|
|
342
|
+
const expire = () => {
|
|
343
|
+
controller.abort(Object.assign(/* @__PURE__ */ new Error(`The report exceeded its ${timeoutMs / 1e3} second budget.`), { code: "STIM_REPORT_TIMEOUT" }));
|
|
344
|
+
};
|
|
345
|
+
const timer = setTimeout(expire, timeoutMs);
|
|
346
|
+
let rejectCancellation;
|
|
347
|
+
const cancelled = new Promise((_, reject) => {
|
|
348
|
+
rejectCancellation = reject;
|
|
349
|
+
});
|
|
350
|
+
const abort = () => rejectCancellation(signal.reason);
|
|
351
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
352
|
+
const outcome = await (async () => {
|
|
353
|
+
try {
|
|
354
|
+
signal.throwIfAborted();
|
|
355
|
+
const result = await Promise.race([work(operation), cancelled]);
|
|
356
|
+
if (performance.now() >= deadline) expire();
|
|
357
|
+
signal.throwIfAborted();
|
|
358
|
+
return { result };
|
|
359
|
+
} catch (error) {
|
|
360
|
+
return { error };
|
|
361
|
+
}
|
|
362
|
+
})().finally(async () => {
|
|
363
|
+
clearTimeout(timer);
|
|
364
|
+
signal.removeEventListener("abort", abort);
|
|
365
|
+
controller.abort();
|
|
366
|
+
const cleanupDeadline = performance.now() + 35e3;
|
|
367
|
+
const expireCleanup = () => {
|
|
368
|
+
state.failure ??= [...pending.values()].find((failure) => failure !== void 0) ?? Object.assign(/* @__PURE__ */ new Error("Report cleanup did not finish within 35 seconds."), {
|
|
369
|
+
code: "STIM_CLAIM_UNAVAILABLE",
|
|
370
|
+
reportCleanup: true,
|
|
371
|
+
remedy: "Check that the child processes the report started and their descendants have stopped"
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
let cleanupTimer;
|
|
375
|
+
try {
|
|
376
|
+
await Promise.race([(async () => {
|
|
377
|
+
while (pending.size) await Promise.allSettled(pending.keys());
|
|
378
|
+
})(), new Promise((resolve) => {
|
|
379
|
+
cleanupTimer = setTimeout(() => {
|
|
380
|
+
expireCleanup();
|
|
381
|
+
resolve();
|
|
382
|
+
}, 35e3);
|
|
383
|
+
})]);
|
|
384
|
+
if (performance.now() >= cleanupDeadline) expireCleanup();
|
|
385
|
+
} finally {
|
|
386
|
+
clearTimeout(cleanupTimer);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
if ("failure" in state) throw state.failure;
|
|
390
|
+
if ("error" in outcome) throw outcome.error;
|
|
391
|
+
return outcome.result;
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
394
|
//#region src/exec.ts
|
|
395
395
|
const MAX_BUFFER = 67108864;
|
|
396
396
|
const REPORT_CHILD_EXIT_CAP_MS = 15e3;
|
|
@@ -994,4 +994,4 @@ function getExecutor() {
|
|
|
994
994
|
return active;
|
|
995
995
|
}
|
|
996
996
|
//#endregion
|
|
997
|
-
export {
|
|
997
|
+
export { operationState as C, ownership_claim_exports as D, debugLog as E, __commonJSMin as O, isTermination as S, process_identity_exports as T, declareSpawnsOn as _, trackReportResource as a, spawnDeclared as b, waitForGroupExit as c, throwIfCancelled as d, WorkspaceProcessCleanupError as f, allowDeclaredSpawns as g, workspaceProcessLockPath as h, runReport as i, __require as k, cancellableSleep as l, workspaceProcessLockError as m, isTimeoutError as n, groupExitBudgetMs as o, withWorkspaceProcessLock as p, reportSignal as r, loadScaledBudgetMs as s, getExecutor as t, cancelledError as u, refuseDeclaredSpawns as v, withDrainingCancellation as w, stopDeclaringSpawnsOn as x, signalDeclaredSpawns as y };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _t as findStaleDeviceRecords, ft as describeParkedSims, gt as findOrphanedDevices, pt as describeUnverifiableDevices, q as selectCaches, ut as deleteParkedSims, vt as findStaleProjectDevices } from "./ccache-
|
|
2
|
-
import { a as runGc, i as readGcReport, n as executeGc, o as withGcMaintenanceClaim, r as gcCommand, s as formatGcReport, t as collectGcReport } from "./gc-
|
|
1
|
+
import { _t as findStaleDeviceRecords, ft as describeParkedSims, gt as findOrphanedDevices, pt as describeUnverifiableDevices, q as selectCaches, ut as deleteParkedSims, vt as findStaleProjectDevices } from "./ccache-BXtzEL6M.mjs";
|
|
2
|
+
import { a as runGc, i as readGcReport, n as executeGc, o as withGcMaintenanceClaim, r as gcCommand, s as formatGcReport, t as collectGcReport } from "./gc-DolXpMSB.mjs";
|
|
3
3
|
export { collectGcReport, gcCommand as default, deleteParkedSims, describeParkedSims, describeUnverifiableDevices, executeGc, findOrphanedDevices, findStaleDeviceRecords, findStaleProjectDevices, formatGcReport, readGcReport, runGc, selectCaches, withGcMaintenanceClaim };
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { D as ownership_claim_exports,
|
|
2
|
-
import { E as workspaceDir, u as workspaceLastUsed } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import { d as
|
|
5
|
-
import { t as runOperationFile } from "./operation-exec-
|
|
6
|
-
import { $t as TRASH_MANIFEST, Ft as matchWorktreeEntry, Wt as resolveSourceCheckoutAsync, Zt as TRASH_CLAIMS, en as deleteTrashEntry, jt as listWorktreesAsync } from "./settings-
|
|
7
|
-
import { i as findProjectRoot$1, v as detectIsExpo } from "./project-
|
|
8
|
-
import { B as listOrphanedAvdDirectories, Et as readCreatedDevices$1, R as listAvdsAsync, Tt as forgetCreatedDeviceAsync, U as ownedAvdDirectory, bt as parkedMaxSetting, h as avdNameAbsent, mt as POOL_SETTING_REMEDY } from "./android-
|
|
9
|
-
import { $ as gradleVersionLines, $n as memoryCacheKind, B as includesArchives, Ct as describeError, En as runProcessOperation, F as gcOptionsOf, Ft as withEasProjectLock, G as planCacheEmptying, H as includesRecordings, J as selectsBeyondCaches, Jn as parseArchiveSelector, K as previewScopedEmptying, L as openGcLog, Q as deleteGradleVersions, St as deleteEasSessions, U as includesWorkspaceOutputs, V as includesParkedDevices, W as isWorkspacesScope, X as collectGradleVersions, Y as trimCaches, Zn as collectMemoryReport, _t as findStaleDeviceRecords, ar as scopedMemoryReport, at as DEVICE_LIST_TIMEOUT_MS, bt as withAndroidAvdSizes, ct as collectParkedSims, dt as deleteProjectDevices, er as memoryLines, et as gradleVersionsPending, fr as sizeCaches, gt as findOrphanedDevices, ht as eraseParkedDevices, ir as reclaimMemory, it as collectInventory, lt as deleteParkedAvds, mt as deviceSweepIsScoped, nr as memorySweepIsScoped, ot as collectDeviceLeases, pt as describeUnverifiableDevices, q as selectCaches, rr as memoryWorkPending, rt as getMachineCacheReport, sr as phase, st as collectParkedAvds, tr as memoryScope, tt as includesGradleVersions, ur as discoverCaches, ut as deleteParkedSims, vt as findStaleProjectDevices, wt as withRemoteSessionGcLocks, xt as collectEasSessionSweep, yt as unverifiedDeviceCommand, z as emptyCaches } from "./ccache-
|
|
10
|
-
import { n as easMachineStateRoot$1, o as removeEasSessionClaimAsync, r as readEasSessionLedger$1 } from "./eas-session-ledger-
|
|
11
|
-
import { At as mapLimited, Dt as createGcResults, Et as GC_OUTPUT, I as idleDeviceLines, M as collectIdleDevices, Mt as sizeConcurrency, N as collectIdleDevicesAsync, R as parseIdleDuration, a as collectOrphanedWorkspaces, b as workspaceInUseAsync, c as isInsideWorkspaces, f as rootPresence, g as ARTIFACT_DIRS, i as clearWorkspaceOutputs, jt as readConcurrency, kt as eachLimited, n as REBUILD_COST, o as collectWorkspaceOutputs, p as sizeText, r as WORKSPACE_OUTPUT_DIRS, s as deleteOrphanedWorkspaces, t as LIGHTEN_AFTER_MS, u as listWorkspaceDirs, v as withIdleWorkspace, wt as listBuildSlots, z as shutDownIdleDevices } from "./workspaces-
|
|
1
|
+
import { D as ownership_claim_exports, T as process_identity_exports, _ as declareSpawnsOn, d as throwIfCancelled, f as WorkspaceProcessCleanupError, t as getExecutor, w as withDrainingCancellation, x as stopDeclaringSpawnsOn } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir, u as workspaceLastUsed } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { d as quotedPath$1, h as shortUdid, o as formatLongDuration, u as plural } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { C as removeProject, M as acquireAvdClaim, at as isOnMountedVolume, d as getConfigDir, ht as projectDeviceSlots, it as isAbsentPath, k as withConfigLockAsync$1, nt as directorySizeAsync, ot as listMountedVolumes, rt as formatBytes, st as measuredDirectorySizeAsync, v as loadConfig$1 } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { t as runOperationFile } from "./operation-exec-DKlBcKAL.mjs";
|
|
6
|
+
import { $t as TRASH_MANIFEST, Ft as matchWorktreeEntry, Wt as resolveSourceCheckoutAsync, Zt as TRASH_CLAIMS, en as deleteTrashEntry, jt as listWorktreesAsync } from "./settings-B5IBDfTx.mjs";
|
|
7
|
+
import { i as findProjectRoot$1, v as detectIsExpo } from "./project-DWEXiBA9.mjs";
|
|
8
|
+
import { B as listOrphanedAvdDirectories, Et as readCreatedDevices$1, R as listAvdsAsync, Tt as forgetCreatedDeviceAsync, U as ownedAvdDirectory, bt as parkedMaxSetting, h as avdNameAbsent, mt as POOL_SETTING_REMEDY } from "./android-Iq0M2t2d.mjs";
|
|
9
|
+
import { $ as gradleVersionLines, $n as memoryCacheKind, B as includesArchives, Ct as describeError, En as runProcessOperation, F as gcOptionsOf, Ft as withEasProjectLock, G as planCacheEmptying, H as includesRecordings, J as selectsBeyondCaches, Jn as parseArchiveSelector, K as previewScopedEmptying, L as openGcLog, Q as deleteGradleVersions, St as deleteEasSessions, U as includesWorkspaceOutputs, V as includesParkedDevices, W as isWorkspacesScope, X as collectGradleVersions, Y as trimCaches, Zn as collectMemoryReport, _t as findStaleDeviceRecords, ar as scopedMemoryReport, at as DEVICE_LIST_TIMEOUT_MS, bt as withAndroidAvdSizes, ct as collectParkedSims, dt as deleteProjectDevices, er as memoryLines, et as gradleVersionsPending, fr as sizeCaches, gt as findOrphanedDevices, ht as eraseParkedDevices, ir as reclaimMemory, it as collectInventory, lt as deleteParkedAvds, mt as deviceSweepIsScoped, nr as memorySweepIsScoped, ot as collectDeviceLeases, pt as describeUnverifiableDevices, q as selectCaches, rr as memoryWorkPending, rt as getMachineCacheReport, sr as phase, st as collectParkedAvds, tr as memoryScope, tt as includesGradleVersions, ur as discoverCaches, ut as deleteParkedSims, vt as findStaleProjectDevices, wt as withRemoteSessionGcLocks, xt as collectEasSessionSweep, yt as unverifiedDeviceCommand, z as emptyCaches } from "./ccache-BXtzEL6M.mjs";
|
|
10
|
+
import { n as easMachineStateRoot$1, o as removeEasSessionClaimAsync, r as readEasSessionLedger$1 } from "./eas-session-ledger-Bspy-VJQ.mjs";
|
|
11
|
+
import { At as mapLimited, Dt as createGcResults, Et as GC_OUTPUT, I as idleDeviceLines, M as collectIdleDevices, Mt as sizeConcurrency, N as collectIdleDevicesAsync, R as parseIdleDuration, a as collectOrphanedWorkspaces, b as workspaceInUseAsync, c as isInsideWorkspaces, f as rootPresence, g as ARTIFACT_DIRS, i as clearWorkspaceOutputs, jt as readConcurrency, kt as eachLimited, n as REBUILD_COST, o as collectWorkspaceOutputs, p as sizeText, r as WORKSPACE_OUTPUT_DIRS, s as deleteOrphanedWorkspaces, t as LIGHTEN_AFTER_MS, u as listWorkspaceDirs, v as withIdleWorkspace, wt as listBuildSlots, z as shutDownIdleDevices } from "./workspaces-B3ahAHZc.mjs";
|
|
12
12
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
13
|
-
import { N as listBuildLocks, k as removeExpiredLease } from "./activity-
|
|
14
|
-
import { d as listAllIosSims, f as listAllIosSimsAsync } from "./ios-
|
|
13
|
+
import { N as listBuildLocks, k as removeExpiredLease } from "./activity-C8kBq9w0.mjs";
|
|
14
|
+
import { d as listAllIosSims, f as listAllIosSimsAsync } from "./ios-BdZdNsAj.mjs";
|
|
15
15
|
import { t as resolveMaintenanceSettings } from "./settings-D9LtQaUw.mjs";
|
|
16
|
-
import { r as readCollectors } from "./ownership-
|
|
17
|
-
import { A as deleteSelectedArchives, O as
|
|
18
|
-
import { p as writeCacheFile } from "./warm-progress-
|
|
19
|
-
import { a as restoreProblem, o as workspaceKeys } from "./lightened-
|
|
20
|
-
import { C as candidateRootsAsync, D as worktreeRemovalReason, E as worktreePullRequestNote, S as maintenancePinned, T as removeWorktrees, _ as finishedWorkspaces, a as previewMaintenance, b as cachedDeviceActivity, c as deleteTempLeftovers, d as appRoots, f as artifactWorktrees, g as stopIdleWorkspace, h as planIdleStop, l as tempLeftoverLines, m as collectArtifactsAsync, o as triggeringRoot, p as clearArtifact, s as collectTempLeftovers, t as deleteIdleWorkspaceDevices, u as tempLeftoverSection, w as collectWorktreeSweep, x as cachedDeviceActivityAsync, y as ownedDeviceUsage } from "./act-
|
|
21
|
-
import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-
|
|
16
|
+
import { r as readCollectors } from "./ownership-hC7xvvxF.mjs";
|
|
17
|
+
import { A as deleteSelectedArchives, O as classifyProjectEntries, j as sweepArchiveStaging, k as reclaimProject } from "./worktree-BhsML6GV.mjs";
|
|
18
|
+
import { p as writeCacheFile } from "./warm-progress-q11Vdvhh.mjs";
|
|
19
|
+
import { a as restoreProblem, o as workspaceKeys } from "./lightened-Cv4ToJRX.mjs";
|
|
20
|
+
import { C as candidateRootsAsync, D as worktreeRemovalReason, E as worktreePullRequestNote, S as maintenancePinned, T as removeWorktrees, _ as finishedWorkspaces, a as previewMaintenance, b as cachedDeviceActivity, c as deleteTempLeftovers, d as appRoots, f as artifactWorktrees, g as stopIdleWorkspace, h as planIdleStop, l as tempLeftoverLines, m as collectArtifactsAsync, o as triggeringRoot, p as clearArtifact, s as collectTempLeftovers, t as deleteIdleWorkspaceDevices, u as tempLeftoverSection, w as collectWorktreeSweep, x as cachedDeviceActivityAsync, y as ownedDeviceUsage } from "./act-Cur4YKtK.mjs";
|
|
21
|
+
import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-BTRaK_up.mjs";
|
|
22
22
|
import { claimRemoveCommand, isClaimRefusal, isClaimUnavailable, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
23
23
|
import { existsSync, lstatSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
24
24
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
25
25
|
import { LOG_ROTATE_BYTES, ensurePrivateDir, rotatedLogPath, withDirLock, withDirLockTransaction } from "@stim-cli/core";
|
|
26
26
|
import { assertHostedDeviceLedger, configLockPath, deviceHostArea, deviceHostRoot, diskUsageCacheFile, hostedDeviceId, isJsonObject, listRecordedDevicesAsync, listStatusCacheEntries, maintenanceRunClaims, parseHostedPlatformDevice, readArchivesAsync, readDiskUsage, readHostedDevice, readHostedDeviceLedger, readHostedSessions, recordedBytes, trashRoot } from "@stim-cli/core/state";
|
|
27
|
-
import {
|
|
28
|
-
import { fileURLToPath } from "node:url";
|
|
29
|
-
import { setImmediate } from "node:timers/promises";
|
|
27
|
+
import { join as join$1 } from "path";
|
|
30
28
|
import chalk from "chalk";
|
|
31
29
|
import { existsSync as existsSync$1 } from "fs";
|
|
32
30
|
import { InvalidArgumentError } from "commander";
|
|
31
|
+
import { fileURLToPath } from "node:url";
|
|
32
|
+
import { setImmediate } from "node:timers/promises";
|
|
33
33
|
import { lstat, open, readFile, readdir, rename, rm, stat, utimes, writeFile } from "node:fs/promises";
|
|
34
34
|
//#region src/commands/gc/archives.ts
|
|
35
35
|
async function stagingOrNone(signal) {
|
|
@@ -2276,40 +2276,11 @@ async function removeInvalidProjectEntries(invalidProjects, output, signal) {
|
|
|
2276
2276
|
function collectGcMemory(scope, env, operation) {
|
|
2277
2277
|
return memorySweepIsScoped(env) ? Promise.resolve(scopedMemoryReport()) : collectMemoryReport(scope, true, operation);
|
|
2278
2278
|
}
|
|
2279
|
-
function classifyProjectEntries(cfg, mountedVolumes) {
|
|
2280
|
-
const deadProjects = [];
|
|
2281
|
-
const invalidProjects = [];
|
|
2282
|
-
const skipped = [];
|
|
2283
|
-
for (const [path, project] of Object.entries(cfg?.projects || {})) {
|
|
2284
|
-
if (!isAbsolute$1(path)) {
|
|
2285
|
-
const claimed = describeDereferenced(project);
|
|
2286
|
-
if (claimed.length) skipped.push({
|
|
2287
|
-
dir: path,
|
|
2288
|
-
reason: `not an absolute path, so this record is invalid; kept because it still claims ${claimed.join(" and ")}; gc removes it once that claim is gone, or drop the entry from the config file by hand`
|
|
2289
|
-
});
|
|
2290
|
-
else invalidProjects.push(path);
|
|
2291
|
-
continue;
|
|
2292
|
-
}
|
|
2293
|
-
if (existsSync$1(path)) continue;
|
|
2294
|
-
if (!isOnMountedVolume(path, mountedVolumes)) {
|
|
2295
|
-
const volume = volumeRootFor(path);
|
|
2296
|
-
skipped.push({
|
|
2297
|
-
dir: path,
|
|
2298
|
-
reason: `volume ${volume} is not mounted`
|
|
2299
|
-
});
|
|
2300
|
-
} else deadProjects.push(path);
|
|
2301
|
-
}
|
|
2302
|
-
return {
|
|
2303
|
-
deadProjects,
|
|
2304
|
-
invalidProjects,
|
|
2305
|
-
skipped
|
|
2306
|
-
};
|
|
2307
|
-
}
|
|
2308
2279
|
/** The workspace directories an unscoped run removes whole: those of dead projects and orphaned directories. */
|
|
2309
2280
|
async function removedWholeWorkspaceDirs(operation) {
|
|
2310
2281
|
const mountedVolumes = listMountedVolumes();
|
|
2311
2282
|
const cfg = loadConfig$1();
|
|
2312
|
-
const { deadProjects } = classifyProjectEntries(cfg, mountedVolumes);
|
|
2283
|
+
const { deadProjects } = classifyProjectEntries(cfg?.projects ?? {}, mountedVolumes);
|
|
2313
2284
|
const { orphaned } = await collectOrphanedWorkspaces(Object.keys(cfg?.projects ?? {}), mountedVolumes, {
|
|
2314
2285
|
measure: false,
|
|
2315
2286
|
operation
|
|
@@ -2444,7 +2415,7 @@ async function collectGcReport({ olderThan = null, cache = null, worktrees = fal
|
|
|
2444
2415
|
olderThanDays: olderThan,
|
|
2445
2416
|
now
|
|
2446
2417
|
});
|
|
2447
|
-
const { deadProjects, invalidProjects, skipped } = classifyProjectEntries(cfg, mountedVolumes);
|
|
2418
|
+
const { deadProjects, invalidProjects, skipped } = classifyProjectEntries(cfg?.projects ?? {}, mountedVolumes);
|
|
2448
2419
|
const workspaceDirs = await collectOrphanedWorkspaces(Object.keys(cfg?.projects ?? {}), mountedVolumes, { operation });
|
|
2449
2420
|
skipped.push(...workspaceDirs.skipped);
|
|
2450
2421
|
const statusCaches = collectStaleStatusCaches(mountedVolumes);
|
|
@@ -2913,7 +2884,7 @@ async function pruneDeadProjects(deadProjects, output, operation) {
|
|
|
2913
2884
|
let deleteFailures = 0;
|
|
2914
2885
|
for (const path of deadProjects) {
|
|
2915
2886
|
operation?.signal.throwIfAborted();
|
|
2916
|
-
if (
|
|
2887
|
+
if (!isAbsentPath(path) || !isOnMountedVolume(path)) {
|
|
2917
2888
|
output.log(chalk.yellow(`Kept ${path}: its absence can no longer be confirmed.`));
|
|
2918
2889
|
output.record("project", "kept", path, { detail: "its absence can no longer be confirmed" });
|
|
2919
2890
|
continue;
|