stim 1.26.0 → 1.27.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 (171) hide show
  1. package/dist/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-BKN2Yuhg.mjs} +2 -2
  2. package/dist/{act-C-BqJEpu.mjs → act-ROviTF_t.mjs} +297 -122
  3. package/dist/{activity-Lnb_EoRY.mjs → activity-Cd-ysFes.mjs} +6 -6
  4. package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-C5nCKWp9.mjs} +5 -5
  5. package/dist/{android-CSbLRD53.mjs → android--HBgpvpW.mjs} +5 -5
  6. package/dist/{android-CiNQw3kq.mjs → android-Cd6w7_qw.mjs} +96 -43
  7. package/dist/{android-B5P81yI-.mjs → android-Deb9X3_Y.mjs} +37 -15
  8. package/dist/{android-DTAcRwBC.mjs → android-DriNoAVy.mjs} +23 -18
  9. package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-D5e6ecUg.mjs} +4 -4
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/api.d.mts +13 -3
  12. package/dist/api.mjs +39 -29
  13. package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-BHQHx3Rm.mjs} +2 -2
  14. package/dist/{artifact-BxREhAaV.mjs → artifact-0AGJYB9O.mjs} +18 -23
  15. package/dist/{artifact-CsAP6AGK.mjs → artifact-faemIZv5.mjs} +19 -24
  16. package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
  17. package/dist/auto-placement-z-H5pJza.mjs +350 -0
  18. package/dist/{browser-web-rYPyqhTf.mjs → browser-web-slD8AvLp.mjs} +16 -16
  19. package/dist/{build-cache-DrXNCy3T.mjs → build-cache-gBJ-WKzA.mjs} +43 -21
  20. package/dist/{build-DPhApsjV.mjs → build-hS0QyFlQ.mjs} +35 -31
  21. package/dist/{build-plan-DrMMdayj.mjs → build-plan-CBqYbzYM.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-BWTze1Ls.mjs} +560 -1603
  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-ftXDLto1.mjs} +24 -23
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-D9CaRks-.mjs → client-xsdxrhWA.mjs} +48 -62
  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-Dj-WT4BP.mjs} +1 -1
  33. package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
  34. package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-BGokZ-Ng.mjs} +108 -60
  35. package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-C3OtgG94.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-BMca82xo.mjs} +2 -2
  38. package/dist/{device-BcYeHSFu.mjs → device-BJm0irrq.mjs} +16 -16
  39. package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-6LP7QsaA.mjs} +101 -16
  40. package/dist/device-host-worker.mjs +19 -19
  41. package/dist/{device-ios-BLGfXQeK.mjs → device-ios-534c14fz.mjs} +251 -23
  42. package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-DwsGfjUN.mjs} +5 -5
  43. package/dist/{device-pool-Dluix4H3.mjs → device-pool-BnQqvs6o.mjs} +3 -3
  44. package/dist/{device-BK-zwyd_.mjs → device-tM41-TUq.mjs} +25 -24
  45. package/dist/{doctor-Cp-BhzTS.mjs → doctor-Dbx1ZpD2.mjs} +1 -1
  46. package/dist/{doctor-Bhg1ii70.mjs → doctor-DyqE9n1J.mjs} +28 -16
  47. package/dist/{doctor-OnwP94ne.mjs → doctor-F-3VUUyN.mjs} +76 -32
  48. package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
  49. package/dist/doctor-fingerprint.mjs +1 -1
  50. package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-CxDbyrrt.mjs} +5 -5
  51. package/dist/{eas-build-Dsj93iM9.mjs → eas-build-CjNSWmjo.mjs} +4 -4
  52. package/dist/eas-fallback-9fqb46kW.mjs +87 -0
  53. package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-DrP4OuuM.mjs} +6 -6
  54. package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-snej9k4j.mjs} +51 -25
  55. package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
  56. package/dist/{gc-C_79zvz4.mjs → gc-BRwAY3qT.mjs} +2 -2
  57. package/dist/{gc-ldgr-hXU.mjs → gc-CGZ1Yg88.mjs} +160 -45
  58. package/dist/{guide-D7K0X6KG.mjs → guide-_rfEh_zM.mjs} +580 -183
  59. package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-BMKzUNnY.mjs} +4 -4
  60. package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-D7Pk_Oo1.mjs} +12 -8
  61. package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-B1gqQuva.mjs} +8 -8
  62. package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-Dg3qrZmV.mjs} +5 -5
  63. package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B9w4H8hc.mjs} +6 -6
  64. package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CdgaiuyP.mjs} +17 -16
  65. package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-Cbvo5KEh.mjs} +7 -8
  66. package/dist/{ios-ftxdQbJS.mjs → ios-B5HlVMhQ.mjs} +92 -37
  67. package/dist/{ios-B7-lToDu.mjs → ios-Bk4mWbtS.mjs} +8 -8
  68. package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
  69. package/dist/{ios-WxpDJ5T1.mjs → ios-E26qSpkb.mjs} +27 -11
  70. package/dist/{ios-device-CsyryvpT.mjs → ios-device-C_QkIf1Z.mjs} +3 -3
  71. package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
  72. package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-D8Jcy_br.mjs} +22 -9
  73. package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
  74. package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BZ03NFgF.mjs} +1 -1
  75. package/dist/{js-swap-BMhXYVDS.mjs → js-swap-Dg2a945i.mjs} +8 -7
  76. package/dist/{launch-DOp8RjDz.mjs → launch-CRyBeNsA.mjs} +42 -38
  77. package/dist/lightened-BCsdAGj_.mjs +171 -0
  78. package/dist/{logs-dQDki6Tt.mjs → logs-CC_-ZzEE.mjs} +7 -7
  79. package/dist/{logs-s1dRIG1E.mjs → logs-aJQb-RDg.mjs} +46 -21
  80. package/dist/{macos-B0VEV3Gf.mjs → macos-BGmTpnv9.mjs} +1 -1
  81. package/dist/{macos-DBBPNnIA.mjs → macos-DlCBhMw5.mjs} +73 -38
  82. package/dist/macos-run.mjs +1 -1
  83. package/dist/maintenance-run.mjs +7 -7
  84. package/dist/{metro-CjC10t6E.mjs → metro-CvyD-xwe.mjs} +4 -4
  85. package/dist/{metro-gateway-B6_PgD0L.mjs → metro-gateway-BnHdqMO_.mjs} +3 -3
  86. package/dist/{named-ports-BG0j1X4g.mjs → named-ports-BCyMWA6b.mjs} +3 -3
  87. package/dist/{native-android-CL2NGiik.mjs → native-android-DlpxCyOP.mjs} +17 -18
  88. package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-C13qT7R_.mjs} +5 -5
  89. package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DqaIBO5w.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-B1W8SrxB.mjs} +3 -3
  92. package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-QPP0Rm68.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-Bx-0cku-.mjs} +3 -3
  97. package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
  98. package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-C9yAaKEv.mjs} +18 -4
  99. package/dist/{placement-log-DIFPQAXp.mjs → placement-log-BXUbiZM6.mjs} +3 -3
  100. package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-UxnQjv5Z.mjs} +36 -10
  101. package/dist/{ports-C2_w1Z0Z.mjs → ports-uUrghqWN.mjs} +3 -3
  102. package/dist/{prebuild-gmouvmJZ.mjs → prebuild-BDpToDgR.mjs} +16 -17
  103. package/dist/{project-BUu6Is4k.mjs → project-DYj-HVx6.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-DDBccgJw.mjs} +32 -26
  107. package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-DaK2IFyP.mjs} +9 -9
  108. package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-B-Mw6DcR.mjs} +6 -6
  109. package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-DjYwUF9U.mjs} +23 -17
  110. package/dist/{recordings-BldzVKq0.mjs → recordings-C20iUZfp.mjs} +1 -1
  111. package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
  112. package/dist/{reload-C9OduiNc.mjs → reload-DJBeF_rC.mjs} +1 -1
  113. package/dist/{reload-CCR7KC_l.mjs → reload-fUdkH2_p.mjs} +16 -16
  114. package/dist/{remote-C8S7FlPF.mjs → remote-y6n99WMW.mjs} +22 -9
  115. package/dist/{result-7F5hEwQJ.mjs → result-CTqBw2Te.mjs} +32 -21
  116. package/dist/{run-BqB0v3pt.mjs → run-DaCeNKRm.mjs} +3 -3
  117. package/dist/{selection-BNPBZ6T5.mjs → selection-Bs8phwhN.mjs} +37 -29
  118. package/dist/{server-bare-A75rDIdD.mjs → server-bare-BOh-iZEj.mjs} +2 -2
  119. package/dist/{server-command-CssKFOD7.mjs → server-command-8CuA51Cv.mjs} +6 -6
  120. package/dist/{server-expo-eQfOdydb.mjs → server-expo-ABQs2XFA.mjs} +4 -4
  121. package/dist/server-expo-Ba_Y21vB.mjs +2 -0
  122. package/dist/{settings-CosW5X-S.mjs → settings-BDVI8Ivc.mjs} +331 -62
  123. package/dist/{settings-OaGQF-ri.mjs → settings-CMHhQNwI.mjs} +24 -3
  124. package/dist/settings-payload-cm60Zhib.mjs +257 -0
  125. package/dist/settings-write-BdNRLlBn.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-0l7RqSpr.mjs} +6 -6
  129. package/dist/{stage-jKQ7CP_B.mjs → stage-F4cAfJGi.mjs} +2 -2
  130. package/dist/{start-C_wefNKB.mjs → start-DcqnF9p8.mjs} +1 -1
  131. package/dist/{start-_BdJ32cZ.mjs → start-DrPwER_2.mjs} +27 -22
  132. package/dist/{state-C1i2nMOP.mjs → state-BX1y5syV.mjs} +4 -4
  133. package/dist/{state-C4OdpOTF.mjs → state-CZxLyetD.mjs} +2 -2
  134. package/dist/{stats-tEpEEH-u.mjs → stats-GxuCbles.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-BfnK9pUd.mjs} +25 -25
  138. package/dist/{status-B9M7x4CZ.mjs → status-Bj7ZYvvc.mjs} +1 -1
  139. package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BfabQn03.mjs} +5 -5
  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-ySNQHXMG.mjs → stop-CH79S3IZ.mjs} +5 -5
  143. package/dist/{stop-DRqQVqDJ.mjs → stop-D-EAr25B.mjs} +21 -20
  144. package/dist/{stop-CmdNhGlC.mjs → stop-x1Yu3He4.mjs} +2 -2
  145. package/dist/supervisor-run.mjs +17 -17
  146. package/dist/{support-CVOCp0Ft.mjs → support-Be0UeVZU.mjs} +10 -10
  147. package/dist/{support-BGSCBoib.mjs → support-CNg_YsOk.mjs} +6 -6
  148. package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-uPqYvGBv.mjs} +4 -4
  149. package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-Ch4YjY_A.mjs} +11 -12
  150. package/dist/{toolchain-J4J8MrAr.mjs → toolchain-CbCG6C5Z.mjs} +321 -15
  151. package/dist/{toolchain-DoavrvIA.mjs → toolchain-JYAOquPg.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-C0RsbngN.mjs} +731 -727
  155. package/dist/{web-Bihbf7-u.mjs → web-Cq_AQ4DK.mjs} +9 -9
  156. package/dist/web-Je6abcpz.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-BjqdjnJR.mjs} +3 -3
  160. package/dist/{workspaces-g2lhdBXF.mjs → workspaces-DFbj07jp.mjs} +1795 -70
  161. package/dist/{worktree-BKuklFh_.mjs → worktree-COAJ3-OD.mjs} +934 -514
  162. package/dist/{worktree-Bm4cb-nU.mjs → worktree-JGUd_53L.mjs} +1 -1
  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
@@ -0,0 +1,350 @@
1
+ import { _ as loadConfig$1, p as getProject } from "./config-Cn94Jc0g.mjs";
2
+ import { m as peekBudget } from "./ccache-BWTze1Ls.mjs";
3
+ import { z as readHostMemoryPressureAsync } from "./ios-E26qSpkb.mjs";
4
+ import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-Bs8phwhN.mjs";
5
+ import { c as call, l as connectHost, p as requireHostedAppMode } from "./hosted-client-D7Pk_Oo1.mjs";
6
+ import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-BZ03NFgF.mjs";
7
+ import { i as prepareHostedNative } from "./hosted-native-CdgaiuyP.mjs";
8
+ import { l as peekDeviceSlots, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-6LP7QsaA.mjs";
9
+ import { ambientEnv } from "@stim-cli/core";
10
+ import { automaticMachineEnabled, isJsonObject, machineCapacity, mayRunHere, parseHostedChoice, parseHostedNativeOffer, prefersRemote } from "@stim-cli/core/state";
11
+ import { setTimeout } from "node:timers/promises";
12
+ //#region src/device-host/placement.ts
13
+ function local$1(code, reason, skipped = [], atCapacity = false) {
14
+ return {
15
+ kind: "local",
16
+ code,
17
+ reason,
18
+ skipped,
19
+ ...atCapacity ? { atCapacity: true } : {}
20
+ };
21
+ }
22
+ function decideDevicePlacement(inputs) {
23
+ if ("sticky" in inputs) {
24
+ if ("machine" in inputs.sticky) {
25
+ const reason = `recorded session on ${inputs.sticky.machine}`;
26
+ return {
27
+ kind: "host",
28
+ code: "sticky",
29
+ reason,
30
+ machines: [{
31
+ machine: inputs.sticky.machine,
32
+ reason
33
+ }],
34
+ skipped: []
35
+ };
36
+ }
37
+ return {
38
+ kind: "local",
39
+ code: "sticky",
40
+ reason: "this workspace's device runs here",
41
+ skipped: []
42
+ };
43
+ }
44
+ const { platform, placement = "auto", here, offers, buildMachine, noWait, eas } = inputs;
45
+ const remoteFirst = prefersRemote(placement);
46
+ const { count, max, queued } = here.devices;
47
+ const room = max === 0 || count !== null && count < max;
48
+ const localEnabled = here.localEnabled !== false && mayRunHere(placement);
49
+ const cannotTake = !localEnabled || !room || queued > 0;
50
+ const atCapacity = count !== null && (!room || queued > 0);
51
+ const usage = max > 0 ? `${count} of ${max} devices in use` : `${count} devices in use, no device cap`;
52
+ const localReason = !mayRunHere(placement) ? "remote-only never runs here" : !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}`);
53
+ let hostsFull = false;
54
+ const nowhere = (code, reason, skipped = [], waiting = "") => {
55
+ if (!mayRunHere(placement)) return {
56
+ kind: "refused",
57
+ code: "pool-unavailable",
58
+ reason,
59
+ skipped,
60
+ ...hostsFull ? { hostsFull: true } : {}
61
+ };
62
+ if (!localEnabled && !atCapacity) return {
63
+ kind: "refused",
64
+ code: "pool-unavailable",
65
+ reason,
66
+ skipped
67
+ };
68
+ if (!cannotTake || count === null) return local$1(code, reason + waiting, skipped);
69
+ if (eas?.usable) return {
70
+ kind: "eas",
71
+ code: "eas-fallback",
72
+ reason: `${reason}; EAS Simulator (remote.easFallback)`,
73
+ skipped
74
+ };
75
+ const why = eas ? [...skipped, {
76
+ machine: "eas",
77
+ code: eas.code,
78
+ reason: eas.reason
79
+ }] : skipped;
80
+ return localEnabled ? local$1(code, reason + waiting, why, true) : {
81
+ kind: "refused",
82
+ code: "pool-unavailable",
83
+ reason,
84
+ skipped: why,
85
+ atCapacity: true
86
+ };
87
+ };
88
+ if (!offers.length) return nowhere("no-remote-mac", "no remote machines configured; " + localReason);
89
+ if (localEnabled && count === null && !remoteFirst) return local$1("device-count-unknown", localReason);
90
+ if (!remoteFirst && !cannotTake && here.memoryPressure === "normal" && !here.budgetRefusal && here.loadPerCore < here.maxLoadPerCore) return local$1("this-mac-free", localReason);
91
+ const ceiling = (offer) => offer.resources.maxLoadPerCore ?? here.maxLoadPerCore;
92
+ const skipped = [];
93
+ const admitted = [];
94
+ offers.forEach((probe, index) => {
95
+ let reason = null;
96
+ let code = "unreachable";
97
+ if ("failure" in probe) reason = probe.failure;
98
+ else {
99
+ const { offer } = probe;
100
+ if (offer.declined !== null) [code, reason] = ["declined", `declined: ${offer.declined}`];
101
+ else if (offer.platform !== platform || !offer.choice) [code, reason] = ["no-matching-device", `no matching ${platform} device choice`];
102
+ else if (offer.resources.memoryPressure !== "normal") [code, reason] = ["memory", "host memory pressure unknown or elevated"];
103
+ else if (offer.capacity.available === 0) [code, reason] = ["no-capacity", "no hosted device capacity available"];
104
+ else if (offer.resources.loadPerCore !== null && offer.resources.loadPerCore >= ceiling(offer)) [code, reason] = ["load", `saturated: load ${offer.resources.loadPerCore.toFixed(1)}/core there, at or above ${ceiling(offer)}/core`];
105
+ else if (placement === "auto" && !cannotTake && offer.resources.loadPerCore === null) [code, reason] = ["load", "host load unknown while this machine has room"];
106
+ else admitted.push({
107
+ machine: probe.machine,
108
+ offer,
109
+ index
110
+ });
111
+ }
112
+ if (reason) skipped.push({
113
+ machine: probe.machine,
114
+ code,
115
+ reason
116
+ });
117
+ if (reason && ("offer" in probe ? [
118
+ "no-capacity",
119
+ "load",
120
+ "memory"
121
+ ].includes(code) || code === "declined" && (probe.offer.capacity.available === 0 || probe.offer.resources.memoryPressure !== "normal") : false)) hostsFull = true;
122
+ });
123
+ admitted.sort((a, b) => Number(b.machine === buildMachine) - Number(a.machine === buildMachine) || a.index - b.index);
124
+ if (!admitted.length) return nowhere("no-host-admits", `${localReason}; no host admits`, skipped, localEnabled && cannotTake && !noWait ? "; waiting locally if needed" : "");
125
+ const machines = admitted.map(({ machine, offer }) => ({
126
+ machine,
127
+ reason: `${remoteFirst && !cannotTake ? `${placement} tries remote machines first` : localReason}; ${machine}${machine === buildMachine ? " is the explicit remote machine," : ""} load ${offer.resources.loadPerCore === null ? "unknown" : offer.resources.loadPerCore.toFixed(1) + "/core"}`
128
+ }));
129
+ return {
130
+ kind: "host",
131
+ code: "placed",
132
+ machines,
133
+ reason: machines[0].reason,
134
+ skipped
135
+ };
136
+ }
137
+ //#endregion
138
+ //#region src/device-host/auto-placement.ts
139
+ const HOST_WAIT_POLL_MS = 5e3;
140
+ function refusalText(decision, waitedMs) {
141
+ return [
142
+ decision.reason,
143
+ ...decision.skipped.map((each) => `${each.machine}: ${each.reason}`),
144
+ ...waitedMs === null ? [] : [`waited ${Math.round(waitedMs / 1e3)}s for a remote machine with room`]
145
+ ].join("; ");
146
+ }
147
+ async function probeHost(machine, platform, selectors, appMode, signal) {
148
+ let host;
149
+ const deadline = Date.now() + 3e3;
150
+ const cancel = () => host?.connection.close();
151
+ try {
152
+ host = await connectHost(machine, 3e3, true, signal);
153
+ signal?.addEventListener("abort", cancel, { once: true });
154
+ signal?.throwIfAborted();
155
+ if (platform !== "macos") requireHostedAppMode(host, platform, appMode);
156
+ const offer = await call(host, "device-host.offer", {
157
+ platform,
158
+ ...selectors
159
+ }, Math.max(1, deadline - Date.now()));
160
+ signal?.throwIfAborted();
161
+ const resources = isJsonObject(offer.resources) ? offer.resources : {};
162
+ const parsed = parseHostedNativeOffer({
163
+ ...offer,
164
+ resources: {
165
+ ...resources,
166
+ loadPerCore: resources.loadPerCore ?? 0
167
+ }
168
+ });
169
+ let choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsed?.platform === platform ? parsed.choice : null;
170
+ if (choice && platform !== "macos" && ("runtime" in choice ? selectors.deviceType && selectors.deviceType !== choice.deviceType || selectors.runtime && selectors.runtime.replace(/^iOS /, "") !== choice.runtime.replace(/^iOS /, "") : "systemImage" in choice && (selectors.systemImage && selectors.systemImage !== choice.systemImage || selectors.deviceProfile && selectors.deviceProfile !== choice.deviceProfile))) choice = null;
171
+ if (!isJsonObject(offer.capacity) || offer.declined !== null && typeof offer.declined !== "string") throw new Error("unreadable device offer");
172
+ return {
173
+ probe: {
174
+ machine,
175
+ offer: {
176
+ platform,
177
+ choice,
178
+ declined: offer.declined,
179
+ capacity: { available: typeof offer.capacity.available === "number" ? offer.capacity.available : null },
180
+ resources: {
181
+ ...typeof resources.maxLoadPerCore === "number" && Number.isFinite(resources.maxLoadPerCore) && resources.maxLoadPerCore > 0 ? { maxLoadPerCore: resources.maxLoadPerCore } : {},
182
+ loadPerCore: typeof resources.loadPerCore === "number" && Number.isFinite(resources.loadPerCore) && resources.loadPerCore >= 0 ? resources.loadPerCore : null,
183
+ memoryFreeBytes: typeof resources.memoryFreeBytes === "number" ? resources.memoryFreeBytes : 0,
184
+ memoryPressure: typeof resources.memoryPressure === "string" ? resources.memoryPressure : null
185
+ }
186
+ }
187
+ },
188
+ ...choice && ("runtime" in choice || "systemImage" in choice) ? { target: {
189
+ host,
190
+ choice,
191
+ session: null
192
+ } } : {}
193
+ };
194
+ } catch (error) {
195
+ signal?.throwIfAborted();
196
+ return { probe: {
197
+ machine,
198
+ failure: error instanceof Error ? error.message : String(error)
199
+ } };
200
+ } finally {
201
+ signal?.removeEventListener("abort", cancel);
202
+ host?.connection.close();
203
+ }
204
+ }
205
+ function hosted(target, machine, code, reason, skipped = []) {
206
+ if (target) target.selection = {
207
+ selected: "auto",
208
+ reason
209
+ };
210
+ return {
211
+ target,
212
+ placement: {
213
+ decision: "hosted",
214
+ machine,
215
+ reason
216
+ },
217
+ code,
218
+ skipped
219
+ };
220
+ }
221
+ function local(code, reason, skipped = []) {
222
+ return {
223
+ target: null,
224
+ placement: {
225
+ decision: "local",
226
+ reason
227
+ },
228
+ code,
229
+ skipped
230
+ };
231
+ }
232
+ function viaEas(code, reason, skipped) {
233
+ return {
234
+ target: null,
235
+ placement: {
236
+ decision: "eas",
237
+ machine: "eas",
238
+ reason
239
+ },
240
+ code,
241
+ skipped
242
+ };
243
+ }
244
+ async function automaticDevicePlacement({ root, slot, platform, placement = "auto", selectors, appMode, buildMachine, noWait, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, onWait = () => {}, eas, signal, localSims }, { machines = () => hostingMachines(void 0, signal), read = readHostedNative, write = writeHostedNativeAsync, resume = prepareHostedNative, peek = () => peekDeviceSlots({
245
+ platform: platform === "macos" ? "ios" : platform,
246
+ project: getProject(root),
247
+ slot,
248
+ ...localSims ? { sources: { sims: localSims } } : {}
249
+ }), capacity = machineCapacity, memory = () => readHostMemoryPressureAsync(void 0, void 0, signal), probe = probeHost, budget = (projectRoot) => peekBudget(projectRoot, {}, ambientEnv(), signal), now = Date.now, sleep = (ms) => setTimeout(ms, void 0, { signal }) } = {}) {
250
+ const recorded = platform === "macos" ? void 0 : read(root, platform, slot)[slot];
251
+ if (recorded && platform !== "macos") {
252
+ const target = await resume(recorded.machine, selectors, recorded, platform, true, appMode);
253
+ if (target) return {
254
+ target,
255
+ placement: {
256
+ decision: "hosted",
257
+ machine: recorded.machine,
258
+ reason: recorded.reason ?? decideDevicePlacement({ sticky: { machine: recorded.machine } }).reason
259
+ },
260
+ code: "sticky",
261
+ skipped: [],
262
+ sticky: true
263
+ };
264
+ await write(root, slot, null, platform);
265
+ }
266
+ const devices = platform === "macos" ? {
267
+ count: 0,
268
+ max: 0,
269
+ queued: 0,
270
+ localLive: false
271
+ } : peek();
272
+ if (devices.localLive && placement === "remote-only") throw Object.assign(/* @__PURE__ */ new Error(`This workspace's ${platform} device for slot ${slot} runs on this machine, and remote-only never runs here.`), {
273
+ code: "STIM_HOSTING_REFUSED",
274
+ remedy: "Run stim stop, then retry."
275
+ });
276
+ if (devices.localLive) return {
277
+ ...local("sticky", decideDevicePlacement({ sticky: { local: true } }).reason),
278
+ sticky: true
279
+ };
280
+ const configured = await machines();
281
+ signal?.throwIfAborted();
282
+ if (configured === null) throw Object.assign(/* @__PURE__ */ new Error("remote.machines is invalid. Run stim guide settings and correct it."), { code: "STIM_HOSTING_REFUSED" });
283
+ const config = loadConfig$1();
284
+ const entries = configured.filter((machine) => automaticMachineEnabled("device", machine, config));
285
+ const preference = resolveBuildMachine(buildMachine, ambientEnv().STIM_REMOTE_BUILD, config?.remote?.build);
286
+ buildMachine = namedBuildMachine(preference) ? preference : void 0;
287
+ const load = capacity();
288
+ const here = {
289
+ localEnabled: automaticMachineEnabled("device", "local", config),
290
+ loadPerCore: load.loadPerCore,
291
+ maxLoadPerCore: load.maxLoadPerCore,
292
+ memoryPressure: await memory(),
293
+ devices,
294
+ budgetRefusal: await budget(root)
295
+ };
296
+ signal?.throwIfAborted();
297
+ const inputs = (offers) => ({
298
+ platform,
299
+ placement,
300
+ here,
301
+ offers,
302
+ buildMachine,
303
+ noWait
304
+ });
305
+ const notProbed = entries.map((machine) => ({
306
+ machine,
307
+ failure: "not probed"
308
+ }));
309
+ const waitStarted = now();
310
+ let announced = false;
311
+ let probes = [];
312
+ let offers = notProbed;
313
+ let decision;
314
+ for (;;) {
315
+ const early = decideDevicePlacement(inputs(notProbed));
316
+ probes = early.kind === "local" && early.skipped.length === 0 ? [] : await Promise.all(entries.map((machine) => probe(machine, platform, selectors, appMode, signal)));
317
+ offers = probes.length ? probes.map((each) => each.probe) : notProbed;
318
+ decision = decideDevicePlacement(inputs(offers));
319
+ if (decision.kind !== "refused" || !decision.hostsFull) break;
320
+ const waited = now() - waitStarted;
321
+ const immediate = noWait || waitMs <= 0;
322
+ if (immediate || waited >= waitMs) throw Object.assign(new Error(refusalText(decision, immediate ? null : waited)), {
323
+ code: "STIM_AT_CAPACITY",
324
+ remedy: `Wait for a remote machine in remote.machines to have room, ${platform === "macos" ? "retry later" : "retry with a longer --wait <seconds>"}, or select a placement that may run here.`
325
+ });
326
+ if (!announced) {
327
+ announced = true;
328
+ onWait(`remote-only waits up to ${Math.round(waitMs / 1e3)}s for a remote machine with room (${decision.skipped.map((each) => `${each.machine}: ${each.reason}`).join("; ")})`);
329
+ }
330
+ await sleep(Math.min(HOST_WAIT_POLL_MS, waitMs - waited));
331
+ signal?.throwIfAborted();
332
+ }
333
+ if ((decision.kind === "local" || decision.kind === "refused") && decision.atCapacity && eas && placement !== "remote-only") decision = decideDevicePlacement({
334
+ ...inputs(offers),
335
+ eas: await eas()
336
+ });
337
+ if (decision.kind === "refused") throw Object.assign(new Error(refusalText(decision, null)), {
338
+ code: "STIM_HOSTING_REFUSED",
339
+ remedy: placement === "remote-only" ? entries.length === 0 ? "Add an approved Mac to remote.machines (stim guide settings), or select a placement that may run here." : "Wait for a remote machine in remote.machines to have room, check stim doctor for the ones that are unreachable or unapproved, or select a placement that may run here." : "Enable an available member in remote.devicePoolDisabled or select a machine explicitly."
340
+ });
341
+ if (decision.kind === "eas") return viaEas(decision.code, decision.reason, decision.skipped);
342
+ if (decision.kind === "local") return local(decision.code, decision.reason, decision.skipped);
343
+ const machine = decision.machines[0].machine;
344
+ return hosted(probes.find((each) => each.probe.machine === machine)?.target ?? null, machine, decision.code, decision.reason, decision.skipped);
345
+ }
346
+ function devicePlacementLine(placement, skipped) {
347
+ return `${placement.machine ?? "local"}, ${placement.reason}${placement.decision !== "hosted" && skipped.length ? "; " + skipped.map((each) => `${each.machine}: ${each.reason}`).join("; ") : ""}`;
348
+ }
349
+ //#endregion
350
+ export { devicePlacementLine as n, probeHost as r, automaticDevicePlacement as t };
@@ -1,20 +1,20 @@
1
- import { D as ownership_claim_exports, S as process_identity_exports, c as throwIfCancelled, l as WorkspaceProcessCleanupError, s as cancelledError, t as getExecutor, u as withWorkspaceProcessLock } from "./exec-VFRpu1iA.mjs";
2
- import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-pUg3_RRA.mjs";
3
- import { p as getProject } from "./config-BktkY_zC.mjs";
4
- import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
5
- import { M as metroPortSetting, a as SETTING_SHAPE_REMEDY, ot as webSettings } from "./settings-CosW5X-S.mjs";
6
- import { b as isPackageResolvable, v as detectIsExpo } from "./project-BUu6Is4k.mjs";
7
- import { d as resolveProjectMetro } from "./metro-CjC10t6E.mjs";
8
- import { s as readNdjsonGenerations$1 } from "./ndjson-CgE_o3Dl.mjs";
9
- import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-C1i2nMOP.mjs";
10
- import { sn as readMetroRecords } from "./budget-k2mZGvvk.mjs";
11
- import { D as teardownBrowserHeld, g as resolveSupervisorTarget } from "./workspaces-g2lhdBXF.mjs";
12
- import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-BG0j1X4g.mjs";
13
- import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CzEA_-5_.mjs";
14
- import { o as resolveWorkspaceMetroPort } from "./start-_BdJ32cZ.mjs";
1
+ import { D as ownership_claim_exports, S as process_identity_exports, c as throwIfCancelled, l as WorkspaceProcessCleanupError, s as cancelledError, t as getExecutor, u as withWorkspaceProcessLock } from "./exec-aULwtNly.mjs";
2
+ import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-BjqdjnJR.mjs";
3
+ import { p as getProject } from "./config-Cn94Jc0g.mjs";
4
+ import { l as phaseLine } from "./command-output-Dj-WT4BP.mjs";
5
+ import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-BDVI8Ivc.mjs";
6
+ import { b as isPackageResolvable, v as detectIsExpo } from "./project-DYj-HVx6.mjs";
7
+ import { d as resolveProjectMetro } from "./metro-CvyD-xwe.mjs";
8
+ import { c as readNdjsonGenerations$1 } from "./ndjson-Dy2W4vRa.mjs";
9
+ import { Wt as readMetroRecords } from "./ccache-BWTze1Ls.mjs";
10
+ import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-BX1y5syV.mjs";
11
+ import { b as resolveSupervisorTarget, lt as teardownBrowserHeld } from "./workspaces-DFbj07jp.mjs";
12
+ import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-BCyMWA6b.mjs";
13
+ import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CQJlcj3x.mjs";
14
+ import { o as resolveWorkspaceMetroPort } from "./start-DrPwER_2.mjs";
15
15
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
16
- import { n as windowsLauncherArgs } from "./detached-entry-KmieOKgN.mjs";
17
- import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-BvV8ssI3.mjs";
16
+ import { n as windowsLauncherArgs } from "./detached-entry-BPlSaCwC.mjs";
17
+ import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-DyDWurWG.mjs";
18
18
  import { randomUUID } from "node:crypto";
19
19
  import { mkdirSync, openSync, statSync, watch } from "node:fs";
20
20
  import { ambientEnv } from "@stim-cli/core";
@@ -1,16 +1,17 @@
1
- import { c as throwIfCancelled, t as getExecutor, x as withDrainingCancellation } from "./exec-VFRpu1iA.mjs";
2
- import { y as sharedBuildCache } from "./workspace-state-pUg3_RRA.mjs";
3
- import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-CUZifp6Z.mjs";
4
- import { m as defaultAndroidLayout } from "./settings-CosW5X-S.mjs";
5
- import { r as register } from "./cache-manifest-BEZ9Bpl1.mjs";
6
- import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-B46U9hXc.mjs";
1
+ import { c as throwIfCancelled, t as getExecutor, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
+ import { y as sharedBuildCache } from "./workspace-state-BjqdjnJR.mjs";
3
+ import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-Dp4FuIGR.mjs";
4
+ import { m as defaultAndroidLayout } from "./settings-BDVI8Ivc.mjs";
5
+ import { r as register } from "./cache-manifest-DEjqGGat.mjs";
6
+ import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-BHQHx3Rm.mjs";
7
7
  import { createHash } from "node:crypto";
8
8
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
9
9
  import { join } from "node:path";
10
10
  import { artifactIn, buildCacheKey, resolveArtifact, storeArtifactAsync } from "@stim-cli/core";
11
+ import { trace } from "@stim-cli/core/state";
11
12
  import { basename as basename$1, isAbsolute as isAbsolute$1, join as join$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "path";
12
13
  import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync as statSync$1 } from "fs";
13
- import { readdir, writeFile } from "node:fs/promises";
14
+ import { readdir, rename, rm, writeFile } from "node:fs/promises";
14
15
  import { isDeepStrictEqual } from "util";
15
16
  import * as expoFingerprint from "@expo/fingerprint";
16
17
  import { loadConfigAsync } from "@expo/fingerprint/build/Config.js";
@@ -391,17 +392,19 @@ async function fingerprintOptions(projectRoot, { platform, iosProjectPath = "ios
391
392
  };
392
393
  }
393
394
  async function fingerprintProject(projectRoot, { createFingerprint = expoFingerprint.createFingerprintAsync, debug = false, ...target } = {}) {
394
- const options = await fingerprintOptions(projectRoot, target);
395
- const result = await createFingerprint(projectRoot, debug ? {
396
- ...options,
397
- debug
398
- } : options);
399
- const hash = result?.hash ?? null;
400
- if (!hash) return null;
401
- return {
402
- hash,
403
- sources: Array.isArray(result?.sources) ? result.sources : []
404
- };
395
+ return trace.spanAsync("fingerprint", async () => {
396
+ const options = await fingerprintOptions(projectRoot, target);
397
+ const result = await createFingerprint(projectRoot, debug ? {
398
+ ...options,
399
+ debug
400
+ } : options);
401
+ const hash = result?.hash ?? null;
402
+ if (!hash) return null;
403
+ return {
404
+ hash,
405
+ sources: Array.isArray(result?.sources) ? result.sources : []
406
+ };
407
+ }, { platform: target.platform });
405
408
  }
406
409
  /** The env files @expo/env loads for the config: @expo/fingerprint 0.21 evaluates it in development mode. */
407
410
  function expoEnvFiles(env = {}) {
@@ -424,8 +427,8 @@ async function gitignoredFingerprintInputs(projectRoot, sources, target, { env,
424
427
  if (sources.some((source) => source.type === "contents" && source.id === "expoConfig")) {
425
428
  for (const name of expoEnvFiles(env)) if (lstatSync$1(join$1(projectRoot, name), { throwIfNoEntry: false })?.isFile()) found.add(name);
426
429
  }
427
- const top = realpathSync$1(await gitAsync(projectRoot, ["rev-parse", "--show-toplevel"], { signal }));
428
- const base = realpathSync$1(projectRoot);
430
+ const top = realpathSync$1.native(await gitAsync(projectRoot, ["rev-parse", "--show-toplevel"], { signal }));
431
+ const base = realpathSync$1.native(projectRoot);
429
432
  const pathspecs = sources.flatMap((source) => {
430
433
  if (source.type === "contents" || inNodeModules(source.filePath)) return [];
431
434
  const inRepo = relative$1(top, resolve$1(base, source.filePath));
@@ -544,6 +547,25 @@ async function storeBuild(platform, key, buildPath, rootOrOptions = {}) {
544
547
  throw error;
545
548
  }
546
549
  }
550
+ /** Removes a stored build by renaming its entry aside first, so no run sees a half-deleted entry. */
551
+ async function evictBuild(platform, key, root = sharedBuildCache()) {
552
+ const dir = entryDir(platform, key, root);
553
+ const evicted = `${dir}.evicted-${process.pid}`;
554
+ try {
555
+ await rm(evicted, {
556
+ recursive: true,
557
+ force: true
558
+ });
559
+ await rename(dir, evicted);
560
+ } catch {
561
+ return false;
562
+ }
563
+ await rm(evicted, {
564
+ recursive: true,
565
+ force: true
566
+ }).catch(() => {});
567
+ return true;
568
+ }
547
569
  const PROVIDER_DOWNLOAD_DIR = "cache-provider";
548
570
  function providerDownloadPath(workspacePath) {
549
571
  return join$1(workspacePath, PROVIDER_DOWNLOAD_DIR);
@@ -832,4 +854,4 @@ function fingerprintDiffRecord({ changed, previousHash, hash }) {
832
854
  };
833
855
  }
834
856
  //#endregion
835
- export { assetDiffReason as A, storeBuild as C, trackedFingerprintPaths as D, storedSources as E, compareAssetManifests as M, readAssetManifest as N, untrackedMissLine as O, resolveBuild as S, storedAssetManifest as T, packageIn as _, configInputsChanged as a, providerUploadOutcome as b, expoConfigContents as c, fingerprintDiffRecord as d, fingerprintOptions as f, inputsChangedDuringBuild as g, ignoredFingerprintPaths as h, compareSourceLists as i, captureAssetManifest as j, untrackedNativeFiles as k, expoEnvFiles as l, gitignoredFingerprintInputs as m, buildCacheKey as n, diffFingerprintSources as o, fingerprintProject as p, changedDuringBuildLine as r, entryDir as s, artifactIn as t, filesystemBuildCapability as u, prepareProviderDownloadDir as v, storedAppId as w, refingerprintAfterMutation as x, providerDownloadPath as y };
857
+ export { untrackedNativeFiles as A, resolveBuild as C, storedSources as D, storedAssetManifest as E, captureAssetManifest as M, compareAssetManifests as N, trackedFingerprintPaths as O, readAssetManifest as P, refingerprintAfterMutation as S, storedAppId as T, inputsChangedDuringBuild as _, configInputsChanged as a, providerDownloadPath as b, evictBuild as c, filesystemBuildCapability as d, fingerprintDiffRecord as f, ignoredFingerprintPaths as g, gitignoredFingerprintInputs as h, compareSourceLists as i, assetDiffReason as j, untrackedMissLine as k, expoConfigContents as l, fingerprintProject as m, buildCacheKey as n, diffFingerprintSources as o, fingerprintOptions as p, changedDuringBuildLine as r, entryDir as s, artifactIn as t, expoEnvFiles as u, packageIn as v, storeBuild as w, providerUploadOutcome as x, prepareProviderDownloadDir as y };
@@ -1,29 +1,28 @@
1
- import { c as throwIfCancelled, s as cancelledError, x as withDrainingCancellation } from "./exec-VFRpu1iA.mjs";
2
- import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-pUg3_RRA.mjs";
3
- import { E as upsertProject, O as withConfigLockAsync, p as getProject, u as getConcurrencyLimits } from "./config-BktkY_zC.mjs";
4
- import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
5
- import { K as resolveCacheProviderConfig, Y as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-CosW5X-S.mjs";
6
- import { f as projectRegistry, v as detectIsExpo } from "./project-BUu6Is4k.mjs";
7
- import { s as workspaceShareURL } from "./stim-desktop-6Dqp-gjX.mjs";
8
- import { k as hostSystemImageArch } from "./android-DTAcRwBC.mjs";
9
- import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
10
- import { K as startBuildProgress, W as recordFinishedBuild, X as readRunEstimates, Y as createRunRecorder, et as recordRunStats, nr as uploadRemote, q as tapBuildLog, qn as checkEasAuth, tr as resolveRemote, tt as statsProjectKey } from "./budget-k2mZGvvk.mjs";
11
- import { d as runCancellationSignal, f as withNativeBuildRun } from "./native-run-BfIDFKLH.mjs";
12
- import { L as acquireBuildSlot, z as releaseBuildSlot } from "./workspaces-g2lhdBXF.mjs";
13
- import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-Lnb_EoRY.mjs";
14
- import { b as providerUploadOutcome, w as storedAppId } from "./build-cache-DrXNCy3T.mjs";
15
- import { m as listIosRuntimes } from "./ios-WxpDJ5T1.mjs";
1
+ import { c as throwIfCancelled, s as cancelledError, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
+ import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-BjqdjnJR.mjs";
3
+ import { E as upsertProject, O as withConfigLockAsync, p as getProject, u as getConcurrencyLimits } from "./config-Cn94Jc0g.mjs";
4
+ import { l as phaseLine } from "./command-output-Dj-WT4BP.mjs";
5
+ import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-BDVI8Ivc.mjs";
6
+ import { f as projectRegistry, v as detectIsExpo } from "./project-DYj-HVx6.mjs";
7
+ import { s as workspaceShareURL } from "./stim-desktop-CbWo21kb.mjs";
8
+ import { k as hostSystemImageArch } from "./android-DriNoAVy.mjs";
9
+ import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
10
+ import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-BWTze1Ls.mjs";
11
+ import { X as tapBuildLog, Y as startBuildProgress, at as recordRunStats, et as createRunRecorder, ot as statsProjectKey, q as recordFinishedBuild, tt as readRunEstimates, xt as releaseBuildSlot, yt as acquireBuildSlot } from "./workspaces-DFbj07jp.mjs";
12
+ import { V as readBundleId, ot as runCancellationSignal, st as withNativeBuildRun } from "./toolchain-CbCG6C5Z.mjs";
13
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-Cd-ysFes.mjs";
14
+ import { T as storedAppId, x as providerUploadOutcome } from "./build-cache-gBJ-WKzA.mjs";
15
+ import { m as listIosRuntimes } from "./ios-E26qSpkb.mjs";
16
16
  import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
17
- import { V as readBundleId } from "./toolchain-J4J8MrAr.mjs";
18
- import { S as setRemoteLogSink } from "./client-D9CaRks-.mjs";
19
- import { l as resolveBuildPlacement } from "./selection-BNPBZ6T5.mjs";
20
- import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-CVOCp0Ft.mjs";
21
- import { f as settleFingerprintCheck } from "./prebuild-gmouvmJZ.mjs";
22
- import { n as ensureWorkspaceStorageSafely } from "./native-runtime-Dq3RBcON.mjs";
23
- import { t as acquireAndroidArtifact } from "./artifact-BxREhAaV.mjs";
24
- import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-7F5hEwQJ.mjs";
25
- import { a as lastBuildRecord } from "./ios-project-Ty5pHl9O.mjs";
26
- import { t as acquireIosArtifact } from "./artifact-CsAP6AGK.mjs";
17
+ import { S as setRemoteLogSink } from "./client-xsdxrhWA.mjs";
18
+ import { d as resolveBuildPlacement } from "./selection-Bs8phwhN.mjs";
19
+ import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-Be0UeVZU.mjs";
20
+ import { f as settleFingerprintCheck } from "./prebuild-BDpToDgR.mjs";
21
+ import { n as ensureWorkspaceStorageSafely } from "./native-runtime-DqaIBO5w.mjs";
22
+ import { t as acquireAndroidArtifact } from "./artifact-0AGJYB9O.mjs";
23
+ import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-CTqBw2Te.mjs";
24
+ import { o as lastBuildRecord } from "./ios-project-D8Jcy_br.mjs";
25
+ import { t as acquireIosArtifact } from "./artifact-faemIZv5.mjs";
27
26
  import { constants, promises } from "node:fs";
28
27
  import { basename, join } from "node:path";
29
28
  import { hostSimulatorArch } from "@stim-cli/core";
@@ -117,13 +116,14 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
117
116
  let directory;
118
117
  let built = null;
119
118
  let failureAfterCleanup = null;
120
- const finishRecord = (status, errorCode) => persistLastBuild({
119
+ const finishRecord = (status, errorCode, message) => persistLastBuild({
121
120
  root,
122
121
  record,
123
122
  startedAt,
124
123
  durationMs: Date.now() - started,
125
124
  status,
126
125
  errorCode,
126
+ message,
127
127
  out: note,
128
128
  recordBuild: (at, entry) => recordFinishedBuild(at, entry, { artifactOnly: true })
129
129
  });
@@ -223,7 +223,7 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
223
223
  };
224
224
  } catch (error) {
225
225
  const failure = runCancellationSignal(context)?.aborted ? cancelledError("Android build", error) : error;
226
- finishRecord("failed", failure.code);
226
+ finishRecord("failed", failure.code, failure instanceof Error ? failure.message : String(failure));
227
227
  stats.record({
228
228
  failed: true,
229
229
  durationMs: Date.now() - started
@@ -233,7 +233,7 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
233
233
  await artifact?.release();
234
234
  failureAfterCleanup = built && runCancellationSignal(context)?.aborted ? cancelledError("Android build") : null;
235
235
  if (failureAfterCleanup) {
236
- finishRecord("failed", failureAfterCleanup.code);
236
+ finishRecord("failed", failureAfterCleanup.code, failureAfterCleanup.message);
237
237
  stats.record({
238
238
  failed: true,
239
239
  durationMs: Date.now() - started
@@ -346,9 +346,13 @@ async function buildIosOperation(context, root, options) {
346
346
  let directory;
347
347
  let built = null;
348
348
  let failureAfterCleanup = null;
349
- const finish = (status, appPath, errorCode) => {
349
+ const finish = (status, appPath, errorCode, message) => {
350
350
  try {
351
351
  recordFinishedBuild(root, lastBuildRecord({
352
+ ledger: {
353
+ scheme: buildScheme,
354
+ message
355
+ },
352
356
  startedAt,
353
357
  status,
354
358
  appPath,
@@ -477,7 +481,7 @@ async function buildIosOperation(context, root, options) {
477
481
  };
478
482
  } catch (error) {
479
483
  const failure = runCancellationSignal(context)?.aborted ? cancelledError("iOS build", error) : error;
480
- finish("failed", void 0, failure.code);
484
+ finish("failed", void 0, failure.code, failure instanceof Error ? failure.message : String(failure));
481
485
  stats.record({
482
486
  failed: true,
483
487
  durationMs: Date.now() - started
@@ -488,7 +492,7 @@ async function buildIosOperation(context, root, options) {
488
492
  await artifact?.release();
489
493
  failureAfterCleanup = built && runCancellationSignal(context)?.aborted ? cancelledError("iOS build") : null;
490
494
  if (failureAfterCleanup) {
491
- finish("failed", void 0, failureAfterCleanup.code);
495
+ finish("failed", void 0, failureAfterCleanup.code, failureAfterCleanup.message);
492
496
  stats.record({
493
497
  failed: true,
494
498
  durationMs: Date.now() - started
@@ -1,9 +1,10 @@
1
- import { T as trackReportResource } from "./exec-VFRpu1iA.mjs";
2
- import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-BF5AR2dL.mjs";
3
- import { Gt as removeTemporaryEntryAsync, Ut as makeTemporaryDirectory } from "./settings-CosW5X-S.mjs";
4
- import { Jn as easAuthNote, V as estimateBuild, Z as readStats } from "./budget-k2mZGvvk.mjs";
5
- import { s as entryDir, t as artifactIn } from "./build-cache-DrXNCy3T.mjs";
6
- import { l as predictBuildMiss, o as staleNativeDirRefusal } from "./prebuild-gmouvmJZ.mjs";
1
+ import { T as trackReportResource } from "./exec-aULwtNly.mjs";
2
+ import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-Dj-WT4BP.mjs";
3
+ import { $t as makeTemporaryDirectory, tn as removeTemporaryEntryAsync } from "./settings-BDVI8Ivc.mjs";
4
+ import { jn as easAuthNote } from "./ccache-BWTze1Ls.mjs";
5
+ import { W as estimateBuild, nt as readStats } from "./workspaces-DFbj07jp.mjs";
6
+ import { s as entryDir, t as artifactIn } from "./build-cache-gBJ-WKzA.mjs";
7
+ import { l as predictBuildMiss, o as staleNativeDirRefusal } from "./prebuild-BDpToDgR.mjs";
7
8
  import chalk from "chalk";
8
9
  import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, resolveTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
9
10
  //#region src/commands/build-plan.ts
@@ -1,4 +1,4 @@
1
- import { d as getConfigDir } from "./config-BktkY_zC.mjs";
1
+ import { d as getConfigDir } from "./config-Cn94Jc0g.mjs";
2
2
  import { cacheDirRefusal, readCacheManifest, updateCacheManifest } from "@stim-cli/core";
3
3
  import { join, resolve } from "path";
4
4
  import { existsSync } from "fs";
@@ -1,2 +1,2 @@
1
- import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-BEZ9Bpl1.mjs";
1
+ import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DEjqGGat.mjs";
2
2
  export { manifestPath, readManifest, register, registeredCaches, unregister };