stim 1.26.0 → 1.28.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 (172) hide show
  1. package/dist/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-CKByBnTD.mjs} +2 -2
  2. package/dist/{act-C-BqJEpu.mjs → act-8iswyfRa.mjs} +319 -126
  3. package/dist/{activity-Lnb_EoRY.mjs → activity-DRMg4_mD.mjs} +6 -6
  4. package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-tE90fDdo.mjs} +5 -5
  5. package/dist/{android-CiNQw3kq.mjs → android-CHmSU4B4.mjs} +101 -45
  6. package/dist/{android-DTAcRwBC.mjs → android-CsPs-7Mg.mjs} +23 -18
  7. package/dist/{android-B5P81yI-.mjs → android-D577ApKG.mjs} +37 -15
  8. package/dist/{android-CSbLRD53.mjs → android-YWCbmkVK.mjs} +5 -5
  9. package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-_aDifWW0.mjs} +4 -4
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/api.d.mts +14 -4
  12. package/dist/api.mjs +39 -29
  13. package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-CQbwM0qO.mjs} +2 -2
  14. package/dist/{artifact-CsAP6AGK.mjs → artifact-DYtHjxsn.mjs} +19 -24
  15. package/dist/{artifact-BxREhAaV.mjs → artifact-bFkfD3vf.mjs} +18 -23
  16. package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
  17. package/dist/auto-placement-BVqs8AJi.mjs +350 -0
  18. package/dist/{browser-web-rYPyqhTf.mjs → browser-web-BUaLcafY.mjs} +16 -16
  19. package/dist/{build-DPhApsjV.mjs → build-cQURy_KW.mjs} +35 -31
  20. package/dist/{build-cache-DrXNCy3T.mjs → build-cache-CZULpXVl.mjs} +43 -21
  21. package/dist/{build-plan-DrMMdayj.mjs → build-plan-CxoYfxsc.mjs} +7 -6
  22. package/dist/{cache-manifest-BEZ9Bpl1.mjs → cache-manifest-DEjqGGat.mjs} +1 -1
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{budget-k2mZGvvk.mjs → ccache-Bm_A1xX9.mjs} +562 -1604
  25. package/dist/{cdp-BG3FJCCx.mjs → cdp-C3svvXiE.mjs} +1 -1
  26. package/dist/{chrome-BvV8ssI3.mjs → chrome-DyDWurWG.mjs} +1 -1
  27. package/dist/{cli-BBKFGOFl.mjs → cli-CpbaLDa7.mjs} +24 -23
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-D9CaRks-.mjs → client-YxCer6ab.mjs} +84 -65
  30. package/dist/collector-run.d.mts +10 -9
  31. package/dist/collector-run.mjs +42 -27
  32. package/dist/{command-output-BF5AR2dL.mjs → command-output-C8R1KIvi.mjs} +1 -1
  33. package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
  34. package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-DKeMzwXY.mjs} +108 -60
  35. package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-CojA2o0t.mjs} +14 -7
  36. package/dist/{detached-entry-KmieOKgN.mjs → detached-entry-BPlSaCwC.mjs} +1 -1
  37. package/dist/{dev-client-DXR_tPVY.mjs → dev-client-D-BW5uiq.mjs} +2 -2
  38. package/dist/{device-BK-zwyd_.mjs → device-CgXfbcz5.mjs} +25 -24
  39. package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-Cd8lMSn3.mjs} +175 -22
  40. package/dist/{device-BcYeHSFu.mjs → device-eeK95Lir.mjs} +16 -16
  41. package/dist/device-host-worker.mjs +22 -20
  42. package/dist/{device-ios-BLGfXQeK.mjs → device-ios-Cc9ulihb.mjs} +251 -23
  43. package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-Mtzp4THX.mjs} +5 -5
  44. package/dist/{device-pool-Dluix4H3.mjs → device-pool-eRz6DtCg.mjs} +3 -3
  45. package/dist/{doctor-Bhg1ii70.mjs → doctor-Bz_ouYAW.mjs} +28 -16
  46. package/dist/{doctor-Cp-BhzTS.mjs → doctor-C2QyhejJ.mjs} +1 -1
  47. package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
  48. package/dist/doctor-fingerprint.mjs +1 -1
  49. package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-BTW82PDC.mjs} +5 -5
  50. package/dist/{doctor-OnwP94ne.mjs → doctor-xf7ht-5n.mjs} +76 -32
  51. package/dist/{eas-build-Dsj93iM9.mjs → eas-build-Dm6q68QY.mjs} +4 -4
  52. package/dist/eas-fallback-DajNpxf-.mjs +87 -0
  53. package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-CBFo_Uo1.mjs} +37 -8
  54. package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-D1QfyJzQ.mjs} +51 -25
  55. package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
  56. package/dist/{gc-ldgr-hXU.mjs → gc-DM5oMm-J.mjs} +161 -45
  57. package/dist/{gc-C_79zvz4.mjs → gc-PLFwb0k4.mjs} +2 -2
  58. package/dist/{guide-D7K0X6KG.mjs → guide-C4I46XAk.mjs} +674 -213
  59. package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-DlaKLbW0.mjs} +6 -7
  60. package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-DDRm9hPJ.mjs} +51 -20
  61. package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-bSebOKbz.mjs} +8 -8
  62. package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-B0c53W_c.mjs} +5 -5
  63. package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B7-8Pv4H.mjs} +6 -6
  64. package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CDe33CSr.mjs} +22 -18
  65. package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-CQ0QwU9J.mjs} +7 -8
  66. package/dist/{ios-WxpDJ5T1.mjs → ios-B1DYuOjh.mjs} +27 -11
  67. package/dist/{ios-B7-lToDu.mjs → ios-B1HvafEG.mjs} +8 -8
  68. package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
  69. package/dist/{ios-device-CsyryvpT.mjs → ios-device-B4elVFKi.mjs} +3 -3
  70. package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
  71. package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-CR4mZ7CH.mjs} +22 -9
  72. package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
  73. package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BPHqMDdZ.mjs} +1 -1
  74. package/dist/{ios-ftxdQbJS.mjs → ios-tg4tp3q1.mjs} +94 -37
  75. package/dist/{js-swap-BMhXYVDS.mjs → js-swap-CVpSW1fn.mjs} +8 -7
  76. package/dist/{launch-DOp8RjDz.mjs → launch-DoySmhjz.mjs} +42 -38
  77. package/dist/lightened-DFAJgfIk.mjs +171 -0
  78. package/dist/{logs-s1dRIG1E.mjs → logs-BGsW7iPe.mjs} +46 -21
  79. package/dist/{logs-dQDki6Tt.mjs → logs-DI5ILkYB.mjs} +7 -7
  80. package/dist/{macos-DBBPNnIA.mjs → macos-Bo9st9Di.mjs} +73 -38
  81. package/dist/{macos-B0VEV3Gf.mjs → macos-C12RMJQF.mjs} +1 -1
  82. package/dist/macos-run.mjs +1 -1
  83. package/dist/maintenance-run.mjs +7 -7
  84. package/dist/{metro-CjC10t6E.mjs → metro-BnhXV2Mj.mjs} +4 -4
  85. package/dist/{metro-gateway-B6_PgD0L.mjs → metro-request-DXyKjVDF.mjs} +26 -47
  86. package/dist/{named-ports-BG0j1X4g.mjs → named-ports-Phoi2POD.mjs} +3 -3
  87. package/dist/{native-android-CL2NGiik.mjs → native-android-vxgtLD7w.mjs} +17 -18
  88. package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-BN96IVw8.mjs} +5 -5
  89. package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DG4Rodzj.mjs} +9 -8
  90. package/dist/{native-source-D-4Dh4JU.mjs → native-source-D1AzWiuP.mjs} +1 -1
  91. package/dist/{native-xcode-inputs-BW7H8JGu.mjs → native-xcode-inputs-BKarCoKg.mjs} +3 -3
  92. package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-8A-efGa5.mjs} +17 -17
  93. package/dist/{ndjson-CgE_o3Dl.mjs → ndjson-Dy2W4vRa.mjs} +2 -2
  94. package/dist/offload-worker.mjs +23 -24
  95. package/dist/{operation-exec-CUZifp6Z.mjs → operation-exec-Dp4FuIGR.mjs} +1 -1
  96. package/dist/{ownership-BjYvMNX_.mjs → ownership-DJCq48IJ.mjs} +3 -3
  97. package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
  98. package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-BzTa8g1F.mjs} +18 -4
  99. package/dist/{placement-log-DIFPQAXp.mjs → placement-log-Cvhta5ib.mjs} +3 -3
  100. package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-WkZdccuN.mjs} +36 -10
  101. package/dist/{ports-C2_w1Z0Z.mjs → ports-UV4mJgyC.mjs} +3 -3
  102. package/dist/{prebuild-gmouvmJZ.mjs → prebuild-k8d_tqOq.mjs} +16 -17
  103. package/dist/{project-BUu6Is4k.mjs → project-Sui52ywT.mjs} +17 -17
  104. package/dist/{pull-request-CbNlkFok.mjs → pull-request-BzLmzAIQ.mjs} +2 -2
  105. package/dist/pull-requests.mjs +1 -1
  106. package/dist/{react-native-android-Cgg99REN.mjs → react-native-android-DANlGGQf.mjs} +32 -26
  107. package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-jUHnIfZ9.mjs} +9 -9
  108. package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-DCWRjS7K.mjs} +6 -6
  109. package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-BwMsFMXi.mjs} +23 -17
  110. package/dist/{recordings-BldzVKq0.mjs → recordings-iy0mkm7b.mjs} +1 -1
  111. package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
  112. package/dist/{reload-C9OduiNc.mjs → reload-Bj7QyuDy.mjs} +1 -1
  113. package/dist/{reload-CCR7KC_l.mjs → reload-c_uEyc_X.mjs} +16 -16
  114. package/dist/{remote-C8S7FlPF.mjs → remote-DFlpAqdV.mjs} +23 -10
  115. package/dist/{result-7F5hEwQJ.mjs → result-BIcXREyC.mjs} +32 -21
  116. package/dist/{run-BqB0v3pt.mjs → run-y2HwyNvg.mjs} +3 -3
  117. package/dist/{selection-BNPBZ6T5.mjs → selection-CXgM_VK_.mjs} +37 -29
  118. package/dist/{server-bare-A75rDIdD.mjs → server-bare-2N4vSRZG.mjs} +2 -2
  119. package/dist/{server-command-CssKFOD7.mjs → server-command-qneHPcRI.mjs} +6 -6
  120. package/dist/{server-expo-eQfOdydb.mjs → server-expo-Ccm9zB0o.mjs} +4 -4
  121. package/dist/server-expo-WulkyAwT.mjs +2 -0
  122. package/dist/{settings-CosW5X-S.mjs → settings-CY5JZlNN.mjs} +375 -62
  123. package/dist/{settings-OaGQF-ri.mjs → settings-Cfd_Q6ys.mjs} +24 -3
  124. package/dist/settings-payload-DwQiEMCn.mjs +257 -0
  125. package/dist/settings-write-CJpjkeAd.mjs +185 -0
  126. package/dist/settings.schema.json +51 -33
  127. package/dist/{simslim-Bax1qcxu.mjs → simslim-DCQwzoPy.mjs} +2 -2
  128. package/dist/{slot-launch-CYCEhfBY.mjs → slot-launch-BpmanOnk.mjs} +6 -6
  129. package/dist/{stage-jKQ7CP_B.mjs → stage-CmugrSG5.mjs} +2 -2
  130. package/dist/{start-C_wefNKB.mjs → start-CHH3zgIU.mjs} +1 -1
  131. package/dist/{start-_BdJ32cZ.mjs → start-DYLk6GXn.mjs} +27 -22
  132. package/dist/{state-C1i2nMOP.mjs → state-B2QJbDwz.mjs} +4 -4
  133. package/dist/{state-C4OdpOTF.mjs → state-BXC1Lfxw.mjs} +2 -2
  134. package/dist/{stats-tEpEEH-u.mjs → stats-DxKqhcGp.mjs} +5 -5
  135. package/dist/{stats-report-n2U5plhk.mjs → stats-report-B86Cv7Uc.mjs} +1 -1
  136. package/dist/{status-CRXz-Gtj.mjs → status-7ULDEJ1e.mjs} +1 -1
  137. package/dist/{status-DQrqodLj.mjs → status-BHCkOZga.mjs} +51 -28
  138. package/dist/{status-B9M7x4CZ.mjs → status-D_Ljc89p.mjs} +1 -1
  139. package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BmsPqYSU.mjs} +18 -7
  140. package/dist/status-worker.mjs +1 -1
  141. package/dist/{stim-desktop-6Dqp-gjX.mjs → stim-desktop-CbWo21kb.mjs} +2 -2
  142. package/dist/{stop-DRqQVqDJ.mjs → stop-D-dGE9gh.mjs} +21 -20
  143. package/dist/{stop-ySNQHXMG.mjs → stop-DQvE-P76.mjs} +10 -6
  144. package/dist/{stop-CmdNhGlC.mjs → stop-b2pouxAO.mjs} +2 -2
  145. package/dist/supervisor-run.mjs +237 -63
  146. package/dist/{support-BGSCBoib.mjs → support-04IhBUTT.mjs} +6 -6
  147. package/dist/{support-CVOCp0Ft.mjs → support-BtlJKjyQ.mjs} +12 -11
  148. package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-Cj2UpmPN.mjs} +4 -4
  149. package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-BhF2stxY.mjs} +11 -12
  150. package/dist/{toolchain-J4J8MrAr.mjs → toolchain-mLA_km-b.mjs} +321 -15
  151. package/dist/{toolchain-DoavrvIA.mjs → toolchain-qktiV8xc.mjs} +1 -1
  152. package/dist/{trigger-KVaWWNyn.mjs → trigger-DMou-X7j.mjs} +2 -2
  153. package/dist/trigger-qp2ji5wE.mjs +2 -0
  154. package/dist/{warm-progress-DvhTX_eu.mjs → warm-progress-B0Vpuvpl.mjs} +731 -727
  155. package/dist/{web-Bihbf7-u.mjs → web-BYmK0TjL.mjs} +9 -9
  156. package/dist/web-CrVLVQZY.mjs +2 -0
  157. package/dist/web-run.mjs +9 -9
  158. package/dist/windows-report.mjs +1 -1
  159. package/dist/{workspace-state-pUg3_RRA.mjs → workspace-state-kIZrdlSg.mjs} +3 -3
  160. package/dist/{workspaces-g2lhdBXF.mjs → workspaces-CmOcceDN.mjs} +1879 -74
  161. package/dist/{worktree-BKuklFh_.mjs → worktree-2dk5edza.mjs} +933 -534
  162. package/dist/worktree-nliAoHxB.mjs +2 -0
  163. package/package.json +7 -7
  164. package/dist/ccache-Bx5TbxwG.mjs +0 -143
  165. package/dist/eas-fallback-FwkeqqGi.mjs +0 -381
  166. package/dist/hosted-ios-D55QhYaD.mjs +0 -15
  167. package/dist/native-run-BfIDFKLH.mjs +0 -275
  168. package/dist/server-expo-wvcj5tiZ.mjs +0 -2
  169. package/dist/settings-write-QjYfSrjF.mjs +0 -360
  170. package/dist/trigger-DzJu208Q.mjs +0 -2
  171. package/dist/web-BFLueSh-.mjs +0 -2
  172. package/dist/worktree-Bm4cb-nU.mjs +0 -2
@@ -0,0 +1,2 @@
1
+ import { a as nestedWorktrees, c as registerRemove, d as removalPath, f as removalRemedy, g as worktreeCommand, h as warmedWorkspace, i as excludeWatchmanCookies, l as registerWarm, m as warmWorktreeTarget, n as dependencyInstallCommand, o as porcelainPath, p as removeWorktreeTarget, r as excludePodChurn, s as reclaimKeys, t as customIosDirs, u as removalBlockers } from "./worktree-2dk5edza.mjs";
2
+ export { customIosDirs, worktreeCommand as default, dependencyInstallCommand, excludePodChurn, excludeWatchmanCookies, nestedWorktrees, porcelainPath, reclaimKeys, registerRemove, registerWarm, removalBlockers, removalPath, removalRemedy, removeWorktreeTarget, warmWorktreeTarget, warmedWorkspace };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stim",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "Stim: fast, isolated React Native environments for coding agents",
5
5
  "keywords": [
6
6
  "agent",
@@ -53,11 +53,11 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@expo/fingerprint": "^0.21.5",
56
- "@stim-cli/agent-driver": "1.26.0",
57
- "@stim-cli/agent-driver-agent-device": "1.26.0",
58
- "@stim-cli/cache": "1.26.0",
59
- "@stim-cli/core": "1.26.0",
60
- "@stim-cli/metro": "1.26.0",
56
+ "@stim-cli/agent-driver": "1.28.0",
57
+ "@stim-cli/agent-driver-agent-device": "1.28.0",
58
+ "@stim-cli/cache": "1.28.0",
59
+ "@stim-cli/core": "1.28.0",
60
+ "@stim-cli/metro": "1.28.0",
61
61
  "@xmldom/xmldom": "0.9.12",
62
62
  "chalk": "^6.0.0",
63
63
  "commander": "^15.0.0",
@@ -66,7 +66,7 @@
66
66
  "ws": "^8.21.3"
67
67
  },
68
68
  "devDependencies": {
69
- "@stim-cli/expo-build-cache": "1.26.0",
69
+ "@stim-cli/expo-build-cache": "1.28.0",
70
70
  "@types/cross-spawn": "^6.0.6",
71
71
  "@types/which": "^3.0.4",
72
72
  "@types/ws": "^8.18.1",
@@ -1,143 +0,0 @@
1
- import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { b as sharedCcache, k as workspaceLogsDir } from "./workspace-state-pUg3_RRA.mjs";
3
- import { _ as loadConfig } from "./config-BktkY_zC.mjs";
4
- import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
5
- import { m as defaultAndroidLayout } from "./settings-CosW5X-S.mjs";
6
- import { r as register } from "./cache-manifest-BEZ9Bpl1.mjs";
7
- import { o as machineNumber } from "./budget-k2mZGvvk.mjs";
8
- import { readFileSync, realpathSync } from "node:fs";
9
- import { isAbsolute, join, relative } from "node:path";
10
- import chalk from "chalk";
11
- const CCACHE_SLOPPINESS = "pch_defines,time_macros";
12
- const STATS_LOG_FILE = "ccache-stats.log";
13
- const CCACHE_UNAVAILABLE = {
14
- status: "unavailable",
15
- hits: null,
16
- misses: null,
17
- hitRatePercent: null
18
- };
19
- const CCACHE_NOT_RUN = {
20
- status: "not-run",
21
- hits: null,
22
- misses: null,
23
- hitRatePercent: null
24
- };
25
- function ccacheStatsLog(root) {
26
- return join(workspaceLogsDir(root), STATS_LOG_FILE);
27
- }
28
- function ccacheMaxSize(config = loadConfig(), env = process.env) {
29
- const { value, error } = machineNumber("caches.ccacheMaxGb", config, env);
30
- return error || value === void 0 ? "5G" : `${value}G`;
31
- }
32
- function ccacheEnvironment({ binary, dir, workspaceRoot, statsLog, maxSize = "5G" }) {
33
- return {
34
- CMAKE_C_COMPILER_LAUNCHER: binary,
35
- CMAKE_CXX_COMPILER_LAUNCHER: binary,
36
- CCACHE_DIR: dir,
37
- CCACHE_BASEDIR: workspaceRoot,
38
- CCACHE_NOHASHDIR: "true",
39
- CCACHE_SLOPPINESS,
40
- CCACHE_MAXSIZE: maxSize,
41
- CCACHE_STATSLOG: statsLog
42
- };
43
- }
44
- function parseCcacheBinary(output) {
45
- const first = String(output ?? "").split("\n")[0]?.trim();
46
- if (!first || !isAbsolute(first)) return null;
47
- return first;
48
- }
49
- const CMAKE_LAUNCHER = /CMAKE_(C|CXX)_COMPILER_LAUNCHER\b/;
50
- function projectCmakeLauncher(source) {
51
- if (typeof source !== "string") return null;
52
- const match = CMAKE_LAUNCHER.exec(source);
53
- return match ? `CMAKE_${match[1]}_COMPILER_LAUNCHER` : null;
54
- }
55
- const HIT_COUNTERS = /* @__PURE__ */ new Set(["direct_cache_hit", "preprocessed_cache_hit"]);
56
- function parseCcacheStatsLog(text) {
57
- if (typeof text !== "string") return null;
58
- let hits = 0;
59
- let misses = 0;
60
- for (const raw of text.split("\n")) {
61
- const line = raw.trim();
62
- if (HIT_COUNTERS.has(line)) hits += 1;
63
- else if (line === "cache_miss") misses += 1;
64
- }
65
- const total = hits + misses;
66
- if (total === 0) return null;
67
- return {
68
- status: "reported",
69
- hits,
70
- misses,
71
- hitRatePercent: Math.round(hits / total * 1e3) / 10
72
- };
73
- }
74
- function readCcacheActivity(statsLog) {
75
- let text;
76
- try {
77
- text = readFileSync(statsLog, "utf-8");
78
- } catch {
79
- return CCACHE_UNAVAILABLE;
80
- }
81
- return parseCcacheStatsLog(text) ?? CCACHE_UNAVAILABLE;
82
- }
83
- function ccacheActivityLine(activity) {
84
- if (activity.status === "reported") return `${activity.hits} hits / ${activity.misses} misses (${activity.hitRatePercent}%)`;
85
- if (activity.status === "not-run") return "not run; artifact cache supplied the app";
86
- return "unavailable; no C++ compile went through ccache";
87
- }
88
- function lookupCcache() {
89
- try {
90
- return parseCcacheBinary(getExecutor().findExecutable("ccache"));
91
- } catch {
92
- return null;
93
- }
94
- }
95
- function readOrNull(file) {
96
- try {
97
- return readFileSync(file, "utf-8");
98
- } catch {
99
- return null;
100
- }
101
- }
102
- function canonical(root) {
103
- try {
104
- return realpathSync(root);
105
- } catch {
106
- return root;
107
- }
108
- }
109
- function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = sharedCcache(), lookup = lookupCcache, env = process.env, onNote = (line) => console.error(line) }) {
110
- const binary = lookup();
111
- if (!binary) {
112
- onNote(chalk.dim(phaseLine("cache", "ccache off (not installed; brew install ccache)")));
113
- return null;
114
- }
115
- const { moduleDir } = layout;
116
- const declared = projectCmakeLauncher(readOrNull(join(moduleDir, "build.gradle")) ?? readOrNull(join(moduleDir, "build.gradle.kts")));
117
- if (declared) {
118
- onNote(chalk.dim(phaseLine("cache", `ccache off (${join(relative(root, moduleDir), "build.gradle")} sets ${declared} itself)`)));
119
- return null;
120
- }
121
- const statsLog = ccacheStatsLog(root);
122
- register({
123
- dir,
124
- registeredBy: root,
125
- name: "ccache",
126
- prune: "atomic",
127
- note: "ccache keeps itself under CCACHE_MAXSIZE, so it is emptied whole or not at all"
128
- });
129
- onNote(chalk.dim(phaseLine("cache", `ccache on (${dir})`)));
130
- return {
131
- dir,
132
- statsLog,
133
- env: ccacheEnvironment({
134
- binary,
135
- dir,
136
- workspaceRoot: canonical(root),
137
- statsLog,
138
- maxSize: ccacheMaxSize(loadConfig(), env)
139
- })
140
- };
141
- }
142
- //#endregion
143
- export { readCcacheActivity as a, projectCmakeLauncher as i, CCACHE_UNAVAILABLE as n, resolveCcache as o, ccacheActivityLine as r, CCACHE_NOT_RUN as t };
@@ -1,381 +0,0 @@
1
- import { c as throwIfCancelled, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { _ as loadConfig$1, p as getProject } from "./config-BktkY_zC.mjs";
3
- import { r as childEnvironment } from "./operation-exec-CUZifp6Z.mjs";
4
- import { lt as detectProviders, ut as planMetroReach } from "./settings-CosW5X-S.mjs";
5
- import { M as readMetroTunnel, P as readRemoteSession } from "./project-BUu6Is4k.mjs";
6
- import { Jt as readInstalledEasCliVersionAsync, Yn as isEasAuthFailureText, ar as remoteCommand, cr as easCliSupport, er as resolveEasCliBin, or as MIN_EAS_CLI_DEVICE_VERSION, s as peekBudget, sr as MIN_EAS_CLI_SIMULATOR_VERSION } from "./budget-k2mZGvvk.mjs";
7
- import { R as readHostMemoryPressureAsync } from "./ios-WxpDJ5T1.mjs";
8
- import { c as resolveBuildMachine, h as hostingMachines, i as namedBuildMachine } from "./selection-BNPBZ6T5.mjs";
9
- import { c as call, l as connectHost, p as requireHostedAppMode } from "./hosted-client-fHO8yqzc.mjs";
10
- import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-Cw7-WQf2.mjs";
11
- import { i as prepareHostedNative } from "./hosted-native-CpDB3-PO.mjs";
12
- import { c as peekDeviceSlots } from "./device-capacity-DCSvUF0l.mjs";
13
- import { ambientEnv } from "@stim-cli/core";
14
- import { automaticMachineEnabled, isJsonObject, machineCapacity, parseHostedChoice, parseHostedNativeOffer } from "@stim-cli/core/state";
15
- //#region src/device-host/placement.ts
16
- function local$1(code, reason, skipped = [], atCapacity = false) {
17
- return {
18
- kind: "local",
19
- code,
20
- reason,
21
- skipped,
22
- ...atCapacity ? { atCapacity: true } : {}
23
- };
24
- }
25
- function decideDevicePlacement(inputs) {
26
- if ("sticky" in inputs) {
27
- if ("machine" in inputs.sticky) {
28
- const reason = `recorded session on ${inputs.sticky.machine}`;
29
- return {
30
- kind: "host",
31
- code: "sticky",
32
- reason,
33
- machines: [{
34
- machine: inputs.sticky.machine,
35
- reason
36
- }],
37
- skipped: []
38
- };
39
- }
40
- return {
41
- kind: "local",
42
- code: "sticky",
43
- reason: "this workspace's device runs here",
44
- skipped: []
45
- };
46
- }
47
- const { platform, here, offers, buildMachine, noWait, eas } = inputs;
48
- const { count, max, queued } = here.devices;
49
- const room = max === 0 || count !== null && count < max;
50
- const localEnabled = here.localEnabled !== false;
51
- const cannotTake = !localEnabled || !room || queued > 0;
52
- const atCapacity = count !== null && (!room || queued > 0);
53
- const usage = max > 0 ? `${count} of ${max} devices in use` : `${count} devices in use, no device cap`;
54
- const localReason = !localEnabled ? "local is disabled in remote.devicePoolDisabled" : count === null ? "cannot tell how many devices run here; local boot admission decides" : cannotTake ? `${usage}${queued ? `, ${queued} runs queued ahead` : ""}` : here.budgetRefusal ?? (here.memoryPressure !== "normal" ? `host memory pressure ${here.memoryPressure ?? "unknown"} here` : `load ${here.loadPerCore.toFixed(1)}/core here, ${usage}`);
55
- const nowhere = (code, reason, skipped = [], waiting = "") => {
56
- if (!localEnabled && !atCapacity) return {
57
- kind: "refused",
58
- code: "pool-unavailable",
59
- reason,
60
- skipped
61
- };
62
- if (!cannotTake || count === null) return local$1(code, reason + waiting, skipped);
63
- if (eas?.usable) return {
64
- kind: "eas",
65
- code: "eas-fallback",
66
- reason: `${reason}; EAS Simulator (remote.easFallback)`,
67
- skipped
68
- };
69
- const why = eas ? [...skipped, {
70
- machine: "eas",
71
- code: eas.code,
72
- reason: eas.reason
73
- }] : skipped;
74
- return localEnabled ? local$1(code, reason + waiting, why, true) : {
75
- kind: "refused",
76
- code: "pool-unavailable",
77
- reason,
78
- skipped: why,
79
- atCapacity: true
80
- };
81
- };
82
- if (!offers.length) return nowhere("no-remote-mac", "no remote machines configured; " + localReason);
83
- if (localEnabled && count === null) return local$1("device-count-unknown", localReason);
84
- if (!cannotTake && here.memoryPressure === "normal" && !here.budgetRefusal && here.loadPerCore < here.maxLoadPerCore) return local$1("this-mac-free", localReason);
85
- const skipped = [];
86
- const admitted = [];
87
- offers.forEach((probe, index) => {
88
- let reason = null;
89
- let code = "unreachable";
90
- if ("failure" in probe) reason = probe.failure;
91
- else {
92
- const { offer } = probe;
93
- if (offer.declined !== null) [code, reason] = ["declined", `declined: ${offer.declined}`];
94
- else if (offer.platform !== platform || !offer.choice) [code, reason] = ["no-matching-device", `no matching ${platform} device choice`];
95
- else if (offer.resources.memoryPressure !== "normal") [code, reason] = ["memory", "host memory pressure unknown or elevated"];
96
- else if (offer.capacity.available === 0) [code, reason] = ["no-capacity", "no hosted device capacity available"];
97
- else if (!cannotTake && (offer.resources.loadPerCore === null || offer.resources.loadPerCore >= here.loadPerCore)) [code, reason] = ["load", offer.resources.loadPerCore === null ? "host load unknown while this machine has room" : "host is not less loaded than this machine"];
98
- else admitted.push({
99
- machine: probe.machine,
100
- offer,
101
- index
102
- });
103
- }
104
- if (reason) skipped.push({
105
- machine: probe.machine,
106
- code,
107
- reason
108
- });
109
- });
110
- admitted.sort((a, b) => Number(b.machine === buildMachine) - Number(a.machine === buildMachine) || (a.offer.resources.loadPerCore ?? Infinity) - (b.offer.resources.loadPerCore ?? Infinity) || b.offer.resources.memoryFreeBytes - a.offer.resources.memoryFreeBytes || a.index - b.index);
111
- if (!admitted.length) return nowhere("no-host-admits", `${localReason}; no host admits`, skipped, localEnabled && cannotTake && !noWait ? "; waiting locally if needed" : "");
112
- const machines = admitted.map(({ machine, offer }) => ({
113
- machine,
114
- reason: `${localReason}; ${machine}${machine === buildMachine ? " is the explicit remote machine," : ""} load ${offer.resources.loadPerCore === null ? "unknown" : offer.resources.loadPerCore.toFixed(1) + "/core"}`
115
- }));
116
- return {
117
- kind: "host",
118
- code: "placed",
119
- machines,
120
- reason: machines[0].reason,
121
- skipped
122
- };
123
- }
124
- //#endregion
125
- //#region src/device-host/auto-placement.ts
126
- async function probeHost(machine, platform, selectors, appMode, signal) {
127
- let host;
128
- const deadline = Date.now() + 3e3;
129
- const cancel = () => host?.connection.close();
130
- try {
131
- host = await connectHost(machine, 3e3, true, signal);
132
- signal?.addEventListener("abort", cancel, { once: true });
133
- signal?.throwIfAborted();
134
- requireHostedAppMode(host, platform, appMode);
135
- const offer = await call(host, "device-host.offer", {
136
- platform,
137
- ...selectors
138
- }, Math.max(1, deadline - Date.now()));
139
- signal?.throwIfAborted();
140
- const resources = isJsonObject(offer.resources) ? offer.resources : {};
141
- const parsed = parseHostedNativeOffer({
142
- ...offer,
143
- resources: {
144
- ...resources,
145
- loadPerCore: resources.loadPerCore ?? 0
146
- }
147
- });
148
- let choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsed?.platform === "android" ? parsed.choice : null;
149
- if (choice && ("runtime" in choice ? selectors.deviceType && selectors.deviceType !== choice.deviceType || selectors.runtime && selectors.runtime.replace(/^iOS /, "") !== choice.runtime.replace(/^iOS /, "") : selectors.systemImage && selectors.systemImage !== choice.systemImage || selectors.deviceProfile && selectors.deviceProfile !== choice.deviceProfile)) choice = null;
150
- if (!isJsonObject(offer.capacity) || offer.declined !== null && typeof offer.declined !== "string") throw new Error("unreadable device offer");
151
- return {
152
- probe: {
153
- machine,
154
- offer: {
155
- platform,
156
- choice,
157
- declined: offer.declined,
158
- capacity: { available: typeof offer.capacity.available === "number" ? offer.capacity.available : null },
159
- resources: {
160
- loadPerCore: typeof resources.loadPerCore === "number" && Number.isFinite(resources.loadPerCore) && resources.loadPerCore >= 0 ? resources.loadPerCore : null,
161
- memoryFreeBytes: typeof resources.memoryFreeBytes === "number" ? resources.memoryFreeBytes : 0,
162
- memoryPressure: typeof resources.memoryPressure === "string" ? resources.memoryPressure : null
163
- }
164
- }
165
- },
166
- ...choice ? { target: {
167
- host,
168
- choice,
169
- session: null
170
- } } : {}
171
- };
172
- } catch (error) {
173
- signal?.throwIfAborted();
174
- return { probe: {
175
- machine,
176
- failure: error instanceof Error ? error.message : String(error)
177
- } };
178
- } finally {
179
- signal?.removeEventListener("abort", cancel);
180
- host?.connection.close();
181
- }
182
- }
183
- function hosted(target, code, reason, skipped = []) {
184
- target.selection = {
185
- selected: "auto",
186
- reason
187
- };
188
- return {
189
- target,
190
- placement: {
191
- decision: "hosted",
192
- machine: target.host.machine,
193
- reason
194
- },
195
- code,
196
- skipped
197
- };
198
- }
199
- function local(code, reason, skipped = []) {
200
- return {
201
- target: null,
202
- placement: {
203
- decision: "local",
204
- reason
205
- },
206
- code,
207
- skipped
208
- };
209
- }
210
- function viaEas(code, reason, skipped) {
211
- return {
212
- target: null,
213
- placement: {
214
- decision: "eas",
215
- machine: "eas",
216
- reason
217
- },
218
- code,
219
- skipped
220
- };
221
- }
222
- async function automaticDevicePlacement({ root, slot, platform, selectors, appMode, buildMachine, noWait, eas, signal, localSims }, { machines = () => hostingMachines(void 0, signal), read = readHostedNative, write = writeHostedNativeAsync, resume = prepareHostedNative, peek = () => peekDeviceSlots({
223
- platform,
224
- project: getProject(root),
225
- slot,
226
- ...localSims ? { sources: { sims: localSims } } : {}
227
- }), capacity = machineCapacity, memory = () => readHostMemoryPressureAsync(void 0, void 0, signal), probe = probeHost, budget = (projectRoot) => peekBudget(projectRoot, {}, ambientEnv(), signal) } = {}) {
228
- const recorded = read(root, platform, slot)[slot];
229
- if (recorded) {
230
- const target = await resume(recorded.machine, selectors, recorded, platform, true, appMode);
231
- if (target) return {
232
- target,
233
- placement: {
234
- decision: "hosted",
235
- machine: recorded.machine,
236
- reason: recorded.reason ?? decideDevicePlacement({ sticky: { machine: recorded.machine } }).reason
237
- },
238
- code: "sticky",
239
- skipped: [],
240
- sticky: true
241
- };
242
- await write(root, slot, null, platform);
243
- }
244
- const devices = peek();
245
- if (devices.localLive) return {
246
- ...local("sticky", decideDevicePlacement({ sticky: { local: true } }).reason),
247
- sticky: true
248
- };
249
- const configured = await machines();
250
- signal?.throwIfAborted();
251
- if (configured === null) throw Object.assign(/* @__PURE__ */ new Error("remote.machines is invalid. Run stim guide settings and correct it."), { code: "STIM_HOSTING_REFUSED" });
252
- const config = loadConfig$1();
253
- const entries = configured.filter((machine) => automaticMachineEnabled("device", machine, config));
254
- const preference = resolveBuildMachine(buildMachine, ambientEnv().STIM_REMOTE_BUILD, config?.remote?.build);
255
- buildMachine = namedBuildMachine(preference) ? preference : void 0;
256
- const load = capacity();
257
- const here = {
258
- localEnabled: automaticMachineEnabled("device", "local", config),
259
- loadPerCore: load.loadPerCore,
260
- maxLoadPerCore: load.maxLoadPerCore,
261
- memoryPressure: await memory(),
262
- devices,
263
- budgetRefusal: await budget(root)
264
- };
265
- signal?.throwIfAborted();
266
- const inputs = (offers) => ({
267
- platform,
268
- here,
269
- offers,
270
- buildMachine,
271
- noWait
272
- });
273
- const notProbed = entries.map((machine) => ({
274
- machine,
275
- failure: "not probed"
276
- }));
277
- const early = decideDevicePlacement(inputs(notProbed));
278
- const probes = early.kind === "local" && early.skipped.length === 0 ? [] : await Promise.all(entries.map((machine) => probe(machine, platform, selectors, appMode, signal)));
279
- const offers = probes.length ? probes.map((each) => each.probe) : notProbed;
280
- let decision = decideDevicePlacement(inputs(offers));
281
- if ((decision.kind === "local" || decision.kind === "refused") && decision.atCapacity && eas) decision = decideDevicePlacement({
282
- ...inputs(offers),
283
- eas: await eas()
284
- });
285
- if (decision.kind === "refused") throw Object.assign(new Error(devicePlacementLine({
286
- decision: "local",
287
- reason: decision.reason
288
- }, decision.skipped)), {
289
- code: "STIM_HOSTING_REFUSED",
290
- remedy: "Enable an available member in remote.devicePoolDisabled or select a machine explicitly."
291
- });
292
- if (decision.kind === "eas") return viaEas(decision.code, decision.reason, decision.skipped);
293
- if (decision.kind === "local") return local(decision.code, decision.reason, decision.skipped);
294
- const target = probes.find((each) => each.probe.machine === decision.machines[0].machine).target;
295
- return hosted(target, decision.code, decision.reason, decision.skipped);
296
- }
297
- function devicePlacementLine(placement, skipped) {
298
- return `${placement.machine ?? "local"}, ${placement.reason}${placement.decision !== "hosted" && skipped.length ? "; " + skipped.map((each) => `${each.machine}: ${each.reason}`).join("; ") : ""}`;
299
- }
300
- //#endregion
301
- //#region src/engine/eas-fallback.ts
302
- const AVAILABILITY_TIMEOUT_MS = 3e4;
303
- function unusable(code, reason) {
304
- return {
305
- usable: false,
306
- code,
307
- reason
308
- };
309
- }
310
- /** Reads `eas simulator:availability --json`: `{"available": true, ...}` on stdout, or a failure on stderr. */
311
- function parseSimulatorAvailability(outcome) {
312
- if ("failure" in outcome) {
313
- if (outcome.timedOut) return unusable("eas-unavailable", "eas simulator:availability timed out");
314
- const detail = outcome.failure.split("\n").map((line) => line.trim()).find((line) => line && !/is now available\.$|^(To upgrade|npm install|Proceeding with|\(node:|\(Use `node)/.test(line));
315
- if (isEasAuthFailureText(outcome.failure)) return unusable("eas-logged-out", "eas-cli is not logged in (run eas login or set EXPO_TOKEN)");
316
- return unusable("eas-unavailable", `eas simulator:availability failed${detail ? `: ${detail}` : ""}`);
317
- }
318
- let data = null;
319
- try {
320
- data = JSON.parse(outcome.stdout.slice(outcome.stdout.indexOf("{")));
321
- } catch {}
322
- if (typeof data !== "object" || data === null || typeof data.available !== "boolean") return unusable("eas-unavailable", "eas simulator:availability printed no availability");
323
- return data.available ? { usable: true } : unusable("eas-not-enabled", "EAS Simulator is not enabled for this EAS account");
324
- }
325
- /**
326
- * Whether this run could use an EAS Simulator the way `--remote eas` does, without starting a session or a build.
327
- * Each refusal names what `--remote eas` would refuse later, so automatic placement falls through instead.
328
- */
329
- async function checkEasFallback({ root, platform, slot, release, isExpo, tunnelMode, publicUrl, deviceTypeFlag, localOnlyFlags, env = process.env, resolveBin = resolveEasCliBin, readVersion = readInstalledEasCliVersionAsync, operation, onPath = (bin) => getExecutor().findExecutable(bin) !== null, readTunnel = readMetroTunnel, readSession = readRemoteSession, metroPort = () => getProject(root)?.metroPort ?? null, availability = async (bin) => {
330
- try {
331
- return { stdout: await remoteCommand({
332
- operation,
333
- easBin: bin
334
- }, bin, [
335
- "simulator:availability",
336
- "--json",
337
- "--non-interactive"
338
- ], {
339
- cwd: root,
340
- ...childEnvironment(env),
341
- timeoutMs: AVAILABILITY_TIMEOUT_MS
342
- }) };
343
- } catch (error) {
344
- const err = error;
345
- return {
346
- failure: String(err.stderr || err.message || error),
347
- timedOut: err.code === "ETIMEDOUT"
348
- };
349
- }
350
- } }) {
351
- if (slot !== "default") return unusable("eas-named-slot", `an EAS Simulator takes only the default slot, not ${slot}`);
352
- if (localOnlyFlags.length) return unusable("eas-local-flags", `${localOnlyFlags.join(" and ")} applies only to a ${platform} device on a Mac`);
353
- const session = readSession(root);
354
- if (session && session.platform !== platform) return unusable("eas-session-busy", `this workspace's EAS Simulator session ${session.sessionId} runs ${session.platform ?? "another platform"}`);
355
- if (session && deviceTypeFlag?.trim() && session.deviceType !== deviceTypeFlag.trim()) return unusable("eas-session-busy", `this workspace's EAS Simulator session ${session.sessionId} runs ${session.deviceType ?? "the model EAS chose"}, not ${deviceTypeFlag.trim()}`);
356
- if (!onPath("agent-device")) return unusable("eas-no-agent-device", "agent-device is not on PATH");
357
- throwIfCancelled(operation?.signal, "EAS availability");
358
- const bin = resolveBin(root);
359
- if (!bin) return unusable("eas-no-cli", "eas-cli is not installed for this project or on PATH");
360
- const versionOutput = await readVersion(bin.file, root, operation);
361
- const minimum = platform === "ios" && deviceTypeFlag?.trim() ? MIN_EAS_CLI_DEVICE_VERSION : MIN_EAS_CLI_SIMULATOR_VERSION;
362
- const { supported, version } = easCliSupport(versionOutput, minimum);
363
- if (!supported) return unusable("eas-cli-too-old", `eas-cli ${version ?? "(unknown version)"} is older than ${minimum}`);
364
- if (!release) {
365
- const mode = tunnelMode ?? "auto";
366
- if (mode === "off") return unusable("eas-metro-unreachable", "metro.tunnel is off, so an EAS Simulator cannot reach Metro");
367
- const plan = planMetroReach({
368
- mode,
369
- metroPort: metroPort() ?? "unknown",
370
- publicUrl: env["STIM_METRO_PUBLIC_URL"]?.trim() || publicUrl,
371
- isExpo,
372
- available: detectProviders(onPath, mode)
373
- });
374
- if ("failed" in plan) return unusable("eas-metro-unreachable", plan.failed);
375
- if ("start" in plan && plan.start === "tailscale") return unusable("eas-metro-unreachable", "metro.tunnel is tailscale, which an EAS Simulator cannot reach");
376
- if ("expoTunnel" in plan && readTunnel(root)?.kind !== "expo") return unusable("eas-metro-unreachable", "Metro has no Expo tunnel; run stim start --remote first");
377
- }
378
- return parseSimulatorAvailability(await availability(bin.file));
379
- }
380
- //#endregion
381
- export { probeHost as i, automaticDevicePlacement as n, devicePlacementLine as r, checkEasFallback as t };
@@ -1,15 +0,0 @@
1
- import { a as stopHostedNative, i as prepareHostedNative, r as placeHostedNative } from "./hosted-native-CpDB3-PO.mjs";
2
- //#region src/device-host/hosted-ios.ts
3
- async function prepareHostedIos(machine, selectors, recorded, mode) {
4
- return await prepareHostedNative(machine, selectors, recorded, "ios", false, mode);
5
- }
6
- async function placeHostedIos(target, options) {
7
- return await placeHostedNative(target, {
8
- ...options,
9
- platform: "ios",
10
- reserved: (placement) => options.reserved(placement)
11
- });
12
- }
13
- const stopHostedIos = stopHostedNative;
14
- //#endregion
15
- export { prepareHostedIos as n, stopHostedIos as r, placeHostedIos as t };