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
@@ -1,275 +0,0 @@
1
- import { D as ownership_claim_exports, b as operationState, g as signalDeclaredSpawns, h as refuseDeclaredSpawns, p as allowDeclaredSpawns, u as withWorkspaceProcessLock, y as isTermination } from "./exec-VFRpu1iA.mjs";
2
- import { E as workspaceDir, l as withWorkspaceStateLockAsync, o as updateWorkspaceState, r as readWorkspaceState, t as clearWorkspaceStateKey } from "./workspace-state-pUg3_RRA.mjs";
3
- import { a as formatElapsed, l as phaseLine } from "./command-output-BF5AR2dL.mjs";
4
- import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
5
- import { existsSync, mkdirSync } from "node:fs";
6
- import { basename, dirname, join } from "node:path";
7
- import { setTimeout } from "node:timers/promises";
8
- //#region src/cache/cache-claim.ts
9
- const LABEL = "cache";
10
- const POLL_MS = 500;
11
- const EMPTYING_WAIT_MS = 6e5;
12
- /**
13
- * The claim set guarding a cache Stim can only empty whole. It sits beside the cache's resolved directory, so emptying
14
- * the cache never removes it and every path that reaches the same cache names the same set; before the cache exists,
15
- * its resolved parent stands in for it.
16
- */
17
- function cacheClaimRoot(dir) {
18
- return `${existsSync(dir) ? canonicalPath(dir) : join(canonicalPath(dirname(dir)), basename(dir))}.claims`;
19
- }
20
- function describe(holder) {
21
- const { platform, projectRoot } = holder.details;
22
- const where = typeof projectRoot === "string" ? ` in ${projectRoot}` : "";
23
- return holder.mode === "shared" ? `the ${typeof platform === "string" ? platform : "iOS"} build (pid ${holder.owner.pid}${where}) may be using it` : `pid ${holder.owner.pid} is emptying it`;
24
- }
25
- /** Why the cache at `dir` may be in use, from its claim set, without taking or removing any claim. */
26
- function cacheUser(dir) {
27
- const root = cacheClaimRoot(dir);
28
- const survey = (0, ownership_claim_exports.readClaimSet)(root);
29
- const problem = survey.unresolved[0];
30
- if (problem) return `the cache claim ${problem.path} is unresolved, so a build may be using it`;
31
- const holder = survey.live[0];
32
- return holder ? describe(holder) : void 0;
33
- }
34
- /**
35
- * Takes the exclusive claim an emptier holds while it removes the cache's contents; a string is why it cannot.
36
- * It never waits for a build that holds the cache.
37
- */
38
- function claimForEmptying(dir) {
39
- try {
40
- const attempt = (0, ownership_claim_exports.tryAcquireClaim)({
41
- root: cacheClaimRoot(dir),
42
- mode: "exclusive",
43
- label: LABEL
44
- });
45
- if (attempt.acquired) return attempt.acquired;
46
- if (attempt.pending) (0, ownership_claim_exports.releaseClaim)(attempt.pending);
47
- const holder = attempt.held ?? attempt.waitingFor?.[0];
48
- return holder ? describe(holder) : `its claim at ${cacheClaimRoot(dir)} could not be taken`;
49
- } catch (error) {
50
- if ((0, ownership_claim_exports.isClaimRefusal)(error) || (0, ownership_claim_exports.isClaimUnavailable)(error)) return error.message;
51
- return `its claim at ${cacheClaimRoot(dir)} could not be taken: ${error instanceof Error ? error.message : String(error)}`;
52
- }
53
- }
54
- /**
55
- * Takes the shared claim a build holds on the compilation cache it compiles with, waiting while an emptier holds it.
56
- * A claim set Stim cannot resolve, or no process identity, is a failure: the build never runs unguarded.
57
- */
58
- async function shareCompilationCache({ dir, projectRoot, note, signal }) {
59
- const started = Date.now();
60
- let told = false;
61
- for (;;) {
62
- signal?.throwIfAborted();
63
- let attempt;
64
- let root = `${dir}.claims`;
65
- try {
66
- mkdirSync(dirname(dir), { recursive: true });
67
- root = cacheClaimRoot(dir);
68
- attempt = (0, ownership_claim_exports.tryAcquireClaim)({
69
- root,
70
- mode: "shared",
71
- label: LABEL,
72
- details: {
73
- platform: "ios",
74
- projectRoot
75
- }
76
- });
77
- } catch (error) {
78
- return { failure: (0, ownership_claim_exports.claimFailure)(error, null) ?? {
79
- code: ownership_claim_exports.CLAIM_UNAVAILABLE,
80
- message: `Stim could not take the compilation cache claim at ${root}: ${error instanceof Error ? error.message : String(error)}.`,
81
- remedy: `Restore write access to ${dirname(root)}, then retry the same Stim command.`
82
- } };
83
- }
84
- if (attempt.acquired) return { claim: attempt.acquired };
85
- const emptier = attempt.held ? `pid ${attempt.held.owner.pid}` : "another process";
86
- const waited = Date.now() - started;
87
- if (waited >= EMPTYING_WAIT_MS) return { failure: {
88
- code: "STIM_BUILD_FAILED",
89
- message: `${emptier} has been emptying the compilation cache at ${dir} for ${formatElapsed(waited)}.`,
90
- remedy: "Run the same command again once it has finished."
91
- } };
92
- if (!told) note(phaseLine("build", `waiting for ${emptier} to finish emptying the compilation cache at ${dir}`));
93
- told = true;
94
- await setTimeout(POLL_MS);
95
- }
96
- }
97
- //#endregion
98
- //#region src/engine/native-run.ts
99
- const NATIVE_RUN_LOCK = "native-run";
100
- const NATIVE_RUN_WAIT_MS = 18e5;
101
- const WAIT_HEARTBEAT_MS = 3e4;
102
- const CANCEL_REQUEST_KEY = "nativeRunCancel";
103
- const REQUEST_POLL_MS = 250;
104
- function nativeRunHolder(holder) {
105
- const { command, platform, slot, interrupt } = holder.details;
106
- return {
107
- command: typeof command === "string" ? command : null,
108
- platform: typeof platform === "string" ? platform : null,
109
- slot: typeof slot === "string" ? slot : "default",
110
- takesSignals: interrupt === "signal"
111
- };
112
- }
113
- function describeNativeRunHolder(holder, now) {
114
- const { command, slot } = nativeRunHolder(holder);
115
- const started = Date.parse(holder.startedAt);
116
- const facts = [`pid ${holder.owner.pid}`];
117
- if (Number.isFinite(started)) facts.push(`running for ${formatElapsed(now - started)}`);
118
- if (command === null) return `another Stim run (${facts.join(", ")})`;
119
- if (command === "build") return `an artifact build (${facts.join(", ")})`;
120
- return `\`stim ${command}${slot === "default" ? "" : ` --slot ${slot}`}\` (${facts.join(", ")})`;
121
- }
122
- /**
123
- * Report a wait on the native-run lock: one line as soon as a holder is seen, a line for each new
124
- * holder, and a heartbeat every WAIT_HEARTBEAT_MS while the same holder keeps it.
125
- */
126
- function nativeRunWaitNotice({ write, now = Date.now, describe = describeNativeRunHolder }) {
127
- let claimId = null;
128
- let lastAt = 0;
129
- return (holder, firstLine) => {
130
- const at = now();
131
- if (holder.claimId !== claimId) {
132
- claimId = holder.claimId;
133
- lastAt = at;
134
- write(firstLine ?? `waiting for ${describe(holder, at)} in this workspace to finish`);
135
- return;
136
- }
137
- if (at - lastAt < WAIT_HEARTBEAT_MS) return;
138
- lastAt = at;
139
- write(`still waiting for ${describe(holder, at)}`);
140
- };
141
- }
142
- /**
143
- * What `stop` does about the run holding the native-run lock. A build is interrupted only when the stop
144
- * leaves it nothing to deploy to: the whole workspace stops, the build targets the stopped slot, or the
145
- * stopped slot is the workspace's only device. A build for another slot that stays is left running and
146
- * the stop proceeds without the lock. Only an owner whose identity is proven live is signalled.
147
- */
148
- function decideStopAction({ stopSlot, holder, ownerIdentity, deviceSlots }) {
149
- if (holder.command === "macos" || holder.command === "build") {
150
- if (stopSlot !== void 0) return { action: "proceed" };
151
- return ownerIdentity === "same" ? { action: "interrupt" } : { action: "refuse" };
152
- }
153
- if (holder.command !== "ios" && holder.command !== "android") return { action: "wait" };
154
- if (!(stopSlot === void 0 || holder.slot === stopSlot || deviceSlots.includes(stopSlot) && deviceSlots.every((slot) => slot === stopSlot))) return { action: "proceed" };
155
- return ownerIdentity === "same" ? { action: "interrupt" } : { action: "refuse" };
156
- }
157
- const requestListeners = /* @__PURE__ */ new Map();
158
- /**
159
- * Ask the run holding `claimId` to cancel: the request is written to the workspace state, where the run's watch
160
- * finds it, and a run in this process is told at once.
161
- */
162
- function requestNativeRunCancel(root, claimId, pid = process.pid) {
163
- updateWorkspaceState(root, (state) => ({
164
- ...state,
165
- [CANCEL_REQUEST_KEY]: {
166
- claimId,
167
- pid,
168
- at: (/* @__PURE__ */ new Date()).toISOString()
169
- }
170
- }));
171
- requestListeners.get(claimId)?.();
172
- }
173
- function cancelRequestFor(root, claimId) {
174
- const request = readWorkspaceState(root)?.[CANCEL_REQUEST_KEY];
175
- if (request?.claimId !== claimId || typeof request.pid !== "number") return null;
176
- return { pid: request.pid };
177
- }
178
- function clearNativeRunCancel(root, claimId) {
179
- try {
180
- clearWorkspaceStateKey(root, CANCEL_REQUEST_KEY, (value) => value?.claimId === claimId);
181
- } catch {}
182
- }
183
- /** The active native run of `context`'s operation aborts this signal when it is cancelled. */
184
- function runCancellationSignal(context) {
185
- return operationState(context).runSignal;
186
- }
187
- /** Why `context`'s native run was cancelled, or null while it was not. */
188
- function runCancellation(context) {
189
- return operationState(context).cancelled;
190
- }
191
- function cancelledFailure(context, platform, { code, message }) {
192
- const cancelled = runCancellation(context);
193
- if (cancelled === null || code === "STIM_CLAIM_UNAVAILABLE") return null;
194
- return {
195
- code: "STIM_CANCELLED",
196
- message: `The ${platform} run was ${cancelled} before it finished.`,
197
- remedy: `Run \`stim ${platform}\` again when you want the app on a device.`,
198
- lines: [`it stopped at ${code ?? "an unfinished step"}${message ? `: ${message}` : ""}`]
199
- };
200
- }
201
- function cancelOnAbort({ context, root, claim, write, controller }) {
202
- const state = operationState(context);
203
- const cancel = () => {
204
- if (controller.signal.aborted) return;
205
- const request = cancelRequestFor(root, claim.claimId);
206
- const cancelled = request ? `cancelled by \`stim stop\` (pid ${request.pid})` : "cancelled by an interrupt";
207
- state.cancelled = cancelled;
208
- state.handled = true;
209
- controller.abort();
210
- refuseDeclaredSpawns(context, `the run was ${cancelled}`);
211
- const signalled = signalDeclaredSpawns(context, "SIGINT");
212
- if (signalled > 0 || request) state.draining = true;
213
- write(signalled > 0 ? `${cancelled}; stopping the running build tool` : request ? `${cancelled}; stopping before the next build tool or install` : cancelled);
214
- };
215
- const onAbort = () => {
216
- if (!isTermination(context.signal.reason)) cancel();
217
- };
218
- const onRequest = () => {
219
- if (controller.signal.aborted || !cancelRequestFor(root, claim.claimId)) return;
220
- cancel();
221
- state.abortOperation?.("stop");
222
- };
223
- context.signal.addEventListener("abort", onAbort);
224
- if (context.signal.aborted) onAbort();
225
- requestListeners.set(claim.claimId, onRequest);
226
- const watch = setInterval(onRequest, REQUEST_POLL_MS);
227
- watch.unref();
228
- return async () => {
229
- clearInterval(watch);
230
- requestListeners.delete(claim.claimId);
231
- context.signal.removeEventListener("abort", onAbort);
232
- allowDeclaredSpawns(context);
233
- await withWorkspaceStateLockAsync(root, () => clearNativeRunCancel(root, claim.claimId)).catch(() => {});
234
- };
235
- }
236
- /**
237
- * Run an `ios`, `android` or `macos` invocation under the workspace's native-run lock: the claim records the
238
- * command, platform and slot, and a wait for another holder is reported on `write`. An abort of `context.signal`
239
- * forwards an interrupt to the running declared build tool and refuses any later one; a run `stim stop` cancelled
240
- * stops before its next build tool or install. A `SIGTERM` abort reason is left to the caller.
241
- */
242
- function withNativeBuildRun(context, root, details, fn, { write }) {
243
- const notice = nativeRunWaitNotice({ write });
244
- const state = operationState(context);
245
- return withWorkspaceProcessLock(workspaceDir(root), NATIVE_RUN_LOCK, async (claim) => {
246
- state.cancelled = null;
247
- const controller = new AbortController();
248
- state.runSignal = controller.signal;
249
- const dispose = cancelOnAbort({
250
- context,
251
- root,
252
- claim,
253
- write,
254
- controller
255
- });
256
- try {
257
- return await fn(claim);
258
- } finally {
259
- await dispose();
260
- state.runSignal = void 0;
261
- }
262
- }, {
263
- external: true,
264
- signal: context.signal,
265
- waitMs: NATIVE_RUN_WAIT_MS,
266
- declareSpawnsFor: context,
267
- details: {
268
- ...details,
269
- interrupt: state.takesSignals ? "signal" : "request"
270
- },
271
- onHeld: (holder) => notice(holder)
272
- });
273
- }
274
- //#endregion
275
- export { decideStopAction as a, nativeRunWaitNotice as c, runCancellationSignal as d, withNativeBuildRun as f, shareCompilationCache as h, clearNativeRunCancel as i, requestNativeRunCancel as l, claimForEmptying as m, NATIVE_RUN_WAIT_MS as n, describeNativeRunHolder as o, cacheUser as p, cancelledFailure as r, nativeRunHolder as s, NATIVE_RUN_LOCK as t, runCancellation as u };
@@ -1,2 +0,0 @@
1
- import { m as startExpoServer } from "./server-expo-eQfOdydb.mjs";
2
- export { startExpoServer };
@@ -1,360 +0,0 @@
1
- import { u as withWorkspaceProcessLock } from "./exec-VFRpu1iA.mjs";
2
- import { A as writeConfigSettingAsync, O as withConfigLockAsync$1, _ as loadConfig$1, f as getConfigPath$1, h as getRepoSettings, m as getProjectSettings } from "./config-BktkY_zC.mjs";
3
- import { a as killOnAbort, i as gitPath } from "./operation-exec-CUZifp6Z.mjs";
4
- import { B as readCommittedSettings, at as unknownSettingKeys } from "./settings-CosW5X-S.mjs";
5
- import { r as findCommandWorkspaceAsync, t as NO_PROJECT_REFUSAL } from "./project-BUu6Is4k.mjs";
6
- import { i as stimDesktopInstalledAsync, n as settingDefault, r as stimDesktopInstalled } from "./stim-desktop-6Dqp-gjX.mjs";
7
- import { n as recordingLayers, t as deleteTurnedOffRecordings } from "./recordings-BldzVKq0.mjs";
8
- import { existsSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
9
- import { join } from "node:path";
10
- import { configDir } from "@stim-cli/core";
11
- import { SETTINGS, SETTING_SCOPES, coerceSettingText, isJsonObject, isSensitiveReference, settingDefinition, settingValueError } from "@stim-cli/core/state";
12
- //#region src/workspace/settings-payload.ts
13
- const MASK = "********";
14
- const PRECEDENCE = [
15
- "workspace",
16
- "repo",
17
- "committed",
18
- "machine"
19
- ];
20
- var SettingsRefusal = class extends Error {
21
- code;
22
- remedy;
23
- constructor(code, message, remedy) {
24
- super(message);
25
- this.code = code;
26
- this.remedy = remedy;
27
- }
28
- };
29
- /** Reads layers using exactly `env`; `signal` kills Git children. `resolvedProject` pins a mutation's readback target. */
30
- async function readSettingsContext(cwd, env, note = () => {}, signal, resolvedProject) {
31
- const repoRootOf = (dir) => gitPath(dir, ["--show-toplevel"], env, signal);
32
- const projectPath = resolvedProject === void 0 ? await findCommandWorkspaceAsync(cwd, repoRootOf, note) : resolvedProject;
33
- const start = projectPath ?? cwd;
34
- const [common, root] = await Promise.all([gitPath(start, ["--path-format=absolute", "--git-common-dir"], env, signal), repoRootOf(start)]);
35
- signal?.throwIfAborted();
36
- const repoRoot = common ? root ?? projectPath : null;
37
- const app = projectPath ?? repoRoot;
38
- const repository = repoRoot ?? projectPath;
39
- const committed = readCommittedSettings(app);
40
- let installed;
41
- return {
42
- projectPath,
43
- gitCommonDir: common,
44
- repoRoot,
45
- machine: loadConfig$1(),
46
- workspace: projectPath ? getProjectSettings(projectPath) : {},
47
- repo: common ? getRepoSettings(common) : {},
48
- committed: {
49
- app: committed,
50
- repository: repository === app ? committed : readCommittedSettings(repository)
51
- },
52
- env,
53
- desktopInstalled: () => installed ??= stimDesktopInstalled(process.platform, env)
54
- };
55
- }
56
- function valueAt(settings, key) {
57
- let node = settings;
58
- for (const segment of key.split(".")) {
59
- if (!isJsonObject(node)) return void 0;
60
- node = node[segment];
61
- }
62
- return node;
63
- }
64
- function committedDirectory(context, setting) {
65
- return setting?.committedAt === "repository" ? repositoryDirectory(context) : appDirectory(context);
66
- }
67
- function repositoryDirectory(context) {
68
- return context.repoRoot ?? context.projectPath;
69
- }
70
- function appDirectory(context) {
71
- return context.projectPath ?? context.repoRoot;
72
- }
73
- function layerFile(context, scope, setting) {
74
- const machineFile = getConfigPath$1();
75
- if (scope === "machine") return machineFile;
76
- if (scope === "workspace") return context.projectPath ? `${machineFile} (projects["${context.projectPath}"].settings)` : null;
77
- if (scope === "repo") return context.gitCommonDir ? `${machineFile} (repos["${context.gitCommonDir}"].settings)` : null;
78
- const directory = committedDirectory(context, setting);
79
- return directory ? join(directory, ".stim.json") : null;
80
- }
81
- function layerSettings(context, scope, setting) {
82
- if (scope === "machine") return context.machine ?? {};
83
- if (scope === "workspace") return context.workspace;
84
- if (scope === "repo") return context.repo;
85
- return setting?.committedAt === "repository" ? context.committed.repository : context.committed.app;
86
- }
87
- function masked(setting, value) {
88
- return setting.sensitive && value !== void 0 && value !== null ? MASK : value;
89
- }
90
- function settingExample(setting) {
91
- switch (setting.type.kind) {
92
- case "boolean": return "false";
93
- case "number": return String(setting.default ?? setting.type.minimum ?? 1);
94
- case "strings": return `'["node_modules"]'`;
95
- case "object": return `'{"key": "value"}'`;
96
- case "choice": return setting.type.choices[0];
97
- default: return "<value>";
98
- }
99
- }
100
- function envSettingValue(setting, raw) {
101
- const value = coerceSettingText(setting, raw);
102
- const error = settingValueError(setting, value);
103
- if (error) throw new SettingsRefusal("STIM_BAD_ARG", `Invalid ${setting.env} value ${JSON.stringify(raw)}. Expected ${error}.`, `Fix the environment variable, or unset it and run \`stim settings set ${setting.key} ${settingExample(setting)}\`.`);
104
- return value;
105
- }
106
- function settingEntry(context, setting) {
107
- const layers = {};
108
- for (const scope of PRECEDENCE) {
109
- if (!setting.scopes.includes(scope) || layerFile(context, scope, setting) === null) continue;
110
- const value = valueAt(layerSettings(context, scope, setting), setting.key);
111
- if (value !== void 0) layers[scope] = masked(setting, value);
112
- }
113
- const envValue = setting.env ? context.env[setting.env] : void 0;
114
- const env = setting.env && envValue ? {
115
- name: setting.env,
116
- value: String(masked(setting, envValue))
117
- } : void 0;
118
- const scopedHome = !env && setting.scopedHomeValue !== void 0 && context.env.STIM_HOME;
119
- const ci = !env && setting.ciValue !== void 0 && context.env.CI;
120
- const winner = PRECEDENCE.find((scope) => scope in layers);
121
- let value = null;
122
- let origin = null;
123
- let defaultReason = null;
124
- if (env) {
125
- value = masked(setting, envSettingValue(setting, envValue));
126
- origin = "env";
127
- } else if (scopedHome) {
128
- value = setting.scopedHomeValue;
129
- origin = "env";
130
- } else if (ci) {
131
- value = setting.ciValue;
132
- origin = "env";
133
- } else if (winner) {
134
- value = layers[winner];
135
- origin = winner;
136
- } else if (setting.default !== void 0) {
137
- const fallback = settingDefault(setting, context.desktopInstalled);
138
- value = fallback.value;
139
- origin = "default";
140
- defaultReason = fallback.reason;
141
- }
142
- return {
143
- key: setting.key,
144
- value,
145
- origin,
146
- layers,
147
- ...env ? { env } : scopedHome ? { env: {
148
- name: "STIM_HOME",
149
- value: context.env.STIM_HOME
150
- } } : ci ? { env: {
151
- name: "CI",
152
- value: context.env.CI
153
- } } : {},
154
- ...setting.sensitive ? { sensitive: true } : {},
155
- ...defaultReason ? { defaultReason } : {}
156
- };
157
- }
158
- function unknownEntries(context) {
159
- const sources = [
160
- {
161
- scope: "machine",
162
- file: layerFile(context, "machine", null),
163
- settings: { optimizations: context.machine?.optimizations }
164
- },
165
- {
166
- scope: "workspace",
167
- file: layerFile(context, "workspace", null),
168
- settings: layerSettings(context, "workspace", null)
169
- },
170
- {
171
- scope: "repo",
172
- file: layerFile(context, "repo", null),
173
- settings: layerSettings(context, "repo", null)
174
- },
175
- {
176
- scope: "committed",
177
- file: layerFile(context, "committed", null),
178
- settings: layerSettings(context, "committed", null)
179
- }
180
- ];
181
- const repository = repositoryDirectory(context);
182
- if (repository && repository !== appDirectory(context)) sources.push({
183
- scope: "committed",
184
- file: join(repository, ".stim.json"),
185
- settings: context.committed.repository
186
- });
187
- return sources.flatMap(({ scope, file, settings }) => file === null ? [] : unknownSettingKeys(settings).map((key) => ({
188
- key,
189
- scope,
190
- file,
191
- value: valueAt(settings, key)
192
- })));
193
- }
194
- function settingsPayload(context) {
195
- const files = {};
196
- for (const scope of SETTING_SCOPES) {
197
- const file = layerFile(context, scope, null);
198
- if (file) files[scope] = file;
199
- }
200
- return {
201
- project: context.projectPath,
202
- files,
203
- settings: SETTINGS.map((setting) => settingEntry(context, setting)),
204
- unknown: unknownEntries(context)
205
- };
206
- }
207
- /** Every setting with its effective value and layers; looks Stim Desktop up asynchronously, and only when a default depends on it. */
208
- async function readSettingsPayload(context, signal) {
209
- let asked = false;
210
- const payload = settingsPayload({
211
- ...context,
212
- desktopInstalled: () => {
213
- asked = true;
214
- return false;
215
- }
216
- });
217
- if (!asked) return payload;
218
- const installed = await stimDesktopInstalledAsync(process.platform, context.env, killOnAbort(signal));
219
- signal?.throwIfAborted();
220
- return settingsPayload({
221
- ...context,
222
- desktopInstalled: () => installed
223
- });
224
- }
225
- //#endregion
226
- //#region src/workspace/settings-write.ts
227
- function requireSetting(key) {
228
- const setting = settingDefinition(key);
229
- if (setting) return setting;
230
- throw new SettingsRefusal("STIM_BAD_ARG", `${JSON.stringify(key)} is not a Stim setting.`, "Run `stim settings` to list every setting, or `stim guide settings` for what each one does.");
231
- }
232
- function readScope(raw, setting) {
233
- if (raw === void 0) {
234
- if (setting.scopes.length === 1) return setting.scopes[0];
235
- throw new SettingsRefusal("STIM_BAD_ARG", `${setting.key} can live in more than one layer, so the command needs --scope.`, `Pass --scope ${setting.scopes.join("|")}.`);
236
- }
237
- if (!SETTING_SCOPES.includes(raw)) throw new SettingsRefusal("STIM_BAD_ARG", `--scope takes ${SETTING_SCOPES.join(", ")}, not ${JSON.stringify(raw)}.`, null);
238
- const scope = raw;
239
- if (!setting.scopes.includes(scope)) throw new SettingsRefusal("STIM_BAD_ARG", `${setting.key} is not read from the ${scope} layer.`, `Pass --scope ${setting.scopes.join("|")}.`);
240
- return scope;
241
- }
242
- function requireLayer(context, scope, setting) {
243
- const file = layerFile(context, scope, setting);
244
- if (file) return file;
245
- if (scope === "repo") throw new SettingsRefusal("STIM_BAD_ARG", "The repo layer is keyed by a Git repository, and this directory is not inside one.", "Run this from inside the repository, or pick another --scope.");
246
- throw new SettingsRefusal(NO_PROJECT_REFUSAL.code, NO_PROJECT_REFUSAL.message, NO_PROJECT_REFUSAL.remedy);
247
- }
248
- function parseSettingValue(setting, raw) {
249
- const invalid = (expected) => new SettingsRefusal("STIM_BAD_ARG", `Invalid ${setting.key} value ${JSON.stringify(raw)}. Expected ${expected}.`, `For example: stim settings set ${setting.key} ${settingExample(setting)}${setting.scopes.length > 1 ? ` --scope ${setting.scopes[0]}` : ""}`);
250
- const kind = setting.type.kind;
251
- const value = coerceSettingText(setting, raw);
252
- const error = settingValueError(setting, value);
253
- if (error) throw invalid(kind === "strings" || kind === "object" ? `${error}, written as JSON` : error);
254
- return value;
255
- }
256
- function committedTarget(context, setting) {
257
- const directory = committedDirectory(context, setting);
258
- if (!directory) throw new SettingsRefusal(NO_PROJECT_REFUSAL.code, NO_PROJECT_REFUSAL.message, NO_PROJECT_REFUSAL.remedy);
259
- return join(directory, ".stim.json");
260
- }
261
- function writeCommitted(file, key, value, signal) {
262
- return withConfigLockAsync$1(() => {
263
- const exists = existsSync(file);
264
- const text = exists ? readFileSync(file, "utf-8") : "";
265
- let parsed = {};
266
- if (exists && text.trim() !== "") try {
267
- parsed = JSON.parse(text);
268
- } catch (error) {
269
- throw new SettingsRefusal("STIM_BAD_ARG", `${file} is not valid JSON: ${error.message}`, `Repair ${file}, then run the command again.`);
270
- }
271
- if (!isJsonObject(parsed)) throw new SettingsRefusal("STIM_BAD_ARG", `${file} is not a JSON object.`, `Repair ${file}, then run the command again.`);
272
- const parts = key.split(".");
273
- const chain = [parsed];
274
- for (const part of parts.slice(0, -1)) {
275
- const node = chain.at(-1);
276
- if (!isJsonObject(node[part])) {
277
- if (value === void 0) return false;
278
- node[part] = {};
279
- }
280
- chain.push(node[part]);
281
- }
282
- const leaf = parts.at(-1);
283
- const parent = chain.at(-1);
284
- if (value === void 0) {
285
- if (!(leaf in parent)) return false;
286
- delete parent[leaf];
287
- for (let index = chain.length - 1; index > 0; index--) {
288
- if (Object.keys(chain[index]).length > 0) break;
289
- delete chain[index - 1][parts[index - 1]];
290
- }
291
- } else parent[leaf] = value;
292
- const indent = /\n([ \t]+)"/.exec(text)?.[1] ?? 2;
293
- const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
294
- writeFileSync(tmp, `${JSON.stringify(parsed, null, indent)}\n`);
295
- try {
296
- renameSync(tmp, file);
297
- } catch (error) {
298
- try {
299
- unlinkSync(tmp);
300
- } catch {}
301
- throw error;
302
- }
303
- return true;
304
- }, signal);
305
- }
306
- function writeSetting(context, setting, scope, value, signal) {
307
- if (scope === "committed") return writeCommitted(committedTarget(context, setting), setting.key, value, signal);
308
- if (scope === "machine") return writeConfigSettingAsync({ scope }, setting.key, value, signal);
309
- if (scope === "workspace") return writeConfigSettingAsync({
310
- scope,
311
- projectPath: context.projectPath
312
- }, setting.key, value, signal);
313
- return writeConfigSettingAsync({
314
- scope,
315
- gitCommonDir: context.gitCommonDir
316
- }, setting.key, value, signal);
317
- }
318
- /** Shares CLI set/unset validation and side effects; after commit, recording cleanup finishes despite cancellation. */
319
- async function mutateSetting(request, { cwd, env, note = () => {}, signal, beforeWrite }) {
320
- signal?.throwIfAborted();
321
- const { key } = request;
322
- const setting = requireSetting(key);
323
- const scope = readScope(request.scope, setting);
324
- const value = request.action === "set" ? parseSettingValue(setting, request.value) : void 0;
325
- if (setting.sensitive && scope === "committed" && value !== void 0 && !isSensitiveReference(value)) throw new SettingsRefusal("STIM_BAD_ARG", `${key} is sensitive, so a committed .stim.json takes only an env: or file: reference, never the secret.`, `Set the secret with --scope workspace or --scope repo, which store it in ${getConfigPath$1()}, readable only by you, or commit a reference such as env:MY_KEYSTORE_PASSWORD.`);
326
- const context = await readSettingsContext(cwd, env, note, signal);
327
- const file = requireLayer(context, scope, setting);
328
- beforeWrite?.(context.projectPath);
329
- const apply = async () => {
330
- const recording = setting.key === "recording.enabled" ? recordingLayers() : null;
331
- const changed = await writeSetting(context, setting, scope, value, signal);
332
- const updated = await readSettingsContext(cwd, env, void 0, void 0, context.projectPath);
333
- const recordingsDeleted = recording ? await deleteTurnedOffRecordings(recording) : void 0;
334
- let entry = settingEntry({
335
- ...updated,
336
- desktopInstalled: () => false
337
- }, setting);
338
- if (entry.origin === "default" && setting.desktopDefault !== void 0) {
339
- const installed = await stimDesktopInstalledAsync(process.platform, env);
340
- entry = settingEntry({
341
- ...updated,
342
- desktopInstalled: () => installed
343
- }, setting);
344
- }
345
- return {
346
- key,
347
- scope,
348
- file,
349
- changed,
350
- setting: entry,
351
- ...recordingsDeleted ? { recordingsDeleted } : {}
352
- };
353
- };
354
- return key === "recording.enabled" ? withWorkspaceProcessLock(configDir(), "recording-settings", apply, {
355
- external: true,
356
- signal
357
- }) : apply();
358
- }
359
- //#endregion
360
- export { layerFile as a, settingEntry as c, SettingsRefusal as i, readScope as n, readSettingsContext as o, requireSetting as r, readSettingsPayload as s, mutateSetting as t };
@@ -1,2 +0,0 @@
1
- import { t as triggerMaintenance } from "./trigger-KVaWWNyn.mjs";
2
- export { triggerMaintenance };
@@ -1,2 +0,0 @@
1
- import { n as webCommand, t as runWeb } from "./web-Bihbf7-u.mjs";
2
- export { webCommand as default, runWeb };
@@ -1,2 +0,0 @@
1
- import { _ as worktreeCommand, a as matchWorktreeEntry, c as reclaimKeys, d as removalBlockers, f as removalPath, g as warmedWorkspace, h as warmWorktreeTarget, i as excludeWatchmanCookies, l as registerRemove, m as removeWorktreeTarget, n as dependencyInstallCommand, o as nestedWorktrees, p as removalRemedy, r as excludePodChurn, s as porcelainPath, t as customIosDirs, u as registerWarm } from "./worktree-BKuklFh_.mjs";
2
- export { customIosDirs, worktreeCommand as default, dependencyInstallCommand, excludePodChurn, excludeWatchmanCookies, matchWorktreeEntry, nestedWorktrees, porcelainPath, reclaimKeys, registerRemove, registerWarm, removalBlockers, removalPath, removalRemedy, removeWorktreeTarget, warmWorktreeTarget, warmedWorkspace };