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,22 +1,24 @@
1
- import { _ as loadConfig$1, p as getProject } from "./config-BYDxlMY3.mjs";
2
- import { Dt as repoRoot, I as projectSettingsContext } from "./settings-B717odTD.mjs";
3
- import { f as refuseNoProject, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
4
- import { d as projectRegistry } from "./project-_phNIJfs.mjs";
5
- import { J as inspectWatchmanMemory, Q as memorySweepIsScoped, a as inspectBudget, n as budgetLine } from "./budget-f7516Zk0.mjs";
6
- import { C as inspectDeviceHostMachines, b as inspectBuildMachines, d as simulatorRuntime, s as offloadCheck } from "./client-qQAaXSUs.mjs";
7
- import { I as memoryCulpritFindings, L as readMemoryCulprits, h as listIosRuntimesAsync, l as iosRuntimeMatches, x as pickDefaultIosCreation } from "./ios-RkW4pnQf.mjs";
8
- import { T as detectXcodeMajor } from "./toolchain-DxSsNssu.mjs";
9
- import { o as compareStimVersions, s as inspectStimVersions } from "./eas-session-ledger-Cm0Gwq2F.mjs";
10
- import { h as resolveDeviceType, v as resolveRuntime } from "./support-CwjbFs9H.mjs";
11
- import { r as maintenanceStatus, t as maintenanceLine } from "./status-BTA7kKiQ.mjs";
12
- import { a as writeIgnoreDirs, i as watchedCheckouts, n as inspectNestedWorktrees, r as nestedWorktreeFinding, s as recordDoctorRun } from "./doctor-watchman-BRyV2adA.mjs";
13
- import { i as runDoctor, o as readMachineSettings } from "./doctor-kfMBnUw6.mjs";
14
- import { dirname, join, sep } from "path";
1
+ import { Y as doctorIo, _ as loadConfig$1, p as getProject } from "./config-DlrsduwG.mjs";
2
+ import { f as refuseNoProject, l as phaseLine } from "./command-output-gwpm28fu.mjs";
3
+ import { L as projectSettingsContextAsync, Mt as repoRoot } from "./settings-C7O8A6ZI.mjs";
4
+ import { f as projectRegistry, t as NO_PROJECT_REFUSAL } from "./project-wM_XFTvE.mjs";
5
+ import { c as inspectStimVersions, s as compareStimVersions } from "./eas-session-ledger-DlY_serQ.mjs";
6
+ import { a as inspectBudget, cr as inspectWatchmanMemory, fr as memorySweepIsScoped, n as budgetLine } from "./budget-Cvwn54qV.mjs";
7
+ import { L as memoryCulpritFindings, R as readMemoryCulpritsAsync, f as listAllIosSimsAsync, h as listIosRuntimesAsync, l as iosRuntimeMatches, x as pickDefaultIosCreation } from "./ios-hcBpnEGk.mjs";
8
+ import { c as detectXcodeMajorAsync } from "./xcode-BXn9-xYx.mjs";
9
+ import { s as offloadCheck } from "./client-OyRoEuSr.mjs";
10
+ import { c as inspectBuildMachines, f as inspectDeviceHostMachines } from "./selection-DSMbWEX2.mjs";
11
+ import { r as maintenanceStatus, t as maintenanceLine } from "./status-BRROykC8.mjs";
12
+ import { a as writeIgnoreDirs, c as recordDoctorRun, i as watchedCheckouts, n as inspectNestedWorktrees, r as nestedWorktreeFinding } from "./doctor-watchman-N2wDotwQ.mjs";
13
+ import { c as checkWorktreeStorageLayout, l as readMachineSettings, o as runDoctor } from "./doctor-Bo7BXLux.mjs";
14
+ import { h as resolveDeviceType, v as resolveRuntime } from "./support-CNioewsd.mjs";
15
15
  import { isJsonObject, maintenanceNdjsonFile, readHostedAppMetadata, readHostedSessions } from "@stim-cli/core/state";
16
+ import { dirname, join, sep } from "path";
17
+ import chalk from "chalk";
16
18
  import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
17
- import { homedir } from "os";
18
19
  import { InvalidArgumentError } from "commander";
19
- import chalk from "chalk";
20
+ import { homedir } from "os";
21
+ import { discoverToolchain, projectNodeBin, projectNodePin } from "@stim-cli/core/toolchain";
20
22
  //#region src/diagnostics/sandbox.ts
21
23
  /**
22
24
  * What a sandboxed harness has to permit for Stim to work: its state
@@ -252,7 +254,7 @@ function runningHostedApps() {
252
254
  return 0;
253
255
  }
254
256
  }
255
- /** Notes installed hosted apps on this Mac while `hosting.agentDriver` starts no driver. */
257
+ /** Notes installed hosted apps on this machine while `hosting.agentDriver` starts no driver. */
256
258
  function inspectHostedAgentDriver() {
257
259
  const hosting = loadConfig$1()?.hosting;
258
260
  return hostedAgentDriverFinding(isJsonObject(hosting) ? hosting.agentDriver : void 0, runningHostedApps());
@@ -274,7 +276,7 @@ async function iosTargetRuntime(root, settings) {
274
276
  const runtime = resolveRuntime(null, settings);
275
277
  if (runtime) return runtimes.find((each) => iosRuntimeMatches(each, runtime))?.identifier ?? null;
276
278
  const udid = getProject(root)?.platforms?.ios?.deviceUdid;
277
- const own = typeof udid === "string" ? simulatorRuntime(udid) : null;
279
+ const own = typeof udid === "string" ? (await listAllIosSimsAsync()).find((device) => device.udid === udid)?.runtime : null;
278
280
  if (own) return own;
279
281
  const deviceType = resolveDeviceType(null, settings) ?? void 0;
280
282
  return pickDefaultIosCreation([], runtimes, { deviceType })?.runtimeId ?? null;
@@ -302,16 +304,49 @@ function stimVersionLines(report) {
302
304
  phaseLine("installs", paths + versions)
303
305
  ];
304
306
  }
307
+ const OVERRIDES = {
308
+ node: "put another node first on PATH",
309
+ JAVA_HOME: "set JAVA_HOME",
310
+ ANDROID_HOME: "set ANDROID_HOME"
311
+ };
312
+ function toolchainReport(root, env = process.env) {
313
+ const { entries } = discoverToolchain(env);
314
+ const pin = projectNodePin(root);
315
+ const pinned = pin ? projectNodeBin(root, env) : null;
316
+ return {
317
+ entries,
318
+ projectNode: pin ? {
319
+ pin: pin.file,
320
+ spec: pin.spec,
321
+ bin: pinned?.bin ?? null,
322
+ version: pinned?.version ?? null
323
+ } : null
324
+ };
325
+ }
326
+ function toolchainLine(entry) {
327
+ const where = entry.source === "environment" ? "from the environment" : entry.source === "discovered" ? `found from ${entry.from ?? "a standard location"}` : "not found";
328
+ const override = OVERRIDES[entry.name] ? `; ${OVERRIDES[entry.name]} to override` : "";
329
+ return phaseLine(entry.name, `${entry.value ?? "unset"} (${where}${override})`);
330
+ }
331
+ function toolchainLines(report) {
332
+ const project = report.projectNode;
333
+ return [...report.entries.map(toolchainLine), ...project ? [phaseLine("project node", project.bin ? `${project.version} at ${project.bin}, which ${project.pin} pins (${project.spec}); Metro runs on it when the node on PATH does not satisfy the pin` : `${project.pin} pins ${project.spec}, which no nvm, fnm, Volta, asdf or mise install provides; Metro runs on the node on PATH`)] : []];
334
+ }
305
335
  function budgetLines(budget) {
306
336
  return budget ? [phaseLine("budget", budgetLine(budget))] : [];
307
337
  }
308
- function doctorSuccessLines(platform, stim, budget = null, projectLines = []) {
338
+ function doctorSuccessLines(platform, stim, budget = null, projectLines = [], toolchain = []) {
309
339
  return [
310
340
  `Doctor (${doctorTarget(platform)})`,
311
341
  phaseLine("result", "PASS"),
312
342
  phaseLine("findings", "0"),
313
343
  ...stimVersionLines(stim),
314
344
  ...budgetLines(budget),
345
+ ...toolchain.length ? [
346
+ "",
347
+ "Toolchain",
348
+ ...toolchain
349
+ ] : [],
315
350
  "",
316
351
  "Shared",
317
352
  phaseLine("settings", "every Stim setting type, machine config paths, companions and inert keys"),
@@ -367,18 +402,133 @@ function applySandboxFix(root, env = process.env) {
367
402
  console.error(chalk.green(`${result.status === "created" ? "Wrote" : "Updated"} ${target}`));
368
403
  console.error(chalk.dim("Added writes to Stim's state directory, the simulator XPC service, and local port binding. Claude Code reads project settings from the directory a session starts in, so this file only counts for sessions rooted there. Restart the session for it to take effect."));
369
404
  }
405
+ async function prepareDoctor(root, platform, registry, operation) {
406
+ const settingsContext = await projectSettingsContextAsync(root, void 0, {
407
+ env: operation?.env ?? process.env,
408
+ signal: operation?.signal
409
+ });
410
+ const machineSettings = readMachineSettings(settingsContext);
411
+ const settings = machineSettings.corrupt ? null : machineSettings.settings;
412
+ const selected = registry.selectDoctor(root, platform);
413
+ return {
414
+ settingsContext,
415
+ machineSettings,
416
+ settings,
417
+ selected,
418
+ doctors: await selected.load()
419
+ };
420
+ }
421
+ async function readDoctorReport(operation, platform, version, requestAccess = false) {
422
+ const found = projectRegistry.findProjectRoot(operation.projectRoot);
423
+ if (!found) throw Object.assign(new Error(NO_PROJECT_REFUSAL.message), NO_PROJECT_REFUSAL);
424
+ const root = found;
425
+ const prepared = await prepareDoctor(root, platform, projectRegistry, operation);
426
+ return assembleDoctorReport(root, {
427
+ platform,
428
+ fix: requestAccess
429
+ }, version, prepared, (runningVersion) => inspectStimVersions(runningVersion, {
430
+ operation,
431
+ cwd: root,
432
+ env: operation.env,
433
+ runningPath: ""
434
+ }), process.platform, operation);
435
+ }
436
+ async function assembleDoctorReport(root, opts, version, prepared, inspectVersions, host, operation) {
437
+ const { settingsContext, machineSettings, settings, selected, doctors } = prepared;
438
+ const env = operation?.env ?? process.env;
439
+ const io = doctorIo(operation);
440
+ const stim = await inspectVersions(version);
441
+ const { findings, context } = await runDoctor(root, {
442
+ xcodeMajor: selected.platforms.includes("ios") && host === "darwin" ? await detectXcodeMajorAsync() : null,
443
+ platform: opts.platform,
444
+ platforms: selected.platforms,
445
+ host,
446
+ machineSettings,
447
+ repoRoot: settingsContext.repoRoot,
448
+ remoteEnv: env,
449
+ operation,
450
+ tailnetStatus: io.status
451
+ }, doctors.map((doctor) => doctor.inspect));
452
+ findings.unshift(...await checkWorktreeStorageLayout(context));
453
+ if (selected.problem) findings.unshift({
454
+ level: "cost",
455
+ ...selected.problem.kind === "not-an-app" ? { code: "not-an-app" } : {},
456
+ title: selected.problem.kind === "unreadable" ? "The project could not be read" : "This directory has no supported app for this operation",
457
+ detail: selected.problem.message,
458
+ fix: selected.problem.remedy
459
+ });
460
+ for (const doctor of doctors) if (doctor.inspectAsync) findings.push(...await doctor.inspectAsync(context));
461
+ if (detectHarness(env)) {
462
+ const sandbox = sandboxFinding(settingsContext.repoRoot ?? root, {
463
+ env,
464
+ home: env.HOME ?? env.USERPROFILE,
465
+ stimHome: operation?.home ?? env.STIM_HOME
466
+ });
467
+ if (sandbox) findings.push(sandbox);
468
+ }
469
+ const shadowed = shadowedStimFinding(stim);
470
+ if (shadowed) findings.push(shadowed);
471
+ const budget = await inspectBudget(root, void 0, env, operation);
472
+ findings.push(...budget.findings);
473
+ const watchmanMemory = withoutUnhandledRejection(inspectWatchmanMemory(env, operation));
474
+ const tickets = /* @__PURE__ */ new Map();
475
+ const deviceHosts = withoutUnhandledRejection(inspectDeviceHostMachines({
476
+ fix: opts.fix === true,
477
+ version,
478
+ tickets,
479
+ operation
480
+ }, io));
481
+ const nestedWorktrees = await inspectNestedWorktrees(root);
482
+ const watched = withoutUnhandledRejection(watchedCheckouts(nestedWorktrees.map((entry) => entry.checkout)));
483
+ const targetInspectors = doctors.flatMap((doctor) => {
484
+ const inspect = doctor.offloadTargets?.(context, () => iosTargetRuntime(root, settings));
485
+ return inspect ? [inspect] : [];
486
+ });
487
+ const remoteMachinesInspection = withoutUnhandledRejection(inspectBuildMachines({
488
+ fix: opts.fix === true,
489
+ version,
490
+ tickets,
491
+ operation,
492
+ check: targetInspectors.length ? offloadCheck(root, async () => (await Promise.all(targetInspectors.map((inspect) => inspect()))).flat()) : null
493
+ }, io));
494
+ const watchman = await watchmanMemory;
495
+ if (watchman) findings.push(watchman);
496
+ if (!memorySweepIsScoped(env)) findings.push(...memoryCulpritFindings(await readMemoryCulpritsAsync()));
497
+ const watchedRoots = await watched;
498
+ for (const entry of nestedWorktrees) findings.push(nestedWorktreeFinding(entry, watchedRoots.has(entry.checkout)));
499
+ const remoteMachines = await remoteMachinesInspection;
500
+ findings.push(...remoteMachines.findings);
501
+ const deviceHostMachines = await deviceHosts;
502
+ const reported = new Set(remoteMachines.findings.map((each) => each.title));
503
+ findings.push(...deviceHostMachines.findings.filter((each) => !reported.has(each.title)));
504
+ const agentDriver = inspectHostedAgentDriver();
505
+ if (agentDriver) findings.push(agentDriver);
506
+ const toolchain = host === "darwin" ? toolchainReport(root, env) : null;
507
+ const maintenance = maintenanceStatus(env);
508
+ return {
509
+ project: root,
510
+ platform: opts.platform ?? null,
511
+ stim,
512
+ budget: budget.report,
513
+ maintenance: {
514
+ ...maintenance,
515
+ logPath: maintenanceNdjsonFile()
516
+ },
517
+ remoteMachines: remoteMachines.machines,
518
+ deviceHosts: deviceHostMachines.machines,
519
+ toolchain,
520
+ findings
521
+ };
522
+ }
370
523
  function doctorCommand(program, version, inspectVersions = inspectStimVersions, host = process.platform, registry = projectRegistry) {
371
- program.command("doctor").description("Inspect the source checkout and report project state that can make native worktrees slow or invalid. The checkout is left untouched unless --fix is passed; --platform filters native findings. Each run in a supported native app is recorded in Stim state so guide can say when doctor is due.").option("--json", "print the findings as JSON").option("--platform <platform>", "report shared findings plus only this native platform: ios or android", parseDoctorPlatform).option("--fix", "repair the sandbox allowance when the report names it, and stale Android .cxx configurations in a React Native or Expo checkout; add linked worktrees nested in a checkout to its .watchmanconfig ignore_dirs; ask each remote Mac in remote.machines for build and device-host approval. Stop native builds first. Generated CMake output must be ignored and untracked; custom launcher settings and source files are preserved.").action(async (opts) => {
524
+ program.command("doctor").description("Inspect the source checkout and report project state that can make native worktrees slow or invalid. The checkout is left untouched unless --fix is passed; --platform filters native findings. Each run in a supported native app is recorded in Stim state so guide can say when doctor is due.").option("--json", "print the findings as JSON").option("--platform <platform>", "report shared findings plus only this native platform: ios or android", parseDoctorPlatform).option("--fix", "repair the sandbox allowance when the report names it, and stale Android .cxx configurations in a React Native or Expo checkout; add linked worktrees nested in a checkout to its .watchmanconfig ignore_dirs; ask each remote machine in remote.machines for build and device-host approval. Stop native builds first. Generated CMake output must be ignored and untracked; custom launcher settings and source files are preserved.").action(async (opts) => {
372
525
  const root = registry.findProjectRoot(process.cwd());
373
526
  if (!root) {
374
527
  refuseNoProject({ json: Boolean(opts.json) });
375
528
  return;
376
529
  }
377
- const settingsContext = projectSettingsContext(root);
378
- const machineSettings = readMachineSettings(settingsContext);
379
- const settings = machineSettings.corrupt ? null : machineSettings.settings;
380
- const selected = registry.selectDoctor(root, opts.platform);
381
- const doctors = await selected.load();
530
+ const prepared = await prepareDoctor(root, opts.platform, registry);
531
+ const { settingsContext, settings, selected, doctors } = prepared;
382
532
  if (opts.fix) {
383
533
  if (sandboxFinding(repoRoot(root) ?? root)) applySandboxFix(root);
384
534
  for (const doctor of doctors) {
@@ -393,7 +543,7 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
393
543
  process.exitCode = 1;
394
544
  }
395
545
  }
396
- const nestedToFix = inspectNestedWorktrees(root);
546
+ const nestedToFix = await inspectNestedWorktrees(root);
397
547
  const watchedToFix = await watchedCheckouts(nestedToFix.map((entry) => entry.checkout));
398
548
  for (const entry of nestedToFix) {
399
549
  let result;
@@ -414,80 +564,21 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
414
564
  }
415
565
  }
416
566
  }
417
- const stim = await inspectVersions(version);
418
- const { findings, context } = runDoctor(root, {
419
- xcodeMajor: selected.platforms.includes("ios") && host === "darwin" ? detectXcodeMajor() : null,
420
- platform: opts.platform,
421
- platforms: selected.platforms,
422
- host,
423
- machineSettings,
424
- repoRoot: settingsContext.repoRoot
425
- }, doctors.map((doctor) => doctor.inspect));
426
- if (selected.problem) findings.unshift({
427
- level: "cost",
428
- ...selected.problem.kind === "not-an-app" ? { code: "not-an-app" } : {},
429
- title: selected.problem.kind === "unreadable" ? "The project could not be read" : "This directory has no supported app for this operation",
430
- detail: selected.problem.message,
431
- fix: selected.problem.remedy
432
- });
433
- for (const doctor of doctors) if (doctor.inspectAsync) findings.push(...await doctor.inspectAsync(context));
434
- if (detectHarness()) {
435
- const sandbox = sandboxFinding(repoRoot(root) ?? root);
436
- if (sandbox) findings.push(sandbox);
437
- }
438
- const shadowed = shadowedStimFinding(stim);
439
- if (shadowed) findings.push(shadowed);
440
- const budget = await inspectBudget(root);
441
- findings.push(...budget.findings);
442
- const watchmanMemory = withoutUnhandledRejection(inspectWatchmanMemory());
443
- const deviceHosts = withoutUnhandledRejection(inspectDeviceHostMachines({ fix: opts.fix === true }));
444
- const nestedWorktrees = inspectNestedWorktrees(root);
445
- const watched = withoutUnhandledRejection(watchedCheckouts(nestedWorktrees.map((entry) => entry.checkout)));
446
- const targetInspectors = doctors.flatMap((doctor) => {
447
- const inspect = doctor.offloadTargets?.(context, () => iosTargetRuntime(root, settings));
448
- return inspect ? [inspect] : [];
449
- });
450
- const remoteMachinesInspection = withoutUnhandledRejection(inspectBuildMachines({
451
- fix: opts.fix === true,
452
- check: targetInspectors.length ? offloadCheck(root, async () => (await Promise.all(targetInspectors.map((inspect) => inspect()))).flat()) : null
453
- }));
454
- const watchman = await watchmanMemory;
455
- if (watchman) findings.push(watchman);
456
- if (!memorySweepIsScoped()) findings.push(...memoryCulpritFindings(readMemoryCulprits()));
457
- const watchedRoots = await watched;
458
- for (const entry of nestedWorktrees) findings.push(nestedWorktreeFinding(entry, watchedRoots.has(entry.checkout)));
459
- const remoteMachines = await remoteMachinesInspection;
460
- findings.push(...remoteMachines.findings);
461
- const deviceHostMachines = await deviceHosts;
462
- const reported = new Set(remoteMachines.findings.map((each) => each.title));
463
- findings.push(...deviceHostMachines.findings.filter((each) => !reported.has(each.title)));
464
- const agentDriver = inspectHostedAgentDriver();
465
- if (agentDriver) findings.push(agentDriver);
466
- const maintenance = maintenanceStatus();
567
+ const report = await assembleDoctorReport(root, opts, version, prepared, inspectVersions, host);
568
+ const { findings, stim, toolchain, maintenance } = report;
569
+ const budget = { report: report.budget };
467
570
  const maintenanceLines = [
468
571
  phaseLine("maintenance.mode", maintenance.mode),
469
572
  phaseLine("maintenance log", maintenanceNdjsonFile()),
470
573
  phaseLine("last pass", maintenanceLine(maintenance, false) ?? "no pass has run yet")
471
574
  ];
472
575
  if (opts.json) {
473
- console.log(JSON.stringify({
474
- project: root,
475
- platform: opts.platform ?? null,
476
- stim,
477
- budget: budget.report,
478
- maintenance: {
479
- ...maintenance,
480
- logPath: maintenanceNdjsonFile()
481
- },
482
- remoteMachines: remoteMachines.machines,
483
- deviceHosts: deviceHostMachines.machines,
484
- findings
485
- }));
576
+ console.log(JSON.stringify(report));
486
577
  recordDoctorRun(root, opts.platform, version, void 0, selected.platforms);
487
578
  return;
488
579
  }
489
580
  if (findings.length === 0) {
490
- const lines = [...doctorSuccessLines(opts.platform, stim, budget.report, doctors.flatMap((doctor) => doctor.successLines?.(opts.platform) ?? [])), ...maintenanceLines];
581
+ const lines = [...doctorSuccessLines(opts.platform, stim, budget.report, doctors.flatMap((doctor) => doctor.successLines?.(opts.platform) ?? []), toolchain ? toolchainLines(toolchain) : []), ...maintenanceLines];
491
582
  for (const [index, line] of lines.entries()) if (index === 1) console.log(chalk.green(line));
492
583
  else if (line && !line.startsWith(" ")) console.log(chalk.bold(line));
493
584
  else console.log(chalk.dim(line));
@@ -501,6 +592,10 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
501
592
  ...budgetLines(budget.report),
502
593
  ...maintenanceLines
503
594
  ]) console.log(chalk.dim(line));
595
+ if (toolchain) {
596
+ console.log(chalk.bold("\nToolchain"));
597
+ for (const line of toolchainLines(toolchain)) console.log(chalk.dim(line));
598
+ }
504
599
  for (const f of ordered) {
505
600
  const tag = f.level === "cost" ? chalk.yellow("costs time") : chalk.dim("note");
506
601
  console.log(`\n${tag} ${chalk.bold(f.title)}`);
@@ -512,4 +607,4 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
512
607
  });
513
608
  }
514
609
  //#endregion
515
- export { applySandboxFix, doctorCommand as default, doctorSuccessLines, parseDoctorPlatform, shadowedStimFinding };
610
+ export { readDoctorReport as a, parseDoctorPlatform as i, doctorCommand as n, shadowedStimFinding as o, doctorSuccessLines as r, toolchainReport as s, applySandboxFix as t };
@@ -0,0 +1,16 @@
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
+ import { fileURLToPath } from "node:url";
3
+ //#region src/doctor-fingerprint.ts
4
+ async function readDoctorFingerprint(operation, request) {
5
+ const output = await getExecutor().runFileAsync(process.execPath, [fileURLToPath(new URL("../dist/doctor-fingerprint.mjs", import.meta.url))], {
6
+ cwd: operation.cwd,
7
+ env: Object.fromEntries(Object.entries(operation.env).filter((entry) => entry[1] !== void 0)),
8
+ input: JSON.stringify(request),
9
+ timeoutMs: 6e4,
10
+ killSignal: "SIGKILL",
11
+ signal: operation.signal
12
+ });
13
+ return JSON.parse(output);
14
+ }
15
+ //#endregion
16
+ export { readDoctorFingerprint as t };
@@ -0,0 +1,19 @@
1
+ import { l as fingerprintProject } from "./build-cache-Dv7RN200.mjs";
2
+ import * as fingerprint from "@expo/fingerprint";
3
+ //#region bin/doctor-fingerprint.ts
4
+ let input = "";
5
+ for await (const chunk of process.stdin) input += String(chunk);
6
+ const { root, cold, ...options } = JSON.parse(input);
7
+ let result = null;
8
+ try {
9
+ result = await fingerprintProject(root, {
10
+ ...options,
11
+ ...cold ? { createFingerprint: (projectRoot, requestOptions) => fingerprint.createFingerprintAsync(projectRoot, {
12
+ ...requestOptions,
13
+ useRNCoreAutolinkingFromExpo: true
14
+ }) } : {}
15
+ });
16
+ } catch {}
17
+ process.stdout.write(JSON.stringify(result));
18
+ //#endregion
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import { a as readDoctorReport, i as parseDoctorPlatform, n as doctorCommand, o as shadowedStimFinding, r as doctorSuccessLines, s as toolchainReport, t as applySandboxFix } from "./doctor-D5_EzwfA.mjs";
2
+ export { applySandboxFix, doctorCommand as default, doctorSuccessLines, parseDoctorPlatform, readDoctorReport, shadowedStimFinding, toolchainReport };
@@ -1,9 +1,8 @@
1
- import { E as upsertProject, d as getConfigDir, p as getProject } from "./config-BYDxlMY3.mjs";
2
- import { r as gitQuiet } from "./git-DDfFzkMm.mjs";
3
- import { Dt as repoRoot, St as listWorktrees } from "./settings-B717odTD.mjs";
4
- import { d as projectRegistry } from "./project-_phNIJfs.mjs";
5
- import { o as runWatchman, r as parseWatchRoots } from "./watchman-CPQFZLXY.mjs";
6
- import { o as compareStimVersions } from "./eas-session-ledger-Cm0Gwq2F.mjs";
1
+ import { E as upsertProject, O as withConfigLockAsync$1, d as getConfigDir, p as getProject } from "./config-DlrsduwG.mjs";
2
+ import { l as gitQuietAsync } from "./operation-exec-BW0em61G.mjs";
3
+ import { Et as listWorktreesAsync, Nt as repoRootAsync } from "./settings-C7O8A6ZI.mjs";
4
+ import { f as projectRegistry } from "./project-wM_XFTvE.mjs";
5
+ import { d as parseWatchRoots, m as runWatchman, s as compareStimVersions } from "./eas-session-ledger-DlY_serQ.mjs";
7
6
  import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
8
7
  import { dirname, isAbsolute, join, relative, sep } from "node:path";
9
8
  import { isJsonObject } from "@stim-cli/core/state";
@@ -13,6 +12,7 @@ const DOCTOR_STALE_MS = 7 * DAY_MS;
13
12
  const UPDATE_CHECK_INTERVAL_MS = DAY_MS;
14
13
  const UPDATE_CHECK_TIMEOUT_MS = 2e3;
15
14
  const LATEST_URL = "https://registry.npmjs.org/stim/latest";
15
+ /** Records CLI history best-effort; storage failures do not fail the CLI report. */
16
16
  function recordDoctorRun(projectRoot, platform, version, now = /* @__PURE__ */ new Date(), platforms) {
17
17
  const run = {
18
18
  at: now.toISOString(),
@@ -21,13 +21,28 @@ function recordDoctorRun(projectRoot, platform, version, now = /* @__PURE__ */ n
21
21
  try {
22
22
  const targets = platforms ?? projectRegistry.selectDoctor(projectRoot, platform).platforms;
23
23
  if (targets.length === 0) return;
24
- upsertProject(projectRoot, (existing) => {
25
- const doctorRuns = { ...existing.doctorRuns };
26
- for (const target of targets) doctorRuns[target] = run;
27
- return { doctorRuns };
28
- });
24
+ writeDoctorRun(projectRoot, targets, run);
29
25
  } catch {}
30
26
  }
27
+ /** Records a completed check, rejecting unavailable state and honoring cancellation while waiting for its lock. */
28
+ async function recordDoctorCheck(projectRoot, platform, version, signal) {
29
+ signal.throwIfAborted();
30
+ const targets = projectRegistry.selectDoctor(projectRoot, platform).platforms;
31
+ if (targets.length === 0) return;
32
+ await withConfigLockAsync$1(() => {
33
+ writeDoctorRun(projectRoot, targets, {
34
+ at: (/* @__PURE__ */ new Date()).toISOString(),
35
+ version
36
+ });
37
+ }, signal);
38
+ }
39
+ function writeDoctorRun(projectRoot, targets, run) {
40
+ upsertProject(projectRoot, (existing) => {
41
+ const doctorRuns = { ...existing.doctorRuns };
42
+ for (const target of targets) doctorRuns[target] = run;
43
+ return { doctorRuns };
44
+ });
45
+ }
31
46
  function doctorDueReason(record, running, now) {
32
47
  const at = record ? Date.parse(record.at) : NaN;
33
48
  if (!record || Number.isNaN(at)) return "never run";
@@ -194,24 +209,28 @@ function canonical(path) {
194
209
  return null;
195
210
  }
196
211
  }
197
- function inspectNestedWorktrees(projectRoot) {
198
- const worktrees = listWorktrees(repoRoot(projectRoot) ?? projectRoot).filter((entry) => !entry.prunable && !entry.bare).flatMap((entry) => canonical(entry.path) ?? []);
199
- return worktrees.flatMap((checkout) => {
212
+ async function inspectNestedWorktrees(projectRoot) {
213
+ const worktrees = (await listWorktreesAsync(await repoRootAsync(projectRoot) ?? projectRoot)).filter((entry) => !entry.prunable && !entry.bare).flatMap((entry) => canonical(entry.path) ?? []);
214
+ const entries = [];
215
+ for (const checkout of worktrees) {
200
216
  const configPath = join(checkout, ".watchmanconfig");
201
217
  const config = readWatchmanConfig(configPath);
202
- const { nested, add } = nestedWorktreeIgnores(checkout, worktrees, ignoreDirsOf(config), (dir) => Boolean(gitQuiet(checkout, [
218
+ let { nested, add } = nestedWorktreeIgnores(checkout, worktrees, ignoreDirsOf(config), () => false);
219
+ const [parent] = add;
220
+ if (parent && add.length === 1 && parent !== nested[0] && Boolean(await gitQuietAsync(checkout, [
203
221
  "ls-files",
204
222
  "--",
205
- dir
206
- ]) ?? true));
207
- return nested.length > 0 ? [{
223
+ parent
224
+ ]) ?? true)) add = nested;
225
+ if (nested.length > 0) entries.push({
208
226
  checkout,
209
227
  configPath,
210
228
  config,
211
229
  nested,
212
230
  add
213
- }] : [];
214
- });
231
+ });
232
+ }
233
+ return entries;
215
234
  }
216
235
  async function watchedCheckouts(checkouts, watchman = runWatchman) {
217
236
  if (checkouts.length === 0) return /* @__PURE__ */ new Set();
@@ -256,4 +275,4 @@ function writeIgnoreDirs(entry) {
256
275
  return { status: entry.config.kind === "absent" ? "created" : "updated" };
257
276
  }
258
277
  //#endregion
259
- export { writeIgnoreDirs as a, watchedCheckouts as i, inspectNestedWorktrees as n, guideStatus as o, nestedWorktreeFinding as r, recordDoctorRun as s, WATCHMAN_NESTED_WORKTREES as t };
278
+ export { writeIgnoreDirs as a, recordDoctorRun as c, watchedCheckouts as i, inspectNestedWorktrees as n, guideStatus as o, nestedWorktreeFinding as r, recordDoctorCheck as s, WATCHMAN_NESTED_WORKTREES as t };
@@ -1,10 +1,9 @@
1
- import { j as ownership_claim_exports } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-BX1sJQ2E.mjs";
4
- import { f as resolveEasCliBin } from "./remote-cache-OyOyVIS3.mjs";
5
- import { g as easCliUpgradeRemedy, h as easCliSupport, s as readInstalledEasCliVersion } from "./device-remote-xRT0Vmo9.mjs";
6
- import { existsSync, realpathSync, statSync } from "node:fs";
1
+ import { t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
+ import { a as killOnAbort, f as throwIfCancelled, r as childEnvironment } from "./operation-exec-BW0em61G.mjs";
3
+ import { Zn as remoteCliInvocation, nr as easCliUpgradeRemedy, qn as resolveEasCliBin, tr as easCliSupport } from "./budget-Cvwn54qV.mjs";
4
+ import { M as acquireBuildLock, P as releaseBuildLock } from "./activity-CMLmzp7o.mjs";
7
5
  import { createHash } from "node:crypto";
6
+ import { existsSync, realpathSync, statSync } from "node:fs";
8
7
  //#region src/engine/eas-build.ts
9
8
  const MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION = "18.9.0";
10
9
  function isEasBuildFailure(result) {
@@ -45,31 +44,63 @@ function selectEasBuild(builds, { platform, profile, fingerprint, projectId, phy
45
44
  }
46
45
  return null;
47
46
  }
48
- async function lookUpEasBuild({ root, platform, profile, note, physical = false, readEasCliVersion = readInstalledEasCliVersion }) {
47
+ async function lookUpEasBuild({ context, root, platform, profile, note, physical = false, env, signal, readEasCliVersion }) {
48
+ throwIfCancelled(signal, "EAS development build");
49
49
  const retry = "the same Stim command";
50
50
  const buildCommand = `npx eas-cli build --platform ${platform} --profile ${shellArg(profile)}`;
51
51
  const cli = resolveEasCliBin(root);
52
52
  if (!cli) throw new EasFailure("STIM_EAS_UNAVAILABLE", "EAS CLI is not installed.", "Install eas-cli, run eas login, then retry.");
53
- const easCli = easCliSupport(readEasCliVersion(cli.file, root), MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION);
54
- if (!easCli.supported) throw new EasFailure("STIM_EAS_UNAVAILABLE", easCli.version ? `eas-cli ${easCli.version} (${cli.file}) cannot download a build by ID; --eas-profile needs eas-cli ${MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION} or later.` : `Could not read an eas-cli version from \`${cli.file} --version\`; --eas-profile needs eas-cli ${MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION} or later.`, `${easCliUpgradeRemedy(MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION)}, then retry ${retry}.`);
55
53
  let profileEnv = {};
56
- const run = (args, timeoutMs = 12e4) => {
54
+ const command = async (args, timeoutMs = 12e4) => {
55
+ throwIfCancelled(signal, "EAS development build");
57
56
  try {
58
- return JSON.parse(getExecutor().runFile(cli.file, [
57
+ const environment = env ? childEnvironment({
58
+ ...env,
59
+ ...profileEnv
60
+ }) : {
61
+ env: profileEnv,
62
+ omitEnv: []
63
+ };
64
+ const invocation = remoteCliInvocation(cli.file, args, "eas-cli");
65
+ const output = await getExecutor().runFileAsync(invocation.file, invocation.args, {
66
+ cwd: root,
67
+ timeoutMs,
68
+ ...environment,
69
+ omitEnv: [...environment.omitEnv, ...args[0] === "--version" ? ["AGENT_DEVICE_DAEMON_BASE_URL", "AGENT_DEVICE_DAEMON_AUTH_TOKEN"] : []],
70
+ onSpawn: killOnAbort(signal),
71
+ declareFor: context
72
+ });
73
+ throwIfCancelled(signal, "EAS development build");
74
+ return output;
75
+ } catch (error) {
76
+ throwIfCancelled(signal, "EAS development build");
77
+ throw error;
78
+ }
79
+ };
80
+ let version;
81
+ try {
82
+ version = readEasCliVersion ? await readEasCliVersion(cli.file, root) : await command(["--version"], 3e4);
83
+ } catch {
84
+ throwIfCancelled(signal, "EAS development build");
85
+ version = null;
86
+ }
87
+ throwIfCancelled(signal, "EAS development build");
88
+ const easCli = easCliSupport(version, MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION);
89
+ if (!easCli.supported) throw new EasFailure("STIM_EAS_UNAVAILABLE", easCli.version ? `eas-cli ${easCli.version} (${cli.file}) cannot download a build by ID; --eas-profile needs eas-cli ${MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION} or later.` : `Could not read an eas-cli version from \`${cli.file} --version\`; --eas-profile needs eas-cli ${MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION} or later.`, `${easCliUpgradeRemedy(MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION)}, then retry ${retry}.`);
90
+ const run = async (args, timeoutMs = 12e4) => {
91
+ try {
92
+ return JSON.parse(await command([
59
93
  ...args,
60
94
  "--json",
61
95
  "--non-interactive"
62
- ], {
63
- cwd: root,
64
- timeoutMs,
65
- env: profileEnv
66
- }));
96
+ ], timeoutMs));
67
97
  } catch {
98
+ throwIfCancelled(signal, "EAS development build");
68
99
  throw new EasFailure("STIM_EAS_UNAVAILABLE", `EAS ${args[0]} failed or returned invalid JSON.`, `Run npx eas-cli ${args.map(shellArg).join(" ")} to inspect the error, then retry ${retry}.`);
69
100
  }
70
101
  };
71
102
  note(`eas resolving profile ${profile}`);
72
- const config = object(run([
103
+ const config = object(await run([
73
104
  "config",
74
105
  "--platform",
75
106
  platform,
@@ -83,7 +114,7 @@ async function lookUpEasBuild({ root, platform, profile, note, physical = false,
83
114
  if (typeof projectId !== "string" || !projectId) throw new EasFailure("STIM_BAD_ARG", "The Expo app is not linked to an EAS project.", "Link the intended EAS project with eas init, then retry.");
84
115
  if (platform === "ios" ? buildProfile.buildConfiguration !== void 0 && buildProfile.buildConfiguration !== "Debug" : buildProfile.gradleCommand !== void 0 && (typeof buildProfile.gradleCommand !== "string" || !/^:app:assemble\w*Debug$/.test(buildProfile.gradleCommand))) throw new EasFailure("STIM_BAD_ARG", `EAS profile ${profile} overrides the development build configuration.`, "Use ios.buildConfiguration: Debug or an android.gradleCommand that assembles a single Debug APK, or remove the override.");
85
116
  note(`eas fingerprinting ${platform} with profile ${profile}`);
86
- const fingerprint = object(run([
117
+ const fingerprint = object(await run([
87
118
  "fingerprint:generate",
88
119
  "--platform",
89
120
  platform,
@@ -92,7 +123,7 @@ async function lookUpEasBuild({ root, platform, profile, note, physical = false,
92
123
  ])).hash;
93
124
  if (typeof fingerprint !== "string" || !/^[a-f0-9]{40,64}$/.test(fingerprint)) throw new EasFailure("STIM_EAS_UNAVAILABLE", "EAS returned no valid native fingerprint.", `Run npx eas-cli fingerprint:generate --platform ${platform} --build-profile ${shellArg(profile)} to inspect the result.`);
94
125
  note(`eas looking for ${fingerprint.slice(0, 8)}`);
95
- const buildId = selectEasBuild(run([
126
+ const buildId = selectEasBuild(await run([
96
127
  "build:list",
97
128
  "--platform",
98
129
  platform,
@@ -171,6 +202,7 @@ async function planEasDevelopmentBuild(args) {
171
202
  missing: found.buildId ? null : found.missing
172
203
  };
173
204
  } catch (error) {
205
+ throwIfCancelled(args.signal, "EAS development build");
174
206
  return easFailure(error, "the same Stim command");
175
207
  }
176
208
  }
@@ -202,7 +234,7 @@ async function resolveEasDevelopmentBuild(args) {
202
234
  });
203
235
  if (!lock.acquired) throw new EasFailure("STIM_EAS_UNAVAILABLE", `Another run holds the EAS artifact claim at ${lock.path}.`, `Wait for that run to finish, then retry ${retry}.`);
204
236
  args.note(`eas resolving artifact for build ${buildId}`);
205
- const result = object(run([
237
+ const result = object(await run([
206
238
  "build:download",
207
239
  "--build-id",
208
240
  buildId
@@ -219,6 +251,7 @@ async function resolveEasDevelopmentBuild(args) {
219
251
  cacheHit: "remote"
220
252
  };
221
253
  } catch (error) {
254
+ throwIfCancelled(args.signal, "EAS development build");
222
255
  return easFailure(error, retry);
223
256
  } finally {
224
257
  releaseBuildLock(lock);