stim 1.14.0 → 1.16.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.
Files changed (152) hide show
  1. package/README.md +2 -0
  2. package/dist/activity-BxwdD81S.mjs +609 -0
  3. package/dist/agent-device-usage-output-Dpih1Tfa.mjs +411 -0
  4. package/dist/{android-d6rGq1pA.mjs → android-B_NumVyQ.mjs} +169 -81
  5. package/dist/{android-LbPFRWVL.mjs → android-Ift4kVvt.mjs} +517 -413
  6. package/dist/android-cas-8U4DPqeR.mjs +167 -0
  7. package/dist/android-cas-compiler.mjs +2 -2
  8. package/dist/{android-XpvCrV7q.mjs → android-r2rBL8kV.mjs} +2 -2
  9. package/dist/{app-install-BpgSgkJj.mjs → app-install-CKWdbXIX.mjs} +128 -151
  10. package/dist/attempt-Bk2ouQVL.mjs +39 -0
  11. package/dist/budget-DjrURfQn.mjs +2700 -0
  12. package/dist/{build-plan-Dcr-3ie0.mjs → build-plan-DjeSb2Xl.mjs} +192 -653
  13. package/dist/build-slots-rUk77xqh.mjs +132 -0
  14. package/dist/{cache-manifest-C68QQ0ua.mjs → cache-manifest-DnUHBJaU.mjs} +2 -2
  15. package/dist/cache-manifest.mjs +1 -1
  16. package/dist/{chrome-BPCiC3ZX.mjs → chrome-BrcVWQyD.mjs} +1 -1
  17. package/dist/cli-BkYZ_6hy.mjs +51 -0
  18. package/dist/cli.mjs +6 -42
  19. package/dist/client-BTY686R6.mjs +1368 -0
  20. package/dist/collector-run.mjs +9 -195
  21. package/dist/{command-output-DVcpw6eE.mjs → command-output-DnJMdEY-.mjs} +1 -1
  22. package/dist/{config-lvc7d3C2.mjs → config-D0DbpZtM.mjs} +28 -29
  23. package/dist/{created-devices-CllH_8eb.mjs → created-devices-D5owjN4C.mjs} +2 -2
  24. package/dist/{dependency-state-DsT7aKeo.mjs → dependency-state-B6cMXZab.mjs} +2 -2
  25. package/dist/{deps-D9IcKqXS.mjs → deps-urbmfXig.mjs} +3 -3
  26. package/dist/{detached-entry-DJHoca49.mjs → detached-entry-CiTEgMR1.mjs} +1 -1
  27. package/dist/dev-client-CroAIjjj.mjs +43 -0
  28. package/dist/{device-CjuuAJjQ.mjs → device-DZQjF7H5.mjs} +8 -7
  29. package/dist/device-capacity-BHwxNBlu.mjs +136 -0
  30. package/dist/device-host-worker.d.mts +1 -0
  31. package/dist/device-host-worker.mjs +964 -0
  32. package/dist/device-ios-BadmeL2V.mjs +381 -0
  33. package/dist/{device-lease-5c3WrVRm.mjs → device-lease-D-hLqx1b.mjs} +43 -36
  34. package/dist/{device-pool-BiyDyPP-.mjs → device-lease-run-CqjShqWW.mjs} +6 -126
  35. package/dist/device-pool-CUaEWMMm.mjs +125 -0
  36. package/dist/{device-remote-D87zEzaq.mjs → device-remote-D5WVWqOq.mjs} +69 -163
  37. package/dist/{doctor-x9pnU9fq.mjs → doctor-Cimf-gGB.mjs} +241 -103
  38. package/dist/{error-diagnostics-C5HzcwCW.mjs → error-diagnostics-B9L4Ae0x.mjs} +15 -18
  39. package/dist/{exec-DK8KaVHK.mjs → exec-CaErVv7t.mjs} +5 -1
  40. package/dist/{gc-ko6mUAYD.mjs → gc-Bqy4bjEu.mjs} +599 -108
  41. package/dist/{android-cas-iZK3DOCr.mjs → gradle-BsO1MdsH.mjs} +8 -294
  42. package/dist/{guide-6R0VNFqI.mjs → guide-B_uyKTxW.mjs} +2511 -239
  43. package/dist/{guide-status-BZrFPIA_.mjs → guide-status-CjEZMAD4.mjs} +3 -3
  44. package/dist/hosted-client-a-WmqE2L.mjs +197 -0
  45. package/dist/hosted-ios-CIWelIqf.mjs +220 -0
  46. package/dist/hosted-logs-D5g041Q3.mjs +187 -0
  47. package/dist/hosted-macos-BSZyIb3y.mjs +135 -0
  48. package/dist/idle-DYVymG92.mjs +1099 -0
  49. package/dist/idle-shutdown-CTsDnAde.mjs +122 -0
  50. package/dist/in-use-DvBw0Kxo.mjs +130 -0
  51. package/dist/{ios-BwDPrnYQ.mjs → ios-BaInn3sW.mjs} +201 -10
  52. package/dist/ios-Cr1h5gnO.mjs +189 -0
  53. package/dist/{ios-P1f5nm2n.mjs → ios-aq3QoGI3.mjs} +1159 -633
  54. package/dist/{ios-device-BiOsSVzd.mjs → ios-device-Ee7sDXfp.mjs} +1 -1
  55. package/dist/{ios-device-DGglU3E_.mjs → ios-device-FfCN_C8p.mjs} +12 -7
  56. package/dist/ios-state-DS5UpYTH.mjs +48 -0
  57. package/dist/{launch-verify-Deg4tB3Z.mjs → launch-verify-2DBRizjo.mjs} +5 -5
  58. package/dist/logs-CHEVK8zD.mjs +371 -0
  59. package/dist/machines-BIBUdhpj.mjs +265 -0
  60. package/dist/macos-CSYEAFmF.mjs +473 -0
  61. package/dist/macos-run.d.mts +5 -0
  62. package/dist/macos-run.mjs +2 -0
  63. package/dist/maintenance-run.d.mts +4 -0
  64. package/dist/maintenance-run.mjs +254 -0
  65. package/dist/{metro-CcEo8Fl8.mjs → metro-BeK1ZPz1.mjs} +20 -120
  66. package/dist/metro-gateway-BJ-rxQAB.mjs +84 -0
  67. package/dist/{named-ports-Blg8IxOh.mjs → named-ports-Bk_YXEmE.mjs} +6 -59
  68. package/dist/native-run-NaBrRFtQ.mjs +147 -0
  69. package/dist/{native-runtime-DjBHRg5m.mjs → native-runtime-DBzRnEKS.mjs} +9 -5
  70. package/dist/{ndjson-CDY9IkVC.mjs → ndjson-PclOIwVY.mjs} +2 -2
  71. package/dist/offload-worker.d.mts +122 -0
  72. package/dist/offload-worker.mjs +606 -0
  73. package/dist/{ownership-DyYDF5ww.mjs → ownership-DiA16AsN.mjs} +3 -2
  74. package/dist/ownership-hCkPzGmr.mjs +571 -0
  75. package/dist/{page-BHUzTDFt.mjs → page-QF_Ke10s.mjs} +7 -2
  76. package/dist/{ports-BguS83ex.mjs → ports-R2k4Knz3.mjs} +3 -3
  77. package/dist/prebuild-D2fsca_Z.mjs +213 -0
  78. package/dist/preview-DhVbvPAZ.mjs +318 -0
  79. package/dist/process-identity-BmRm1qV0.mjs +12 -0
  80. package/dist/{project-CWlvEaeN.mjs → project-Du91Ilvc.mjs} +74 -19
  81. package/dist/pull-request-pxnDCQzn.mjs +322 -0
  82. package/dist/pull-requests.d.mts +120 -0
  83. package/dist/pull-requests.mjs +2 -0
  84. package/dist/recordings-BIXOzVnr.mjs +37 -0
  85. package/dist/{reload-BiniwsSZ.mjs → reload-rM9jV1fz.mjs} +109 -24
  86. package/dist/{remote-cache-CcR6o6lI.mjs → remote-cache-C8-V13XN.mjs} +5 -5
  87. package/dist/run-f4vI6EnK.mjs +119 -0
  88. package/dist/{server-bare-DGfgyJ5J.mjs → server-bare-CpPGmnmO.mjs} +33 -15
  89. package/dist/server-expo-CVqO2c35.mjs +2 -0
  90. package/dist/{server-expo-BVuwQ65v.mjs → server-expo-MC0rHlOC.mjs} +8 -12
  91. package/dist/settings-BBpMcDbD.mjs +25 -0
  92. package/dist/{settings-B-fsC-Om.mjs → settings-ZkDzkzvB.mjs} +22 -10
  93. package/dist/settings-oTSkkNrM.mjs +1439 -0
  94. package/dist/settings.schema.json +845 -97
  95. package/dist/{simslim-DrDN4WuV.mjs → simslim-B8-7AoTI.mjs} +8 -132
  96. package/dist/{slot-launch-D5t8EiMf.mjs → slot-launch-B8VrHxn1.mjs} +11 -8
  97. package/dist/{spawn-claims-Drw_o-Fb.mjs → spawn-claims-D0XfSe8u.mjs} +1 -1
  98. package/dist/spawn-entry-jw19m8Nl.mjs +17 -0
  99. package/dist/stage-CzaiwFsI.mjs +143 -0
  100. package/dist/start-CX8Ig-U2.mjs +2 -0
  101. package/dist/{start-s4RXp1wy.mjs → start-ClDfwXa4.mjs} +116 -65
  102. package/dist/state-3DwSQIBK.mjs +41 -0
  103. package/dist/state-B4PQFXMW.d.mts +12 -0
  104. package/dist/{state-Dk9RVXI7.mjs → state-C1jB7Q8q.mjs} +70 -8
  105. package/dist/{state-DHqvsbqC.mjs → state-DcW6vOd_.mjs} +7 -4
  106. package/dist/stats-CEZ_i5je.mjs +77 -0
  107. package/dist/{status-BgAuxESg.mjs → status-BuvBFeII.mjs} +118 -20
  108. package/dist/{status-BsPAnfOI.mjs → status-Cs7VLg9D.mjs} +542 -283
  109. package/dist/status-DlKvVJBE.mjs +49 -0
  110. package/dist/stdout-reader-C8yjre1x.mjs +23 -0
  111. package/dist/stim-desktop-Cnz8CPnl.mjs +63 -0
  112. package/dist/stim-footprint.swift +32 -0
  113. package/dist/{stim-installations-CINXy_su.mjs → stim-installations-QMEI32v1.mjs} +1 -1
  114. package/dist/stop-B0Yxtmiy.mjs +48 -0
  115. package/dist/{stop-BzreOWJp.mjs → stop-Bffozsac.mjs} +83 -16
  116. package/dist/{stop-BWIF_6BK.mjs → stop-Dt_dM16A.mjs} +2 -2
  117. package/dist/stop-cause-CidxIqup.mjs +97 -0
  118. package/dist/supervisor-run.d.mts +43 -11
  119. package/dist/supervisor-run.mjs +363 -24
  120. package/dist/support-CAP8qDUF.mjs +316 -0
  121. package/dist/support-D4aYJniO.mjs +201 -0
  122. package/dist/teardown-CL6vDs2Y.mjs +727 -0
  123. package/dist/{xcode-Cp5KvK9x.mjs → toolchain-DkUflduf.mjs} +364 -14
  124. package/dist/trigger-Bemu8ytw.mjs +65 -0
  125. package/dist/trigger-CXts6qt1.mjs +2 -0
  126. package/dist/warm-progress-CpGv3Wb6.mjs +732 -0
  127. package/dist/{web-BsQs1WlO.mjs → web-DWUaMp8P.mjs} +37 -21
  128. package/dist/web-run.mjs +310 -13
  129. package/dist/workspace-process-lock-BL7Q0HCO.mjs +57 -0
  130. package/dist/workspace-state-B8-aJ1_5.mjs +371 -0
  131. package/dist/workspaces-BV4pdHFz.mjs +306 -0
  132. package/dist/{worktree-UrQWXSeb.mjs → worktree-K-xj9Db0.mjs} +625 -256
  133. package/dist/worktree-jnG8Iph5.mjs +2 -0
  134. package/package.json +10 -5
  135. package/shim/bundle-response.cjs +28 -12
  136. package/dist/activity-CYVDcrt3.mjs +0 -356
  137. package/dist/budget-CGDkhvv_.mjs +0 -1745
  138. package/dist/build-progress-DxKpwnaS.mjs +0 -247
  139. package/dist/idle-DXtx3RbX.mjs +0 -191
  140. package/dist/in-use-DlqBDKqY.mjs +0 -249
  141. package/dist/logs-Civ4gbBH.mjs +0 -486
  142. package/dist/merge-state-ytFQCeh4.mjs +0 -262
  143. package/dist/server-expo-DIHDhvGg.mjs +0 -2
  144. package/dist/settings-D61iNOsB.mjs +0 -629
  145. package/dist/start-Cetfvy8l.mjs +0 -2
  146. package/dist/stats-CFpFGlJV.mjs +0 -62
  147. package/dist/stats-CX1Z8Tca.mjs +0 -368
  148. package/dist/stim-desktop-CXt8-Z3J.mjs +0 -40
  149. package/dist/stop-cause-hjGBOZTG.mjs +0 -1231
  150. package/dist/worktree-BVrHsYZG.mjs +0 -752
  151. package/dist/worktree-CHWWvm5v.mjs +0 -2
  152. package/dist/{metro-store-DzeWkfqW.mjs → metro-store-CDDZHtPl.mjs} +1 -1
@@ -0,0 +1,132 @@
1
+ import { n as ownership_claim_exports } from "./process-identity-BmRm1qV0.mjs";
2
+ import { a as formatElapsed } from "./command-output-DnJMdEY-.mjs";
3
+ import { n as declareSpawnsOn, o as stopDeclaringSpawnsOn } from "./spawn-claims-D0XfSe8u.mjs";
4
+ import { readdirSync, statSync } from "node:fs";
5
+ import { join } from "node:path";
6
+ import { buildSlotsDir, tryAcquireBuildSlotClaim } from "@stim-cli/core/state";
7
+ //#region src/engine/build-slots.ts
8
+ const SLOT_PREFIX = "slot-";
9
+ const SLOT_POLL_MS = 1e3;
10
+ const SLOT_PROGRESS_MS = 3e4;
11
+ const SLOT_CEILING_MS = 54e5;
12
+ function sleepAsync(ms) {
13
+ return new Promise((resolve) => setTimeout(resolve, ms));
14
+ }
15
+ function toRecord(holder) {
16
+ const details = holder.details;
17
+ return {
18
+ pid: holder.owner.pid,
19
+ index: typeof details.index === "number" ? details.index : null,
20
+ projectRoot: typeof details.projectRoot === "string" ? details.projectRoot : null,
21
+ startedAt: holder.startedAt || null,
22
+ logFile: typeof details.logFile === "string" ? details.logFile : null
23
+ };
24
+ }
25
+ function tryAcquireBuildSlot({ max, root = null, logFile = null }) {
26
+ if (!max || max <= 0) return {
27
+ acquired: true,
28
+ unlimited: true
29
+ };
30
+ const got = tryAcquireBuildSlotClaim({
31
+ max,
32
+ details: {
33
+ projectRoot: root,
34
+ logFile
35
+ }
36
+ });
37
+ if (!got) return null;
38
+ declareSpawnsOn(got.claim);
39
+ return {
40
+ acquired: true,
41
+ path: got.path,
42
+ index: got.index,
43
+ slot: {
44
+ pid: got.claim.owner.pid,
45
+ index: got.index,
46
+ projectRoot: root,
47
+ startedAt: got.claim.startedAt,
48
+ logFile
49
+ },
50
+ claim: got.claim
51
+ };
52
+ }
53
+ function slotWaitingLine({ max, elapsedMs }) {
54
+ return `${"build".padEnd(11)} waiting for a build slot (all ${max} in use, ${formatElapsed(elapsedMs)} elapsed) -- stim guide lifecycle concurrency`;
55
+ }
56
+ async function acquireBuildSlot({ max, root = null, logFile = null, now = Date.now, out = () => {}, sleep = sleepAsync, intervalMs = SLOT_POLL_MS, progressMs = SLOT_PROGRESS_MS, ceilingMs = SLOT_CEILING_MS }) {
57
+ if (!max || max <= 0) return {
58
+ acquired: true,
59
+ unlimited: true
60
+ };
61
+ const started = now();
62
+ let lastProgress = started;
63
+ let waited = false;
64
+ for (;;) {
65
+ const got = tryAcquireBuildSlot({
66
+ max,
67
+ root,
68
+ logFile
69
+ });
70
+ if (got) return {
71
+ ...got,
72
+ slotWaitMs: waited ? Math.max(0, Math.round(now() - started)) : 0
73
+ };
74
+ waited = true;
75
+ const elapsed = now() - started;
76
+ if (elapsed >= ceilingMs) {
77
+ const err = /* @__PURE__ */ new Error(`Waited ${formatElapsed(elapsed)} for one of ${max} build slots, and every slot is held by a process that is still running, or by a holder Stim cannot identify. Slots live under ` + buildSlotsDir() + "; remove a slot directory whose builder is not really building, or raise concurrency.maxBuilds.");
78
+ err.code = "STIM_BUILD_SLOT_TIMEOUT";
79
+ throw err;
80
+ }
81
+ if (now() - lastProgress >= progressMs) {
82
+ lastProgress = now();
83
+ out(slotWaitingLine({
84
+ max,
85
+ elapsedMs: elapsed
86
+ }));
87
+ }
88
+ await sleep(intervalMs);
89
+ }
90
+ }
91
+ function releaseBuildSlot(handle) {
92
+ if (!handle || handle.unlimited) return false;
93
+ stopDeclaringSpawnsOn(handle.claim);
94
+ return (0, ownership_claim_exports.releaseClaim)(handle.claim);
95
+ }
96
+ function listBuildSlots() {
97
+ const dir = buildSlotsDir();
98
+ let names;
99
+ try {
100
+ names = readdirSync(dir);
101
+ } catch {
102
+ return [];
103
+ }
104
+ const slots = [];
105
+ for (const name of names) {
106
+ if (!name.startsWith(SLOT_PREFIX)) continue;
107
+ const path = join(dir, name);
108
+ try {
109
+ if (!statSync(path).isDirectory()) continue;
110
+ } catch {
111
+ continue;
112
+ }
113
+ const survey = (0, ownership_claim_exports.readClaimSet)(path);
114
+ const holder = survey.live[0] ?? survey.dead[0];
115
+ const info = holder ? toRecord(holder) : null;
116
+ const index = Number(name.slice(5));
117
+ slots.push({
118
+ path,
119
+ name,
120
+ index: Number.isFinite(index) ? index : null,
121
+ pid: info?.pid ?? null,
122
+ projectRoot: info?.projectRoot ?? null,
123
+ startedAt: info?.startedAt ?? null,
124
+ logFile: info?.logFile ?? null,
125
+ alive: survey.live.length > 0,
126
+ unresolved: survey.unresolved.length > 0
127
+ });
128
+ }
129
+ return slots;
130
+ }
131
+ //#endregion
132
+ export { listBuildSlots as n, releaseBuildSlot as r, acquireBuildSlot as t };
@@ -1,8 +1,8 @@
1
- import { d as getConfigDir } from "./config-lvc7d3C2.mjs";
1
+ import { d as getConfigDir } from "./config-D0DbpZtM.mjs";
2
2
  import { existsSync } from "fs";
3
+ import { homedir } from "os";
3
4
  import { isAbsolute, join, resolve } from "path";
4
5
  import { readCacheManifest, updateCacheManifest } from "@stim-cli/core";
5
- import { homedir } from "os";
6
6
  //#region src/cache/cache-manifest.ts
7
7
  function manifestPath() {
8
8
  return join(getConfigDir(), "caches.json");
@@ -1,2 +1,2 @@
1
- import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-C68QQ0ua.mjs";
1
+ import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DnUHBJaU.mjs";
2
2
  export { manifestPath, readManifest, register, registeredCaches, unregister };
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
1
+ import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
2
  import { existsSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { homedir } from "node:os";
@@ -0,0 +1,51 @@
1
+ import { y as refuseRelativeStimPaths } from "./config-D0DbpZtM.mjs";
2
+ import { readFileSync } from "node:fs";
3
+ import { Command } from "commander";
4
+ //#region bin/cli.ts
5
+ const commands = /* @__PURE__ */ new Map([
6
+ ["doctor", () => import("./doctor-Cimf-gGB.mjs")],
7
+ ["worktree", () => import("./worktree-jnG8Iph5.mjs")],
8
+ ["start", () => import("./start-CX8Ig-U2.mjs")],
9
+ ["ports", () => import("./ports-R2k4Knz3.mjs")],
10
+ ["stop", () => import("./stop-Dt_dM16A.mjs")],
11
+ ["ios", () => import("./ios-aq3QoGI3.mjs")],
12
+ ["android", () => import("./android-Ift4kVvt.mjs")],
13
+ ["web", () => import("./web-DWUaMp8P.mjs")],
14
+ ["macos", () => import("./macos-CSYEAFmF.mjs")],
15
+ ["reload", () => import("./reload-rM9jV1fz.mjs")],
16
+ ["device", () => import("./device-DZQjF7H5.mjs")],
17
+ ["logs", () => import("./logs-CHEVK8zD.mjs")],
18
+ ["settings", () => import("./settings-ZkDzkzvB.mjs")],
19
+ ["status", () => import("./status-Cs7VLg9D.mjs")],
20
+ ["stats", () => import("./stats-CEZ_i5je.mjs")],
21
+ ["gc", () => import("./gc-Bqy4bjEu.mjs")],
22
+ ["guide", () => import("./guide-B_uyKTxW.mjs")]
23
+ ]);
24
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
25
+ const program = new Command();
26
+ program.name("stim").description("Isolated React Native dev environments per project/worktree").version(pkg.version);
27
+ try {
28
+ refuseRelativeStimPaths();
29
+ const first = process.argv[2];
30
+ const loadCommand = commands.get((first === "help" ? process.argv[3] : first) ?? "");
31
+ if (loadCommand) (await loadCommand()).default(program, pkg.version);
32
+ else if (first !== "--version" && first !== "-V") {
33
+ const modules = await Promise.all([...commands.values()].map((load) => load()));
34
+ for (const module of modules) module.default(program, pkg.version);
35
+ }
36
+ program.hook("preAction", async (_command, action) => {
37
+ try {
38
+ const { triggerMaintenance } = await import("./trigger-CXts6qt1.mjs");
39
+ triggerMaintenance(action.name());
40
+ } catch {}
41
+ });
42
+ await program.parseAsync();
43
+ } catch (err) {
44
+ const code = err?.code;
45
+ const message = err instanceof Error ? err.message : String(err);
46
+ if (typeof code === "string" && code.startsWith("STIM_")) console.error(`${code}: ${message}`);
47
+ else console.error(`Unexpected error: ${message.replace(/\.$/, "")}. Report it at ${pkg.bugs.url}`);
48
+ process.exit(1);
49
+ }
50
+ //#endregion
51
+ export {};
package/dist/cli.mjs CHANGED
@@ -1,45 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { v as refuseRelativeStimPaths } from "./config-lvc7d3C2.mjs";
3
- import { readFileSync } from "node:fs";
4
- import { Command } from "commander";
5
- //#region bin/cli.ts
6
- const commands = /* @__PURE__ */ new Map([
7
- ["doctor", () => import("./doctor-x9pnU9fq.mjs")],
8
- ["worktree", () => import("./worktree-CHWWvm5v.mjs")],
9
- ["start", () => import("./start-Cetfvy8l.mjs")],
10
- ["ports", () => import("./ports-BguS83ex.mjs")],
11
- ["stop", () => import("./stop-BWIF_6BK.mjs")],
12
- ["ios", () => import("./ios-P1f5nm2n.mjs")],
13
- ["android", () => import("./android-LbPFRWVL.mjs")],
14
- ["web", () => import("./web-BsQs1WlO.mjs")],
15
- ["reload", () => import("./reload-BiniwsSZ.mjs")],
16
- ["device", () => import("./device-CjuuAJjQ.mjs")],
17
- ["logs", () => import("./logs-Civ4gbBH.mjs")],
18
- ["settings", () => import("./settings-B-fsC-Om.mjs")],
19
- ["status", () => import("./status-BsPAnfOI.mjs")],
20
- ["stats", () => import("./stats-CFpFGlJV.mjs")],
21
- ["gc", () => import("./gc-ko6mUAYD.mjs")],
22
- ["guide", () => import("./guide-6R0VNFqI.mjs")]
23
- ]);
24
- const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
25
- const program = new Command();
26
- program.name("stim").description("Isolated React Native dev environments per project/worktree").version(pkg.version);
27
- try {
28
- refuseRelativeStimPaths();
29
- const first = process.argv[2];
30
- const loadCommand = commands.get((first === "help" ? process.argv[3] : first) ?? "");
31
- if (loadCommand) (await loadCommand()).default(program, pkg.version);
32
- else if (first !== "--version" && first !== "-V") {
33
- const modules = await Promise.all([...commands.values()].map((load) => load()));
34
- for (const module of modules) module.default(program, pkg.version);
35
- }
36
- await program.parseAsync();
37
- } catch (err) {
38
- const code = err?.code;
39
- const message = err instanceof Error ? err.message : String(err);
40
- if (typeof code === "string" && code.startsWith("STIM_")) console.error(`${code}: ${message}`);
41
- else console.error(`Unexpected error: ${message.replace(/\.$/, "")}. Report it at ${pkg.bugs.url}`);
42
- process.exit(1);
43
- }
2
+ //#region bin/node-check.ts
3
+ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e3 + parseInt(part, 10), 0);
4
+ if (encode(process.versions.node) < encode("22.12.0")) {
5
+ process.stderr.write(`STIM_NODE_UNSUPPORTED: Stim needs Node 22.12.0 or later; this is Node ${process.versions.node} at ${process.execPath}. To run Stim where a project pins an older Node, see https://stim.appandflow.com/docs/requirements#older-node-pins\n`);
6
+ process.exitCode = 1;
7
+ } else import("./cli-BkYZ_6hy.mjs");
44
8
  //#endregion
45
9
  export {};