stim 1.17.2 → 1.19.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 (162) hide show
  1. package/README.md +50 -1
  2. package/dist/{activity-IRvJY_ru.mjs → activity-BSw0x84R.mjs} +4 -4
  3. package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-Bjxu_VmX.mjs} +8 -8
  4. package/dist/{android-B9yaNKwa.mjs → android-BXc6BmEi.mjs} +658 -404
  5. package/dist/{android-B_YNZy61.mjs → android-BdQC6zs1.mjs} +9 -9
  6. package/dist/android-BvV1gGdN.mjs +4 -0
  7. package/dist/{android-DE4v59Mb.mjs → android-DE5g_5gv.mjs} +2 -2
  8. package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-C87geAg-.mjs} +5 -5
  9. package/dist/android-cas-compiler.mjs +2 -2
  10. package/dist/api-DIf_s86s.mjs +150 -0
  11. package/dist/api-run.d.mts +1 -0
  12. package/dist/api-run.mjs +145 -0
  13. package/dist/api.d.mts +218 -0
  14. package/dist/api.mjs +2 -0
  15. package/dist/{app-install-VPkI5WEg.mjs → app-install-CFI4ptUL.mjs} +33 -13
  16. package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
  17. package/dist/{web-Dl0KSRHf.mjs → browser-web-CDhqQxhv.mjs} +138 -176
  18. package/dist/{budget-DfcgFdQB.mjs → budget-Dz-kyXLv.mjs} +1391 -58
  19. package/dist/build-facts-B87vo-Im.d.mts +142 -0
  20. package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-DiwKSyv9.mjs} +3 -3
  21. package/dist/cache-manifest.mjs +1 -1
  22. package/dist/{chrome-BrcVWQyD.mjs → chrome-BTUOo8p2.mjs} +1 -1
  23. package/dist/cli-C9Zvgbdc.mjs +68 -0
  24. package/dist/cli.mjs +1 -1
  25. package/dist/{client-SvBdgObD.mjs → client-CuUo8Nvg.mjs} +381 -49
  26. package/dist/collector-run.d.mts +6 -0
  27. package/dist/collector-run.mjs +9 -9
  28. package/dist/{command-output-CDAIFD-8.mjs → command-output-Bt8ygHE7.mjs} +2 -2
  29. package/dist/{config-D0DbpZtM.mjs → config-DC5jEtd1.mjs} +9 -5
  30. package/dist/{created-devices-CpvzBL25.mjs → created-devices-D0s26Hx5.mjs} +2 -2
  31. package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-DKaS1OM9.mjs} +2 -2
  32. package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-pB_IPfV4.mjs} +1 -1
  33. package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CDY_zAmD.mjs} +2 -2
  34. package/dist/{device-C8IOoJPv.mjs → device-BHw0WlHl.mjs} +8 -8
  35. package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-BoN1jQkO.mjs} +25 -14
  36. package/dist/device-host-worker.mjs +19 -19
  37. package/dist/{gradle-dJpre3Yn.mjs → device-ios-B2ruohE-.mjs} +661 -107
  38. package/dist/{device-lease-DpoS36_u.mjs → device-lease-Cu7PtQpZ.mjs} +9 -9
  39. package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-D38SnZtt.mjs} +4 -4
  40. package/dist/{device-pool-3o7s5lo4.mjs → device-pool-CP4rAsHx.mjs} +3 -3
  41. package/dist/{device-remote-hFSkpfQu.mjs → device-remote-B5GiUifk.mjs} +15 -16
  42. package/dist/{doctor-CFv1fCrF.mjs → doctor-PRJH94v6.mjs} +61 -34
  43. package/dist/doctor-watchman-wZhyTdp4.mjs +259 -0
  44. package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics--v5HGOU0.mjs} +11 -11
  45. package/dist/{exec-CaErVv7t.mjs → exec-i8GDPwq9.mjs} +93 -6
  46. package/dist/{gc-DEmkg3Xh.mjs → gc-CyHMcKcn.mjs} +25 -471
  47. package/dist/{guide-CSmhMTf8.mjs → guide-dRaQJJk9.mjs} +681 -507
  48. package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bs7fytj7.mjs} +3 -3
  49. package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C5G4h_OJ.mjs} +2 -2
  50. package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-Bik035eL.mjs} +1 -1
  51. package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-CI9Az9a4.mjs} +9 -9
  52. package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-DABm3ScO.mjs} +5 -5
  53. package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DbV2aUVw.mjs} +13 -9
  54. package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-DYiMBn34.mjs} +7 -8
  55. package/dist/{ios-DSfnPfse.mjs → ios-BWbHFZVz.mjs} +19 -7
  56. package/dist/{ios-Cr1h5gnO.mjs → ios-DCrkgXEM.mjs} +1 -1
  57. package/dist/ios-DYUr9LGc.mjs +8 -0
  58. package/dist/ios-ITYno9rO.mjs +2241 -0
  59. package/dist/{ios-device-pAN4t54-.mjs → ios-device-CJ_ZOGky.mjs} +3 -3
  60. package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-CrW8aMb5.mjs} +1 -1
  61. package/dist/{ios-state-8L3lgum6.mjs → ios-state-By0XuLTQ.mjs} +1 -1
  62. package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-DCveSE6d.mjs} +5 -5
  63. package/dist/{logs-BAaS7gS2.mjs → logs-Bao1HOMy.mjs} +13 -13
  64. package/dist/{macos-BIRQS90f.mjs → macos-ciyBdTY5.mjs} +194 -132
  65. package/dist/macos-nIOATJmR.mjs +2 -0
  66. package/dist/macos-run.mjs +1 -1
  67. package/dist/maintenance-run.mjs +349 -47
  68. package/dist/manifest-CX0d1IkZ.mjs +148 -0
  69. package/dist/{metro-g8NqiJp-.mjs → metro-DI2AjPF_.mjs} +196 -43
  70. package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-BxpJLIwh.mjs} +4 -4
  71. package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
  72. package/dist/{build-plan-BDsSi09V.mjs → miss-reason-CjQCOKqq.mjs} +207 -249
  73. package/dist/{named-ports-C8m8EQs2.mjs → named-ports-B4iWH4E-.mjs} +70 -8
  74. package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-BGxsbfny.mjs} +6 -6
  75. package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
  76. package/dist/offload-worker.d.mts +3 -45
  77. package/dist/offload-worker.mjs +11 -11
  78. package/dist/{ownership-DyRQru0q.mjs → ownership-EB0ySdGK.mjs} +3 -3
  79. package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
  80. package/dist/placement-log-Dxe34rJm.mjs +88 -0
  81. package/dist/plan-placement-BVY59qa8.mjs +290 -0
  82. package/dist/{ports-4nYqxPWC.mjs → ports-ByPc0_97.mjs} +3 -3
  83. package/dist/{prebuild-D7RUMkwN.mjs → prebuild-BKJ3wJI1.mjs} +5 -5
  84. package/dist/preview-BbSottmO.mjs +986 -0
  85. package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
  86. package/dist/project-B5eQ1USs.mjs +612 -0
  87. package/dist/{pull-request-pxnDCQzn.mjs → pull-request-IHNdMnG8.mjs} +1 -1
  88. package/dist/pull-requests.mjs +1 -1
  89. package/dist/react-native-ios-BMh2i25I.mjs +2 -0
  90. package/dist/react-native-ios-CSpIxexZ.mjs +2083 -0
  91. package/dist/{recordings-BNgsD1Tr.mjs → recordings-Bv8McZN4.mjs} +1 -1
  92. package/dist/{reload-DcRxj3qG.mjs → reload-rAPdqeRR.mjs} +14 -15
  93. package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-N3hAEaAL.mjs} +5 -5
  94. package/dist/{run-CkE9y0nc.mjs → run-lAkle1-c.mjs} +5 -5
  95. package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-CkIjnegq.mjs} +5 -6
  96. package/dist/server-expo-DGsdUGX2.mjs +2 -0
  97. package/dist/{server-expo-CHTyXD0G.mjs → server-expo-n3tUi3Em.mjs} +5 -6
  98. package/dist/{settings-SR9OmW9h.mjs → settings-2am7TSxp.mjs} +5 -5
  99. package/dist/{settings-Cfd-0r2d.mjs → settings-CxgngUZk.mjs} +116 -103
  100. package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
  101. package/dist/settings.schema.json +198 -9
  102. package/dist/{simslim-BWNrc3M3.mjs → simslim-D9LkJxIO.mjs} +7 -7
  103. package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-HV_KtPIw.mjs} +6 -6
  104. package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
  105. package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
  106. package/dist/{stage-CzaiwFsI.mjs → stage-BgaZJVZY.mjs} +14 -3
  107. package/dist/{start-AlfCPRVU.mjs → start-D8NbxNBb.mjs} +1 -1
  108. package/dist/{start-DUz3mYdb.mjs → start-DtxthMfI.mjs} +34 -27
  109. package/dist/{state-PeQiJuIu.mjs → state-D2KtnALG.mjs} +4 -4
  110. package/dist/{state-DyaNTgfR.mjs → state-Tp4uImDS.mjs} +5 -3
  111. package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
  112. package/dist/{stats-Bq4fJOdB.mjs → stats-8EJ5ivFT.mjs} +6 -6
  113. package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
  114. package/dist/{status-BA2pehwf.mjs → status-BOyp0CUl.mjs} +31 -34
  115. package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-C65jk_q2.mjs} +1 -1
  116. package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-DbmUjsLv.mjs} +1 -1
  117. package/dist/stop-D0UIpZuh.mjs +72 -0
  118. package/dist/{stop-zF1y04f2.mjs → stop-DRipAg-e.mjs} +2 -2
  119. package/dist/{stop-DQIasgKp.mjs → stop-zDlknFoz.mjs} +79 -33
  120. package/dist/supervisor-run.d.mts +24 -22
  121. package/dist/supervisor-run.mjs +21 -22
  122. package/dist/{support-CsJNVfOc.mjs → support-CNqYkV0y.mjs} +7 -7
  123. package/dist/{support-WvD__tSV.mjs → support-DsNaFg6D.mjs} +5 -5
  124. package/dist/swiftpm-macos-aJzPAj1t.mjs +119 -0
  125. package/dist/{toolchain-DNyR3NPq.mjs → toolchain-C3xSoyUl.mjs} +475 -269
  126. package/dist/{trigger-Bemu8ytw.mjs → trigger-CAhmG-4s.mjs} +6 -6
  127. package/dist/trigger-CoalsMTV.mjs +2 -0
  128. package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-pFLB2e6P.mjs} +135 -38
  129. package/dist/{status-CzS4bPO9.mjs → watchman-BL1IdOtq.mjs} +75 -7
  130. package/dist/web-DFpFeZu5.mjs +2 -0
  131. package/dist/web-DbbrPUn0.mjs +127 -0
  132. package/dist/web-run.mjs +10 -10
  133. package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-CR9X86xJ.mjs} +3 -3
  134. package/dist/{ownership-BMLqyBgJ.mjs → workspaces-Djb2gfi9.mjs} +661 -23
  135. package/dist/{worktree-Be_7NLKy.mjs → worktree-BL4M1rhB.mjs} +252 -50
  136. package/dist/{worktree-j3IcFAI5.mjs → worktree-DV-A0LNL.mjs} +1 -1
  137. package/package.json +10 -5
  138. package/shim/bundle-response.cjs +2 -1
  139. package/shim/bundle-response.d.cts +1 -1
  140. package/shim/expo-metro-config.cjs +1 -1
  141. package/dist/build-progress-D0WkjCPd.mjs +0 -1036
  142. package/dist/build-slots-41v_d2x9.mjs +0 -142
  143. package/dist/cli-CYXb29oE.mjs +0 -51
  144. package/dist/deps-iKw0eD4P.mjs +0 -438
  145. package/dist/device-ios-C2Um-XUR.mjs +0 -412
  146. package/dist/errors-B6W7FkxQ.mjs +0 -15
  147. package/dist/guide-status-Du-ZQ3FD.mjs +0 -125
  148. package/dist/idle-BXG__1BA.mjs +0 -176
  149. package/dist/in-use-CvGOUn-x.mjs +0 -130
  150. package/dist/ios-BJ4XUSe1.mjs +0 -3867
  151. package/dist/native-run-D1Q56rAD.mjs +0 -158
  152. package/dist/preview-B-g9d7kV.mjs +0 -318
  153. package/dist/process-identity-BmRm1qV0.mjs +0 -12
  154. package/dist/project-D47Rh0ly.mjs +0 -276
  155. package/dist/server-expo-CeakhI8P.mjs +0 -2
  156. package/dist/state-BKa8wNN5.mjs +0 -148
  157. package/dist/stop-BIiM49EY.mjs +0 -48
  158. package/dist/stop-cause-rhmGfwvt.mjs +0 -97
  159. package/dist/trigger-CXts6qt1.mjs +0 -2
  160. package/dist/watchman-APYjXSQa.mjs +0 -48
  161. package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
  162. package/dist/workspaces-Bcib97-6.mjs +0 -306
@@ -0,0 +1,142 @@
1
+ import "./state-lKh8shBp.mjs";
2
+ import "./ndjson-Du3j0AQ9.mjs";
3
+ import "@stim-cli/core/state";
4
+ //#region src/optimizations.d.ts
5
+ interface Optimizations {
6
+ buildCache: boolean;
7
+ remoteBuildCache: boolean;
8
+ releaseBundleSwap: boolean;
9
+ metroSharedCache: boolean;
10
+ metroWarmup: boolean;
11
+ ios: {
12
+ compilationCache: boolean;
13
+ swiftCompilationCache: boolean | null;
14
+ prefixMapping: boolean;
15
+ };
16
+ android: {
17
+ compilerCache: "ccache" | "cas" | "none";
18
+ casToolchain: string | null;
19
+ compilerCacheFallback: CompilerCacheFallback | null;
20
+ pch: "auto" | "on" | "off";
21
+ gradleBuildCache: boolean;
22
+ targetAbiOnly: boolean;
23
+ };
24
+ }
25
+ interface CompilerCacheFallback {
26
+ key: string;
27
+ reason: string;
28
+ fromEnvironment: boolean;
29
+ manifest: string | null;
30
+ }
31
+ //#endregion
32
+ //#region src/engine/build-facts.d.ts
33
+ type CacheHitLevel = "local" | "remote" | false;
34
+ type LaunchStatus = boolean | "unverified" | "bundling";
35
+ interface LogsInfo {
36
+ dir?: string;
37
+ }
38
+ interface CompilationCacheActivity {
39
+ status: "reported" | "unavailable" | "not-run";
40
+ hits: number | null;
41
+ cacheableTasks: number | null;
42
+ hitRatePercent: number | null;
43
+ swiftTargetsWithoutExplicitModules?: number;
44
+ }
45
+ interface CcacheActivity {
46
+ status: "reported" | "unavailable" | "not-run";
47
+ hits: number | null;
48
+ misses: number | null;
49
+ hitRatePercent: number | null;
50
+ }
51
+ interface DevServerStart {
52
+ started: true;
53
+ reason: "not running" | "stopped (idle)";
54
+ }
55
+ interface RunLeaseFacts {
56
+ kind: string;
57
+ expiresAt: string;
58
+ }
59
+ interface IosFacts {
60
+ devicePlacement?: import("@stim-cli/core/state").DevicePlacement;
61
+ host?: import("@stim-cli/core/state").HostedIosStatus;
62
+ slot?: string;
63
+ platform: string;
64
+ udid: string;
65
+ deviceName: string | null;
66
+ deviceType: string | null;
67
+ runtime: string | null;
68
+ fingerprint?: string | null;
69
+ configuration: string | null;
70
+ scheme?: string;
71
+ cacheKey?: string | null;
72
+ cacheHit: CacheHitLevel;
73
+ cacheSkipped: boolean;
74
+ buildMachine?: string;
75
+ builtOn?: string;
76
+ /** The remote Mac that compiled the app when the build was offloaded; absent otherwise. */
77
+ offloadedTo?: string;
78
+ /** Why the app was built here after the run considered offloading it; absent otherwise. */
79
+ offloadFallback?: string;
80
+ compilationCache: CompilationCacheActivity;
81
+ waitedForBuild: {
82
+ pid: number | null;
83
+ ms: number;
84
+ } | null;
85
+ appPath?: string | null;
86
+ bundleId?: string | null;
87
+ installSkipped: boolean;
88
+ launched: LaunchStatus;
89
+ metroPort?: number | null;
90
+ logs: LogsInfo;
91
+ agentDevice?: {
92
+ stateDir: string;
93
+ };
94
+ durationMs?: number;
95
+ webPreviewUrl?: string | null;
96
+ lease?: RunLeaseFacts | null;
97
+ devServer?: DevServerStart;
98
+ }
99
+ interface AndroidFacts {
100
+ devicePlacement?: import("@stim-cli/core/state").DevicePlacement;
101
+ host?: import("@stim-cli/core/state").HostedAndroidStatus;
102
+ slot?: string;
103
+ platform: string;
104
+ serial: string | null;
105
+ avdName: string | null;
106
+ deviceName: string | null;
107
+ systemImage: string | null;
108
+ deviceProfile: string | null;
109
+ fingerprint: string | null;
110
+ cacheKey: string | null;
111
+ variant: string | null;
112
+ metroPort: number | null;
113
+ cacheHit: CacheHitLevel;
114
+ cacheSkipped: boolean;
115
+ buildMachine?: string;
116
+ builtOn?: string;
117
+ /** The remote Mac that compiled the APK when the build was offloaded; absent otherwise. */
118
+ offloadedTo?: string;
119
+ /** Why the APK was built here after the run considered offloading it; absent otherwise. */
120
+ offloadFallback?: string;
121
+ waitedForBuild: {
122
+ pid: number | null;
123
+ ms: number;
124
+ } | null;
125
+ appPath: string | null;
126
+ bundleId: string | null;
127
+ installSkipped: boolean;
128
+ launched: LaunchStatus;
129
+ ccache: CcacheActivity;
130
+ debugHttpHost: string | null;
131
+ debugHttpHostNote: string | null;
132
+ devClientUrl: string | null;
133
+ logs: string | null;
134
+ agentDevice?: {
135
+ stateDir: string;
136
+ };
137
+ durationMs: number | null;
138
+ lease?: RunLeaseFacts | null;
139
+ devServer?: DevServerStart;
140
+ }
141
+ //#endregion
142
+ export { Optimizations as a, IosFacts as i, CcacheActivity as n, CompilationCacheActivity as r, AndroidFacts as t };
@@ -1,8 +1,8 @@
1
- import { d as getConfigDir } from "./config-D0DbpZtM.mjs";
2
- import { existsSync } from "fs";
3
- import { homedir } from "os";
1
+ import { d as getConfigDir } from "./config-DC5jEtd1.mjs";
4
2
  import { isAbsolute, join, resolve } from "path";
3
+ import { existsSync } from "fs";
5
4
  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-DnUHBJaU.mjs";
1
+ import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DiwKSyv9.mjs";
2
2
  export { manifestPath, readManifest, register, registeredCaches, unregister };
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-CaErVv7t.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.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,68 @@
1
+ import { n as debugLog } from "./exec-i8GDPwq9.mjs";
2
+ import { y as refuseRelativeStimPaths } from "./config-DC5jEtd1.mjs";
3
+ import { readFileSync } from "node:fs";
4
+ import { runId } from "@stim-cli/core/state";
5
+ import { Command } from "commander";
6
+ //#region bin/cli.ts
7
+ const commands = /* @__PURE__ */ new Map([
8
+ ["doctor", () => import("./doctor-PRJH94v6.mjs")],
9
+ ["worktree", () => import("./worktree-DV-A0LNL.mjs")],
10
+ ["start", () => import("./start-D8NbxNBb.mjs")],
11
+ ["ports", () => import("./ports-ByPc0_97.mjs")],
12
+ ["stop", () => import("./stop-DRipAg-e.mjs")],
13
+ ["ios", () => import("./ios-DYUr9LGc.mjs")],
14
+ ["android", () => import("./android-BvV1gGdN.mjs")],
15
+ ["web", () => import("./web-DFpFeZu5.mjs")],
16
+ ["macos", () => import("./macos-nIOATJmR.mjs")],
17
+ ["reload", () => import("./reload-rAPdqeRR.mjs")],
18
+ ["device", () => import("./device-BHw0WlHl.mjs")],
19
+ ["logs", () => import("./logs-Bao1HOMy.mjs")],
20
+ ["settings", () => import("./settings-2am7TSxp.mjs")],
21
+ ["status", () => import("./status-BOyp0CUl.mjs")],
22
+ ["stats", () => import("./stats-8EJ5ivFT.mjs")],
23
+ ["gc", () => import("./gc-CyHMcKcn.mjs")],
24
+ ["guide", () => import("./guide-dRaQJJk9.mjs")]
25
+ ]);
26
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
27
+ const program = new Command();
28
+ program.name("stim").description("Isolated React Native dev environments per project/worktree").version(pkg.version);
29
+ try {
30
+ refuseRelativeStimPaths();
31
+ process.env.STIM_RUN_ID = runId();
32
+ const first = process.argv[2];
33
+ const loadCommand = commands.get((first === "help" ? process.argv[3] : first) ?? "");
34
+ if (loadCommand) (await loadCommand()).default(program, pkg.version);
35
+ else if (first !== "--version" && first !== "-V") {
36
+ const modules = await Promise.all([...commands.values()].map((load) => load()));
37
+ for (const module of modules) module.default(program, pkg.version);
38
+ }
39
+ program.hook("preAction", async (_command, action) => {
40
+ if (debugLog.enabled()) {
41
+ const path = [];
42
+ for (let each = action; each?.parent; each = each.parent) path.unshift(each.name());
43
+ const started = Date.now();
44
+ debugLog.log("run_start", {
45
+ version: pkg.version,
46
+ command: path,
47
+ flags: process.argv.slice(2).filter((arg) => arg.startsWith("-")).map((arg) => arg.split("=")[0])
48
+ });
49
+ process.on("exit", (code) => debugLog.log("run_end", {
50
+ exit: code,
51
+ ms: Date.now() - started
52
+ }));
53
+ }
54
+ try {
55
+ const { triggerMaintenance } = await import("./trigger-CoalsMTV.mjs");
56
+ triggerMaintenance(action.name());
57
+ } catch {}
58
+ });
59
+ await program.parseAsync();
60
+ } catch (err) {
61
+ const code = err?.code;
62
+ const message = err instanceof Error ? err.message : String(err);
63
+ if (typeof code === "string" && code.startsWith("STIM_")) console.error(`${code}: ${message}`);
64
+ else console.error(`Unexpected error: ${message.replace(/\.$/, "")}. Report it at ${pkg.bugs.url}`);
65
+ process.exit(1);
66
+ }
67
+ //#endregion
68
+ export {};
package/dist/cli.mjs CHANGED
@@ -4,6 +4,6 @@ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e
4
4
  if (encode(process.versions.node) < encode("22.12.0")) {
5
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
6
  process.exitCode = 1;
7
- } else import("./cli-CYXb29oE.mjs");
7
+ } else import("./cli-C9Zvgbdc.mjs");
8
8
  //#endregion
9
9
  export {};