stim 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +60 -7
  2. package/dist/{acquire-artifact-CD4lbiWE.mjs → acquire-artifact-Co2k4f7O.mjs} +21 -3
  3. package/dist/{act-DHAw2A2S.mjs → act-DsuqEkiM.mjs} +298 -164
  4. package/dist/{activity-BzVfHSrY.mjs → activity-CMLmzp7o.mjs} +33 -12
  5. package/dist/{agent-device-usage-output-zh1vhbLp.mjs → agent-device-usage-output-DUFaTMdd.mjs} +7 -7
  6. package/dist/{android-BLgbNqox.mjs → android-ByRMUoiJ.mjs} +66 -52
  7. package/dist/{android-DUYkNF4u.mjs → android-C7sVmyI9.mjs} +160 -59
  8. package/dist/{android-CV_GCELZ.mjs → android-DGkNqa_c.mjs} +5 -5
  9. package/dist/{android-BEJ8Jpl7.mjs → android-DR5lZ2Az.mjs} +2 -2
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/{android-cas-Ct5b1xCK.mjs → android-cas-ngferVq2.mjs} +3 -3
  12. package/dist/{client-B7QVOlCr.d.mts → android-project-DVWyCbWU.d.mts} +145 -7
  13. package/dist/api.d.mts +132 -118
  14. package/dist/api.mjs +239 -42
  15. package/dist/{artifact-B8T3S5gi.mjs → artifact-8EY8SAPw.mjs} +40 -35
  16. package/dist/{artifact-DAuZ-FNU.mjs → artifact-DJPy518Y.mjs} +69 -40
  17. package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
  18. package/dist/{browser-web-QQzVjz3O.mjs → browser-web-Bcv99PBM.mjs} +187 -59
  19. package/dist/{budget-Bs6SxxzO.mjs → budget-Cvwn54qV.mjs} +830 -699
  20. package/dist/{build-CoPzQRNw.mjs → build-CabC3G23.mjs} +34 -27
  21. package/dist/{build-cache-DmyR9Zzc.mjs → build-cache-Dv7RN200.mjs} +4 -4
  22. package/dist/{build-plan-CaFskB7_.mjs → build-plan-DUC8Ka9y.mjs} +74 -14
  23. package/dist/{cache-manifest-DkkqguoK.mjs → cache-manifest-DSeQjt-Q.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-BJRZ9pG3.mjs → ccache-Btwc36-I.mjs} +6 -6
  26. package/dist/{cdp-CWmIUMbw.mjs → cdp-3fwICjzi.mjs} +1 -1
  27. package/dist/{chrome-B6tfCta1.mjs → chrome-Bbw689-6.mjs} +1 -1
  28. package/dist/{cli-0DYf8QhQ.mjs → cli-CHZa9Lvk.mjs} +20 -20
  29. package/dist/cli.mjs +1 -1
  30. package/dist/{client-UXD70ZbM.mjs → client-OyRoEuSr.mjs} +218 -47
  31. package/dist/collector-run.d.mts +1 -1
  32. package/dist/collector-run.mjs +6 -6
  33. package/dist/{command-output-B1UrjZHL.mjs → command-output-gwpm28fu.mjs} +1 -1
  34. package/dist/{config-CYcBF478.mjs → config-DlrsduwG.mjs} +17 -11
  35. package/dist/{created-devices-CqeBlrEn.mjs → created-devices-x9rN6bhs.mjs} +13 -3
  36. package/dist/{dependency-state-BbKQW83h.mjs → dependency-state-1I9KZT1Y.mjs} +2 -2
  37. package/dist/{detached-entry-DFRyG1_o.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
  38. package/dist/{dev-client-UOeESKm6.mjs → dev-client-BSDR5h3F.mjs} +2 -2
  39. package/dist/{device-ExJq8Ei7.mjs → device-B-L3Fbxy.mjs} +71 -14
  40. package/dist/{device-DCxH7_By.mjs → device-DklWZLqb.mjs} +16 -16
  41. package/dist/{device-capacity-CMlqEcvw.mjs → device-capacity-DK5_EwRS.mjs} +9 -10
  42. package/dist/device-host-worker.mjs +25 -32
  43. package/dist/{device-ios-DRUeKaFV.mjs → device-ios-DoB6KFCO.mjs} +39 -16
  44. package/dist/{device-lease-run-C8raGFoP.mjs → device-lease-run-xJPQ_QQG.mjs} +5 -5
  45. package/dist/{device-pool-DMRpVX9a.mjs → device-pool-BMkdsefq.mjs} +3 -3
  46. package/dist/{doctor-DTvaDOda.mjs → doctor-Bo7BXLux.mjs} +24 -37
  47. package/dist/{doctor-Dhqebm0q.mjs → doctor-D5_EzwfA.mjs} +19 -16
  48. package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
  49. package/dist/doctor-fingerprint.mjs +1 -1
  50. package/dist/{doctor-BLHCYxzi.mjs → doctor-thjWAV0z.mjs} +1 -1
  51. package/dist/{doctor-watchman-Cv1F10Kj.mjs → doctor-watchman-N2wDotwQ.mjs} +5 -5
  52. package/dist/{eas-build-BomfRnFT.mjs → eas-build-CwknaQYj.mjs} +4 -4
  53. package/dist/{eas-fallback-DJwZpy0c.mjs → eas-fallback-CSgAulr5.mjs} +27 -18
  54. package/dist/{eas-session-ledger-op6A54yi.mjs → eas-session-ledger-DlY_serQ.mjs} +8 -7
  55. package/dist/{error-diagnostics-Bf0rZvG9.mjs → error-diagnostics-DBWO2rxE.mjs} +10 -10
  56. package/dist/{exec-_UbtCQcG.mjs → exec-DEoAhcze.mjs} +155 -47
  57. package/dist/{exec-H20xSg2T.d.mts → exec-DnYc4HGH.d.mts} +17 -4
  58. package/dist/{gc-_-dCXdyL.mjs → gc-CXxN-4SE.mjs} +587 -313
  59. package/dist/gc-DnNDQyaP.mjs +3 -0
  60. package/dist/{guide-Yqwt2bd6.mjs → guide-Br0LEfKy.mjs} +239 -43
  61. package/dist/{hosted-android-Bw-honsd.mjs → hosted-android-B-9f-jkd.mjs} +6 -6
  62. package/dist/{hosted-client-DB_gBPfY.mjs → hosted-client-DZAPrcro.mjs} +4 -4
  63. package/dist/{hosted-ios-CUvOf4Vr.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
  64. package/dist/{hosted-logs-DL_P5AdN.mjs → hosted-logs-FIRx9X2f.mjs} +5 -5
  65. package/dist/{hosted-macos-QI141yKk.mjs → hosted-macos-_awYSpfv.mjs} +21 -12
  66. package/dist/{hosted-native-Ksyjgzq-.mjs → hosted-native-BdzE668-.mjs} +27 -14
  67. package/dist/{idle-BVeRGroT.d.mts → idle-C4cZ757K.d.mts} +3 -3
  68. package/dist/{idle-shutdown-DaKmZi0z.mjs → idle-shutdown-DDg3SdvY.mjs} +7 -7
  69. package/dist/ios-CDvlmUs7.d.mts +24 -0
  70. package/dist/{ios-CQ68hG9s.mjs → ios-Ds1clbIt.mjs} +8 -8
  71. package/dist/{ios-device-CwFMehUS.mjs → ios-device--h_-8ENa.mjs} +3 -3
  72. package/dist/{ios-device-CXGP1bsD.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
  73. package/dist/{ios-CpByZy12.mjs → ios-hcBpnEGk.mjs} +81 -34
  74. package/dist/{ios-ubFsBzwq.mjs → ios-pm4nL6By.mjs} +59 -50
  75. package/dist/{ios-project-WuwwBdvW.mjs → ios-project-CZhKODF3.mjs} +5 -5
  76. package/dist/{ios-signing-DTTIChGs.mjs → ios-signing-BtAffm0A.mjs} +2 -2
  77. package/dist/{ios-state-DvFX-K_l.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
  78. package/dist/{ios-qNJt4dFm.mjs → ios-xtlRHaeB.mjs} +1 -1
  79. package/dist/{js-swap-Cc1dttps.mjs → js-swap-Bwhh4S7V.mjs} +7 -29
  80. package/dist/{launch-Zq2mOSDy.mjs → launch-BjxemNpK.mjs} +40 -39
  81. package/dist/{launch-CD1yVc7U.mjs → launch-CCzXlc8r.mjs} +16 -16
  82. package/dist/{logs-BS00Anxf.mjs → logs-BfwwadsZ.mjs} +151 -24
  83. package/dist/{logs-CMm05HxN.mjs → logs-jTS_lHSo.mjs} +10 -17
  84. package/dist/{macos-B65--pPd.mjs → macos-DVlSSyUg.mjs} +1 -1
  85. package/dist/{macos-C-0qJ6zq.mjs → macos-NfV2D7dO.mjs} +143 -46
  86. package/dist/macos-run.mjs +1 -1
  87. package/dist/maintenance-run.mjs +8 -8
  88. package/dist/{metro-DEXpIhHC.mjs → metro-DiXtA3Ty.mjs} +59 -37
  89. package/dist/{metro-gateway-BMJNlj3E.mjs → metro-gateway-CKZqKqx7.mjs} +120 -22
  90. package/dist/{named-ports-BWTzt6mu.mjs → named-ports-DkEzOfzO.mjs} +40 -33
  91. package/dist/{native-android-JACyjTZs.mjs → native-android-CqgnOgsT.mjs} +43 -242
  92. package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
  93. package/dist/{native-gradle-inputs-Bep9JcSF.mjs → native-gradle-inputs-Dnh84Zbd.mjs} +3 -129
  94. package/dist/{native-run-DY_RLx3C.mjs → native-run-NwUuxbkg.mjs} +4 -5
  95. package/dist/{native-runtime-Dg1Q7tfF.mjs → native-runtime-B7KIafpM.mjs} +8 -7
  96. package/dist/native-source-Y0yLhFyQ.mjs +133 -0
  97. package/dist/{native-xcode-inputs-CB2iQeWq.mjs → native-xcode-inputs-D_VOfFL7.mjs} +2 -3
  98. package/dist/{native-xcode-ios-CXX39F7o.mjs → native-xcode-ios-BYDOHWLN.mjs} +27 -32
  99. package/dist/offload-worker.d.mts +65 -2
  100. package/dist/offload-worker.mjs +305 -73
  101. package/dist/operation-exec-BW0em61G.mjs +171 -0
  102. package/dist/{ownership-DEmM5vhh.mjs → ownership-C5fo5Edb.mjs} +3 -3
  103. package/dist/{page-CPaHeYqj.mjs → page-DBL2PiUU.mjs} +8 -4
  104. package/dist/{placement-log-BqGbTa61.mjs → placement-log-BnGgJRRZ.mjs} +1 -1
  105. package/dist/{plan-placement-Bwj-IjY1.mjs → plan-placement-DIsMtN-d.mjs} +12 -8
  106. package/dist/{ports-D-MmCTdv.mjs → ports-Cy1RkmuQ.mjs} +3 -3
  107. package/dist/{prebuild-uD_ipCxF.mjs → prebuild-D4JoEAEs.mjs} +49 -14
  108. package/dist/{project-BZNjmW_8.mjs → project-wM_XFTvE.mjs} +16 -16
  109. package/dist/{pull-request-Lfetn8Kr.mjs → pull-request-W1IuLXDt.mjs} +102 -20
  110. package/dist/{pull-request-zjCSAryH.d.mts → pull-request-eODyIqZF.d.mts} +6 -2
  111. package/dist/pull-requests.d.mts +2 -2
  112. package/dist/pull-requests.mjs +2 -2
  113. package/dist/{react-native-android-DuzH0cn3.mjs → react-native-android-6OZ7MSM7.mjs} +71 -48
  114. package/dist/{react-native-build-rhk4smwQ.mjs → react-native-build-Dvd8hC21.mjs} +8 -8
  115. package/dist/{react-native-doctor-CQpuIMso.mjs → react-native-doctor-DsoSF1Y9.mjs} +7 -7
  116. package/dist/{react-native-ios-Bhq1rJeV.mjs → react-native-ios-4u1Rn-GR.mjs} +40 -26
  117. package/dist/{recordings-DYteQSu4.mjs → recordings-CQmfzAh7.mjs} +1 -1
  118. package/dist/registration-BcRgF6Ox.mjs +51 -0
  119. package/dist/{reload-CmTRFJaX.mjs → reload-BzkYabB-.mjs} +16 -15
  120. package/dist/{reload-DzjSl5P_.mjs → reload-D7AVlb8N.mjs} +1 -1
  121. package/dist/{remote-ByYkXdGD.mjs → remote-DjGDmlTZ.mjs} +18 -15
  122. package/dist/{result-DNiS-tTP.mjs → result-D2Ykz_iD.mjs} +24 -23
  123. package/dist/{run-D23HmJMs.mjs → run-DidHghD1.mjs} +3 -2
  124. package/dist/{selection-CSl9i5qU.mjs → selection-DSMbWEX2.mjs} +6 -5
  125. package/dist/{server-bare-CxTrvDg8.mjs → server-bare-CafzuyFB.mjs} +2 -2
  126. package/dist/{server-command-CtzloH3v.mjs → server-command-C6QjeupS.mjs} +5 -5
  127. package/dist/{server-expo-DT_F_uVI.mjs → server-expo-CrjB29pq.mjs} +7 -5
  128. package/dist/server-expo-D58c9L0M.mjs +2 -0
  129. package/dist/{settings-CsJDEXgK.mjs → settings-C7O8A6ZI.mjs} +223 -243
  130. package/dist/{settings-T1gtc3bf.mjs → settings-DpR-1Wnn.mjs} +1 -1
  131. package/dist/{settings-write-HyVZ8eQ8.mjs → settings-write-CzD60rOD.mjs} +7 -6
  132. package/dist/settings.schema.json +13 -0
  133. package/dist/{simslim-Cgk17SXV.mjs → simslim-BNckWpXi.mjs} +2 -2
  134. package/dist/{slot-launch-DF8VfT64.mjs → slot-launch-CbfmNgM6.mjs} +6 -6
  135. package/dist/{stage-BIS0ydsV.mjs → stage-Bps5oius.mjs} +21 -4
  136. package/dist/{start-RChynRDp.mjs → start-Br-oxqMD.mjs} +1 -1
  137. package/dist/{start-7lpH7hmN.mjs → start-EojN4WFz.mjs} +622 -393
  138. package/dist/{state-C4ZtUisW.mjs → state--smjFSTL.mjs} +22 -7
  139. package/dist/{state-XMziexv2.mjs → state-08I3hw3_.mjs} +2 -2
  140. package/dist/{stats-53T7OTb9.mjs → stats-D3GerlFW.mjs} +5 -5
  141. package/dist/{stats-report-BFfMpWWF.mjs → stats-report-BzaPrRm6.mjs} +1 -1
  142. package/dist/{status-DqEUSSxs.mjs → status-BRROykC8.mjs} +2 -2
  143. package/dist/{status-CSi6tlRq.mjs → status-EvrK72L2.mjs} +1 -1
  144. package/dist/{status-BL7jVyAB.mjs → status-WBDajew2.mjs} +43 -29
  145. package/dist/{status-watch-GDCfqpTE.mjs → status-watch-Bg_u-pwR.mjs} +48 -16
  146. package/dist/status-worker.mjs +1 -1
  147. package/dist/{stim-desktop-C12we7lz.mjs → stim-desktop-D5OGpYZM.mjs} +2 -2
  148. package/dist/{stop-Bk_1qiV6.mjs → stop-DTZ9uTw3.mjs} +2 -2
  149. package/dist/{stop-D7h6jAXQ.mjs → stop-Dky10AEJ.mjs} +31 -22
  150. package/dist/{stop-CPzlM1L-.mjs → stop-Mv6W9FAk.mjs} +15 -16
  151. package/dist/supervisor-run.d.mts +3 -3
  152. package/dist/supervisor-run.mjs +28 -36
  153. package/dist/{support-Dlu37g6H.mjs → support-CNioewsd.mjs} +10 -10
  154. package/dist/{support-67vraa1Q.mjs → support-yUiOjnVY.mjs} +8 -8
  155. package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
  156. package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
  157. package/dist/toolchain-BY8X8HXx.mjs +2 -0
  158. package/dist/{toolchain-Hp9sCpK4.mjs → toolchain-DpJMHq0n.mjs} +9 -6
  159. package/dist/{trigger-BAahxUPq.mjs → trigger-Cbyc41d_.mjs} +3 -3
  160. package/dist/trigger-yb_nFzPF.mjs +2 -0
  161. package/dist/{warm-progress-BHX5r0Ei.mjs → warm-progress-CA3TgT3-.mjs} +29 -16
  162. package/dist/web-CZ07gd77.mjs +2 -0
  163. package/dist/{web-CJmIj6AI.mjs → web-DKx6yoFA.mjs} +11 -10
  164. package/dist/web-run.mjs +11 -9
  165. package/dist/windows-report.mjs +1 -1
  166. package/dist/{workspace-state-Cjuigeeu.mjs → workspace-state-U08dEzhG.mjs} +3 -3
  167. package/dist/{workspaces-BccMFmGQ.mjs → workspaces-CpANmBlq.mjs} +594 -266
  168. package/dist/{worktree-DQ6Zi2Mv.mjs → worktree-CHecZ4Oq.mjs} +850 -551
  169. package/dist/worktree-ZqZVjD9K.mjs +2 -0
  170. package/dist/{xcode-Zlx3qjEs.mjs → xcode-BXn9-xYx.mjs} +5 -5
  171. package/package.json +7 -7
  172. package/shim/android-audio/Main.java +24 -0
  173. package/shim/android-audio/README.md +17 -0
  174. package/shim/android-audio.jar +0 -0
  175. package/dist/gc-C-WwL0yi.mjs +0 -3
  176. package/dist/git-C3iTsJaZ.mjs +0 -73
  177. package/dist/server-expo-C-90EhcG.mjs +0 -2
  178. package/dist/settings-DkdmlelE.d.mts +0 -15
  179. package/dist/swiftpm-macos-p8WZbxKU.mjs +0 -130
  180. package/dist/toolchain-DhKwp9iI.mjs +0 -2
  181. package/dist/trigger-Bf3uDcpv.mjs +0 -2
  182. package/dist/web-DknQETPs.mjs +0 -2
  183. package/dist/workspace-process-lock-1_1OoVW5.mjs +0 -57
  184. package/dist/worktree-CK2MpJW5.mjs +0 -2
@@ -1,7 +1,8 @@
1
- import { f as ownership_claim_exports, p as process_identity_exports, t as getExecutor } from "./exec-_UbtCQcG.mjs";
1
+ import { g as process_identity_exports, r as WorkspaceProcessCleanupError, t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
2
  import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
- import { d as writeWorkspaceState, o as updateWorkspaceState, r as readWorkspaceState$1, t as clearWorkspaceStateKey } from "./workspace-state-Cjuigeeu.mjs";
4
- import { l as pidExists } from "./metro-DEXpIhHC.mjs";
3
+ import { t as runOperationFile } from "./operation-exec-BW0em61G.mjs";
4
+ import { d as writeWorkspaceState, o as updateWorkspaceState, r as readWorkspaceState$1, t as clearWorkspaceStateKey } from "./workspace-state-U08dEzhG.mjs";
5
+ import { c as pidExists } from "./metro-DiXtA3Ty.mjs";
5
6
  import { readFileSync, readlinkSync, rmSync } from "node:fs";
6
7
  import { hostname } from "node:os";
7
8
  import { join } from "node:path";
@@ -69,18 +70,32 @@ function chromeProcessState(record, profile) {
69
70
  return groupRunsProfile(listing, record.pid, profile) ? "lingering" : "gone";
70
71
  }
71
72
  /** Checks the owned Chrome process or surviving group without blocking on ps. */
72
- async function chromeProcessStateAsync(record, profile) {
73
+ async function chromeProcessStateAsync(record, profile, operation) {
74
+ operation?.signal.throwIfAborted();
73
75
  const state = chromeIdentityState(record);
74
76
  if (state) return state;
75
- const listing = await getExecutor().runFileQuietAsync("ps", [
77
+ let listing;
78
+ const args = [
76
79
  "-A",
77
80
  "-ww",
78
81
  "-o",
79
82
  "pgid=,command="
80
- ], {
83
+ ];
84
+ const options = {
81
85
  timeoutMs: 1e4,
82
86
  killSignal: "SIGKILL"
83
- });
87
+ };
88
+ if (operation) try {
89
+ listing = await runOperationFile(operation, getExecutor(), "ps", args, {
90
+ ...options,
91
+ cwd: operation.cwd
92
+ });
93
+ } catch (error) {
94
+ if (error instanceof WorkspaceProcessCleanupError) throw error;
95
+ operation.signal.throwIfAborted();
96
+ return "unknown";
97
+ }
98
+ else listing = await getExecutor().runFileQuietAsync("ps", args, options);
84
99
  if (listing === null) return "unknown";
85
100
  return groupRunsProfile(listing, record.pid, profile) ? "lingering" : "gone";
86
101
  }
@@ -1,6 +1,6 @@
1
- import { p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
1
+ import { g as process_identity_exports } from "./exec-DEoAhcze.mjs";
2
2
  import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
- import { o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-Cjuigeeu.mjs";
3
+ import { o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
4
4
  import { existsSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { readMacosRecord } from "@stim-cli/core/state";
@@ -1,8 +1,8 @@
1
- import { P as formatBytes } from "./config-CYcBF478.mjs";
2
- import { o as formatLongDuration } from "./command-output-B1UrjZHL.mjs";
3
- import { i as findProjectRoot$1 } from "./project-BZNjmW_8.mjs";
4
- import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-zh1vhbLp.mjs";
5
- import { t as readProjectStats } from "./stats-report-BFfMpWWF.mjs";
1
+ import { P as formatBytes } from "./config-DlrsduwG.mjs";
2
+ import { o as formatLongDuration } from "./command-output-gwpm28fu.mjs";
3
+ import { i as findProjectRoot$1 } from "./project-wM_XFTvE.mjs";
4
+ import { i as getSwiftpmCacheUsage, n as swiftpmCacheLines, r as getAgentDeviceUsage, t as agentDeviceLines } from "./agent-device-usage-output-DUFaTMdd.mjs";
5
+ import { t as readProjectStats } from "./stats-report-BzaPrRm6.mjs";
6
6
  import { archivedUsage, readArchives } from "@stim-cli/core/state";
7
7
  import chalk from "chalk";
8
8
  //#region src/commands/stats.ts
@@ -1,4 +1,4 @@
1
- import { Kt as gitPath } from "./settings-CsJDEXgK.mjs";
1
+ import { i as gitPath } from "./operation-exec-BW0em61G.mjs";
2
2
  import { readStatsReport, statsProjectKey } from "@stim-cli/core/state";
3
3
  //#region src/engine/stats-report.ts
4
4
  /** The stats report for the project at `root`, keyed like the run recorders; Git runs with `env` and dies when `signal` aborts. */
@@ -1,7 +1,7 @@
1
- import { P as formatBytes } from "./config-CYcBF478.mjs";
1
+ import { P as formatBytes } from "./config-DlrsduwG.mjs";
2
2
  import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
3
- import { maintenanceRunClaims, readMaintenanceState } from "@stim-cli/core/state";
4
3
  import { claimRemoveCommand, readClaimSet } from "@stim-cli/core/ownership-claim";
4
+ import { maintenanceRunClaims, readMaintenanceState } from "@stim-cli/core/state";
5
5
  //#region src/maintenance/status.ts
6
6
  function maintenanceStatus(env = process.env) {
7
7
  const state = readMaintenanceState();
@@ -1,2 +1,2 @@
1
- import { n as runStatusWatch, r as statusCommand, t as readVolumes } from "./status-BL7jVyAB.mjs";
1
+ import { n as runStatusWatch, r as statusCommand, t as readVolumes } from "./status-WBDajew2.mjs";
2
2
  export { statusCommand as default, readVolumes, runStatusWatch };
@@ -1,29 +1,29 @@
1
- import { p as process_identity_exports, t as getExecutor } from "./exec-_UbtCQcG.mjs";
1
+ import { g as process_identity_exports, t as getExecutor } from "./exec-DEoAhcze.mjs";
2
2
  import { m as workspaceLogsDir$1, p as workspaceLogErrorIndex } from "./paths-DQtTgsBf.mjs";
3
- import { H as deviceSlotKey, K as projectDeviceSlots, P as formatBytes, W as parseDeviceSlotKey, _ as loadConfig$1, d as getConfigDir, z as volumeRootFor } from "./config-CYcBF478.mjs";
4
- import { a as formatElapsed, i as formatDuration, r as clockTime, u as plural } from "./command-output-B1UrjZHL.mjs";
5
- import { r as readWorkspaceState$1 } from "./workspace-state-Cjuigeeu.mjs";
6
- import { Dt as linkedWorktreesOnDisk, Ft as repoRoot, Y as resolveSettings, bt as gitCommonDirOnDisk, ot as workspaceHiddenSetting, vt as gitCommonDir } from "./settings-CsJDEXgK.mjs";
7
- import { n as gitAsync } from "./git-C3iTsJaZ.mjs";
8
- import { I as readWorkspaceLaunches, M as readMetroTunnel, P as readRemoteSession, S as readAppJson, a as findServerWorkspace, l as projectShortcut, u as detectPlatforms, v as detectIsExpo, y as detectTutorial } from "./project-BZNjmW_8.mjs";
3
+ import { G as projectDeviceSlots, P as formatBytes, R as volumeRootFor, U as parseDeviceSlotKey, V as deviceSlotKey, _ as loadConfig$1, d as getConfigDir } from "./config-DlrsduwG.mjs";
4
+ import { a as formatElapsed, i as formatDuration, r as clockTime, u as plural } from "./command-output-gwpm28fu.mjs";
5
+ import { s as gitAsync } from "./operation-exec-BW0em61G.mjs";
6
+ import { r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
7
+ import { Mt as repoRoot, Y as resolveSettings, _t as gitCommonDir, ot as workspaceHiddenSetting, wt as linkedWorktreesOnDisk, yt as gitCommonDirOnDisk } from "./settings-C7O8A6ZI.mjs";
8
+ import { I as readWorkspaceLaunches, M as readMetroTunnel, P as readRemoteSession, S as readAppJson, a as findServerWorkspace, l as projectShortcut, u as detectPlatforms, v as detectIsExpo, y as detectTutorial } from "./project-wM_XFTvE.mjs";
9
9
  import { a as parseNdjsonLine } from "./ndjson-CgE_o3Dl.mjs";
10
- import { a as listeningPids, d as processCwds, f as resolveProjectMetro, g as isMetroRunning, l as pidExists, s as listeningPidsByPort, u as processCwd } from "./metro-DEXpIhHC.mjs";
11
- import { a as readWebPage, o as readWebRecord, u as webFacts } from "./state-C4ZtUisW.mjs";
12
- import { A as remoteDeviceState, C as environmentState, D as parseDfFree, E as metroReverseTargets, M as tightVolumes, N as unprovisionedWorktrees, O as poolLine, P as withWebFacts, S as diskLine, T as gitSummaryText, _ as addReverseMissingIssue, b as deviceLeaseLines, g as activityLabel, j as statusActivity, k as remoteDeviceLine, r as readEasSessionLedger$1, v as applyMachineMemory, x as deviceLeaseStates, y as capacity } from "./eas-session-ledger-op6A54yi.mjs";
13
- import { F as buildStatusLine, G as readStats$1, I as bundlingActivity, N as activeBuildState, P as buildReport, R as parseActiveBuild, Y as statsProjectKey$1, h as describeMetroLastStop, j as ACTIVE_BUILD_KEY, o as machineNumber, vn as hasMetroReverse, vr as attributeMachineUsage, y as metroLastStop, yr as readFootprints } from "./budget-Bs6SxxzO.mjs";
14
- import { m as resolveSupervisorTarget } from "./workspaces-BccMFmGQ.mjs";
15
- import { a as createDeviceProcessTables, b as leaseIsExpired, h as tailLines, m as readWebActivity, r as createActivityReader, w as parseWorkspaceLeases, x as listLeaseFiles } from "./activity-BzVfHSrY.mjs";
16
- import { H as ownedAvdSerialResolver, R as ownedAvdDeviceProfile, gt as readParked, ht as parkedMaxSetting, k as listAdbDevices, lt as POOL_SETTING_REMEDY } from "./android-DUYkNF4u.mjs";
17
- import { b as parseSimctlList, f as listAllIosSimsAsync } from "./ios-CpByZy12.mjs";
18
- import { f as probeHostedSession } from "./hosted-client-DB_gBPfY.mjs";
19
- import "./hosted-macos-QI141yKk.mjs";
20
- import { i as readSupervisorState } from "./stop-CPzlM1L-.mjs";
21
- import { n as maintenanceLines, r as maintenanceStatus } from "./status-DqEUSSxs.mjs";
22
- import { f as mergeState, i as createStatusMeasurer, n as workspacePhase, r as applyStatusMeasures } from "./warm-progress-BHX5r0Ei.mjs";
23
- import { r as workspaceRecordingEnabled } from "./recordings-DYteQSu4.mjs";
24
- import { d as readIosDevices, s as isReachable } from "./ios-device-CwFMehUS.mjs";
25
- import { t as triggerMaintenance } from "./trigger-BAahxUPq.mjs";
26
- import { a as createRefreshScheduler, c as watchStatusSources, n as WATCH_LIGHT_INTERVAL_MS, o as watchChangeKey, r as WATCH_MACHINE_INTERVAL_MS, s as watchPayload, t as WATCH_FALLBACK_MS } from "./status-watch-GDCfqpTE.mjs";
10
+ import { c as pidExists, d as resolveProjectMetro, h as isMetroRunning, i as listeningPids, l as processCwd, o as listeningPidsByPort, u as processCwds } from "./metro-DiXtA3Ty.mjs";
11
+ import { a as readWebPage, o as readWebRecord, u as webFacts } from "./state--smjFSTL.mjs";
12
+ import { A as remoteDeviceState, C as environmentState, D as parseDfFree, E as metroReverseTargets, M as tightVolumes, N as unprovisionedWorktrees, O as poolLine, P as withWebFacts, S as diskLine, T as gitSummaryText, _ as addReverseMissingIssue, b as deviceLeaseLines, g as activityLabel, j as statusActivity, k as remoteDeviceLine, r as readEasSessionLedger$1, v as applyMachineMemory, x as deviceLeaseStates, y as capacity } from "./eas-session-ledger-DlY_serQ.mjs";
13
+ import { F as buildStatusLine, G as readStats$1, I as bundlingActivity, N as activeBuildState, P as buildReport, R as parseActiveBuild, Y as statsProjectKey$1, h as describeMetroLastStop, j as ACTIVE_BUILD_KEY, o as machineNumber, vn as hasMetroReverse, vr as attributeMachineUsage, y as metroLastStop, yr as readFootprints } from "./budget-Cvwn54qV.mjs";
14
+ import { h as resolveSupervisorTarget } from "./workspaces-CpANmBlq.mjs";
15
+ import { a as createDeviceProcessTables, b as leaseIsExpired, h as tailLines, m as readWebActivity, r as createActivityReader, w as parseWorkspaceLeases, x as listLeaseFiles } from "./activity-CMLmzp7o.mjs";
16
+ import { A as listAdbDevices, B as ownedAvdDeviceProfile, W as ownedAvdSerialResolver, _t as parkedMaxSetting, dt as POOL_SETTING_REMEDY, vt as readParked } from "./android-C7sVmyI9.mjs";
17
+ import { b as parseSimctlList, f as listAllIosSimsAsync } from "./ios-hcBpnEGk.mjs";
18
+ import { f as probeHostedSession } from "./hosted-client-DZAPrcro.mjs";
19
+ import "./hosted-macos-_awYSpfv.mjs";
20
+ import { i as readSupervisorState } from "./stop-Mv6W9FAk.mjs";
21
+ import { n as maintenanceLines, r as maintenanceStatus } from "./status-BRROykC8.mjs";
22
+ import { f as mergeState, i as createStatusMeasurer, n as workspacePhase, r as applyStatusMeasures } from "./warm-progress-CA3TgT3-.mjs";
23
+ import { r as workspaceRecordingEnabled } from "./recordings-CQmfzAh7.mjs";
24
+ import { d as readIosDevices, s as isReachable } from "./ios-device--h_-8ENa.mjs";
25
+ import { t as triggerMaintenance } from "./trigger-Cbyc41d_.mjs";
26
+ import { a as createRefreshScheduler, c as watchStatusSources, n as WATCH_LIGHT_INTERVAL_MS, o as watchChangeKey, r as WATCH_MACHINE_INTERVAL_MS, s as watchPayload, t as WATCH_FALLBACK_MS } from "./status-watch-Bg_u-pwR.mjs";
27
27
  import { t as watchStdoutReader } from "./stdout-reader-C8yjre1x.mjs";
28
28
  import { createHash, randomUUID } from "node:crypto";
29
29
  import { mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -500,7 +500,8 @@ function gitFilesStamp(worktree, refs) {
500
500
  * default-branch commit stands in, because a merged branch stays merged. A judgement that timed out is not retried
501
501
  * for the same HEAD and target for five minutes. With `maxAgeMs`, a summary made that recently in this process is
502
502
  * reused while the git files it depends on are unchanged, so a change that is not staged can take up to `maxAgeMs`
503
- * to show; so is the null of a worktree whose directory is gone.
503
+ * to show; so is the null of a worktree whose directory is gone. Deferred merge verdicts are retried independently
504
+ * of the cached counts without renewing their age.
504
505
  */
505
506
  async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
506
507
  const now = Date.now();
@@ -518,7 +519,7 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
518
519
  const files = maxAgeMs > 0 ? gitFilesStamp(worktree, refs) : null;
519
520
  if (memo && memo.files !== null && memo.files === files?.stamp && now - memo.at < maxAgeMs) return {
520
521
  path: worktree.path,
521
- memo: memo.git
522
+ memo
522
523
  };
523
524
  const repository = worktree.repository;
524
525
  if (repository && !targets.has(repository)) targets.set(repository, defaultBranchOf(repository));
@@ -541,7 +542,16 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
541
542
  const summaries = /* @__PURE__ */ new Map();
542
543
  for (const read of reads) {
543
544
  if ("memo" in read) {
544
- summaries.set(read.path, read.memo ?? null);
545
+ const memo = read.memo;
546
+ if (memo?.git && memo.pendingMerge) {
547
+ const merge = mergedInto(read.path, memo.pendingMerge.head, memo.pendingMerge.target, budget);
548
+ memo.git = {
549
+ ...memo.git,
550
+ mergedInto: merge.into
551
+ };
552
+ if (!merge.deferred) delete memo.pendingMerge;
553
+ }
554
+ summaries.set(read.path, memo?.git ?? null);
545
555
  continue;
546
556
  }
547
557
  if (!read.status) {
@@ -564,12 +574,16 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
564
574
  upstream: counts.upstream,
565
575
  target: read.target?.ref ?? null
566
576
  };
567
- const settled = !merge?.deferred && refs.upstream === read.refs.upstream && refs.target === read.refs.target;
577
+ const settled = refs.upstream === read.refs.upstream && refs.target === read.refs.target;
568
578
  recent.set(read.path, {
569
579
  at: read.at,
570
580
  files: settled ? read.files?.stamp ?? null : null,
571
581
  refs,
572
- git: summary
582
+ git: summary,
583
+ ...merge?.deferred && head && read.target ? { pendingMerge: {
584
+ head,
585
+ target: read.target
586
+ } } : {}
573
587
  });
574
588
  summaries.set(read.path, summary);
575
589
  }
@@ -1,10 +1,10 @@
1
- import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
- import { l as pidExists } from "./metro-DEXpIhHC.mjs";
3
- import { n as easMachineStateRoot } from "./eas-session-ledger-op6A54yi.mjs";
4
- import { d as androidToolPath } from "./android-DUYkNF4u.mjs";
5
- import { b as parseSimctlList } from "./ios-CpByZy12.mjs";
6
- import { readdirSync, statSync, watch } from "node:fs";
7
- import { dirname, join } from "node:path";
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
+ import { c as pidExists } from "./metro-DiXtA3Ty.mjs";
3
+ import { n as easMachineStateRoot } from "./eas-session-ledger-DlY_serQ.mjs";
4
+ import { d as androidToolPath } from "./android-C7sVmyI9.mjs";
5
+ import { b as parseSimctlList } from "./ios-hcBpnEGk.mjs";
6
+ import { existsSync, readdirSync, statSync, watch } from "node:fs";
7
+ import { basename, dirname, join } from "node:path";
8
8
  //#region src/status-watch.ts
9
9
  const WATCH_FALLBACK_MS = 3e4;
10
10
  const WATCH_LIGHT_INTERVAL_MS = 1e3;
@@ -131,6 +131,7 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
131
131
  [join(home, "device-locks"), "leases"],
132
132
  [easMachineStateRoot(), "eas"]
133
133
  ]);
134
+ if (platform === "darwin") return dirs;
134
135
  let names = [];
135
136
  try {
136
137
  names = readdirSync(join(home, "workspaces"));
@@ -152,10 +153,25 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
152
153
  for (const [dir, kind] of desired) {
153
154
  if (watchers.has(dir)) continue;
154
155
  try {
155
- const watcher = watch(dir, (_event, name) => {
156
- const change = statusChange(kind, name === null ? null : String(name));
156
+ const recursive = platform === "darwin" && kind === "workspaces";
157
+ const watcher = watch(dir, { recursive }, (_event, name) => {
158
+ let source = kind;
159
+ let filename = name === null ? null : String(name);
160
+ if (recursive && filename !== null) {
161
+ const [, entry, child, ...nested] = filename.split("/");
162
+ if (entry !== void 0) {
163
+ if (entry === "logs" && child !== void 0 && nested.length === 0) {
164
+ source = "logs";
165
+ filename = child;
166
+ } else if (child === void 0) {
167
+ source = "workspace";
168
+ filename = entry;
169
+ } else return;
170
+ }
171
+ }
172
+ const change = statusChange(source, filename);
157
173
  if (!change) return;
158
- if (kind === "home" || kind === "workspaces" || kind === "workspace") {
174
+ if (source === "home" || source === "workspaces" || source === "workspace") {
159
175
  listingVersion++;
160
176
  reconcile();
161
177
  }
@@ -213,14 +229,24 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
213
229
  onChange("full");
214
230
  };
215
231
  const watchDir = (dir, listener) => {
216
- if (deviceWatchers.has(dir)) return;
217
232
  try {
218
- const watcher = watch(dir, (_event, name) => listener(name === null ? null : String(name)));
233
+ const ino = statSync(dir, { bigint: true }).ino;
234
+ const current = deviceWatchers.get(dir);
235
+ if (current?.ino === ino) return;
236
+ current?.watcher.close();
237
+ deviceWatchers.delete(dir);
238
+ const watcher = watch(dir, (_event, name) => {
239
+ if (!stopped && deviceWatchers.get(dir)?.watcher === watcher) listener(name === null ? null : String(name));
240
+ });
219
241
  watcher.on("error", () => {
242
+ if (deviceWatchers.get(dir)?.watcher !== watcher) return;
220
243
  watcher.close();
221
244
  deviceWatchers.delete(dir);
222
245
  });
223
- deviceWatchers.set(dir, watcher);
246
+ deviceWatchers.set(dir, {
247
+ watcher,
248
+ ino
249
+ });
224
250
  } catch {}
225
251
  };
226
252
  const watchDeviceSet = () => {
@@ -232,13 +258,18 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
232
258
  const wanted = /* @__PURE__ */ new Set();
233
259
  if (names) {
234
260
  wanted.add(deviceSet);
235
- for (const name of names) if (SIMULATOR_DIR.test(name)) wanted.add(join(deviceSet, name));
261
+ for (const name of names) {
262
+ if (!SIMULATOR_DIR.test(name)) continue;
263
+ const dir = join(deviceSet, name);
264
+ const plist = join(dir, "device.plist");
265
+ wanted.add(existsSync(plist) ? plist : dir);
266
+ }
236
267
  } else {
237
268
  let dir = dirname(deviceSet);
238
269
  while (dirname(dir) !== dir && !isDirectory(dir)) dir = dirname(dir);
239
270
  wanted.add(dir);
240
271
  }
241
- for (const [dir, watcher] of deviceWatchers) {
272
+ for (const [dir, { watcher }] of deviceWatchers) {
242
273
  if (wanted.has(dir)) continue;
243
274
  watcher.close();
244
275
  deviceWatchers.delete(dir);
@@ -247,6 +278,7 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
247
278
  watchDeviceSet();
248
279
  changed();
249
280
  });
281
+ else if (basename(dir) === "device.plist") watchDir(dir, changed);
250
282
  else if (dirname(dir) === deviceSet) watchDir(dir, (name) => {
251
283
  if (name === null || name === "device.plist") changed();
252
284
  });
@@ -317,7 +349,7 @@ function watchStatusSources({ home, deviceSet, onChange, platform = process.plat
317
349
  repositories.clear();
318
350
  clearInterval(processTimer);
319
351
  if (simTimer) clearInterval(simTimer);
320
- for (const watcher of deviceWatchers.values()) watcher.close();
352
+ for (const { watcher } of deviceWatchers.values()) watcher.close();
321
353
  deviceWatchers.clear();
322
354
  simctl?.kill("SIGKILL");
323
355
  adb.stop();
@@ -1,4 +1,4 @@
1
- import { n as runStatusWatch } from "./status-BL7jVyAB.mjs";
1
+ import { n as runStatusWatch } from "./status-WBDajew2.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  //#region src/status-worker.ts
4
4
  const STOP_EXIT_MS = 500;
@@ -1,5 +1,5 @@
1
- import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
- import { C as saveConfig, c as ensureConfig } from "./config-CYcBF478.mjs";
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
+ import { C as saveConfig, c as ensureConfig } from "./config-DlrsduwG.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { workspaceId } from "@stim-cli/core";
5
5
  import { readHomeIdentity, withConfigLockAsync } from "@stim-cli/core/state";
@@ -1,3 +1,3 @@
1
- import { m as resolveSupervisorTarget } from "./workspaces-BccMFmGQ.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-CPzlM1L-.mjs";
1
+ import { h as resolveSupervisorTarget } from "./workspaces-CpANmBlq.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-Mv6W9FAk.mjs";
3
3
  export { clearCollectorState, clearSupervisorState, stopCommand as default, readCollectorState, readSupervisorState, resolveCollectorTargets, resolveSupervisorTarget, runStop, stopWorkspaceNow };
@@ -1,10 +1,9 @@
1
- import { f as ownership_claim_exports, p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
1
+ import { g as process_identity_exports, i as withWorkspaceProcessLock, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
2
  import { d as workspaceDir } from "./paths-DQtTgsBf.mjs";
3
- import { d as writeWorkspaceState, l as withWorkspaceStateLockAsync } from "./workspace-state-Cjuigeeu.mjs";
4
- import { a as macosRuntimeClaim, o as requiredMacosRecord } from "./state-XMziexv2.mjs";
5
- import { S as runningBundleInstancesAsync } from "./workspaces-BccMFmGQ.mjs";
6
- import { t as withWorkspaceProcessLock } from "./workspace-process-lock-1_1OoVW5.mjs";
7
- import { n as stopHostedMacos } from "./hosted-macos-QI141yKk.mjs";
3
+ import { d as writeWorkspaceState, l as withWorkspaceStateLockAsync } from "./workspace-state-U08dEzhG.mjs";
4
+ import { a as macosRuntimeClaim, o as requiredMacosRecord } from "./state-08I3hw3_.mjs";
5
+ import { C as runningBundleInstancesAsync } from "./workspaces-CpANmBlq.mjs";
6
+ import { n as stopHostedMacos } from "./hosted-macos-_awYSpfv.mjs";
8
7
  import { readMacosRecord } from "@stim-cli/core/state";
9
8
  //#region src/macos/stop.ts
10
9
  const APP_EXIT_MS = 5e3;
@@ -16,57 +15,67 @@ function signal(pid, name) {
16
15
  if (error.code !== "ESRCH") throw error;
17
16
  }
18
17
  }
19
- async function stopProcesses(records, waitMs = APP_EXIT_MS) {
18
+ async function stopProcesses(records, waitMs = APP_EXIT_MS, operation) {
20
19
  let live = [...new Map(records.map((record) => [record.pid, record])).values()];
21
20
  for (const name of ["SIGTERM", "SIGKILL"]) {
21
+ operation?.signal.throwIfAborted();
22
22
  live = live.filter((record) => {
23
23
  const identity = (0, process_identity_exports.inspectProcessIdentity)(record);
24
24
  if (identity === "gone" || identity === "different") return false;
25
25
  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" });
26
26
  return true;
27
27
  });
28
- for (const record of live) signal(record.pid, name);
29
- const exited = await Promise.all(live.map((record) => (0, process_identity_exports.waitForProcessExit)(record, waitMs)));
28
+ for (const record of live) {
29
+ operation?.signal.throwIfAborted();
30
+ signal(record.pid, name);
31
+ }
32
+ const exited = await Promise.all(live.map((record) => (0, process_identity_exports.waitForProcessExit)(record, waitMs, operation?.signal)));
30
33
  live = live.filter((_, index) => !exited[index]);
31
34
  if (!live.length) return;
32
35
  }
33
36
  throw new Error(`Owned macOS process ${live.map((record) => record.pid).join(", ")} did not exit.`);
34
37
  }
35
38
  /** Stops every running copy of the workspace's owned app bundle, including copies LaunchServices started. */
36
- async function stopBundleInstances(root) {
37
- const instances = await runningBundleInstancesAsync(root);
38
- await stopProcesses(instances);
39
+ async function stopBundleInstances(root, operation) {
40
+ const instances = await runningBundleInstancesAsync(root, operation);
41
+ await stopProcesses(instances, void 0, operation);
39
42
  return instances.length > 0;
40
43
  }
41
- async function stopMacosAppHeld(root) {
44
+ async function stopMacosAppHeld(root, operation) {
45
+ operation?.signal.throwIfAborted();
42
46
  const record = requiredMacosRecord(root);
43
- if (record?.supervisor) await stopProcesses([record.supervisor], SUPERVISOR_EXIT_MS);
47
+ if (record?.supervisor) await stopProcesses([record.supervisor], SUPERVISOR_EXIT_MS, operation);
44
48
  const app = readMacosRecord(root)?.app ?? record?.app;
45
- if (app) await stopProcesses([app]);
46
- const instances = await runningBundleInstancesAsync(root);
47
- await stopProcesses(instances);
49
+ if (app) await stopProcesses([app], void 0, operation);
50
+ const instances = await runningBundleInstancesAsync(root, operation);
51
+ await stopProcesses(instances, void 0, operation);
52
+ operation?.signal.throwIfAborted();
48
53
  if (!record) return instances.length > 0;
49
54
  const claims = (0, ownership_claim_exports.readClaimSet)(macosRuntimeClaim(root));
50
55
  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" });
51
56
  return true;
52
57
  }
53
58
  /** Stops the workspace's app here, or its session on the hosting Mac, which must confirm the session stopped. */
54
- function stopMacosApp(root) {
59
+ function stopMacosApp(root, operation) {
55
60
  const stop = async () => {
61
+ operation?.signal.throwIfAborted();
56
62
  const record = requiredMacosRecord(root);
57
- if (!record?.host) return stopMacosAppHeld(root);
58
- await stopHostedMacos(root, record.host);
63
+ if (!record?.host) return stopMacosAppHeld(root, operation);
64
+ await stopHostedMacos(root, record.host, operation?.signal);
65
+ operation?.signal.throwIfAborted();
59
66
  const { host: _host, hostLaunched: _launched, ...stopped } = record;
60
67
  await withWorkspaceStateLockAsync(root, () => writeWorkspaceState(root, { macos: {
61
68
  ...stopped,
62
69
  supervisor: void 0
63
- } }));
70
+ } }), operation?.signal);
64
71
  return true;
65
72
  };
66
73
  return withWorkspaceProcessLock(workspaceDir(root), "macos-launch", stop, {
67
74
  external: true,
68
75
  waitMs: 0,
69
- ownerPurpose: "stop macOS app"
76
+ ownerPurpose: "stop macOS app",
77
+ signal: operation?.signal,
78
+ declareSpawnsFor: operation
70
79
  });
71
80
  }
72
81
  //#endregion
@@ -1,20 +1,19 @@
1
- import { _ as debugLog, f as ownership_claim_exports, p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
1
+ import { b as debugLog, g as process_identity_exports, i as withWorkspaceProcessLock, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
2
  import { d as workspaceDir } from "./paths-DQtTgsBf.mjs";
3
- import { E as upsertProject, G as parseDeviceSlotOption, J as validateDeviceSlot, K as projectDeviceSlots, O as withConfigLockAsync$1, U as deviceSlotPlatforms, W as parseDeviceSlotKey, o as clearSupervisor, p as getProject } from "./config-CYcBF478.mjs";
4
- import { f as refuseNoProject, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-B1UrjZHL.mjs";
5
- import { c as withWorkspaceStateLock, d as writeWorkspaceState, l as withWorkspaceStateLockAsync, n as clearWorkspaceStateKeys, r as readWorkspaceState$1, s as updateWorkspaceStateAsync } from "./workspace-state-Cjuigeeu.mjs";
6
- import { A as clearWorkspaceLaunches, M as readMetroTunnel, O as clearManagedMetroTunnel, P as readRemoteSession, T as MODE_COMMAND, j as clearWorkspaceSupervisor, k as clearRemoteSession, n as findCommandWorkspace } from "./project-BZNjmW_8.mjs";
7
- import { t as macosAppPresent } from "./state-XMziexv2.mjs";
8
- import { d as processCwds, f as resolveProjectMetro, g as isMetroRunning, i as killMetroTreeAsync, l as pidExists, m as signalProcessTreeAsync, o as listeningPidsAsync } from "./metro-DEXpIhHC.mjs";
9
- import { S as withdrawDevServerStopRequest, b as requestDevServerStop, qn as resolveEasCliBin, v as logVanishedSupervisor, zt as endRecordedSession } from "./budget-Bs6SxxzO.mjs";
10
- import { a as decideStopAction, c as nativeRunWaitNotice, i as clearNativeRunCancel, l as requestNativeRunCancel, n as NATIVE_RUN_WAIT_MS, o as describeNativeRunHolder, s as nativeRunHolder, t as NATIVE_RUN_LOCK } from "./native-run-DY_RLx3C.mjs";
11
- import { D as teardownOwnedBrowser, E as teardownOwnedAvd, O as teardownOwnedIosSim, g as stopTunnel, m as resolveSupervisorTarget } from "./workspaces-BccMFmGQ.mjs";
12
- import { O as releaseWorkspaceLeasesAsync, y as fileLeaseIo } from "./activity-BzVfHSrY.mjs";
13
- import { t as withWorkspaceProcessLock } from "./workspace-process-lock-1_1OoVW5.mjs";
14
- import { i as stopHostedAndroid } from "./hosted-android-Bw-honsd.mjs";
15
- import { r as stopHostedIos } from "./hosted-ios-CUvOf4Vr.mjs";
16
- import { n as stopMacosApp } from "./stop-D7h6jAXQ.mjs";
17
- import { n as verifyCollectorOwnership } from "./ownership-DEmM5vhh.mjs";
3
+ import { E as upsertProject, G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, U as parseDeviceSlotKey, W as parseDeviceSlotOption, o as clearSupervisor, p as getProject, q as validateDeviceSlot } from "./config-DlrsduwG.mjs";
4
+ import { f as refuseNoProject, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-gwpm28fu.mjs";
5
+ import { c as withWorkspaceStateLock, d as writeWorkspaceState, l as withWorkspaceStateLockAsync, n as clearWorkspaceStateKeys, r as readWorkspaceState$1, s as updateWorkspaceStateAsync } from "./workspace-state-U08dEzhG.mjs";
6
+ import { A as clearWorkspaceLaunches, M as readMetroTunnel, O as clearManagedMetroTunnel, P as readRemoteSession, T as MODE_COMMAND, j as clearWorkspaceSupervisor, k as clearRemoteSession, n as findCommandWorkspace } from "./project-wM_XFTvE.mjs";
7
+ import { t as macosAppPresent } from "./state-08I3hw3_.mjs";
8
+ import { a as listeningPidsAsync, c as pidExists, d as resolveProjectMetro, h as isMetroRunning, p as signalProcessTreeAsync, r as killMetroTreeAsync, u as processCwds } from "./metro-DiXtA3Ty.mjs";
9
+ import { S as withdrawDevServerStopRequest, b as requestDevServerStop, qn as resolveEasCliBin, v as logVanishedSupervisor, zt as endRecordedSession } from "./budget-Cvwn54qV.mjs";
10
+ import { a as decideStopAction, c as nativeRunWaitNotice, i as clearNativeRunCancel, l as requestNativeRunCancel, n as NATIVE_RUN_WAIT_MS, o as describeNativeRunHolder, s as nativeRunHolder, t as NATIVE_RUN_LOCK } from "./native-run-NwUuxbkg.mjs";
11
+ import { D as teardownOwnedAvd, O as teardownOwnedBrowser, _ as stopTunnel, h as resolveSupervisorTarget, k as teardownOwnedIosSim } from "./workspaces-CpANmBlq.mjs";
12
+ import { O as releaseWorkspaceLeasesAsync, y as fileLeaseIo } from "./activity-CMLmzp7o.mjs";
13
+ import { i as stopHostedAndroid } from "./hosted-android-B-9f-jkd.mjs";
14
+ import { r as stopHostedIos } from "./hosted-ios-CsCS21hn.mjs";
15
+ import { n as stopMacosApp } from "./stop-Dky10AEJ.mjs";
16
+ import { n as verifyCollectorOwnership } from "./ownership-C5fo5Edb.mjs";
18
17
  import { hostedAndroidDeviceName, hostedAndroidRecords, hostedIosRecords, hostedNativeRecords, isJsonObject, parseHostedNativePlacement } from "@stim-cli/core/state";
19
18
  import chalk from "chalk";
20
19
  //#region src/commands/stop.ts
@@ -1,6 +1,6 @@
1
- import { a as clearExpoMetroTunnel, c as writePidFile, n as MODE_BARE, o as clearWorkspaceSupervisor, r as MODE_EXPO, s as readPidFile, t as SettingsObject } from "./settings-DkdmlelE.mjs";
2
- import { n as NdjsonWriter } from "./exec-H20xSg2T.mjs";
3
- import { n as OwnedDeviceActivity } from "./idle-BVeRGroT.mjs";
1
+ import { c as readPidFile, i as MODE_EXPO, l as writePidFile, n as SettingsObject, o as clearExpoMetroTunnel, r as MODE_BARE, s as clearWorkspaceSupervisor } from "./ios-CDvlmUs7.mjs";
2
+ import { n as NdjsonWriter } from "./exec-DnYc4HGH.mjs";
3
+ import { n as OwnedDeviceActivity } from "./idle-C4cZ757K.mjs";
4
4
  import { DevServerStopRecord, DeviceIdleShutdownRecord } from "@stim-cli/core/state";
5
5
  //#region src/watchman.d.ts
6
6
  type WatchmanCommand = (args: string[], timeoutMs: number) => Promise<unknown>;