stim 1.18.0 → 1.19.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 (140) hide show
  1. package/README.md +1 -1
  2. package/dist/{activity-BxnkDZDi.mjs → activity-BSw0x84R.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-CZ66YA4T.mjs → agent-device-usage-output-Bjxu_VmX.mjs} +5 -5
  4. package/dist/{android-BvwuMUJ9.mjs → android-BXc6BmEi.mjs} +507 -347
  5. package/dist/{android-DC3ZLuw0.mjs → android-BdQC6zs1.mjs} +6 -6
  6. package/dist/{android-BKA16DTf.mjs → android-BvV1gGdN.mjs} +3 -3
  7. package/dist/{android-CBwCNicO.mjs → android-DE5g_5gv.mjs} +2 -2
  8. package/dist/{android-cas-BBFyr9CA.mjs → android-cas-C87geAg-.mjs} +3 -3
  9. package/dist/android-cas-compiler.mjs +1 -1
  10. package/dist/{api-D0VtFhqk.mjs → api-DIf_s86s.mjs} +5 -7
  11. package/dist/api-run.mjs +8 -8
  12. package/dist/api.d.mts +8 -2
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-D-PUENug.mjs → app-install-CFI4ptUL.mjs} +33 -13
  15. package/dist/{web-DTU0uiWj.mjs → browser-web-CDhqQxhv.mjs} +134 -172
  16. package/dist/{budget-DIhL2BKx.mjs → budget-Dz-kyXLv.mjs} +15 -202
  17. package/dist/{build-facts-DcLv2HSd.d.mts → build-facts-B87vo-Im.d.mts} +32 -1
  18. package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-DiwKSyv9.mjs} +1 -1
  19. package/dist/cache-manifest.mjs +1 -1
  20. package/dist/{chrome-DJnmnS5q.mjs → chrome-BTUOo8p2.mjs} +1 -1
  21. package/dist/{cli-DNJMwADx.mjs → cli-C9Zvgbdc.mjs} +20 -20
  22. package/dist/cli.mjs +1 -1
  23. package/dist/{client-DzhapoMB.mjs → client-CuUo8Nvg.mjs} +248 -23
  24. package/dist/collector-run.d.mts +6 -0
  25. package/dist/collector-run.mjs +6 -6
  26. package/dist/{command-output-CBtzyIgF.mjs → command-output-Bt8ygHE7.mjs} +1 -1
  27. package/dist/{config-CgYMahz7.mjs → config-DC5jEtd1.mjs} +6 -2
  28. package/dist/{created-devices-DKbeWsiK.mjs → created-devices-D0s26Hx5.mjs} +2 -2
  29. package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-DKaS1OM9.mjs} +2 -2
  30. package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-pB_IPfV4.mjs} +1 -1
  31. package/dist/{dev-client-CLnIH02x.mjs → dev-client-CDY_zAmD.mjs} +2 -2
  32. package/dist/{device-D7oCHGWi.mjs → device-BHw0WlHl.mjs} +8 -8
  33. package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-BoN1jQkO.mjs} +23 -12
  34. package/dist/device-host-worker.mjs +14 -14
  35. package/dist/{gradle-C6GKnunQ.mjs → device-ios-B2ruohE-.mjs} +659 -105
  36. package/dist/{device-lease-Co-EwifR.mjs → device-lease-Cu7PtQpZ.mjs} +5 -5
  37. package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-D38SnZtt.mjs} +4 -4
  38. package/dist/{device-pool-F5WvRPtD.mjs → device-pool-CP4rAsHx.mjs} +3 -3
  39. package/dist/{device-remote-tHbd1fKy.mjs → device-remote-B5GiUifk.mjs} +15 -16
  40. package/dist/{doctor-B9ckYUoU.mjs → doctor-PRJH94v6.mjs} +53 -29
  41. package/dist/doctor-watchman-wZhyTdp4.mjs +259 -0
  42. package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics--v5HGOU0.mjs} +10 -10
  43. package/dist/{exec-DWhCZDGm.mjs → exec-i8GDPwq9.mjs} +32 -8
  44. package/dist/{gc-Dh6mXOKC.mjs → gc-CyHMcKcn.mjs} +19 -19
  45. package/dist/{guide-tm6igAaa.mjs → guide-dRaQJJk9.mjs} +409 -472
  46. package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-Bs7fytj7.mjs} +3 -3
  47. package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-C5G4h_OJ.mjs} +1 -1
  48. package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-Bik035eL.mjs} +1 -1
  49. package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-CI9Az9a4.mjs} +7 -7
  50. package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-DABm3ScO.mjs} +4 -4
  51. package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-DbV2aUVw.mjs} +12 -8
  52. package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DYiMBn34.mjs} +7 -7
  53. package/dist/{ios-B3SbOWdw.mjs → ios-BWbHFZVz.mjs} +5 -5
  54. package/dist/{ios-Bvbf0SGY.mjs → ios-DCrkgXEM.mjs} +1 -1
  55. package/dist/{ios-DNpdygiv.mjs → ios-DYUr9LGc.mjs} +7 -6
  56. package/dist/ios-ITYno9rO.mjs +2241 -0
  57. package/dist/{ios-device-vOaByMhw.mjs → ios-device-CJ_ZOGky.mjs} +3 -3
  58. package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-CrW8aMb5.mjs} +1 -1
  59. package/dist/{ios-state-B2pES6Vs.mjs → ios-state-By0XuLTQ.mjs} +1 -1
  60. package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-DCveSE6d.mjs} +4 -4
  61. package/dist/{logs-1Ylc1Ri6.mjs → logs-Bao1HOMy.mjs} +10 -10
  62. package/dist/{macos-DF6C7wUU.mjs → macos-ciyBdTY5.mjs} +108 -130
  63. package/dist/macos-nIOATJmR.mjs +2 -0
  64. package/dist/macos-run.mjs +1 -1
  65. package/dist/maintenance-run.mjs +7 -7
  66. package/dist/manifest-CX0d1IkZ.mjs +148 -0
  67. package/dist/{metro-Dh8T4Ytd.mjs → metro-DI2AjPF_.mjs} +194 -41
  68. package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BxpJLIwh.mjs} +2 -2
  69. package/dist/{plan-placement-CtxkCO54.mjs → miss-reason-CjQCOKqq.mjs} +180 -296
  70. package/dist/{named-ports-BFIz1Shz.mjs → named-ports-B4iWH4E-.mjs} +12 -5
  71. package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BGxsbfny.mjs} +6 -6
  72. package/dist/offload-worker.d.mts +1 -29
  73. package/dist/offload-worker.mjs +9 -8
  74. package/dist/{ownership-D6Se7gg_.mjs → ownership-EB0ySdGK.mjs} +2 -2
  75. package/dist/{placement-log-BcPhRwR4.mjs → placement-log-Dxe34rJm.mjs} +7 -3
  76. package/dist/plan-placement-BVY59qa8.mjs +290 -0
  77. package/dist/{ports-BLTtfBq-.mjs → ports-ByPc0_97.mjs} +3 -3
  78. package/dist/{prebuild-juCyreaR.mjs → prebuild-BKJ3wJI1.mjs} +4 -4
  79. package/dist/{preview-D5V07Nrl.mjs → preview-BbSottmO.mjs} +16 -17
  80. package/dist/project-B5eQ1USs.mjs +612 -0
  81. package/dist/{pull-request-u4vp7zmK.mjs → pull-request-IHNdMnG8.mjs} +1 -1
  82. package/dist/pull-requests.mjs +1 -1
  83. package/dist/react-native-ios-BMh2i25I.mjs +2 -0
  84. package/dist/react-native-ios-CSpIxexZ.mjs +2083 -0
  85. package/dist/{recordings-BAWltsVt.mjs → recordings-Bv8McZN4.mjs} +1 -1
  86. package/dist/{reload-DvyWzVjJ.mjs → reload-rAPdqeRR.mjs} +13 -14
  87. package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-N3hAEaAL.mjs} +4 -4
  88. package/dist/{run-vhtDgpHO.mjs → run-lAkle1-c.mjs} +2 -2
  89. package/dist/{server-bare-B9E7S1aR.mjs → server-bare-CkIjnegq.mjs} +3 -3
  90. package/dist/server-expo-DGsdUGX2.mjs +2 -0
  91. package/dist/{server-expo-DoBHhuzK.mjs → server-expo-n3tUi3Em.mjs} +3 -3
  92. package/dist/{settings-Byp2AQ_E.mjs → settings-2am7TSxp.mjs} +5 -6
  93. package/dist/{settings-CQyMElEP.mjs → settings-CxgngUZk.mjs} +767 -15
  94. package/dist/settings.schema.json +72 -6
  95. package/dist/{simslim-EHBQ2R4G.mjs → simslim-D9LkJxIO.mjs} +5 -5
  96. package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-HV_KtPIw.mjs} +6 -6
  97. package/dist/{stage-g_WqWeaE.mjs → stage-BgaZJVZY.mjs} +1 -1
  98. package/dist/{start-NTc1Ifqs.mjs → start-D8NbxNBb.mjs} +1 -1
  99. package/dist/{start-D-IeOyoK.mjs → start-DtxthMfI.mjs} +29 -22
  100. package/dist/{state-BG-aAk4k.mjs → state-D2KtnALG.mjs} +2 -2
  101. package/dist/{state-xnqpx3AD.mjs → state-Tp4uImDS.mjs} +4 -2
  102. package/dist/{stats-DY6ekz8F.mjs → stats-8EJ5ivFT.mjs} +6 -6
  103. package/dist/{status-DCjZeE-K.mjs → status-BOyp0CUl.mjs} +25 -27
  104. package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-C65jk_q2.mjs} +1 -1
  105. package/dist/{stim-installations-aR_WsNOA.mjs → stim-installations-DbmUjsLv.mjs} +1 -1
  106. package/dist/stop-D0UIpZuh.mjs +72 -0
  107. package/dist/{stop-DIJtD2GL.mjs → stop-DRipAg-e.mjs} +2 -2
  108. package/dist/{stop-BTjs3xbc.mjs → stop-zDlknFoz.mjs} +78 -31
  109. package/dist/supervisor-run.mjs +14 -14
  110. package/dist/{support-BaayeYCf.mjs → support-CNqYkV0y.mjs} +7 -7
  111. package/dist/{support-Bwvbrq5-.mjs → support-DsNaFg6D.mjs} +5 -5
  112. package/dist/swiftpm-macos-aJzPAj1t.mjs +119 -0
  113. package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-C3xSoyUl.mjs} +27 -270
  114. package/dist/{trigger-CJMhwXe8.mjs → trigger-CAhmG-4s.mjs} +3 -3
  115. package/dist/trigger-CoalsMTV.mjs +2 -0
  116. package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-pFLB2e6P.mjs} +133 -36
  117. package/dist/{status-Dcr0Qexd.mjs → watchman-BL1IdOtq.mjs} +75 -7
  118. package/dist/web-DFpFeZu5.mjs +2 -0
  119. package/dist/web-DbbrPUn0.mjs +127 -0
  120. package/dist/web-run.mjs +7 -7
  121. package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CR9X86xJ.mjs} +1 -1
  122. package/dist/{workspaces-xXItD8Dj.mjs → workspaces-Djb2gfi9.mjs} +102 -18
  123. package/dist/{worktree-BSYlofkq.mjs → worktree-BL4M1rhB.mjs} +45 -42
  124. package/dist/{worktree-BJfnU6r5.mjs → worktree-DV-A0LNL.mjs} +1 -1
  125. package/package.json +5 -5
  126. package/shim/bundle-response.cjs +2 -1
  127. package/shim/bundle-response.d.cts +1 -1
  128. package/shim/expo-metro-config.cjs +1 -1
  129. package/dist/device-ios-6MewKKnc.mjs +0 -412
  130. package/dist/guide-status-Bhf9SJXc.mjs +0 -125
  131. package/dist/ios-CPdkoKaa.mjs +0 -3953
  132. package/dist/macos-Ck7OBMNY.mjs +0 -2
  133. package/dist/native-run-B06FkmZx.mjs +0 -158
  134. package/dist/project-C3ChRLZy.mjs +0 -212
  135. package/dist/projects-DD7dBTCj.mjs +0 -92
  136. package/dist/server-expo-Db9HBUoa.mjs +0 -2
  137. package/dist/stop-BGhKMOuH.mjs +0 -48
  138. package/dist/trigger-DWAq9hkw.mjs +0 -2
  139. package/dist/web-B6_bFDn7.mjs +0 -2
  140. package/dist/worktree-CsKYexJM.mjs +0 -753
@@ -275,7 +275,7 @@
275
275
  }
276
276
  },
277
277
  "remote": {
278
- "description": "Default iOS remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy",
278
+ "description": "Default iOS remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy; local runs here, overriding a lower layer",
279
279
  "type": "string",
280
280
  "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]*(?::(?!0+$)(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
281
281
  "x-stim": {
@@ -464,7 +464,7 @@
464
464
  }
465
465
  },
466
466
  "remote": {
467
- "description": "Default Android remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy",
467
+ "description": "Default Android remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy; local runs here, overriding a lower layer",
468
468
  "type": "string",
469
469
  "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]*(?::(?!0+$)(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
470
470
  "x-stim": {
@@ -874,6 +874,27 @@
874
874
  },
875
875
  "additionalProperties": false
876
876
  },
877
+ "remote": {
878
+ "type": "object",
879
+ "properties": {
880
+ "easFallback": {
881
+ "description": "When ios.remote or android.remote is auto, this Mac is at its concurrency.maxDevices cap and no Mac in remote.machines takes the run, run the simulator or emulator on a billed EAS Simulator instead of waiting or refusing, when eas-cli can",
882
+ "type": "boolean",
883
+ "default": false,
884
+ "x-stim": {
885
+ "key": "remote.easFallback",
886
+ "kind": "boolean",
887
+ "scopes": [
888
+ "machine",
889
+ "workspace",
890
+ "repo",
891
+ "committed"
892
+ ]
893
+ }
894
+ }
895
+ },
896
+ "additionalProperties": false
897
+ },
877
898
  "$schema": {
878
899
  "type": "string"
879
900
  }
@@ -1139,7 +1160,7 @@
1139
1160
  }
1140
1161
  },
1141
1162
  "remote": {
1142
- "description": "Default iOS remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy",
1163
+ "description": "Default iOS remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy; local runs here, overriding a lower layer",
1143
1164
  "type": "string",
1144
1165
  "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]*(?::(?!0+$)(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
1145
1166
  "x-stim": {
@@ -1189,7 +1210,7 @@
1189
1210
  }
1190
1211
  },
1191
1212
  "remote": {
1192
- "description": "Default Android remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy",
1213
+ "description": "Default Android remote target: eas, proxy, or an approved Mac in remote.machines; auto places on an approved Mac when this Mac is full or busy; local runs here, overriding a lower layer",
1193
1214
  "type": "string",
1194
1215
  "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]*(?::(?!0+$)(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
1195
1216
  "x-stim": {
@@ -2051,8 +2072,53 @@
2051
2072
  ]
2052
2073
  }
2053
2074
  },
2075
+ "buildPoolDisabled": {
2076
+ "description": "Members excluded from this requester's automatic build placement: local or exact remote.machines entries. Explicit placement and running builds are unaffected; at least one local or configured, approved remote member must stay enabled",
2077
+ "type": "array",
2078
+ "items": {
2079
+ "type": "string"
2080
+ },
2081
+ "default": [],
2082
+ "x-stim": {
2083
+ "key": "remote.buildPoolDisabled",
2084
+ "kind": "strings",
2085
+ "scopes": [
2086
+ "machine"
2087
+ ]
2088
+ }
2089
+ },
2090
+ "devicePoolDisabled": {
2091
+ "description": "Members excluded from this requester's automatic simulator and emulator placement: local or exact remote.machines entries. Explicit placement and existing sessions are unaffected; at least one local or configured, approved remote member must stay enabled",
2092
+ "type": "array",
2093
+ "items": {
2094
+ "type": "string"
2095
+ },
2096
+ "default": [],
2097
+ "x-stim": {
2098
+ "key": "remote.devicePoolDisabled",
2099
+ "kind": "strings",
2100
+ "scopes": [
2101
+ "machine"
2102
+ ]
2103
+ }
2104
+ },
2105
+ "easFallback": {
2106
+ "description": "When ios.remote or android.remote is auto, this Mac is at its concurrency.maxDevices cap and no Mac in remote.machines takes the run, run the simulator or emulator on a billed EAS Simulator instead of waiting or refusing, when eas-cli can",
2107
+ "type": "boolean",
2108
+ "default": false,
2109
+ "x-stim": {
2110
+ "key": "remote.easFallback",
2111
+ "kind": "boolean",
2112
+ "scopes": [
2113
+ "machine",
2114
+ "workspace",
2115
+ "repo",
2116
+ "committed"
2117
+ ]
2118
+ }
2119
+ },
2054
2120
  "build": {
2055
- "description": "Build placement: auto follows remote.buildMode with local fallback; local always builds here; a name in remote.machines requires that remote Mac without fallback. The ios, android and macos --remote-build flag overrides this setting and its environment override",
2121
+ "description": "Build placement: auto follows remote.buildMode within enabled automatic pool members; local always builds here; a name in remote.machines requires that remote Mac without fallback. The ios, android and macos --remote-build flag overrides this setting and its environment override",
2056
2122
  "type": "string",
2057
2123
  "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]*(?::(?!0+$)(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
2058
2124
  "default": "auto",
@@ -2066,7 +2132,7 @@
2066
2132
  }
2067
2133
  },
2068
2134
  "buildMode": {
2069
- "description": "When remote.build is auto, where iOS simulator Debug, Android emulator debug and macOS SwiftPM Debug builds run: auto builds here while this Mac has a free concurrency.maxBuilds slot and its load is under server.maxLoadPerCore, and otherwise builds on a less loaded Mac in remote.machines; force builds on a remote Mac whenever one can take the build; off always builds here",
2135
+ "description": "When remote.build is auto, where iOS simulator Debug, Android emulator debug and macOS SwiftPM Debug builds run: auto builds here while this Mac has a free concurrency.maxBuilds slot and its load is under server.maxLoadPerCore, and otherwise builds on a less loaded Mac in remote.machines; force builds on an enabled remote Mac whenever one can take the build; off builds here when local is enabled in remote.buildPoolDisabled",
2070
2136
  "type": "string",
2071
2137
  "enum": [
2072
2138
  "auto",
@@ -1,10 +1,10 @@
1
1
  import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
2
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
3
  import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
4
- import { d as getConfigDir } from "./config-CgYMahz7.mjs";
5
- import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-Co-EwifR.mjs";
6
- import { f as resolveEasCliBin } from "./remote-cache-BGg7aGIZ.mjs";
7
- import { _ as easCliSupport, s as readInstalledEasCliVersion, v as easCliUpgradeRemedy } from "./device-remote-tHbd1fKy.mjs";
4
+ import { d as getConfigDir } from "./config-DC5jEtd1.mjs";
5
+ import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-Cu7PtQpZ.mjs";
6
+ import { f as resolveEasCliBin } from "./remote-cache-N3hAEaAL.mjs";
7
+ import { s as readInstalledEasCliVersion, v as easCliSupport, y as easCliUpgradeRemedy } from "./device-remote-B5GiUifk.mjs";
8
8
  import { existsSync, realpathSync, statSync } from "node:fs";
9
9
  import { join } from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -1,9 +1,9 @@
1
- import { B as parseDeviceSlotKey, H as projectDeviceSlots, p as getProject } from "./config-CgYMahz7.mjs";
2
- import { r as readWorkspaceState$1 } from "./workspace-state-C59dqG-Z.mjs";
3
- import { n as fileLeaseIo } from "./device-lease-Co-EwifR.mjs";
4
- import { E as getAvdNameForSerial, O as listAdbDevices } from "./android-DC3ZLuw0.mjs";
5
- import { d as listAllIosSims } from "./ios-B3SbOWdw.mjs";
6
- import { f as deviceShellArg } from "./app-install-D-PUENug.mjs";
1
+ import { B as parseDeviceSlotKey, H as projectDeviceSlots, p as getProject } from "./config-DC5jEtd1.mjs";
2
+ import { r as readWorkspaceState$1 } from "./workspace-state-CR9X86xJ.mjs";
3
+ import { n as fileLeaseIo } from "./device-lease-Cu7PtQpZ.mjs";
4
+ import { E as getAvdNameForSerial, O as listAdbDevices } from "./android-BdQC6zs1.mjs";
5
+ import { d as listAllIosSims } from "./ios-BWbHFZVz.mjs";
6
+ import { f as deviceShellArg } from "./app-install-CFI4ptUL.mjs";
7
7
  import { hostedNativeRecords } from "@stim-cli/core/state";
8
8
  //#region src/engine/slot-launch.ts
9
9
  function launchSlotScope(root, slot = "default") {
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
2
  import { cpSync, existsSync, mkdirSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
3
3
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { validMacosResourceDestination } from "@stim-cli/core";
@@ -1,2 +1,2 @@
1
- import { a as registerStart, c as startDevServer, d as tailLines, f as wantsExpoOwnTunnel, i as readLogTail, l as startFacts, n as liveSupervisor, o as resolveWorkspaceMetroPort, r as parseWait, s as startCommand, t as failureEvidence, u as supervisorEntry } from "./start-D-IeOyoK.mjs";
1
+ import { a as registerStart, c as startDevServer, d as tailLines, f as wantsExpoOwnTunnel, i as readLogTail, l as startFacts, n as liveSupervisor, o as resolveWorkspaceMetroPort, r as parseWait, s as startCommand, t as failureEvidence, u as supervisorEntry } from "./start-DtxthMfI.mjs";
2
2
  export { startCommand as default, failureEvidence, liveSupervisor, parseWait, readLogTail, registerStart, resolveWorkspaceMetroPort, startDevServer, startFacts, supervisorEntry, tailLines, wantsExpoOwnTunnel };
@@ -1,20 +1,19 @@
1
1
  import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
2
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
3
  import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
4
- import { _ as stepTimer, l as phaseLine } from "./command-output-CBtzyIgF.mjs";
5
- import { E as upsertProject, p as getProject } from "./config-CgYMahz7.mjs";
6
- import { s as gitCommonDir, y as repoRoot } from "./worktree-CsKYexJM.mjs";
7
- import { f as readAppConfigText, i as detectIsExpo, n as appProjectProblem, p as readAppJson, s as findProjectRoot$1, t as NO_PROJECT_REFUSAL } from "./project-C3ChRLZy.mjs";
8
- import { l as resolveProjectMetro, o as pidExists, p as reserveMetroPort, u as signalProcessTree } from "./metro-Dh8T4Ytd.mjs";
9
- import { c as writeWorkspaceState, g as workspaceAgentDeviceDir, i as recordWorkspaceUse, m as supervisorLogFile, n as clearWorkspaceStateKeys, r as readWorkspaceState$1, u as ensureWorkspaceStorage, x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
10
- import { Ht as readMetroTunnel, Rt as clearManagedMetroTunnel, d as stopOwnedMetroForReset, t as budgetGate } from "./budget-DIhL2BKx.mjs";
11
- import { _ as terminateChild, b as withManagedTunnelLock, g as stopTunnel, h as startTunnelSequence, m as resolveSupervisorTarget, v as withManagedRemoteWorktreeLock } from "./workspaces-xXItD8Dj.mjs";
12
- import { a as workspaceLinks, i as workspaceLinkLine } from "./stim-desktop-Behws_fi.mjs";
13
- import { A as publicUrlSetting, F as resolveSettings, G as PUBLIC_METRO_ENV, H as tunnelModeSetting, K as detectProviders, M as remoteAndroidSetting, N as remoteIosSetting, P as resolveCacheProviderConfig, S as metroTunnelSettingError, U as unknownSettingKeys, b as metroIdleStopMinutesSetting, d as deviceIdleShutdownMinutesSetting, i as SETTING_SHAPE_REMEDY, q as planMetroReach, u as cacheProviderSettingError, w as ngrokUrlSetting, x as metroPortSetting, z as settingShapeErrors } from "./settings-CQyMElEP.mjs";
14
- import { a as withWorkspaceProcessLock, o as workspaceProcessLockError } from "./named-ports-BFIz1Shz.mjs";
4
+ import { _ as stepTimer, l as phaseLine } from "./command-output-Bt8ygHE7.mjs";
5
+ import { E as upsertProject, p as getProject } from "./config-DC5jEtd1.mjs";
6
+ import { c as writeWorkspaceState, g as workspaceAgentDeviceDir, i as recordWorkspaceUse, m as supervisorLogFile, n as clearWorkspaceStateKeys, r as readWorkspaceState$1, u as ensureWorkspaceStorage, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
7
+ import { E as readMetroTunnel, S as clearManagedMetroTunnel, _ as readAppJson, g as readAppConfigText, p as detectIsExpo, r as findProjectRoot, s as projectProblem, t as NO_PROJECT_REFUSAL } from "./project-B5eQ1USs.mjs";
8
+ import { A as publicUrlSetting, B as settingShapeErrors, F as resolveCacheProviderConfig, I as resolveSettings, J as planMetroReach, K as PUBLIC_METRO_ENV, M as remoteAndroidSetting, P as remoteIosSetting, S as metroTunnelSettingError, U as tunnelModeSetting, W as unknownSettingKeys, b as metroIdleStopMinutesSetting, d as deviceIdleShutdownMinutesSetting, i as SETTING_SHAPE_REMEDY, mt as repoRoot, nt as gitCommonDir, q as detectProviders, u as cacheProviderSettingError, w as ngrokUrlSetting, x as metroPortSetting } from "./settings-CxgngUZk.mjs";
9
+ import { d as signalProcessTree, g as PortInspectionError, h as PORT_INSPECTION_REMEDY, m as reserveMetroPort, s as pidExists, u as resolveProjectMetro } from "./metro-DI2AjPF_.mjs";
10
+ import { d as stopOwnedMetroForReset, t as budgetGate } from "./budget-Dz-kyXLv.mjs";
11
+ import { _ as terminateChild, b as withManagedTunnelLock, g as stopTunnel, h as startTunnelSequence, m as resolveSupervisorTarget, v as withManagedRemoteWorktreeLock } from "./workspaces-Djb2gfi9.mjs";
12
+ import { a as workspaceLinks, i as workspaceLinkLine } from "./stim-desktop-C65jk_q2.mjs";
13
+ import { a as withWorkspaceProcessLock, o as workspaceProcessLockError } from "./named-ports-B4iWH4E-.mjs";
15
14
  import { i as levelRank } from "./ndjson-LGZAMsqa.mjs";
16
- import { d as readProjectConfig } from "./remote-cache-BGg7aGIZ.mjs";
17
- import { n as windowsLauncherArgs } from "./detached-entry-BLfcgc4O.mjs";
15
+ import { d as readProjectConfig } from "./remote-cache-N3hAEaAL.mjs";
16
+ import { n as windowsLauncherArgs } from "./detached-entry-pB_IPfV4.mjs";
18
17
  import { appendFileSync, mkdirSync, openSync, readFileSync } from "node:fs";
19
18
  import { dirname } from "node:path";
20
19
  import { join as join$1 } from "path";
@@ -251,13 +250,13 @@ function registerStart(program, overrides = {}) {
251
250
  remedy: "Pass a whole number of seconds, e.g. --wait 90."
252
251
  });
253
252
  const waitSeconds = wait.seconds;
254
- const root = findProjectRoot$1(process.cwd());
253
+ const root = findProjectRoot(process.cwd());
255
254
  if (!root) return fail(NO_PROJECT_REFUSAL);
256
- const projectProblem = appProjectProblem(root);
257
- if (projectProblem) return fail({
255
+ const problem = projectProblem(root, "dev-server");
256
+ if (problem) return fail({
258
257
  code: "STIM_NO_PROJECT",
259
- message: projectProblem.message,
260
- remedy: projectProblem.remedy
258
+ message: problem.message,
259
+ remedy: problem.remedy
261
260
  });
262
261
  try {
263
262
  ensureWorkspaceStorage(root);
@@ -973,7 +972,7 @@ async function resolveWorkspaceMetroPort(root, note, command, reserve = true) {
973
972
  const pinned = setting.port;
974
973
  const project = getProject(root);
975
974
  const recorded = project?.metroPort;
976
- if (pinned === null && command === "web") return recorded ?? await reserveMetroPort(root);
975
+ if (pinned === null && command === "web") return recorded ?? await reservePort(root, null);
977
976
  if (recorded) {
978
977
  const supervisor = resolveSupervisorTarget({
979
978
  state: readWorkspaceState$1(root)?.supervisor,
@@ -1005,17 +1004,25 @@ async function resolveWorkspaceMetroPort(root, note, command, reserve = true) {
1005
1004
  } else if (recorded) {
1006
1005
  const held = await resolveProjectMetro(recorded, root);
1007
1006
  if (!held.notOurs) return recorded;
1008
- const fresh = await reserveMetroPort(root);
1009
- if (fresh !== recorded) {
1007
+ const fresh = await reservePort(root, null);
1008
+ if (typeof fresh === "number" && fresh !== recorded) {
1010
1009
  note(chalk.yellow(`Port ${recorded} is held by something else (${held.notOurs}).`));
1011
1010
  note(chalk.dim(`Reserved port ${fresh} for this project instead.`));
1012
1011
  }
1013
1012
  return fresh;
1014
1013
  }
1015
1014
  if (!reserve && pinned !== null) return pinned;
1015
+ return reservePort(root, pinned);
1016
+ }
1017
+ async function reservePort(root, pinned) {
1016
1018
  try {
1017
1019
  return await reserveMetroPort(root, void 0, void 0, pinned);
1018
1020
  } catch (error) {
1021
+ if (error instanceof PortInspectionError) return {
1022
+ code: error.code,
1023
+ message: error.reason,
1024
+ remedy: PORT_INSPECTION_REMEDY
1025
+ };
1019
1026
  return {
1020
1027
  code: "STIM_BAD_ARG",
1021
1028
  message: error.message,
@@ -1,6 +1,6 @@
1
1
  import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { o as pidExists } from "./metro-Dh8T4Ytd.mjs";
3
- import { a as updateWorkspaceState, c as writeWorkspaceState, r as readWorkspaceState$1, t as clearWorkspaceStateKey, v as workspaceDir, x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
2
+ import { a as updateWorkspaceState, c as writeWorkspaceState, r as readWorkspaceState$1, t as clearWorkspaceStateKey, v as workspaceDir, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
3
+ import { s as pidExists } from "./metro-DI2AjPF_.mjs";
4
4
  import { readFileSync, readlinkSync, rmSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { WEB_VIEWPORTS } from "@stim-cli/core/state";
@@ -1,11 +1,13 @@
1
1
  import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { a as updateWorkspaceState, r as readWorkspaceState$1, v as workspaceDir, x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
2
+ import { a as updateWorkspaceState, r as readWorkspaceState$1, v as workspaceDir, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
3
+ import { existsSync } from "node:fs";
3
4
  import { join } from "node:path";
4
5
  import { readMacosRecord } from "@stim-cli/core/state";
5
6
  //#region src/macos/state.ts
6
7
  const macosDir = (root) => join(workspaceDir(root), "macos");
7
8
  const macosLogFile = (root) => join(workspaceLogsDir$1(root), "macos.ndjson");
8
9
  const macosRuntimeClaim = (root) => join(macosDir(root), "runtime.lock");
10
+ const macosAppPresent = (root) => readWorkspaceState$1(root)?.macos !== void 0 || existsSync(macosDir(root));
9
11
  function macosProcess(pid) {
10
12
  const processToken = (0, process_identity_exports.captureProcessToken)(pid);
11
13
  const start = (0, process_identity_exports.processStartMicros)(pid);
@@ -38,4 +40,4 @@ function updateMacosRecord(root, owner, patch) {
38
40
  return updated;
39
41
  }
40
42
  //#endregion
41
- export { requiredMacosRecord as a, macosRuntimeClaim as i, macosLogFile as n, updateMacosRecord as o, macosProcess as r, macosDir as t };
43
+ export { macosRuntimeClaim as a, macosProcess as i, macosDir as n, requiredMacosRecord as o, macosLogFile as r, updateMacosRecord as s, macosAppPresent as t };
@@ -1,8 +1,8 @@
1
- import { o as formatLongDuration } from "./command-output-CBtzyIgF.mjs";
2
- import { j as formatBytes } from "./config-CgYMahz7.mjs";
3
- import { s as gitCommonDir, y as repoRoot } from "./worktree-CsKYexJM.mjs";
4
- import { s as findProjectRoot$1 } from "./project-C3ChRLZy.mjs";
5
- import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-CZ66YA4T.mjs";
1
+ import { o as formatLongDuration } from "./command-output-Bt8ygHE7.mjs";
2
+ import { j as formatBytes } from "./config-DC5jEtd1.mjs";
3
+ import { r as findProjectRoot } from "./project-B5eQ1USs.mjs";
4
+ import { mt as repoRoot, nt as gitCommonDir } from "./settings-CxgngUZk.mjs";
5
+ import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-Bjxu_VmX.mjs";
6
6
  import { archivedUsage, readArchives, readStatsReport, statsProjectKey } from "@stim-cli/core/state";
7
7
  import chalk from "chalk";
8
8
  //#region src/commands/stats.ts
@@ -13,7 +13,7 @@ function statsCommand(program) {
13
13
  program.command("stats").description("Show how many `ios` and `android` runs this project and this machine have recorded, how many hit the build cache, and an estimate of the time that cache saved.").option("--json", "print the aggregates as JSON").action(async (opts) => {
14
14
  const agentDevice = await getAgentDeviceUsage();
15
15
  const swiftpmCache = await getSwiftpmCacheUsage();
16
- const root = findProjectRoot$1(process.cwd());
16
+ const root = findProjectRoot(process.cwd());
17
17
  const key = root ? statsProjectKey({
18
18
  root,
19
19
  commonDir: gitCommonDir(root),
@@ -1,33 +1,31 @@
1
1
  import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
3
- import { a as formatElapsed, i as formatDuration, r as clockTime, u as plural } from "./command-output-CBtzyIgF.mjs";
4
- import { B as parseDeviceSlotKey, F as volumeRootFor, H as projectDeviceSlots, R as deviceSlotKey, _ as loadConfig$1, d as getConfigDir, j as formatBytes } from "./config-CgYMahz7.mjs";
5
- import { c as gitCommonDirOnDisk, p as linkedWorktreesOnDisk, s as gitCommonDir, y as repoRoot } from "./worktree-CsKYexJM.mjs";
6
- import { a as detectTutorial, c as findServerWorkspace, d as projectShortcut, i as detectIsExpo, p as readAppJson } from "./project-C3ChRLZy.mjs";
7
- import { a as listeningPidsByPort, c as processCwds, d as isMetroRunning, i as listeningPids, l as resolveProjectMetro, o as pidExists, s as processCwd } from "./metro-Dh8T4Ytd.mjs";
8
- import { b as workspaceLogErrorIndex, r as readWorkspaceState$1, x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
9
- import { a as readWebPage, o as readWebRecord, u as webFacts } from "./state-BG-aAk4k.mjs";
10
- import { _ as statusActivity, a as capacity, b as withWebFacts, c as diskLine, d as gitSummaryText, f as metroReverseTargets, g as remoteDeviceState, h as remoteDeviceLine, i as applyMachineMemory, l as environmentState, m as poolLine, n as activityLabel, o as deviceLeaseLines, p as parseDfFree, r as addReverseMissingIssue, s as deviceLeaseStates, v as tightVolumes, y as unprovisionedWorktrees } from "./status-Dcr0Qexd.mjs";
11
- import { A as buildReport, B as readStats$1, D as ACTIVE_BUILD_KEY, Ht as readMetroTunnel, Kt as readWorkspaceLaunches, N as parseActiveBuild, W as statsProjectKey$1, Wt as readRemoteSession, Xt as readFootprints, Yt as attributeMachineUsage, _ as metroLastStop, j as buildStatusLine, k as activeBuildState, o as machineNumber, p as describeMetroLastStop } from "./budget-DIhL2BKx.mjs";
12
- import { m as resolveSupervisorTarget } from "./workspaces-xXItD8Dj.mjs";
13
- import { d as readWebActivity, f as tailLines, i as createDeviceProcessTables, r as createActivityReader } from "./activity-BxnkDZDi.mjs";
14
- import { i as listLeaseFiles, r as leaseIsExpired, s as parseWorkspaceLeases } from "./device-lease-Co-EwifR.mjs";
15
- import { F as ownedAvdDeviceProfile, O as listAdbDevices, d as androidToolPath, ft as parkedMaxSetting, ot as POOL_SETTING_REMEDY, pt as readParked, z as ownedAvdSerialResolver } from "./android-DC3ZLuw0.mjs";
16
- import { f as listAllIosSimsAsync, y as parseSimctlList } from "./ios-B3SbOWdw.mjs";
17
- import { F as resolveSettings } from "./settings-CQyMElEP.mjs";
2
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
+ import { a as formatElapsed, i as formatDuration, r as clockTime, u as plural } from "./command-output-Bt8ygHE7.mjs";
4
+ import { B as parseDeviceSlotKey, F as volumeRootFor, H as projectDeviceSlots, R as deviceSlotKey, _ as loadConfig$1, d as getConfigDir, j as formatBytes } from "./config-DC5jEtd1.mjs";
5
+ import { b as workspaceLogErrorIndex, r as readWorkspaceState$1, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
6
+ import { A as readWorkspaceLaunches, E as readMetroTunnel, O as readRemoteSession, _ as readAppJson, c as projectShortcut, i as findServerWorkspace, l as detectPlatforms, m as detectTutorial, p as detectIsExpo } from "./project-B5eQ1USs.mjs";
7
+ import { I as resolveSettings, ct as linkedWorktreesOnDisk, mt as repoRoot, nt as gitCommonDir, rt as gitCommonDirOnDisk } from "./settings-CxgngUZk.mjs";
8
+ import { a as listeningPidsByPort, c as processCwd, i as listeningPids, l as processCwds, p as isMetroRunning, s as pidExists, u as resolveProjectMetro } from "./metro-DI2AjPF_.mjs";
9
+ import { a as readWebPage, o as readWebRecord, u as webFacts } from "./state-D2KtnALG.mjs";
10
+ import { C as statusActivity, E as withWebFacts, S as remoteDeviceState, T as unprovisionedWorktrees, _ as gitSummaryText, b as poolLine, c as activityLabel, d as capacity, f as deviceLeaseLines, h as environmentState, l as addReverseMissingIssue, m as diskLine, p as deviceLeaseStates, u as applyMachineMemory, v as metroReverseTargets, w as tightVolumes, x as remoteDeviceLine, y as parseDfFree } from "./watchman-BL1IdOtq.mjs";
11
+ import { A as buildReport, B as readStats$1, D as ACTIVE_BUILD_KEY, Mt as readFootprints, N as parseActiveBuild, W as statsProjectKey$1, _ as metroLastStop, j as buildStatusLine, jt as attributeMachineUsage, k as activeBuildState, o as machineNumber, p as describeMetroLastStop } from "./budget-Dz-kyXLv.mjs";
12
+ import { m as resolveSupervisorTarget } from "./workspaces-Djb2gfi9.mjs";
13
+ import { d as readWebActivity, f as tailLines, i as createDeviceProcessTables, r as createActivityReader } from "./activity-BSw0x84R.mjs";
14
+ import { i as listLeaseFiles, r as leaseIsExpired, s as parseWorkspaceLeases } from "./device-lease-Cu7PtQpZ.mjs";
15
+ import { F as ownedAvdDeviceProfile, O as listAdbDevices, d as androidToolPath, ft as parkedMaxSetting, ot as POOL_SETTING_REMEDY, pt as readParked, z as ownedAvdSerialResolver } from "./android-BdQC6zs1.mjs";
16
+ import { f as listAllIosSimsAsync, y as parseSimctlList } from "./ios-BWbHFZVz.mjs";
18
17
  import { a as parseNdjsonLine } from "./ndjson-LGZAMsqa.mjs";
19
- import { l as probeHostedSession } from "./hosted-client-C-rMtppF.mjs";
20
- import { m as hasMetroReverse } from "./app-install-D-PUENug.mjs";
21
- import { m as readEasSessionLedger$1, p as easMachineStateRoot$1 } from "./device-remote-tHbd1fKy.mjs";
22
- import { d as readIosDevices, s as isReachable } from "./ios-device-vOaByMhw.mjs";
23
- import "./hosted-macos-B-wEjlwG.mjs";
24
- import { i as readSupervisorState } from "./stop-BTjs3xbc.mjs";
25
- import { i as createStatusMeasurer, n as workspacePhase, r as applyStatusMeasures, s as mergeState } from "./warm-progress-CjB-MP6H.mjs";
26
- import { r as workspaceRecordingEnabled } from "./recordings-BAWltsVt.mjs";
27
- import { t as detectPlatforms } from "./projects-DD7dBTCj.mjs";
18
+ import { l as probeHostedSession } from "./hosted-client-C5G4h_OJ.mjs";
19
+ import { m as hasMetroReverse } from "./app-install-CFI4ptUL.mjs";
20
+ import { m as readEasSessionLedger$1, p as easMachineStateRoot$1 } from "./device-remote-B5GiUifk.mjs";
21
+ import { d as readIosDevices, s as isReachable } from "./ios-device-CJ_ZOGky.mjs";
22
+ import "./hosted-macos-DABm3ScO.mjs";
23
+ import { i as readSupervisorState } from "./stop-zDlknFoz.mjs";
24
+ import { i as createStatusMeasurer, n as workspacePhase, r as applyStatusMeasures, s as mergeState } from "./warm-progress-pFLB2e6P.mjs";
25
+ import { r as workspaceRecordingEnabled } from "./recordings-Bv8McZN4.mjs";
28
26
  import { n as maintenanceLines, r as maintenanceStatus } from "./status-BEeL6IKz.mjs";
29
27
  import { t as watchStdoutReader } from "./stdout-reader-C8yjre1x.mjs";
30
- import { t as triggerMaintenance } from "./trigger-CJMhwXe8.mjs";
28
+ import { t as triggerMaintenance } from "./trigger-CAhmG-4s.mjs";
31
29
  import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
32
30
  import { join, posix, resolve } from "node:path";
33
31
  import { basename as basename$1, dirname as dirname$1, join as join$1 } from "path";
@@ -35,8 +33,8 @@ import { DEVICE_RECLAIM_REASON, ERROR_SOURCES, archiveRoot, archivedUsage, bundl
35
33
  import chalk from "chalk";
36
34
  import { closeSync as closeSync$1, existsSync as existsSync$1, fstatSync as fstatSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readSync as readSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1, writeFileSync as writeFileSync$1 } from "fs";
37
35
  import { rotatedLogPath } from "@stim-cli/core";
38
- import { homedir, totalmem } from "os";
39
36
  import { createHash, randomUUID } from "node:crypto";
37
+ import { homedir, totalmem } from "os";
40
38
  //#region src/device-host/hosted-native-status.ts
41
39
  function hostedNativeProbe(placement, probe, slot, platform) {
42
40
  const label = platform === "ios" ? "iOS" : "Android";
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
2
  //#region src/devices/stim-desktop.ts
3
3
  const LAUNCH_SERVICES_LOOKUP = `ObjC.import('AppKit'); const url = $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier('dev.stim.desktop'); url.isNil() ? '' : url.path.js`;
4
4
  const SCHEME_HANDLER_LOOKUP = `ObjC.import('AppKit'); const url = $.NSWorkspace.sharedWorkspace.URLForApplicationToOpenURL($.NSURL.URLWithString('stim-desktop://workspace')); url.isNil() ? '' : url.path.js`;
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
2
  import { accessSync, constants, realpathSync, statSync } from "node:fs";
3
3
  import { delimiter, join, resolve } from "node:path";
4
4
  //#region src/diagnostics/stim-installations.ts
@@ -0,0 +1,72 @@
1
+ import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
+ import { c as writeWorkspaceState, v as workspaceDir } from "./workspace-state-CR9X86xJ.mjs";
3
+ import { C as runningBundleInstances } from "./workspaces-Djb2gfi9.mjs";
4
+ import { a as withWorkspaceProcessLock } from "./named-ports-B4iWH4E-.mjs";
5
+ import { a as macosRuntimeClaim, o as requiredMacosRecord } from "./state-Tp4uImDS.mjs";
6
+ import { n as stopHostedMacos } from "./hosted-macos-DABm3ScO.mjs";
7
+ import { readMacosRecord } from "@stim-cli/core/state";
8
+ //#region src/macos/stop.ts
9
+ const APP_EXIT_MS = 5e3;
10
+ const SUPERVISOR_EXIT_MS = 12e3;
11
+ function signal(pid, name) {
12
+ try {
13
+ process.kill(pid, name);
14
+ } catch (error) {
15
+ if (error.code !== "ESRCH") throw error;
16
+ }
17
+ }
18
+ async function stopProcesses(records, waitMs = APP_EXIT_MS) {
19
+ let live = [...new Map(records.map((record) => [record.pid, record])).values()];
20
+ for (const name of ["SIGTERM", "SIGKILL"]) {
21
+ live = live.filter((record) => {
22
+ const identity = (0, process_identity_exports.inspectProcessIdentity)(record);
23
+ if (identity === "gone" || identity === "different") return false;
24
+ if (identity !== "same") throw Object.assign(/* @__PURE__ */ new Error(`Cannot verify macOS owner pid ${record.pid}; no signal was sent.`), { code: "STIM_MACOS_OWNER_UNVERIFIED" });
25
+ return true;
26
+ });
27
+ for (const record of live) signal(record.pid, name);
28
+ const exited = await Promise.all(live.map((record) => (0, process_identity_exports.waitForProcessExit)(record, waitMs)));
29
+ live = live.filter((_, index) => !exited[index]);
30
+ if (!live.length) return;
31
+ }
32
+ throw new Error(`Owned macOS process ${live.map((record) => record.pid).join(", ")} did not exit.`);
33
+ }
34
+ /** Stops every running copy of the workspace's owned app bundle, including copies LaunchServices started. */
35
+ async function stopBundleInstances(root) {
36
+ const instances = runningBundleInstances(root);
37
+ await stopProcesses(instances);
38
+ return instances.length > 0;
39
+ }
40
+ async function stopMacosAppHeld(root) {
41
+ const record = requiredMacosRecord(root);
42
+ if (record?.supervisor) await stopProcesses([record.supervisor], SUPERVISOR_EXIT_MS);
43
+ const app = readMacosRecord(root)?.app ?? record?.app;
44
+ if (app) await stopProcesses([app]);
45
+ const instances = runningBundleInstances(root);
46
+ await stopProcesses(instances);
47
+ if (!record) return instances.length > 0;
48
+ const claims = (0, ownership_claim_exports.readClaimSet)(macosRuntimeClaim(root));
49
+ if (claims.unresolved.length || claims.live.length) throw Object.assign(/* @__PURE__ */ new Error("The macOS runtime claim cannot be released; inspect its recorded owner before cleanup."), { code: "STIM_MACOS_OWNER_UNVERIFIED" });
50
+ return true;
51
+ }
52
+ /** Stops the workspace's app here, or its session on the hosting Mac, which must confirm the session stopped. */
53
+ function stopMacosApp(root) {
54
+ const stop = async () => {
55
+ const record = requiredMacosRecord(root);
56
+ if (!record?.host) return stopMacosAppHeld(root);
57
+ await stopHostedMacos(root, record.host);
58
+ const { host: _host, hostLaunched: _launched, ...stopped } = record;
59
+ writeWorkspaceState(root, { macos: {
60
+ ...stopped,
61
+ supervisor: void 0
62
+ } });
63
+ return true;
64
+ };
65
+ return withWorkspaceProcessLock(workspaceDir(root), "macos-launch", stop, {
66
+ external: true,
67
+ waitMs: 0,
68
+ ownerPurpose: "stop macOS app"
69
+ });
70
+ }
71
+ //#endregion
72
+ export { stopMacosApp as n, stopMacosAppHeld as r, stopBundleInstances as t };
@@ -1,3 +1,3 @@
1
- import { m as resolveSupervisorTarget } from "./workspaces-xXItD8Dj.mjs";
2
- import { a as resolveCollectorTargets, c as stopWorkspaceNow, i as readSupervisorState, n as clearSupervisorState, o as runStop, r as readCollectorState, s as stopCommand, t as clearCollectorState } from "./stop-BTjs3xbc.mjs";
1
+ import { m as resolveSupervisorTarget } from "./workspaces-Djb2gfi9.mjs";
2
+ import { a as resolveCollectorTargets, c as stopWorkspaceNow, i as readSupervisorState, n as clearSupervisorState, o as runStop, r as readCollectorState, s as stopCommand, t as clearCollectorState } from "./stop-zDlknFoz.mjs";
3
3
  export { clearCollectorState, clearSupervisorState, stopCommand as default, readCollectorState, readSupervisorState, resolveCollectorTargets, resolveSupervisorTarget, runStop, stopWorkspaceNow };