stim 1.18.0 → 1.19.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 (140) hide show
  1. package/README.md +1 -1
  2. package/dist/{activity-BxnkDZDi.mjs → activity-BSw0x84R.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-CZ66YA4T.mjs → agent-device-usage-output-Bjxu_VmX.mjs} +5 -5
  4. package/dist/{android-BvwuMUJ9.mjs → android-BXc6BmEi.mjs} +507 -347
  5. package/dist/{android-DC3ZLuw0.mjs → android-BdQC6zs1.mjs} +6 -6
  6. package/dist/{android-BKA16DTf.mjs → android-BvV1gGdN.mjs} +3 -3
  7. package/dist/{android-CBwCNicO.mjs → android-DE5g_5gv.mjs} +2 -2
  8. package/dist/{android-cas-BBFyr9CA.mjs → android-cas-C87geAg-.mjs} +3 -3
  9. package/dist/android-cas-compiler.mjs +1 -1
  10. package/dist/{api-D0VtFhqk.mjs → api-DIf_s86s.mjs} +5 -7
  11. package/dist/api-run.mjs +8 -8
  12. package/dist/api.d.mts +8 -2
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-D-PUENug.mjs → app-install-CFI4ptUL.mjs} +33 -13
  15. package/dist/{web-DTU0uiWj.mjs → browser-web-CDhqQxhv.mjs} +134 -172
  16. package/dist/{budget-DIhL2BKx.mjs → budget-Dz-kyXLv.mjs} +15 -202
  17. package/dist/{build-facts-DcLv2HSd.d.mts → build-facts-B87vo-Im.d.mts} +32 -1
  18. package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-DiwKSyv9.mjs} +1 -1
  19. package/dist/cache-manifest.mjs +1 -1
  20. package/dist/{chrome-DJnmnS5q.mjs → chrome-BTUOo8p2.mjs} +1 -1
  21. package/dist/{cli-DNJMwADx.mjs → cli-C9Zvgbdc.mjs} +20 -20
  22. package/dist/cli.mjs +1 -1
  23. package/dist/{client-DzhapoMB.mjs → client-CuUo8Nvg.mjs} +248 -23
  24. package/dist/collector-run.d.mts +6 -0
  25. package/dist/collector-run.mjs +6 -6
  26. package/dist/{command-output-CBtzyIgF.mjs → command-output-Bt8ygHE7.mjs} +1 -1
  27. package/dist/{config-CgYMahz7.mjs → config-DC5jEtd1.mjs} +6 -2
  28. package/dist/{created-devices-DKbeWsiK.mjs → created-devices-D0s26Hx5.mjs} +2 -2
  29. package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-DKaS1OM9.mjs} +2 -2
  30. package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-pB_IPfV4.mjs} +1 -1
  31. package/dist/{dev-client-CLnIH02x.mjs → dev-client-CDY_zAmD.mjs} +2 -2
  32. package/dist/{device-D7oCHGWi.mjs → device-BHw0WlHl.mjs} +8 -8
  33. package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-BoN1jQkO.mjs} +23 -12
  34. package/dist/device-host-worker.mjs +14 -14
  35. package/dist/{gradle-C6GKnunQ.mjs → device-ios-B2ruohE-.mjs} +659 -105
  36. package/dist/{device-lease-Co-EwifR.mjs → device-lease-Cu7PtQpZ.mjs} +5 -5
  37. package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-D38SnZtt.mjs} +4 -4
  38. package/dist/{device-pool-F5WvRPtD.mjs → device-pool-CP4rAsHx.mjs} +3 -3
  39. package/dist/{device-remote-tHbd1fKy.mjs → device-remote-B5GiUifk.mjs} +15 -16
  40. package/dist/{doctor-B9ckYUoU.mjs → doctor-PRJH94v6.mjs} +53 -29
  41. package/dist/doctor-watchman-wZhyTdp4.mjs +259 -0
  42. package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics--v5HGOU0.mjs} +10 -10
  43. package/dist/{exec-DWhCZDGm.mjs → exec-i8GDPwq9.mjs} +32 -8
  44. package/dist/{gc-Dh6mXOKC.mjs → gc-CyHMcKcn.mjs} +19 -19
  45. package/dist/{guide-tm6igAaa.mjs → guide-dRaQJJk9.mjs} +409 -472
  46. package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-Bs7fytj7.mjs} +3 -3
  47. package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-C5G4h_OJ.mjs} +1 -1
  48. package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-Bik035eL.mjs} +1 -1
  49. package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-CI9Az9a4.mjs} +7 -7
  50. package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-DABm3ScO.mjs} +4 -4
  51. package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-DbV2aUVw.mjs} +12 -8
  52. package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DYiMBn34.mjs} +7 -7
  53. package/dist/{ios-B3SbOWdw.mjs → ios-BWbHFZVz.mjs} +5 -5
  54. package/dist/{ios-Bvbf0SGY.mjs → ios-DCrkgXEM.mjs} +1 -1
  55. package/dist/{ios-DNpdygiv.mjs → ios-DYUr9LGc.mjs} +7 -6
  56. package/dist/ios-ITYno9rO.mjs +2241 -0
  57. package/dist/{ios-device-vOaByMhw.mjs → ios-device-CJ_ZOGky.mjs} +3 -3
  58. package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-CrW8aMb5.mjs} +1 -1
  59. package/dist/{ios-state-B2pES6Vs.mjs → ios-state-By0XuLTQ.mjs} +1 -1
  60. package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-DCveSE6d.mjs} +4 -4
  61. package/dist/{logs-1Ylc1Ri6.mjs → logs-Bao1HOMy.mjs} +10 -10
  62. package/dist/{macos-DF6C7wUU.mjs → macos-ciyBdTY5.mjs} +108 -130
  63. package/dist/macos-nIOATJmR.mjs +2 -0
  64. package/dist/macos-run.mjs +1 -1
  65. package/dist/maintenance-run.mjs +7 -7
  66. package/dist/manifest-CX0d1IkZ.mjs +148 -0
  67. package/dist/{metro-Dh8T4Ytd.mjs → metro-DI2AjPF_.mjs} +194 -41
  68. package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BxpJLIwh.mjs} +2 -2
  69. package/dist/{plan-placement-CtxkCO54.mjs → miss-reason-CjQCOKqq.mjs} +180 -296
  70. package/dist/{named-ports-BFIz1Shz.mjs → named-ports-B4iWH4E-.mjs} +12 -5
  71. package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BGxsbfny.mjs} +6 -6
  72. package/dist/offload-worker.d.mts +1 -29
  73. package/dist/offload-worker.mjs +9 -8
  74. package/dist/{ownership-D6Se7gg_.mjs → ownership-EB0ySdGK.mjs} +2 -2
  75. package/dist/{placement-log-BcPhRwR4.mjs → placement-log-Dxe34rJm.mjs} +7 -3
  76. package/dist/plan-placement-BVY59qa8.mjs +290 -0
  77. package/dist/{ports-BLTtfBq-.mjs → ports-ByPc0_97.mjs} +3 -3
  78. package/dist/{prebuild-juCyreaR.mjs → prebuild-BKJ3wJI1.mjs} +4 -4
  79. package/dist/{preview-D5V07Nrl.mjs → preview-BbSottmO.mjs} +16 -17
  80. package/dist/project-B5eQ1USs.mjs +612 -0
  81. package/dist/{pull-request-u4vp7zmK.mjs → pull-request-IHNdMnG8.mjs} +1 -1
  82. package/dist/pull-requests.mjs +1 -1
  83. package/dist/react-native-ios-BMh2i25I.mjs +2 -0
  84. package/dist/react-native-ios-CSpIxexZ.mjs +2083 -0
  85. package/dist/{recordings-BAWltsVt.mjs → recordings-Bv8McZN4.mjs} +1 -1
  86. package/dist/{reload-DvyWzVjJ.mjs → reload-rAPdqeRR.mjs} +13 -14
  87. package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-N3hAEaAL.mjs} +4 -4
  88. package/dist/{run-vhtDgpHO.mjs → run-lAkle1-c.mjs} +2 -2
  89. package/dist/{server-bare-B9E7S1aR.mjs → server-bare-CkIjnegq.mjs} +3 -3
  90. package/dist/server-expo-DGsdUGX2.mjs +2 -0
  91. package/dist/{server-expo-DoBHhuzK.mjs → server-expo-n3tUi3Em.mjs} +3 -3
  92. package/dist/{settings-Byp2AQ_E.mjs → settings-2am7TSxp.mjs} +5 -6
  93. package/dist/{settings-CQyMElEP.mjs → settings-CxgngUZk.mjs} +767 -15
  94. package/dist/settings.schema.json +72 -6
  95. package/dist/{simslim-EHBQ2R4G.mjs → simslim-D9LkJxIO.mjs} +5 -5
  96. package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-HV_KtPIw.mjs} +6 -6
  97. package/dist/{stage-g_WqWeaE.mjs → stage-BgaZJVZY.mjs} +1 -1
  98. package/dist/{start-NTc1Ifqs.mjs → start-D8NbxNBb.mjs} +1 -1
  99. package/dist/{start-D-IeOyoK.mjs → start-DtxthMfI.mjs} +29 -22
  100. package/dist/{state-BG-aAk4k.mjs → state-D2KtnALG.mjs} +2 -2
  101. package/dist/{state-xnqpx3AD.mjs → state-Tp4uImDS.mjs} +4 -2
  102. package/dist/{stats-DY6ekz8F.mjs → stats-8EJ5ivFT.mjs} +6 -6
  103. package/dist/{status-DCjZeE-K.mjs → status-BOyp0CUl.mjs} +25 -27
  104. package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-C65jk_q2.mjs} +1 -1
  105. package/dist/{stim-installations-aR_WsNOA.mjs → stim-installations-DbmUjsLv.mjs} +1 -1
  106. package/dist/stop-D0UIpZuh.mjs +72 -0
  107. package/dist/{stop-DIJtD2GL.mjs → stop-DRipAg-e.mjs} +2 -2
  108. package/dist/{stop-BTjs3xbc.mjs → stop-zDlknFoz.mjs} +78 -31
  109. package/dist/supervisor-run.mjs +14 -14
  110. package/dist/{support-BaayeYCf.mjs → support-CNqYkV0y.mjs} +7 -7
  111. package/dist/{support-Bwvbrq5-.mjs → support-DsNaFg6D.mjs} +5 -5
  112. package/dist/swiftpm-macos-aJzPAj1t.mjs +119 -0
  113. package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-C3xSoyUl.mjs} +27 -270
  114. package/dist/{trigger-CJMhwXe8.mjs → trigger-CAhmG-4s.mjs} +3 -3
  115. package/dist/trigger-CoalsMTV.mjs +2 -0
  116. package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-pFLB2e6P.mjs} +133 -36
  117. package/dist/{status-Dcr0Qexd.mjs → watchman-BL1IdOtq.mjs} +75 -7
  118. package/dist/web-DFpFeZu5.mjs +2 -0
  119. package/dist/web-DbbrPUn0.mjs +127 -0
  120. package/dist/web-run.mjs +7 -7
  121. package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CR9X86xJ.mjs} +1 -1
  122. package/dist/{workspaces-xXItD8Dj.mjs → workspaces-Djb2gfi9.mjs} +102 -18
  123. package/dist/{worktree-BSYlofkq.mjs → worktree-BL4M1rhB.mjs} +45 -42
  124. package/dist/{worktree-BJfnU6r5.mjs → worktree-DV-A0LNL.mjs} +1 -1
  125. package/package.json +5 -5
  126. package/shim/bundle-response.cjs +2 -1
  127. package/shim/bundle-response.d.cts +1 -1
  128. package/shim/expo-metro-config.cjs +1 -1
  129. package/dist/device-ios-6MewKKnc.mjs +0 -412
  130. package/dist/guide-status-Bhf9SJXc.mjs +0 -125
  131. package/dist/ios-CPdkoKaa.mjs +0 -3953
  132. package/dist/macos-Ck7OBMNY.mjs +0 -2
  133. package/dist/native-run-B06FkmZx.mjs +0 -158
  134. package/dist/project-C3ChRLZy.mjs +0 -212
  135. package/dist/projects-DD7dBTCj.mjs +0 -92
  136. package/dist/server-expo-Db9HBUoa.mjs +0 -2
  137. package/dist/stop-BGhKMOuH.mjs +0 -48
  138. package/dist/trigger-DWAq9hkw.mjs +0 -2
  139. package/dist/web-B6_bFDn7.mjs +0 -2
  140. package/dist/worktree-CsKYexJM.mjs +0 -753
@@ -1,12 +1,13 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
2
  import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
3
- import { D as fingerprintProject, M as refingerprintAfterMutation } from "./device-lease-Co-EwifR.mjs";
4
- import { F as resolveCcache, _ as buildIos, j as CCACHE_UNAVAILABLE, l as podsAreStale, o as workerToolchain, p as runPodInstall, s as manifestDigest, u as readPodState } from "./toolchain-Bnyd_K3A.mjs";
5
- import { n as recordPrebuild, r as runPrebuild, t as planPrebuild } from "./prebuild-juCyreaR.mjs";
6
- import { a as gradlewPath, i as buildAndroid, r as assembleTaskFor } from "./gradle-C6GKnunQ.mjs";
7
- import { d as podAction } from "./support-BaayeYCf.mjs";
8
- import { t as logLines } from "./run-vhtDgpHO.mjs";
9
- import { r as stageBundle, t as resolveBundleExtras } from "./stage-g_WqWeaE.mjs";
3
+ import { D as fingerprintProject, M as refingerprintAfterMutation } from "./device-lease-Cu7PtQpZ.mjs";
4
+ import { r as CCACHE_UNAVAILABLE, s as resolveCcache, t as manifestDigest } from "./manifest-CX0d1IkZ.mjs";
5
+ import { c as podsAreStale, f as runPodInstall, l as readPodState, o as workerToolchain } from "./toolchain-C3xSoyUl.mjs";
6
+ import { m as assembleTaskFor, o as buildAndroid, s as buildIos, u as gradlewPath } from "./device-ios-B2ruohE-.mjs";
7
+ import { n as recordPrebuild, r as runPrebuild, t as planPrebuild } from "./prebuild-BKJ3wJI1.mjs";
8
+ import { d as podAction } from "./support-CNqYkV0y.mjs";
9
+ import { r as stageBundle, t as resolveBundleExtras } from "./stage-BgaZJVZY.mjs";
10
+ import { t as logLines } from "./run-lAkle1-c.mjs";
10
11
  import { chmodSync, constants, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
11
12
  import { basename, dirname, join } from "node:path";
12
13
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { o as pidExists } from "./metro-Dh8T4Ytd.mjs";
3
- import { c as writeWorkspaceState, o as withWorkspaceStateLock, r as readWorkspaceState } from "./workspace-state-C59dqG-Z.mjs";
2
+ import { c as writeWorkspaceState, o as withWorkspaceStateLock, r as readWorkspaceState } from "./workspace-state-CR9X86xJ.mjs";
3
+ import { s as pidExists } from "./metro-DI2AjPF_.mjs";
4
4
  import { realpathSync } from "node:fs";
5
5
  //#region src/collector/state.ts
6
6
  function collectorRoot(root) {
@@ -1,4 +1,4 @@
1
- import { p as buildPlacementSettings } from "./client-DzhapoMB.mjs";
1
+ import { T as buildPlacementSettings } from "./client-CuUo8Nvg.mjs";
2
2
  //#region src/placement-log.ts
3
3
  /** `machine` is `local` when the run stays on this Mac. */
4
4
  function placementRecord(input) {
@@ -20,7 +20,7 @@ function skippedCandidates(skipped) {
20
20
  msg: reason
21
21
  }));
22
22
  }
23
- function devicePlacementRecord({ platform, fromFlag, placed }) {
23
+ function devicePlacementRecord({ platform, fromFlag, easFallback = false, placed }) {
24
24
  return placementRecord({
25
25
  kind: "device",
26
26
  platform,
@@ -28,7 +28,11 @@ function devicePlacementRecord({ platform, fromFlag, placed }) {
28
28
  key: `${platform}.remote`,
29
29
  value: "auto",
30
30
  from: fromFlag ? "flag" : "setting"
31
- }],
31
+ }, ...easFallback ? [{
32
+ key: "remote.easFallback",
33
+ value: "true",
34
+ from: "setting"
35
+ }] : []],
32
36
  candidates: skippedCandidates(placed.skipped),
33
37
  choice: {
34
38
  machine: placed.placement.machine ?? "local",
@@ -0,0 +1,290 @@
1
+ import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-Bt8ygHE7.mjs";
2
+ import { Ct as removeTemporaryEntry, St as makeTemporaryDirectory } from "./settings-CxgngUZk.mjs";
3
+ import { B as readStats$1, M as estimateBuild } from "./budget-Dz-kyXLv.mjs";
4
+ import { w as entryDir, y as artifactIn } from "./device-lease-Cu7PtQpZ.mjs";
5
+ import { N as hostingMachines } from "./client-CuUo8Nvg.mjs";
6
+ import { r as readHostedNative } from "./ios-state-By0XuLTQ.mjs";
7
+ import { g as automaticDevicePlacement, r as predictBuildMiss, v as probeHost } from "./miss-reason-CjQCOKqq.mjs";
8
+ import { a as easAuthNote } from "./remote-cache-N3hAEaAL.mjs";
9
+ import { i as staleNativeDirRefusal } from "./prebuild-BKJ3wJI1.mjs";
10
+ import { automaticMachineEnabled } from "@stim-cli/core/state";
11
+ import chalk from "chalk";
12
+ import { resolveTieredBuild } from "@stim-cli/cache";
13
+ //#region src/engine/artifact-lifecycle.ts
14
+ async function runArtifactLifecycle(phases) {
15
+ try {
16
+ const resolved = await phases.resolve();
17
+ if (resolved.kind === "ready") return resolved.artifact;
18
+ const cached = resolved.kind === "cached" ? resolved.artifact : await phases.claim?.() ?? null;
19
+ if (cached !== null) {
20
+ const reused = await phases.reuse(cached);
21
+ if (reused !== null) return reused;
22
+ }
23
+ const { build } = phases;
24
+ const placement = build.placement?.select() ?? null;
25
+ if (placement === null) await build.admit();
26
+ const preparation = await build.prepare();
27
+ const late = await build.revalidate(preparation);
28
+ if (late !== null) return late.ready;
29
+ if (build.placement && placement !== null) {
30
+ const offloaded = await build.placement.acquire(placement, preparation);
31
+ if (offloaded !== null) return offloaded.ready;
32
+ await build.admit();
33
+ }
34
+ const artifact = await build.compile(placement, preparation);
35
+ if (await build.validate(preparation) === "cacheable") await build.store(artifact);
36
+ return build.finish ? await build.finish(artifact) : artifact;
37
+ } finally {
38
+ phases.release();
39
+ }
40
+ }
41
+ //#endregion
42
+ //#region src/commands/build-plan.ts
43
+ const DISCARD = {
44
+ file: "",
45
+ written: 0,
46
+ dropped: 0,
47
+ lastError: null,
48
+ write: () => true,
49
+ close: () => ({
50
+ file: "",
51
+ written: 0,
52
+ dropped: 0,
53
+ lastError: null
54
+ })
55
+ };
56
+ async function providerHit({ root, platform, cacheKey, providerConfig }, deps) {
57
+ if (!providerConfig) return null;
58
+ let destinationDir;
59
+ try {
60
+ destinationDir = makeTemporaryDirectory(root, "stim-plan-");
61
+ } catch (error) {
62
+ deps.note(chalk.yellow(phaseLine("cache", `provider not checked: ${error?.message || error}`)));
63
+ return null;
64
+ }
65
+ try {
66
+ const found = await resolveTieredBuild({
67
+ local: {
68
+ resolve: () => null,
69
+ store: () => null
70
+ },
71
+ loadProvider: () => deps.loadCacheProvider({
72
+ projectRoot: root,
73
+ config: providerConfig
74
+ }),
75
+ target: {
76
+ projectRoot: root,
77
+ platform,
78
+ key: cacheKey
79
+ },
80
+ destinationDir,
81
+ warn: (_code, message) => deps.note(chalk.yellow(phaseLine("cache", message)))
82
+ });
83
+ return found ? found.providerName ?? "the cache provider" : null;
84
+ } finally {
85
+ removeTemporaryEntry(destinationDir);
86
+ }
87
+ }
88
+ async function expoRemoteHit(lookup, deps) {
89
+ if (!lookup.expoRemote) return null;
90
+ const { root, platform, isExpo, fingerprint } = lookup;
91
+ const loaded = await deps.loadProjectProvider(root, { isExpo });
92
+ if (loaded?.unavailable) {
93
+ deps.note(chalk.yellow(phaseLine("cache", `provider not usable: ${loaded.unavailable}`)));
94
+ return null;
95
+ }
96
+ if (!loaded?.provider) return null;
97
+ const name = loaded.name ?? "the build cache provider";
98
+ if (name === "eas") {
99
+ const auth = deps.checkEasAuth({
100
+ projectRoot: root,
101
+ owner: loaded.owner || null
102
+ });
103
+ const authNote = easAuthNote(auth);
104
+ if (authNote) deps.note(chalk.yellow(phaseLine("cache", authNote)));
105
+ if (auth?.code === "logged-out") return null;
106
+ }
107
+ const hit = await deps.resolveRemote({
108
+ provider: loaded.provider,
109
+ platform,
110
+ projectRoot: root,
111
+ fingerprintHash: fingerprint,
112
+ runOptions: lookup.expoRemote.runOptions,
113
+ logWriter: DISCARD
114
+ });
115
+ if (hit?.timedOut) deps.note(chalk.yellow(phaseLine("cache", `${name} did not answer; counted as a miss`)));
116
+ else if (hit?.failed) deps.note(chalk.yellow(phaseLine("cache", `${name} could not be used: ${hit.failed}`)));
117
+ return hit?.appPath ? name : null;
118
+ }
119
+ async function planCachedBuild(lookup, deps) {
120
+ const { root, platform, isExpo, fingerprint, sources, cacheKey, cachePolicy } = lookup;
121
+ let cacheHit = false;
122
+ let provider = null;
123
+ if (cachePolicy.read) {
124
+ if (artifactIn(entryDir(platform, cacheKey))) cacheHit = "local";
125
+ else {
126
+ provider = (cachePolicy.remote ? await providerHit(lookup, deps) : null) ?? await expoRemoteHit(lookup, deps);
127
+ if (provider) cacheHit = "remote";
128
+ }
129
+ }
130
+ let prebuild = null;
131
+ let refusal = null;
132
+ let missReason;
133
+ if (!cacheHit) {
134
+ prebuild = deps.planPrebuild(root, platform, {
135
+ isExpo,
136
+ fingerprint,
137
+ sources
138
+ });
139
+ if (prebuild === "refuse") refusal = staleNativeDirRefusal(platform);
140
+ else if (cachePolicy.read) missReason = predictBuildMiss({
141
+ root,
142
+ platform,
143
+ current: {
144
+ hash: fingerprint,
145
+ sources
146
+ },
147
+ prebuild: prebuild === "generate" || prebuild === "regenerate" ? prebuild : null
148
+ });
149
+ }
150
+ return planPayload(lookup, {
151
+ fingerprint,
152
+ cacheKey,
153
+ cacheHit,
154
+ provider,
155
+ cacheSkipped: !cachePolicy.read,
156
+ prebuild,
157
+ ...missReason ? { missReason } : {},
158
+ refusal
159
+ });
160
+ }
161
+ function planPayload({ platform, slot, projectKey }, found) {
162
+ const { refusal, missReason, ...rest } = found;
163
+ const outcome = refusal ? null : found.cacheHit ? "hit" : "cold";
164
+ const estimate = outcome ? estimateBuild(readStats$1().record?.history?.[projectKey], platform, outcome) : {
165
+ expectedMs: null,
166
+ basis: 0
167
+ };
168
+ return {
169
+ platform,
170
+ ...slot === "default" ? {} : { slot },
171
+ ...rest,
172
+ outcome,
173
+ expectedMs: estimate.expectedMs,
174
+ basis: estimate.basis,
175
+ ...missReason ? { missReason } : {},
176
+ ...refusal ? { refusal } : {}
177
+ };
178
+ }
179
+ function cacheLine(plan) {
180
+ if (plan.refusal) return `the build would refuse with ${plan.refusal.code}`;
181
+ if (plan.cacheHit === "local") return "local cache hit";
182
+ if (plan.cacheHit === "remote") return `remote cache hit (${plan.provider})`;
183
+ return `${plan.cacheSkipped ? "cache reads are off" : "cache miss"}: compiles${plan.prebuild === "generate" || plan.prebuild === "regenerate" ? `, ${plan.prebuild}s the native dir` : ""}`;
184
+ }
185
+ function printPlan(plan, json) {
186
+ if (json) {
187
+ console.log(JSON.stringify(plan));
188
+ return;
189
+ }
190
+ const slot = plan.slot ? ` [${plan.slot}]` : "";
191
+ console.log(phaseLine("plan", `${plan.platform}${slot} ${shortHash(plan.fingerprint)} -> ${cacheLine(plan)}`));
192
+ if (plan.placement) console.log(phaseLine("placement", plan.placement));
193
+ if (plan.missReason) console.log(phaseLine("cache", `miss: ${plan.missReason.summary}`));
194
+ if (plan.refusal) {
195
+ console.log(phaseLine("error", plan.refusal.message));
196
+ console.log(phaseLine("remedy", plan.refusal.remedy));
197
+ return;
198
+ }
199
+ console.log(phaseLine("expect", plan.expectedMs === null ? `unknown: no ${plan.outcome} run of this project is recorded yet` : `~${formatDuration(plan.expectedMs)} (median of ${plural(plan.basis, `${plan.outcome} run`)})`));
200
+ }
201
+ function refusePlan({ code, message, remedy }, json, lines = []) {
202
+ console.error(chalk.red(phaseLine("error", message)));
203
+ for (const line of lines) console.error(chalk.dim(phaseLine("", line)));
204
+ console.error(chalk.dim(phaseLine("remedy", remedy)));
205
+ console.error(chalk.red(phaseLine("failed", code)));
206
+ if (json) console.log(JSON.stringify({
207
+ code,
208
+ message,
209
+ remedy
210
+ }));
211
+ process.exitCode = 1;
212
+ }
213
+ const PLAN_ONLY_REMEDY = "Drop the flag to plan the owned simulator or emulator build, or run the command without --plan.";
214
+ function planFlagRefusal(flag) {
215
+ return {
216
+ code: "STIM_BAD_ARG",
217
+ message: `${flag} does not apply to --plan, which predicts the next local build without choosing a device.`,
218
+ remedy: PLAN_ONLY_REMEDY
219
+ };
220
+ }
221
+ //#endregion
222
+ //#region src/device-host/plan-placement.ts
223
+ /**
224
+ * Where `--plan` assumes the next run puts its simulator or emulator, with no session, reservation or state write.
225
+ * A named Mac, or the Mac a recorded session already holds, answers with the device its `device-host.offer` would
226
+ * give; `auto` repeats the placement decision a run makes now and, when that stays on this Mac, notes any Mac
227
+ * whose device would key differently. The result predicts the cache key only; a run reads its own device.
228
+ */
229
+ async function planHostedDevice({ root, slot, platform, machine, selectors, sameKey, eas, deps = {} }) {
230
+ const { automatic = automaticDevicePlacement, probe = probeHost, machines = hostingMachines } = deps;
231
+ const named = async (name) => {
232
+ const result = await probe(name, platform, selectors);
233
+ if ("failure" in result.probe) return {
234
+ kind: "unknown",
235
+ reason: `${name} did not give a ${platform} device (${result.probe.failure})`
236
+ };
237
+ const { choice, declined } = result.probe.offer;
238
+ if (!choice) return {
239
+ kind: "unknown",
240
+ reason: `${name} has no ${platform} device for this selection${declined ? ` (${declined})` : ""}`
241
+ };
242
+ return {
243
+ kind: "hosted",
244
+ choice,
245
+ placement: `on ${name}`
246
+ };
247
+ };
248
+ if (machine !== "auto") return named(machine);
249
+ try {
250
+ const recorded = readHostedNative(root, platform, slot)[slot];
251
+ if (recorded) return await named(recorded.machine);
252
+ const placed = await automatic({
253
+ root,
254
+ slot,
255
+ platform,
256
+ selectors,
257
+ noWait: false,
258
+ ...eas ? { eas } : {}
259
+ }, {
260
+ read: () => ({}),
261
+ write: () => {}
262
+ });
263
+ if (placed.placement.decision === "eas") return {
264
+ kind: "unknown",
265
+ reason: `auto would run on an EAS Simulator now (${placed.placement.reason}), which --plan cannot read without a session`
266
+ };
267
+ if (placed.target) return {
268
+ kind: "hosted",
269
+ choice: placed.target.choice,
270
+ placement: `on ${placed.target.host.machine}, as auto would now`
271
+ };
272
+ const names = (machines() ?? []).filter((name) => automaticMachineEnabled("device", name));
273
+ const differs = (await Promise.all(names.map((name) => probe(name, platform, selectors)))).flatMap(({ probe: each }) => "offer" in each && each.offer.choice && sameKey(each.offer.choice) === false ? [each.machine] : []);
274
+ if (differs.length) return {
275
+ kind: "local",
276
+ placement: `this Mac; auto may use ${differs.join(", ")}, which builds for another architecture, so its key differs`
277
+ };
278
+ return {
279
+ kind: "local",
280
+ placement: names.length ? `this Mac; auto may use ${names.join(", ")}` : "this Mac"
281
+ };
282
+ } catch (error) {
283
+ return {
284
+ kind: "unknown",
285
+ reason: error.message
286
+ };
287
+ }
288
+ }
289
+ //#endregion
290
+ export { printPlan as a, planPayload as i, planCachedBuild as n, refusePlan as o, planFlagRefusal as r, runArtifactLifecycle as s, planHostedDevice as t };
@@ -1,6 +1,6 @@
1
- import { p as getProject } from "./config-CgYMahz7.mjs";
2
- import { o as findCommandWorkspace } from "./project-C3ChRLZy.mjs";
3
- import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-BFIz1Shz.mjs";
1
+ import { p as getProject } from "./config-DC5jEtd1.mjs";
2
+ import { n as findCommandWorkspace } from "./project-B5eQ1USs.mjs";
3
+ import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-B4iWH4E-.mjs";
4
4
  //#region src/commands/ports.ts
5
5
  async function inProject(action) {
6
6
  try {
@@ -1,9 +1,9 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
2
  import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
3
- import { i as detectIsExpo } from "./project-C3ChRLZy.mjs";
4
- import { a as updateWorkspaceState, r as readWorkspaceState } from "./workspace-state-C59dqG-Z.mjs";
3
+ import { a as updateWorkspaceState, r as readWorkspaceState } from "./workspace-state-CR9X86xJ.mjs";
4
+ import { p as detectIsExpo } from "./project-B5eQ1USs.mjs";
5
5
  import { a as spawnDeclared } from "./spawn-claims-Kqiifsk2.mjs";
6
- import { i as expoBinRefusal, r as expoBinPath } from "./server-expo-DoBHhuzK.mjs";
6
+ import { i as expoBinRefusal, r as expoBinPath } from "./server-expo-n3tUi3Em.mjs";
7
7
  import { existsSync } from "node:fs";
8
8
  import { join } from "node:path";
9
9
  //#region src/engine/prebuild.ts
@@ -1,21 +1,20 @@
1
- import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
2
- import { o as formatLongDuration, u as plural } from "./command-output-CBtzyIgF.mjs";
3
- import { H as projectDeviceSlots, M as isOnMountedVolume, N as listMountedVolumes, P as measuredDirectorySize, _ as loadConfig$1, p as getProject } from "./config-CgYMahz7.mjs";
4
- import { C as sourceCheckoutOf, b as resolveFullRef, d as hasUncommittedWork, l as hasPopulatedSubmodules, m as listWorktrees, o as dirtyPaths, w as unpushedCommits } from "./worktree-CsKYexJM.mjs";
5
- import { s as findProjectRoot$1 } from "./project-C3ChRLZy.mjs";
6
- import { C as workspaceStateFile, r as readWorkspaceState$1, s as workspaceLastUsed, x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
7
- import { n as readManifest } from "./cache-manifest-BI7ozfmH.mjs";
8
- import { At as phase, G as DEVICE_LIST_TIMEOUT_MS, Zt as discoverCaches, c as readVolumeSpace, i as enforceBudget, l as resolveBudget, o as machineNumber, pt as planCacheEmptying, r as cacheLabel, u as trimmableCaches } from "./budget-DIhL2BKx.mjs";
9
- import { I as canonicalPath, M as listBuildSlots, P as recordGcResult, a as collectWorkspaceOutputs, c as listWorkspaceDirs, i as collectOrphanedWorkspaces, p as workspaceInUse, s as isInsideWorkspaces } from "./workspaces-xXItD8Dj.mjs";
10
- import { h as listBuildLocks, i as listLeaseFiles, r as leaseIsExpired } from "./device-lease-Co-EwifR.mjs";
11
- import { pt as readParked, z as ownedAvdSerialResolver } from "./android-DC3ZLuw0.mjs";
12
- import { M as readHostMemoryPressure, d as listAllIosSims } from "./ios-B3SbOWdw.mjs";
13
- import { D as projectMaintenancePinned } from "./settings-CQyMElEP.mjs";
1
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
2
+ import { o as formatLongDuration, u as plural } from "./command-output-Bt8ygHE7.mjs";
3
+ import { H as projectDeviceSlots, M as isOnMountedVolume, N as listMountedVolumes, P as measuredDirectorySize, _ as loadConfig$1, p as getProject } from "./config-DC5jEtd1.mjs";
4
+ import { C as workspaceStateFile, r as readWorkspaceState$1, s as workspaceLastUsed, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
5
+ import { r as findProjectRoot } from "./project-B5eQ1USs.mjs";
6
+ import { D as projectMaintenancePinned, ht as resolveFullRef, it as hasPopulatedSubmodules, lt as listWorktrees, ot as hasUncommittedWork, tt as dirtyPaths, vt as sourceCheckoutOf, yt as unpushedCommits } from "./settings-CxgngUZk.mjs";
7
+ import { n as readManifest } from "./cache-manifest-DiwKSyv9.mjs";
8
+ import { At as phase, G as DEVICE_LIST_TIMEOUT_MS, Nt as discoverCaches, c as readVolumeSpace, i as enforceBudget, l as resolveBudget, o as machineNumber, pt as planCacheEmptying, r as cacheLabel, u as trimmableCaches } from "./budget-Dz-kyXLv.mjs";
9
+ import { F as recordGcResult, L as canonicalPath, N as listBuildSlots, a as collectWorkspaceOutputs, c as listWorkspaceDirs, i as collectOrphanedWorkspaces, p as workspaceInUse, s as isInsideWorkspaces } from "./workspaces-Djb2gfi9.mjs";
10
+ import { h as listBuildLocks, i as listLeaseFiles, r as leaseIsExpired } from "./device-lease-Cu7PtQpZ.mjs";
11
+ import { pt as readParked, z as ownedAvdSerialResolver } from "./android-BdQC6zs1.mjs";
12
+ import { M as readHostMemoryPressure, d as listAllIosSims } from "./ios-BWbHFZVz.mjs";
14
13
  import { a as metroStoreRoot } from "./metro-store-BAHFcJm6.mjs";
15
- import { n as describePullRequest, o as pullRequestLookups, r as endedPullRequest } from "./pull-request-u4vp7zmK.mjs";
14
+ import { n as describePullRequest, o as pullRequestLookups, r as endedPullRequest } from "./pull-request-IHNdMnG8.mjs";
16
15
  import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
17
- import { o as fetchDefaultBranch, s as mergeState } from "./warm-progress-CjB-MP6H.mjs";
18
- import { f as removeWorktreeTarget, i as matchWorktreeEntry, n as excludePodChurn, o as reclaimKeys, r as excludeWatchmanCookies } from "./worktree-BSYlofkq.mjs";
16
+ import { o as fetchDefaultBranch, s as mergeState } from "./warm-progress-pFLB2e6P.mjs";
17
+ import { f as removeWorktreeTarget, i as matchWorktreeEntry, n as excludePodChurn, o as reclaimKeys, r as excludeWatchmanCookies } from "./worktree-BL4M1rhB.mjs";
19
18
  import { existsSync } from "node:fs";
20
19
  import { basename, isAbsolute, join, sep } from "node:path";
21
20
  import { isAbsolute as isAbsolute$1, join as join$1 } from "path";
@@ -865,7 +864,7 @@ async function planWorktrees({ protectedRoot, pinned, now }) {
865
864
  //#endregion
866
865
  //#region src/maintenance/preview.ts
867
866
  function triggeringRoot() {
868
- return canonicalPath(findProjectRoot$1(process.cwd()) ?? join(configDir(), "maintenance", "no-project"));
867
+ return canonicalPath(findProjectRoot(process.cwd()) ?? join(configDir(), "maintenance", "no-project"));
869
868
  }
870
869
  async function plannedMaintenance(pressure, sizes, settings, { devices = true, sweep = false, worktrees = false } = {}) {
871
870
  const resolved = resolveBudget();