stim 1.26.0 → 1.27.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 (171) hide show
  1. package/dist/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-BKN2Yuhg.mjs} +2 -2
  2. package/dist/{act-C-BqJEpu.mjs → act-ROviTF_t.mjs} +297 -122
  3. package/dist/{activity-Lnb_EoRY.mjs → activity-Cd-ysFes.mjs} +6 -6
  4. package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-C5nCKWp9.mjs} +5 -5
  5. package/dist/{android-CSbLRD53.mjs → android--HBgpvpW.mjs} +5 -5
  6. package/dist/{android-CiNQw3kq.mjs → android-Cd6w7_qw.mjs} +96 -43
  7. package/dist/{android-B5P81yI-.mjs → android-Deb9X3_Y.mjs} +37 -15
  8. package/dist/{android-DTAcRwBC.mjs → android-DriNoAVy.mjs} +23 -18
  9. package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-D5e6ecUg.mjs} +4 -4
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/api.d.mts +13 -3
  12. package/dist/api.mjs +39 -29
  13. package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-BHQHx3Rm.mjs} +2 -2
  14. package/dist/{artifact-BxREhAaV.mjs → artifact-0AGJYB9O.mjs} +18 -23
  15. package/dist/{artifact-CsAP6AGK.mjs → artifact-faemIZv5.mjs} +19 -24
  16. package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
  17. package/dist/auto-placement-z-H5pJza.mjs +350 -0
  18. package/dist/{browser-web-rYPyqhTf.mjs → browser-web-slD8AvLp.mjs} +16 -16
  19. package/dist/{build-cache-DrXNCy3T.mjs → build-cache-gBJ-WKzA.mjs} +43 -21
  20. package/dist/{build-DPhApsjV.mjs → build-hS0QyFlQ.mjs} +35 -31
  21. package/dist/{build-plan-DrMMdayj.mjs → build-plan-CBqYbzYM.mjs} +7 -6
  22. package/dist/{cache-manifest-BEZ9Bpl1.mjs → cache-manifest-DEjqGGat.mjs} +1 -1
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{budget-k2mZGvvk.mjs → ccache-BWTze1Ls.mjs} +560 -1603
  25. package/dist/{cdp-BG3FJCCx.mjs → cdp-C3svvXiE.mjs} +1 -1
  26. package/dist/{chrome-BvV8ssI3.mjs → chrome-DyDWurWG.mjs} +1 -1
  27. package/dist/{cli-BBKFGOFl.mjs → cli-ftXDLto1.mjs} +24 -23
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-D9CaRks-.mjs → client-xsdxrhWA.mjs} +48 -62
  30. package/dist/collector-run.d.mts +10 -9
  31. package/dist/collector-run.mjs +42 -27
  32. package/dist/{command-output-BF5AR2dL.mjs → command-output-Dj-WT4BP.mjs} +1 -1
  33. package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
  34. package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-BGokZ-Ng.mjs} +108 -60
  35. package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-C3OtgG94.mjs} +14 -7
  36. package/dist/{detached-entry-KmieOKgN.mjs → detached-entry-BPlSaCwC.mjs} +1 -1
  37. package/dist/{dev-client-DXR_tPVY.mjs → dev-client-BMca82xo.mjs} +2 -2
  38. package/dist/{device-BcYeHSFu.mjs → device-BJm0irrq.mjs} +16 -16
  39. package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-6LP7QsaA.mjs} +101 -16
  40. package/dist/device-host-worker.mjs +19 -19
  41. package/dist/{device-ios-BLGfXQeK.mjs → device-ios-534c14fz.mjs} +251 -23
  42. package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-DwsGfjUN.mjs} +5 -5
  43. package/dist/{device-pool-Dluix4H3.mjs → device-pool-BnQqvs6o.mjs} +3 -3
  44. package/dist/{device-BK-zwyd_.mjs → device-tM41-TUq.mjs} +25 -24
  45. package/dist/{doctor-Cp-BhzTS.mjs → doctor-Dbx1ZpD2.mjs} +1 -1
  46. package/dist/{doctor-Bhg1ii70.mjs → doctor-DyqE9n1J.mjs} +28 -16
  47. package/dist/{doctor-OnwP94ne.mjs → doctor-F-3VUUyN.mjs} +76 -32
  48. package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
  49. package/dist/doctor-fingerprint.mjs +1 -1
  50. package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-CxDbyrrt.mjs} +5 -5
  51. package/dist/{eas-build-Dsj93iM9.mjs → eas-build-CjNSWmjo.mjs} +4 -4
  52. package/dist/eas-fallback-9fqb46kW.mjs +87 -0
  53. package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-DrP4OuuM.mjs} +6 -6
  54. package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-snej9k4j.mjs} +51 -25
  55. package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
  56. package/dist/{gc-C_79zvz4.mjs → gc-BRwAY3qT.mjs} +2 -2
  57. package/dist/{gc-ldgr-hXU.mjs → gc-CGZ1Yg88.mjs} +160 -45
  58. package/dist/{guide-D7K0X6KG.mjs → guide-_rfEh_zM.mjs} +580 -183
  59. package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-BMKzUNnY.mjs} +4 -4
  60. package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-D7Pk_Oo1.mjs} +12 -8
  61. package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-B1gqQuva.mjs} +8 -8
  62. package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-Dg3qrZmV.mjs} +5 -5
  63. package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B9w4H8hc.mjs} +6 -6
  64. package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CdgaiuyP.mjs} +17 -16
  65. package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-Cbvo5KEh.mjs} +7 -8
  66. package/dist/{ios-ftxdQbJS.mjs → ios-B5HlVMhQ.mjs} +92 -37
  67. package/dist/{ios-B7-lToDu.mjs → ios-Bk4mWbtS.mjs} +8 -8
  68. package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
  69. package/dist/{ios-WxpDJ5T1.mjs → ios-E26qSpkb.mjs} +27 -11
  70. package/dist/{ios-device-CsyryvpT.mjs → ios-device-C_QkIf1Z.mjs} +3 -3
  71. package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
  72. package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-D8Jcy_br.mjs} +22 -9
  73. package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
  74. package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BZ03NFgF.mjs} +1 -1
  75. package/dist/{js-swap-BMhXYVDS.mjs → js-swap-Dg2a945i.mjs} +8 -7
  76. package/dist/{launch-DOp8RjDz.mjs → launch-CRyBeNsA.mjs} +42 -38
  77. package/dist/lightened-BCsdAGj_.mjs +171 -0
  78. package/dist/{logs-dQDki6Tt.mjs → logs-CC_-ZzEE.mjs} +7 -7
  79. package/dist/{logs-s1dRIG1E.mjs → logs-aJQb-RDg.mjs} +46 -21
  80. package/dist/{macos-B0VEV3Gf.mjs → macos-BGmTpnv9.mjs} +1 -1
  81. package/dist/{macos-DBBPNnIA.mjs → macos-DlCBhMw5.mjs} +73 -38
  82. package/dist/macos-run.mjs +1 -1
  83. package/dist/maintenance-run.mjs +7 -7
  84. package/dist/{metro-CjC10t6E.mjs → metro-CvyD-xwe.mjs} +4 -4
  85. package/dist/{metro-gateway-B6_PgD0L.mjs → metro-gateway-BnHdqMO_.mjs} +3 -3
  86. package/dist/{named-ports-BG0j1X4g.mjs → named-ports-BCyMWA6b.mjs} +3 -3
  87. package/dist/{native-android-CL2NGiik.mjs → native-android-DlpxCyOP.mjs} +17 -18
  88. package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-C13qT7R_.mjs} +5 -5
  89. package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DqaIBO5w.mjs} +9 -8
  90. package/dist/{native-source-D-4Dh4JU.mjs → native-source-D1AzWiuP.mjs} +1 -1
  91. package/dist/{native-xcode-inputs-BW7H8JGu.mjs → native-xcode-inputs-B1W8SrxB.mjs} +3 -3
  92. package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-QPP0Rm68.mjs} +17 -17
  93. package/dist/{ndjson-CgE_o3Dl.mjs → ndjson-Dy2W4vRa.mjs} +2 -2
  94. package/dist/offload-worker.mjs +23 -24
  95. package/dist/{operation-exec-CUZifp6Z.mjs → operation-exec-Dp4FuIGR.mjs} +1 -1
  96. package/dist/{ownership-BjYvMNX_.mjs → ownership-Bx-0cku-.mjs} +3 -3
  97. package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
  98. package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-C9yAaKEv.mjs} +18 -4
  99. package/dist/{placement-log-DIFPQAXp.mjs → placement-log-BXUbiZM6.mjs} +3 -3
  100. package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-UxnQjv5Z.mjs} +36 -10
  101. package/dist/{ports-C2_w1Z0Z.mjs → ports-uUrghqWN.mjs} +3 -3
  102. package/dist/{prebuild-gmouvmJZ.mjs → prebuild-BDpToDgR.mjs} +16 -17
  103. package/dist/{project-BUu6Is4k.mjs → project-DYj-HVx6.mjs} +17 -17
  104. package/dist/{pull-request-CbNlkFok.mjs → pull-request-BzLmzAIQ.mjs} +2 -2
  105. package/dist/pull-requests.mjs +1 -1
  106. package/dist/{react-native-android-Cgg99REN.mjs → react-native-android-DDBccgJw.mjs} +32 -26
  107. package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-DaK2IFyP.mjs} +9 -9
  108. package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-B-Mw6DcR.mjs} +6 -6
  109. package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-DjYwUF9U.mjs} +23 -17
  110. package/dist/{recordings-BldzVKq0.mjs → recordings-C20iUZfp.mjs} +1 -1
  111. package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
  112. package/dist/{reload-C9OduiNc.mjs → reload-DJBeF_rC.mjs} +1 -1
  113. package/dist/{reload-CCR7KC_l.mjs → reload-fUdkH2_p.mjs} +16 -16
  114. package/dist/{remote-C8S7FlPF.mjs → remote-y6n99WMW.mjs} +22 -9
  115. package/dist/{result-7F5hEwQJ.mjs → result-CTqBw2Te.mjs} +32 -21
  116. package/dist/{run-BqB0v3pt.mjs → run-DaCeNKRm.mjs} +3 -3
  117. package/dist/{selection-BNPBZ6T5.mjs → selection-Bs8phwhN.mjs} +37 -29
  118. package/dist/{server-bare-A75rDIdD.mjs → server-bare-BOh-iZEj.mjs} +2 -2
  119. package/dist/{server-command-CssKFOD7.mjs → server-command-8CuA51Cv.mjs} +6 -6
  120. package/dist/{server-expo-eQfOdydb.mjs → server-expo-ABQs2XFA.mjs} +4 -4
  121. package/dist/server-expo-Ba_Y21vB.mjs +2 -0
  122. package/dist/{settings-CosW5X-S.mjs → settings-BDVI8Ivc.mjs} +331 -62
  123. package/dist/{settings-OaGQF-ri.mjs → settings-CMHhQNwI.mjs} +24 -3
  124. package/dist/settings-payload-cm60Zhib.mjs +257 -0
  125. package/dist/settings-write-BdNRLlBn.mjs +185 -0
  126. package/dist/settings.schema.json +51 -33
  127. package/dist/{simslim-Bax1qcxu.mjs → simslim-DCQwzoPy.mjs} +2 -2
  128. package/dist/{slot-launch-CYCEhfBY.mjs → slot-launch-0l7RqSpr.mjs} +6 -6
  129. package/dist/{stage-jKQ7CP_B.mjs → stage-F4cAfJGi.mjs} +2 -2
  130. package/dist/{start-C_wefNKB.mjs → start-DcqnF9p8.mjs} +1 -1
  131. package/dist/{start-_BdJ32cZ.mjs → start-DrPwER_2.mjs} +27 -22
  132. package/dist/{state-C1i2nMOP.mjs → state-BX1y5syV.mjs} +4 -4
  133. package/dist/{state-C4OdpOTF.mjs → state-CZxLyetD.mjs} +2 -2
  134. package/dist/{stats-tEpEEH-u.mjs → stats-GxuCbles.mjs} +5 -5
  135. package/dist/{stats-report-n2U5plhk.mjs → stats-report-B86Cv7Uc.mjs} +1 -1
  136. package/dist/{status-CRXz-Gtj.mjs → status-7ULDEJ1e.mjs} +1 -1
  137. package/dist/{status-DQrqodLj.mjs → status-BfnK9pUd.mjs} +25 -25
  138. package/dist/{status-B9M7x4CZ.mjs → status-Bj7ZYvvc.mjs} +1 -1
  139. package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BfabQn03.mjs} +5 -5
  140. package/dist/status-worker.mjs +1 -1
  141. package/dist/{stim-desktop-6Dqp-gjX.mjs → stim-desktop-CbWo21kb.mjs} +2 -2
  142. package/dist/{stop-ySNQHXMG.mjs → stop-CH79S3IZ.mjs} +5 -5
  143. package/dist/{stop-DRqQVqDJ.mjs → stop-D-EAr25B.mjs} +21 -20
  144. package/dist/{stop-CmdNhGlC.mjs → stop-x1Yu3He4.mjs} +2 -2
  145. package/dist/supervisor-run.mjs +17 -17
  146. package/dist/{support-CVOCp0Ft.mjs → support-Be0UeVZU.mjs} +10 -10
  147. package/dist/{support-BGSCBoib.mjs → support-CNg_YsOk.mjs} +6 -6
  148. package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-uPqYvGBv.mjs} +4 -4
  149. package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-Ch4YjY_A.mjs} +11 -12
  150. package/dist/{toolchain-J4J8MrAr.mjs → toolchain-CbCG6C5Z.mjs} +321 -15
  151. package/dist/{toolchain-DoavrvIA.mjs → toolchain-JYAOquPg.mjs} +1 -1
  152. package/dist/{trigger-KVaWWNyn.mjs → trigger-DMou-X7j.mjs} +2 -2
  153. package/dist/trigger-qp2ji5wE.mjs +2 -0
  154. package/dist/{warm-progress-DvhTX_eu.mjs → warm-progress-C0RsbngN.mjs} +731 -727
  155. package/dist/{web-Bihbf7-u.mjs → web-Cq_AQ4DK.mjs} +9 -9
  156. package/dist/web-Je6abcpz.mjs +2 -0
  157. package/dist/web-run.mjs +9 -9
  158. package/dist/windows-report.mjs +1 -1
  159. package/dist/{workspace-state-pUg3_RRA.mjs → workspace-state-BjqdjnJR.mjs} +3 -3
  160. package/dist/{workspaces-g2lhdBXF.mjs → workspaces-DFbj07jp.mjs} +1795 -70
  161. package/dist/{worktree-BKuklFh_.mjs → worktree-COAJ3-OD.mjs} +934 -514
  162. package/dist/{worktree-Bm4cb-nU.mjs → worktree-JGUd_53L.mjs} +1 -1
  163. package/package.json +7 -7
  164. package/dist/ccache-Bx5TbxwG.mjs +0 -143
  165. package/dist/eas-fallback-FwkeqqGi.mjs +0 -381
  166. package/dist/hosted-ios-D55QhYaD.mjs +0 -15
  167. package/dist/native-run-BfIDFKLH.mjs +0 -275
  168. package/dist/server-expo-wvcj5tiZ.mjs +0 -2
  169. package/dist/settings-write-QjYfSrjF.mjs +0 -360
  170. package/dist/trigger-DzJu208Q.mjs +0 -2
  171. package/dist/web-BFLueSh-.mjs +0 -2
@@ -1,43 +1,44 @@
1
- import { o as cancellableSleep, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { f as writeWorkspaceStateAsync, k as workspaceLogsDir, r as readWorkspaceState } from "./workspace-state-pUg3_RRA.mjs";
3
- import { B as deviceSlotFileKey, E as upsertProject, O as withConfigLockAsync, V as deviceSlotKey, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals } from "./config-BktkY_zC.mjs";
4
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-BF5AR2dL.mjs";
5
- import { K as resolveCacheProviderConfig, Pt as repoRootAsync, Ut as makeTemporaryDirectory, Wt as removeTemporaryEntry, X as resolveSettings, et as settingOriginScope, lt as detectProviders, rt as settingsLayers, yt as gitCommonDirAsync } from "./settings-CosW5X-S.mjs";
6
- import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunchAsync } from "./project-BUu6Is4k.mjs";
7
- import { o as workspaceLinks } from "./stim-desktop-6Dqp-gjX.mjs";
8
- import { c as pidExists, d as resolveProjectMetro, f as signalProcessTree } from "./metro-CjC10t6E.mjs";
9
- import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
10
- import { $t as LAUNCH_BUNDLING, Bn as gateMetroOrigin, Kt as ensureMetroReachable, Mn as launchIosApp, Nn as restartedAppNote, On as installIosApp, Q as recordCapacityRefusal, Sn as devClientUrl, Wt as bundleEntryPoint, X as readRunEstimates, Xn as loadProjectProvider, Xt as remoteIosDeps, Zt as resolveRemoteContext, _n as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, an as isBundleProof, cn as unattributedLaunchLines, dn as verifyLaunch, en as LAUNCH_FATAL, er as resolveEasCliBin, et as recordRunStats, fn as verifyReleaseLaunch, kn as iosAppProcess, ln as unverifiedLaunchLines, nr as uploadRemote, on as readCollectorRecords, qn as checkEasAuth, qt as ensureRemoteBootOwned, rn as RELEASE_VERIFY_WAIT_MS, sn as readMetroRecords, t as budgetGate, tn as LAUNCH_UNVERIFIED, tr as resolveRemote, xn as clearOtherUserApps, zn as readRemoteSimulatorArch } from "./budget-k2mZGvvk.mjs";
11
- import { L as acquireBuildSlot, z as releaseBuildSlot } from "./workspaces-g2lhdBXF.mjs";
12
- import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-Lnb_EoRY.mjs";
13
- import { C as storeBuild, S as resolveBuild, k as untrackedNativeFiles, p as fingerprintProject } from "./build-cache-DrXNCy3T.mjs";
14
- import { d as listAllIosSims, h as listIosRuntimesAsync, r as clearIosAppData } from "./ios-WxpDJ5T1.mjs";
15
- import { B as readBundleExecutable, H as resolveScheme, O as runPodInstall, T as readPodState, V as readBundleId, w as podsAreStale } from "./toolchain-J4J8MrAr.mjs";
16
- import { n as readHostedIos, o as writeHostedIosAsync } from "./ios-state-Cw7-WQf2.mjs";
17
- import { n as hostedMetroPortProbe } from "./hosted-native-CpDB3-PO.mjs";
18
- import { n as prepareHostedIos, t as placeHostedIos } from "./hosted-ios-D55QhYaD.mjs";
19
- import { n as verifyCollectorOwnership } from "./ownership-BjYvMNX_.mjs";
20
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CYCEhfBY.mjs";
21
- import { c as startDevServer, g as detectBundleId } from "./start-_BdJ32cZ.mjs";
1
+ import { o as cancellableSleep, t as getExecutor, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
+ import { f as writeWorkspaceStateAsync, k as workspaceLogsDir, r as readWorkspaceState } from "./workspace-state-BjqdjnJR.mjs";
3
+ import { B as deviceSlotFileKey, E as upsertProject, O as withConfigLockAsync, V as deviceSlotKey, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals } from "./config-Cn94Jc0g.mjs";
4
+ import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-Dj-WT4BP.mjs";
5
+ import { $t as makeTemporaryDirectory, J as resolveCacheProviderConfig, Lt as repoRootAsync, Q as resolveSettings, at as settingsLayers, dt as detectProviders, en as removeTemporaryEntry, nt as settingOriginScope, xt as gitCommonDirAsync } from "./settings-BDVI8Ivc.mjs";
6
+ import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunchAsync } from "./project-DYj-HVx6.mjs";
7
+ import { o as workspaceLinks } from "./stim-desktop-CbWo21kb.mjs";
8
+ import { c as pidExists, d as resolveProjectMetro, f as signalProcessTree } from "./metro-CvyD-xwe.mjs";
9
+ import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
10
+ import { An as checkEasAuth, At as ensureRemoteBootOwned, Bt as RELEASE_VERIFY_WAIT_MS, Cn as gateMetroOrigin, Dt as bundleEntryPoint, Gt as unattributedLaunchLines, Ht as isBundleProof, It as LAUNCH_BUNDLING, Jt as verifyLaunch, Kt as unverifiedLaunchLines, Ln as resolveEasCliBin, Lt as LAUNCH_FATAL, Nn as loadProjectProvider, Nt as remoteIosDeps, Pt as resolveRemoteContext, Rn as resolveRemote, Rt as LAUNCH_UNVERIFIED, Sn as readRemoteSimulatorArch, Ut as readCollectorRecords, Wt as readMetroRecords, Yt as verifyReleaseLaunch, an as devClientUrl, c as budgetGate, dn as installIosApp, en as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, fn as iosAppProcess, gn as restartedAppNote, hn as launchIosApp, in as clearOtherUserApps, kt as ensureMetroReachable, zn as uploadRemote } from "./ccache-BWTze1Ls.mjs";
11
+ import { at as recordRunStats, rt as recordCapacityRefusal, tt as readRunEstimates, xt as releaseBuildSlot, yt as acquireBuildSlot } from "./workspaces-DFbj07jp.mjs";
12
+ import { B as readBundleExecutable, H as resolveScheme, O as runPodInstall, T as readPodState, V as readBundleId, w as podsAreStale } from "./toolchain-CbCG6C5Z.mjs";
13
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-Cd-ysFes.mjs";
14
+ import { A as untrackedNativeFiles, C as resolveBuild, c as evictBuild, m as fingerprintProject, w as storeBuild } from "./build-cache-gBJ-WKzA.mjs";
15
+ import { d as listAllIosSims, h as listIosRuntimesAsync, r as clearIosAppData } from "./ios-E26qSpkb.mjs";
16
+ import { n as readHostedIos, o as writeHostedIosAsync } from "./ios-state-BZ03NFgF.mjs";
17
+ import { n as hostedMetroPortProbe } from "./hosted-native-CdgaiuyP.mjs";
18
+ import { i as prepareHostedIos, r as placeHostedIos } from "./phone-reverses-C9yAaKEv.mjs";
19
+ import { n as verifyCollectorOwnership } from "./ownership-Bx-0cku-.mjs";
20
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-0l7RqSpr.mjs";
21
+ import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-DaK2IFyP.mjs";
22
+ import { c as startDevServer, g as detectBundleId } from "./start-DrPwER_2.mjs";
22
23
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
23
- import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-oNwqF5Wb.mjs";
24
- import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnAbort } from "./device-lease-run-BmvIl7bI.mjs";
25
- import { r as checkDeviceCapacity } from "./device-capacity-DCSvUF0l.mjs";
26
- import { n as clearIosAdoptionPending } from "./device-ios-BLGfXQeK.mjs";
27
- import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-CVOCp0Ft.mjs";
28
- import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-4c_qXvQm.mjs";
29
- import { a as resolveEasDevelopmentBuild } from "./eas-build-Dsj93iM9.mjs";
30
- import { a as printNativeCrashReport, n as IOS_CRASH_REPORT_RETRY, o as simulatorConsolePaths, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BOOm9Db7.mjs";
31
- import { t as followHostedLaunchLogs } from "./hosted-logs-sync-B0pvmOk-.mjs";
32
- import { a as runPrebuild, d as memoizedFingerprint, n as planPrebuildAsync } from "./prebuild-gmouvmJZ.mjs";
33
- import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-Dq3RBcON.mjs";
34
- import { n as devClientTakesDevMenuParams, r as hasDevClient, t as devClientScheme } from "./dev-client-DXR_tPVY.mjs";
35
- import { n as automaticDevicePlacement, t as checkEasFallback } from "./eas-fallback-FwkeqqGi.mjs";
36
- import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-BK-zwyd_.mjs";
37
- import { t as selectFromPool } from "./device-pool-Dluix4H3.mjs";
38
- import { o as reportIosResult } from "./ios-project-Ty5pHl9O.mjs";
39
- import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-CsyryvpT.mjs";
40
- import { i as swapJsBundle } from "./js-swap-BMhXYVDS.mjs";
24
+ import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnAbort } from "./device-lease-run-DwsGfjUN.mjs";
25
+ import { r as checkDeviceCapacity } from "./device-capacity-6LP7QsaA.mjs";
26
+ import { n as clearIosAdoptionPending } from "./device-ios-534c14fz.mjs";
27
+ import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-Be0UeVZU.mjs";
28
+ import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-BJzvDPfU.mjs";
29
+ import { a as resolveEasDevelopmentBuild } from "./eas-build-CjNSWmjo.mjs";
30
+ import { a as captureNativeCrashes, c as simulatorConsolePaths, i as bundleBindFailure, n as IOS_CRASH_REPORT_RETRY, s as printNativeCrashReport, t as errorDiagnostics } from "./error-diagnostics-snej9k4j.mjs";
31
+ import { t as followHostedLaunchLogs } from "./hosted-logs-sync-Dg3qrZmV.mjs";
32
+ import { a as runPrebuild, d as memoizedFingerprint, n as planPrebuildAsync } from "./prebuild-BDpToDgR.mjs";
33
+ import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-DqaIBO5w.mjs";
34
+ import { n as devClientTakesDevMenuParams, r as hasDevClient, t as devClientScheme } from "./dev-client-BMca82xo.mjs";
35
+ import { t as automaticDevicePlacement } from "./auto-placement-z-H5pJza.mjs";
36
+ import { t as checkEasFallback } from "./eas-fallback-9fqb46kW.mjs";
37
+ import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-tM41-TUq.mjs";
38
+ import { t as selectFromPool } from "./device-pool-BnQqvs6o.mjs";
39
+ import { s as reportIosResult } from "./ios-project-D8Jcy_br.mjs";
40
+ import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-C_QkIf1Z.mjs";
41
+ import { i as swapJsBundle } from "./js-swap-Dg2a945i.mjs";
41
42
  import { mkdirSync, openSync, writeFileSync } from "node:fs";
42
43
  import { networkInterfaces } from "node:os";
43
44
  import { basename, join } from "node:path";
@@ -231,7 +232,8 @@ async function verifyIosMetroRun({ operation, root, slot, appPath, d, launched,
231
232
  return running.state === "unknown" ? null : running.state === "running";
232
233
  };
233
234
  const siblings = metroCheck ? await siblingPlatformSlots(root, "ios", slot) : [];
234
- const verification = metroCheck ? await d.verifyLaunch({
235
+ const verification = metroCheck ? await withDrainingCancellation(operation, operation?.signal, () => d.verifyLaunch({
236
+ signal: operation?.signal,
235
237
  requireBundleResponse: true,
236
238
  slot: launchSlotScope(root, slot),
237
239
  appPid: physical || remoteDevice ? null : launched?.pid,
@@ -251,7 +253,7 @@ async function verifyIosMetroRun({ operation, root, slot, appPath, d, launched,
251
253
  const running = await iosAppProcess(udid, bundleId);
252
254
  return running.state === "unknown" ? null : running.state === "running";
253
255
  }
254
- }) : {
256
+ })) : {
255
257
  verified: false,
256
258
  skipped: true
257
259
  };
@@ -395,6 +397,27 @@ async function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }
395
397
  for (const failure of swept.failed) note(chalk.yellow(phaseLine("install", `could not remove ${failure}, left by the previous workspace`)));
396
398
  return `Could not remove ${swept.failed.join(", ")}, left by the previous workspace.`;
397
399
  }
400
+ async function evictUnbindableCacheHit({ d, root, slot, udid, bundleId, appPath, launchedAt, logsDir, cacheHit, providerName, storeKey, runCommand, local, logFields, operation }) {
401
+ if (!cacheHit || !storeKey || !bundleId || !local) return null;
402
+ const symbol = (await captureNativeCrashes({
403
+ root,
404
+ slot,
405
+ platform: "ios",
406
+ deviceId: udid,
407
+ appId: bundleId,
408
+ since: launchedAt,
409
+ appPath
410
+ }, logsDir, operation?.signal, operation?.env)).map(bundleBindFailure).find(Boolean);
411
+ if (!symbol || !await d.evictBuild("ios", storeKey)) return null;
412
+ const provider = cacheHit === "remote" || Boolean(providerName);
413
+ return {
414
+ code: "STIM_LAUNCH_FAILED",
415
+ message: `The cached app cannot start: dyld could not bind ${symbol} between two parts of the app itself.`,
416
+ remedy: `Stim removed the cache entry ${storeKey}${provider ? ", but the cache provider may still hold its copy" : ""}. Run \`${runCommand}\`${provider ? " with `--no-build-cache`" : ""} again to build the app fresh. If the fresh app crashes the same way, the project's own native code is the cause.`,
417
+ logPath: logsDir,
418
+ build: logFields
419
+ };
420
+ }
398
421
  function installMayBeProven(adopting, parkedCacheKey, storeKey) {
399
422
  return !adopting || !parkedCacheKey || parkedCacheKey === storeKey;
400
423
  }
@@ -425,8 +448,9 @@ async function recordIosReloadTarget({ d, root, physical, remoteDevice, bundleId
425
448
  function installFailureRemedy(remoteDevice) {
426
449
  return remoteDevice?.failureRemedy() ?? "Check that the simulator is booted and that the app was built for the simulator SDK.";
427
450
  }
428
- function launchFailureRemedy(remoteDevice, udid, bundleId, logFile) {
451
+ function launchFailureRemedy(remoteDevice, udid, bundleId, logFile, reason) {
429
452
  if (remoteDevice) return remoteDevice.failureRemedy();
453
+ if (reason && /system shell .*probably crashed/.test(reason)) return `SpringBoard, the simulator's system shell, is not running, and only a reboot brings it back. Run \`stim stop\`, then \`stim ios\` again. Repeated crashes leave SpringBoard reports in ~/Library/Logs/DiagnosticReports.`;
430
454
  return `If the simulator timed out, run \`stim doctor --platform ios\` and resolve any reported host memory pressure before retrying. Otherwise run \`xcrun simctl launch --terminate-running-process --console ${udid} ${bundleId}\` to see what the app reports, and check ${logFile}.`;
431
455
  }
432
456
  async function finishIosRun({ operation, output, projectBundleId, runtime, runtimePreparation, devicePlacement, artifact, d, root, slot, json, release, configuration, buildScheme, isExpo, metroCheck, metroPort, logsDir, logFile, device, udid, physical, wireless, lanAddress, lanOriginUrl, remoteDevice, bootPromise, bootDuration, bootPending, fail, phase, note, logWriter, elapsed, startedAt, closeWriter, lease, releaseLease, recordRun, reclaimed, devServer, enterPhase, enterActivity }) {
@@ -488,6 +512,27 @@ async function finishIosRun({ operation, output, projectBundleId, runtime, runti
488
512
  let installSkipped = false;
489
513
  let launched;
490
514
  let launchedAt = d.now();
515
+ const evictUnbound = () => evictUnbindableCacheHit({
516
+ d,
517
+ root,
518
+ slot,
519
+ udid,
520
+ bundleId,
521
+ appPath,
522
+ launchedAt,
523
+ logsDir,
524
+ cacheHit,
525
+ providerName,
526
+ storeKey,
527
+ runCommand,
528
+ local: !physical && !remoteDevice,
529
+ logFields: {
530
+ ...buildFailure,
531
+ appPath,
532
+ bundleId
533
+ },
534
+ operation
535
+ });
491
536
  if (physical) {
492
537
  const overWifi = await installsOverWifi(d, udid, wireless, note);
493
538
  const bounds = iosDeviceBounds(overWifi);
@@ -715,10 +760,12 @@ async function finishIosRun({ operation, output, projectBundleId, runtime, runti
715
760
  since: launchedAt,
716
761
  appPath
717
762
  }, logsDir, (line) => note(chalk.red(phaseLine("launch", line))), Boolean(remoteDevice), operation?.signal, operation?.env);
763
+ const evicted = await evictUnbound();
764
+ if (evicted) return fail(evicted);
718
765
  return fail({
719
766
  code: launched.code || "STIM_LAUNCH_FAILED",
720
767
  message: launched.reason,
721
- remedy: launchFailureRemedy(remoteDevice, udid, bundleId, logFile),
768
+ remedy: launchFailureRemedy(remoteDevice, udid, bundleId, logFile, launched.reason),
722
769
  build: {
723
770
  ...buildFailure,
724
771
  appPath,
@@ -781,25 +828,25 @@ async function finishIosRun({ operation, output, projectBundleId, runtime, runti
781
828
  metroOrigin: typeof launched?.jsLocation === "string" ? launched.jsLocation : null,
782
829
  enterActivity
783
830
  });
784
- if (launchState === "fatal") return fail({
785
- code: "STIM_LAUNCH_FAILED",
786
- message: "The app failed its launch readiness check.",
787
- remedy: `Read the launch error above or run \`stim logs --errors\`. The full timeline is in ${logsDir}.`,
788
- logPath: logsDir,
789
- build: {
790
- ...buildFailure,
791
- appPath,
792
- bundleId
793
- }
794
- });
795
- logWriter().write(runtime.kind === "process" ? {
796
- src: "build",
797
- level: launchState === "unverified" ? "warn" : "info",
798
- event: launchState === "unverified" ? "launch_unverified" : "launch_verified",
799
- msg: launchState === "unverified" ? `${bundleId} could not be verified as running` : `${bundleId} is running its native process`
800
- } : launchOutcomeRecord({
831
+ if (launchState === "fatal") {
832
+ const evicted = await evictUnbound();
833
+ if (evicted) return fail(evicted);
834
+ return fail({
835
+ code: "STIM_LAUNCH_FAILED",
836
+ message: "The app failed its launch readiness check.",
837
+ remedy: `Read the launch error above or run \`stim logs --errors\`. The full timeline is in ${logsDir}.`,
838
+ logPath: logsDir,
839
+ build: {
840
+ ...buildFailure,
841
+ appPath,
842
+ bundleId
843
+ }
844
+ });
845
+ }
846
+ logWriter().write(launchOutcomeRecord({
801
847
  launchState,
802
848
  release: runtime.kind === "embedded-js",
849
+ process: runtime.kind === "process",
803
850
  bundleId,
804
851
  configuration,
805
852
  metroPort,
@@ -1017,6 +1064,7 @@ const DEFAULT_DEPS = {
1017
1064
  fingerprintProject,
1018
1065
  memoizedFingerprint,
1019
1066
  untrackedNativeFiles,
1067
+ evictBuild,
1020
1068
  resolveBuild,
1021
1069
  storeBuild,
1022
1070
  resolveCacheProviderConfig,
@@ -1,9 +1,10 @@
1
- import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { Nt as repoRoot } from "./settings-CosW5X-S.mjs";
1
+ import { t as getExecutor } from "./exec-aULwtNly.mjs";
2
+ import { It as repoRoot } from "./settings-BDVI8Ivc.mjs";
3
+ import { createHash, randomUUID } from "node:crypto";
3
4
  import { existsSync } from "node:fs";
4
5
  import { dirname, join, relative } from "node:path";
5
6
  //#region src/dependency-state.ts
6
- function installedNpmTreeIsValid(projectRoot) {
7
+ function installedNpmTreeProblems(projectRoot) {
7
8
  try {
8
9
  getExecutor().runFile("npm", [
9
10
  "ls",
@@ -14,9 +15,15 @@ function installedNpmTreeIsValid(projectRoot) {
14
15
  cwd: projectRoot,
15
16
  timeoutMs: 3e4
16
17
  });
17
- return true;
18
- } catch {
19
- return false;
18
+ return "";
19
+ } catch (error) {
20
+ const stdout = error instanceof Error && "stdout" in error ? error.stdout : "";
21
+ let problems;
22
+ try {
23
+ problems = JSON.parse(String(stdout ?? ""))?.problems;
24
+ } catch {}
25
+ if (!Array.isArray(problems)) return randomUUID();
26
+ return createHash("sha256").update(problems.map(String).toSorted().join("\n")).digest("hex");
20
27
  }
21
28
  }
22
29
  async function installedNpmTreeIsValidAsync(projectRoot) {
@@ -88,4 +95,4 @@ function hasInstalledDependencies(projectRoot, markers = [
88
95
  return markers.some((entry) => existsSync(join(projectRoot, entry)));
89
96
  }
90
97
  //#endregion
91
- export { installedNpmTreeIsValidAsync as i, hasInstalledDependencies as n, installedNpmTreeIsValid as r, dependencyState as t };
98
+ export { installedNpmTreeProblems as i, hasInstalledDependencies as n, installedNpmTreeIsValidAsync as r, dependencyState as t };
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
1
+ import { t as getExecutor } from "./exec-aULwtNly.mjs";
2
2
  import { openSync } from "node:fs";
3
3
  //#region src/detached-entry.ts
4
4
  const LOG_FILE_FLAG = "--log-file";
@@ -1,5 +1,5 @@
1
- import { C as resolvePackageJson, b as isPackageResolvable } from "./project-BUu6Is4k.mjs";
2
- import { In as pickDevClientScheme, Ln as readBundleSchemes } from "./budget-k2mZGvvk.mjs";
1
+ import { C as resolvePackageJson, b as isPackageResolvable } from "./project-DYj-HVx6.mjs";
2
+ import { bn as readBundleSchemes, yn as pickDevClientScheme } from "./ccache-BWTze1Ls.mjs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { isJsonObject, readJsonObject } from "@stim-cli/core/state";
5
5
  //#region src/commands/dev-client.ts
@@ -1,20 +1,20 @@
1
- import { b as operationState, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-BktkY_zC.mjs";
1
+ import { b as operationState, t as getExecutor } from "./exec-aULwtNly.mjs";
2
+ import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-Cn94Jc0g.mjs";
3
3
  import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
4
- import { r as clockTime } from "./command-output-BF5AR2dL.mjs";
5
- import { J as resolveProjectSettings, Ut as makeTemporaryDirectory, Wt as removeTemporaryEntry, nt as settingValueAt, q as resolveIosProjectDir } from "./settings-CosW5X-S.mjs";
6
- import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-BUu6Is4k.mjs";
7
- import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-DTAcRwBC.mjs";
8
- import { Un as runProcessOperation } from "./budget-k2mZGvvk.mjs";
9
- import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-Lnb_EoRY.mjs";
10
- import { H as resolveScheme, K as xcodebuildArgs } from "./toolchain-J4J8MrAr.mjs";
11
- import { a as discoverXcodeProject } from "./react-native-build-oNwqF5Wb.mjs";
12
- import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-BmvIl7bI.mjs";
13
- import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-CVOCp0Ft.mjs";
14
- import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-4c_qXvQm.mjs";
15
- import { t as selectFromPool } from "./device-pool-Dluix4H3.mjs";
16
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-CsyryvpT.mjs";
17
- import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-BW7H8JGu.mjs";
4
+ import { r as clockTime } from "./command-output-Dj-WT4BP.mjs";
5
+ import { $t as makeTemporaryDirectory, X as resolveProjectSettings, Y as resolveIosProjectDir, en as removeTemporaryEntry, it as settingValueAt } from "./settings-BDVI8Ivc.mjs";
6
+ import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-DYj-HVx6.mjs";
7
+ import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-DriNoAVy.mjs";
8
+ import { En as runProcessOperation } from "./ccache-BWTze1Ls.mjs";
9
+ import { H as resolveScheme, K as xcodebuildArgs } from "./toolchain-CbCG6C5Z.mjs";
10
+ import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-Cd-ysFes.mjs";
11
+ import { a as discoverXcodeProject } from "./react-native-build-DaK2IFyP.mjs";
12
+ import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-DwsGfjUN.mjs";
13
+ import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-Be0UeVZU.mjs";
14
+ import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-BJzvDPfU.mjs";
15
+ import { t as selectFromPool } from "./device-pool-BnQqvs6o.mjs";
16
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-C_QkIf1Z.mjs";
17
+ import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-B1W8SrxB.mjs";
18
18
  import { existsSync, readdirSync, realpathSync, statSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
20
  import { join } from "node:path";
@@ -1,18 +1,61 @@
1
- import { D as ownership_claim_exports, d as workspaceProcessLockError, u as withWorkspaceProcessLock } from "./exec-VFRpu1iA.mjs";
2
- import { G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-BktkY_zC.mjs";
3
- import { a as formatElapsed, l as phaseLine } from "./command-output-BF5AR2dL.mjs";
4
- import { g as deviceReclaimIdleMinutesSetting } from "./settings-CosW5X-S.mjs";
5
- import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-DTAcRwBC.mjs";
6
- import { $ as recordCapacityWait, Q as recordCapacityRefusal } from "./budget-k2mZGvvk.mjs";
1
+ import { D as ownership_claim_exports, d as workspaceProcessLockError, u as withWorkspaceProcessLock } from "./exec-aULwtNly.mjs";
2
+ import { G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-Cn94Jc0g.mjs";
3
+ import { a as formatElapsed, l as phaseLine } from "./command-output-Dj-WT4BP.mjs";
4
+ import { g as deviceReclaimIdleMinutesSetting } from "./settings-BDVI8Ivc.mjs";
5
+ import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-DriNoAVy.mjs";
6
+ import { _ as withIdleWorkspace, it as recordCapacityWait, rt as recordCapacityRefusal } from "./workspaces-DFbj07jp.mjs";
7
7
  import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
8
- import { p as withIdleWorkspace } from "./workspaces-g2lhdBXF.mjs";
9
- import { d as listAllIosSims, f as listAllIosSimsAsync, l as iosRuntimeMatches, y as parseRuntimeVersion } from "./ios-WxpDJ5T1.mjs";
10
- import { i as writeIdleShutdownEvent, n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-FfxL1KdG.mjs";
8
+ import { d as listAllIosSims, f as listAllIosSimsAsync, l as iosRuntimeMatches, y as parseRuntimeVersion } from "./ios-E26qSpkb.mjs";
9
+ import { i as writeIdleShutdownEvent, n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-Cbvo5KEh.mjs";
11
10
  import { realpathSync } from "node:fs";
12
11
  import { basename, join } from "node:path";
13
12
  import { workspaceId } from "@stim-cli/core";
14
13
  import { DEVICE_RECLAIM_REASON, automaticMachineEnabled } from "@stim-cli/core/state";
15
14
  import { setTimeout } from "node:timers/promises";
15
+ //#region src/workspace/display-label.ts
16
+ function baseLabel({ root, label }) {
17
+ return label || basename(root);
18
+ }
19
+ function pathSegments(root) {
20
+ return root.split(/[\\/]+/).filter(Boolean).toReversed();
21
+ }
22
+ function workspaceLabels(workspaces) {
23
+ const labels = /* @__PURE__ */ new Map();
24
+ const groups = /* @__PURE__ */ new Map();
25
+ for (const workspace of workspaces) {
26
+ const base = baseLabel(workspace);
27
+ const group = groups.get(base) ?? [];
28
+ if (!group.some(({ root }) => root === workspace.root)) group.push(workspace);
29
+ groups.set(base, group);
30
+ }
31
+ for (const [base, group] of groups) {
32
+ const [only] = group;
33
+ if (group.length === 1 && only) {
34
+ labels.set(only.root, base);
35
+ continue;
36
+ }
37
+ const segments = group.map(({ root }) => pathSegments(root));
38
+ const longest = Math.max(...segments.map((parts) => parts.length));
39
+ let depth = 0;
40
+ while (depth < longest && segments.every((parts) => parts[depth] === segments[0]?.[depth])) depth++;
41
+ const suffixes = segments.map((parts) => parts[depth]);
42
+ const distinct = new Set(suffixes).size === group.length;
43
+ group.forEach(({ root }, index) => {
44
+ const suffix = distinct ? suffixes[index] : root;
45
+ labels.set(root, suffix ? `${base} (${suffix})` : base);
46
+ });
47
+ }
48
+ return labels;
49
+ }
50
+ function workspaceDisplayLabel(root, config) {
51
+ const registered = Object.entries(config?.projects ?? {}).map(([path, project]) => ({
52
+ root: path,
53
+ label: project.label
54
+ }));
55
+ const own = registered.find((entry) => entry.root === root);
56
+ return workspaceLabels([...registered, own ?? { root }]).get(root) ?? basename(root);
57
+ }
58
+ //#endregion
16
59
  //#region src/devices/queue-reclaim.ts
17
60
  async function reclaimIdleDevice(root, idleMs, out, now, skipped) {
18
61
  try {
@@ -26,7 +69,7 @@ async function reclaimIdleDevice(root, idleMs, out, now, skipped) {
26
69
  }).toSorted((a, b) => b.idleForMs - a.idleForMs).find(({ device }) => !skipped.has(`${device.kind}:${device.id}`));
27
70
  if (!candidate) return 0;
28
71
  const { device, idleForMs } = candidate;
29
- const label = loadConfig$1()?.projects[device.project]?.label || basename(device.project);
72
+ const label = workspaceDisplayLabel(device.project, loadConfig$1());
30
73
  const log = (event) => {
31
74
  writeIdleShutdownEvent(device.project, event);
32
75
  if (event.level === "warn") out(`${"device".padEnd(11)} ${event.msg}`);
@@ -167,6 +210,31 @@ function listed(source, empty, absent = () => false) {
167
210
  throw new DeviceCountUnavailable("", { cause: error });
168
211
  }
169
212
  }
213
+ async function listedAwait(read, empty, absent = () => false) {
214
+ try {
215
+ return await read() ?? empty;
216
+ } catch (error) {
217
+ if (absent(error)) return empty;
218
+ throw new DeviceCountUnavailable("", { cause: error });
219
+ }
220
+ }
221
+ async function readInventoryAsync({ sims = () => process.platform === "darwin" ? listAllIosSimsAsync({ timeoutMs: LISTING_TIMEOUT_MS }) : [], adb = () => listAdbDevicesAsync({ timeoutMs: LISTING_TIMEOUT_MS }), config = loadConfig$1, booting = readBootingDevices }) {
222
+ try {
223
+ const recorded = await listedAwait(() => typeof config === "function" ? config() : config, null);
224
+ return {
225
+ booting: await listedAwait(() => typeof booting === "function" ? booting() : booting, []),
226
+ sims: await listedAwait(() => typeof sims === "function" ? sims() : sims, [], toolAbsent),
227
+ adb: recordsOwnedEmulator(recorded) ? await listedAwait(() => typeof adb === "function" ? adb() : adb, NO_ADB, toolAbsent) : NO_ADB,
228
+ config: recorded
229
+ };
230
+ } catch (error) {
231
+ if (error instanceof DeviceCountUnavailable) {
232
+ if ((0, ownership_claim_exports.isClaimRefusal)(error.cause)) throw error.cause;
233
+ return uncountedRefusal(error.cause);
234
+ }
235
+ throw error;
236
+ }
237
+ }
170
238
  function readInventory({ sims = listSimsForCount, adb = listAdbForCount, config = loadConfig$1, booting = readBootingDevices }) {
171
239
  try {
172
240
  const recorded = listed(config, null);
@@ -205,6 +273,15 @@ async function listedAsync(source, empty) {
205
273
  throw new DeviceCountUnavailable("", { cause: error });
206
274
  }
207
275
  }
276
+ async function countLiveOwnedDevicesFrom(sources, { exclude = [] } = {}) {
277
+ try {
278
+ const inventory = await readInventoryAsync(sources);
279
+ return "code" in inventory ? { unknown: inventory.message } : inventoryKeys(inventory, exclude).size;
280
+ } catch (error) {
281
+ if ((0, ownership_claim_exports.isClaimRefusal)(error)) return { unknown: error.message };
282
+ throw error;
283
+ }
284
+ }
208
285
  async function countLiveOwnedDevicesAsync(operation) {
209
286
  try {
210
287
  operation.signal.throwIfAborted();
@@ -310,9 +387,17 @@ function deviceSlotWaitingLine({ count, max, holders, elapsedMs, queue }) {
310
387
  }
311
388
  function deviceHolders(inventory, keys) {
312
389
  const names = /* @__PURE__ */ new Map();
313
- for (const [root, project] of Object.entries(inventory.config?.projects ?? {})) for (const { platforms } of projectDeviceSlots(project)) {
314
- if (platforms.ios?.deviceUdid) names.set(deviceKey("ios", platforms.ios.deviceUdid), project.label || basename(root));
315
- if (platforms.android?.avdName) names.set(deviceKey("android", platforms.android.avdName), project.label || basename(root));
390
+ const projects = Object.entries(inventory.config?.projects ?? {});
391
+ const labels = workspaceLabels(projects.map(([root, project]) => ({
392
+ root,
393
+ label: project.label
394
+ })));
395
+ for (const [root, project] of projects) {
396
+ const label = labels.get(root) ?? basename(root);
397
+ for (const { platforms } of projectDeviceSlots(project)) {
398
+ if (platforms.ios?.deviceUdid) names.set(deviceKey("ios", platforms.ios.deviceUdid), label);
399
+ if (platforms.android?.avdName) names.set(deviceKey("android", platforms.android.avdName), label);
400
+ }
316
401
  }
317
402
  for (const sim of inventory.sims) {
318
403
  const key = deviceKey("ios", sim.udid);
@@ -394,7 +479,7 @@ async function admissionTransaction(action, lockWaitMs, out, signal) {
394
479
  }
395
480
  }
396
481
  /** Boots an owned device under the Stim home's cap, reserving capacity before releasing admission. */
397
- async function withDeviceBootAdmission(device, boot, { root, max = getConcurrencyLimits().maxDevices, sources = {}, lockWaitMs = ADMISSION_LOCK_WAIT_MS, out = () => {}, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, noWait = false, automatic = false, displayName = basename(root), reclaimIdleMinutes = deviceReclaimIdleMinutesSetting({}), now = Date.now, signal, sleep = (ms) => setTimeout(ms, void 0, { signal }), waitingFor = () => {}, onWait = () => {} }) {
482
+ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrencyLimits().maxDevices, sources = {}, lockWaitMs = ADMISSION_LOCK_WAIT_MS, out = () => {}, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, noWait = false, automatic = false, displayName = workspaceDisplayLabel(root, loadConfig$1()), reclaimIdleMinutes = deviceReclaimIdleMinutesSetting({}), now = Date.now, signal, sleep = (ms) => setTimeout(ms, void 0, { signal }), waitingFor = () => {}, onWait = () => {} }) {
398
483
  const requireMembership = () => {
399
484
  if (automatic && !automaticMachineEnabled("device", "local")) throw new DeviceAdmissionRefusal({
400
485
  code: "STIM_HOSTING_REFUSED",
@@ -466,7 +551,7 @@ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrenc
466
551
  if ((typeof booting === "function" ? booting() : booting).some((entry) => deviceKey(entry.platform, entry.key) === own)) return admit();
467
552
  return wait(lastInventory);
468
553
  }
469
- const inventory = readInventory(sources);
554
+ const inventory = await readInventoryAsync(sources);
470
555
  if ("code" in inventory) throw new DeviceAdmissionRefusal(inventory);
471
556
  const keys = inventoryKeys(inventory);
472
557
  const own = deviceKey(device.platform, device.key);
@@ -612,4 +697,4 @@ function unknownAndroidDeviceProfileRefusal(requested, profiles) {
612
697
  };
613
698
  }
614
699
  //#endregion
615
- export { countLiveOwnedDevicesAsync as a, peekDeviceSlots as c, unknownAndroidSystemImageRefusal as d, unknownIosDeviceTypeRefusal as f, countLiveOwnedDevices as i, runtimeMismatch as l, withDeviceBootAdmission as m, DeviceAdmissionRefusal as n, deviceTypeMismatch as o, unknownIosRuntimeRefusal as p, checkDeviceCapacity as r, layerNote as s, DEFAULT_DEVICE_SLOT_WAIT_MS as t, unknownAndroidDeviceProfileRefusal as u };
700
+ export { countLiveOwnedDevicesAsync as a, layerNote as c, unknownAndroidDeviceProfileRefusal as d, unknownAndroidSystemImageRefusal as f, withDeviceBootAdmission as h, countLiveOwnedDevices as i, peekDeviceSlots as l, unknownIosRuntimeRefusal as m, DeviceAdmissionRefusal as n, countLiveOwnedDevicesFrom as o, unknownIosDeviceTypeRefusal as p, checkDeviceCapacity as r, deviceTypeMismatch as s, DEFAULT_DEVICE_SLOT_WAIT_MS as t, runtimeMismatch as u };
@@ -1,19 +1,19 @@
1
- import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { _ as ensureWorkspaceStorage, d as writeWorkspaceState } from "./workspace-state-pUg3_RRA.mjs";
3
- import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-BktkY_zC.mjs";
4
- import { i as macosProcess, o as requiredMacosRecord } from "./state-C4OdpOTF.mjs";
5
- import { A as listAdbDevices, Ct as forgetCreatedDeviceAsync, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, ct as waitForBoot, d as androidToolPath, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, nt as resolveOwnedAvdSerialAsync, t as DEFAULT_AVD_DEVICE_PROFILE, tt as resetAdoptedAvd, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-DTAcRwBC.mjs";
6
- import { a as parsePidof, i as parseLogcatLine, t as androidClockOffset } from "./android-B5P81yI-.mjs";
7
- import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
8
- import { An as launchAndroidApp, En as installAndroidApp, Fn as writeDebugHttpHost, Mn as launchIosApp, On as installIosApp, Pn as reverseMetroPorts, jn as launchAndroidReleaseApp, kn as iosAppProcess, vn as androidAppProcess } from "./budget-k2mZGvvk.mjs";
9
- import { A as teardownOwnedIosSim, O as teardownOwnedAvd } from "./workspaces-g2lhdBXF.mjs";
10
- import { A as uninstallIosApp, E as resolveIosCreation, L as readHostMemoryPressure, T as resetIosPrivacy, a as createOwnedIosSim, d as listAllIosSims, g as listUserApps, n as bootIosSim, w as resetIosKeychain } from "./ios-WxpDJ5T1.mjs";
11
- import { r as stopMacosAppHeld } from "./stop-ySNQHXMG.mjs";
1
+ import { t as getExecutor } from "./exec-aULwtNly.mjs";
2
+ import { _ as ensureWorkspaceStorage, d as writeWorkspaceState } from "./workspace-state-BjqdjnJR.mjs";
3
+ import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-Cn94Jc0g.mjs";
4
+ import { i as macosProcess, o as requiredMacosRecord } from "./state-CZxLyetD.mjs";
5
+ import { A as listAdbDevices, Ct as forgetCreatedDeviceAsync, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, ct as waitForBoot, d as androidToolPath, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, nt as resolveOwnedAvdSerialAsync, t as DEFAULT_AVD_DEVICE_PROFILE, tt as resetAdoptedAvd, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-DriNoAVy.mjs";
6
+ import { a as parsePidof, i as parseLogcatLine, t as androidClockOffset } from "./android-Deb9X3_Y.mjs";
7
+ import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
8
+ import { _n as reverseMetroPorts, dn as installIosApp, fn as iosAppProcess, hn as launchIosApp, ln as installAndroidApp, mn as launchAndroidReleaseApp, pn as launchAndroidApp, tn as androidAppProcess, vn as writeDebugHttpHost } from "./ccache-BWTze1Ls.mjs";
9
+ import { ft as teardownOwnedIosSim, ut as teardownOwnedAvd } from "./workspaces-DFbj07jp.mjs";
10
+ import { E as resolveIosCreation, R as readHostMemoryPressure, T as resetIosPrivacy, a as createOwnedIosSim, d as listAllIosSims, g as listUserApps, j as uninstallIosApp, n as bootIosSim, w as resetIosKeychain } from "./ios-E26qSpkb.mjs";
11
+ import { r as stopMacosAppHeld } from "./stop-CH79S3IZ.mjs";
12
12
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
13
- import { i as countLiveOwnedDevices } from "./device-capacity-DCSvUF0l.mjs";
14
- import { _ as findAapt } from "./support-BGSCBoib.mjs";
15
- import { t as waitForMacosRegistration } from "./registration-CN6nlhcD.mjs";
16
- import { n as parseLogStreamLine } from "./ios-ENC4sRPA.mjs";
13
+ import { i as countLiveOwnedDevices } from "./device-capacity-6LP7QsaA.mjs";
14
+ import { _ as findAapt } from "./support-CNg_YsOk.mjs";
15
+ import { t as waitForMacosRegistration } from "./registration-BwCe64PH.mjs";
16
+ import { n as parseLogStreamLine } from "./ios-CsRVik64.mjs";
17
17
  import { createHash, randomUUID } from "node:crypto";
18
18
  import { chmodSync, closeSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statfsSync, symlinkSync, writeFileSync } from "node:fs";
19
19
  import { availableParallelism, freemem, homedir, loadavg } from "node:os";
@@ -232,7 +232,7 @@ function collectHostedNativeLogs({ home, platform, since, final, query, parse, t
232
232
  //#endregion
233
233
  //#region src/device-host/android-logs.ts
234
234
  /** Captures bounded logcat output from the installed app on this home's exact ledger-owned serial. */
235
- function collectHostedAndroidLogs(home, session, attempt, since, final = false) {
235
+ async function collectHostedAndroidLogs(home, session, attempt, since, final = false) {
236
236
  const deadline = Date.now() + 1e4;
237
237
  const device = readHostedDevice(home, "android");
238
238
  assertHostedAndroidSerial(home, device);
@@ -240,9 +240,9 @@ function collectHostedAndroidLogs(home, session, attempt, since, final = false)
240
240
  if (app.state !== "installed") return false;
241
241
  const exec = getExecutor();
242
242
  const adb = androidToolPath("adb");
243
- const clockOffsetMs = androidClockOffset(device.serial, { exec: {
243
+ const clockOffsetMs = await androidClockOffset(device.serial, { exec: {
244
244
  ...exec,
245
- runFile: (file, args, options) => exec.runFile(file === "adb" ? adb : file, args, options)
245
+ runFileAsync: (file, args, options) => exec.runFileAsync(file === "adb" ? adb : file, args, options)
246
246
  } }) ?? 0;
247
247
  const previous = readHostedNativeLogsCheckpoint(home, "android");
248
248
  let current = null;
@@ -1226,7 +1226,7 @@ async function main() {
1226
1226
  if (input.platform === "macos" && !hostedMacosAppSlot(input.appSlot)) throw new Error("Invalid hosted macOS app slot.");
1227
1227
  if (input.mode === "logs") {
1228
1228
  if (input.platform !== "ios" && input.platform !== "android" || !process.env.STIM_HOME || typeof input.since !== "number" || !Number.isFinite(input.since)) throw new Error("Invalid hosted native log request.");
1229
- const more = (input.platform === "android" ? collectHostedAndroidLogs : collectHostedIosLogs)(process.env.STIM_HOME, input.session, input.attempt, input.since, input.final === true);
1229
+ const more = await (input.platform === "android" ? collectHostedAndroidLogs : collectHostedIosLogs)(process.env.STIM_HOME, input.session, input.attempt, input.since, input.final === true);
1230
1230
  process.stdout.write(`${JSON.stringify({ more })}\n`);
1231
1231
  return;
1232
1232
  }