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
@@ -0,0 +1,248 @@
1
+ import { y as trackReportResource } from "./exec-DEoAhcze.mjs";
2
+ import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-gwpm28fu.mjs";
3
+ import { Ht as makeTemporaryDirectory, Wt as removeTemporaryEntryAsync } from "./settings-C7O8A6ZI.mjs";
4
+ import { G as readStats, L as estimateBuild, Vn as easAuthNote } from "./budget-Cvwn54qV.mjs";
5
+ import { o as entryDir, t as artifactIn } from "./build-cache-Dv7RN200.mjs";
6
+ import { a as staleNativeDirRefusal, c as predictBuildMiss } from "./prebuild-D4JoEAEs.mjs";
7
+ import chalk from "chalk";
8
+ import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, resolveTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
9
+ //#region src/commands/build-plan.ts
10
+ const DISCARD = {
11
+ file: "",
12
+ written: 0,
13
+ dropped: 0,
14
+ lastError: null,
15
+ write: () => true,
16
+ close: () => ({
17
+ file: "",
18
+ written: 0,
19
+ dropped: 0,
20
+ lastError: null
21
+ })
22
+ };
23
+ async function providerHit({ root, platform, cacheKey, providerConfig }, deps) {
24
+ if (!providerConfig) return null;
25
+ let destinationDir;
26
+ try {
27
+ destinationDir = makeTemporaryDirectory(root, "stim-plan-");
28
+ } catch (error) {
29
+ deps.note(chalk.yellow(phaseLine("cache", `provider not checked: ${error?.message || error}`)));
30
+ return null;
31
+ }
32
+ let pending = Promise.resolve();
33
+ const cleanupFailure = Object.assign(/* @__PURE__ */ new Error(`Cache provider cleanup did not finish within 35 seconds. Retained ${destinationDir}.`), {
34
+ code: "STIM_CLAIM_UNAVAILABLE",
35
+ reportCleanup: true,
36
+ remedy: "Confirm that no cache work is still using the retained download directory before inspecting its permissions and removing it."
37
+ });
38
+ let cleanup;
39
+ let close;
40
+ const closed = new Promise((resolve) => {
41
+ close = resolve;
42
+ });
43
+ const finish = () => cleanup ??= finishProviderDownload(pending, destinationDir, cleanupFailure).finally(() => close());
44
+ trackReportResource(deps.operation, closed, finish, deps.operation?.signal, cleanupFailure);
45
+ try {
46
+ const found = await resolveTieredBuild({
47
+ local: {
48
+ resolve: () => null,
49
+ store: () => null
50
+ },
51
+ loadProvider: async () => {
52
+ const loaded = await deps.loadCacheProvider({
53
+ projectRoot: root,
54
+ config: providerConfig,
55
+ ...deps.operation ? { env: deps.operation.env } : {},
56
+ timeoutMs: timeoutFromEnv(PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, deps.operation?.env)
57
+ });
58
+ const capability = loaded?.provider?.builds;
59
+ if (!capability) return loaded;
60
+ return {
61
+ ...loaded,
62
+ provider: {
63
+ ...loaded.provider,
64
+ builds: {
65
+ store: capability.store.bind(capability),
66
+ resolve: (request) => {
67
+ const resolving = Promise.resolve().then(() => capability.resolve(request));
68
+ pending = resolving.then(() => void 0, (cause) => {
69
+ if (cause instanceof Error && "reportCleanup" in cause) throw cause;
70
+ });
71
+ return resolving;
72
+ }
73
+ }
74
+ }
75
+ };
76
+ },
77
+ signal: deps.operation?.signal,
78
+ timeoutMs: buildResolveTimeoutMs(deps.operation?.env),
79
+ target: {
80
+ projectRoot: root,
81
+ platform,
82
+ key: cacheKey
83
+ },
84
+ destinationDir,
85
+ warn: (_code, message) => deps.note(chalk.yellow(phaseLine("cache", message)))
86
+ });
87
+ return found ? found.providerName ?? "the cache provider" : null;
88
+ } finally {
89
+ await finish();
90
+ }
91
+ }
92
+ async function finishProviderDownload(pending, destinationDir, cleanupFailure) {
93
+ let timer;
94
+ if (!await Promise.race([pending.then(() => true), new Promise((resolve) => {
95
+ timer = setTimeout(() => resolve(false), 35e3);
96
+ })]).finally(() => clearTimeout(timer))) throw cleanupFailure;
97
+ try {
98
+ await removeTemporaryEntryAsync(destinationDir);
99
+ } catch (cause) {
100
+ throw Object.assign(new Error(`Cache provider download cleanup failed. Retained ${destinationDir}.`, { cause }), {
101
+ code: "STIM_CLAIM_UNAVAILABLE",
102
+ reportCleanup: true,
103
+ remedy: "Check the retained directory permissions and remove it before retrying."
104
+ });
105
+ }
106
+ }
107
+ async function expoRemoteHit(lookup, deps) {
108
+ if (!lookup.expoRemote) return null;
109
+ const { root, platform, isExpo, fingerprint } = lookup;
110
+ const loaded = await deps.loadProjectProvider(root, {
111
+ isExpo,
112
+ context: deps.operation
113
+ });
114
+ if (loaded?.unavailable) {
115
+ deps.note(chalk.yellow(phaseLine("cache", `provider not usable: ${loaded.unavailable}`)));
116
+ return null;
117
+ }
118
+ if (!loaded?.provider) return null;
119
+ const name = loaded.name ?? "the build cache provider";
120
+ if (name === "eas") {
121
+ const auth = await deps.checkEasAuth({
122
+ context: deps.operation,
123
+ projectRoot: root,
124
+ owner: loaded.owner || null
125
+ });
126
+ const authNote = easAuthNote(auth);
127
+ if (authNote) deps.note(chalk.yellow(phaseLine("cache", authNote)));
128
+ if (auth?.code === "logged-out") return null;
129
+ }
130
+ const hit = await deps.resolveRemote({
131
+ context: deps.operation,
132
+ provider: loaded.provider,
133
+ platform,
134
+ projectRoot: root,
135
+ fingerprintHash: fingerprint,
136
+ runOptions: lookup.expoRemote.runOptions,
137
+ logWriter: DISCARD
138
+ });
139
+ if (hit?.timedOut) deps.note(chalk.yellow(phaseLine("cache", `${name} did not answer; counted as a miss`)));
140
+ else if (hit?.failed) deps.note(chalk.yellow(phaseLine("cache", `${name} could not be used: ${hit.failed}`)));
141
+ return hit?.appPath ? name : null;
142
+ }
143
+ async function planCachedBuild(lookup, deps) {
144
+ const { root, platform, isExpo, fingerprint, sources, cacheKey, cachePolicy } = lookup;
145
+ deps.operation?.signal.throwIfAborted();
146
+ let cacheHit = false;
147
+ let provider = null;
148
+ if (cachePolicy.read) {
149
+ if (artifactIn(entryDir(platform, cacheKey))) cacheHit = "local";
150
+ else {
151
+ provider = (cachePolicy.remote ? await providerHit(lookup, deps) : null) ?? await expoRemoteHit(lookup, deps);
152
+ if (provider) cacheHit = "remote";
153
+ }
154
+ }
155
+ deps.operation?.signal.throwIfAborted();
156
+ let prebuild = null;
157
+ let refusal = null;
158
+ let missReason;
159
+ if (!cacheHit) {
160
+ prebuild = await deps.planPrebuild(root, platform, {
161
+ isExpo,
162
+ fingerprint,
163
+ sources
164
+ }, deps.operation?.signal);
165
+ if (prebuild === "refuse") refusal = staleNativeDirRefusal(platform);
166
+ else if (cachePolicy.read) missReason = predictBuildMiss({
167
+ root,
168
+ platform,
169
+ current: {
170
+ hash: fingerprint,
171
+ sources
172
+ },
173
+ prebuild: prebuild === "generate" || prebuild === "regenerate" ? prebuild : null
174
+ });
175
+ }
176
+ return planPayload(lookup, {
177
+ fingerprint,
178
+ cacheKey,
179
+ cacheHit,
180
+ provider,
181
+ cacheSkipped: !cachePolicy.read,
182
+ prebuild,
183
+ ...missReason ? { missReason } : {},
184
+ refusal
185
+ });
186
+ }
187
+ function planPayload({ platform, slot, projectKey }, found) {
188
+ const { refusal, missReason, ...rest } = found;
189
+ const outcome = refusal ? null : found.cacheHit ? "hit" : "cold";
190
+ const estimate = outcome ? estimateBuild(readStats().record?.history?.[projectKey], platform, outcome) : {
191
+ expectedMs: null,
192
+ basis: 0
193
+ };
194
+ return {
195
+ platform,
196
+ ...slot === "default" ? {} : { slot },
197
+ ...rest,
198
+ outcome,
199
+ expectedMs: estimate.expectedMs,
200
+ basis: estimate.basis,
201
+ ...missReason ? { missReason } : {},
202
+ ...refusal ? { refusal } : {}
203
+ };
204
+ }
205
+ function cacheLine(plan) {
206
+ if (plan.refusal) return `the build would refuse with ${plan.refusal.code}`;
207
+ if (plan.cacheHit === "local") return "local cache hit";
208
+ if (plan.cacheHit === "remote") return `remote cache hit (${plan.provider})`;
209
+ return `${plan.cacheSkipped ? "cache reads are off" : "cache miss"}: compiles${plan.prebuild === "generate" || plan.prebuild === "regenerate" ? `, ${plan.prebuild}s the native dir` : ""}`;
210
+ }
211
+ function printPlan(plan, json) {
212
+ if (json) {
213
+ console.log(JSON.stringify(plan));
214
+ return;
215
+ }
216
+ const slot = plan.slot ? ` [${plan.slot}]` : "";
217
+ console.log(phaseLine("plan", `${plan.platform}${slot} ${shortHash(plan.fingerprint)} -> ${cacheLine(plan)}`));
218
+ if (plan.placement) console.log(phaseLine("placement", plan.placement));
219
+ if (plan.missReason) console.log(phaseLine("cache", `miss: ${plan.missReason.summary}`));
220
+ if (plan.refusal) {
221
+ console.log(phaseLine("error", plan.refusal.message));
222
+ console.log(phaseLine("remedy", plan.refusal.remedy));
223
+ return;
224
+ }
225
+ console.log(phaseLine("expect", plan.expectedMs === null ? `unknown: no ${plan.outcome} run of this project is recorded yet` : `~${formatDuration(plan.expectedMs)} (median of ${plural(plan.basis, `${plan.outcome} run`)})`));
226
+ }
227
+ function refusePlan({ code, message, remedy }, json, lines = []) {
228
+ console.error(chalk.red(phaseLine("error", message)));
229
+ for (const line of lines) console.error(chalk.dim(phaseLine("", line)));
230
+ console.error(chalk.dim(phaseLine("remedy", remedy)));
231
+ console.error(chalk.red(phaseLine("failed", code)));
232
+ if (json) console.log(JSON.stringify({
233
+ code,
234
+ message,
235
+ remedy
236
+ }));
237
+ process.exitCode = 1;
238
+ }
239
+ const PLAN_ONLY_REMEDY = "Drop the flag to plan the owned simulator or emulator build, or run the command without --plan.";
240
+ function planFlagRefusal(flag) {
241
+ return {
242
+ code: "STIM_BAD_ARG",
243
+ message: `${flag} does not apply to --plan, which predicts the next local build without choosing a device.`,
244
+ remedy: PLAN_ONLY_REMEDY
245
+ };
246
+ }
247
+ //#endregion
248
+ export { refusePlan as a, printPlan as i, planFlagRefusal as n, planPayload as r, planCachedBuild as t };
@@ -1,7 +1,7 @@
1
- import { d as getConfigDir } from "./config-BYDxlMY3.mjs";
1
+ import { d as getConfigDir } from "./config-DlrsduwG.mjs";
2
+ import { cacheDirRefusal, readCacheManifest, updateCacheManifest } from "@stim-cli/core";
2
3
  import { join, resolve } from "path";
3
4
  import { existsSync } from "fs";
4
- import { cacheDirRefusal, readCacheManifest, updateCacheManifest } from "@stim-cli/core";
5
5
  import { homedir } from "os";
6
6
  //#region src/cache/cache-manifest.ts
7
7
  function manifestPath() {
@@ -1,2 +1,2 @@
1
- import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-XH-fvDUj.mjs";
1
+ import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DSeQjt-Q.mjs";
2
2
  export { manifestPath, readManifest, register, registeredCaches, unregister };
@@ -1,10 +1,10 @@
1
- import { _ as loadConfig } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { r as register } from "./cache-manifest-XH-fvDUj.mjs";
4
- import { m as defaultAndroidLayout } from "./settings-B717odTD.mjs";
5
- import { h as sharedCcache, w as workspaceLogsDir } from "./workspace-state-DJt_MMvf.mjs";
6
- import { l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
7
- import { o as machineNumber } from "./budget-f7516Zk0.mjs";
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
+ import { a as sharedCcache, m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
3
+ import { _ as loadConfig } from "./config-DlrsduwG.mjs";
4
+ import { l as phaseLine } from "./command-output-gwpm28fu.mjs";
5
+ import { m as defaultAndroidLayout } from "./settings-C7O8A6ZI.mjs";
6
+ import { r as register } from "./cache-manifest-DSeQjt-Q.mjs";
7
+ import { o as machineNumber } from "./budget-Cvwn54qV.mjs";
8
8
  import { readFileSync, realpathSync } from "node:fs";
9
9
  import { isAbsolute, join, relative } from "node:path";
10
10
  import chalk from "chalk";
@@ -106,7 +106,7 @@ function canonical(root) {
106
106
  return root;
107
107
  }
108
108
  }
109
- function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = sharedCcache(), lookup = lookupCcache, onNote = (line) => console.error(line) }) {
109
+ function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = sharedCcache(), lookup = lookupCcache, env = process.env, onNote = (line) => console.error(line) }) {
110
110
  const binary = lookup();
111
111
  if (!binary) {
112
112
  onNote(chalk.dim(phaseLine("cache", "ccache off (not installed; brew install ccache)")));
@@ -121,6 +121,7 @@ function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = shared
121
121
  const statsLog = ccacheStatsLog(root);
122
122
  register({
123
123
  dir,
124
+ registeredBy: root,
124
125
  name: "ccache",
125
126
  prune: "atomic",
126
127
  note: "ccache keeps itself under CCACHE_MAXSIZE, so it is emptied whole or not at all"
@@ -134,7 +135,7 @@ function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = shared
134
135
  dir,
135
136
  workspaceRoot: canonical(root),
136
137
  statsLog,
137
- maxSize: ccacheMaxSize()
138
+ maxSize: ccacheMaxSize(loadConfig(), env)
138
139
  })
139
140
  };
140
141
  }
@@ -1,8 +1,10 @@
1
+ import { d as cancelledError, f as throwIfCancelled } from "./operation-exec-BW0em61G.mjs";
1
2
  import { WebSocket } from "ws";
2
3
  //#region src/web/cdp.ts
3
4
  const COMMAND_TIMEOUT_MS = 15e3;
4
- function connectCdp(url, { timeoutMs = 5e3 } = {}) {
5
+ function connectCdp(url, { timeoutMs = 5e3, signal } = {}) {
5
6
  return new Promise((resolve, reject) => {
7
+ if (signal?.aborted) return reject(cancelledError("browser operation"));
6
8
  const socket = new WebSocket(url, {
7
9
  perMessageDeflate: false,
8
10
  maxPayload: 268435456
@@ -12,10 +14,13 @@ function connectCdp(url, { timeoutMs = 5e3 } = {}) {
12
14
  const closeListeners = [];
13
15
  let nextId = 1;
14
16
  let closed = false;
17
+ let opened = false;
15
18
  const timer = setTimeout(() => {
16
19
  socket.terminate();
17
20
  reject(/* @__PURE__ */ new Error(`DevTools did not accept a connection at ${url} within ${timeoutMs}ms`));
18
21
  }, timeoutMs);
22
+ const abort = () => socket.terminate();
23
+ signal?.addEventListener("abort", abort, { once: true });
19
24
  socket.on("message", (data) => {
20
25
  let message;
21
26
  try {
@@ -42,7 +47,11 @@ function connectCdp(url, { timeoutMs = 5e3 } = {}) {
42
47
  });
43
48
  socket.on("close", () => {
44
49
  closed = true;
45
- for (const waiter of pending.values()) waiter.reject(/* @__PURE__ */ new Error("DevTools connection closed"));
50
+ clearTimeout(timer);
51
+ signal?.removeEventListener("abort", abort);
52
+ const error = signal?.aborted ? cancelledError("browser operation") : /* @__PURE__ */ new Error("DevTools connection closed");
53
+ if (!opened) reject(error);
54
+ for (const waiter of pending.values()) waiter.reject(error);
46
55
  pending.clear();
47
56
  for (const listener of closeListeners) listener();
48
57
  });
@@ -51,9 +60,11 @@ function connectCdp(url, { timeoutMs = 5e3 } = {}) {
51
60
  reject(error);
52
61
  });
53
62
  socket.on("open", () => {
63
+ opened = true;
54
64
  clearTimeout(timer);
55
65
  resolve({
56
66
  send(method, params = {}, sessionId) {
67
+ if (signal?.aborted) return Promise.reject(cancelledError("browser operation"));
57
68
  if (closed) return Promise.reject(/* @__PURE__ */ new Error("DevTools connection closed"));
58
69
  const id = nextId++;
59
70
  return new Promise((resolveCommand, rejectCommand) => {
@@ -97,10 +108,12 @@ function connectCdp(url, { timeoutMs = 5e3 } = {}) {
97
108
  * Connects to the browser DevTools endpoint on loopback `port` only when the process serving it is `chromePid`,
98
109
  * the Chrome Stim started. Chrome reports its own browser process through `SystemInfo.getProcessInfo`.
99
110
  */
100
- async function connectOwnedBrowser(port, chromePid) {
101
- const { webSocketDebuggerUrl } = await (await fetch(`http://127.0.0.1:${port}/json/version`, { signal: AbortSignal.timeout(2e3) })).json();
111
+ async function connectOwnedBrowser(port, chromePid, signal) {
112
+ throwIfCancelled(signal, "browser operation");
113
+ const { webSocketDebuggerUrl } = await (await fetch(`http://127.0.0.1:${port}/json/version`, { signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(2e3)]) : AbortSignal.timeout(2e3) })).json();
102
114
  if (typeof webSocketDebuggerUrl !== "string" || !webSocketDebuggerUrl.startsWith(`ws://127.0.0.1:${port}/`)) throw new Error(`port ${port} does not serve a browser DevTools endpoint`);
103
- const cdp = await connectCdp(webSocketDebuggerUrl);
115
+ throwIfCancelled(signal, "browser operation");
116
+ const cdp = await connectCdp(webSocketDebuggerUrl, { signal });
104
117
  try {
105
118
  const { processInfo } = await cdp.send("SystemInfo.getProcessInfo");
106
119
  const browser = processInfo?.find((entry) => entry.type === "browser")?.id;
@@ -1,7 +1,7 @@
1
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
2
  import { existsSync } from "node:fs";
3
- import { join } from "node:path";
4
3
  import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
5
  //#region src/web/chrome.ts
6
6
  const CHROME_INSTALL_REMEDY = "Install Google Chrome from https://www.google.com/chrome/ (or Chromium), then run `stim doctor`.";
7
7
  const MAC_APPS = [["Google Chrome.app", "Google Chrome"], ["Chromium.app", "Chromium"]];
@@ -21,8 +21,11 @@ function chromeCandidates(host, { home = homedir(), env = process.env } = {}) {
21
21
  return [];
22
22
  }
23
23
  /** The installed Chrome or Chromium executable Stim launches, or null when none is installed. */
24
- function findChrome({ host = process.platform, exists = existsSync, findExecutable = (name) => getExecutor().findExecutable(name) } = {}) {
25
- const installed = chromeCandidates(host).find((path) => exists(path));
24
+ function findChrome({ host = process.platform, env = process.env, home = env.HOME || env.USERPROFILE || homedir(), exists = existsSync, findExecutable = (name) => getExecutor().findExecutable(name) } = {}) {
25
+ const installed = chromeCandidates(host, {
26
+ home,
27
+ env
28
+ }).find((path) => exists(path));
26
29
  if (installed) return installed;
27
30
  for (const name of PATH_NAMES) {
28
31
  const found = findExecutable(name);
@@ -1,27 +1,27 @@
1
- import { y as refuseRelativeStimPaths } from "./config-BYDxlMY3.mjs";
2
- import { r as debugLog } from "./exec-DqKo9GKJ.mjs";
1
+ import { b as debugLog } from "./exec-DEoAhcze.mjs";
2
+ import { y as refuseRelativeStimPaths } from "./config-DlrsduwG.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { runId } from "@stim-cli/core/state";
5
5
  import { Command } from "commander";
6
6
  //#region bin/cli.ts
7
7
  const commands = /* @__PURE__ */ new Map([
8
- ["doctor", () => import("./doctor-CB8oZKCk.mjs")],
9
- ["worktree", () => import("./worktree-DpLdCHga.mjs")],
10
- ["start", () => import("./start-TXeMmmO2.mjs")],
11
- ["ports", () => import("./ports-DdSUicVo.mjs")],
12
- ["stop", () => import("./stop-DR6VoDIk.mjs")],
13
- ["ios", () => import("./ios-BwVCF7oA.mjs")],
14
- ["android", () => import("./android-Dlzxshgp.mjs")],
15
- ["web", () => import("./web-Dq-i3wzJ.mjs")],
16
- ["macos", () => import("./macos-D7uDvO-z.mjs")],
17
- ["reload", () => import("./reload-C8JhxjSh.mjs")],
18
- ["device", () => import("./device-DuiPJQSn.mjs")],
19
- ["logs", () => import("./logs-BGrEUaEs.mjs")],
20
- ["settings", () => import("./settings-BORNaaCO.mjs")],
21
- ["status", () => import("./status-WgFbkRzj.mjs")],
22
- ["stats", () => import("./stats-BoY5sEPU.mjs")],
23
- ["gc", () => import("./gc-qWOMdnER.mjs")],
24
- ["guide", () => import("./guide-G9cAbVAc.mjs")]
8
+ ["doctor", () => import("./doctor-thjWAV0z.mjs")],
9
+ ["worktree", () => import("./worktree-ZqZVjD9K.mjs")],
10
+ ["start", () => import("./start-Br-oxqMD.mjs")],
11
+ ["ports", () => import("./ports-Cy1RkmuQ.mjs")],
12
+ ["stop", () => import("./stop-DTZ9uTw3.mjs")],
13
+ ["ios", () => import("./ios-Ds1clbIt.mjs")],
14
+ ["android", () => import("./android-DGkNqa_c.mjs")],
15
+ ["web", () => import("./web-CZ07gd77.mjs")],
16
+ ["macos", () => import("./macos-DVlSSyUg.mjs")],
17
+ ["reload", () => import("./reload-D7AVlb8N.mjs")],
18
+ ["device", () => import("./device-DklWZLqb.mjs")],
19
+ ["logs", () => import("./logs-jTS_lHSo.mjs")],
20
+ ["settings", () => import("./settings-DpR-1Wnn.mjs")],
21
+ ["status", () => import("./status-EvrK72L2.mjs")],
22
+ ["stats", () => import("./stats-D3GerlFW.mjs")],
23
+ ["gc", () => import("./gc-DnNDQyaP.mjs")],
24
+ ["guide", () => import("./guide-Br0LEfKy.mjs")]
25
25
  ]);
26
26
  const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
27
27
  const program = new Command();
@@ -52,7 +52,7 @@ try {
52
52
  }));
53
53
  }
54
54
  try {
55
- const { triggerMaintenance } = await import("./trigger-9_USgmxz.mjs");
55
+ const { triggerMaintenance } = await import("./trigger-yb_nFzPF.mjs");
56
56
  triggerMaintenance(action.name());
57
57
  } catch {}
58
58
  });
package/dist/cli.mjs CHANGED
@@ -4,6 +4,6 @@ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e
4
4
  if (encode(process.versions.node) < encode("22.12.0")) {
5
5
  process.stderr.write(`STIM_NODE_UNSUPPORTED: Stim needs Node 22.12.0 or later; this is Node ${process.versions.node} at ${process.execPath}. To run Stim where a project pins an older Node, see https://stim.appandflow.com/docs/requirements#older-node-pins\n`);
6
6
  process.exitCode = 1;
7
- } else import("./cli-CLP3diBm.mjs");
7
+ } else import("./cli-CHZa9Lvk.mjs");
8
8
  //#endregion
9
9
  export {};