stim 1.20.2 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +88 -8
  2. package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
  3. package/dist/act-DHAw2A2S.mjs +2667 -0
  4. package/dist/activity-BzVfHSrY.mjs +1376 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
  6. package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
  7. package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
  8. package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
  9. package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
  10. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
  11. package/dist/android-cas-compiler.mjs +2 -2
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/api.d.mts +740 -8
  14. package/dist/api.mjs +585 -1
  15. package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
  16. package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
  17. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
  18. package/dist/budget-Bs6SxxzO.mjs +9154 -0
  19. package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
  20. package/dist/build-cache-DmyR9Zzc.mjs +602 -0
  21. package/dist/build-plan-CaFskB7_.mjs +188 -0
  22. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
  25. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
  26. package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
  27. package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/client-B7QVOlCr.d.mts +253 -0
  30. package/dist/client-UXD70ZbM.mjs +1406 -0
  31. package/dist/collector-run.d.mts +4 -40
  32. package/dist/collector-run.mjs +9 -8
  33. package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
  34. package/dist/config-CYcBF478.mjs +949 -0
  35. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
  36. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
  37. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
  38. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
  39. package/dist/device-DCxH7_By.mjs +1068 -0
  40. package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
  41. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
  42. package/dist/device-host-worker.mjs +65 -61
  43. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
  44. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
  45. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
  46. package/dist/doctor-BLHCYxzi.mjs +2 -0
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
  49. package/dist/doctor-fingerprint.mjs +19 -0
  50. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
  51. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
  52. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
  53. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
  54. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
  55. package/dist/exec-H20xSg2T.d.mts +65 -0
  56. package/dist/exec-_UbtCQcG.mjs +750 -0
  57. package/dist/gc-C-WwL0yi.mjs +3 -0
  58. package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
  59. package/dist/git-C3iTsJaZ.mjs +73 -0
  60. package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
  61. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
  62. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
  63. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
  64. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
  65. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
  66. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
  67. package/dist/idle-BVeRGroT.d.mts +24 -0
  68. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
  69. package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
  70. package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
  71. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
  73. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
  74. package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
  75. package/dist/ios-signing-DTTIChGs.mjs +489 -0
  76. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
  77. package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
  78. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
  79. package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
  80. package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
  81. package/dist/logs-BS00Anxf.mjs +352 -0
  82. package/dist/logs-CMm05HxN.mjs +255 -0
  83. package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
  84. package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +122 -247
  87. package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
  88. package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
  89. package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
  90. package/dist/native-android-JACyjTZs.mjs +844 -0
  91. package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
  92. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  93. package/dist/native-run-DY_RLx3C.mjs +277 -0
  94. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
  95. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
  96. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
  97. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  98. package/dist/offload-worker.d.mts +1 -46
  99. package/dist/offload-worker.mjs +197 -66
  100. package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
  101. package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
  102. package/dist/paths-BsJMoPP2.mjs +12 -0
  103. package/dist/paths-DQtTgsBf.mjs +42 -0
  104. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
  105. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
  106. package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
  107. package/dist/prebuild-uD_ipCxF.mjs +449 -0
  108. package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
  109. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
  110. package/dist/pull-request-zjCSAryH.d.mts +120 -0
  111. package/dist/pull-requests.d.mts +1 -119
  112. package/dist/pull-requests.mjs +1 -1
  113. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
  114. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
  115. package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
  116. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
  117. package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
  118. package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
  119. package/dist/reload-DzjSl5P_.mjs +2 -0
  120. package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
  121. package/dist/result-DNiS-tTP.mjs +434 -0
  122. package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
  123. package/dist/selection-CSl9i5qU.mjs +619 -0
  124. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
  125. package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
  126. package/dist/server-expo-C-90EhcG.mjs +2 -0
  127. package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
  128. package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
  129. package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
  130. package/dist/settings-T1gtc3bf.mjs +114 -0
  131. package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
  132. package/dist/settings.schema.json +163 -16
  133. package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
  134. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
  135. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  136. package/dist/stage-BIS0ydsV.mjs +183 -0
  137. package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
  138. package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
  139. package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
  140. package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
  141. package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
  142. package/dist/stats-report-BFfMpWWF.mjs +16 -0
  143. package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
  144. package/dist/status-CSi6tlRq.mjs +2 -0
  145. package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
  146. package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
  147. package/dist/status-worker.d.mts +1 -0
  148. package/dist/status-worker.mjs +19 -0
  149. package/dist/stim-desktop-C12we7lz.mjs +112 -0
  150. package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
  151. package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
  152. package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
  153. package/dist/supervisor-run.d.mts +8 -17
  154. package/dist/supervisor-run.mjs +63 -27
  155. package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
  156. package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
  157. package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
  158. package/dist/toolchain-DhKwp9iI.mjs +2 -0
  159. package/dist/toolchain-Hp9sCpK4.mjs +873 -0
  160. package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
  161. package/dist/trigger-Bf3uDcpv.mjs +2 -0
  162. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
  163. package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
  164. package/dist/web-DknQETPs.mjs +2 -0
  165. package/dist/web-run.mjs +11 -12
  166. package/dist/windows-report.d.mts +1 -0
  167. package/dist/windows-report.mjs +18 -0
  168. package/dist/windows-report.ps1 +43 -0
  169. package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
  170. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
  171. package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
  172. package/dist/worktree-CK2MpJW5.mjs +2 -0
  173. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
  174. package/dist/xcode-Zlx3qjEs.mjs +896 -0
  175. package/package.json +7 -5
  176. package/shim/android-optimizations.gradle +7 -5
  177. package/dist/activity-BSV745Kz.mjs +0 -629
  178. package/dist/api-qvOzWyfO.mjs +0 -154
  179. package/dist/api-run.mjs +0 -294
  180. package/dist/app-install-BIKtMfPq.mjs +0 -896
  181. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  182. package/dist/budget-f7516Zk0.mjs +0 -4106
  183. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  184. package/dist/cancellation-C_22VQTH.mjs +0 -24
  185. package/dist/client-qQAaXSUs.mjs +0 -1771
  186. package/dist/config-BYDxlMY3.mjs +0 -562
  187. package/dist/device-DuiPJQSn.mjs +0 -290
  188. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  189. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  190. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  191. package/dist/exec-DqKo9GKJ.mjs +0 -268
  192. package/dist/git-DDfFzkMm.mjs +0 -45
  193. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  194. package/dist/logs-BGrEUaEs.mjs +0 -383
  195. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  196. package/dist/native-android-D5qc3-_v.mjs +0 -226
  197. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  198. package/dist/plan-C4TjdPsR.mjs +0 -260
  199. package/dist/prebuild-DYbucPXy.mjs +0 -212
  200. package/dist/preview-78a9kR_-.mjs +0 -1011
  201. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  202. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  203. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  204. package/dist/result-CaJg5Iat.mjs +0 -186
  205. package/dist/server-expo-Bigriskl.mjs +0 -2
  206. package/dist/settings-BORNaaCO.mjs +0 -402
  207. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  208. package/dist/stage-KNTQopqv.mjs +0 -157
  209. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  210. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  211. package/dist/toolchain-BFkAcstd.mjs +0 -2
  212. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  213. package/dist/trigger-9_USgmxz.mjs +0 -2
  214. package/dist/web-Dq-i3wzJ.mjs +0 -2
  215. package/dist/worktree-DpLdCHga.mjs +0 -2
  216. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  217. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
package/dist/api.d.mts CHANGED
@@ -1,9 +1,16 @@
1
- import { i as IosFacts, n as CcacheActivity, r as CompilationCacheActivity, t as AndroidFacts } from "./build-facts-DcLv2HSd.mjs";
2
- import "./settings-vk3mJGSm.mjs";
3
- import "./ndjson-Du3j0AQ9.mjs";
4
- import { MacosBuild, NdjsonRecord, WebBrowserState, WebViewport } from "@stim-cli/core/state";
1
+ import { a as DoctorPlatform, c as AndroidFacts, d as IosFacts, i as TailnetMachineIo, l as CcacheActivity, n as BuildMachinesInspection, o as Finding, r as GeneratedTickets, u as CompilationCacheActivity } from "./client-B7QVOlCr.mjs";
2
+ import { i as WorkspaceLaunchPlatform } from "./settings-DkdmlelE.mjs";
3
+ import "./exec-H20xSg2T.mjs";
4
+ import { t as IdleDevice } from "./idle-BVeRGroT.mjs";
5
+ import { readFileSync, writeFileSync } from "node:fs";
6
+ import { StimContext, hostSimulatorArch } from "@stim-cli/core";
7
+ import { ANDROID_EMULATOR_APPS, AgentDeviceUsage, ArchivedWorkspace, MacosBuild, MaintenanceAction, MaintenanceMode, MaintenancePressure, MaintenanceStatus, NdjsonRecord, SettingScope, SettingWriteResult, SettingsPayload, SimRuntimeUsage, StatsReport, SwiftpmCacheUsage, WebBrowserState, WebViewport, machineCapacity } from "@stim-cli/core/state";
5
8
  import { Command } from "commander";
9
+ import "@expo/fingerprint";
10
+ import { loadCacheProvider } from "@stim-cli/cache";
11
+ import { ToolchainEntry } from "@stim-cli/core/toolchain";
6
12
  import { ChildProcess } from "node:child_process";
13
+ import { HelloResult } from "@stim-cli/core/protocol";
7
14
  //#region src/commands/android/build.d.ts
8
15
  interface AndroidBuildOptions {
9
16
  variant?: string;
@@ -27,6 +34,9 @@ interface AndroidBuildFacts {
27
34
  logs: {
28
35
  dir: string;
29
36
  };
37
+ links: {
38
+ workspace: string;
39
+ };
30
40
  }
31
41
  //#endregion
32
42
  //#region src/commands/macos-build.d.ts
@@ -43,6 +53,9 @@ interface MacosBuildFacts {
43
53
  logs: {
44
54
  dir: string;
45
55
  };
56
+ links: {
57
+ workspace: string;
58
+ };
46
59
  }
47
60
  //#endregion
48
61
  //#region src/commands/ios/build.d.ts
@@ -71,6 +84,9 @@ interface IosBuildFacts {
71
84
  logs: {
72
85
  dir: string;
73
86
  };
87
+ links: {
88
+ workspace: string;
89
+ };
74
90
  }
75
91
  //#endregion
76
92
  //#region src/engine/device-lease.d.ts
@@ -164,6 +180,652 @@ interface WebFacts extends WebBrowserState {
164
180
  durationMs: number;
165
181
  }
166
182
  //#endregion
183
+ //#region src/maintenance/status.d.ts
184
+ declare function maintenanceStatus(env?: NodeJS.ProcessEnv): MaintenanceStatus;
185
+ //#endregion
186
+ //#region src/commands/gc/results.d.ts
187
+ type GcResultKind = "archive" | "device" | "parkedDevice" | "parkedHostedDevice" | "idleDevice" | "deviceRecord" | "workspaceOutputs" | "recording" | "workspaceDirectory" | "project" | "buildLock" | "buildSlot" | "deviceLease" | "easSession" | "worktree" | "cache" | "statusCache" | "tempLeftover" | "watchmanRoot" | "watchman" | "gradleDaemon" | "gradleVersion" | "kotlinDaemon";
188
+ type GcResultStatus = "done" | "kept" | "failed";
189
+ interface GcResult {
190
+ kind: GcResultKind;
191
+ status: GcResultStatus;
192
+ label: string;
193
+ id: string | null;
194
+ bytes: number | null;
195
+ detail: string | null;
196
+ }
197
+ //#endregion
198
+ //#region src/budget.d.ts
199
+ type ReclaimStepName = "idle-devices" | "idle-dev-servers" | "workspace-outputs" | "stale-cache-entries";
200
+ interface ReclaimedStep {
201
+ step: ReclaimStepName;
202
+ targets: string[];
203
+ failures: number;
204
+ freedMb?: number;
205
+ }
206
+ interface BudgetReport {
207
+ budget: {
208
+ minFreeDiskGb: number;
209
+ hardFloorDiskGb: number;
210
+ maxCommittedMemoryGb: number;
211
+ maxLiveWorkspaces: number;
212
+ };
213
+ volumes: {
214
+ volume: string;
215
+ freeGb: number;
216
+ }[];
217
+ memory: {
218
+ committedGb: number;
219
+ liveWorkspaces: number;
220
+ } | null;
221
+ plan: ReclaimedStep[];
222
+ }
223
+ //#endregion
224
+ //#region src/device-host/machines.d.ts
225
+ interface MachineReport {
226
+ machine: string;
227
+ state: "invalid" | "tailscale-off" | "not-on-tailnet" | "key-changed" | "not-asked" | "pending" | "approved" | "revoked" | "lapsed" | "outdated" | "unreachable" | "credentials-unavailable" | "busy";
228
+ dnsName?: string;
229
+ deviceId?: string;
230
+ requestedAt?: string;
231
+ expiresAt?: string;
232
+ host?: NonNullable<HelloResult["host"]>;
233
+ }
234
+ interface Inspection {
235
+ findings: Finding[];
236
+ machines: MachineReport[];
237
+ }
238
+ /**
239
+ * Reports the device-host approval of each remote machine, separate from its build approval. Only --fix makes a setup
240
+ * ticket or forgets credentials; every server key stays pinned.
241
+ */
242
+ declare function inspectDeviceHostMachines({ fix, version, tickets, operation }: {
243
+ fix: boolean;
244
+ version?: string;
245
+ tickets?: GeneratedTickets;
246
+ operation?: StimContext;
247
+ }, io?: TailnetMachineIo, entries?: string[] | null): Promise<Inspection>;
248
+ //#endregion
249
+ //#region src/diagnostics/stim-installations.d.ts
250
+ interface StimInstallation {
251
+ path: string;
252
+ realPath: string;
253
+ version: string | null;
254
+ }
255
+ interface StimVersionReport {
256
+ runningVersion: string;
257
+ runningPath: string | null;
258
+ resolved: StimInstallation | null;
259
+ installations: StimInstallation[];
260
+ versions: string[];
261
+ highestVersion: string | null;
262
+ resolvedIsOlder: boolean;
263
+ }
264
+ //#endregion
265
+ //#region src/commands/doctor.d.ts
266
+ /**
267
+ * Where the toolchain a process without a login shell, such as stim-server under Stim Desktop, finds each tool,
268
+ * and the Node the project's dev server runs on.
269
+ */
270
+ interface ToolchainReport {
271
+ entries: ToolchainEntry[];
272
+ projectNode: {
273
+ pin: string;
274
+ spec: string;
275
+ bin: string | null;
276
+ version: string | null;
277
+ } | null;
278
+ }
279
+ interface DoctorReport {
280
+ project: string;
281
+ platform: DoctorPlatform | null;
282
+ stim: StimVersionReport;
283
+ budget: BudgetReport | null;
284
+ maintenance: ReturnType<typeof maintenanceStatus> & {
285
+ logPath: string;
286
+ };
287
+ remoteMachines: BuildMachinesInspection["machines"];
288
+ deviceHosts: Awaited<ReturnType<typeof inspectDeviceHostMachines>>["machines"];
289
+ toolchain: ToolchainReport | null;
290
+ findings: Finding[];
291
+ }
292
+ //#endregion
293
+ //#region src/commands/gc/worktrees.d.ts
294
+ type WorktreeSkipCode = "not-a-worktree" | "bare-repository" | "source-checkout-unknown" | "source-checkout" | "locked" | "nested-worktree" | "in-use" | "status-unreadable" | "dirty" | "unpushed-unchecked" | "unpushed" | "submodules" | "not-merged" | "merge-unknown" | "last-use-unknown" | "recently-used" | "activity-unknown" | "recent-activity";
295
+ interface WorktreeBuildState {
296
+ bytes: number | null;
297
+ dirs: {
298
+ path: string;
299
+ bytes: number | null;
300
+ }[];
301
+ }
302
+ //#endregion
303
+ //#region src/maintenance/plan.d.ts
304
+ interface MaintenancePlan {
305
+ actions: MaintenanceAction[];
306
+ blocked: string[];
307
+ skips: {
308
+ target: string;
309
+ reason: string;
310
+ workspace?: string;
311
+ }[];
312
+ }
313
+ //#endregion
314
+ //#region src/maintenance/preview.d.ts
315
+ interface MaintenancePreview extends MaintenancePlan {
316
+ mode: MaintenanceMode;
317
+ invalid?: string;
318
+ pressure: MaintenancePressure | null;
319
+ note: string | null;
320
+ }
321
+ //#endregion
322
+ //#region src/commands/gc/devices.d.ts
323
+ interface ParkedSimReport {
324
+ udid: string;
325
+ name: string;
326
+ model: string | null;
327
+ runtime: string | null;
328
+ parkedAt: string;
329
+ app: string | null;
330
+ bytes: number | null;
331
+ listed: boolean | null;
332
+ }
333
+ interface ParkedAvdReport {
334
+ name: string;
335
+ systemImage: string;
336
+ deviceProfile: string | null;
337
+ parkedAt: string;
338
+ app: string | null;
339
+ bytes: number | null;
340
+ listed: boolean | null;
341
+ }
342
+ //#endregion
343
+ //#region src/commands/gc/hosted-devices.d.ts
344
+ interface ParkedHostedDeviceReport {
345
+ session: string;
346
+ client: string;
347
+ platform: "ios" | "android";
348
+ id: string | null;
349
+ name: string | null;
350
+ parkedAt: string;
351
+ listed: boolean | null;
352
+ }
353
+ //#endregion
354
+ //#region src/archive.d.ts
355
+ interface ArchiveStaging {
356
+ path: string;
357
+ kept: boolean;
358
+ reason: string | null;
359
+ removeCommand: string | null;
360
+ }
361
+ //#endregion
362
+ //#region src/commands/gc/archive-selector.d.ts
363
+ type ArchiveKind = "logs" | "recordings" | "agentActions";
364
+ //#endregion
365
+ //#region src/commands/gc/archives.d.ts
366
+ interface ArchiveSelection {
367
+ records: {
368
+ id: string;
369
+ kinds: string[];
370
+ bytes: number;
371
+ expires: ArchivedWorkspace["expires"];
372
+ willDelete: boolean;
373
+ }[];
374
+ staging: ArchiveStaging[];
375
+ unknownId: string | null;
376
+ knownIds: string[];
377
+ kind: ArchiveKind | null;
378
+ }
379
+ //#endregion
380
+ //#region src/devices/machine-cache-usage.d.ts
381
+ interface SizedDir {
382
+ dir: string;
383
+ bytes: number | null;
384
+ }
385
+ interface MachineCacheReport {
386
+ measuredAt: string;
387
+ complete: boolean;
388
+ notices: string[];
389
+ gradle: {
390
+ home: string;
391
+ unusedVersions: {
392
+ version: string;
393
+ bytes: number | null;
394
+ dirs: SizedDir[];
395
+ remedy: string | null;
396
+ }[];
397
+ usedVersions: {
398
+ version: string;
399
+ projects: string[];
400
+ }[];
401
+ unreadableProjects: string[];
402
+ modules: (SizedDir & {
403
+ remedy: string;
404
+ }) | null;
405
+ };
406
+ simRuntimes: {
407
+ checked: boolean;
408
+ runtimes: (SimRuntimeUsage & {
409
+ remedy: string | null;
410
+ })[];
411
+ };
412
+ deviceSupport: {
413
+ entries: SizedDir[];
414
+ remedy: string;
415
+ };
416
+ runnerBuilds: {
417
+ agentDeviceVersion: string | null;
418
+ xcodeBuildVersion: string | null;
419
+ groups: {
420
+ packageVersion: string | null;
421
+ xcodeBuildVersion: string | null;
422
+ current: boolean | null;
423
+ entries: number;
424
+ inUse: number;
425
+ bytes: number | null;
426
+ oldestUseAt: string | null;
427
+ }[];
428
+ remedy: string;
429
+ };
430
+ }
431
+ //#endregion
432
+ //#region src/commands/gc/gradle-versions.d.ts
433
+ type GradleSweepBlock = "machine-global" | "no-registry" | "unsafe-layout" | "listing-failed" | "unreadable-project" | "gradle-running" | "processes-unknown";
434
+ type GradleVersionKeptCode = GradleSweepBlock | "pinned" | "not-a-directory" | "walk-failed" | "too-many-entries" | "recently-modified";
435
+ interface GradleVersionEntry {
436
+ version: string;
437
+ dirs: string[];
438
+ bytes: number | null;
439
+ lastModifiedAt: string | null;
440
+ willDelete: boolean;
441
+ reason: GradleVersionKeptCode | null;
442
+ detail: string | null;
443
+ }
444
+ interface GradleVersionSweep {
445
+ home: string;
446
+ olderThanDays: number | null;
447
+ blocked: {
448
+ reason: GradleSweepBlock;
449
+ detail: string;
450
+ } | null;
451
+ /** Why running Gradle blocks deletion; with `pastRunningGradle`, versions are judged as if it had stopped. */
452
+ gradleRunning: string | null;
453
+ /** The pids of the Gradle processes behind `gradleRunning`. */
454
+ gradleRunningPids: number[];
455
+ versions: GradleVersionEntry[];
456
+ leftovers: string[];
457
+ }
458
+ //#endregion
459
+ //#region src/commands/gc/workspaces.d.ts
460
+ type WorkspaceKeptCode = "unresolved" | "in-use" | "last-use-unknown" | "recently-used";
461
+ //#endregion
462
+ //#region src/commands/gc/logs.d.ts
463
+ type WorkspaceLogsKeptCode = "unresolved" | "in-use" | "collector";
464
+ //#endregion
465
+ //#region src/commands/gc/finished-devices.d.ts
466
+ interface OwnedDeviceDisk {
467
+ kind: "ios" | "android";
468
+ count: number;
469
+ bytes: number;
470
+ /** Owned devices whose disk could not be measured; `bytes` leaves them out. */
471
+ unmeasured: number;
472
+ }
473
+ //#endregion
474
+ //#region src/commands/gc/recordings.d.ts
475
+ type RecordingKeptCode = "unresolved" | "retained" | "recently-recorded";
476
+ //#endregion
477
+ //#region src/commands/gc/temp-leftovers.d.ts
478
+ type TempLeftoverKind = "stim" | "xctrace" | "jest";
479
+ interface TempLeftover {
480
+ kind: TempLeftoverKind;
481
+ path: string;
482
+ bytes: number;
483
+ willDelete: boolean;
484
+ kept: string | null;
485
+ }
486
+ interface TempLeftoverReport {
487
+ root: string;
488
+ entries: TempLeftover[];
489
+ /** Judges an entry again right before deletion (a Stim directory after its rename to `staged`), so a claim or recording use since the scan keeps it. */
490
+ recheck?: (staged: string, original: string, kind: "stim" | "xctrace") => Promise<string | null>;
491
+ }
492
+ interface TempLeftoverGroup {
493
+ kind: TempLeftoverKind;
494
+ count: number;
495
+ bytes: number;
496
+ deleteCount: number;
497
+ deleteBytes: number;
498
+ kept: {
499
+ reason: string;
500
+ count: number;
501
+ }[];
502
+ remedy: string;
503
+ }
504
+ declare function tempLeftoverSection(report: TempLeftoverReport | null | undefined): {
505
+ root: string;
506
+ groups: TempLeftoverGroup[];
507
+ } | null;
508
+ //#endregion
509
+ //#region src/commands/gc/memory.d.ts
510
+ declare const WATCHMAN_KIND = "watchman";
511
+ declare const GRADLE_DAEMONS_KIND = "gradle-daemons";
512
+ type MemoryCacheKind = typeof WATCHMAN_KIND | typeof GRADLE_DAEMONS_KIND;
513
+ type MemoryKeptCode = "in-use" | "busy" | "unknown" | "build-running" | "stim-server";
514
+ interface MemoryProcess {
515
+ kind: "watchman" | "gradleDaemon" | "kotlinDaemon";
516
+ cacheKind: MemoryCacheKind;
517
+ pid: number;
518
+ startedAt: string | null;
519
+ bytes: number;
520
+ measure: "footprint" | "rss";
521
+ version: string | null;
522
+ gradleHome: string | null;
523
+ offloadClient: string | null;
524
+ state: "idle" | "busy" | "unknown";
525
+ reclaimable: boolean;
526
+ reason: MemoryKeptCode | null;
527
+ detail: string | null;
528
+ }
529
+ type WatchmanRootStale = "missing" | "pruned-worktree";
530
+ interface WatchmanRoot {
531
+ path: string;
532
+ stale: WatchmanRootStale | null;
533
+ subscriptions: number | null;
534
+ triggers: number | null;
535
+ removable: boolean;
536
+ detail: string | null;
537
+ }
538
+ //#endregion
539
+ //#region src/commands/gc/report.d.ts
540
+ interface GcJsonLock {
541
+ path: string;
542
+ platform: string;
543
+ key: string | null;
544
+ pid: number | null;
545
+ projectRoot: string | null;
546
+ }
547
+ /** The `gc --json` sections, in text report order. Sections contain entries or a report-only usage payload. */
548
+ interface GcJsonSections {
549
+ archived?: ArchiveSelection["records"];
550
+ archiveStaging?: ArchiveSelection["staging"];
551
+ deadProjects: {
552
+ path: string;
553
+ }[];
554
+ invalidProjects: {
555
+ path: string;
556
+ }[];
557
+ orphanedPorts: {
558
+ project: string;
559
+ label: string;
560
+ port: number;
561
+ }[];
562
+ orphanedWorkspaces: {
563
+ dir: string;
564
+ projectRoot: string;
565
+ bytes: number | null;
566
+ }[];
567
+ linkedWorktrees: {
568
+ path: string;
569
+ idleDays: number | null;
570
+ mergedInto: string | null;
571
+ pullRequest: {
572
+ number: number;
573
+ state: "open" | "merged" | "closed";
574
+ url: string;
575
+ containsHead: boolean;
576
+ } | null;
577
+ pullRequestUnknown: string | null;
578
+ willRemove: boolean;
579
+ reason: WorktreeSkipCode | null;
580
+ detail: string;
581
+ eligibleAt: string | null;
582
+ buildState: WorktreeBuildState | null;
583
+ }[];
584
+ unlistedWorktreeDirectories: {
585
+ path: string;
586
+ repository: string;
587
+ bytes: number | null;
588
+ remedy: string;
589
+ }[];
590
+ parkedSimulators: ParkedSimReport[];
591
+ parkedEmulators: ParkedAvdReport[];
592
+ parkedHostedDevices: ParkedHostedDeviceReport[];
593
+ orphanedDevices: {
594
+ kind: "ios" | "android";
595
+ id: string;
596
+ name: string;
597
+ bytes: number | null;
598
+ directory: string | null;
599
+ }[];
600
+ unverifiedDevices: {
601
+ kind: "ios" | "android";
602
+ id: string;
603
+ name: string;
604
+ command: string;
605
+ }[];
606
+ staleDevices: {
607
+ kind: "ios" | "android";
608
+ id: string;
609
+ name: string;
610
+ project: string;
611
+ slot: string | null;
612
+ idleDays: number;
613
+ bytes: number | null;
614
+ }[];
615
+ finishedDevices: {
616
+ kind: "ios" | "android";
617
+ id: string;
618
+ name: string;
619
+ project: string;
620
+ slot: string | null;
621
+ bytes: number | null;
622
+ reason: string;
623
+ }[];
624
+ ownedDeviceDisk: OwnedDeviceDisk[];
625
+ staleDeviceRecords: {
626
+ kind: "ios" | "android";
627
+ id: string;
628
+ project: string;
629
+ slot: string | null;
630
+ }[];
631
+ staleLedgerEntries: {
632
+ kind: "ios" | "android" | "web";
633
+ id: string;
634
+ }[];
635
+ staleEasLedgerEntries: {
636
+ id: string;
637
+ workspaceRoot: string;
638
+ }[];
639
+ staleStatusCaches: {
640
+ kind: "disk-usage" | "pull-request";
641
+ path: string;
642
+ file: string;
643
+ bytes: number;
644
+ }[];
645
+ idleDevices: IdleDevice[];
646
+ orphanedEasSessions: {
647
+ id: string;
648
+ name: string;
649
+ platform: "ios" | "android";
650
+ status: string;
651
+ projectScope: string;
652
+ }[];
653
+ staleBuildLocks: GcJsonLock[];
654
+ staleBuildSlots: {
655
+ path: string;
656
+ index: number | null;
657
+ pid: number | null;
658
+ projectRoot: string | null;
659
+ }[];
660
+ unresolvedBuildClaims: {
661
+ kind: "lock" | "slot";
662
+ path: string;
663
+ }[];
664
+ buildsInProgress: GcJsonLock[];
665
+ expiredDeviceLeases: {
666
+ path: string;
667
+ platform: string;
668
+ id: string;
669
+ deviceName: string | null;
670
+ holder: string | null;
671
+ expiresAt: string | null;
672
+ }[];
673
+ keptDeviceLeases: {
674
+ name: string;
675
+ path: string;
676
+ detail: string;
677
+ }[];
678
+ deviceSweepNotices: {
679
+ message: string;
680
+ }[];
681
+ easSessionSweepNotices: {
682
+ message: string;
683
+ }[];
684
+ skipped: {
685
+ path: string;
686
+ detail: string;
687
+ }[];
688
+ workspaceLogs: {
689
+ dir: string;
690
+ projectRoot: string | null;
691
+ bytes: number;
692
+ trimBytes: number;
693
+ willTrim: boolean;
694
+ reason: WorkspaceLogsKeptCode | null;
695
+ detail: string | null;
696
+ }[];
697
+ recordings: {
698
+ dir: string;
699
+ projectRoot: string | null;
700
+ bytes: number;
701
+ deleteBytes: number;
702
+ willDelete: boolean;
703
+ withWorkspace: boolean;
704
+ reason: RecordingKeptCode | null;
705
+ detail: string | null;
706
+ }[];
707
+ workspaceBuildOutputs: {
708
+ dir: string;
709
+ projectRoot: string | null;
710
+ bytes: number | null;
711
+ idleDays: number | null;
712
+ willClear: boolean;
713
+ reason: WorkspaceKeptCode | null;
714
+ detail: string | null;
715
+ }[];
716
+ agentDevice: AgentDeviceUsage | null;
717
+ swiftpmCache: SwiftpmCacheUsage | null;
718
+ machineCaches: MachineCacheReport | null;
719
+ tempLeftovers: ReturnType<typeof tempLeftoverSection>;
720
+ gradleVersions: GradleVersionSweep | null;
721
+ caches: {
722
+ name: string;
723
+ dir: string;
724
+ source: "registered" | "detected" | null;
725
+ bytes: number | null;
726
+ note: string | null;
727
+ willEmpty: boolean;
728
+ emptySkipped: string | null;
729
+ scopedEmpty: {
730
+ willEmpty: boolean;
731
+ emptySkipped: string | null;
732
+ } | null;
733
+ }[];
734
+ memory: MemoryProcess[];
735
+ watchmanRoots: WatchmanRoot[];
736
+ memoryNotices: {
737
+ message: string;
738
+ }[];
739
+ }
740
+ //#endregion
741
+ //#region src/commands/gc/inventory.d.ts
742
+ /**
743
+ * Who a simulator or AVD belongs to: a workspace of this Stim home, this home's parked pool, this home
744
+ * with no workspace left, a `stim-*` device this home has no record of creating, or the user.
745
+ */
746
+ type InventoryOwner = "workspace" | "parked" | "orphaned" | "otherStimHome" | "user";
747
+ interface InventoryDevice {
748
+ kind: "ios" | "android";
749
+ id: string;
750
+ name: string;
751
+ model: string | null;
752
+ runtime: string | null;
753
+ state: string | null;
754
+ lastUsedAt: string | null;
755
+ bytes: number | null;
756
+ directory: string | null;
757
+ owner: InventoryOwner;
758
+ project: string | null;
759
+ slot: string | null;
760
+ }
761
+ interface InventoryRuntime {
762
+ identifier: string;
763
+ runtimeIdentifier: string | null;
764
+ version: string | null;
765
+ build: string | null;
766
+ bytes: number | null;
767
+ lastUsedAt: string | null;
768
+ deviceCount: number;
769
+ command: string | null;
770
+ }
771
+ interface InventorySystemImage {
772
+ package: string;
773
+ directory: string;
774
+ avdCount: number;
775
+ command: string;
776
+ }
777
+ interface GcInventory {
778
+ devices: InventoryDevice[];
779
+ runtimes: InventoryRuntime[];
780
+ systemImages: InventorySystemImage[];
781
+ notices: string[];
782
+ }
783
+ //#endregion
784
+ //#region src/commands/gc.d.ts
785
+ interface RunGcOptions {
786
+ idle?: number;
787
+ olderThan?: number;
788
+ cache?: string;
789
+ delete?: boolean;
790
+ worktrees?: boolean;
791
+ json?: boolean;
792
+ }
793
+ interface GcRefusal {
794
+ code: string;
795
+ message: string;
796
+ remedy: string;
797
+ }
798
+ type GcPayload = {
799
+ mode: "dry-run" | "delete";
800
+ idle: number | null;
801
+ cacheScope: string | null;
802
+ olderThan: number | null;
803
+ worktreeSweep: {
804
+ olderThan: number;
805
+ defaulted: boolean;
806
+ } | null;
807
+ actionable: boolean;
808
+ failures: number | null;
809
+ sections: GcJsonSections;
810
+ maintenance?: MaintenancePreview;
811
+ results: GcResult[];
812
+ inventory: GcInventory | null;
813
+ } | GcRefusal;
814
+ type GcReadOptions = Pick<RunGcOptions, "olderThan" | "cache" | "worktrees">;
815
+ //#endregion
816
+ //#region src/commands/reload.d.ts
817
+ type ReloadPlatform = WorkspaceLaunchPlatform | "web";
818
+ interface ReloadFacts {
819
+ platform: ReloadPlatform;
820
+ deviceId: string;
821
+ deviceName: string;
822
+ appId: string;
823
+ metroPort: number | null;
824
+ strategy: "metro-websocket" | "metro-broadcast" | "cdp";
825
+ targets: number | null;
826
+ reverseRestored: string[];
827
+ }
828
+ //#endregion
167
829
  //#region src/api/types.d.ts
168
830
  type StimPlatform = "ios" | "android" | "macos" | "web";
169
831
  interface StimProgress {
@@ -173,8 +835,10 @@ interface StimProgress {
173
835
  interface StimOptions {
174
836
  /** Absolute or relative path to the app directory, resolved once when creating the client. */
175
837
  projectRoot: string;
176
- /** Absolute Stim state directory. Omit to use the caller's STIM_HOME or the default home. */
838
+ /** Absolute Stim state directory. Omit to use STIM_HOME from `env` or the default home. */
177
839
  home?: string;
840
+ /** Environment Stim reads its settings overrides from and passes to its child processes. Defaults to the caller's `process.env`. */
841
+ env?: NodeJS.ProcessEnv;
178
842
  /** Absolute native artifact cache directory. Its coordinating home must be shared by all writers. */
179
843
  buildCache?: string;
180
844
  /**
@@ -257,6 +921,13 @@ interface StimStopOptions {
257
921
  signal?: AbortSignal;
258
922
  }
259
923
  type StimStopResult = StopResult;
924
+ interface StimReloadOptions {
925
+ platform?: ReloadPlatform;
926
+ signal?: AbortSignal;
927
+ /** Runs once with the resolved workspace before usage recording or a reload; throwing refuses the operation. */
928
+ beforeReload?: (workspace: string) => void;
929
+ }
930
+ type StimReloadResult = ReloadFacts;
260
931
  interface StimDiagnosticsOptions {
261
932
  /** Maximum number of records, default 200. Zero returns paths without records. */
262
933
  tail?: number;
@@ -267,8 +938,45 @@ interface StimDiagnostics {
267
938
  directory: string;
268
939
  records: NdjsonRecord[];
269
940
  }
941
+ interface StimLogsOptions {
942
+ slot?: string;
943
+ sources?: string[];
944
+ minLevel?: string;
945
+ since?: string;
946
+ grep?: string;
947
+ tail?: number;
948
+ errorsOnly?: boolean;
949
+ signal?: AbortSignal;
950
+ }
951
+ interface StimReadOptions {
952
+ signal?: AbortSignal;
953
+ }
954
+ interface StimDoctorOptions extends StimReadOptions {
955
+ platform?: "ios" | "android";
956
+ /** Records completed iOS/Android checks in project state. Defaults to false for report-only reads. */
957
+ record?: boolean;
958
+ }
959
+ type StimDoctorReport = DoctorReport;
960
+ type StimGcOptions = GcReadOptions & StimReadOptions;
961
+ type StimGcReport = Exclude<GcPayload, {
962
+ code: string;
963
+ }>;
964
+ type StimSettings = SettingsPayload;
965
+ type StimSettingWriteResult = SettingWriteResult;
966
+ interface StimSettingWriteOptions extends StimReadOptions {
967
+ scope?: SettingScope;
968
+ /** Runs once with the resolved workspace before mutation; throwing refuses the write. */
969
+ beforeWrite?: (workspace: string | null) => void;
970
+ }
971
+ type StimStats = StatsReport;
270
972
  interface StimClient {
271
973
  readonly projectRoot: string;
974
+ /** Returns this home's persistent nonsecret identity, initializing it under the config lock on first use. */
975
+ identity(options?: StimReadOptions): Promise<string>;
976
+ /** Reads findings with a 60 second execution and 35 second cleanup budget. Never repairs; records a completed check only with `record: true`. */
977
+ doctor(options?: StimDoctorOptions): Promise<StimDoctorReport>;
978
+ /** Reads the GC dry-run report with a 60 second execution and 35 second cleanup budget. Never deletes, repairs or shuts down idle resources. */
979
+ gc(options?: StimGcOptions): Promise<StimGcReport>;
272
980
  /** Builds an artifact without acquiring a device or starting a runtime. */
273
981
  build<P extends StimBuildOptions["platform"]>(options: StimBuildOptions & {
274
982
  platform: P;
@@ -284,8 +992,29 @@ interface StimClient {
284
992
  run(options: StimRunOptions): Promise<StimRunResult>;
285
993
  /** Stops this workspace, including resources created before a failed run. Use a fresh signal for cleanup. */
286
994
  stop(options?: StimStopOptions): Promise<StimStopResult>;
287
- /** Reads the existing local timeline; available even when run failed before creating any logs. */
995
+ /** Requests a JavaScript or owned Chrome reload. Completion is not observed; cancellation cannot undo a sent request. */
996
+ reload(options?: StimReloadOptions): Promise<StimReloadResult>;
997
+ /** Reads the existing local timeline in process; available even when run failed before creating any logs. */
288
998
  diagnostics(options?: StimDiagnosticsOptions): Promise<StimDiagnostics>;
999
+ /**
1000
+ * Every setting with its effective value, origin and per-layer values for this project, as `stim settings --json`
1001
+ * prints them. Runs in the calling process without blocking its event loop on child processes.
1002
+ */
1003
+ settings(options?: StimReadOptions): Promise<StimSettings>;
1004
+ /** Writes CLI text (including JSON for object/array settings) to one layer; returned sensitive values are masked. */
1005
+ setSetting(key: string, value: string, options?: StimSettingWriteOptions): Promise<StimSettingWriteResult>;
1006
+ /** Removes one layer value. Cancellation prevents a pending write; committed writes finish recording cleanup. */
1007
+ unsetSetting(key: string, options?: StimSettingWriteOptions): Promise<StimSettingWriteResult>;
1008
+ /**
1009
+ * Run and build-cache counts for this project and machine, build placement and the last recorded agent-device and
1010
+ * SwiftPM cache usage, as `stim stats --json` prints them except that the usage figures are not measured again.
1011
+ * Runs in the calling process without blocking its event loop on child processes.
1012
+ */
1013
+ stats(options?: StimReadOptions): Promise<StimStats>;
1014
+ /** Reads the merged raw log timeline, including native crashes and agent actions, as `stim logs --json`. */
1015
+ logs(options?: StimLogsOptions): Promise<NdjsonRecord[]>;
1016
+ /** Emits backfill, then appended records until stopped or aborted. With onBackfill, initial batches are awaited there instead. */
1017
+ followLogs(options: StimLogsOptions, onRecord: (record: NdjsonRecord) => void, onBackfill?: (records: readonly NdjsonRecord[]) => Promise<void>): Promise<() => void>;
289
1018
  }
290
1019
  interface StimFailure {
291
1020
  code: string;
@@ -305,8 +1034,11 @@ declare class StimError extends Error {
305
1034
  }
306
1035
  /**
307
1036
  * Creates a client without starting processes or changing the caller's cwd, environment, or signal handlers.
308
- * Each operation runs in a separate Stim worker. Resources remain workspace-owned until stop() is called.
1037
+ * The Stim home is fixed when the client is created: `home`, else STIM_HOME from `env`, else the default home.
1038
+ * Operations run in the calling process against the client's home and project, so clients for different
1039
+ * homes can share a process.
1040
+ * Resources remain workspace-owned until stop() is called.
309
1041
  */
310
1042
  declare function createStim(options: StimOptions): StimClient;
311
1043
  //#endregion
312
- export { type StimBuildOptions, type StimBuildResult, type StimClient, type StimDiagnostics, type StimDiagnosticsOptions, StimError, type StimOptions, type StimPlatform, type StimProgress, type StimRunOptions, type StimRunResult, type StimStopOptions, type StimStopResult, createStim };
1044
+ export { type StimBuildOptions, type StimBuildResult, type StimClient, type StimDiagnostics, type StimDiagnosticsOptions, type StimDoctorOptions, type StimDoctorReport, StimError, type StimGcOptions, type StimGcReport, type StimLogsOptions, type StimOptions, type StimPlatform, type StimProgress, type StimReadOptions, type StimReloadOptions, type StimReloadResult, type StimRunOptions, type StimRunResult, type StimSettingWriteOptions, type StimSettingWriteResult, type StimSettings, type StimStats, type StimStopOptions, type StimStopResult, createStim };