stim 1.24.0 → 1.26.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 (162) hide show
  1. package/README.md +1 -1
  2. package/dist/{acquire-artifact-CEs02U2o.mjs → acquire-artifact-DVsvSwf7.mjs} +1 -1
  3. package/dist/{act-Cyvm8xYc.mjs → act-C-BqJEpu.mjs} +158 -36
  4. package/dist/{activity-Dq3ZcdD8.mjs → activity-Lnb_EoRY.mjs} +4 -5
  5. package/dist/{agent-device-usage-output-CccomeE0.mjs → agent-device-usage-output-DbXy5tg8.mjs} +4 -4
  6. package/dist/{android-CX5IcRuf.mjs → android-B5P81yI-.mjs} +1 -1
  7. package/dist/{android-DcztblCT.mjs → android-CSbLRD53.mjs} +5 -5
  8. package/dist/{android-BZppyPe_.mjs → android-CiNQw3kq.mjs} +81 -52
  9. package/dist/{android-882m4hxX.mjs → android-DTAcRwBC.mjs} +81 -34
  10. package/dist/{android-cas-BtCOrNqb.mjs → android-cas-BTVhZ0Qs.mjs} +4 -4
  11. package/dist/{android-project-DVWyCbWU.d.mts → android-project-DUGMbq28.d.mts} +61 -3
  12. package/dist/api.d.mts +8 -5
  13. package/dist/api.mjs +27 -27
  14. package/dist/apk-signed-tail-B46U9hXc.mjs +142 -0
  15. package/dist/{artifact-BR5VNArK.mjs → artifact-BxREhAaV.mjs} +25 -19
  16. package/dist/{artifact-Bdt_n9Jc.mjs → artifact-CsAP6AGK.mjs} +36 -21
  17. package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
  18. package/dist/{browser-web-ycg9qWB8.mjs → browser-web-rYPyqhTf.mjs} +11 -12
  19. package/dist/{budget-dPGuhNai.mjs → budget-k2mZGvvk.mjs} +242 -38
  20. package/dist/{build-CaF574eS.mjs → build-DPhApsjV.mjs} +28 -24
  21. package/dist/{build-cache-HFUQ9eLz.mjs → build-cache-DrXNCy3T.mjs} +123 -23
  22. package/dist/{build-plan-JsDUq4w1.mjs → build-plan-DrMMdayj.mjs} +5 -5
  23. package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-BEZ9Bpl1.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-CCn1S6qG.mjs → ccache-Bx5TbxwG.mjs} +6 -6
  26. package/dist/{cli-xqAidP7O.mjs → cli-BBKFGOFl.mjs} +19 -19
  27. package/dist/cli.mjs +1 -1
  28. package/dist/{client-18-ZowoT.mjs → client-D9CaRks-.mjs} +55 -71
  29. package/dist/collector-run.mjs +4 -4
  30. package/dist/{command-output-DxC0k2rk.mjs → command-output-BF5AR2dL.mjs} +1 -1
  31. package/dist/{config-BZhXY15H.mjs → config-BktkY_zC.mjs} +321 -15
  32. package/dist/{launch-BVlyQw3T.mjs → dependencies-Dw6wfQdv.mjs} +259 -256
  33. package/dist/{dependency-state-C56ll9hY.mjs → dependency-state-DFB41vfr.mjs} +1 -1
  34. package/dist/{dev-client-w_fok0Ek.mjs → dev-client-DXR_tPVY.mjs} +2 -2
  35. package/dist/{device-BktRGdjS.mjs → device-BK-zwyd_.mjs} +64 -33
  36. package/dist/{device-4RUugw5X.mjs → device-BcYeHSFu.mjs} +14 -14
  37. package/dist/{device-capacity-Ic-kdmEV.mjs → device-capacity-DCSvUF0l.mjs} +10 -17
  38. package/dist/device-host-worker.mjs +11 -13
  39. package/dist/{device-ios-DzpSlZyd.mjs → device-ios-BLGfXQeK.mjs} +68 -25
  40. package/dist/{device-lease-run-DUtkbqBQ.mjs → device-lease-run-BmvIl7bI.mjs} +5 -5
  41. package/dist/{device-pool-CgBHk401.mjs → device-pool-Dluix4H3.mjs} +3 -3
  42. package/dist/{doctor-DZgpqR6J.mjs → doctor-Bhg1ii70.mjs} +14 -14
  43. package/dist/{doctor-BZ6oxNum.mjs → doctor-Cp-BhzTS.mjs} +1 -1
  44. package/dist/{doctor-C33AzVfR.mjs → doctor-OnwP94ne.mjs} +81 -26
  45. package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-D3a04Mhu.mjs} +8 -2
  46. package/dist/doctor-fingerprint.mjs +1 -1
  47. package/dist/{doctor-watchman-B453A231.mjs → doctor-watchman-BStK05nt.mjs} +4 -4
  48. package/dist/{eas-build-CxKUNHsb.mjs → eas-build-Dsj93iM9.mjs} +2 -2
  49. package/dist/{eas-fallback-LMxk9Kw0.mjs → eas-fallback-FwkeqqGi.mjs} +13 -12
  50. package/dist/{eas-session-ledger-Ck6YXPAO.mjs → eas-session-ledger-B5vygTiD.mjs} +5 -5
  51. package/dist/{error-diagnostics-BkKCZq4P.mjs → error-diagnostics-BOOm9Db7.mjs} +8 -8
  52. package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
  53. package/dist/{gc-DDWEAj0w.mjs → gc-C_79zvz4.mjs} +2 -2
  54. package/dist/{gc-yVKpAOKM.mjs → gc-ldgr-hXU.mjs} +74 -43
  55. package/dist/{guide-Bggftwc5.mjs → guide-D7K0X6KG.mjs} +374 -78
  56. package/dist/{hosted-android-D4dweBof.mjs → hosted-android-Bk54ej6n.mjs} +3 -3
  57. package/dist/{hosted-client-BBTVe3X6.mjs → hosted-client-fHO8yqzc.mjs} +5 -5
  58. package/dist/{hosted-ios-Sn0djzg8.mjs → hosted-ios-D55QhYaD.mjs} +1 -1
  59. package/dist/{hosted-logs-CYIZ5ubJ.mjs → hosted-logs-BfbmDM4M.mjs} +17 -11
  60. package/dist/hosted-logs-sync-B0pvmOk-.mjs +195 -0
  61. package/dist/{hosted-macos-CXjsUNBR.mjs → hosted-macos-CPl0OZ9h.mjs} +5 -5
  62. package/dist/{hosted-native-Doxbfzem.mjs → hosted-native-CpDB3-PO.mjs} +6 -7
  63. package/dist/{idle-shutdown-BInjLKqm.mjs → idle-shutdown-FfxL1KdG.mjs} +22 -9
  64. package/dist/{ios-BItP6lkn.mjs → ios-B7-lToDu.mjs} +8 -8
  65. package/dist/{ios-CVUFFZ6C.mjs → ios-WxpDJ5T1.mjs} +129 -14
  66. package/dist/{ios-device-BI38NFFH.mjs → ios-device-CsyryvpT.mjs} +1 -1
  67. package/dist/{ios-B1FXRCMX.mjs → ios-ftxdQbJS.mjs} +84 -51
  68. package/dist/{ios-project-KYqeJURj.mjs → ios-project-Ty5pHl9O.mjs} +6 -6
  69. package/dist/{ios-state-DlElquYD.mjs → ios-state-Cw7-WQf2.mjs} +1 -1
  70. package/dist/{js-swap-BvrQvXHY.mjs → js-swap-BMhXYVDS.mjs} +4 -4
  71. package/dist/{launch-SfzGH_s9.mjs → launch-DOp8RjDz.mjs} +32 -27
  72. package/dist/{logs-DXE32kyb.mjs → logs-dQDki6Tt.mjs} +9 -173
  73. package/dist/{logs-ovlU7m7N.mjs → logs-s1dRIG1E.mjs} +85 -36
  74. package/dist/{macos-B3BveDrU.mjs → macos-B0VEV3Gf.mjs} +1 -1
  75. package/dist/{macos-CCfhb-jT.mjs → macos-DBBPNnIA.mjs} +18 -19
  76. package/dist/macos-run.mjs +1 -1
  77. package/dist/maintenance-run.mjs +28 -11
  78. package/dist/{metro-Bu8LBfzS.mjs → metro-CjC10t6E.mjs} +2 -2
  79. package/dist/{metro-gateway-DtsOy-0P.mjs → metro-gateway-B6_PgD0L.mjs} +2 -3
  80. package/dist/{named-ports-BWDuU5oQ.mjs → named-ports-BG0j1X4g.mjs} +2 -2
  81. package/dist/{native-android-96BBizbq.mjs → native-android-CL2NGiik.mjs} +17 -17
  82. package/dist/{native-gradle-artifact-inputs-BcLYBZil.mjs → native-gradle-artifact-inputs-btSUulme.mjs} +3 -3
  83. package/dist/{native-run-BmH7U8pr.mjs → native-run-BfIDFKLH.mjs} +2 -3
  84. package/dist/{native-runtime-DgtJkzIa.mjs → native-runtime-Dq3RBcON.mjs} +6 -7
  85. package/dist/{native-xcode-inputs-irplbQb0.mjs → native-xcode-inputs-BW7H8JGu.mjs} +2 -2
  86. package/dist/{native-xcode-ios-BY-6hh6M.mjs → native-xcode-ios-CBXJAxfC.mjs} +18 -18
  87. package/dist/offload-worker.d.mts +7 -2
  88. package/dist/offload-worker.mjs +34 -23
  89. package/dist/{ownership-DxlZGDcV.mjs → ownership-BjYvMNX_.mjs} +2 -2
  90. package/dist/{phone-reverses-BdsdesVF.mjs → phone-reverses-lmj6kcPm.mjs} +3 -3
  91. package/dist/{placement-log-DUvqqsB-.mjs → placement-log-DIFPQAXp.mjs} +1 -1
  92. package/dist/{plan-placement-4axc0Hs7.mjs → plan-placement-IiiSQhtz.mjs} +3 -3
  93. package/dist/{ports-D-E_OiAO.mjs → ports-C2_w1Z0Z.mjs} +3 -3
  94. package/dist/prebuild-gmouvmJZ.mjs +1247 -0
  95. package/dist/{project-Dz-hWkb-.mjs → project-BUu6Is4k.mjs} +15 -16
  96. package/dist/{react-native-android-DOinxgwB.mjs → react-native-android-Cgg99REN.mjs} +48 -33
  97. package/dist/{react-native-build-AuCu-aAP.mjs → react-native-build-oNwqF5Wb.mjs} +8 -8
  98. package/dist/{react-native-doctor-2ivJUmwZ.mjs → react-native-doctor-BhA3KUte.mjs} +49 -8
  99. package/dist/{react-native-ios-D5zTIuH8.mjs → react-native-ios-B-nf4rjN.mjs} +40 -25
  100. package/dist/{recordings-CdPwYwvs.mjs → recordings-BldzVKq0.mjs} +1 -1
  101. package/dist/{reload-Ck9RJeSq.mjs → reload-C9OduiNc.mjs} +1 -1
  102. package/dist/{reload-C1TTVesC.mjs → reload-CCR7KC_l.mjs} +14 -14
  103. package/dist/{remote-DEZ7AOVq.mjs → remote-C8S7FlPF.mjs} +16 -7
  104. package/dist/{result-DqBrb12U.mjs → result-7F5hEwQJ.mjs} +17 -17
  105. package/dist/{run-BIwoU44q.mjs → run-BqB0v3pt.mjs} +1 -1
  106. package/dist/{selection-BLtvaqxc.mjs → selection-BNPBZ6T5.mjs} +157 -44
  107. package/dist/{server-bare-Z1ToVLPn.mjs → server-bare-A75rDIdD.mjs} +55 -3
  108. package/dist/{server-command-C0pmjNdG.mjs → server-command-CssKFOD7.mjs} +4 -4
  109. package/dist/{server-expo-Tt_hLRpy.mjs → server-expo-eQfOdydb.mjs} +8 -6
  110. package/dist/server-expo-wvcj5tiZ.mjs +2 -0
  111. package/dist/{settings-RKwY33wv.mjs → settings-CosW5X-S.mjs} +59 -61
  112. package/dist/{settings-kkt0vP4w.mjs → settings-OaGQF-ri.mjs} +1 -1
  113. package/dist/{settings-write--gj6MACV.mjs → settings-write-QjYfSrjF.mjs} +5 -5
  114. package/dist/settings.schema.json +71 -6
  115. package/dist/{simslim-CdWKT3vA.mjs → simslim-Bax1qcxu.mjs} +22 -6
  116. package/dist/{slot-launch-A1BgotaM.mjs → slot-launch-CYCEhfBY.mjs} +6 -6
  117. package/dist/{stage-ERTMh88n.mjs → stage-jKQ7CP_B.mjs} +1 -1
  118. package/dist/{start-Bmg_qmHi.mjs → start-C_wefNKB.mjs} +1 -1
  119. package/dist/{start-BKGrEhzG.mjs → start-_BdJ32cZ.mjs} +9 -10
  120. package/dist/{state-B1ig0Kqy.mjs → state-C1i2nMOP.mjs} +2 -3
  121. package/dist/{state-BfAltYJP.mjs → state-C4OdpOTF.mjs} +1 -2
  122. package/dist/{stats-B-ckuiUg.mjs → stats-tEpEEH-u.mjs} +4 -4
  123. package/dist/{status-Pw-807f0.mjs → status-B9M7x4CZ.mjs} +1 -1
  124. package/dist/{status-Fect2w9R.mjs → status-CRXz-Gtj.mjs} +1 -1
  125. package/dist/{status-DfFp6a76.mjs → status-DQrqodLj.mjs} +22 -23
  126. package/dist/{status-watch-XC7F-AMf.mjs → status-watch-B5wDIH_o.mjs} +4 -4
  127. package/dist/status-worker.mjs +1 -1
  128. package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-6Dqp-gjX.mjs} +1 -1
  129. package/dist/{stop-BFu7X_Do.mjs → stop-CmdNhGlC.mjs} +2 -2
  130. package/dist/{stop-CL1kDHds.mjs → stop-DRqQVqDJ.mjs} +74 -53
  131. package/dist/{stop-DhclRwOO.mjs → stop-ySNQHXMG.mjs} +4 -5
  132. package/dist/supervisor-run.d.mts +1 -0
  133. package/dist/supervisor-run.mjs +15 -16
  134. package/dist/{support-B3tzVhKn.mjs → support-BGSCBoib.mjs} +4 -4
  135. package/dist/{support-B1W-hmC2.mjs → support-CVOCp0Ft.mjs} +15 -12
  136. package/dist/{swiftpm-artifact-inputs-BWYPj9Sn.mjs → swiftpm-artifact-inputs-CfUzt_0Z.mjs} +1 -1
  137. package/dist/{swiftpm-macos-BVCP5mO4.mjs → swiftpm-macos-x6HPpl_2.mjs} +10 -10
  138. package/dist/toolchain-DoavrvIA.mjs +2 -0
  139. package/dist/toolchain-J4J8MrAr.mjs +2107 -0
  140. package/dist/trigger-DzJu208Q.mjs +2 -0
  141. package/dist/{trigger-CBMe2YLH.mjs → trigger-KVaWWNyn.mjs} +1 -1
  142. package/dist/{warm-progress-ol0ZypEu.mjs → warm-progress-DvhTX_eu.mjs} +3 -4
  143. package/dist/web-BFLueSh-.mjs +2 -0
  144. package/dist/{web-BH7peScT.mjs → web-Bihbf7-u.mjs} +8 -9
  145. package/dist/web-run.mjs +4 -4
  146. package/dist/{workspace-state-CeBpIZgr.mjs → workspace-state-pUg3_RRA.mjs} +45 -7
  147. package/dist/{workspaces-CSV2Orf4.mjs → workspaces-g2lhdBXF.mjs} +17 -17
  148. package/dist/{worktree-Dw8kfacb.mjs → worktree-BKuklFh_.mjs} +34 -31
  149. package/dist/{worktree-DEDUzO_L.mjs → worktree-Bm4cb-nU.mjs} +1 -1
  150. package/package.json +8 -8
  151. package/shim/bundle-response.cjs +53 -1
  152. package/shim/bundle-response.d.cts +1 -1
  153. package/shim/expo-metro-config.cjs +23 -1
  154. package/dist/created-devices-D2Aca-xu.mjs +0 -52
  155. package/dist/paths-DQtTgsBf.mjs +0 -42
  156. package/dist/prebuild-DmVCf5xb.mjs +0 -501
  157. package/dist/server-expo-CEntXzRw.mjs +0 -2
  158. package/dist/toolchain-BjgKdoEf.mjs +0 -2
  159. package/dist/toolchain-D3bmRMia.mjs +0 -897
  160. package/dist/trigger-BLsHgAGR.mjs +0 -2
  161. package/dist/web-BdOFlTJr.mjs +0 -2
  162. package/dist/xcode-DHu41qQ4.mjs +0 -910
@@ -1,22 +1,23 @@
1
- import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
2
- import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } from "./config-BZhXY15H.mjs";
3
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-DxC0k2rk.mjs";
4
- import { L as workspaceDevServerMode } from "./project-Dz-hWkb-.mjs";
5
- import { o as workspaceLinks } from "./stim-desktop-DS0mzR8U.mjs";
6
- import { i as androidDataFreeBytes, ot as trimAndroidCaches, tt as resetAdoptedAvd, u as androidToolCwd } from "./android-882m4hxX.mjs";
7
- import { c as pidExists, f as signalProcessTree } from "./metro-Bu8LBfzS.mjs";
8
- import { $t as VERIFY_TIMEOUT_MS, On as restartedAppNote, Qt as RELEASE_VERIFY_WAIT_MS, Sn as installConflictKind, Xt as LAUNCH_FATAL, Yt as LAUNCH_BUNDLING, Zt as LAUNCH_UNVERIFIED, in as unverifiedLaunchLines, ln as ADB_INSTALL_TIMEOUT_MS, mn as androidDevClientUrl, pn as androidAppProcess, rn as unattributedLaunchLines } from "./budget-dPGuhNai.mjs";
9
- import { O as teardownOwnedAvd } from "./workspaces-CSV2Orf4.mjs";
10
- import { _ as providerUploadOutcome } from "./build-cache-HFUQ9eLz.mjs";
11
- import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-DxlZGDcV.mjs";
12
- import { t as recordPhoneReverse } from "./phone-reverses-BdsdesVF.mjs";
13
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-A1BgotaM.mjs";
1
+ import { k as workspaceLogsDir } from "./workspace-state-pUg3_RRA.mjs";
2
+ import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } from "./config-BktkY_zC.mjs";
3
+ import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-BF5AR2dL.mjs";
4
+ import { L as workspaceDevServerMode } from "./project-BUu6Is4k.mjs";
5
+ import { o as workspaceLinks } from "./stim-desktop-6Dqp-gjX.mjs";
6
+ import { i as androidDataFreeBytes, ot as trimAndroidCaches, tt as resetAdoptedAvd, u as androidToolCwd } from "./android-DTAcRwBC.mjs";
7
+ import { c as pidExists, f as signalProcessTree } from "./metro-CjC10t6E.mjs";
8
+ import { $t as LAUNCH_BUNDLING, Dn as installConflictKind, Nn as restartedAppNote, cn as unattributedLaunchLines, en as LAUNCH_FATAL, in as VERIFY_TIMEOUT_MS, ln as unverifiedLaunchLines, mn as ADB_INSTALL_TIMEOUT_MS, rn as RELEASE_VERIFY_WAIT_MS, tn as LAUNCH_UNVERIFIED, vn as androidAppProcess, yn as androidDevClientUrl } from "./budget-k2mZGvvk.mjs";
9
+ import { O as teardownOwnedAvd } from "./workspaces-g2lhdBXF.mjs";
10
+ import { b as providerUploadOutcome } from "./build-cache-DrXNCy3T.mjs";
11
+ import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-BjYvMNX_.mjs";
12
+ import { t as recordPhoneReverse } from "./phone-reverses-lmj6kcPm.mjs";
13
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CYCEhfBY.mjs";
14
14
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
15
- import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-DUtkbqBQ.mjs";
16
- import { a as printNativeCrashReport, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BkKCZq4P.mjs";
17
- import { i as launchOutcomeRecord } from "./native-runtime-DgtJkzIa.mjs";
18
- import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-B3tzVhKn.mjs";
19
- import { a as persistLastBuild, n as finishAndroidUpload, s as reportAndroidResult } from "./result-DqBrb12U.mjs";
15
+ import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-BmvIl7bI.mjs";
16
+ import { a as printNativeCrashReport, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BOOm9Db7.mjs";
17
+ import { f as settleFingerprintCheck } from "./prebuild-gmouvmJZ.mjs";
18
+ import { i as launchOutcomeRecord } from "./native-runtime-Dq3RBcON.mjs";
19
+ import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-BGSCBoib.mjs";
20
+ import { a as persistLastBuild, n as finishAndroidUpload, s as reportAndroidResult } from "./result-7F5hEwQJ.mjs";
20
21
  import { mkdirSync, openSync, statSync } from "node:fs";
21
22
  import { basename, join } from "node:path";
22
23
  import { ambientEnv } from "@stim-cli/core";
@@ -186,12 +187,12 @@ async function verifyAndroidProcessRun({ operation, root, slot, remoteDevice, ve
186
187
  phase("", chalk.yellow(`${embeddedJavaScript ? "A release process" : "The app process"} exited before readiness. Run \`stim logs --errors\` for captured crash reports, or \`stim logs --source device\` for the full device output.`));
187
188
  return { state: LAUNCH_FATAL };
188
189
  }
189
- async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, verifyLaunched, serial, androidPackage, metroCheck, logsDir, launchedAt, metroPort, isExpo, physical, device, scheme, component = null, phase, enterActivity }) {
190
- const runCommand = nativeRunCommand("android", slot, {
190
+ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, verifyLaunched, serial, androidPackage, metroCheck, logsDir, launchedAt, metroPort, isExpo, physical, device, scheme, component = null, phase, enterActivity, hostedLogs, hostedRunCommand }) {
191
+ const runCommand = hostedRunCommand ?? nativeRunCommand("android", slot, {
191
192
  physical,
192
193
  deviceId: serial
193
194
  });
194
- const readNativeCrashes = () => remoteDevice ? [] : captureNativeCrashes({
195
+ const readNativeCrashes = () => hostedLogs ? hostedLogs.readNativeCrashes() : remoteDevice ? [] : captureNativeCrashes({
195
196
  root,
196
197
  slot,
197
198
  platform: "android",
@@ -216,7 +217,9 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
216
217
  platform: "android",
217
218
  mode: workspaceDevServerMode(root, isExpo),
218
219
  readNativeCrashes,
219
- processAlive: async () => {
220
+ readDeviceRecords: hostedLogs?.readDeviceRecords,
221
+ deviceLogsThrough: hostedLogs?.deviceLogsThrough,
222
+ processAlive: hostedLogs ? null : async () => {
220
223
  const running = await androidAppProcess(serial, androidPackage);
221
224
  return running.state === "unknown" ? null : running.state === "running";
222
225
  }
@@ -240,12 +243,12 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
240
243
  phase("verify", chalk.red(`FATAL after ${formatDuration(verification.waitedMs ?? 0)}: ${reason}`));
241
244
  for (const line of launchErrorPreview(verification.errors ?? [], root)) phase("", chalk.red(line));
242
245
  if (verification.processAlive === false && !verification.errors?.some((record) => record.event === "native_crash")) phase("logs", "No attributable native crash report captured yet. Run `stim logs --errors` again for delayed reports, or `stim logs --source device` for available output.");
243
- if (nativeFatal || verification.processAlive === false) phase("remedy", chalk.yellow(`Fix the crash, then run \`${runCommand}\` again; it force-stops a crashed process that remains alive behind the system crash dialog. Metro reload cannot recover it.`));
246
+ if (nativeFatal || verification.processAlive === false) phase("remedy", chalk.yellow(hostedRunCommand ? `Fix the crash, then run \`${runCommand}\` again. Metro reload cannot recover it.` : `Fix the crash, then run \`${runCommand}\` again; it force-stops a crashed process that remains alive behind the system crash dialog. Metro reload cannot recover it.`));
244
247
  else if (verification.processAlive === true && metroPort !== null) phase("remedy", chalk.yellow(`The native app is still running. ${deliveryFailed ? "Check the Metro logs and device connection, then" : "Fix the JavaScript or TypeScript error, then"} run \`stim reload android\`. Do not run \`${runCommand}\` unless native inputs changed or the app process exits.`));
245
248
  return { state: LAUNCH_FATAL };
246
249
  }
247
250
  if (verification?.verified) {
248
- phase("verify", `bundle loaded` + (verification.processAlive === true ? ", process alive" : "") + (verification.readiness ? "" : ", stable for 3s -- the first screen may still be rendering") + ` (${formatDuration(verification.waitedMs ?? 0)} total)`);
251
+ phase("verify", `bundle loaded` + (verification.processAlive === true ? ", process alive" : "") + (verification.readiness ? "" : verification.jsRunning ? ", app JavaScript running -- the first screen may still be rendering" : ", stable for 3s -- the first screen may still be rendering") + ` (${formatDuration(verification.waitedMs ?? 0)} total)`);
249
252
  const report = launchErrorReport(verification.errors ?? [], root);
250
253
  if (report.summary) phase("launch", chalk.dim(report.summary));
251
254
  for (const line of report.lines) phase("launch", chalk.yellow(line));
@@ -288,7 +291,8 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
288
291
  component,
289
292
  devClientUrl: scheme ? androidDevClientUrl(scheme, metroPort ?? 8081, physical) : null,
290
293
  devClient: Boolean(scheme),
291
- mode: workspaceDevServerMode(root, isExpo)
294
+ mode: workspaceDevServerMode(root, isExpo),
295
+ remote: Boolean(hostedLogs)
292
296
  })) phase("", chalk.yellow(line));
293
297
  return { state: LAUNCH_UNVERIFIED };
294
298
  }
@@ -374,7 +378,7 @@ async function resolveInstallSerial({ root, slot, device, physical, remoteDevice
374
378
  });
375
379
  return resolved.serial;
376
380
  }
377
- async function finishAndroidRun({ operation, runtime, runtimePreparation, lease, releaseLease, root, slot, json, metroCheck, useBuildCache, variant, release, isExpo, metroPort, logsDir, emuLog, device, physical, remoteDevice, bootPromise, resolveAvdSerial, waitForDeviceBoot, bootDuration, bootPending, apkPath, androidPackage: initialPackage, androidPackageProblem, record, waitedForBuild, ccache, uploadPending, providerUpload, providerName, remote, abandonedRemote: remoteWasAbandoned, started, startedAt, writer, phase, fail, readApkPackage, readProjectPackage, packageRemedy, install, launch, launchRelease, resolveDevClientScheme, verifyLaunched, verifyReleaseLaunched, spawn, kill, pidAlive, verifyCollector, writeLaunch, recordBuild, now, out, emit, recordRun, reclaimed, devServer, enterPhase, enterActivity, rebootDevice, dataFreeBytes = androidDataFreeBytes, trimCaches = trimAndroidCaches, wipeDevice = teardownOwnedAvd }) {
381
+ async function finishAndroidRun({ operation, runtime, runtimePreparation, lease, releaseLease, root, slot, json, metroCheck, useBuildCache, variant, release, isExpo, metroPort, logsDir, emuLog, device, physical, remoteDevice, bootPromise, resolveAvdSerial, waitForDeviceBoot, bootDuration, bootPending, apkPath, androidPackage: initialPackage, androidPackageProblem, record, waitedForBuild, ccache, uploadPending, fingerprintCheck, providerUpload, providerName, remote, abandonedRemote: remoteWasAbandoned, started, startedAt, writer, phase, fail, readApkPackage, readProjectPackage, packageRemedy, install, launch, launchRelease, resolveDevClientScheme, verifyLaunched, verifyReleaseLaunched, spawn, kill, pidAlive, verifyCollector, writeLaunch, recordBuild, now, out, emit, recordRun, reclaimed, devServer, enterPhase, enterActivity, rebootDevice, dataFreeBytes = androidDataFreeBytes, trimCaches = trimAndroidCaches, wipeDevice = teardownOwnedAvd }) {
378
382
  const { env, signal } = operation ?? {};
379
383
  let androidPackage = initialPackage;
380
384
  let leaseWarned = false;
@@ -590,6 +594,7 @@ async function finishAndroidRun({ operation, runtime, runtimePreparation, lease,
590
594
  const uploadWasAbandoned = await finishAndroidUpload(uploadPending, remote, phase);
591
595
  const providerOutcome = providerUploadOutcome(providerUpload ? await providerUpload : null, providerName, env);
592
596
  if (providerOutcome) phase("cache", providerOutcome.warn ? chalk.yellow(providerOutcome.line) : providerOutcome.line);
597
+ await settleFingerprintCheck(fingerprintCheck, "android", (line) => phase("fingerprint", chalk.yellow(line)), (entry) => writer.write(entry));
593
598
  persistLastBuild({
594
599
  recordBuild,
595
600
  root,
@@ -762,4 +767,4 @@ function diagnoseBootFailure(booted, logFile, runCommand, physical) {
762
767
  };
763
768
  }
764
769
  //#endregion
765
- export { killPreviousCollector as a, collectorLogFile as i, androidProcessRuntime as n, startCollector as o, finishAndroidRun as r, androidMetroRuntime as t };
770
+ export { collectorLogFile as a, verifyAndroidMetroRun as i, androidProcessRuntime as n, killPreviousCollector as o, finishAndroidRun as r, startCollector as s, androidMetroRuntime as t };
@@ -1,18 +1,13 @@
1
1
  import { S as process_identity_exports } from "./exec-VFRpu1iA.mjs";
2
- import { m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
- import { G as projectDeviceSlots, _ as loadConfig$1 } from "./config-BZhXY15H.mjs";
4
- import { n as pullHostedNativeLogs, t as pullHostedMacosLogs } from "./hosted-logs-CYIZ5ubJ.mjs";
5
- import { l as phaseLine } from "./command-output-DxC0k2rk.mjs";
6
- import { f as readAgentDeviceRecordsAsync, n as agentDeviceLiveness, o as envDir } from "./activity-Dq3ZcdD8.mjs";
7
- import { l as connectHost } from "./hosted-client-BBTVe3X6.mjs";
8
- import { n as readHostedIos, t as readHostedAndroid } from "./ios-state-DlElquYD.mjs";
9
- import "./hosted-macos-CXjsUNBR.mjs";
10
- import { i as captureWorkspaceCrashes } from "./error-diagnostics-BkKCZq4P.mjs";
2
+ import { k as workspaceLogsDir$1 } from "./workspace-state-pUg3_RRA.mjs";
3
+ import { G as projectDeviceSlots, _ as loadConfig$1 } from "./config-BktkY_zC.mjs";
4
+ import { f as readAgentDeviceRecordsAsync, n as agentDeviceLiveness, o as envDir } from "./activity-Lnb_EoRY.mjs";
5
+ import { i as captureWorkspaceCrashes } from "./error-diagnostics-BOOm9Db7.mjs";
6
+ import { n as followHostedLogs, r as syncHostedLogs } from "./hosted-logs-sync-B0pvmOk-.mjs";
11
7
  import { readdirSync, statSync, watch } from "node:fs";
12
8
  import { homedir } from "node:os";
13
9
  import { dirname, join, relative, resolve, sep } from "node:path";
14
- import { ambientWrite, configDir } from "@stim-cli/core";
15
- import { LEVELS, SOURCES, agentDeviceStateDirsAsync, buildCriteria, compileGrep, createAsyncAgentActionReader, followLogs, logFiles, openLogDir, parseSince, readMacosRecord, recordMatches, workspaceStateFile } from "@stim-cli/core/state";
10
+ import { LEVELS, SOURCES, agentDeviceStateDirsAsync, buildCriteria, compileGrep, createAsyncAgentActionReader, followLogs, logFiles, openLogDir, parseSince, readMacosRecord, recordMatches } from "@stim-cli/core/state";
16
11
  import { setImmediate } from "node:timers/promises";
17
12
  import { realpath } from "node:fs/promises";
18
13
  //#region src/devices/agent-actions.ts
@@ -221,166 +216,6 @@ function followAgentActions(context, read, onRecord) {
221
216
  return stop;
222
217
  }
223
218
  //#endregion
224
- //#region src/device-host/hosted-logs-sync.ts
225
- const WATCH_RECHECK_MS = 100;
226
- function warn(context, machine, error) {
227
- const text = `${warning(machine, error)}\n`;
228
- if (context) context.output("stderr", text);
229
- else ambientWrite("stderr", text);
230
- }
231
- function warning(machine, error) {
232
- const message = error.message.replace(/\.$/, "");
233
- const hint = message.includes("refused device-host.logs.query") ? ` If ${machine} runs an older stim-server, update it.` : "";
234
- return phaseLine("device", `Could not read the app's logs from ${machine}: ${message}. Showing the logs already copied here.${hint}`);
235
- }
236
- async function syncHostedMacosLogs(root, placement, slot, warnings, platform = "ios", context) {
237
- let host;
238
- const cancel = () => host?.connection.close();
239
- context?.signal.addEventListener("abort", cancel, { once: true });
240
- try {
241
- host = await connectHost(placement.machine, void 0, false, context?.signal);
242
- if (slot !== void 0) await pullHostedNativeLogs(root, slot, placement, host, false, platform, context?.signal);
243
- else await pullHostedMacosLogs(root, placement, host, void 0, void 0, false, context?.signal);
244
- return true;
245
- } catch (error) {
246
- context?.signal.throwIfAborted();
247
- if (!warnings?.has(placement.machine)) {
248
- warn(context, placement.machine, error);
249
- warnings?.add(placement.machine);
250
- }
251
- return false;
252
- } finally {
253
- context?.signal.removeEventListener("abort", cancel);
254
- host?.connection.close();
255
- }
256
- }
257
- function followHostedMacosLogs(root, { failing = false, intervalMs = 500, retryMs = 5e3, slot, platform = "ios", context } = {}) {
258
- let host;
259
- const controller = new AbortController();
260
- const signal = context ? AbortSignal.any([context.signal, controller.signal]) : controller.signal;
261
- const cancel = () => host?.connection.close();
262
- signal.addEventListener("abort", cancel, { once: true });
263
- let retryAt = 0;
264
- let stopped = false;
265
- let running = false;
266
- const tick = async () => {
267
- if (running || stopped || signal.aborted || Date.now() < retryAt) return;
268
- running = true;
269
- try {
270
- const placement = slot !== void 0 ? (platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))[slot] : readMacosRecord(root)?.host;
271
- if (!placement) {
272
- host?.connection.close();
273
- host = void 0;
274
- return;
275
- }
276
- host ??= await connectHost(placement.machine, void 0, false, signal);
277
- if (slot !== void 0) await pullHostedNativeLogs(root, slot, placement, host, false, platform, signal);
278
- else await pullHostedMacosLogs(root, placement, host, void 0, void 0, false, signal);
279
- failing = false;
280
- } catch (error) {
281
- host?.connection.close();
282
- host = void 0;
283
- if (signal.aborted) return;
284
- if (!failing) warn(context, (slot !== void 0 ? (platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))[slot] : readMacosRecord(root)?.host)?.machine ?? "the host", error);
285
- failing = true;
286
- retryAt = Date.now() + retryMs;
287
- } finally {
288
- running = false;
289
- }
290
- };
291
- const timer = setInterval(() => void tick(), intervalMs);
292
- return () => {
293
- stopped = true;
294
- controller.abort();
295
- signal.removeEventListener("abort", cancel);
296
- clearInterval(timer);
297
- host?.connection.close();
298
- };
299
- }
300
- async function syncHostedLogs(root, context) {
301
- const macos = readMacosRecord(root)?.host;
302
- const warnings = /* @__PURE__ */ new Set();
303
- return (await Promise.all([
304
- ...macos ? [syncHostedMacosLogs(root, macos, void 0, warnings, "ios", context)] : [],
305
- ...Object.entries(readHostedIos(root)).map(([slot, placement]) => syncHostedMacosLogs(root, placement, slot, warnings, "ios", context)),
306
- ...Object.entries(readHostedAndroid(root)).map(([slot, placement]) => syncHostedMacosLogs(root, placement, slot, warnings, "android", context))
307
- ])).every(Boolean);
308
- }
309
- function followHostedLogs(root, failing, context) {
310
- const stops = /* @__PURE__ */ new Map();
311
- let closed = false;
312
- const refresh = () => {
313
- if (closed) return;
314
- const active = /* @__PURE__ */ new Set();
315
- if (readMacosRecord(root)?.host) {
316
- active.add("macos");
317
- if (!stops.has("macos")) stops.set("macos", followHostedMacosLogs(root, {
318
- failing,
319
- context
320
- }));
321
- }
322
- for (const platform of ["ios", "android"]) for (const slot of Object.keys(platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))) {
323
- const key = `${platform}:${slot}`;
324
- active.add(key);
325
- if (!stops.has(key)) stops.set(key, followHostedMacosLogs(root, {
326
- failing,
327
- slot,
328
- platform,
329
- context
330
- }));
331
- }
332
- for (const [key, stop] of stops) {
333
- if (active.has(key)) continue;
334
- stop();
335
- stops.delete(key);
336
- }
337
- };
338
- const stateFile = workspaceStateFile(root);
339
- const home = resolve(configDir());
340
- let watcher = null;
341
- let recheck;
342
- const observe = () => {
343
- if (closed) return;
344
- watcher?.close();
345
- watcher = null;
346
- clearTimeout(recheck);
347
- let directory = dirname(stateFile);
348
- for (;;) try {
349
- const entry = relative(directory, stateFile).split(sep)[0];
350
- const next = watch(directory, (_event, name) => {
351
- if (name !== null && name.toString() !== entry) return;
352
- if (directory !== dirname(stateFile)) observe();
353
- refresh();
354
- });
355
- next.on("error", () => {
356
- next.close();
357
- if (watcher === next) watcher = null;
358
- });
359
- next.unref();
360
- watcher = next;
361
- recheck = setTimeout(refresh, WATCH_RECHECK_MS);
362
- recheck.unref();
363
- return;
364
- } catch (error) {
365
- if (directory === home || !(error instanceof Error && "code" in error && error.code === "ENOENT")) return;
366
- directory = dirname(directory);
367
- }
368
- };
369
- observe();
370
- refresh();
371
- const timer = setInterval(() => {
372
- observe();
373
- refresh();
374
- }, 1e4);
375
- return () => {
376
- closed = true;
377
- watcher?.close();
378
- clearTimeout(recheck);
379
- clearInterval(timer);
380
- for (const stop of stops.values()) stop();
381
- };
382
- }
383
- //#endregion
384
219
  //#region src/engine/logs.ts
385
220
  async function openWorkspaceLogs(context, options = {}, follow = false) {
386
221
  context.signal.throwIfAborted();
@@ -429,8 +264,9 @@ async function readWorkspaceLogs(context, options = {}) {
429
264
  await view.close();
430
265
  }
431
266
  }
267
+ const WORKSPACE_SOURCES = SOURCES.filter((source) => source !== "gc");
432
268
  function validateLogOptions(options) {
433
- const invalid = (options.tail !== void 0 && (!Number.isSafeInteger(options.tail) || options.tail < 0) ? "tail must be a non-negative integer." : options.sources?.some((source) => !SOURCES.includes(source)) ? `sources must contain only ${SOURCES.join(", ")}.` : options.minLevel !== void 0 && !LEVELS.includes(options.minLevel) ? `minLevel must be one of ${LEVELS.join(", ")}.` : void 0) ?? (options.since !== void 0 ? parseSince(options.since).error : void 0) ?? (options.grep !== void 0 ? compileGrep(options.grep).error : void 0);
269
+ const invalid = (options.tail !== void 0 && (!Number.isSafeInteger(options.tail) || options.tail < 0) ? "tail must be a non-negative integer." : options.sources?.some((source) => !WORKSPACE_SOURCES.includes(source)) ? `sources must contain only ${WORKSPACE_SOURCES.join(", ")}.` : options.minLevel !== void 0 && !LEVELS.includes(options.minLevel) ? `minLevel must be one of ${LEVELS.join(", ")}.` : void 0) ?? (options.since !== void 0 ? parseSince(options.since).error : void 0) ?? (options.grep !== void 0 ? compileGrep(options.grep).error : void 0);
434
270
  if (invalid) throw Object.assign(new Error(invalid), { code: "STIM_BAD_ARG" });
435
271
  }
436
272
  async function followWorkspaceLogs(context, options, onRecord, onBackfill) {
@@ -483,4 +319,4 @@ async function followWorkspaceLogs(context, options, onRecord, onBackfill) {
483
319
  return stop;
484
320
  }
485
321
  //#endregion
486
- export { followAgentActions as a, followHostedLogs as i, openWorkspaceLogs as n, readWorkspaceLogs as r, followWorkspaceLogs as t };
322
+ export { followAgentActions as i, openWorkspaceLogs as n, readWorkspaceLogs as r, followWorkspaceLogs as t };
@@ -1,16 +1,16 @@
1
- import { m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
2
- import { W as parseDeviceSlotOption, _ as loadConfig$1, g as isPathPrefix } from "./config-BZhXY15H.mjs";
3
- import { f as refuseNoProject, v as launchErrorPreview } from "./command-output-DxC0k2rk.mjs";
4
- import { r as readWorkspaceState$1 } from "./workspace-state-CeBpIZgr.mjs";
5
- import { n as findCommandWorkspace } from "./project-Dz-hWkb-.mjs";
1
+ import { k as workspaceLogsDir$1, r as readWorkspaceState$1 } from "./workspace-state-pUg3_RRA.mjs";
2
+ import { W as parseDeviceSlotOption, _ as loadConfig$1, g as isPathPrefix } from "./config-BktkY_zC.mjs";
3
+ import { f as refuseNoProject, v as launchErrorPreview } from "./command-output-BF5AR2dL.mjs";
4
+ import { n as findCommandWorkspace } from "./project-BUu6Is4k.mjs";
6
5
  import { n as SOURCES$1, t as LEVELS$1 } from "./ndjson-CgE_o3Dl.mjs";
7
- import { a as followAgentActions, i as followHostedLogs, n as openWorkspaceLogs } from "./logs-DXE32kyb.mjs";
8
- import { t as errorDiagnostics } from "./error-diagnostics-BkKCZq4P.mjs";
6
+ import { i as followAgentActions, n as openWorkspaceLogs } from "./logs-dQDki6Tt.mjs";
7
+ import { t as errorDiagnostics } from "./error-diagnostics-BOOm9Db7.mjs";
8
+ import { n as followHostedLogs } from "./hosted-logs-sync-B0pvmOk-.mjs";
9
9
  import { t as watchStdoutReader } from "./stdout-reader-C8yjre1x.mjs";
10
10
  import { realpathSync } from "node:fs";
11
11
  import { relative, sep } from "node:path";
12
12
  import { configDir } from "@stim-cli/core";
13
- import { buildCriteria, compileGrep, followLogs, logFiles, parseSince, queryLogs, recordMatches, runId, sortByTs } from "@stim-cli/core/state";
13
+ import { buildCriteria, compileGrep, fileSizes, followLogs, gcLogDir, logFiles, parseSince, queryLogs, readGcLog, recordMatches, runId, sortByTs } from "@stim-cli/core/state";
14
14
  import chalk from "chalk";
15
15
  //#region src/commands/logs.ts
16
16
  const LEVEL_WIDTH = 5;
@@ -57,7 +57,8 @@ function parseTail(value) {
57
57
  function validateSources(sources) {
58
58
  if (sources === void 0 || sources === null) return { sources: void 0 };
59
59
  const list = Array.isArray(sources) ? sources : [sources];
60
- if (list.includes("all")) return { sources: [...SOURCES$1] };
60
+ if (list.includes("gc") && list.length > 1) return { error: "--source gc reads the machine-wide gc log and cannot be combined with other sources." };
61
+ if (list.includes("all")) return { sources: SOURCES$1.filter((source) => source !== "gc") };
61
62
  const unknown = list.filter((s) => !SOURCES$1.includes(s));
62
63
  if (unknown.length > 0) return { error: `Unknown --source value(s): ${unknown.join(", ")}. Use one or more of: ${SOURCES$1.join(", ")}, or all.` };
63
64
  return { sources: list };
@@ -97,39 +98,20 @@ const LEVEL_COLOURS = {
97
98
  fatal: chalk.bgRed
98
99
  };
99
100
  function logsCommand(program) {
100
- program.command("logs").description("Query this workspace's merged NDJSON log timeline (bundler, client, device, build, agent actions, maintenance). Prints and exits; an existing timeline with nothing matching is a successful, empty result. Use --follow to stream.").option("--slot <name>", "Only this device slot's records, plus the shared Metro and app client records once it has launched", parseDeviceSlotOption).option("--source <s...>", "Only these sources: metro, client, device, build, agent, maintenance, placement, or all").option("--level <l>", `Minimum level: ${LEVELS$1.join(", ")}`).option("--since <d>", "Only records newer than this, e.g. 30s, 5m, 2h").option("--grep <re>", "Only records whose message matches this regular expression").option("--tail <n>", "Only the last n matching records").option("--errors", "Errors and fatals since the last marker, from metro, client and build, plus confirmed native app-crash reports and stim web browser errors. Add --source maintenance for maintenance failures, or --source device or --source all for general device errors.").option("--follow", "Keep streaming new records until interrupted").option("--json", "Emit the raw records, one per line (valid NDJSON; zero matches is zero bytes, exit 0)").action(async (opts) => {
101
+ program.command("logs").description("Query this workspace's merged NDJSON log timeline (bundler, client, device, build, agent actions, maintenance). Prints and exits; an existing timeline with nothing matching is a successful, empty result. Use --follow to stream.").option("--slot <name>", "Only this device slot's records, plus the shared Metro and app client records once it has launched", parseDeviceSlotOption).option("--source <s...>", "Only these sources: metro, client, device, build, agent, maintenance, placement, or all; gc alone reads the machine-wide gc log of what gc and maintenance cleared").option("--level <l>", `Minimum level: ${LEVELS$1.join(", ")}`).option("--since <d>", "Only records newer than this, e.g. 30s, 5m, 2h").option("--grep <re>", "Only records whose message matches this regular expression").option("--tail <n>", "Only the last n matching records").option("--errors", "Errors and fatals since the last marker, from metro, client and build, plus confirmed native app-crash reports and stim web browser errors. Add --source maintenance for maintenance failures, or --source device or --source all for general device errors.").option("--follow", "Keep streaming new records until interrupted").option("--json", "Emit the raw records, one per line (valid NDJSON; zero matches is zero bytes, exit 0)").action(async (opts) => {
102
+ const requested = [opts.source ?? []].flat();
103
+ if (requested.length === 1 && requested[0] === "gc") {
104
+ const { minLevel, tail } = validateOptions(opts);
105
+ printGcLog(opts, opts.errors ? "error" : minLevel, tail);
106
+ return;
107
+ }
101
108
  const root = findCommandWorkspace(process.cwd());
102
109
  if (!root) {
103
110
  refuseNoProject({ json: false });
104
111
  return;
105
112
  }
106
113
  const dir = workspaceLogsDir$1(root);
107
- let sources;
108
- if (opts.source !== void 0) {
109
- const checked = validateSources(opts.source);
110
- if (checked.error) fail(checked.error);
111
- sources = checked.sources;
112
- }
113
- let minLevel;
114
- if (opts.level !== void 0) {
115
- const checked = validateLevel(opts.level);
116
- if (checked.error) fail(checked.error);
117
- minLevel = checked.level;
118
- }
119
- if (opts.since !== void 0) {
120
- const parsed = parseSince(opts.since);
121
- if (parsed.error) fail(parsed.error);
122
- }
123
- let tail;
124
- if (opts.tail !== void 0) {
125
- const parsed = parseTail(opts.tail);
126
- if (parsed.error) fail(parsed.error);
127
- tail = parsed.n;
128
- }
129
- if (opts.grep !== void 0) {
130
- const compiled = compileGrep(opts.grep);
131
- if (compiled.error) fail(compiled.error);
132
- }
114
+ const { sources, minLevel, tail } = validateOptions(opts);
133
115
  requireLogsWorkspace(root, dir);
134
116
  const query = {
135
117
  slot: opts.slot,
@@ -242,6 +224,73 @@ function logsCommand(program) {
242
224
  process.on("SIGTERM", finish);
243
225
  });
244
226
  }
227
+ function validateOptions(opts) {
228
+ let sources;
229
+ if (opts.source !== void 0) {
230
+ const checked = validateSources(opts.source);
231
+ if (checked.error) fail(checked.error);
232
+ sources = checked.sources;
233
+ }
234
+ let minLevel;
235
+ if (opts.level !== void 0) {
236
+ const checked = validateLevel(opts.level);
237
+ if (checked.error) fail(checked.error);
238
+ minLevel = checked.level;
239
+ }
240
+ if (opts.since !== void 0) {
241
+ const parsed = parseSince(opts.since);
242
+ if (parsed.error) fail(parsed.error);
243
+ }
244
+ let tail;
245
+ if (opts.tail !== void 0) {
246
+ const parsed = parseTail(opts.tail);
247
+ if (parsed.error) fail(parsed.error);
248
+ tail = parsed.n;
249
+ }
250
+ if (opts.grep !== void 0) {
251
+ const compiled = compileGrep(opts.grep);
252
+ if (compiled.error) fail(compiled.error);
253
+ }
254
+ return {
255
+ sources,
256
+ minLevel,
257
+ tail
258
+ };
259
+ }
260
+ function printGcLog(opts, minLevel, tail) {
261
+ const emit = (record) => console.log(opts.json ? JSON.stringify(record) : formatRecord(record, { paint: record.level ? LEVEL_COLOURS[record.level] : void 0 }));
262
+ const query = {
263
+ sources: ["gc"],
264
+ minLevel,
265
+ since: opts.since,
266
+ grep: opts.grep
267
+ };
268
+ const offsets = opts.follow ? fileSizes(gcLogDir()) : null;
269
+ const records = queryLogs({
270
+ ...query,
271
+ records: readGcLog(),
272
+ tail
273
+ });
274
+ for (const record of records) emit(record);
275
+ if (!opts.follow) {
276
+ if (records.length === 0 && !opts.json) console.error(chalk.dim(`No matching log records in ${gcLogDir()}`));
277
+ return;
278
+ }
279
+ const stop = followLogs({
280
+ dir: gcLogDir(),
281
+ offsets,
282
+ criteria: buildCriteria(query),
283
+ onRecord: emit
284
+ });
285
+ const finish = () => {
286
+ stop();
287
+ stopReader();
288
+ process.exit(0);
289
+ };
290
+ const stopReader = watchStdoutReader(finish);
291
+ process.on("SIGINT", finish);
292
+ process.on("SIGTERM", finish);
293
+ }
245
294
  function fail(message) {
246
295
  console.error(chalk.red(message));
247
296
  process.exit(1);
@@ -1,2 +1,2 @@
1
- import { n as runMacos, r as waitForLaunchServices, t as macosCommand } from "./macos-CCfhb-jT.mjs";
1
+ import { n as runMacos, r as waitForLaunchServices, t as macosCommand } from "./macos-DBBPNnIA.mjs";
2
2
  export { macosCommand as default, runMacos, waitForLaunchServices };
@@ -1,24 +1,23 @@
1
1
  import { _ as spawnDeclared, c as throwIfCancelled, t as getExecutor, u as withWorkspaceProcessLock, x as withDrainingCancellation } from "./exec-VFRpu1iA.mjs";
2
- import { d as workspaceDir, l as workspaceAgentDeviceDir, m as workspaceLogsDir$1, r as ensureWorkspaceStorageAsync } from "./paths-DQtTgsBf.mjs";
3
- import { E as upsertProject, O as withConfigLockAsync$1, u as getConcurrencyLimits } from "./config-BZhXY15H.mjs";
4
- import { l as phaseLine } from "./command-output-DxC0k2rk.mjs";
5
- import { a as recordWorkspaceUseAsync, f as writeWorkspaceStateAsync } from "./workspace-state-CeBpIZgr.mjs";
6
- import { J as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY, et as settingShapeErrors } from "./settings-RKwY33wv.mjs";
7
- import { f as projectRegistry, i as findProjectRoot$1, s as ownedDeviceLabel } from "./project-Dz-hWkb-.mjs";
8
- import { i as macosProcess, n as macosDir, o as requiredMacosRecord, r as macosLogFile } from "./state-BfAltYJP.mjs";
2
+ import { E as workspaceDir, a as recordWorkspaceUseAsync, f as writeWorkspaceStateAsync, k as workspaceLogsDir$1, v as ensureWorkspaceStorageAsync, w as workspaceAgentDeviceDir } from "./workspace-state-pUg3_RRA.mjs";
3
+ import { E as upsertProject, O as withConfigLockAsync$1, u as getConcurrencyLimits } from "./config-BktkY_zC.mjs";
4
+ import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
5
+ import { Y as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY, tt as settingShapeErrors } from "./settings-CosW5X-S.mjs";
6
+ import { f as projectRegistry, i as findProjectRoot$1, s as ownedDeviceLabel } from "./project-BUu6Is4k.mjs";
7
+ import { i as macosProcess, n as macosDir, o as requiredMacosRecord, r as macosLogFile } from "./state-C4OdpOTF.mjs";
9
8
  import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
10
- import { B as recordFinishedBuild, H as startBuildProgress, Ln as processContext, M as NO_BUILD_PROGRESS, Rn as runProcessOperation, U as tapBuildLog, z as recordBuildPhase } from "./budget-dPGuhNai.mjs";
11
- import { d as runCancellationSignal, f as withNativeBuildRun } from "./native-run-BmH7U8pr.mjs";
12
- import { L as acquireBuildSlot, z as releaseBuildSlot } from "./workspaces-CSV2Orf4.mjs";
13
- import { D as sanitizeDeviceLabel } from "./ios-CVUFFZ6C.mjs";
14
- import { S as setRemoteLogSink, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-18-ZowoT.mjs";
15
- import { a as parseBuildMachineOption, c as resolveBuildPlacement, i as namedBuildMachine, o as requireLocalBuild, t as OffloadRefusal } from "./selection-BLtvaqxc.mjs";
16
- import { l as connectHost } from "./hosted-client-BBTVe3X6.mjs";
17
- import { t as placeHostedMacos } from "./hosted-macos-CXjsUNBR.mjs";
18
- import { r as stopMacosAppHeld, t as stopBundleInstances } from "./stop-DhclRwOO.mjs";
9
+ import { Hn as processContext, I as NO_BUILD_PROGRESS, K as startBuildProgress, U as recordBuildPhase, Un as runProcessOperation, W as recordFinishedBuild, q as tapBuildLog } from "./budget-k2mZGvvk.mjs";
10
+ import { d as runCancellationSignal, f as withNativeBuildRun } from "./native-run-BfIDFKLH.mjs";
11
+ import { L as acquireBuildSlot, z as releaseBuildSlot } from "./workspaces-g2lhdBXF.mjs";
12
+ import { O as sanitizeDeviceLabel } from "./ios-WxpDJ5T1.mjs";
13
+ import { S as setRemoteLogSink, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-D9CaRks-.mjs";
14
+ import { a as parseBuildMachineOption, i as namedBuildMachine, l as resolveBuildPlacement, s as requireLocalBuild, t as OffloadRefusal } from "./selection-BNPBZ6T5.mjs";
15
+ import { l as connectHost } from "./hosted-client-fHO8yqzc.mjs";
16
+ import { t as placeHostedMacos } from "./hosted-macos-CPl0OZ9h.mjs";
17
+ import { r as stopMacosAppHeld, t as stopBundleInstances } from "./stop-ySNQHXMG.mjs";
19
18
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
20
- import { t as buildPlacementRecord } from "./placement-log-DUvqqsB-.mjs";
21
- import { t as reidentifyBundle } from "./stage-ERTMh88n.mjs";
19
+ import { t as buildPlacementRecord } from "./placement-log-DIFPQAXp.mjs";
20
+ import { t as reidentifyBundle } from "./stage-jKQ7CP_B.mjs";
22
21
  import { t as validateMacosArtifactPlatform } from "./artifact-platform-CMRc0M_r.mjs";
23
22
  import { t as waitForMacosRegistration } from "./registration-CN6nlhcD.mjs";
24
23
  import { createHash, randomUUID } from "node:crypto";
@@ -346,7 +345,7 @@ async function planMacos(context, root, buildMachineFlag) {
346
345
  if (selected.failure) throw Object.assign(new Error(selected.failure.message), selected.failure);
347
346
  const macos = settings.macos;
348
347
  if (!macos?.product || !macos.infoPlist) throw Object.assign(/* @__PURE__ */ new Error("Set macos.product and macos.infoPlist explicitly in .stim.json. See stim guide macos."), { code: "STIM_BAD_ARG" });
349
- const { swiftpmMacosProject } = await import("./swiftpm-macos-BVCP5mO4.mjs");
348
+ const { swiftpmMacosProject } = await import("./swiftpm-macos-x6HPpl_2.mjs");
350
349
  const recipe = await swiftpmMacosProject(root).prepare(context, settings);
351
350
  let identity = null;
352
351
  let cacheHit = false;
@@ -1,2 +1,2 @@
1
- import { n as runMacosSupervisor, t as logLines } from "./run-BIwoU44q.mjs";
1
+ import { n as runMacosSupervisor, t as logLines } from "./run-BqB0v3pt.mjs";
2
2
  export { logLines, runMacosSupervisor };