stim 1.20.1 → 1.21.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 (217) hide show
  1. package/README.md +94 -11
  2. package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
  3. package/dist/act-DHAw2A2S.mjs +2667 -0
  4. package/dist/activity-BzVfHSrY.mjs +1376 -0
  5. package/dist/{agent-device-usage-output-VPaOgGaF.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -66
  6. package/dist/{android-CZh6ElG5.mjs → android-BEJ8Jpl7.mjs} +3 -3
  7. package/dist/{android-CLbBJ2ve.mjs → android-BLgbNqox.mjs} +128 -79
  8. package/dist/{android-eXfIjKJr.mjs → android-CV_GCELZ.mjs} +5 -5
  9. package/dist/{android-DE8-JfGW.mjs → android-DUYkNF4u.mjs} +188 -106
  10. package/dist/{android-cas-BFpS84v2.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
  11. package/dist/android-cas-compiler.mjs +2 -2
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/api.d.mts +740 -8
  14. package/dist/api.mjs +585 -1
  15. package/dist/{artifact-Ctb2jpw6.mjs → artifact-B8T3S5gi.mjs} +223 -201
  16. package/dist/{artifact-DXk_Fle_.mjs → artifact-DAuZ-FNU.mjs} +158 -148
  17. package/dist/{browser-web-xQWC2RWl.mjs → browser-web-QQzVjz3O.mjs} +28 -26
  18. package/dist/budget-Bs6SxxzO.mjs +9154 -0
  19. package/dist/{build-COBA1tBc.mjs → build-CoPzQRNw.mjs} +144 -101
  20. package/dist/build-cache-DmyR9Zzc.mjs +602 -0
  21. package/dist/build-plan-CaFskB7_.mjs +188 -0
  22. package/dist/{cache-manifest-qA3dT2x2.mjs → cache-manifest-DkkqguoK.mjs} +10 -5
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-CtbqWxIC.mjs → ccache-BJRZ9pG3.mjs} +10 -9
  25. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
  26. package/dist/{chrome-Dp2lMLBe.mjs → chrome-B6tfCta1.mjs} +7 -4
  27. package/dist/{cli-sGqlPu1n.mjs → cli-0DYf8QhQ.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/client-B7QVOlCr.d.mts +253 -0
  30. package/dist/client-UXD70ZbM.mjs +1406 -0
  31. package/dist/collector-run.d.mts +4 -39
  32. package/dist/collector-run.mjs +9 -9
  33. package/dist/{command-output-CPDq_90S.mjs → command-output-B1UrjZHL.mjs} +1 -1
  34. package/dist/config-CYcBF478.mjs +949 -0
  35. package/dist/{created-devices-CXBMtoj5.mjs → created-devices-CqeBlrEn.mjs} +3 -3
  36. package/dist/{dependency-state-B2m8eqsS.mjs → dependency-state-BbKQW83h.mjs} +20 -5
  37. package/dist/{detached-entry-BXq4fIl-.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
  38. package/dist/{dev-client-BqYjMIaC.mjs → dev-client-UOeESKm6.mjs} +2 -2
  39. package/dist/device-DCxH7_By.mjs +1068 -0
  40. package/dist/{device-D4DqjSZZ.mjs → device-ExJq8Ei7.mjs} +35 -36
  41. package/dist/{device-capacity-DrwHwR97.mjs → device-capacity-CMlqEcvw.mjs} +43 -14
  42. package/dist/device-host-worker.mjs +65 -62
  43. package/dist/{device-ios-DE8KJd3b.mjs → device-ios-DRUeKaFV.mjs} +49 -49
  44. package/dist/{device-lease-run-Baelt3nc.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
  45. package/dist/{device-pool-DtK9S6AD.mjs → device-pool-DMRpVX9a.mjs} +5 -5
  46. package/dist/doctor-BLHCYxzi.mjs +2 -0
  47. package/dist/{doctor-Dunu3Nv1.mjs → doctor-DTvaDOda.mjs} +317 -344
  48. package/dist/{doctor-DiP9HsIP.mjs → doctor-Dhqebm0q.mjs} +183 -91
  49. package/dist/doctor-fingerprint.mjs +19 -0
  50. package/dist/{doctor-watchman-XJzT8tK-.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -23
  51. package/dist/{eas-build-0gadvrca.mjs → eas-build-BomfRnFT.mjs} +53 -20
  52. package/dist/{build-plan-CRjAA6Qi.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
  53. package/dist/{watchman-CqmaGcIb.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
  54. package/dist/{error-diagnostics-BhQtoLrZ.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
  55. package/dist/exec-H20xSg2T.d.mts +65 -0
  56. package/dist/exec-_UbtCQcG.mjs +750 -0
  57. package/dist/gc-C-WwL0yi.mjs +3 -0
  58. package/dist/{gc-D5cz5G0k.mjs → gc-_-dCXdyL.mjs} +625 -786
  59. package/dist/git-C3iTsJaZ.mjs +73 -0
  60. package/dist/{guide-DakjcoUt.mjs → guide-Yqwt2bd6.mjs} +990 -280
  61. package/dist/{hosted-android-C-D8Dj0_.mjs → hosted-android-Bw-honsd.mjs} +8 -6
  62. package/dist/{hosted-client--hNFgixu.mjs → hosted-client-DB_gBPfY.mjs} +47 -24
  63. package/dist/{hosted-ios-Chx9XQyI.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
  64. package/dist/{hosted-logs-Bkz0Hxzh.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
  65. package/dist/{hosted-macos-ckTjN-0V.mjs → hosted-macos-QI141yKk.mjs} +21 -15
  66. package/dist/{hosted-native-3KXZ5-qn.mjs → hosted-native-Ksyjgzq-.mjs} +31 -20
  67. package/dist/idle-BVeRGroT.d.mts +24 -0
  68. package/dist/{idle-shutdown-DhAUyf5s.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
  69. package/dist/{ios-BDBN-xpf.mjs → ios-CQ68hG9s.mjs} +8 -8
  70. package/dist/{ios-o896T9PE.mjs → ios-CpByZy12.mjs} +141 -81
  71. package/dist/{ios-device-B1B14xND.mjs → ios-device-CXGP1bsD.mjs} +1 -1
  72. package/dist/{ios-device-BWHKGaJq.mjs → ios-device-CwFMehUS.mjs} +60 -35
  73. package/dist/{ios-project-BeOXKPt2.mjs → ios-project-WuwwBdvW.mjs} +13 -13
  74. package/dist/{ios-VGvNdsv2.mjs → ios-qNJt4dFm.mjs} +1 -1
  75. package/dist/ios-signing-DTTIChGs.mjs +489 -0
  76. package/dist/{ios-state-BsXMwo5y.mjs → ios-state-DvFX-K_l.mjs} +1 -1
  77. package/dist/{ios-CQ8bHQXB.mjs → ios-ubFsBzwq.mjs} +129 -86
  78. package/dist/{js-swap-Z_mSuRrx.mjs → js-swap-Cc1dttps.mjs} +60 -33
  79. package/dist/{launch-V1zqiOYn.mjs → launch-CD1yVc7U.mjs} +92 -91
  80. package/dist/{launch-BootbMk4.mjs → launch-Zq2mOSDy.mjs} +87 -545
  81. package/dist/logs-BS00Anxf.mjs +352 -0
  82. package/dist/logs-CMm05HxN.mjs +255 -0
  83. package/dist/macos-B65--pPd.mjs +2 -0
  84. package/dist/{macos-D7irBW3A.mjs → macos-C-0qJ6zq.mjs} +244 -215
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +122 -247
  87. package/dist/{metro-_ZIE3Axg.mjs → metro-DEXpIhHC.mjs} +71 -17
  88. package/dist/{metro-gateway-BzlQZQmU.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
  89. package/dist/{named-ports-O1TIl7tx.mjs → named-ports-BWTzt6mu.mjs} +8 -64
  90. package/dist/native-android-JACyjTZs.mjs +844 -0
  91. package/dist/{native-gradle-inputs-BQnIdAlL.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -147
  92. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  93. package/dist/native-run-DY_RLx3C.mjs +277 -0
  94. package/dist/{native-runtime-D024BAvm.mjs → native-runtime-Dg1Q7tfF.mjs} +10 -10
  95. package/dist/{native-xcode-inputs-UElfGs59.mjs → native-xcode-inputs-CB2iQeWq.mjs} +28 -20
  96. package/dist/{native-xcode-ios-CjS-nDVY.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
  97. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  98. package/dist/offload-worker.d.mts +1 -46
  99. package/dist/offload-worker.mjs +213 -86
  100. package/dist/{ownership-BrjepDiv.mjs → ownership-DEmM5vhh.mjs} +3 -3
  101. package/dist/{page-Bv9s2KwY.mjs → page-CPaHeYqj.mjs} +7 -4
  102. package/dist/paths-BsJMoPP2.mjs +12 -0
  103. package/dist/paths-DQtTgsBf.mjs +42 -0
  104. package/dist/{placement-log-BItXET1x.mjs → placement-log-BqGbTa61.mjs} +5 -5
  105. package/dist/{plan-placement-B466UYMU.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
  106. package/dist/{ports-BFRL6JTj.mjs → ports-D-MmCTdv.mjs} +3 -3
  107. package/dist/prebuild-uD_ipCxF.mjs +449 -0
  108. package/dist/{project-DX8fXyw_.mjs → project-BZNjmW_8.mjs} +65 -38
  109. package/dist/{pull-request-vOhLNmIb.mjs → pull-request-Lfetn8Kr.mjs} +5 -18
  110. package/dist/pull-request-zjCSAryH.d.mts +120 -0
  111. package/dist/pull-requests.d.mts +1 -119
  112. package/dist/pull-requests.mjs +1 -1
  113. package/dist/{react-native-android-CuXM3QS8.mjs → react-native-android-DuzH0cn3.mjs} +83 -53
  114. package/dist/{gradle-CZZo1TSA.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
  115. package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
  116. package/dist/{react-native-ios-DtVO4qf2.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
  117. package/dist/{recordings-Bk-VivUV.mjs → recordings-DYteQSu4.mjs} +12 -9
  118. package/dist/{reload-D9V7D8gP.mjs → reload-CmTRFJaX.mjs} +95 -49
  119. package/dist/reload-DzjSl5P_.mjs +2 -0
  120. package/dist/{remote-CZiTijxG.mjs → remote-ByYkXdGD.mjs} +15 -10
  121. package/dist/result-DNiS-tTP.mjs +434 -0
  122. package/dist/{run-ClC8UVB5.mjs → run-D23HmJMs.mjs} +4 -5
  123. package/dist/selection-CSl9i5qU.mjs +619 -0
  124. package/dist/{server-bare-dWjAarki.mjs → server-bare-CxTrvDg8.mjs} +3 -4
  125. package/dist/{server-command-DnJYLnr4.mjs → server-command-CtzloH3v.mjs} +14 -7
  126. package/dist/server-expo-C-90EhcG.mjs +2 -0
  127. package/dist/{server-expo-CUuzP9Mp.mjs → server-expo-DT_F_uVI.mjs} +51 -15
  128. package/dist/{settings-Bbztm4oV.mjs → settings-CsJDEXgK.mjs} +301 -132
  129. package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
  130. package/dist/settings-T1gtc3bf.mjs +114 -0
  131. package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
  132. package/dist/settings.schema.json +163 -16
  133. package/dist/{simslim-ChMfe8rg.mjs → simslim-Cgk17SXV.mjs} +14 -13
  134. package/dist/{slot-launch-CeCRr6MK.mjs → slot-launch-DF8VfT64.mjs} +15 -20
  135. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  136. package/dist/stage-BIS0ydsV.mjs +183 -0
  137. package/dist/{start-CRkG-mZ7.mjs → start-7lpH7hmN.mjs} +66 -48
  138. package/dist/{start-mh6bS27z.mjs → start-RChynRDp.mjs} +1 -1
  139. package/dist/{state-lqxdOH_g.mjs → state-C4ZtUisW.mjs} +41 -14
  140. package/dist/{state-BUpAmt2r.mjs → state-XMziexv2.mjs} +3 -2
  141. package/dist/{stats-CaB1MxMi.mjs → stats-53T7OTb9.mjs} +7 -13
  142. package/dist/stats-report-BFfMpWWF.mjs +16 -0
  143. package/dist/{status-C7vzkInu.mjs → status-BL7jVyAB.mjs} +538 -467
  144. package/dist/status-CSi6tlRq.mjs +2 -0
  145. package/dist/{status-BDGHwkCs.mjs → status-DqEUSSxs.mjs} +6 -4
  146. package/dist/{status-watch-ZaVqRdtW.mjs → status-watch-GDCfqpTE.mjs} +187 -22
  147. package/dist/status-worker.d.mts +1 -0
  148. package/dist/status-worker.mjs +19 -0
  149. package/dist/stim-desktop-C12we7lz.mjs +112 -0
  150. package/dist/{stop-BU7JaFCg.mjs → stop-Bk_1qiV6.mjs} +2 -2
  151. package/dist/{stop-BO80KJoT.mjs → stop-CPzlM1L-.mjs} +138 -99
  152. package/dist/{stop-Cftw_sXJ.mjs → stop-D7h6jAXQ.mjs} +11 -10
  153. package/dist/supervisor-run.d.mts +8 -17
  154. package/dist/supervisor-run.mjs +63 -28
  155. package/dist/{support-Ca6PZbpr.mjs → support-67vraa1Q.mjs} +18 -11
  156. package/dist/{support-Co0wk8Cv.mjs → support-Dlu37g6H.mjs} +12 -12
  157. package/dist/{swiftpm-macos-siFSkmCO.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
  158. package/dist/toolchain-DhKwp9iI.mjs +2 -0
  159. package/dist/toolchain-Hp9sCpK4.mjs +873 -0
  160. package/dist/{trigger-C0MWBi8O.mjs → trigger-BAahxUPq.mjs} +20 -5
  161. package/dist/trigger-Bf3uDcpv.mjs +2 -0
  162. package/dist/{warm-progress-5FAXkXIg.mjs → warm-progress-BHX5r0Ei.mjs} +252 -176
  163. package/dist/{web-BTjzE8mc.mjs → web-CJmIj6AI.mjs} +18 -13
  164. package/dist/web-DknQETPs.mjs +2 -0
  165. package/dist/web-run.mjs +16 -17
  166. package/dist/windows-report.d.mts +1 -0
  167. package/dist/windows-report.mjs +18 -0
  168. package/dist/windows-report.ps1 +43 -0
  169. package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
  170. package/dist/{workspace-state-CvgTFe-h.mjs → workspace-state-Cjuigeeu.mjs} +70 -56
  171. package/dist/{workspaces-C4kqIOlx.mjs → workspaces-BccMFmGQ.mjs} +1188 -1080
  172. package/dist/worktree-CK2MpJW5.mjs +2 -0
  173. package/dist/{worktree-DtRsh6go.mjs → worktree-DQ6Zi2Mv.mjs} +368 -110
  174. package/dist/xcode-Zlx3qjEs.mjs +896 -0
  175. package/package.json +7 -5
  176. package/shim/android-optimizations.gradle +7 -5
  177. package/dist/activity-BaMpUQ4-.mjs +0 -629
  178. package/dist/api-run.mjs +0 -296
  179. package/dist/api-zuX3ynYN.mjs +0 -154
  180. package/dist/app-install-Cg9YJy3x.mjs +0 -873
  181. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  182. package/dist/budget-RFbwFpG5.mjs +0 -4109
  183. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  184. package/dist/client-zqjFd79D.mjs +0 -1779
  185. package/dist/config-D0LhTY3S.mjs +0 -524
  186. package/dist/device-BgNj-qVj.mjs +0 -290
  187. package/dist/device-lease-C309csaB.mjs +0 -1228
  188. package/dist/device-remote-DjsNw8DD.mjs +0 -1272
  189. package/dist/eas-session-ledger-DJDeL4Uq.mjs +0 -205
  190. package/dist/exec-B81Qodjn.mjs +0 -254
  191. package/dist/launch-verify-Dl78EVgR.mjs +0 -428
  192. package/dist/logs-Bh4eqCCc.mjs +0 -384
  193. package/dist/macos-kivF8qKz.mjs +0 -2
  194. package/dist/miss-reason-SuTptY-I.mjs +0 -238
  195. package/dist/native-android-D94RlJ-X.mjs +0 -226
  196. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  197. package/dist/plan-Jwu_vr-F.mjs +0 -260
  198. package/dist/prebuild-DB_zLOLc.mjs +0 -213
  199. package/dist/preview-BRLFRhTz.mjs +0 -1004
  200. package/dist/process-identity-Biv3arCO.mjs +0 -40
  201. package/dist/react-native-build-JUF31S8U.mjs +0 -239
  202. package/dist/react-native-doctor-BQHqiXaQ.mjs +0 -78
  203. package/dist/remote-cache-fxcl5C-L.mjs +0 -526
  204. package/dist/result-BrfgXtdO.mjs +0 -186
  205. package/dist/server-expo-Dvkd7JcF.mjs +0 -2
  206. package/dist/settings-BuKMOANA.mjs +0 -402
  207. package/dist/spawn-claims-Kqiifsk2.mjs +0 -72
  208. package/dist/stage-BNKKdDNc.mjs +0 -157
  209. package/dist/stim-desktop-8GQX2OV8.mjs +0 -63
  210. package/dist/tailnet-D7-tE_ug.mjs +0 -265
  211. package/dist/toolchain-B12psPA2.mjs +0 -2
  212. package/dist/toolchain-SqehyPLw.mjs +0 -1657
  213. package/dist/trigger-SHLOWJ4O.mjs +0 -2
  214. package/dist/web-CHN5gh34.mjs +0 -2
  215. package/dist/worktree-Cgnm6vZt.mjs +0 -2
  216. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  217. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,509 +1,49 @@
1
- import { t as getExecutor } from "./exec-B81Qodjn.mjs";
2
- import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
3
- import { E as upsertProject, L as deviceSlotFileKey, R as deviceSlotKey, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals } from "./config-D0LhTY3S.mjs";
4
- import { Et as repoRoot, Ft as removeTemporaryEntry, Pt as makeTemporaryDirectory, W as resolveCacheProviderConfig, Z as settingOriginScope, at as detectProviders, et as settingsLayers, mt as gitCommonDir, q as resolveSettings } from "./settings-Bbztm4oV.mjs";
5
- import { D as fingerprintProject, N as resolveBuild, P as storeBuild, R as untrackedNativeFiles, _ as waitForBuild, g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-C309csaB.mjs";
6
- import { c as writeWorkspaceState, r as readWorkspaceState, w as workspaceLogsDir } from "./workspace-state-CvgTFe-h.mjs";
7
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-CPDq_90S.mjs";
8
- import { I as workspaceDevServerMode, R as writeWorkspaceLaunch, _ as detectIsExpo, d as projectRegistry, r as findProjectRoot } from "./project-DX8fXyw_.mjs";
9
- import { a as workspaceLinks } from "./stim-desktop-8GQX2OV8.mjs";
10
- import { d as signalProcessTree, s as pidExists, u as resolveProjectMetro } from "./metro-_ZIE3Axg.mjs";
11
- import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-C4kqIOlx.mjs";
12
- import { Ft as recordRunStats, Nt as recordCapacityRefusal, jt as readRunEstimates, t as budgetGate } from "./budget-RFbwFpG5.mjs";
13
- import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
14
- import { c as loadProjectProvider, f as resolveEasCliBin, i as checkEasAuth, m as uploadRemote, p as resolveRemote } from "./remote-cache-fxcl5C-L.mjs";
15
- import { c as startDevServer, g as detectBundleId } from "./start-CRkG-mZ7.mjs";
16
- import { d as listAllIosSims, m as listIosRuntimes, r as clearIosAppData } from "./ios-o896T9PE.mjs";
17
- import { c as readMetroRecords, f as verifyLaunch, i as RELEASE_VERIFY_WAIT_MS, l as unattributedLaunchLines, n as LAUNCH_FATAL, o as isBundleProof, p as verifyReleaseLaunch, r as LAUNCH_UNVERIFIED, s as readCollectorRecords, t as LAUNCH_BUNDLING, u as unverifiedLaunchLines } from "./launch-verify-Dl78EVgR.mjs";
18
- import { S as restartedAppNote, _ as installIosApp, a as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, d as devClientUrl, l as clearOtherUserApps, v as iosAppProcess, x as launchIosApp } from "./app-install-Cg9YJy3x.mjs";
19
- import { a as sleep, i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-D024BAvm.mjs";
20
- import { A as readBundleId, f as podsAreStale, g as runPodInstall, j as resolveScheme, k as readBundleExecutable, p as readPodState } from "./toolchain-SqehyPLw.mjs";
21
- import { r as checkDeviceCapacity } from "./device-capacity-DrwHwR97.mjs";
22
- import { n as devClientTakesDevMenuParams, t as devClientScheme } from "./dev-client-BqYjMIaC.mjs";
23
- import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-JUF31S8U.mjs";
24
- import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnSignal } from "./device-lease-run-Baelt3nc.mjs";
25
- import { n as readHostedIos, o as writeHostedIos } from "./ios-state-BsXMwo5y.mjs";
26
- import { o as checkEasFallback, s as automaticDevicePlacement } from "./build-plan-CRjAA6Qi.mjs";
27
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CeCRr6MK.mjs";
28
- import { D as gateMetroOrigin, E as readRemoteSimulatorArch, a as ensureMetroReachable, l as remoteIosDeps, o as ensureRemoteBootOwned, r as bundleEntryPoint, u as resolveRemoteContext } from "./device-remote-DjsNw8DD.mjs";
29
- import { a as resolveEasDevelopmentBuild } from "./eas-build-0gadvrca.mjs";
30
- import { n as verifyCollectorOwnership } from "./ownership-BrjepDiv.mjs";
31
- import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-D4DqjSZZ.mjs";
32
- import { n as clearIosAdoptionPending } from "./device-ios-DE8KJd3b.mjs";
33
- import { t as selectFromPool } from "./device-pool-DtK9S6AD.mjs";
34
- import { a as printNativeCrashReport, n as IOS_CRASH_REPORT_RETRY, o as simulatorConsolePaths, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BhQtoLrZ.mjs";
35
- import { r as runPrebuild, t as planPrebuild } from "./prebuild-DB_zLOLc.mjs";
36
- import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-Co0wk8Cv.mjs";
37
- import { o as reportIosResult } from "./ios-project-BeOXKPt2.mjs";
38
- import { n as prepareHostedIos, t as placeHostedIos } from "./hosted-ios-Chx9XQyI.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-BWHKGaJq.mjs";
40
- import { i as swapJsBundle } from "./js-swap-Z_mSuRrx.mjs";
41
- import { existsSync, mkdirSync, mkdtempSync, openSync, rmSync, writeFileSync } from "node:fs";
1
+ import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
+ import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
3
+ import { E as upsertProject, H as deviceSlotKey, V as deviceSlotFileKey, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals } from "./config-CYcBF478.mjs";
4
+ import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-B1UrjZHL.mjs";
5
+ import { d as writeWorkspaceState, r as readWorkspaceState } from "./workspace-state-Cjuigeeu.mjs";
6
+ import { $ as settingOriginScope, G as resolveCacheProviderConfig, It as repoRootAsync, Qt as cancellableSleep, Xt as removeTemporaryEntry, Y as resolveSettings, Yt as makeTemporaryDirectory, ct as detectProviders, nt as settingsLayers, yt as gitCommonDirAsync } from "./settings-CsJDEXgK.mjs";
7
+ import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunch } from "./project-BZNjmW_8.mjs";
8
+ import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { f as resolveProjectMetro, l as pidExists, p as signalProcessTree } from "./metro-DEXpIhHC.mjs";
10
+ import { $t as readCollectorRecords, Bn as checkEasAuth, Bt as ensureMetroReachable, En as restartedAppNote, Gt as resolveRemoteContext, J as recordRunStats, Jn as resolveRemote, Jt as LAUNCH_FATAL, K as recordCapacityRefusal, Mn as readRemoteSimulatorArch, Nn as gateMetroOrigin, Qt as isBundleProof, Rt as bundleEntryPoint, Sn as iosAppProcess, Tn as launchIosApp, Un as loadProjectProvider, Vt as ensureRemoteBootOwned, W as readRunEstimates, Wt as remoteIosDeps, Xt as RELEASE_VERIFY_WAIT_MS, Yn as uploadRemote, Yt as LAUNCH_UNVERIFIED, an as verifyReleaseLaunch, en as readMetroRecords, hn as devClientUrl, in as verifyLaunch, mn as clearOtherUserApps, nn as unverifiedLaunchLines, qn as resolveEasCliBin, qt as LAUNCH_BUNDLING, t as budgetGate, tn as unattributedLaunchLines, un as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, xn as installIosApp } from "./budget-Bs6SxxzO.mjs";
11
+ import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-BccMFmGQ.mjs";
12
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-BzVfHSrY.mjs";
13
+ import { b as untrackedNativeFiles, g as storeBuild, h as resolveBuild, l as fingerprintProject } from "./build-cache-DmyR9Zzc.mjs";
14
+ import { d as listAllIosSims, m as listIosRuntimes, r as clearIosAppData } from "./ios-CpByZy12.mjs";
15
+ import { o as workspaceLinks } from "./stim-desktop-C12we7lz.mjs";
16
+ import { f as readBundleExecutable, m as resolveScheme, p as readBundleId } from "./xcode-Zlx3qjEs.mjs";
17
+ import { _ as runPodInstall, m as readPodState, p as podsAreStale } from "./toolchain-Hp9sCpK4.mjs";
18
+ import { n as readHostedIos, o as writeHostedIos } from "./ios-state-DvFX-K_l.mjs";
19
+ import { n as prepareHostedIos, t as placeHostedIos } from "./hosted-ios-CUvOf4Vr.mjs";
20
+ import { n as verifyCollectorOwnership } from "./ownership-DEmM5vhh.mjs";
21
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DF8VfT64.mjs";
22
+ import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-rhk4smwQ.mjs";
23
+ 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-C8raGFoP.mjs";
24
+ import { r as checkDeviceCapacity } from "./device-capacity-CMlqEcvw.mjs";
25
+ import { n as clearIosAdoptionPending } from "./device-ios-DRUeKaFV.mjs";
26
+ import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-Dlu37g6H.mjs";
27
+ import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-DTTIChGs.mjs";
28
+ import { a as resolveEasDevelopmentBuild } from "./eas-build-BomfRnFT.mjs";
29
+ import { a as printNativeCrashReport, n as IOS_CRASH_REPORT_RETRY, o as simulatorConsolePaths, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-Bf0rZvG9.mjs";
30
+ import { c as startDevServer, g as detectBundleId } from "./start-7lpH7hmN.mjs";
31
+ import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
32
+ import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-Dg1Q7tfF.mjs";
33
+ import { r as runPrebuild, t as planPrebuild } from "./prebuild-uD_ipCxF.mjs";
34
+ import { n as devClientTakesDevMenuParams, t as devClientScheme } from "./dev-client-UOeESKm6.mjs";
35
+ import { n as automaticDevicePlacement, t as checkEasFallback } from "./eas-fallback-DJwZpy0c.mjs";
36
+ import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-ExJq8Ei7.mjs";
37
+ import { t as selectFromPool } from "./device-pool-DMRpVX9a.mjs";
38
+ import { o as reportIosResult } from "./ios-project-WuwwBdvW.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-CwFMehUS.mjs";
40
+ import { i as swapJsBundle } from "./js-swap-Cc1dttps.mjs";
41
+ import { mkdirSync, openSync, writeFileSync } from "node:fs";
42
+ import { networkInterfaces } from "node:os";
42
43
  import { basename, join } from "node:path";
43
- import { loadCacheProvider } from "@stim-cli/cache";
44
- import { hostSimulatorArch } from "@stim-cli/core";
45
- import { X509Certificate } from "node:crypto";
46
- import { networkInterfaces, tmpdir } from "node:os";
44
+ import { ambientEnv, hostSimulatorArch } from "@stim-cli/core";
47
45
  import chalk from "chalk";
48
- //#region src/engine/ios-profile.ts
49
- const TAG = /<(\/?)\s*([A-Za-z0-9_]+)(?:\s[^>]*?)?(\/?)>/g;
50
- const ENTITIES = {
51
- amp: "&",
52
- lt: "<",
53
- gt: ">",
54
- quot: "\"",
55
- apos: "'"
56
- };
57
- var PlistError = class extends Error {};
58
- function codePoint(value) {
59
- if (!Number.isInteger(value) || value < 0 || value > 1114111 || value >= 55296 && value <= 57343) throw new PlistError(`character reference out of range: ${value}`);
60
- return String.fromCodePoint(value);
61
- }
62
- function decodeEntities(raw) {
63
- return raw.replace(/&(#x?[0-9A-Fa-f]+|[a-z]+);/g, (match, body) => {
64
- if (body.startsWith("#x") || body.startsWith("#X")) return codePoint(Number.parseInt(body.slice(2), 16));
65
- if (body.startsWith("#")) return codePoint(Number.parseInt(body.slice(1), 10));
66
- return ENTITIES[body] ?? match;
67
- });
68
- }
69
- function peekTag(cursor) {
70
- TAG.lastIndex = cursor.pos;
71
- const match = TAG.exec(cursor.xml);
72
- if (!match) return null;
73
- return {
74
- name: (match[2] ?? "").toLowerCase(),
75
- closing: match[1] === "/",
76
- selfClosing: match[3] === "/",
77
- end: TAG.lastIndex
78
- };
79
- }
80
- function takeTag(cursor) {
81
- const tag = peekTag(cursor);
82
- if (tag) cursor.pos = tag.end;
83
- return tag;
84
- }
85
- function takeText(cursor, name) {
86
- const close = cursor.xml.indexOf(`</${name}>`, cursor.pos);
87
- if (close < 0) {
88
- cursor.pos = cursor.xml.length;
89
- return "";
90
- }
91
- const raw = cursor.xml.slice(cursor.pos, close);
92
- cursor.pos = close + name.length + 3;
93
- return raw;
94
- }
95
- function parseValue(cursor) {
96
- const peeked = peekTag(cursor);
97
- if (!peeked || peeked.closing) return void 0;
98
- const tag = takeTag(cursor);
99
- if (tag.selfClosing) {
100
- if (tag.name === "true") return true;
101
- if (tag.name === "false") return false;
102
- if (tag.name === "array") return [];
103
- if (tag.name === "dict") return {};
104
- return "";
105
- }
106
- switch (tag.name) {
107
- case "plist": return parseValue(cursor);
108
- case "dict": {
109
- const out = {};
110
- for (;;) {
111
- const next = peekTag(cursor);
112
- if (!next) break;
113
- if (next.closing) {
114
- cursor.pos = next.end;
115
- break;
116
- }
117
- cursor.pos = next.end;
118
- if (next.name !== "key") continue;
119
- const key = decodeEntities(next.selfClosing ? "" : takeText(cursor, "key"));
120
- const value = parseValue(cursor);
121
- if (value !== void 0) out[key] = value;
122
- }
123
- return out;
124
- }
125
- case "array": {
126
- const out = [];
127
- for (;;) {
128
- const next = peekTag(cursor);
129
- if (!next) break;
130
- if (next.closing) {
131
- cursor.pos = next.end;
132
- break;
133
- }
134
- const value = parseValue(cursor);
135
- if (value === void 0) break;
136
- out.push(value);
137
- }
138
- return out;
139
- }
140
- case "string":
141
- case "key": return decodeEntities(takeText(cursor, tag.name));
142
- case "integer": return Number.parseInt(takeText(cursor, "integer").trim(), 10);
143
- case "real": return Number.parseFloat(takeText(cursor, "real").trim());
144
- case "date": return new Date(takeText(cursor, "date").trim());
145
- case "data": return Buffer.from(takeText(cursor, "data").replace(/\s+/g, ""), "base64");
146
- case "true":
147
- takeText(cursor, "true");
148
- return true;
149
- case "false":
150
- takeText(cursor, "false");
151
- return false;
152
- default:
153
- takeText(cursor, tag.name);
154
- return "";
155
- }
156
- }
157
- function parsePlist(xml) {
158
- if (typeof xml !== "string" || xml.trim() === "") return null;
159
- const stripped = xml.replace(/<!--[\s\S]*?-->/g, "");
160
- const start = stripped.indexOf("<plist");
161
- const cursor = {
162
- xml: stripped,
163
- pos: start < 0 ? 0 : start
164
- };
165
- try {
166
- const value = parseValue(cursor);
167
- return value === void 0 ? null : value;
168
- } catch {
169
- return null;
170
- }
171
- }
172
- function isDict(value) {
173
- return value !== null && typeof value === "object" && !Array.isArray(value) && !Buffer.isBuffer(value) && !(value instanceof Date);
174
- }
175
- function stringsOf(value) {
176
- if (!Array.isArray(value)) return null;
177
- return value.filter((v) => typeof v === "string");
178
- }
179
- function parseProvisioningProfilePlist(xml) {
180
- const root = parsePlist(xml);
181
- if (!isDict(root)) return null;
182
- const entitlements = isDict(root.Entitlements ?? null) ? root.Entitlements : {};
183
- const teamIdentifier = stringsOf(root.TeamIdentifier);
184
- const expiration = root.ExpirationDate;
185
- const certificates = Array.isArray(root.DeveloperCertificates) ? root.DeveloperCertificates.filter((v) => Buffer.isBuffer(v)) : [];
186
- return {
187
- name: typeof root.Name === "string" ? root.Name : null,
188
- uuid: typeof root.UUID === "string" ? root.UUID : null,
189
- teamIdentifier: teamIdentifier?.[0] ?? null,
190
- expirationDate: expiration instanceof Date && !Number.isNaN(expiration.getTime()) ? expiration : null,
191
- provisionedDevices: stringsOf(root.ProvisionedDevices),
192
- provisionsAllDevices: root.ProvisionsAllDevices === true,
193
- getTaskAllow: entitlements["get-task-allow"] === true,
194
- certificates
195
- };
196
- }
197
- function provisioningProfileKind(profile) {
198
- if (profile.provisionedDevices) return profile.getTaskAllow ? "development" : "ad hoc";
199
- return profile.provisionsAllDevices ? "enterprise" : "App Store";
200
- }
201
- function certificateCommonName(der) {
202
- if (!Buffer.isBuffer(der) || der.length === 0) return null;
203
- let subject;
204
- try {
205
- subject = new X509Certificate(der).subject;
206
- } catch {
207
- return null;
208
- }
209
- for (const part of String(subject).split(/\r?\n/)) {
210
- const trimmed = part.trim();
211
- if (trimmed.startsWith("CN=")) return trimmed.slice(3).trim() || null;
212
- }
213
- return /(?:^|,)\s*CN=([^,]+)/.exec(String(subject))?.[1]?.trim() || null;
214
- }
215
- const IDENTITY_LINE = /^\s*\d+\)\s+([0-9A-Fa-f]{40})\s+"(.+)"\s*$/;
216
- function parseSigningIdentities(text) {
217
- if (typeof text !== "string") return [];
218
- const out = [];
219
- for (const line of text.split(/\r?\n/)) {
220
- const match = IDENTITY_LINE.exec(line);
221
- if (!match) continue;
222
- out.push({
223
- sha1: match[1].toUpperCase(),
224
- name: match[2]
225
- });
226
- }
227
- return out;
228
- }
229
- const SIGNING_CODES = {
230
- noProfile: "STIM_NO_PROFILE",
231
- profileMismatch: "STIM_PROFILE_MISMATCH",
232
- noIdentity: "STIM_NO_SIGNING_IDENTITY",
233
- codesignFailed: "STIM_CODESIGN_FAILED"
234
- };
235
- const XCODE_STEP = "build once from Xcode to install it -- Stim will not, because registering a device or minting a profile changes your Apple Developer account.";
236
- const KEYCHAIN_REMEDY = "Open Xcode > Settings > Accounts and download your certificates, or unlock the login keychain with `security unlock-keychain`. `security find-identity -v -p codesigning` should list `Apple Development: ...`.";
237
- function signingConfiguration(input) {
238
- return input.configuration ?? "Debug";
239
- }
240
- function profileGate(input) {
241
- const now = input.now ?? Date.now();
242
- if (!input.profilePresent) return {
243
- ok: false,
244
- code: SIGNING_CODES.noProfile,
245
- reason: "The app bundle has no embedded.mobileprovision, so it was built unsigned or for the simulator.",
246
- remedy: `Set a team and profile for the target's ${signingConfiguration(input)} configuration in Xcode > Signing & Capabilities, then ${XCODE_STEP}`
247
- };
248
- if (!input.profile) return {
249
- ok: false,
250
- code: SIGNING_CODES.noProfile,
251
- reason: "`openssl smime` could not decode the app bundle's embedded.mobileprovision.",
252
- remedy: `The profile inside the app is corrupt. Delete the build cache entry with \`stim gc --delete\`, then ${XCODE_STEP}`
253
- };
254
- const profile = input.profile;
255
- const named = profile.name ? `"${profile.name}"` : "the embedded profile";
256
- if (!profile.expirationDate || profile.expirationDate.getTime() <= now) return {
257
- ok: false,
258
- code: SIGNING_CODES.profileMismatch,
259
- reason: profile.expirationDate ? `The ${provisioningProfileKind(profile)} profile ${named} expired on ${profile.expirationDate.toISOString()}.` : `The ${provisioningProfileKind(profile)} profile ${named} carries no ExpirationDate, so Stim cannot prove it is still valid.`,
260
- remedy: `Renew the profile under Signing & Capabilities, then ${XCODE_STEP}`
261
- };
262
- if (!profile.provisionedDevices) {
263
- const kind = provisioningProfileKind(profile);
264
- return {
265
- ok: false,
266
- code: SIGNING_CODES.profileMismatch,
267
- reason: `${named} is an ${kind} profile, which carries no ProvisionedDevices list, so Stim cannot prove ${input.udid ?? "the target device"} is admitted.`,
268
- remedy: `Local device runs need a development profile. Select one under Signing & Capabilities, then ${XCODE_STEP}`
269
- };
270
- }
271
- const udid = input.udid;
272
- if (!udid || !profile.provisionedDevices.some((d) => d.toLowerCase() === udid.toLowerCase())) return {
273
- ok: false,
274
- code: SIGNING_CODES.profileMismatch,
275
- reason: `The ${provisioningProfileKind(profile)} profile ${named} lists ${profile.provisionedDevices.length} device(s) and ${udid ?? "the target device"} is not one of them.`,
276
- remedy: `Register ${udid ?? "the device"} at developer.apple.com, regenerate the profile, then ${XCODE_STEP}`
277
- };
278
- return {
279
- ok: true,
280
- profile
281
- };
282
- }
283
- function signingGate(input) {
284
- const gated = profileGate(input);
285
- if (!gated.ok) return gated;
286
- const profile = gated.profile;
287
- const named = profile.name ? `"${profile.name}"` : "the embedded profile";
288
- const identities = Array.isArray(input.identities) ? input.identities : [];
289
- if (identities.length === 0) return {
290
- ok: false,
291
- code: SIGNING_CODES.noIdentity,
292
- reason: "`security find-identity -v -p codesigning` lists no codesigning identity on this machine.",
293
- remedy: KEYCHAIN_REMEDY
294
- };
295
- if (input.pinnedSha1) {
296
- const wanted = input.pinnedSha1.trim().toUpperCase();
297
- const match = identities.find((i) => i.sha1 === wanted);
298
- if (match) return {
299
- ok: true,
300
- identity: match
301
- };
302
- return {
303
- ok: false,
304
- code: SIGNING_CODES.noIdentity,
305
- reason: `ios.signingIdentitySha1 is ${wanted}, which is not in the keychain. Available: ${identities.map((i) => `${i.sha1} "${i.name}"`).join(", ")}.`,
306
- remedy: KEYCHAIN_REMEDY
307
- };
308
- }
309
- const wantedName = input.pinnedName?.trim() || certificateCommonName(profile.certificates[0] ?? null);
310
- if (!wantedName) return {
311
- ok: false,
312
- code: SIGNING_CODES.noIdentity,
313
- reason: `Stim could not read a signing-identity name out of ${named}: its DeveloperCertificates entry has no readable subject CN.`,
314
- remedy: "Set ios.signingIdentity in .stim.json to the identity name to re-sign with, or ios.signingIdentitySha1 to its SHA-1 hash."
315
- };
316
- const matches = identities.filter((i) => i.name === wantedName);
317
- if (matches.length === 1) return {
318
- ok: true,
319
- identity: matches[0]
320
- };
321
- if (matches.length === 0) return {
322
- ok: false,
323
- code: SIGNING_CODES.noIdentity,
324
- reason: `The app was signed by "${wantedName}", which is not in this machine's keychain. Available: ${identities.map((i) => `"${i.name}"`).join(", ")}.`,
325
- remedy: `${KEYCHAIN_REMEDY} Or set ios.signingIdentity in .stim.json to one of the identities listed above.`
326
- };
327
- return {
328
- ok: false,
329
- code: SIGNING_CODES.noIdentity,
330
- reason: `${matches.length} keychain identities share the name "${wantedName}", so Stim cannot pick one: ${matches.map((i) => i.sha1).join(", ")}.`,
331
- remedy: "Set ios.signingIdentitySha1 in .stim.json to the SHA-1 hash of the certificate to sign with."
332
- };
333
- }
334
- //#endregion
335
- //#region src/engine/ios-signing.ts
336
- const EMBEDDED_PROFILE = "embedded.mobileprovision";
337
- const SIGNING_TIMEOUT_MS = 12e4;
338
- function lastLines(text, count = 5) {
339
- return String(text ?? "").split(/\r?\n/).map((line) => line.trimEnd()).filter((line) => line.trim() !== "").slice(-count);
340
- }
341
- function errorText(error) {
342
- const withOutput = error;
343
- const stderr = String(withOutput?.stderr ?? "").trim();
344
- const stdout = String(withOutput?.stdout ?? "").trim();
345
- return stderr || stdout || String(withOutput?.message ?? error);
346
- }
347
- function readEmbeddedProfile(appPath, { exec = null } = {}) {
348
- const executor = exec || getExecutor();
349
- const path = join(appPath, EMBEDDED_PROFILE);
350
- if (!existsSync(path)) return {
351
- present: false,
352
- profile: null
353
- };
354
- try {
355
- return {
356
- present: true,
357
- profile: parseProvisioningProfilePlist(executor.runFile("/usr/bin/openssl", [
358
- "smime",
359
- "-verify",
360
- "-noverify",
361
- "-inform",
362
- "DER",
363
- "-in",
364
- path
365
- ], { timeoutMs: SIGNING_TIMEOUT_MS }))
366
- };
367
- } catch {
368
- return {
369
- present: true,
370
- profile: null
371
- };
372
- }
373
- }
374
- function findSigningIdentities({ exec = null } = {}) {
375
- const executor = exec || getExecutor();
376
- try {
377
- return parseSigningIdentities(executor.runFile("security", [
378
- "find-identity",
379
- "-v",
380
- "-p",
381
- "codesigning"
382
- ], { timeoutMs: SIGNING_TIMEOUT_MS }));
383
- } catch {
384
- return [];
385
- }
386
- }
387
- function gateProfileForDevice(options) {
388
- const read = readEmbeddedProfile(options.appPath, { exec: options.exec ?? null });
389
- return profileGate({
390
- profilePresent: read.present,
391
- profile: read.profile,
392
- identities: [],
393
- udid: options.udid,
394
- configuration: options.configuration ?? null,
395
- ...options.now === void 0 ? {} : { now: options.now }
396
- });
397
- }
398
- function gateAppForDevice(options) {
399
- const read = readEmbeddedProfile(options.appPath, { exec: options.exec ?? null });
400
- return signingGate({
401
- profilePresent: read.present,
402
- profile: read.profile,
403
- identities: read.present ? findSigningIdentities({ exec: options.exec ?? null }) : [],
404
- udid: options.udid,
405
- configuration: options.configuration ?? null,
406
- pinnedName: options.pinnedName ?? null,
407
- pinnedSha1: options.pinnedSha1 ?? null,
408
- ...options.now === void 0 ? {} : { now: options.now }
409
- });
410
- }
411
- function extractEntitlements(appPath, executor) {
412
- try {
413
- return String(executor.runFile("codesign", [
414
- "-d",
415
- "--entitlements",
416
- "-",
417
- "--xml",
418
- appPath
419
- ], { timeoutMs: SIGNING_TIMEOUT_MS })).trim();
420
- } catch {
421
- return "";
422
- }
423
- }
424
- function resealBundle({ appPath, identity, exec = null }) {
425
- const executor = exec || getExecutor();
426
- const signAs = identity.sha1 || identity.name;
427
- let mode = "preserve-metadata";
428
- let preserveError = null;
429
- try {
430
- executor.runFile("codesign", [
431
- "--force",
432
- "--sign",
433
- signAs,
434
- "--preserve-metadata=identifier,entitlements,flags,runtime",
435
- appPath
436
- ], { timeoutMs: SIGNING_TIMEOUT_MS });
437
- } catch (error) {
438
- preserveError = error;
439
- }
440
- let tempDir = null;
441
- if (preserveError) {
442
- const entitlements = extractEntitlements(appPath, executor);
443
- const args = [
444
- "--force",
445
- "--sign",
446
- signAs
447
- ];
448
- if (entitlements !== "") {
449
- tempDir = mkdtempSync(join(tmpdir(), "stim-entitlements-"));
450
- const plist = join(tempDir, "entitlements.plist");
451
- writeFileSync(plist, `${entitlements}\n`, "utf-8");
452
- args.push("--entitlements", plist);
453
- mode = "entitlements";
454
- } else mode = "no-entitlements";
455
- args.push(appPath);
456
- try {
457
- executor.runFile("codesign", args, { timeoutMs: SIGNING_TIMEOUT_MS });
458
- } catch (error) {
459
- return {
460
- ok: false,
461
- code: SIGNING_CODES.codesignFailed,
462
- reason: `codesign could not re-seal ${appPath} with "${identity.name}": ${errorText(error)}`,
463
- remedy: `Unlock the login keychain (\`security unlock-keychain\`) and confirm exactly one identity matches "${identity.name}".`,
464
- lastLines: [...lastLines(errorText(preserveError)), ...lastLines(errorText(error))]
465
- };
466
- } finally {
467
- if (tempDir) rmSync(tempDir, {
468
- recursive: true,
469
- force: true
470
- });
471
- }
472
- }
473
- try {
474
- executor.runFile("codesign", [
475
- "--verify",
476
- "--strict",
477
- appPath
478
- ], { timeoutMs: SIGNING_TIMEOUT_MS });
479
- } catch (error) {
480
- return {
481
- ok: false,
482
- code: SIGNING_CODES.codesignFailed,
483
- reason: `codesign --verify --strict rejected ${appPath} after re-sealing it with "${identity.name}": ${errorText(error)}`,
484
- remedy: "The bundle signed but did not seal. Delete the cached artifact with `stim gc --delete` and build fresh, then retry.",
485
- lastLines: lastLines(errorText(error))
486
- };
487
- }
488
- return {
489
- ok: true,
490
- identity,
491
- mode
492
- };
493
- }
494
- function sealAppForDevice(options) {
495
- const gate = gateAppForDevice(options);
496
- if (!gate.ok) return {
497
- ...gate,
498
- lastLines: []
499
- };
500
- return resealBundle({
501
- appPath: options.appPath,
502
- identity: gate.identity,
503
- exec: options.exec ?? null
504
- });
505
- }
506
- //#endregion
46
+ import { loadCacheProvider } from "@stim-cli/cache";
507
47
  //#region src/engine/ios-lan.ts
508
48
  const IP_TXT = "ip.txt";
509
49
  function chooseLanAddress({ pinned = null, candidates }) {
@@ -559,7 +99,7 @@ function copyAppAside(appPath, { exec = null, mkdtemp = () => makeTemporaryDirec
559
99
  "-R",
560
100
  appPath,
561
101
  copy
562
- ]);
102
+ ], { timeoutMs: "unbounded" });
563
103
  } catch {
564
104
  try {
565
105
  removeTemporaryEntry(copy);
@@ -567,7 +107,7 @@ function copyAppAside(appPath, { exec = null, mkdtemp = () => makeTemporaryDirec
567
107
  "-R",
568
108
  appPath,
569
109
  copy
570
- ]);
110
+ ], { timeoutMs: "unbounded" });
571
111
  } catch (error) {
572
112
  removeTemporaryEntry(tmpDir);
573
113
  throw error;
@@ -645,7 +185,7 @@ async function stopPreviousCollector({ root, slot = "default", kill = (pid, sign
645
185
  if (err?.code !== "ESRCH") note(chalk.yellow(`Could not stop the previous ios log collector (pid ${previousPid}): ${err?.message || err}`));
646
186
  }
647
187
  const deadline = Date.now() + waitMs;
648
- while (Date.now() < deadline && alive(previousPid)) await sleep(COLLECTOR_POLL_MS);
188
+ while (Date.now() < deadline && alive(previousPid)) await cancellableSleep(COLLECTOR_POLL_MS);
649
189
  } else if (ownership.status === "unverified") note(chalk.dim(`Previous ios log collector (pid ${previousPid}): ${ownership.reason}, so it was not signalled -- starting a replacement anyway`));
650
190
  }
651
191
  return { killed };
@@ -693,7 +233,7 @@ async function replaceCollector({ root, slot = "default", udid, bundleId, appNam
693
233
  cwd: root,
694
234
  detached: true,
695
235
  stdio,
696
- env: process.env
236
+ env: ambientEnv()
697
237
  });
698
238
  child?.unref?.();
699
239
  } catch (err) {
@@ -723,8 +263,8 @@ const DEFAULT_DEPS = {
723
263
  resolveSettings,
724
264
  settingsLayers,
725
265
  settingOriginScope,
726
- gitCommonDir,
727
- repoRoot,
266
+ gitCommonDir: gitCommonDirAsync,
267
+ repoRoot: repoRootAsync,
728
268
  detectBundleId,
729
269
  detectIsExpo,
730
270
  devClientScheme,
@@ -785,7 +325,7 @@ const DEFAULT_DEPS = {
785
325
  acquireRunLease,
786
326
  runLease,
787
327
  selectFromPool,
788
- releaseLeaseOnSignal,
328
+ releaseLeaseOnAbort,
789
329
  iosDeviceProcess,
790
330
  verifyIosDeviceReleaseLaunch,
791
331
  readBundleId,
@@ -851,7 +391,7 @@ function iosMetroRuntime(prepare) {
851
391
  function missingCrashReportHint({ physical, remote, crashed }) {
852
392
  return crashed && !physical && !remote ? `No attributable native crash report captured yet. ${IOS_CRASH_REPORT_RETRY}` : "No attributable native crash report captured. Read `stim logs --source device` for available output.";
853
393
  }
854
- async function verifyIosProcessRun({ root, slot, appPath, d, launched, configuration, phase, note, logsDir, launchedAt, bundleId, udid, physical, appName, remoteDevice, embeddedJavaScript }) {
394
+ async function verifyIosProcessRun({ operation, root, slot, appPath, d, launched, configuration, phase, note, logsDir, launchedAt, bundleId, udid, physical, appName, remoteDevice, embeddedJavaScript }) {
855
395
  const readNativeCrashes = () => remoteDevice ? [] : captureNativeCrashes({
856
396
  root,
857
397
  slot,
@@ -861,12 +401,12 @@ async function verifyIosProcessRun({ root, slot, appPath, d, launched, configura
861
401
  since: launchedAt,
862
402
  appPath,
863
403
  physical
864
- }, logsDir);
404
+ }, logsDir, operation?.signal, operation?.env);
865
405
  const processCheck = physical ? await d.verifyIosDeviceReleaseLaunch({
866
406
  udid,
867
407
  appName: appName ?? bundleId
868
408
  }) : await d.verifyReleaseLaunch({ pid: launched?.pid ?? null });
869
- const crashes = readNativeCrashes();
409
+ const crashes = await readNativeCrashes();
870
410
  if (processCheck?.verified && !crashes.length) {
871
411
  phase("verify", `process alive ${formatDuration(processCheck.waitedMs ?? 0)} after launch (${configuration}: no bundle fetch to observe)`);
872
412
  return { state: true };
@@ -881,7 +421,7 @@ async function verifyIosProcessRun({ root, slot, appPath, d, launched, configura
881
421
  note(chalk.yellow(phaseLine("", `${embeddedJavaScript ? "Release" : "Process"} readiness was not established. Run \`stim logs --errors\` for captured crash reports, or \`stim logs --source device\` for the full device output.`)));
882
422
  return { state: crashes.length || processCheck?.reason === "exited" ? LAUNCH_FATAL : LAUNCH_UNVERIFIED };
883
423
  }
884
- async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note, metroCheck, logsDir, launchedAt, metroPort, isExpo, bundleId, udid, scheme, physical, appName, lanAddress, lanOrigin, remoteDevice, metroOrigin, enterActivity }) {
424
+ async function verifyIosMetroRun({ operation, root, slot, appPath, d, launched, phase, note, metroCheck, logsDir, launchedAt, metroPort, isExpo, bundleId, udid, scheme, physical, appName, lanAddress, lanOrigin, remoteDevice, metroOrigin, enterActivity }) {
885
425
  const runCommand = nativeRunCommand("ios", slot, {
886
426
  physical,
887
427
  deviceId: udid
@@ -895,15 +435,15 @@ async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note
895
435
  since: launchedAt,
896
436
  appPath,
897
437
  physical
898
- }, logsDir);
899
- const deviceProcess = () => {
900
- const pid = d.iosDeviceProcess({
438
+ }, logsDir, operation?.signal, operation?.env);
439
+ const deviceProcess = async () => {
440
+ const running = await d.iosDeviceProcess({
901
441
  udid,
902
442
  appName: appName ?? bundleId
903
443
  });
904
- return pid === void 0 ? null : pid !== null;
444
+ return running.state === "unknown" ? null : running.state === "running";
905
445
  };
906
- const siblings = metroCheck ? siblingPlatformSlots(root, "ios", slot) : [];
446
+ const siblings = metroCheck ? await siblingPlatformSlots(root, "ios", slot) : [];
907
447
  const verification = metroCheck ? await d.verifyLaunch({
908
448
  requireBundleResponse: true,
909
449
  slot: launchSlotScope(root, slot),
@@ -917,16 +457,16 @@ async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note
917
457
  platform: "ios",
918
458
  mode: workspaceDevServerMode(root, isExpo),
919
459
  readNativeCrashes,
920
- processAlive: remoteDevice ? null : physical ? deviceProcess : () => {
460
+ processAlive: remoteDevice ? null : physical ? deviceProcess : async () => {
921
461
  if (launched?.pid) return d.pidExists(launched.pid);
922
- const pid = iosAppProcess(udid, bundleId);
923
- return pid === void 0 ? null : pid !== null;
462
+ const running = await iosAppProcess(udid, bundleId);
463
+ return running.state === "unknown" ? null : running.state === "running";
924
464
  }
925
465
  }) : {
926
466
  verified: false,
927
467
  skipped: true
928
468
  };
929
- const nativeCrashes = verification.errors?.some((record) => record.event === "native_crash") ? [] : readNativeCrashes();
469
+ const nativeCrashes = verification.errors?.some((record) => record.event === "native_crash") ? [] : await readNativeCrashes();
930
470
  if (nativeCrashes.length) verification.fatal = true;
931
471
  verification.errors = await errorDiagnostics([...verification.errors ?? [], ...nativeCrashes], {
932
472
  root,
@@ -1039,14 +579,14 @@ function reportLaunchErrors(errors, note, root) {
1039
579
  for (const line of report.lines) note(chalk.yellow(phaseLine("launch", line)));
1040
580
  return report.lines.length > 0;
1041
581
  }
1042
- function installsOverWifi(d, udid, selectedWireless, note) {
1043
- const current = d.listIosDevices().find((entry) => entry.udid === udid);
582
+ async function installsOverWifi(d, udid, selectedWireless, note) {
583
+ const current = (await d.listIosDevices()).find((entry) => entry.udid === udid);
1044
584
  const wireless = current ? isWirelessIosDevice(current) : selectedWireless;
1045
585
  if (wireless) note(phaseLine("device", `${current?.name ?? udid} is paired over Wi-Fi, so the install and launch go over the network and take longer than over a cable`));
1046
586
  return wireless;
1047
587
  }
1048
- function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1049
- const swept = d.clearOtherUserApps({
588
+ async function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
589
+ const swept = await d.clearOtherUserApps({
1050
590
  udid,
1051
591
  keep: bundleId
1052
592
  });
@@ -1054,7 +594,7 @@ function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1054
594
  if (swept.listed && swept.failed.length === 0) {
1055
595
  if (swept.kept && bundleId) {
1056
596
  try {
1057
- d.clearIosAppData(udid, bundleId, { defaultsPlist: devClient ? IOS_DEV_MENU_OFF_DEFAULTS_PLIST : null });
597
+ await d.clearIosAppData(udid, bundleId, { defaultsPlist: devClient ? IOS_DEV_MENU_OFF_DEFAULTS_PLIST : null });
1058
598
  } catch (error) {
1059
599
  return `Could not clear the data ${bundleId} kept from the previous workspace: ${String(error?.message || error)}`;
1060
600
  }
@@ -1069,12 +609,12 @@ function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1069
609
  function installMayBeProven(adopting, parkedCacheKey, storeKey) {
1070
610
  return !adopting || !parkedCacheKey || parkedCacheKey === storeKey;
1071
611
  }
1072
- function resolveRunBundleId(d, projectBundleId, appPath, bundleId) {
612
+ async function resolveRunBundleId(d, projectBundleId, appPath, bundleId) {
1073
613
  if (!appPath || bundleId) return bundleId;
1074
- return d.readBundleId(appPath) || projectBundleId();
614
+ return await d.readBundleId(appPath) || await projectBundleId();
1075
615
  }
1076
- function readRunExecutable(d, appPath, note) {
1077
- const executable = appPath ? d.readBundleExecutable(appPath) : null;
616
+ async function readRunExecutable(d, appPath, note) {
617
+ const executable = appPath ? await d.readBundleExecutable(appPath) : null;
1078
618
  if (appPath && !executable) note(chalk.dim(`Could not read CFBundleExecutable from ${appPath}; the device log predicate falls back to the .app basename.`));
1079
619
  return executable;
1080
620
  }
@@ -1100,7 +640,7 @@ function launchFailureRemedy(remoteDevice, udid, bundleId, logFile) {
1100
640
  if (remoteDevice) return remoteDevice.failureRemedy();
1101
641
  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}.`;
1102
642
  }
1103
- async function finishIosRun({ 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 }) {
643
+ 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 }) {
1104
644
  const { path: appPath, bundleId: initialBundleId, failureFields: buildFailure, cache } = artifact;
1105
645
  const { hit: cacheHit, providerName, buildMachine, builtOn, offloadedTo, offloadFallback, readEnabled: useBuildCache, missReason, waitedForBuild, compilation: compilationCache } = cache;
1106
646
  const storeHash = cache.identity?.fingerprint ?? null;
@@ -1129,7 +669,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1129
669
  }
1130
670
  return null;
1131
671
  };
1132
- bundleId = resolveRunBundleId(d, projectBundleId, appPath, bundleId);
672
+ bundleId = await resolveRunBundleId(d, projectBundleId, appPath, bundleId);
1133
673
  if (appPath && !bundleId) return fail({
1134
674
  code: "STIM_INSTALL_FAILED",
1135
675
  message: `Could not read a bundle identifier from the cached app at ${appPath}.`,
@@ -1154,13 +694,13 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1154
694
  const scheme = runtime.scheme(root, appPath, d);
1155
695
  const devMenuParams = runtime.devMenuParams(root, d);
1156
696
  const appName = appNameFromPath(appPath);
1157
- const appExecutable = readRunExecutable(d, appPath, note);
697
+ const appExecutable = await readRunExecutable(d, appPath, note);
1158
698
  const dropSwapDir = artifact.release;
1159
699
  let installSkipped = false;
1160
700
  let launched;
1161
701
  let launchedAt = d.now();
1162
702
  if (physical) {
1163
- const overWifi = installsOverWifi(d, udid, wireless, note);
703
+ const overWifi = await installsOverWifi(d, udid, wireless, note);
1164
704
  const bounds = iosDeviceBounds(overWifi);
1165
705
  const lostBeforeInstall = raiseLeaseFor(bounds.installMs, true);
1166
706
  if (lostBeforeInstall) return fail(lostBeforeInstall);
@@ -1170,7 +710,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1170
710
  });
1171
711
  enterPhase("install");
1172
712
  const installTimer = stepTimer(d.now);
1173
- const installed = d.installIosDeviceApp({
713
+ const installed = await d.installIosDeviceApp({
1174
714
  udid,
1175
715
  appPath,
1176
716
  bundleId,
@@ -1287,7 +827,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1287
827
  } else {
1288
828
  const adopting = Boolean(device?.adoptionPending);
1289
829
  if (adopting) {
1290
- const cleanupFailure = cleanAdoptedIosApps({
830
+ const cleanupFailure = await cleanAdoptedIosApps({
1291
831
  d,
1292
832
  udid,
1293
833
  bundleId,
@@ -1308,7 +848,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1308
848
  }
1309
849
  enterPhase("install");
1310
850
  const installTimer = stepTimer(d.now);
1311
- const installed = d.installIosApp({
851
+ const installed = await d.installIosApp({
1312
852
  udid,
1313
853
  appPath,
1314
854
  bundleId,
@@ -1368,7 +908,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1368
908
  metroPort: port,
1369
909
  devClientScheme,
1370
910
  devMenuParams: menuParams,
1371
- consolePaths: simulatorConsolePaths({
911
+ consolePaths: await simulatorConsolePaths({
1372
912
  deviceId: udid,
1373
913
  appId: bundleId,
1374
914
  since: launchedAt
@@ -1377,7 +917,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1377
917
  });
1378
918
  if ("error" in launched) return fail(launched.error);
1379
919
  if (launched.failed) {
1380
- printNativeCrashReport({
920
+ await printNativeCrashReport({
1381
921
  root,
1382
922
  slot,
1383
923
  platform: "ios",
@@ -1385,7 +925,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1385
925
  appId: bundleId,
1386
926
  since: launchedAt,
1387
927
  appPath
1388
- }, logsDir, (line) => note(chalk.red(phaseLine("launch", line))), Boolean(remoteDevice));
928
+ }, logsDir, (line) => note(chalk.red(phaseLine("launch", line))), Boolean(remoteDevice), operation?.signal, operation?.env);
1389
929
  return fail({
1390
930
  code: launched.code || "STIM_LAUNCH_FAILED",
1391
931
  message: launched.reason,
@@ -1427,6 +967,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1427
967
  });
1428
968
  if (physical) raiseLeaseFor(runtime.verificationWaitMs, false);
1429
969
  const { state: launchState, warning: launchWarning, unattributed } = await runtime.verify(runtimePreparation, {
970
+ operation,
1430
971
  root,
1431
972
  slot,
1432
973
  appPath,
@@ -1480,6 +1021,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1480
1021
  const uploadsAbandoned = await artifact.completeUploads();
1481
1022
  return {
1482
1023
  facts: reportIosResult({
1024
+ output,
1483
1025
  devicePlacement,
1484
1026
  root,
1485
1027
  slot,
@@ -1518,7 +1060,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1518
1060
  recordRun,
1519
1061
  reclaimed,
1520
1062
  devServer,
1521
- links: workspaceLinks(root, {
1063
+ links: await workspaceLinks(root, {
1522
1064
  platform: "ios",
1523
1065
  slot
1524
1066
  })
@@ -1527,4 +1069,4 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1527
1069
  };
1528
1070
  }
1529
1071
  //#endregion
1530
- export { collectorEntry as a, copyAppAside as c, gateProfileForDevice as d, DEFAULT_DEPS as i, lanOriginUrlFor as l, iosMetroRuntime as n, replaceCollector as o, iosProcessRuntime as r, chooseLanAddress as s, finishIosRun as t, writeIpTxt as u };
1072
+ export { collectorEntry as a, copyAppAside as c, DEFAULT_DEPS as i, lanOriginUrlFor as l, iosMetroRuntime as n, replaceCollector as o, iosProcessRuntime as r, chooseLanAddress as s, finishIosRun as t, writeIpTxt as u };