stim 1.26.0 → 1.28.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 (172) hide show
  1. package/dist/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-CKByBnTD.mjs} +2 -2
  2. package/dist/{act-C-BqJEpu.mjs → act-8iswyfRa.mjs} +319 -126
  3. package/dist/{activity-Lnb_EoRY.mjs → activity-DRMg4_mD.mjs} +6 -6
  4. package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-tE90fDdo.mjs} +5 -5
  5. package/dist/{android-CiNQw3kq.mjs → android-CHmSU4B4.mjs} +101 -45
  6. package/dist/{android-DTAcRwBC.mjs → android-CsPs-7Mg.mjs} +23 -18
  7. package/dist/{android-B5P81yI-.mjs → android-D577ApKG.mjs} +37 -15
  8. package/dist/{android-CSbLRD53.mjs → android-YWCbmkVK.mjs} +5 -5
  9. package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-_aDifWW0.mjs} +4 -4
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/api.d.mts +14 -4
  12. package/dist/api.mjs +39 -29
  13. package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-CQbwM0qO.mjs} +2 -2
  14. package/dist/{artifact-CsAP6AGK.mjs → artifact-DYtHjxsn.mjs} +19 -24
  15. package/dist/{artifact-BxREhAaV.mjs → artifact-bFkfD3vf.mjs} +18 -23
  16. package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
  17. package/dist/auto-placement-BVqs8AJi.mjs +350 -0
  18. package/dist/{browser-web-rYPyqhTf.mjs → browser-web-BUaLcafY.mjs} +16 -16
  19. package/dist/{build-DPhApsjV.mjs → build-cQURy_KW.mjs} +35 -31
  20. package/dist/{build-cache-DrXNCy3T.mjs → build-cache-CZULpXVl.mjs} +43 -21
  21. package/dist/{build-plan-DrMMdayj.mjs → build-plan-CxoYfxsc.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-Bm_A1xX9.mjs} +562 -1604
  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-CpbaLDa7.mjs} +24 -23
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-D9CaRks-.mjs → client-YxCer6ab.mjs} +84 -65
  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-C8R1KIvi.mjs} +1 -1
  33. package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
  34. package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-DKeMzwXY.mjs} +108 -60
  35. package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-CojA2o0t.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-D-BW5uiq.mjs} +2 -2
  38. package/dist/{device-BK-zwyd_.mjs → device-CgXfbcz5.mjs} +25 -24
  39. package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-Cd8lMSn3.mjs} +175 -22
  40. package/dist/{device-BcYeHSFu.mjs → device-eeK95Lir.mjs} +16 -16
  41. package/dist/device-host-worker.mjs +22 -20
  42. package/dist/{device-ios-BLGfXQeK.mjs → device-ios-Cc9ulihb.mjs} +251 -23
  43. package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-Mtzp4THX.mjs} +5 -5
  44. package/dist/{device-pool-Dluix4H3.mjs → device-pool-eRz6DtCg.mjs} +3 -3
  45. package/dist/{doctor-Bhg1ii70.mjs → doctor-Bz_ouYAW.mjs} +28 -16
  46. package/dist/{doctor-Cp-BhzTS.mjs → doctor-C2QyhejJ.mjs} +1 -1
  47. package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
  48. package/dist/doctor-fingerprint.mjs +1 -1
  49. package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-BTW82PDC.mjs} +5 -5
  50. package/dist/{doctor-OnwP94ne.mjs → doctor-xf7ht-5n.mjs} +76 -32
  51. package/dist/{eas-build-Dsj93iM9.mjs → eas-build-Dm6q68QY.mjs} +4 -4
  52. package/dist/eas-fallback-DajNpxf-.mjs +87 -0
  53. package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-CBFo_Uo1.mjs} +37 -8
  54. package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-D1QfyJzQ.mjs} +51 -25
  55. package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
  56. package/dist/{gc-ldgr-hXU.mjs → gc-DM5oMm-J.mjs} +161 -45
  57. package/dist/{gc-C_79zvz4.mjs → gc-PLFwb0k4.mjs} +2 -2
  58. package/dist/{guide-D7K0X6KG.mjs → guide-C4I46XAk.mjs} +674 -213
  59. package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-DlaKLbW0.mjs} +6 -7
  60. package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-DDRm9hPJ.mjs} +51 -20
  61. package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-bSebOKbz.mjs} +8 -8
  62. package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-B0c53W_c.mjs} +5 -5
  63. package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B7-8Pv4H.mjs} +6 -6
  64. package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CDe33CSr.mjs} +22 -18
  65. package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-CQ0QwU9J.mjs} +7 -8
  66. package/dist/{ios-WxpDJ5T1.mjs → ios-B1DYuOjh.mjs} +27 -11
  67. package/dist/{ios-B7-lToDu.mjs → ios-B1HvafEG.mjs} +8 -8
  68. package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
  69. package/dist/{ios-device-CsyryvpT.mjs → ios-device-B4elVFKi.mjs} +3 -3
  70. package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
  71. package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-CR4mZ7CH.mjs} +22 -9
  72. package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
  73. package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BPHqMDdZ.mjs} +1 -1
  74. package/dist/{ios-ftxdQbJS.mjs → ios-tg4tp3q1.mjs} +94 -37
  75. package/dist/{js-swap-BMhXYVDS.mjs → js-swap-CVpSW1fn.mjs} +8 -7
  76. package/dist/{launch-DOp8RjDz.mjs → launch-DoySmhjz.mjs} +42 -38
  77. package/dist/lightened-DFAJgfIk.mjs +171 -0
  78. package/dist/{logs-s1dRIG1E.mjs → logs-BGsW7iPe.mjs} +46 -21
  79. package/dist/{logs-dQDki6Tt.mjs → logs-DI5ILkYB.mjs} +7 -7
  80. package/dist/{macos-DBBPNnIA.mjs → macos-Bo9st9Di.mjs} +73 -38
  81. package/dist/{macos-B0VEV3Gf.mjs → macos-C12RMJQF.mjs} +1 -1
  82. package/dist/macos-run.mjs +1 -1
  83. package/dist/maintenance-run.mjs +7 -7
  84. package/dist/{metro-CjC10t6E.mjs → metro-BnhXV2Mj.mjs} +4 -4
  85. package/dist/{metro-gateway-B6_PgD0L.mjs → metro-request-DXyKjVDF.mjs} +26 -47
  86. package/dist/{named-ports-BG0j1X4g.mjs → named-ports-Phoi2POD.mjs} +3 -3
  87. package/dist/{native-android-CL2NGiik.mjs → native-android-vxgtLD7w.mjs} +17 -18
  88. package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-BN96IVw8.mjs} +5 -5
  89. package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DG4Rodzj.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-BKarCoKg.mjs} +3 -3
  92. package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-8A-efGa5.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-DJCq48IJ.mjs} +3 -3
  97. package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
  98. package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-BzTa8g1F.mjs} +18 -4
  99. package/dist/{placement-log-DIFPQAXp.mjs → placement-log-Cvhta5ib.mjs} +3 -3
  100. package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-WkZdccuN.mjs} +36 -10
  101. package/dist/{ports-C2_w1Z0Z.mjs → ports-UV4mJgyC.mjs} +3 -3
  102. package/dist/{prebuild-gmouvmJZ.mjs → prebuild-k8d_tqOq.mjs} +16 -17
  103. package/dist/{project-BUu6Is4k.mjs → project-Sui52ywT.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-DANlGGQf.mjs} +32 -26
  107. package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-jUHnIfZ9.mjs} +9 -9
  108. package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-DCWRjS7K.mjs} +6 -6
  109. package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-BwMsFMXi.mjs} +23 -17
  110. package/dist/{recordings-BldzVKq0.mjs → recordings-iy0mkm7b.mjs} +1 -1
  111. package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
  112. package/dist/{reload-C9OduiNc.mjs → reload-Bj7QyuDy.mjs} +1 -1
  113. package/dist/{reload-CCR7KC_l.mjs → reload-c_uEyc_X.mjs} +16 -16
  114. package/dist/{remote-C8S7FlPF.mjs → remote-DFlpAqdV.mjs} +23 -10
  115. package/dist/{result-7F5hEwQJ.mjs → result-BIcXREyC.mjs} +32 -21
  116. package/dist/{run-BqB0v3pt.mjs → run-y2HwyNvg.mjs} +3 -3
  117. package/dist/{selection-BNPBZ6T5.mjs → selection-CXgM_VK_.mjs} +37 -29
  118. package/dist/{server-bare-A75rDIdD.mjs → server-bare-2N4vSRZG.mjs} +2 -2
  119. package/dist/{server-command-CssKFOD7.mjs → server-command-qneHPcRI.mjs} +6 -6
  120. package/dist/{server-expo-eQfOdydb.mjs → server-expo-Ccm9zB0o.mjs} +4 -4
  121. package/dist/server-expo-WulkyAwT.mjs +2 -0
  122. package/dist/{settings-CosW5X-S.mjs → settings-CY5JZlNN.mjs} +375 -62
  123. package/dist/{settings-OaGQF-ri.mjs → settings-Cfd_Q6ys.mjs} +24 -3
  124. package/dist/settings-payload-DwQiEMCn.mjs +257 -0
  125. package/dist/settings-write-CJpjkeAd.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-BpmanOnk.mjs} +6 -6
  129. package/dist/{stage-jKQ7CP_B.mjs → stage-CmugrSG5.mjs} +2 -2
  130. package/dist/{start-C_wefNKB.mjs → start-CHH3zgIU.mjs} +1 -1
  131. package/dist/{start-_BdJ32cZ.mjs → start-DYLk6GXn.mjs} +27 -22
  132. package/dist/{state-C1i2nMOP.mjs → state-B2QJbDwz.mjs} +4 -4
  133. package/dist/{state-C4OdpOTF.mjs → state-BXC1Lfxw.mjs} +2 -2
  134. package/dist/{stats-tEpEEH-u.mjs → stats-DxKqhcGp.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-BHCkOZga.mjs} +51 -28
  138. package/dist/{status-B9M7x4CZ.mjs → status-D_Ljc89p.mjs} +1 -1
  139. package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BmsPqYSU.mjs} +18 -7
  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-DRqQVqDJ.mjs → stop-D-dGE9gh.mjs} +21 -20
  143. package/dist/{stop-ySNQHXMG.mjs → stop-DQvE-P76.mjs} +10 -6
  144. package/dist/{stop-CmdNhGlC.mjs → stop-b2pouxAO.mjs} +2 -2
  145. package/dist/supervisor-run.mjs +237 -63
  146. package/dist/{support-BGSCBoib.mjs → support-04IhBUTT.mjs} +6 -6
  147. package/dist/{support-CVOCp0Ft.mjs → support-BtlJKjyQ.mjs} +12 -11
  148. package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-Cj2UpmPN.mjs} +4 -4
  149. package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-BhF2stxY.mjs} +11 -12
  150. package/dist/{toolchain-J4J8MrAr.mjs → toolchain-mLA_km-b.mjs} +321 -15
  151. package/dist/{toolchain-DoavrvIA.mjs → toolchain-qktiV8xc.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-B0Vpuvpl.mjs} +731 -727
  155. package/dist/{web-Bihbf7-u.mjs → web-BYmK0TjL.mjs} +9 -9
  156. package/dist/web-CrVLVQZY.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-kIZrdlSg.mjs} +3 -3
  160. package/dist/{workspaces-g2lhdBXF.mjs → workspaces-CmOcceDN.mjs} +1879 -74
  161. package/dist/{worktree-BKuklFh_.mjs → worktree-2dk5edza.mjs} +933 -534
  162. package/dist/worktree-nliAoHxB.mjs +2 -0
  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
  172. package/dist/worktree-Bm4cb-nU.mjs +0 -2
@@ -1,39 +1,40 @@
1
- import { a as recordWorkspaceUseAsync, k as workspaceLogsDir$1 } from "./workspace-state-pUg3_RRA.mjs";
2
- import { B as deviceSlotFileKey, W as parseDeviceSlotOption, q as validateDeviceSlot } from "./config-BktkY_zC.mjs";
3
- import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-BF5AR2dL.mjs";
4
- import { C as iosSigningIdentitySha1Setting, M as metroPortSetting, P as metroWarmupUrlSetting, R as projectSettingsContextAsync, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, it as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting, z as publicUrlSetting } from "./settings-CosW5X-S.mjs";
5
- import { t as NO_PROJECT_REFUSAL } from "./project-BUu6Is4k.mjs";
6
- import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-DTAcRwBC.mjs";
7
- import { G as runFailureRecord, I as NO_BUILD_PROGRESS, J as thrownRunFailureRecord, K as startBuildProgress, Un as runProcessOperation, Ut as binOnPath, Vn as exitAfterFlush, Y as createRunRecorder, hn as DEFAULT_METRO_PORT, q as tapBuildLog, tt as statsProjectKey$1, ur as ownedSessionName } from "./budget-k2mZGvvk.mjs";
8
- import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-BfIDFKLH.mjs";
9
- import { i as createIosSimSnapshot } from "./ios-WxpDJ5T1.mjs";
1
+ import { a as recordWorkspaceUseAsync, k as workspaceLogsDir$1 } from "./workspace-state-kIZrdlSg.mjs";
2
+ import { B as deviceSlotFileKey, W as parseDeviceSlotOption, q as validateDeviceSlot } from "./config-Cn94Jc0g.mjs";
3
+ import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-C8R1KIvi.mjs";
4
+ import { B as publicUrlSetting, C as iosSigningIdentitySettingError, F as metroWarmupUrlSetting, N as metroPortSetting, S as iosSigningIdentitySetting, T as iosSigningIdentitySha1SettingError, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, ot as tunnelModeSetting, v as iosLanHostSetting, w as iosSigningIdentitySha1Setting, y as iosLanHostSettingError, z as projectSettingsContextAsync } from "./settings-CY5JZlNN.mjs";
5
+ import { t as NO_PROJECT_REFUSAL } from "./project-Sui52ywT.mjs";
6
+ import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-CsPs-7Mg.mjs";
7
+ import { En as runProcessOperation, Et as binOnPath, Qt as DEFAULT_METRO_PORT, qn as ownedSessionName, wn as exitAfterFlush } from "./ccache-Bm_A1xX9.mjs";
8
+ import { $ as tapBuildLog, H as NO_BUILD_PROGRESS, Q as startBuildProgress, Z as runFailureRecord, et as thrownRunFailureRecord, lt as statsProjectKey$1, rt as createRunRecorder } from "./workspaces-CmOcceDN.mjs";
9
+ import { Q as cancelledFailure, at as runCancellation, k as COMPILATION_CACHE_NOT_RUN, ot as runCancellationSignal, st as withNativeBuildRun } from "./toolchain-mLA_km-b.mjs";
10
+ import { i as createIosSimSnapshot } from "./ios-B1DYuOjh.mjs";
10
11
  import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
11
- import { k as COMPILATION_CACHE_NOT_RUN } from "./toolchain-J4J8MrAr.mjs";
12
- import { S as setRemoteLogSink, d as simulatorRuntime } from "./client-D9CaRks-.mjs";
13
- import { a as parseBuildMachineOption } from "./selection-BNPBZ6T5.mjs";
14
- import { r as hostedMetroSettings } from "./metro-gateway-B6_PgD0L.mjs";
15
- import { i as writeDevicePlacementAsync } from "./ios-state-Cw7-WQf2.mjs";
16
- import { t as devClientPortBusy } from "./hosted-native-CpDB3-PO.mjs";
17
- import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-BmvIl7bI.mjs";
18
- import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-CVOCp0Ft.mjs";
19
- import { r as isEasBuildFailure } from "./eas-build-Dsj93iM9.mjs";
20
- import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-Dq3RBcON.mjs";
21
- import "./dev-client-DXR_tPVY.mjs";
22
- import { t as didSetUpDevice } from "./device-BK-zwyd_.mjs";
12
+ import { S as setRemoteLogSink, d as simulatorRuntime } from "./client-YxCer6ab.mjs";
13
+ import { s as parseBuildMachineOption } from "./selection-CXgM_VK_.mjs";
14
+ import { r as hostedMetroSettings } from "./metro-request-DXyKjVDF.mjs";
15
+ import { i as writeDevicePlacementAsync } from "./ios-state-BPHqMDdZ.mjs";
16
+ import { t as devClientPortBusy } from "./hosted-native-CDe33CSr.mjs";
17
+ import { i as restoreLightenedDependencies, n as printLightenedFailure } from "./lightened-DFAJgfIk.mjs";
18
+ import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-Mtzp4THX.mjs";
19
+ import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-BtlJKjyQ.mjs";
20
+ import { r as isEasBuildFailure } from "./eas-build-Dm6q68QY.mjs";
21
+ import { i as launchOutcomeRecord, r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-DG4Rodzj.mjs";
22
+ import "./dev-client-D-BW5uiq.mjs";
23
+ import { t as didSetUpDevice } from "./device-CgXfbcz5.mjs";
23
24
  import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
24
- import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-DrMMdayj.mjs";
25
- import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-Ty5pHl9O.mjs";
26
- import { t as acquireIosArtifact } from "./artifact-CsAP6AGK.mjs";
27
- import { a as hostedIosSelectors, i as hostedIosMetroNote, n as connectIosTarget, o as iosPlacementBudget, r as deviceRemoteConflict, s as selectIosPlacement, t as connectIosBackend } from "./remote-C8S7FlPF.mjs";
28
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-CsyryvpT.mjs";
29
- import { i as lanOriginUrlFor, l as verifyIosMetroRun, n as chooseLanAddress, o as finishIosRun, t as DEFAULT_DEPS } from "./dependencies-Dw6wfQdv.mjs";
30
- import { basename, join } from "node:path";
25
+ import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-CxoYfxsc.mjs";
26
+ import { a as iosLedgerDevice, c as writeLastBuild, o as lastBuildRecord, s as reportIosResult } from "./ios-project-CR4mZ7CH.mjs";
27
+ import { t as acquireIosArtifact } from "./artifact-DYtHjxsn.mjs";
28
+ import { a as hostedIosSelectors, i as hostedIosMetroNote, n as connectIosTarget, o as iosPlacementBudget, r as deviceRemoteConflict, s as selectIosPlacement, t as connectIosBackend } from "./remote-DFlpAqdV.mjs";
29
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-B4elVFKi.mjs";
30
+ import { i as lanOriginUrlFor, l as verifyIosMetroRun, n as chooseLanAddress, o as finishIosRun, t as DEFAULT_DEPS } from "./dependencies-DKeMzwXY.mjs";
31
+ import { join } from "node:path";
31
32
  import { workspaceId } from "@stim-cli/core";
32
33
  import { hostedIosStatus, parseMachine } from "@stim-cli/core/state";
33
34
  import chalk from "chalk";
34
35
  import { InvalidArgumentError } from "commander";
35
36
  //#region src/commands/ios/hosted.ts
36
- async function finishHostedIosRun({ target, d, artifact, root, slot, release, appMode, isExpo, metroCheck, metroPort, logsDir, fail, note, phase, enterPhase, enterActivity, selectors, projectBundleId, ...report }) {
37
+ async function finishHostedIosRun({ target, operation, d, artifact, root, slot, release, appMode, isExpo, metroCheck, metroPort, logsDir, fail, note, phase, enterPhase, enterActivity, selectors, projectBundleId, logWriter, ...report }) {
37
38
  const bundleId = artifact.bundleId ?? (await d.readBundleId(artifact.path) || await projectBundleId());
38
39
  if (!bundleId) return fail({
39
40
  code: "STIM_INSTALL_FAILED",
@@ -41,6 +42,7 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
41
42
  });
42
43
  const devClientScheme = appMode === "development" && isExpo ? d.devClientScheme(root, artifact.path) ?? void 0 : void 0;
43
44
  const launchedAt = d.now();
45
+ let marked = false;
44
46
  let run;
45
47
  try {
46
48
  run = await d.placeHostedIos(target, {
@@ -54,7 +56,25 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
54
56
  mode: appMode,
55
57
  ...appMode === "development" && isExpo ? { devClientScheme } : {},
56
58
  metroPort,
57
- reserved: (placement) => d.writeHostedIos(root, slot, placement),
59
+ reserved: (placement) => {
60
+ if (placement.device && !marked) {
61
+ marked = true;
62
+ logWriter().write({
63
+ src: "build",
64
+ level: "info",
65
+ marker: true,
66
+ event: "launch_attempt",
67
+ ts: d.now(),
68
+ platform: "ios",
69
+ appId: bundleId,
70
+ deviceId: placement.session,
71
+ remote: true,
72
+ host: target.host.machine,
73
+ msg: `launching ${bundleId} on ${target.host.machine}`
74
+ });
75
+ }
76
+ return d.writeHostedIos(root, slot, placement);
77
+ },
58
78
  note,
59
79
  enterPhase
60
80
  });
@@ -76,11 +96,13 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
76
96
  }, slot);
77
97
  let launched = run.launched;
78
98
  let launchWarning;
99
+ let unattributed = false;
79
100
  if (appMode === "development") {
80
101
  const hostedLogs = d.followHostedLaunchLogs(root, slot, "ios", launchedAt);
81
102
  let verification;
82
103
  try {
83
104
  verification = await verifyIosMetroRun({
105
+ operation,
84
106
  root,
85
107
  slot,
86
108
  appPath: artifact.path,
@@ -117,7 +139,17 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
117
139
  });
118
140
  launched = verification.state === true ? true : verification.state === "bundling" ? "bundling" : "unverified";
119
141
  launchWarning = verification.warning;
142
+ unattributed = verification.unattributed ?? false;
120
143
  }
144
+ logWriter().write(launchOutcomeRecord({
145
+ launchState: launched,
146
+ release,
147
+ process: appMode === "process",
148
+ bundleId,
149
+ configuration: report.configuration,
150
+ metroPort,
151
+ unattributed
152
+ }));
121
153
  if (launched === "unverified") note(`Launch on ${target.host.machine} is unverified; check the hosted app, then retry stim ios --remote ${target.host.machine}.`);
122
154
  const cache = artifact.cache;
123
155
  const device = run.placement.device;
@@ -207,9 +239,9 @@ function iosCommand(program) {
207
239
  registerIos(program);
208
240
  }
209
241
  function registerIos(program, deps = {}) {
210
- program.command("ios").description("Build (or restore from the fingerprint cache), install and launch this workspace's app on its owned simulator. React Native and Expo Debug runs start the dev server when it is not running.").option("--eas-profile <name>", "Download a matching EAS development build; on a miss, print the build command without running it").option("--slot <name>", "Reusable device slot within this workspace (default: default)", parseDeviceSlotOption).option("--remote-build <value>", "Build on auto, local, or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "Emit the facts as a single JSON line on stdout; every other line goes to stderr").option("--plan", "Predict the next build without building, booting or installing: resolve the fingerprint, check the local then remote cache, and print the expected cache result and duration. Writes no Stim state.").option("--scheme <name>", "Shared Xcode app scheme to build; overrides automatic scheme selection, not the app URL scheme").option("--no-metro-check", "Skip the \"is this workspace's dev server running?\" check: do not start it, and build anyway").option("--no-build-cache", "Build fresh, ignoring cached artifacts (local and the project's build-cache provider); the fresh build still replaces the cache entry").option("--configuration <name>", "Xcode configuration to build (e.g. Release). A non-Debug configuration embeds the JS bundle and skips Metro entirely. Overrides the ios.configuration setting. Default: Debug").option("--device-type <name>", "Simulator model to create this workspace's owned sim as, exactly as `xcrun simctl list devicetypes` names it (e.g. \"iPad Pro 13-inch (M5)\"). Overrides the ios.deviceType setting for this invocation. A model no installed runtime can create refuses with STIM_BAD_ARG and prints the models they do offer.").option("--runtime <version>", "Simulator runtime to create this workspace's owned sim on, as a version (\"18.5\") or a runtime's full name (\"iOS 18.5\"); nothing else matches. Overrides the ios.runtime setting for this invocation. An unknown version refuses with STIM_BAD_ARG and prints the installed runtimes.").option("--simulator-app <app>", "Open the owned simulator in xcode, siniulator, or stim-desktop for this run, overriding the machine iosSimulatorApp setting. Also opens an already running simulator; local simulators only.").option("--device [udid]", "Build the iphoneos slice for a connected iPhone, install it, and launch it, instead of using this workspace's owned simulator. The phone can be cabled or paired over Wi-Fi. With no UDID, the first cabled device this workspace can lease is used, waiting for one that is busy; a Wi-Fi device is used only when no cabled one is connected and ready. In Debug the app is wired to this workspace's Metro over the LAN. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or an approved Mac in remote.machines; named Macs never fall back locally. auto places on an approved Mac when this machine is full or busy. local runs here, whatever ios.remote says.", (value) => {
242
+ program.command("ios").description("Build (or restore from the fingerprint cache), install and launch this workspace's app on its owned simulator. React Native and Expo Debug runs start the dev server when it is not running.").option("--eas-profile <name>", "Download a matching EAS development build; on a miss, print the build command without running it").option("--slot <name>", "Reusable device slot within this workspace (default: default)", parseDeviceSlotOption).option("--remote-build <value>", "Build on local, auto, remote (remote machines first), remote-only (never here), or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "Emit the facts as a single JSON line on stdout; every other line goes to stderr").option("--plan", "Predict the next build without building, booting or installing: resolve the fingerprint, check the local then remote cache, and print the expected cache result and duration. Writes no Stim state.").option("--scheme <name>", "Shared Xcode app scheme to build; overrides automatic scheme selection, not the app URL scheme").option("--no-metro-check", "Skip the \"is this workspace's dev server running?\" check: do not start it, and build anyway").option("--no-build-cache", "Build fresh, ignoring cached artifacts (local and the project's build-cache provider); the fresh build still replaces the cache entry").option("--configuration <name>", "Xcode configuration to build (e.g. Release). A non-Debug configuration embeds the JS bundle and skips Metro entirely. Overrides the ios.configuration setting. Default: Debug").option("--device-type <name>", "Simulator model to create this workspace's owned sim as, exactly as `xcrun simctl list devicetypes` names it (e.g. \"iPad Pro 13-inch (M5)\"). Overrides the ios.deviceType setting for this invocation. A model no installed runtime can create refuses with STIM_BAD_ARG and prints the models they do offer.").option("--runtime <version>", "Simulator runtime to create this workspace's owned sim on, as a version (\"18.5\") or a runtime's full name (\"iOS 18.5\"); nothing else matches. Overrides the ios.runtime setting for this invocation. An unknown version refuses with STIM_BAD_ARG and prints the installed runtimes.").option("--simulator-app <app>", "Open the owned simulator in xcode, siniulator, or stim-desktop for this run, overriding the machine iosSimulatorApp setting. Also opens an already running simulator; local simulators only.").option("--device [udid]", "Build the iphoneos slice for a connected iPhone, install it, and launch it, instead of using this workspace's owned simulator. The phone can be cabled or paired over Wi-Fi. With no UDID, the first cabled device this workspace can lease is used, waiting for one that is busy; a Wi-Fi device is used only when no cabled one is connected and ready. In Debug the app is wired to this workspace's Metro over the LAN. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or an approved Mac in remote.machines; named Macs never fall back locally. auto places on an approved Mac when this machine is full or busy. remote tries remote.machines in order first and runs here only when none takes it. remote-only never runs here. local runs here, whatever ios.remote says.", (value) => {
211
243
  if (parseMachine(value)) return value.trim();
212
- throw new InvalidArgumentError("expected eas, proxy, auto, local, or a remote Mac name");
244
+ throw new InvalidArgumentError("expected eas, proxy, local, auto, remote, remote-only, or a remote Mac name");
213
245
  }).option("--wait <seconds>", "How long to wait for another workspace to release the phone it leases, before refusing with STIM_DEVICE_BUSY (default 60, 0 refuses at once). Without --device, wait for an owned-device slot (default 600 seconds; --no-wait refuses immediately).").option("--no-wait", "Install on a phone another workspace leases instead of waiting: this run takes no lease and, when both workspaces build the same app id, the install terminates the holder's running app. Without --device, refuse a full device cap or existing slot queue immediately.").action(async (opts) => {
214
246
  if (opts.plan) {
215
247
  await planIos(opts, {
@@ -234,6 +266,12 @@ function runIosOperation(context, root, opts = {}, deps = {}, onFailure = () =>
234
266
  platform: "ios",
235
267
  slot: opts.slot ?? "default"
236
268
  }, async (claim) => {
269
+ const lightened = await restoreLightenedDependencies(root, context);
270
+ if (lightened) {
271
+ printLightenedFailure(context, lightened, Boolean(opts.json));
272
+ onFailure(lightened);
273
+ return null;
274
+ }
237
275
  await recordWorkspaceUseAsync(root, /* @__PURE__ */ new Date(), context.env, context.cwd, context.signal);
238
276
  const progress = startBuildProgress({
239
277
  root,
@@ -307,6 +345,10 @@ function iosSlotDeps(d, slot) {
307
345
  ...args,
308
346
  slot
309
347
  }),
348
+ ensureBooted: (args) => base.ensureBooted({
349
+ ...args,
350
+ slot
351
+ }),
310
352
  checkDeviceCapacity: (args) => base.checkDeviceCapacity({
311
353
  ...args,
312
354
  slot
@@ -435,7 +477,15 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
435
477
  let devicePlacement;
436
478
  let builtConfiguration = null;
437
479
  let acquiredBuild = null;
438
- const recordFailedBuild = (build, errorCode) => writeLastBuild(root, lastBuildRecord({
480
+ let builtScheme;
481
+ let builtDevice = null;
482
+ const recordFailedBuild = (build, errorCode, why = {}) => writeLastBuild(root, lastBuildRecord({
483
+ ledger: {
484
+ scheme: builtScheme,
485
+ device: builtDevice,
486
+ message: why.message,
487
+ remedy: why.remedy
488
+ },
439
489
  devicePlacement,
440
490
  buildMachine,
441
491
  ...build,
@@ -461,7 +511,10 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
461
511
  if (remedy) note(chalk.dim(phaseLine("remedy", remedy)));
462
512
  if (logPath) note(chalk.dim(phaseLine("log", logPath)));
463
513
  const failedBuild = build ?? acquiredBuild;
464
- if (failedBuild) recordFailedBuild(failedBuild, code);
514
+ if (failedBuild) recordFailedBuild(failedBuild, code, {
515
+ message,
516
+ remedy
517
+ });
465
518
  if (acquiredBuild) logWriter().write(runFailureRecord({
466
519
  code,
467
520
  message,
@@ -549,6 +602,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
549
602
  const configuration = opts.easProfile !== void 0 ? null : resolveConfiguration(opts.configuration, settings);
550
603
  builtConfiguration = configuration ?? "Debug";
551
604
  const buildScheme = resolveSchemeSelection(opts, settings);
605
+ builtScheme = buildScheme;
552
606
  const release = isReleaseConfiguration(configuration);
553
607
  const appMode = {
554
608
  metro: "development",
@@ -573,7 +627,6 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
573
627
  const deviceSlotWait = {
574
628
  automatic: false,
575
629
  waitMs: deviceSlotWaitMs,
576
- displayName: basename(root),
577
630
  reclaimIdleMinutes: deviceReclaimIdleMinutesSetting(settings),
578
631
  ...deviceWaitRun.policy,
579
632
  onWait: (ms) => {
@@ -621,6 +674,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
621
674
  }),
622
675
  simSnapshot,
623
676
  noWait: deviceSlotWaitMs === 0,
677
+ waitMs: deviceSlotWaitMs,
624
678
  note,
625
679
  phase,
626
680
  log: (entry) => logWriter().write(entry)
@@ -818,6 +872,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
818
872
  const prepareMs = prepare();
819
873
  if (device.created || prepareMs >= 2e3) phase("device", `${deviceLabel(device, device.deviceUdid)} ${device.created ? "created" : "prepared"} (${formatDuration(prepareMs)})`);
820
874
  }
875
+ builtDevice = iosLedgerDevice(device);
821
876
  let bootDuration = "";
822
877
  let bootPending = false;
823
878
  let bootPromise;
@@ -970,7 +1025,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
970
1025
  if (cancelled) return fail(cancelled);
971
1026
  if (acquiredBuild) {
972
1027
  const { code } = error;
973
- recordFailedBuild(acquiredBuild, typeof code === "string" ? code : void 0);
1028
+ recordFailedBuild(acquiredBuild, typeof code === "string" ? code : void 0, { message: error instanceof Error ? error.message : String(error) });
974
1029
  logWriter().write(thrownRunFailureRecord(error, progress.phase()));
975
1030
  }
976
1031
  recordRun({
@@ -1093,6 +1148,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
1093
1148
  };
1094
1149
  compilationCache = artifact.cache.compilation;
1095
1150
  if (hostedTarget) return await finishHostedIosRun({
1151
+ operation: context,
1096
1152
  output: context.output,
1097
1153
  target: hostedTarget,
1098
1154
  projectBundleId: integration.bundleId,
@@ -1121,7 +1177,8 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
1121
1177
  phase,
1122
1178
  enterPhase: progress.step,
1123
1179
  enterActivity: progress.activity,
1124
- selectors
1180
+ selectors,
1181
+ logWriter
1125
1182
  });
1126
1183
  if (!localBoot) {
1127
1184
  progress.step("device");
@@ -1,10 +1,10 @@
1
- import { _ as spawnDeclared, b as operationState, c as throwIfCancelled, t as getExecutor } from "./exec-VFRpu1iA.mjs";
1
+ import { _ as spawnDeclared, b as operationState, c as throwIfCancelled, t as getExecutor } from "./exec-aULwtNly.mjs";
2
2
  import { r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
3
- import { a as killOnAbort, t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
4
- import { Ut as makeTemporaryDirectory, Wt as removeTemporaryEntry } from "./settings-CosW5X-S.mjs";
5
- import { rr as bundleInvocation } from "./budget-k2mZGvvk.mjs";
6
- import { s as expoTelemetryEnv, t as cleanLine } from "./server-expo-eQfOdydb.mjs";
7
- import { G as tailLines, U as startBuildHeartbeat, j as HEARTBEAT_INTERVAL_MS } from "./toolchain-J4J8MrAr.mjs";
3
+ import { a as killOnAbort, t as runOperationFile } from "./operation-exec-Dp4FuIGR.mjs";
4
+ import { an as makeTemporaryDirectory, on as removeTemporaryEntry } from "./settings-CY5JZlNN.mjs";
5
+ import { Bn as bundleInvocation } from "./ccache-Bm_A1xX9.mjs";
6
+ import { G as tailLines, U as startBuildHeartbeat, j as HEARTBEAT_INTERVAL_MS } from "./toolchain-mLA_km-b.mjs";
7
+ import { s as expoTelemetryEnv, t as cleanLine } from "./server-expo-Ccm9zB0o.mjs";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { basename, join } from "node:path";
@@ -120,7 +120,8 @@ async function readPlistKey(context, e, plist, key, format) {
120
120
  plist
121
121
  ], { timeoutMs: 1e4 });
122
122
  } catch (err) {
123
- if (/No value at that key path/.test(describe(err))) return null;
123
+ const stdout = typeof err === "object" && err !== null && "stdout" in err ? String(err.stdout) : "";
124
+ if (/No value at that key path/.test(`${describe(err)}\n${stdout}`)) return null;
124
125
  throw err;
125
126
  }
126
127
  }
@@ -1,23 +1,24 @@
1
- import { k as workspaceLogsDir } from "./workspace-state-pUg3_RRA.mjs";
2
- import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } from "./config-BktkY_zC.mjs";
3
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-BF5AR2dL.mjs";
4
- import { L as workspaceDevServerMode } from "./project-BUu6Is4k.mjs";
5
- import { o as workspaceLinks } from "./stim-desktop-6Dqp-gjX.mjs";
6
- import { i as androidDataFreeBytes, ot as trimAndroidCaches, tt as resetAdoptedAvd, u as androidToolCwd } from "./android-DTAcRwBC.mjs";
7
- import { c as pidExists, f as signalProcessTree } from "./metro-CjC10t6E.mjs";
8
- import { $t as LAUNCH_BUNDLING, Dn as installConflictKind, Nn as restartedAppNote, cn as unattributedLaunchLines, en as LAUNCH_FATAL, in as VERIFY_TIMEOUT_MS, ln as unverifiedLaunchLines, mn as ADB_INSTALL_TIMEOUT_MS, rn as RELEASE_VERIFY_WAIT_MS, tn as LAUNCH_UNVERIFIED, vn as androidAppProcess, yn as androidDevClientUrl } from "./budget-k2mZGvvk.mjs";
9
- import { O as teardownOwnedAvd } from "./workspaces-g2lhdBXF.mjs";
10
- import { b as providerUploadOutcome } from "./build-cache-DrXNCy3T.mjs";
11
- import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-BjYvMNX_.mjs";
12
- import { t as recordPhoneReverse } from "./phone-reverses-lmj6kcPm.mjs";
13
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CYCEhfBY.mjs";
1
+ import { x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
+ import { k as workspaceLogsDir } from "./workspace-state-kIZrdlSg.mjs";
3
+ import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } 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-C8R1KIvi.mjs";
5
+ import { L as workspaceDevServerMode } from "./project-Sui52ywT.mjs";
6
+ import { o as workspaceLinks } from "./stim-desktop-CbWo21kb.mjs";
7
+ import { i as androidDataFreeBytes, ot as trimAndroidCaches, tt as resetAdoptedAvd, u as androidToolCwd } from "./android-CsPs-7Mg.mjs";
8
+ import { c as pidExists, f as signalProcessTree } from "./metro-BnhXV2Mj.mjs";
9
+ import { Bt as RELEASE_VERIFY_WAIT_MS, Gt as unattributedLaunchLines, It as LAUNCH_BUNDLING, Kt as unverifiedLaunchLines, Lt as LAUNCH_FATAL, Rt as LAUNCH_UNVERIFIED, Vt as VERIFY_TIMEOUT_MS, Zt as ADB_INSTALL_TIMEOUT_MS, gn as restartedAppNote, nn as androidDevClientUrl, tn as androidAppProcess, un as installConflictKind } from "./ccache-Bm_A1xX9.mjs";
10
+ import { pt as teardownOwnedAvd } from "./workspaces-CmOcceDN.mjs";
11
+ import { x as providerUploadOutcome } from "./build-cache-CZULpXVl.mjs";
12
+ import { t as recordPhoneReverse } from "./phone-reverses-BzTa8g1F.mjs";
13
+ import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-DJCq48IJ.mjs";
14
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-BpmanOnk.mjs";
14
15
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
15
- import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-BmvIl7bI.mjs";
16
- import { a as printNativeCrashReport, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BOOm9Db7.mjs";
17
- import { f as settleFingerprintCheck } from "./prebuild-gmouvmJZ.mjs";
18
- import { i as launchOutcomeRecord } from "./native-runtime-Dq3RBcON.mjs";
19
- import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-BGSCBoib.mjs";
20
- import { a as persistLastBuild, n as finishAndroidUpload, s as reportAndroidResult } from "./result-7F5hEwQJ.mjs";
16
+ import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-Mtzp4THX.mjs";
17
+ import { a as captureNativeCrashes, r as androidCrashClockOffset, s as printNativeCrashReport, t as errorDiagnostics } from "./error-diagnostics-D1QfyJzQ.mjs";
18
+ import { f as settleFingerprintCheck } from "./prebuild-k8d_tqOq.mjs";
19
+ import { i as launchOutcomeRecord } from "./native-runtime-DG4Rodzj.mjs";
20
+ import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-04IhBUTT.mjs";
21
+ import { a as persistLastBuild, n as finishAndroidUpload, s as reportAndroidResult } from "./result-BIcXREyC.mjs";
21
22
  import { mkdirSync, openSync, statSync } from "node:fs";
22
23
  import { basename, join } from "node:path";
23
24
  import { ambientEnv } from "@stim-cli/core";
@@ -104,17 +105,11 @@ async function startCollector({ root, slot = "default", serial, packageName, spa
104
105
  //#endregion
105
106
  //#region src/commands/android/launch.ts
106
107
  function androidLaunchOutcomeRecord(kind, args) {
107
- if (kind !== "process") return launchOutcomeRecord({
108
+ return launchOutcomeRecord({
108
109
  ...args,
109
- release: kind === "embedded-js"
110
+ release: kind === "embedded-js",
111
+ process: kind === "process"
110
112
  });
111
- const unverified = args.launchState === LAUNCH_UNVERIFIED;
112
- return {
113
- src: "build",
114
- level: unverified ? "warn" : "info",
115
- event: unverified ? "launch_unverified" : "launch_verified",
116
- msg: unverified ? `${args.bundleId} could not be verified as running` : `${args.bundleId} is running its native process`
117
- };
118
113
  }
119
114
  function androidProcessRuntime(prepare, kind = "process") {
120
115
  return {
@@ -192,19 +187,28 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
192
187
  physical,
193
188
  deviceId: serial
194
189
  });
195
- const readNativeCrashes = () => hostedLogs ? hostedLogs.readNativeCrashes() : remoteDevice ? [] : captureNativeCrashes({
196
- root,
197
- slot,
198
- platform: "android",
199
- deviceId: serial,
200
- appId: androidPackage,
201
- since: launchedAt
202
- }, logsDir, operation?.signal, operation?.env);
190
+ let clockOffsetMs;
191
+ const readNativeCrashes = async () => {
192
+ if (hostedLogs) return hostedLogs.readNativeCrashes();
193
+ if (remoteDevice) return [];
194
+ const measured = clockOffsetMs ?? await androidCrashClockOffset(serial, operation?.signal);
195
+ if (measured !== null) clockOffsetMs = measured;
196
+ return captureNativeCrashes({
197
+ root,
198
+ slot,
199
+ platform: "android",
200
+ deviceId: serial,
201
+ appId: androidPackage,
202
+ since: launchedAt,
203
+ clockOffsetMs: measured
204
+ }, logsDir, operation?.signal, operation?.env);
205
+ };
203
206
  const freshEmulator = Boolean((device.created || device.adoptionPending) && device.owned && !remoteDevice);
204
207
  const timeoutMs = freshEmulator ? 6e4 : VERIFY_TIMEOUT_MS;
205
208
  if (metroCheck && freshEmulator) phase("verify", `waiting up to 60s for bundle load (${device.created ? "new" : "adopted"} emulator)`);
206
209
  const siblings = metroCheck ? await siblingPlatformSlots(root, "android", slot) : [];
207
- const verification = metroCheck ? await verifyLaunched({
210
+ const verification = metroCheck ? await withDrainingCancellation(operation, operation?.signal, () => verifyLaunched({
211
+ signal: operation?.signal,
208
212
  timeoutMs,
209
213
  requireBundleResponse: true,
210
214
  slot: launchSlotScope(root, slot),
@@ -223,7 +227,7 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
223
227
  const running = await androidAppProcess(serial, androidPackage);
224
228
  return running.state === "unknown" ? null : running.state === "running";
225
229
  }
226
- }) : {
230
+ })) : {
227
231
  verified: false,
228
232
  skipped: true
229
233
  };
@@ -0,0 +1,171 @@
1
+ import { l as WorkspaceProcessCleanupError } from "./exec-aULwtNly.mjs";
2
+ import { c as withWorkspaceStateLock } from "./workspace-state-kIZrdlSg.mjs";
3
+ import { l as phaseLine } from "./command-output-C8R1KIvi.mjs";
4
+ import { Jt as warmWorktreePaths, Lt as podsOutOfSync, Q as resolveSettings, Rt as readWorktreeExclude, kt as listCarryableIgnoredEntries, vt as depsOutOfSync } from "./settings-CY5JZlNN.mjs";
5
+ import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
6
+ import { m as warmWorktreeTarget } from "./worktree-2dk5edza.mjs";
7
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
8
+ import { basename, dirname, join, relative } from "node:path";
9
+ import { isJsonObject, readJsonObject, workspaceLightenedFile, workspaceMetadataFile } from "@stim-cli/core/state";
10
+ //#region src/workspace/lightened.ts
11
+ function strings(value) {
12
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
13
+ }
14
+ function readRecord(root) {
15
+ const record = readJsonObject(workspaceLightenedFile(root));
16
+ return isJsonObject(record) ? {
17
+ dirs: strings(record.dirs),
18
+ pending: strings(record.pending)
19
+ } : {
20
+ dirs: [],
21
+ pending: []
22
+ };
23
+ }
24
+ /** The keys among `keys` that have a Stim workspace, which is what restores a lightened worktree. */
25
+ function workspaceKeys(keys) {
26
+ return keys.filter((key) => existsSync(workspaceMetadataFile(key)));
27
+ }
28
+ const LOCKFILES = [
29
+ "pnpm-lock.yaml",
30
+ "package-lock.json",
31
+ "yarn.lock",
32
+ "bun.lock",
33
+ "bun.lockb"
34
+ ];
35
+ function readOrNull(path) {
36
+ try {
37
+ return readFileSync(path);
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
42
+ async function sourceFacts(worktree, operation) {
43
+ try {
44
+ const { root: source, common } = await warmWorktreePaths(worktree, operation);
45
+ const settings = resolveSettings({
46
+ gitCommonDir: common,
47
+ repoRoot: source
48
+ }).worktree;
49
+ const configured = isJsonObject(settings) && Array.isArray(settings.exclude) ? settings.exclude.filter((entry) => typeof entry === "string") : [];
50
+ const excluded = readWorktreeExclude(source);
51
+ const patterns = excluded?.length ? excluded : configured;
52
+ return {
53
+ source,
54
+ carryable: new Set(await listCarryableIgnoredEntries(source, patterns, {
55
+ env: operation?.env,
56
+ signal: operation?.signal,
57
+ declareFor: operation
58
+ }))
59
+ };
60
+ } catch (error) {
61
+ operation?.signal.throwIfAborted();
62
+ if (error instanceof WorkspaceProcessCleanupError) throw error;
63
+ return null;
64
+ }
65
+ }
66
+ /**
67
+ * Why `worktree warm` could not put back what is deleted at `path`, or null when it copies the same versions back: it
68
+ * carries that directory from the source checkout, and both hold the same lockfile.
69
+ */
70
+ async function restoreProblem({ worktree, path }, cache = /* @__PURE__ */ new Map(), operation) {
71
+ let pending = cache.get(worktree);
72
+ if (!pending) cache.set(worktree, pending = sourceFacts(worktree, operation));
73
+ const facts = await pending;
74
+ if (!facts) return "its source checkout cannot be resolved, so worktree warm could not restore it";
75
+ const rel = relative(worktree, path);
76
+ if (!facts.carryable.has(rel)) return `worktree warm would not copy ${rel} back from the source checkout`;
77
+ const pods = basename(rel) === "Pods";
78
+ if ((pods ? podsOutOfSync(facts.source, [rel]) : depsOutOfSync(facts.source, facts.source, [rel])).length) return `the source checkout's ${rel} was not installed from its own lockfile, so worktree warm would restore other versions`;
79
+ const differs = (pods ? [join(dirname(rel), "Podfile.lock")] : [.../* @__PURE__ */ new Set([".", dirname(rel)])].flatMap((dir) => LOCKFILES.map((name) => join(dir, name)))).find((lock) => {
80
+ const mine = readOrNull(join(worktree, lock));
81
+ const theirs = readOrNull(join(facts.source, lock));
82
+ return mine === null ? theirs !== null : theirs === null || !mine.equals(theirs);
83
+ });
84
+ return differs ? `its ${differs} differs from the source checkout's, so worktree warm would restore other versions` : null;
85
+ }
86
+ function writeRecord(key, update) {
87
+ withWorkspaceStateLock(key, () => {
88
+ const file = workspaceLightenedFile(key);
89
+ mkdirSync(dirname(file), { recursive: true });
90
+ const tmp = `${file}.tmp-${process.pid}`;
91
+ writeFileSync(tmp, `${JSON.stringify({
92
+ at: (/* @__PURE__ */ new Date()).toISOString(),
93
+ ...update(readRecord(key))
94
+ }, null, 2)}\n`, { mode: 384 });
95
+ renameSync(tmp, file);
96
+ });
97
+ }
98
+ /**
99
+ * Records in each Stim workspace among `keys` that `dir` is being deleted to lighten its worktree, before the deletion;
100
+ * it stays pending until `finishLightened`, so a deletion that stops part-way is still restored.
101
+ */
102
+ function recordLightened(keys, dir) {
103
+ for (const key of workspaceKeys(keys)) writeRecord(key, ({ dirs, pending }) => ({
104
+ dirs: [.../* @__PURE__ */ new Set([...dirs, dir])],
105
+ pending: [.../* @__PURE__ */ new Set([...pending, dir])]
106
+ }));
107
+ }
108
+ function finishLightened(keys, dir) {
109
+ for (const key of workspaceKeys(keys)) writeRecord(key, ({ dirs, pending }) => ({
110
+ dirs,
111
+ pending: pending.filter((entry) => entry !== dir)
112
+ }));
113
+ }
114
+ function depsFailure(root, message, remedy = `Run \`stim worktree warm\` in ${root}, or install the project's dependencies, then retry.`) {
115
+ return {
116
+ code: "STIM_DEPS_FAILED",
117
+ message: `gc lightened this worktree, and ${message}`,
118
+ remedy: `${remedy} If you installed them yourself, delete ${workspaceLightenedFile(root)} so Stim stops restoring them.`
119
+ };
120
+ }
121
+ /**
122
+ * Restores the dependencies gc deleted from this workspace's worktree through `stim worktree warm`, or returns the
123
+ * failure to report. A workspace gc never lightened is left alone.
124
+ */
125
+ async function restoreLightenedDependencies(root, operation) {
126
+ const { dirs, pending } = readRecord(root);
127
+ if (!dirs.length) return null;
128
+ const missing = () => dirs.filter((dir) => pending.includes(dir) || !existsSync(dir));
129
+ if (missing().length) {
130
+ const cache = /* @__PURE__ */ new Map();
131
+ const worktree = (await warmWorktreePaths(root, operation).catch(() => null))?.target;
132
+ for (const dir of missing()) {
133
+ const problem = worktree ? await restoreProblem({
134
+ worktree,
135
+ path: dir
136
+ }, cache, operation) : "its worktree cannot be resolved";
137
+ if (problem) return depsFailure(root, `${dir} cannot be restored by worktree warm: ${problem}.`, `Install the project's dependencies in ${root} (for example \`pnpm install\` or \`pod install\`), then retry.`);
138
+ }
139
+ operation.output("stderr", `${phaseLine("deps", `gc lightened this worktree; restoring ${missing().join(", ")} with worktree warm`)}\n`);
140
+ for (const dir of pending) {
141
+ if (!worktree || canonicalPath(dir) !== join(canonicalPath(worktree), relative(worktree, dir))) return depsFailure(root, `${dir} is reached through a link or lies outside its worktree, so it was not removed.`);
142
+ rmSync(dir, {
143
+ recursive: true,
144
+ force: true
145
+ });
146
+ }
147
+ let exitCode;
148
+ try {
149
+ ({exitCode} = await warmWorktreeTarget({
150
+ cwd: root,
151
+ operation
152
+ }));
153
+ } catch (error) {
154
+ operation.signal.throwIfAborted();
155
+ if (error instanceof WorkspaceProcessCleanupError) throw error;
156
+ return depsFailure(root, `worktree warm failed: ${error instanceof Error ? error.message : String(error)}`);
157
+ }
158
+ const left = dirs.filter((dir) => !existsSync(dir));
159
+ if (exitCode !== 0 || left.length) return depsFailure(root, `worktree warm did not restore ${left.join(", ") || "its dependencies"}.`);
160
+ }
161
+ withWorkspaceStateLock(root, () => rmSync(workspaceLightenedFile(root), { force: true }));
162
+ return null;
163
+ }
164
+ /** Prints a restore failure the way a native run reports a refusal, with the JSON line on stdout when asked. */
165
+ function printLightenedFailure(operation, failure, json) {
166
+ operation.output("stderr", `${phaseLine("error", `${failure.code}: ${failure.message}`)}\n`);
167
+ operation.output("stderr", `${phaseLine("remedy", failure.remedy)}\n`);
168
+ if (json) operation.output("stdout", `${JSON.stringify(failure)}\n`);
169
+ }
170
+ //#endregion
171
+ export { restoreProblem as a, restoreLightenedDependencies as i, printLightenedFailure as n, workspaceKeys as o, recordLightened as r, finishLightened as t };