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.
Files changed (231) hide show
  1. package/README.md +141 -8
  2. package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
  3. package/dist/act-DsuqEkiM.mjs +2801 -0
  4. package/dist/activity-CMLmzp7o.mjs +1397 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
  6. package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
  7. package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
  8. package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
  9. package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
  10. package/dist/android-cas-compiler.mjs +2 -2
  11. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/android-project-DVWyCbWU.d.mts +391 -0
  14. package/dist/api.d.mts +810 -64
  15. package/dist/api.mjs +782 -1
  16. package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
  17. package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
  18. package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
  19. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
  20. package/dist/budget-Cvwn54qV.mjs +9285 -0
  21. package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
  22. package/dist/build-cache-Dv7RN200.mjs +602 -0
  23. package/dist/build-plan-DUC8Ka9y.mjs +248 -0
  24. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
  25. package/dist/cache-manifest.mjs +1 -1
  26. package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
  27. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
  28. package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
  29. package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
  30. package/dist/cli.mjs +1 -1
  31. package/dist/client-OyRoEuSr.mjs +1577 -0
  32. package/dist/collector-run.d.mts +4 -40
  33. package/dist/collector-run.mjs +9 -8
  34. package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
  35. package/dist/config-DlrsduwG.mjs +955 -0
  36. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
  37. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
  38. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
  39. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
  40. package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
  41. package/dist/device-DklWZLqb.mjs +1068 -0
  42. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
  43. package/dist/device-host-worker.mjs +76 -79
  44. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
  45. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
  46. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
  49. package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
  50. package/dist/doctor-fingerprint.mjs +19 -0
  51. package/dist/doctor-thjWAV0z.mjs +2 -0
  52. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
  53. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
  54. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
  55. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
  56. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
  57. package/dist/exec-DEoAhcze.mjs +858 -0
  58. package/dist/exec-DnYc4HGH.d.mts +78 -0
  59. package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
  60. package/dist/gc-DnNDQyaP.mjs +3 -0
  61. package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
  62. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
  63. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
  64. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
  65. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
  66. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
  67. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
  68. package/dist/idle-C4cZ757K.d.mts +24 -0
  69. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
  70. package/dist/ios-CDvlmUs7.d.mts +24 -0
  71. package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
  73. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
  74. package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
  75. package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
  76. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
  77. package/dist/ios-signing-BtAffm0A.mjs +489 -0
  78. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
  79. package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
  80. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
  81. package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
  82. package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
  83. package/dist/logs-BfwwadsZ.mjs +479 -0
  84. package/dist/logs-jTS_lHSo.mjs +248 -0
  85. package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
  86. package/dist/macos-NfV2D7dO.mjs +694 -0
  87. package/dist/macos-run.mjs +1 -1
  88. package/dist/maintenance-run.mjs +123 -248
  89. package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
  90. package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
  91. package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
  92. package/dist/native-android-CqgnOgsT.mjs +645 -0
  93. package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
  94. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
  95. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  96. package/dist/native-run-NwUuxbkg.mjs +276 -0
  97. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
  98. package/dist/native-source-Y0yLhFyQ.mjs +133 -0
  99. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
  100. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
  101. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  102. package/dist/offload-worker.d.mts +59 -41
  103. package/dist/offload-worker.mjs +478 -115
  104. package/dist/operation-exec-BW0em61G.mjs +171 -0
  105. package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
  106. package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
  107. package/dist/paths-BsJMoPP2.mjs +12 -0
  108. package/dist/paths-DQtTgsBf.mjs +42 -0
  109. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
  110. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
  111. package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
  112. package/dist/prebuild-D4JoEAEs.mjs +484 -0
  113. package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
  114. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
  115. package/dist/pull-request-eODyIqZF.d.mts +124 -0
  116. package/dist/pull-requests.d.mts +2 -120
  117. package/dist/pull-requests.mjs +2 -2
  118. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
  119. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
  120. package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
  121. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
  122. package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
  123. package/dist/registration-BcRgF6Ox.mjs +51 -0
  124. package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
  125. package/dist/reload-D7AVlb8N.mjs +2 -0
  126. package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
  127. package/dist/result-D2Ykz_iD.mjs +435 -0
  128. package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
  129. package/dist/selection-DSMbWEX2.mjs +620 -0
  130. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
  131. package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
  132. package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
  133. package/dist/server-expo-D58c9L0M.mjs +2 -0
  134. package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
  135. package/dist/settings-DpR-1Wnn.mjs +114 -0
  136. package/dist/settings-write-CzD60rOD.mjs +360 -0
  137. package/dist/settings.schema.json +176 -16
  138. package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
  139. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
  140. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  141. package/dist/stage-Bps5oius.mjs +200 -0
  142. package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
  143. package/dist/start-EojN4WFz.mjs +1364 -0
  144. package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
  145. package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
  146. package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
  147. package/dist/stats-report-BzaPrRm6.mjs +16 -0
  148. package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
  149. package/dist/status-EvrK72L2.mjs +2 -0
  150. package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
  151. package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
  152. package/dist/status-worker.d.mts +1 -0
  153. package/dist/status-worker.mjs +19 -0
  154. package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
  155. package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
  156. package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
  157. package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
  158. package/dist/supervisor-run.d.mts +8 -17
  159. package/dist/supervisor-run.mjs +56 -28
  160. package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
  161. package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
  162. package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
  163. package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
  164. package/dist/toolchain-BY8X8HXx.mjs +2 -0
  165. package/dist/toolchain-DpJMHq0n.mjs +876 -0
  166. package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
  167. package/dist/trigger-yb_nFzPF.mjs +2 -0
  168. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
  169. package/dist/web-CZ07gd77.mjs +2 -0
  170. package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
  171. package/dist/web-run.mjs +13 -12
  172. package/dist/windows-report.d.mts +1 -0
  173. package/dist/windows-report.mjs +18 -0
  174. package/dist/windows-report.ps1 +43 -0
  175. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
  176. package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
  177. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
  178. package/dist/worktree-ZqZVjD9K.mjs +2 -0
  179. package/dist/xcode-BXn9-xYx.mjs +896 -0
  180. package/package.json +7 -5
  181. package/shim/android-audio/Main.java +24 -0
  182. package/shim/android-audio/README.md +17 -0
  183. package/shim/android-audio.jar +0 -0
  184. package/shim/android-optimizations.gradle +7 -5
  185. package/dist/activity-BSV745Kz.mjs +0 -629
  186. package/dist/api-qvOzWyfO.mjs +0 -154
  187. package/dist/api-run.mjs +0 -294
  188. package/dist/app-install-BIKtMfPq.mjs +0 -896
  189. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  190. package/dist/budget-f7516Zk0.mjs +0 -4106
  191. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  192. package/dist/cancellation-C_22VQTH.mjs +0 -24
  193. package/dist/client-qQAaXSUs.mjs +0 -1771
  194. package/dist/config-BYDxlMY3.mjs +0 -562
  195. package/dist/device-DuiPJQSn.mjs +0 -290
  196. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  197. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  198. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  199. package/dist/exec-DqKo9GKJ.mjs +0 -268
  200. package/dist/git-DDfFzkMm.mjs +0 -45
  201. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  202. package/dist/logs-BGrEUaEs.mjs +0 -383
  203. package/dist/macos-Ch5VJmcS.mjs +0 -584
  204. package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
  205. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  206. package/dist/native-android-D5qc3-_v.mjs +0 -226
  207. package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
  208. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  209. package/dist/plan-C4TjdPsR.mjs +0 -260
  210. package/dist/prebuild-DYbucPXy.mjs +0 -212
  211. package/dist/preview-78a9kR_-.mjs +0 -1011
  212. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  213. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  214. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  215. package/dist/result-CaJg5Iat.mjs +0 -186
  216. package/dist/server-expo-Bigriskl.mjs +0 -2
  217. package/dist/settings-BORNaaCO.mjs +0 -402
  218. package/dist/settings-vk3mJGSm.d.mts +0 -13
  219. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  220. package/dist/stage-KNTQopqv.mjs +0 -157
  221. package/dist/start-BWqzODpb.mjs +0 -1116
  222. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  223. package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
  224. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  225. package/dist/toolchain-BFkAcstd.mjs +0 -2
  226. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  227. package/dist/trigger-9_USgmxz.mjs +0 -2
  228. package/dist/web-Dq-i3wzJ.mjs +0 -2
  229. package/dist/worktree-DpLdCHga.mjs +0 -2
  230. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  231. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,186 +0,0 @@
1
- import { y as workspaceAgentDeviceDir } from "./workspace-state-DJt_MMvf.mjs";
2
- import { i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
3
- import { i as workspaceLinkLine } from "./stim-desktop-BzBN2Em2.mjs";
4
- import { Dt as recordFinishedBuild } from "./budget-f7516Zk0.mjs";
5
- import { a as easAuthNote, n as UPLOAD_TIMEOUT_MS, r as cacheLevel, s as isEasAuthFailureText } from "./remote-cache-OyOyVIS3.mjs";
6
- import "./launch-verify-B6Q8hZP-.mjs";
7
- import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine } from "./ccache-zdKiYQ3E.mjs";
8
- import { a as PLATFORM } from "./support-DMTqj3Hm.mjs";
9
- import { buildDiagnostics } from "@stim-cli/core/state";
10
- import chalk from "chalk";
11
- //#region src/commands/android/result.ts
12
- function androidFacts({ root, slot, serial, avdName = null, deviceName = null, systemImage = null, deviceProfile = null, fingerprint, cacheKey = null, variant = null, metroPort = null, cacheHit, cacheSkipped = false, waitedForBuild = null, appPath, bundleId, installSkipped = false, launched, ccache = CCACHE_UNAVAILABLE, logs, debugHttpHost = null, debugHttpHostNote = null, devClientUrl = null, durationMs, lease, devServer = null, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null, host }) {
13
- return {
14
- platform: PLATFORM,
15
- ...host ? { host } : {},
16
- ...slot && slot !== "default" ? { slot } : {},
17
- serial: serial ?? null,
18
- avdName: avdName ?? null,
19
- deviceName: deviceName ?? avdName ?? null,
20
- systemImage: systemImage ?? null,
21
- deviceProfile: deviceProfile ?? null,
22
- fingerprint: fingerprint ?? null,
23
- cacheKey: cacheKey ?? null,
24
- variant: variant ?? null,
25
- metroPort: metroPort ?? null,
26
- cacheHit: cacheLevel(cacheHit),
27
- cacheSkipped: Boolean(cacheSkipped),
28
- buildMachine,
29
- ...builtOn ? { builtOn } : {},
30
- ...offloadedTo ? { offloadedTo } : {},
31
- ...offloadFallback ? { offloadFallback } : {},
32
- waitedForBuild: waitedForBuild ? {
33
- pid: waitedForBuild.pid ?? null,
34
- ms: waitedForBuild.ms ?? 0
35
- } : null,
36
- appPath: appPath ?? null,
37
- bundleId: bundleId ?? null,
38
- installSkipped: Boolean(installSkipped),
39
- launched: launched === "unverified" || launched === "bundling" ? launched : Boolean(launched),
40
- ccache,
41
- debugHttpHost: debugHttpHost ?? null,
42
- debugHttpHostNote: debugHttpHostNote ?? null,
43
- devClientUrl: devClientUrl ?? null,
44
- logs: logs ?? null,
45
- ...root && !host ? { agentDevice: { stateDir: workspaceAgentDeviceDir(root) } } : {},
46
- durationMs: typeof durationMs === "number" && Number.isFinite(durationMs) ? durationMs : null,
47
- ...lease === void 0 ? {} : { lease },
48
- ...devServer ? { devServer } : {}
49
- };
50
- }
51
- function lastBuildRecord({ devicePlacement, fingerprint, cacheKey, cacheHit, cacheSkipped = false, durationMs, appPath, bundleId, startedAt, status, errorCode = null, avdName = null, deviceName = null, missReason = null, diagnostics = null, configuration = null, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null }) {
52
- const record = {
53
- platform: PLATFORM,
54
- avdName: avdName ?? null,
55
- deviceName: deviceName ?? avdName ?? null,
56
- fingerprint: fingerprint ?? null,
57
- cacheKey: cacheKey ?? null,
58
- cacheHit: cacheLevel(cacheHit),
59
- cacheSkipped: Boolean(cacheSkipped),
60
- durationMs: Number.isFinite(durationMs) ? durationMs : null,
61
- appPath: appPath ?? null,
62
- bundleId: bundleId ?? null,
63
- startedAt,
64
- status,
65
- configuration: configuration ?? null
66
- };
67
- if (errorCode) record.errorCode = errorCode;
68
- if (devicePlacement) record.devicePlacement = devicePlacement;
69
- record.buildMachine = buildMachine;
70
- if (builtOn) record.builtOn = builtOn;
71
- if (offloadedTo) record.offloadedTo = offloadedTo;
72
- if (offloadFallback) record.offloadFallback = offloadFallback;
73
- if (missReason && !cacheLevel(cacheHit)) record.missReason = missReason;
74
- const recorded = status === "failed" ? buildDiagnostics(diagnostics) : [];
75
- if (recorded.length) record.diagnostics = recorded;
76
- return record;
77
- }
78
- async function finishAndroidUpload(uploadPending, remote, phase) {
79
- if (!uploadPending) return false;
80
- const upload = await uploadPending;
81
- if (upload?.uploaded) phase("cache", `uploaded (${remote?.name})`);
82
- else if (upload?.timedOut) {
83
- phase("cache", chalk.yellow(`${remote?.name} upload still running after ${formatDuration(UPLOAD_TIMEOUT_MS)}; not waiting`));
84
- return true;
85
- } else if (upload?.failed) {
86
- const authNote = remote?.name === "eas" && isEasAuthFailureText(upload.failed) ? easAuthNote({
87
- code: "logged-out",
88
- reason: upload.failed,
89
- phase: "upload"
90
- }) : null;
91
- phase("cache", chalk.yellow(authNote || `${remote?.name} upload failed: ${upload.failed}`));
92
- }
93
- return false;
94
- }
95
- function reportAndroidResult({ host, root, slot, json, useBuildCache, variant, release, runtimeKind = release ? "embedded-js" : "metro", metroCheck, metroPort, logsDir, serial, apkPath, androidPackage, installSkipped, record, waitedForBuild, remote, providerName, launchState, launchWarning, launched, ccache, durationMs, writer, emit, lease, recordRun, reclaimed = [], devServer = null, links }) {
96
- const offloadedTo = record.offloadedTo ?? null;
97
- recordRun({
98
- failed: false,
99
- cacheHit: cacheLevel(record.cacheHit),
100
- waited: waitedForBuild,
101
- durationMs,
102
- offloadedTo
103
- });
104
- const facts = androidFacts({
105
- host,
106
- root,
107
- slot,
108
- serial,
109
- avdName: record.avdName,
110
- deviceName: record.deviceName,
111
- systemImage: record.systemImage,
112
- deviceProfile: record.deviceProfile,
113
- debugHttpHost: launched.debugHttpHost ?? null,
114
- debugHttpHostNote: launched.debugHttpHostNote ?? null,
115
- devClientUrl: launched.devClientUrl ?? null,
116
- fingerprint: record.fingerprint,
117
- cacheKey: record.cacheKey,
118
- variant,
119
- metroPort,
120
- cacheHit: record.cacheHit,
121
- cacheSkipped: record.cacheSkipped || !useBuildCache,
122
- waitedForBuild,
123
- appPath: apkPath,
124
- bundleId: androidPackage,
125
- installSkipped,
126
- launched: launchState,
127
- ccache,
128
- logs: logsDir,
129
- durationMs,
130
- lease,
131
- devServer,
132
- buildMachine: record.buildMachine,
133
- builtOn: record.builtOn ?? void 0,
134
- offloadedTo,
135
- offloadFallback: record.offloadFallback ?? null
136
- });
137
- writer.close();
138
- if (record.devicePlacement) facts.devicePlacement = record.devicePlacement;
139
- if (json) emit(JSON.stringify({
140
- ...facts,
141
- ...links ? { links } : {},
142
- ...reclaimed.length ? { reclaimed } : {}
143
- }));
144
- else {
145
- const summary = `${launchWarning ? "WARNING" : "OK"}: ${androidPackage} launched on ${host ? `${host.device?.name ?? "Android emulator"} on ${host.machine}` : serial}, ${runtimeKind === "process" ? `${variant ?? "debug"} (native process, no Metro)` : runtimeKind === "embedded-js" ? `${variant} (embedded JS, no Metro)` : `Metro port ${metroPort}`} (${cacheOutcome(record.cacheHit, remote?.name ?? providerName, offloadedTo)})`;
146
- const outcome = launchWarning ? chalk.yellow(`${summary} -- ${launchWarning}`) : launchState === "unverified" ? chalk.yellow(`${summary} -- launch UNVERIFIED`) : launchState === "bundling" ? chalk.green(`${summary} -- bundle requested, still building`) : chalk.green(summary);
147
- const deviceName = record.avdName || record.deviceName || serial;
148
- const cacheResult = useBuildCache ? cacheOutcome(record.cacheHit, remote?.name ?? providerName, offloadedTo) : `bypassed; ${cacheOutcome(false, null, offloadedTo)}`;
149
- const metroResult = runtimeKind === "process" ? "native process (no Metro)" : runtimeKind === "embedded-js" ? `embedded (${variant})` : !metroCheck ? `check skipped on port ${metroPort}` : launchState === "unverified" ? `state unverified on port ${metroPort}` : `running on port ${metroPort}${devServer ? ` (started: ${devServer.reason})` : ""}`;
150
- emit([
151
- outcome,
152
- phaseLine("device", host ? `${deviceName} on ${host.machine}` : `${deviceName} (${serial})`),
153
- phaseLine("app", androidPackage),
154
- phaseLine(runtimeKind === "process" ? "runtime" : "metro", metroResult),
155
- phaseLine("cache", cacheResult),
156
- ...ccache.status === "not-run" ? [phaseLine("compilation cache", ccacheActivityLine(ccache))] : [],
157
- phaseLine("logs", logsDir || "unavailable (remote device)"),
158
- ...!host ? [phaseLine("agent-device", `AGENT_DEVICE_STATE_DIR=${workspaceAgentDeviceDir(root)}`)] : []
159
- ].join("\n"));
160
- if (links) console.error(chalk.dim(workspaceLinkLine(links)));
161
- }
162
- return facts;
163
- }
164
- function cacheOutcome(cacheHit, providerName = null, offloadedTo = null) {
165
- if (cacheHit === "remote") return `cache hit from ${providerName || "the remote cache"}`;
166
- if (cacheHit === "local") return "cache hit";
167
- return offloadedTo ? `built on ${offloadedTo}` : "built";
168
- }
169
- function persistLastBuild({ recordBuild = recordFinishedBuild, root, record, startedAt, durationMs, status, errorCode = null, diagnostics = null, out }) {
170
- const lastBuild = lastBuildRecord({
171
- ...record,
172
- startedAt,
173
- durationMs,
174
- status,
175
- errorCode,
176
- diagnostics
177
- });
178
- try {
179
- recordBuild(root, lastBuild);
180
- } catch (err) {
181
- out(phaseLine("state", chalk.yellow(`could not record lastBuild: ${err?.message || err}`)));
182
- }
183
- return lastBuild;
184
- }
185
- //#endregion
186
- export { reportAndroidResult as a, persistLastBuild as i, finishAndroidUpload as n, lastBuildRecord as r, androidFacts as t };
@@ -1,2 +0,0 @@
1
- import { p as startExpoServer } from "./server-expo-DsguMGUF.mjs";
2
- export { startExpoServer };
@@ -1,402 +0,0 @@
1
- import { D as withConfigLock$1, O as writeConfigSetting, _ as loadConfig$1, f as getConfigPath$1, h as getRepoSettings, m as getProjectSettings } from "./config-BYDxlMY3.mjs";
2
- import { Dt as repoRoot, R as readCommittedSettings, ht as gitCommonDir, nt as unknownSettingKeys } from "./settings-B717odTD.mjs";
3
- import { n as findCommandWorkspace, t as NO_PROJECT_REFUSAL } from "./project-_phNIJfs.mjs";
4
- import { n as settingDefault, r as stimDesktopInstalled } from "./stim-desktop-BzBN2Em2.mjs";
5
- import { n as recordingLayers, t as deleteTurnedOffRecordings } from "./recordings-D0d5aQt0.mjs";
6
- import { existsSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
7
- import { join } from "node:path";
8
- import { SETTINGS, SETTING_SCOPES, coerceSettingText, isJsonObject, isSensitiveReference, settingDefinition, settingValueError } from "@stim-cli/core/state";
9
- import chalk from "chalk";
10
- //#region src/commands/settings.ts
11
- const MASK = "********";
12
- const PRECEDENCE = [
13
- "workspace",
14
- "repo",
15
- "committed",
16
- "machine"
17
- ];
18
- var Refusal = class extends Error {
19
- code;
20
- remedy;
21
- constructor(code, message, remedy) {
22
- super(message);
23
- this.code = code;
24
- this.remedy = remedy;
25
- }
26
- };
27
- function readContext(env, note = () => {}) {
28
- const projectPath = findCommandWorkspace(process.cwd(), note);
29
- const start = projectPath ?? process.cwd();
30
- const common = gitCommonDir(start);
31
- let installed;
32
- return {
33
- projectPath,
34
- gitCommonDir: common,
35
- repoRoot: common ? repoRoot(start) ?? projectPath : null,
36
- machine: loadConfig$1(),
37
- env,
38
- desktopInstalled: () => installed ??= stimDesktopInstalled(process.platform, env)
39
- };
40
- }
41
- function valueAt(settings, key) {
42
- let node = settings;
43
- for (const segment of key.split(".")) {
44
- if (!isJsonObject(node)) return void 0;
45
- node = node[segment];
46
- }
47
- return node;
48
- }
49
- function committedDirectory(context, setting) {
50
- return setting?.committedAt === "repository" ? repositoryDirectory(context) : appDirectory(context);
51
- }
52
- function repositoryDirectory(context) {
53
- return context.repoRoot ?? context.projectPath;
54
- }
55
- function appDirectory(context) {
56
- return context.projectPath ?? context.repoRoot;
57
- }
58
- function layerFile(context, scope, setting) {
59
- const machineFile = getConfigPath$1();
60
- if (scope === "machine") return machineFile;
61
- if (scope === "workspace") return context.projectPath ? `${machineFile} (projects["${context.projectPath}"].settings)` : null;
62
- if (scope === "repo") return context.gitCommonDir ? `${machineFile} (repos["${context.gitCommonDir}"].settings)` : null;
63
- const directory = committedDirectory(context, setting);
64
- return directory ? join(directory, ".stim.json") : null;
65
- }
66
- function layerSettings(context, scope, setting) {
67
- if (scope === "machine") return context.machine ?? {};
68
- if (scope === "workspace") return context.projectPath ? getProjectSettings(context.projectPath) : {};
69
- if (scope === "repo") return context.gitCommonDir ? getRepoSettings(context.gitCommonDir) : {};
70
- return readCommittedSettings(committedDirectory(context, setting));
71
- }
72
- function masked(setting, value) {
73
- return setting.sensitive && value !== void 0 && value !== null ? MASK : value;
74
- }
75
- function settingEntry(context, setting) {
76
- const layers = {};
77
- for (const scope of PRECEDENCE) {
78
- if (!setting.scopes.includes(scope) || layerFile(context, scope, setting) === null) continue;
79
- const value = valueAt(layerSettings(context, scope, setting), setting.key);
80
- if (value !== void 0) layers[scope] = masked(setting, value);
81
- }
82
- const envValue = setting.env ? context.env[setting.env] : void 0;
83
- const env = setting.env && envValue ? {
84
- name: setting.env,
85
- value: String(masked(setting, envValue))
86
- } : void 0;
87
- const scopedHome = !env && setting.scopedHomeValue !== void 0 && context.env.STIM_HOME;
88
- const ci = !env && setting.ciValue !== void 0 && context.env.CI;
89
- const winner = PRECEDENCE.find((scope) => scope in layers);
90
- let value = null;
91
- let origin = null;
92
- let defaultReason = null;
93
- if (env) {
94
- value = masked(setting, envSettingValue(setting, envValue));
95
- origin = "env";
96
- } else if (scopedHome) {
97
- value = setting.scopedHomeValue;
98
- origin = "env";
99
- } else if (ci) {
100
- value = setting.ciValue;
101
- origin = "env";
102
- } else if (winner) {
103
- value = layers[winner];
104
- origin = winner;
105
- } else if (setting.default !== void 0) {
106
- const fallback = settingDefault(setting, context.desktopInstalled);
107
- value = fallback.value;
108
- origin = "default";
109
- defaultReason = fallback.reason;
110
- }
111
- return {
112
- key: setting.key,
113
- value,
114
- origin,
115
- layers,
116
- ...env ? { env } : scopedHome ? { env: {
117
- name: "STIM_HOME",
118
- value: context.env.STIM_HOME
119
- } } : ci ? { env: {
120
- name: "CI",
121
- value: context.env.CI
122
- } } : {},
123
- ...setting.sensitive ? { sensitive: true } : {},
124
- ...defaultReason ? { defaultReason } : {}
125
- };
126
- }
127
- function unknownEntries(context) {
128
- const sources = [
129
- {
130
- scope: "machine",
131
- file: layerFile(context, "machine", null),
132
- settings: { optimizations: context.machine?.optimizations }
133
- },
134
- {
135
- scope: "workspace",
136
- file: layerFile(context, "workspace", null),
137
- settings: layerSettings(context, "workspace", null)
138
- },
139
- {
140
- scope: "repo",
141
- file: layerFile(context, "repo", null),
142
- settings: layerSettings(context, "repo", null)
143
- },
144
- {
145
- scope: "committed",
146
- file: layerFile(context, "committed", null),
147
- settings: layerSettings(context, "committed", null)
148
- }
149
- ];
150
- const repository = repositoryDirectory(context);
151
- if (repository && repository !== appDirectory(context)) sources.push({
152
- scope: "committed",
153
- file: join(repository, ".stim.json"),
154
- settings: readCommittedSettings(repository)
155
- });
156
- return sources.flatMap(({ scope, file, settings }) => file === null ? [] : unknownSettingKeys(settings).map((key) => ({
157
- key,
158
- scope,
159
- file,
160
- value: valueAt(settings, key)
161
- })));
162
- }
163
- function settingsPayload(context) {
164
- const files = {};
165
- for (const scope of SETTING_SCOPES) {
166
- const file = layerFile(context, scope, null);
167
- if (file) files[scope] = file;
168
- }
169
- return {
170
- project: context.projectPath,
171
- files,
172
- settings: SETTINGS.map((setting) => settingEntry(context, setting)),
173
- unknown: unknownEntries(context)
174
- };
175
- }
176
- function requireSetting(key) {
177
- const setting = settingDefinition(key);
178
- if (setting) return setting;
179
- throw new Refusal("STIM_BAD_ARG", `${JSON.stringify(key)} is not a Stim setting.`, "Run `stim settings` to list every setting, or `stim guide settings` for what each one does.");
180
- }
181
- function readScope(raw, setting) {
182
- if (raw === void 0) {
183
- if (setting.scopes.length === 1) return setting.scopes[0];
184
- throw new Refusal("STIM_BAD_ARG", `${setting.key} can live in more than one layer, so the command needs --scope.`, `Pass --scope ${setting.scopes.join("|")}.`);
185
- }
186
- if (!SETTING_SCOPES.includes(raw)) throw new Refusal("STIM_BAD_ARG", `--scope takes ${SETTING_SCOPES.join(", ")}, not ${JSON.stringify(raw)}.`, null);
187
- const scope = raw;
188
- if (!setting.scopes.includes(scope)) throw new Refusal("STIM_BAD_ARG", `${setting.key} is not read from the ${scope} layer.`, `Pass --scope ${setting.scopes.join("|")}.`);
189
- return scope;
190
- }
191
- function requireLayer(context, scope, setting) {
192
- const file = layerFile(context, scope, setting);
193
- if (file) return file;
194
- if (scope === "repo") throw new Refusal("STIM_BAD_ARG", "The repo layer is keyed by a Git repository, and this directory is not inside one.", "Run this from inside the repository, or pick another --scope.");
195
- throw new Refusal(NO_PROJECT_REFUSAL.code, NO_PROJECT_REFUSAL.message, NO_PROJECT_REFUSAL.remedy);
196
- }
197
- function example(setting) {
198
- switch (setting.type.kind) {
199
- case "boolean": return "false";
200
- case "number": return String(setting.default ?? setting.type.minimum ?? 1);
201
- case "strings": return `'["node_modules"]'`;
202
- case "object": return `'{"key": "value"}'`;
203
- case "choice": return setting.type.choices[0];
204
- default: return "<value>";
205
- }
206
- }
207
- function parseSettingValue(setting, raw) {
208
- const invalid = (expected) => new Refusal("STIM_BAD_ARG", `Invalid ${setting.key} value ${JSON.stringify(raw)}. Expected ${expected}.`, `For example: stim settings set ${setting.key} ${example(setting)}${setting.scopes.length > 1 ? ` --scope ${setting.scopes[0]}` : ""}`);
209
- const kind = setting.type.kind;
210
- const value = coerceSettingText(setting, raw);
211
- const error = settingValueError(setting, value);
212
- if (error) throw invalid(kind === "strings" || kind === "object" ? `${error}, written as JSON` : error);
213
- return value;
214
- }
215
- function envSettingValue(setting, raw) {
216
- const value = coerceSettingText(setting, raw);
217
- const error = settingValueError(setting, value);
218
- if (error) throw new Refusal("STIM_BAD_ARG", `Invalid ${setting.env} value ${JSON.stringify(raw)}. Expected ${error}.`, `Fix the environment variable, or unset it and run \`stim settings set ${setting.key} ${example(setting)}\`.`);
219
- return value;
220
- }
221
- function committedTarget(context, setting) {
222
- const directory = committedDirectory(context, setting);
223
- if (!directory) throw new Refusal(NO_PROJECT_REFUSAL.code, NO_PROJECT_REFUSAL.message, NO_PROJECT_REFUSAL.remedy);
224
- return join(directory, ".stim.json");
225
- }
226
- function writeCommitted(file, key, value) {
227
- return withConfigLock$1(() => {
228
- const exists = existsSync(file);
229
- const text = exists ? readFileSync(file, "utf-8") : "";
230
- let parsed = {};
231
- if (exists && text.trim() !== "") try {
232
- parsed = JSON.parse(text);
233
- } catch (error) {
234
- throw new Refusal("STIM_BAD_ARG", `${file} is not valid JSON: ${error.message}`, `Repair ${file}, then run the command again.`);
235
- }
236
- if (!isJsonObject(parsed)) throw new Refusal("STIM_BAD_ARG", `${file} is not a JSON object.`, `Repair ${file}, then run the command again.`);
237
- const parts = key.split(".");
238
- const chain = [parsed];
239
- for (const part of parts.slice(0, -1)) {
240
- const node = chain.at(-1);
241
- if (!isJsonObject(node[part])) {
242
- if (value === void 0) return false;
243
- node[part] = {};
244
- }
245
- chain.push(node[part]);
246
- }
247
- const leaf = parts.at(-1);
248
- const parent = chain.at(-1);
249
- if (value === void 0) {
250
- if (!(leaf in parent)) return false;
251
- delete parent[leaf];
252
- for (let index = chain.length - 1; index > 0; index--) {
253
- if (Object.keys(chain[index]).length > 0) break;
254
- delete chain[index - 1][parts[index - 1]];
255
- }
256
- } else parent[leaf] = value;
257
- const indent = /\n([ \t]+)"/.exec(text)?.[1] ?? 2;
258
- const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
259
- writeFileSync(tmp, `${JSON.stringify(parsed, null, indent)}\n`);
260
- try {
261
- renameSync(tmp, file);
262
- } catch (error) {
263
- try {
264
- unlinkSync(tmp);
265
- } catch {}
266
- throw error;
267
- }
268
- return true;
269
- });
270
- }
271
- function writeSetting(context, setting, scope, value) {
272
- if (scope === "committed") return writeCommitted(committedTarget(context, setting), setting.key, value);
273
- if (scope === "machine") return writeConfigSetting({ scope }, setting.key, value);
274
- if (scope === "workspace") return writeConfigSetting({
275
- scope,
276
- projectPath: context.projectPath
277
- }, setting.key, value);
278
- return writeConfigSetting({
279
- scope,
280
- gitCommonDir: context.gitCommonDir
281
- }, setting.key, value);
282
- }
283
- function formatValue(value) {
284
- return typeof value === "string" ? value : JSON.stringify(value);
285
- }
286
- function formatOrigin(entry) {
287
- if (entry.origin === null) return "unset";
288
- return entry.defaultReason ? `${entry.origin}: ${entry.defaultReason}` : entry.origin;
289
- }
290
- const CONSOLE = {
291
- out: (line) => console.log(line),
292
- note: (line) => console.error(line)
293
- };
294
- function run(json, io, action) {
295
- try {
296
- action();
297
- } catch (error) {
298
- const code = error.code;
299
- if (!(error instanceof Refusal) && !(typeof code === "string" && code.startsWith("STIM_"))) throw error;
300
- const failure = {
301
- code,
302
- message: error.message,
303
- remedy: error instanceof Refusal ? error.remedy : null
304
- };
305
- io.note(chalk.red(`${failure.code}: ${failure.message}`));
306
- if (failure.remedy) io.note(chalk.dim(failure.remedy));
307
- if (json) io.out(JSON.stringify(failure));
308
- process.exitCode = 1;
309
- }
310
- }
311
- function wantsJson(opts, command) {
312
- return Boolean(opts.json ?? command.parent?.opts().json);
313
- }
314
- function registerSettings(program, io = CONSOLE, env = process.env) {
315
- const settings = program.command("settings").description("Show every Stim setting with its effective value and layer, or change one").option("--json", "print every setting, its origin, and each layer value as JSON").action((opts) => run(Boolean(opts.json), io, () => {
316
- const payload = settingsPayload(readContext(env, io.note));
317
- if (opts.json) {
318
- io.out(JSON.stringify(payload));
319
- return;
320
- }
321
- const width = Math.max(...payload.settings.map((entry) => entry.key.length));
322
- for (const entry of payload.settings) {
323
- const shown = entry.origin === null ? "" : formatValue(entry.value);
324
- io.out(`${entry.key.padEnd(width)} ${shown}${shown ? " " : ""}${chalk.dim(`(${formatOrigin(entry)})`)}`);
325
- }
326
- for (const entry of payload.unknown) io.note(chalk.yellow(`Warning: ${entry.key} in ${entry.file} is not read by Stim.`));
327
- }));
328
- settings.command("get <key>").description("Print the effective value of a setting, or its value in one layer").option("--scope <scope>", `read one layer: ${SETTING_SCOPES.join(", ")}`).option("--json", "print the setting entry as JSON").action((key, opts, command) => run(wantsJson(opts, command), io, () => {
329
- const setting = requireSetting(key);
330
- const scope = opts.scope === void 0 ? null : readScope(opts.scope, setting);
331
- const context = readContext(env, io.note);
332
- const entry = settingEntry(context, setting);
333
- const value = scope ? entry.layers[scope] ?? null : entry.value;
334
- if (wantsJson(opts, command)) {
335
- io.out(JSON.stringify(scope ? {
336
- key,
337
- scope,
338
- file: layerFile(context, scope, setting),
339
- value
340
- } : entry));
341
- return;
342
- }
343
- if (value === null) return;
344
- io.out(formatValue(value));
345
- if (!scope && entry.defaultReason) io.note(chalk.dim(`(${formatOrigin(entry)})`));
346
- }));
347
- settings.command("set <key> <value>").description("Write a setting to one layer").option("--scope <scope>", `the layer to write: ${SETTING_SCOPES.join(", ")}`).option("--json", "print the written setting as JSON").action((key, raw, opts, command) => run(wantsJson(opts, command), io, () => {
348
- const setting = requireSetting(key);
349
- const scope = readScope(opts.scope, setting);
350
- const value = parseSettingValue(setting, raw);
351
- if (setting.sensitive && scope === "committed" && !isSensitiveReference(value)) throw new Refusal("STIM_BAD_ARG", `${key} is sensitive, so a committed .stim.json takes only an env: or file: reference, never the secret.`, `Set the secret with --scope workspace or --scope repo, which store it in ${getConfigPath$1()}, readable only by you, or commit a reference such as env:MY_KEYSTORE_PASSWORD.`);
352
- const context = readContext(env, io.note);
353
- const file = requireLayer(context, scope, setting);
354
- const recording = setting.key === "recording.enabled" ? recordingLayers() : null;
355
- const changed = writeSetting(context, setting, scope, value);
356
- report(io, wantsJson(opts, command), {
357
- key,
358
- scope,
359
- file,
360
- changed
361
- }, setting, readContext(env), "set", recording);
362
- }));
363
- settings.command("unset <key>").description("Remove a setting from one layer").option("--scope <scope>", `the layer to clear: ${SETTING_SCOPES.join(", ")}`).option("--json", "print the setting after removal as JSON").action((key, opts, command) => run(wantsJson(opts, command), io, () => {
364
- const setting = requireSetting(key);
365
- const scope = readScope(opts.scope, setting);
366
- const context = readContext(env, io.note);
367
- const file = requireLayer(context, scope, setting);
368
- const recording = setting.key === "recording.enabled" ? recordingLayers() : null;
369
- const changed = writeSetting(context, setting, scope, void 0);
370
- report(io, wantsJson(opts, command), {
371
- key,
372
- scope,
373
- file,
374
- changed
375
- }, setting, readContext(env), "unset", recording);
376
- }));
377
- }
378
- function report(io, json, write, setting, context, verb, recordingBefore) {
379
- const entry = settingEntry(context, setting);
380
- const recordingsDeleted = recordingBefore ? deleteTurnedOffRecordings(recordingBefore) : null;
381
- if (json) {
382
- io.out(JSON.stringify({
383
- ...write,
384
- setting: entry,
385
- ...recordingsDeleted ? { recordingsDeleted } : {}
386
- }));
387
- return;
388
- }
389
- for (const workspace of recordingsDeleted ?? []) io.note(`Deleted the device recordings of ${workspace}.`);
390
- const effective = entry.origin === null ? "unset" : `${formatValue(entry.value)} (${formatOrigin(entry)})`;
391
- if (!write.changed) {
392
- io.out(`${write.key} was not set in ${write.file}; effective value: ${effective}`);
393
- return;
394
- }
395
- const shown = verb === "set" ? ` = ${formatValue(entry.layers[write.scope])}` : "";
396
- io.out(`${verb} ${write.key}${shown} in ${write.file}; effective value: ${effective}`);
397
- }
398
- function settingsCommand(program) {
399
- registerSettings(program);
400
- }
401
- //#endregion
402
- export { settingsCommand as default, registerSettings };
@@ -1,13 +0,0 @@
1
- import "./ndjson-Du3j0AQ9.mjs";
2
- import { SettingsObject, WebViewport } from "@stim-cli/core/state";
3
- import "@stim-cli/cache";
4
- import { ProcessRecord } from "@stim-cli/core/process-identity";
5
- //#region src/supervisor/state.d.ts
6
- declare const MODE_BARE = "bare-inproc";
7
- declare const MODE_EXPO = "expo-child";
8
- declare function clearWorkspaceSupervisor(root: string, expected?: ProcessRecord | null): boolean;
9
- declare function clearExpoMetroTunnel(root: string): void;
10
- declare function writePidFile(root: string, pid: number): string;
11
- declare function readPidFile(root: string): number | null;
12
- //#endregion
13
- export { clearWorkspaceSupervisor as a, clearExpoMetroTunnel as i, MODE_BARE as n, readPidFile as o, MODE_EXPO as r, writePidFile as s, SettingsObject as t };
@@ -1,72 +0,0 @@
1
- import { j as ownership_claim_exports, k as process_identity_exports } from "./config-BYDxlMY3.mjs";
2
- //#region src/engine/spawn-claims.ts
3
- const declaring = /* @__PURE__ */ new Set();
4
- const running = /* @__PURE__ */ new Set();
5
- let refusal = null;
6
- /** Record every child later started through `spawnDeclared` on `claim` until `stopDeclaringSpawnsOn(claim)`. */
7
- function declareSpawnsOn(claim) {
8
- if (claim) declaring.add(claim);
9
- }
10
- function stopDeclaringSpawnsOn(claim) {
11
- if (claim) declaring.delete(claim);
12
- }
13
- /**
14
- * Start a child that every claim passed to `declareSpawnsOn` records until it exits. The child keeps
15
- * the caller's process group, so a terminal interrupt still reaches it; the claim follows the child
16
- * itself. A claim that cannot be marked stops the spawn rather than letting it run unprotected. A claim
17
- * records one child, so declared spawns must not overlap.
18
- */
19
- function spawnDeclared(spawn) {
20
- if (refusal !== null) throw new Error(refusal);
21
- const claims = [...declaring];
22
- if (claims.length === 0) return spawn();
23
- const forget = () => {
24
- for (const claim of claims) try {
25
- (0, ownership_claim_exports.clearClaimChild)(claim);
26
- } catch {}
27
- };
28
- let child;
29
- try {
30
- for (const claim of claims) (0, ownership_claim_exports.markClaimChildPending)(claim);
31
- child = spawn();
32
- } catch (error) {
33
- forget();
34
- throw error;
35
- }
36
- const pid = child.pid;
37
- if (pid === void 0) {
38
- forget();
39
- return child;
40
- }
41
- running.add(child);
42
- child.once("exit", () => running.delete(child));
43
- const captured = (0, process_identity_exports.captureProcessIdentity)(pid);
44
- if (captured.ok) for (const claim of claims) try {
45
- (0, ownership_claim_exports.setClaimChild)(claim, {
46
- pid,
47
- processToken: captured.token
48
- });
49
- } catch {}
50
- child.once("exit", forget);
51
- return child;
52
- }
53
- /** Refuse every later `spawnDeclared` with `reason` until `allowDeclaredSpawns()`. */
54
- function refuseDeclaredSpawns(reason) {
55
- refusal = reason;
56
- }
57
- function allowDeclaredSpawns() {
58
- refusal = null;
59
- }
60
- /** Send `signal` to every child started through `spawnDeclared` that has not exited; returns how many were signalled. */
61
- function signalDeclaredSpawns(signal) {
62
- let signalled = 0;
63
- for (const child of running) {
64
- if (child.exitCode !== null || child.signalCode !== null) continue;
65
- try {
66
- if (child.kill(signal)) signalled += 1;
67
- } catch {}
68
- }
69
- return signalled;
70
- }
71
- //#endregion
72
- export { spawnDeclared as a, signalDeclaredSpawns as i, declareSpawnsOn as n, stopDeclaringSpawnsOn as o, refuseDeclaredSpawns as r, allowDeclaredSpawns as t };