stim 1.31.0 → 1.33.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 (169) hide show
  1. package/dist/{acquire-artifact-P84h3ssa.mjs → acquire-artifact-DTh_LxrE.mjs} +2 -2
  2. package/dist/{act-lcOIEy32.mjs → act-Cur4YKtK.mjs} +74 -25
  3. package/dist/{activity-Dw4N_RFe.mjs → activity-C8kBq9w0.mjs} +6 -6
  4. package/dist/{agent-device-usage-output-Boie2yB-.mjs → agent-device-usage-output-BTRaK_up.mjs} +5 -5
  5. package/dist/{android-BeeC15Ve.mjs → android-B2DSKg-A.mjs} +2 -2
  6. package/dist/{android-DhiWSOFU.mjs → android-BL-QqHjc.mjs} +87 -53
  7. package/dist/{android-aIuJZoDu.mjs → android-D5mCdVl2.mjs} +5 -5
  8. package/dist/{android-DsEj2CCs.mjs → android-Iq0M2t2d.mjs} +27 -15
  9. package/dist/{android-cas-CbumHXIq.mjs → android-cas-Dhcjkys1.mjs} +4 -4
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/android-image-DFk26aY6.mjs +254 -0
  12. package/dist/{android-project-CCEQyYJK.d.mts → android-project-BDlPnfmL.d.mts} +1 -1
  13. package/dist/api.d.mts +2 -1
  14. package/dist/api.mjs +28 -28
  15. package/dist/{apk-signed-tail-B9Usseps.mjs → apk-signed-tail-CPpA-3vu.mjs} +2 -2
  16. package/dist/{artifact-ta3xA0c4.mjs → artifact-BMjubIP2.mjs} +13 -13
  17. package/dist/{artifact-Cr34-Yyy.mjs → artifact-BufzdGbT.mjs} +34 -21
  18. package/dist/{artifact-platform-BO2Uvk_A.mjs → artifact-platform-DqCWUieN.mjs} +1 -1
  19. package/dist/{auto-placement-DtTRG0rk.mjs → auto-placement-D7P98glJ.mjs} +11 -9
  20. package/dist/{browser-web-DuULNZrS.mjs → browser-web-C74et-Nv.mjs} +15 -15
  21. package/dist/{build-BpFFbdXD.mjs → build-DFBGWOTc.mjs} +23 -23
  22. package/dist/{build-cache-BsKim4V7.mjs → build-cache-Cqj4FGnX.mjs} +20 -8
  23. package/dist/{build-plan-DH1rT11x.mjs → build-plan-T3Hi24ax.mjs} +7 -7
  24. package/dist/{cache-manifest-CfiEny4T.mjs → cache-manifest-8JX9S1QJ.mjs} +1 -1
  25. package/dist/cache-manifest.mjs +1 -1
  26. package/dist/{ccache-DVDO2ocE.mjs → ccache-BXtzEL6M.mjs} +34 -24
  27. package/dist/{cdp-C3svvXiE.mjs → cdp-C216kOAn.mjs} +1 -1
  28. package/dist/{chrome-DyDWurWG.mjs → chrome-C8sC5tdl.mjs} +1 -1
  29. package/dist/{cli-C0jjwTuM.mjs → cli-B2YSjc9s.mjs} +20 -20
  30. package/dist/cli.mjs +1 -1
  31. package/dist/{client-DhJOvSvh.mjs → client-0_Mnfz0a.mjs} +29 -9
  32. package/dist/collector-run.mjs +7 -7
  33. package/dist/{command-output-VrXd6qPX.mjs → command-output-DWI9tGPU.mjs} +1 -1
  34. package/dist/{config-D5qNWJEP.mjs → config-BW0fAtoK.mjs} +256 -246
  35. package/dist/{dependencies-DIU-5rnG.mjs → dependencies-CgvBZbXD.mjs} +39 -39
  36. package/dist/{dependency-state-DZVln1P9.mjs → dependency-state-mL5g4H6K.mjs} +2 -2
  37. package/dist/{detached-entry-BPlSaCwC.mjs → detached-entry-tfrgGVWb.mjs} +1 -1
  38. package/dist/{dev-client-DeAg0fso.mjs → dev-client-ChsHwgrn.mjs} +2 -2
  39. package/dist/{device-C2WsPgFt.mjs → device-B0htCt2u.mjs} +13 -13
  40. package/dist/{device-DuNLOlR6.mjs → device-DOehZpyx.mjs} +11 -11
  41. package/dist/{device-android-BjhH0Ru3.mjs → device-android-B8TQP5AX.mjs} +10 -10
  42. package/dist/{device-capacity-Du5wBTNJ.mjs → device-capacity-BAkETfIl.mjs} +9 -9
  43. package/dist/device-host-worker.mjs +58 -17
  44. package/dist/{device-ios-CUYUhSYO.mjs → device-ios-DFaYFdar.mjs} +9 -9
  45. package/dist/{device-lease-run-CHXQEn-7.mjs → device-lease-run-DpiCnRbZ.mjs} +5 -5
  46. package/dist/{device-pool-kUHO7MHO.mjs → device-pool-DP4sCeCC.mjs} +3 -3
  47. package/dist/{device-provision-e7bKS7lx.mjs → device-provision-CnNOIxCF.mjs} +10 -10
  48. package/dist/{doctor-BGcsAgAV.mjs → doctor-9GrW5YSP.mjs} +30 -17
  49. package/dist/{doctor-B6kIVgU9.mjs → doctor-C6Xn96RS.mjs} +1 -1
  50. package/dist/{doctor-fingerprint-o7ZI9YLn.mjs → doctor-fingerprint-DqWvIhMb.mjs} +1 -1
  51. package/dist/doctor-fingerprint.mjs +1 -1
  52. package/dist/{doctor-hva3sd9f.mjs → doctor-nRLBoajo.mjs} +54 -25
  53. package/dist/{doctor-watchman-DJY550yz.mjs → doctor-watchman-CDhpC3Oh.mjs} +5 -5
  54. package/dist/{eas-build-CBFgseh1.mjs → eas-build-CpJ4h9tG.mjs} +4 -4
  55. package/dist/{eas-fallback-DFXdz4d6.mjs → eas-fallback-B3z5nL1g.mjs} +6 -6
  56. package/dist/{eas-session-ledger-aFBLTZr2.mjs → eas-session-ledger-Bspy-VJQ.mjs} +6 -6
  57. package/dist/{error-diagnostics-CCsq_3uG.mjs → error-diagnostics-DoLGklYX.mjs} +10 -10
  58. package/dist/{exec-aULwtNly.mjs → exec-CGuDzt40.mjs} +103 -103
  59. package/dist/{gc-DASUa3Z_.mjs → gc-BWoOp9q7.mjs} +2 -2
  60. package/dist/{gc-B0K4d_PL.mjs → gc-DolXpMSB.mjs} +25 -54
  61. package/dist/{guide-Civo5-zV.mjs → guide-CmZB0GtP.mjs} +194 -50
  62. package/dist/{hosted-android-CH1Sm4wo.mjs → hosted-android-ByG-ICuh.mjs} +4 -4
  63. package/dist/{hosted-client-5ur3YpxY.mjs → hosted-client-D19Lv0tg.mjs} +6 -5
  64. package/dist/{hosted-logs-BYg4yeti.mjs → hosted-logs-D7anR6Dk.mjs} +17 -11
  65. package/dist/{hosted-logs-sync-BPe8xnMu.mjs → hosted-logs-sync-D182b1eJ.mjs} +5 -5
  66. package/dist/{hosted-macos-BagT0Gn3.mjs → hosted-macos-D0DDQxvl.mjs} +6 -6
  67. package/dist/{hosted-native-kaR4nUHk.mjs → hosted-native-BzXIy97W.mjs} +15 -11
  68. package/dist/{idle-shutdown-BWHQ7mQG.mjs → idle-shutdown-6i8CHoNq.mjs} +6 -6
  69. package/dist/{ios-BKR-Dq46.mjs → ios-AdhPKXO3.mjs} +8 -8
  70. package/dist/{ios-CdAV4-1E.mjs → ios-BdZdNsAj.mjs} +6 -6
  71. package/dist/{ios-CsRVik64.mjs → ios-Qam0bT9n.mjs} +1 -1
  72. package/dist/{ios-DUL68MI5.mjs → ios-dbXzjTxx.mjs} +28 -28
  73. package/dist/{ios-device-CiBA-er9.mjs → ios-device-DLdEDWJj.mjs} +1 -1
  74. package/dist/{ios-device-Dz8gFZ0K.mjs → ios-device-DXbHZfFe.mjs} +3 -3
  75. package/dist/{ios-project-Br1tVYWX.mjs → ios-project-BzfLigfh.mjs} +7 -7
  76. package/dist/{ios-signing-BJzvDPfU.mjs → ios-signing-D-tSX1iF.mjs} +2 -2
  77. package/dist/{ios-state-BEIJRJ7P.mjs → ios-state-CWsBysyN.mjs} +1 -1
  78. package/dist/{js-swap-BfG8XpyS.mjs → js-swap-EDVOJmqx.mjs} +6 -6
  79. package/dist/{launch-CrGndh8T.mjs → launch-CKHpthsw.mjs} +20 -20
  80. package/dist/{lightened-DZ9Ip0T3.mjs → lightened-Cv4ToJRX.mjs} +5 -5
  81. package/dist/{logs-C-hfMsxK.mjs → logs-DCQ3_tGS.mjs} +6 -6
  82. package/dist/{logs-DpIKWT3A.mjs → logs-IagR9dWI.mjs} +7 -7
  83. package/dist/{macos-DZ9ZSolN.mjs → macos-Ch7vuM-G.mjs} +22 -22
  84. package/dist/{macos-DNmKwfDy.mjs → macos-pc0aVVbN.mjs} +1 -1
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +6 -6
  87. package/dist/{metro-mKHEMO-a.mjs → metro-B5PVz0Wv.mjs} +4 -4
  88. package/dist/{metro-request-RDhyx85c.mjs → metro-request-2LmFpC1z.mjs} +9 -3
  89. package/dist/{named-ports-B0hCk2v-.mjs → named-ports-CA0nB9Yw.mjs} +3 -3
  90. package/dist/{native-android-DExhFqR6.mjs → native-android-B3CEDq4R.mjs} +29 -19
  91. package/dist/{native-gradle-artifact-inputs-Bcmbdc23.mjs → native-gradle-artifact-inputs-BLnO2hHR.mjs} +5 -5
  92. package/dist/{native-runtime-D4qgnjK_.mjs → native-runtime-e1OU8gEN.mjs} +6 -6
  93. package/dist/{native-source-D1AzWiuP.mjs → native-source-ChAGj7R1.mjs} +1 -1
  94. package/dist/{native-xcode-inputs-EWma1lXh.mjs → native-xcode-inputs-DL3ETb8s.mjs} +3 -3
  95. package/dist/{native-xcode-ios-Y6rzmWTc.mjs → native-xcode-ios-D4e8k2Jy.mjs} +17 -17
  96. package/dist/offload-worker.d.mts +3 -1
  97. package/dist/offload-worker.mjs +37 -23
  98. package/dist/{operation-exec-Dp4FuIGR.mjs → operation-exec-DKlBcKAL.mjs} +1 -1
  99. package/dist/{ownership-CCfiBfOP.mjs → ownership-hC7xvvxF.mjs} +3 -3
  100. package/dist/{page-CQJlcj3x.mjs → page-Dj8IqvGM.mjs} +2 -2
  101. package/dist/{phone-reverses-Drj5QQCh.mjs → phone-reverses-rvyxW1Fl.mjs} +4 -4
  102. package/dist/{placement-log-CFT8SnlS.mjs → placement-log-nnGnu8mo.mjs} +1 -1
  103. package/dist/{plan-placement-DhKCH_wF.mjs → plan-placement-D3JD-T-K.mjs} +6 -6
  104. package/dist/{ports-BNtJ5DCj.mjs → ports-CZJJfJ8Q.mjs} +3 -3
  105. package/dist/{prebuild-D0hvmO4j.mjs → prebuild-Bhs7TTcz.mjs} +12 -12
  106. package/dist/{project-DCLkDM8C.mjs → project-DWEXiBA9.mjs} +16 -16
  107. package/dist/{pull-request-BzLmzAIQ.mjs → pull-request-BpMTNkMB.mjs} +2 -2
  108. package/dist/pull-requests.mjs +1 -1
  109. package/dist/{react-native-android-Dp7vctEA.mjs → react-native-android-C6Y270GS.mjs} +37 -33
  110. package/dist/{react-native-build-vK2lFYfN.mjs → react-native-build-DaPfzf_e.mjs} +10 -10
  111. package/dist/{react-native-doctor-BtWzwZHU.mjs → react-native-doctor-DGMPxkPS.mjs} +6 -6
  112. package/dist/{react-native-ios-DW1Ax3Yv.mjs → react-native-ios-dX48_92n.mjs} +21 -17
  113. package/dist/{recordings-BWnIlhZH.mjs → recordings-AKZfsW2W.mjs} +1 -1
  114. package/dist/{registration-BwCe64PH.mjs → registration-DKjJGQ6p.mjs} +1 -1
  115. package/dist/{reload-BS_ntVV_.mjs → reload-BGwblBJ9.mjs} +1 -1
  116. package/dist/{reload-B-d7-CsI.mjs → reload-DsOByDfy.mjs} +17 -17
  117. package/dist/{remote-DScVlaMz.mjs → remote-D0uJZ76R.mjs} +9 -9
  118. package/dist/{result-Epkl6gyG.mjs → result-DuimMZKJ.mjs} +24 -20
  119. package/dist/{run-2CHAJ9Oj.mjs → run-N-BbRxnC.mjs} +2 -2
  120. package/dist/{selection-C95m--1_.mjs → selection-xS50Mt0V.mjs} +5 -4
  121. package/dist/{server-bare-CFyVFZXJ.mjs → server-bare-BTlICuaX.mjs} +2 -2
  122. package/dist/{server-command-B1gDRJB2.mjs → server-command-BC0EgMfY.mjs} +5 -5
  123. package/dist/{server-expo-CP4dURQp.mjs → server-expo-15RjL0ir.mjs} +3 -3
  124. package/dist/server-expo-gYIypb0-.mjs +2 -0
  125. package/dist/{settings-C6UTYW2K.mjs → settings-B5IBDfTx.mjs} +4 -4
  126. package/dist/{settings-CjTRNCi3.mjs → settings-CuP55ieT.mjs} +2 -2
  127. package/dist/{settings-payload-zf5EnCTg.mjs → settings-payload-BIGGQ3or.mjs} +5 -5
  128. package/dist/{settings-write-Fe0K6BeC.mjs → settings-write-D85j8mej.mjs} +6 -6
  129. package/dist/settings.schema.json +40 -2
  130. package/dist/{simslim-93xmPh-d.mjs → simslim-DKdJx0LL.mjs} +2 -2
  131. package/dist/{slot-launch-B4MHzVX2.mjs → slot-launch-D4oREwhx.mjs} +6 -6
  132. package/dist/{stage-DDrnM0CY.mjs → stage-DKC6tDXu.mjs} +2 -2
  133. package/dist/{start-LSwIFlBv.mjs → start-BsEV4S-s.mjs} +12 -12
  134. package/dist/{start-BXl5tkv8.mjs → start-DfPSLc__.mjs} +1 -1
  135. package/dist/{state-CM_HvvkS.mjs → state-CtmYTRWm.mjs} +4 -4
  136. package/dist/{state-CiflgxTP.mjs → state-DSOUqO-o.mjs} +2 -2
  137. package/dist/{stats-EgpYD536.mjs → stats-ByEUblPr.mjs} +5 -5
  138. package/dist/{stats-report-B86Cv7Uc.mjs → stats-report-BVRCqwWA.mjs} +1 -1
  139. package/dist/{status-BLDvhatv.mjs → status-C6hLlDqW.mjs} +37 -28
  140. package/dist/{status-GQ-JqvRi.mjs → status-DTFhDnd1.mjs} +1 -1
  141. package/dist/{status-DBMD7ZQT.mjs → status-FP1MH9qn.mjs} +1 -1
  142. package/dist/{status-watch-BwG4lJ1q.mjs → status-watch-D8s823CZ.mjs} +5 -5
  143. package/dist/status-worker.mjs +1 -1
  144. package/dist/{stim-desktop-1XxET4S8.mjs → stim-desktop-_WTria-r.mjs} +2 -2
  145. package/dist/{stop-4SAV_RR8.mjs → stop-5LKfVv-0.mjs} +2 -2
  146. package/dist/{stop-WyrZQuX6.mjs → stop-BVI2-L7s.mjs} +16 -16
  147. package/dist/{stop-BfNhzvXO.mjs → stop-CpTy6bod.mjs} +5 -5
  148. package/dist/supervisor-run.mjs +137 -45
  149. package/dist/{support-Cffz6_Ft.mjs → support-CqyWfZZI.mjs} +18 -8
  150. package/dist/{support-Cs24xRQa.mjs → support-D8OH0z98.mjs} +9 -9
  151. package/dist/{swiftpm-artifact-inputs-yp8D5LE4.mjs → swiftpm-artifact-inputs-uq5oV7xR.mjs} +4 -4
  152. package/dist/{swiftpm-macos-D0CzQtpp.mjs → swiftpm-macos-BuhqYB3n.mjs} +11 -11
  153. package/dist/{toolchain-BEra9AIX.mjs → toolchain-D_jotUG7.mjs} +1 -1
  154. package/dist/{toolchain-CGdgD4x4.mjs → toolchain-s5ZmG42Z.mjs} +25 -14
  155. package/dist/{trigger-CfnOfpDd.mjs → trigger-BtB4kbe0.mjs} +2 -2
  156. package/dist/trigger-D8B7QR0q.mjs +2 -0
  157. package/dist/{warm-progress-_aTMvkIH.mjs → warm-progress-q11Vdvhh.mjs} +6 -6
  158. package/dist/{web-BE89ONcc.mjs → web-DwYCTFdh.mjs} +9 -9
  159. package/dist/web-cCfM8kwV.mjs +2 -0
  160. package/dist/web-run.mjs +8 -8
  161. package/dist/windows-report.mjs +1 -1
  162. package/dist/{workspace-state-3bF4TB8P.mjs → workspace-state-BdZ-QgmB.mjs} +3 -3
  163. package/dist/{workspaces-BNEyJ1B_.mjs → workspaces-B3ahAHZc.mjs} +18 -17
  164. package/dist/{worktree-BTrii9e_.mjs → worktree-BhsML6GV.mjs} +77 -31
  165. package/dist/{worktree-DB3Ypdj6.mjs → worktree-CrjsPIs2.mjs} +1 -1
  166. package/package.json +7 -7
  167. package/dist/server-expo-D3k9mvP8.mjs +0 -2
  168. package/dist/trigger-DBZ-GBrl.mjs +0 -2
  169. package/dist/web-DQPxvFVD.mjs +0 -2
@@ -0,0 +1,254 @@
1
+ import { D as ownership_claim_exports, T as process_identity_exports, l as cancellableSleep, t as getExecutor } from "./exec-CGuDzt40.mjs";
2
+ import { it as settingValueAt } from "./settings-B5IBDfTx.mjs";
3
+ import { Q as pickDefaultSystemImage, d as androidToolPath, j as hostSystemImageArch, kt as recordInstalledSystemImageAsync, o as androidHome, z as listInstalledSystemImages } from "./android-Iq0M2t2d.mjs";
4
+ import { createHash } from "node:crypto";
5
+ import { existsSync, readFileSync, realpathSync, statfsSync } from "node:fs";
6
+ import { isAbsolute, join } from "node:path";
7
+ import { configDir } from "@stim-cli/core";
8
+ //#region src/devices/android-image.ts
9
+ const RECOMMENDED_ANDROID_API = 36;
10
+ const IMAGE_INSTALL_FREE_BYTES = 8 * 1024 ** 3;
11
+ const IMAGE_INSTALL_TIMEOUT_MS = 18e5;
12
+ const CLAIM_POLL_MS = 2e3;
13
+ const SYSTEM_IMAGE_PACKAGE = /^system-images;android-\d+;[^;\s]+;([^;\s]+)$/;
14
+ const LICENSE_NOT_ACCEPTED = /license is not accepted|licenses or those of the packages they depend on were not accepted/i;
15
+ function recommendedSystemImage(arch = hostSystemImageArch()) {
16
+ return `system-images;android-${RECOMMENDED_ANDROID_API};google_apis;${arch}`;
17
+ }
18
+ function androidImageInstallPolicy(settings) {
19
+ return settingValueAt(settings, "android.installImages") === "never" ? "never" : "auto";
20
+ }
21
+ function sdkmanagerCommand(args, env) {
22
+ const tool = androidToolPath("sdkmanager", process.platform, env);
23
+ return `${isAbsolute(tool) ? JSON.stringify(tool) : tool} ${args}`;
24
+ }
25
+ /**
26
+ * Decides which system image an owned AVD uses: the requested one, else the newest installed image for the host, else
27
+ * Stim's recommended image. An image that is not installed is installed only when the policy allows it and its ABI is
28
+ * the host's.
29
+ */
30
+ function decideSystemImage({ requested, installed, policy, hostArch = hostSystemImageArch(), env }) {
31
+ if (requested && installed.some((image) => image.pkg === requested)) return {
32
+ kind: "installed",
33
+ pkg: requested
34
+ };
35
+ const picked = requested ? null : pickDefaultSystemImage([...installed], { hostArch });
36
+ if (picked) return {
37
+ kind: "installed",
38
+ pkg: picked.pkg
39
+ };
40
+ const pkg = requested ?? recommendedSystemImage(hostArch);
41
+ const arch = SYSTEM_IMAGE_PACKAGE.exec(pkg)?.[1];
42
+ if (arch !== hostArch) return {
43
+ kind: "refuse",
44
+ code: "STIM_BAD_ARG",
45
+ message: arch ? `The Android system image "${pkg}" is not installed, and Stim installs only ${hostArch} images on this machine.` : `"${pkg}" is not an Android system image package id.`,
46
+ remedy: `Pass \`--system-image\` (or set android.systemImage) to an installed image, or to one Stim can install for ${hostArch} such as "${recommendedSystemImage(hostArch)}".`
47
+ };
48
+ if (policy === "never") return {
49
+ kind: "refuse",
50
+ code: requested ? "STIM_BAD_ARG" : "STIM_NO_DEVICE",
51
+ message: `${requested ? `The Android system image "${pkg}" is not installed` : `No ${hostArch} Android system image is installed`}, and android.installImages is never, so Stim does not install one.`,
52
+ remedy: `${requested ? "Pass `--system-image` (or set android.systemImage) to an installed image, run" : "Run"} \`${sdkmanagerCommand(`--install "${pkg}"`, env)}\` on this machine, or set android.installImages to auto, then try again.`
53
+ };
54
+ return {
55
+ kind: "install",
56
+ pkg
57
+ };
58
+ }
59
+ function freeBytes(path) {
60
+ try {
61
+ const disk = statfsSync(path);
62
+ return disk.bavail * disk.bsize;
63
+ } catch {
64
+ return null;
65
+ }
66
+ }
67
+ function licenseAccepted(sdk) {
68
+ try {
69
+ return readFileSync(join(sdk, "licenses", "android-sdk-license"), "utf8").trim().length > 0;
70
+ } catch {
71
+ return false;
72
+ }
73
+ }
74
+ function imageComplete(sdk, pkg) {
75
+ const directory = join(sdk, ...pkg.split(";"));
76
+ return existsSync(join(directory, "package.xml")) && !existsSync(join(directory, ".installer"));
77
+ }
78
+ function claimRoot(sdk) {
79
+ let canonical = sdk;
80
+ try {
81
+ canonical = realpathSync(sdk);
82
+ } catch {}
83
+ const key = createHash("sha256").update(canonical).digest("hex").slice(0, 16);
84
+ return join(configDir(), "android-sdk-installs", key);
85
+ }
86
+ function failureLine(text) {
87
+ const lines = text.split(/[\r\n]+/).map((line) => line.trim()).filter((line) => line && !line.startsWith("["));
88
+ return lines.find((line) => /^(Warning|Error):/.test(line)) ?? lines.at(-1) ?? "";
89
+ }
90
+ const gb = (bytes) => (bytes / 1024 ** 3).toFixed(1);
91
+ const refuse = (message, remedy, code = "STIM_NO_DEVICE") => ({
92
+ ok: false,
93
+ code,
94
+ message,
95
+ remedy
96
+ });
97
+ function outputOf(error) {
98
+ const field = (name) => {
99
+ const value = error && typeof error === "object" ? Reflect.get(error, name) : void 0;
100
+ return typeof value === "string" ? value : "";
101
+ };
102
+ return `${field("stdout")}\n${field("stderr")}`;
103
+ }
104
+ /** Makes sure the system image an owned AVD needs is installed. `installed` is true when it was missing at the start of this call, whichever run installed it. */
105
+ async function ensureSystemImage({ requested, policy, env, signal, note }) {
106
+ const decision = decideSystemImage({
107
+ requested,
108
+ installed: listInstalledSystemImages(void 0, env),
109
+ policy,
110
+ env
111
+ });
112
+ if (decision.kind === "refuse") return {
113
+ ok: false,
114
+ code: decision.code,
115
+ message: decision.message,
116
+ remedy: decision.remedy
117
+ };
118
+ if (decision.kind === "installed") return {
119
+ ok: true,
120
+ installed: false
121
+ };
122
+ const result = await installSystemImage({
123
+ pkg: decision.pkg,
124
+ env,
125
+ signal,
126
+ note
127
+ });
128
+ return result.ok ? {
129
+ ok: true,
130
+ installed: true
131
+ } : result;
132
+ }
133
+ const licensesRefusal = (pkg, sdk, env) => ({
134
+ code: "STIM_NO_DEVICE",
135
+ message: `The Android SDK licenses ${pkg} needs are not accepted in ${sdk}, and Stim does not accept them for you.`,
136
+ remedy: `Run \`${sdkmanagerCommand("--licenses", env)}\` on this machine and accept them, then try again.`
137
+ });
138
+ /** Why this machine cannot install `pkg` now, checked before any download: no sdkmanager, no accepted license, or too little disk. */
139
+ function systemImageInstallProblem(pkg, env) {
140
+ const sdk = androidHome(env);
141
+ if (!isAbsolute(androidToolPath("sdkmanager", process.platform, env))) return {
142
+ code: "STIM_NO_DEVICE",
143
+ message: `The Android SDK command-line tools are not installed in ${sdk}, so Stim cannot install ${pkg}.`,
144
+ remedy: "Install \"Android SDK Command-line Tools (latest)\" from the SDK Manager in Android Studio, then try again."
145
+ };
146
+ if (!licenseAccepted(sdk)) return licensesRefusal(pkg, sdk, env);
147
+ const free = freeBytes(sdk);
148
+ if (free !== null && free < IMAGE_INSTALL_FREE_BYTES) return {
149
+ code: "STIM_NO_DEVICE",
150
+ message: `${gb(free)} GB free on the volume of ${sdk}, needs ${gb(IMAGE_INSTALL_FREE_BYTES)} GB to download and unpack ${pkg}.`,
151
+ remedy: `Free space on that volume (\`stim gc\` lists what Stim can reclaim), or run \`${sdkmanagerCommand(`--install "${pkg}"`, env)}\` yourself, then try again.`
152
+ };
153
+ return null;
154
+ }
155
+ /**
156
+ * Installs one system image with the SDK's own sdkmanager, never accepting a license for the user. One install runs per
157
+ * SDK root and Stim home: a second caller waits for the first and returns without installing when the image is there.
158
+ */
159
+ async function installSystemImage({ pkg, env, signal, note }) {
160
+ const sdk = androidHome(env);
161
+ const tool = androidToolPath("sdkmanager", process.platform, env);
162
+ const manual = sdkmanagerCommand(`--install "${pkg}"`, env);
163
+ const licenses = () => ({
164
+ ok: false,
165
+ ...licensesRefusal(pkg, sdk, env)
166
+ });
167
+ const root = claimRoot(sdk);
168
+ let claim;
169
+ let waited = false;
170
+ while (!claim) {
171
+ try {
172
+ claim = (0, ownership_claim_exports.tryAcquireClaim)({
173
+ root,
174
+ mode: "exclusive",
175
+ details: {
176
+ sdk,
177
+ package: pkg
178
+ },
179
+ label: "Android system image install"
180
+ }).acquired;
181
+ } catch (error) {
182
+ const failure = (0, ownership_claim_exports.claimFailure)(error, null);
183
+ if (failure) return refuse(failure.message, failure.remedy, failure.code);
184
+ throw error;
185
+ }
186
+ if (claim) break;
187
+ if (!waited) note(`waiting for another Stim process that installs an Android system image in ${sdk}`);
188
+ waited = true;
189
+ await cancellableSleep(CLAIM_POLL_MS, {
190
+ signal,
191
+ what: "wait for the Android system image install"
192
+ });
193
+ }
194
+ const held = claim;
195
+ let unresolved = false;
196
+ try {
197
+ if (imageComplete(sdk, pkg)) return {
198
+ ok: true,
199
+ installed: false
200
+ };
201
+ const problem = systemImageInstallProblem(pkg, env);
202
+ if (problem) return {
203
+ ok: false,
204
+ ...problem
205
+ };
206
+ note(`installing ${pkg} with sdkmanager (about 2 GB)`);
207
+ let output;
208
+ (0, ownership_claim_exports.markClaimChildPending)(held);
209
+ try {
210
+ output = await getExecutor().runFileAsync(tool, [
211
+ `--sdk_root=${sdk}`,
212
+ "--install",
213
+ pkg
214
+ ], {
215
+ timeoutMs: IMAGE_INSTALL_TIMEOUT_MS,
216
+ input: "n\n",
217
+ signal,
218
+ containProcessTree: true,
219
+ onSpawn: (child) => {
220
+ if (child.pid === void 0) return;
221
+ const captured = (0, process_identity_exports.captureProcessIdentity)(child.pid);
222
+ if (!captured.ok) throw new Error(`Cannot record the sdkmanager process: ${captured.reason}`);
223
+ (0, ownership_claim_exports.setClaimChild)(held, {
224
+ pid: child.pid,
225
+ processToken: captured.token
226
+ });
227
+ }
228
+ });
229
+ } catch (error) {
230
+ if (error instanceof Error && "reportCleanup" in error) {
231
+ unresolved = true;
232
+ throw error;
233
+ }
234
+ signal?.throwIfAborted();
235
+ const text = outputOf(error);
236
+ if (LICENSE_NOT_ACCEPTED.test(text)) return licenses();
237
+ return refuse(`sdkmanager could not install ${pkg}: ${failureLine(text) || (error instanceof Error ? error.message : String(error))}`, `Run \`${manual}\` on this machine to see the full error, then try again.`);
238
+ } finally {
239
+ if (!unresolved) (0, ownership_claim_exports.clearClaimChild)(held);
240
+ }
241
+ if (LICENSE_NOT_ACCEPTED.test(output)) return licenses();
242
+ const directory = join(sdk, ...pkg.split(";"));
243
+ if (!imageComplete(sdk, pkg)) return refuse(`sdkmanager finished without installing ${pkg}: ${failureLine(output) || "it printed no error"}`, `Run \`${manual}\` on this machine to see the full output, then try again.`);
244
+ await recordInstalledSystemImageAsync(realpathSync(directory));
245
+ return {
246
+ ok: true,
247
+ installed: true
248
+ };
249
+ } finally {
250
+ if (!unresolved) (0, ownership_claim_exports.releaseClaim)(held);
251
+ }
252
+ }
253
+ //#endregion
254
+ export { systemImageInstallProblem as a, installSystemImage as i, decideSystemImage as n, ensureSystemImage as r, androidImageInstallPolicy as t };
@@ -3,9 +3,9 @@ import { r as createNdjsonWriter } from "./exec-DnYc4HGH.mjs";
3
3
  import { readFileSync, writeFileSync } from "node:fs";
4
4
  import { StimContext, hostSimulatorArch } from "@stim-cli/core";
5
5
  import { ANDROID_EMULATOR_APPS, BuildPhase, BuildPlanPayload, Endpoint, RunEstimates, SettingScope, WebViewport, machineCapacity } from "@stim-cli/core/state";
6
- import "@stim-cli/core/noise-session";
7
6
  import { readFileSync as readFileSync$1 } from "fs";
8
7
  import { Command } from "commander";
8
+ import "@stim-cli/core/noise-session";
9
9
  import "@expo/fingerprint";
10
10
  import { CacheProviderConfig, loadCacheProvider } from "@stim-cli/cache";
11
11
  import { BuildReactNativeArtifactQuery, BuildSwiftpmArtifactQuery, GradleOffloadInputs, HelloResult, RemoteDiagnosis } from "@stim-cli/core/protocol";
package/dist/api.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as CompilationCacheActivity, a as BuildMachinesInspection, c as TailnetMachineIo, d as BudgetReport, f as DoctorPlatform, g as CcacheActivity, h as AndroidFacts, n as WebLaunched, o as GeneratedTickets, p as Finding, s as KeyConfirmer, v as IosFacts } from "./android-project-CCEQyYJK.mjs";
1
+ import { _ as CompilationCacheActivity, a as BuildMachinesInspection, c as TailnetMachineIo, d as BudgetReport, f as DoctorPlatform, g as CcacheActivity, h as AndroidFacts, n as WebLaunched, o as GeneratedTickets, p as Finding, s as KeyConfirmer, v as IosFacts } from "./android-project-BDlPnfmL.mjs";
2
2
  import { a as WorkspaceLaunchPlatform } from "./ios-CDvlmUs7.mjs";
3
3
  import "./exec-DnYc4HGH.mjs";
4
4
  import "./pull-request-eODyIqZF.mjs";
@@ -776,6 +776,7 @@ interface InventorySystemImage {
776
776
  package: string;
777
777
  directory: string;
778
778
  avdCount: number;
779
+ stimInstalled: boolean;
779
780
  command: string;
780
781
  }
781
782
  interface GcInventory {
package/dist/api.mjs CHANGED
@@ -1,32 +1,32 @@
1
- import { D as ownership_claim_exports, T as trackReportResource, b as operationState, c as throwIfCancelled, l as WorkspaceProcessCleanupError, s as cancelledError, w as runReport } from "./exec-aULwtNly.mjs";
2
- import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir$1, v as ensureWorkspaceStorageAsync } from "./workspace-state-3bF4TB8P.mjs";
3
- import { D as upsertProject, J as validateDeviceSlot, b as refuseRelativeStimPaths, k as withConfigLockAsync$1, m as getProject } from "./config-D5qNWJEP.mjs";
4
- import { l as phaseLine } from "./command-output-VrXd6qPX.mjs";
5
- import { Vt as repoRootAsync, Z as resolveProjectSettingsAsync, _ as inertSettingWarning, a as SETTING_SHAPE_REMEDY, p as cacheProviderSettingError, rt as settingShapeErrors, st as unknownSettingKeys } from "./settings-C6UTYW2K.mjs";
6
- import { c as projectProblem, f as projectRegistry, i as findProjectRoot$1, r as findCommandWorkspaceAsync, t as NO_PROJECT_REFUSAL } from "./project-DCLkDM8C.mjs";
7
- import { n as macosDir } from "./state-CiflgxTP.mjs";
8
- import { c as ensureHomeIdentity, s as workspaceShareURL } from "./stim-desktop-1XxET4S8.mjs";
1
+ import { C as operationState, D as ownership_claim_exports, a as trackReportResource, d as throwIfCancelled, f as WorkspaceProcessCleanupError, i as runReport, u as cancelledError } from "./exec-CGuDzt40.mjs";
2
+ import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir$1, v as ensureWorkspaceStorageAsync } from "./workspace-state-BdZ-QgmB.mjs";
3
+ import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
4
+ import { D as upsertProject, _t as validateDeviceSlot, b as refuseRelativeStimPaths, k as withConfigLockAsync$1, m as getProject } from "./config-BW0fAtoK.mjs";
5
+ import { Vt as repoRootAsync, Z as resolveProjectSettingsAsync, _ as inertSettingWarning, a as SETTING_SHAPE_REMEDY, p as cacheProviderSettingError, rt as settingShapeErrors, st as unknownSettingKeys } from "./settings-B5IBDfTx.mjs";
6
+ import { c as projectProblem, f as projectRegistry, i as findProjectRoot$1, r as findCommandWorkspaceAsync, t as NO_PROJECT_REFUSAL } from "./project-DWEXiBA9.mjs";
7
+ import { n as macosDir } from "./state-DSOUqO-o.mjs";
8
+ import { c as ensureHomeIdentity, s as workspaceShareURL } from "./stim-desktop-_WTria-r.mjs";
9
9
  import { i as createNdjsonWriter } from "./ndjson-CrjIsGzw.mjs";
10
- import { $ as tapBuildLog, Q as startBuildProgress, X as recordFinishedBuild, tt as errorRemedy } from "./workspaces-BNEyJ1B_.mjs";
11
- import { ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-CGdgD4x4.mjs";
12
- import { d as resolveBuildPlacement } from "./selection-C95m--1_.mjs";
13
- import { c as stopWorkspaceNow } from "./stop-WyrZQuX6.mjs";
14
- import { r as runReload } from "./reload-B-d7-CsI.mjs";
15
- import { m as warmWorktreeTarget, p as removeWorktreeTarget } from "./worktree-BTrii9e_.mjs";
16
- import { i as restoreLightenedDependencies } from "./lightened-DZ9Ip0T3.mjs";
17
- import { c as startDevServer } from "./start-LSwIFlBv.mjs";
18
- import { s as recordDoctorCheck } from "./doctor-watchman-DJY550yz.mjs";
19
- import { c as readSettingsPayload, s as readSettingsContext, t as SettingsRefusal } from "./settings-payload-zf5EnCTg.mjs";
20
- import { a as readDoctorReport } from "./doctor-BGcsAgAV.mjs";
21
- import { i as readGcReport, n as executeGc, o as withGcMaintenanceClaim } from "./gc-B0K4d_PL.mjs";
22
- import { r as readWorkspaceLogs, t as followWorkspaceLogs } from "./logs-C-hfMsxK.mjs";
23
- import { t as readProjectStats } from "./stats-report-B86Cv7Uc.mjs";
24
- import { n as buildAndroidOperation, t as buildIosOperation } from "./build-BpFFbdXD.mjs";
25
- import { a as readAndroidBuildPlan, i as runAndroidOperation } from "./android-DhiWSOFU.mjs";
26
- import { i as readIosBuildPlan, r as runIosOperation } from "./ios-DUL68MI5.mjs";
27
- import { a as buildMacosBundle, i as planMacos, n as runMacos } from "./macos-DZ9ZSolN.mjs";
28
- import { t as runWeb } from "./web-BE89ONcc.mjs";
29
- import { t as mutateSetting } from "./settings-write-Fe0K6BeC.mjs";
10
+ import { $ as tapBuildLog, Q as startBuildProgress, X as recordFinishedBuild, tt as errorRemedy } from "./workspaces-B3ahAHZc.mjs";
11
+ import { ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
12
+ import { d as resolveBuildPlacement } from "./selection-xS50Mt0V.mjs";
13
+ import { c as stopWorkspaceNow } from "./stop-BVI2-L7s.mjs";
14
+ import { r as runReload } from "./reload-DsOByDfy.mjs";
15
+ import { m as warmWorktreeTarget, p as removeWorktreeTarget } from "./worktree-BhsML6GV.mjs";
16
+ import { i as restoreLightenedDependencies } from "./lightened-Cv4ToJRX.mjs";
17
+ import { c as startDevServer } from "./start-BsEV4S-s.mjs";
18
+ import { s as recordDoctorCheck } from "./doctor-watchman-CDhpC3Oh.mjs";
19
+ import { c as readSettingsPayload, s as readSettingsContext, t as SettingsRefusal } from "./settings-payload-BIGGQ3or.mjs";
20
+ import { a as readDoctorReport } from "./doctor-9GrW5YSP.mjs";
21
+ import { i as readGcReport, n as executeGc, o as withGcMaintenanceClaim } from "./gc-DolXpMSB.mjs";
22
+ import { r as readWorkspaceLogs, t as followWorkspaceLogs } from "./logs-DCQ3_tGS.mjs";
23
+ import { t as readProjectStats } from "./stats-report-BVRCqwWA.mjs";
24
+ import { n as buildAndroidOperation, t as buildIosOperation } from "./build-DFBGWOTc.mjs";
25
+ import { a as readAndroidBuildPlan, i as runAndroidOperation } from "./android-BL-QqHjc.mjs";
26
+ import { i as readIosBuildPlan, r as runIosOperation } from "./ios-dbXzjTxx.mjs";
27
+ import { a as buildMacosBundle, i as planMacos, n as runMacos } from "./macos-Ch7vuM-G.mjs";
28
+ import { t as runWeb } from "./web-DwYCTFdh.mjs";
29
+ import { t as mutateSetting } from "./settings-write-D85j8mej.mjs";
30
30
  import { randomBytes } from "node:crypto";
31
31
  import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync } from "node:fs";
32
32
  import { stripVTControlCharacters } from "node:util";
@@ -1,5 +1,5 @@
1
- import { y as sharedBuildCache } from "./workspace-state-3bF4TB8P.mjs";
2
- import { O as findBuildTool } from "./android-DsEj2CCs.mjs";
1
+ import { y as sharedBuildCache } from "./workspace-state-BdZ-QgmB.mjs";
2
+ import { O as findBuildTool } from "./android-Iq0M2t2d.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import { closeSync, fstatSync, openSync, readFileSync, readSync, realpathSync, renameSync, rmSync } from "node:fs";
5
5
  import { basename, dirname, join } from "node:path";
@@ -1,16 +1,16 @@
1
- import { D as ownership_claim_exports, c as throwIfCancelled, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
- import { E as workspaceDir } from "./workspace-state-3bF4TB8P.mjs";
3
- import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-VrXd6qPX.mjs";
4
- import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote, n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-DVDO2ocE.mjs";
5
- import { $ as cancelledFailure, st as runCancellationSignal } from "./toolchain-CGdgD4x4.mjs";
6
- import { b as providerDownloadPath, y as prepareProviderDownloadDir } from "./build-cache-BsKim4V7.mjs";
7
- import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-DhJOvSvh.mjs";
8
- import { a as missingPackageManagerRemedy, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-C95m--1_.mjs";
9
- import { f as formatDiagnostic } from "./react-native-build-vK2lFYfN.mjs";
10
- import { u as skippedMissReason } from "./prebuild-D0hvmO4j.mjs";
11
- import { t as buildPlacementRecord } from "./placement-log-CFT8SnlS.mjs";
12
- import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-P84h3ssa.mjs";
13
- import { a as PLATFORM, h as displayPath } from "./support-Cffz6_Ft.mjs";
1
+ import { D as ownership_claim_exports, d as throwIfCancelled, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
2
+ import { E as workspaceDir } from "./workspace-state-BdZ-QgmB.mjs";
3
+ import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-DWI9tGPU.mjs";
4
+ import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote, n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-BXtzEL6M.mjs";
5
+ import { $ as cancelledFailure, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
6
+ import { b as prepareProviderDownloadDir, x as providerDownloadPath } from "./build-cache-Cqj4FGnX.mjs";
7
+ import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-0_Mnfz0a.mjs";
8
+ import { a as missingPackageManagerRemedy, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-xS50Mt0V.mjs";
9
+ import { f as formatDiagnostic } from "./react-native-build-DaPfzf_e.mjs";
10
+ import { u as skippedMissReason } from "./prebuild-Bhs7TTcz.mjs";
11
+ import { t as buildPlacementRecord } from "./placement-log-nnGnu8mo.mjs";
12
+ import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DTh_LxrE.mjs";
13
+ import { a as PLATFORM, h as displayPath } from "./support-CqyWfZZI.mjs";
14
14
  import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
15
15
  import { rmSync } from "node:fs";
16
16
  import { join } from "node:path";
@@ -1,16 +1,16 @@
1
- import { D as ownership_claim_exports, c as throwIfCancelled, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
2
- import { E as workspaceDir } from "./workspace-state-3bF4TB8P.mjs";
3
- import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-VrXd6qPX.mjs";
4
- import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote } from "./ccache-DVDO2ocE.mjs";
5
- import { $ as cancelledFailure, A as COMPILATION_CACHE_NOT_RUN, F as compilationCacheActivityLine, st as runCancellationSignal } from "./toolchain-CGdgD4x4.mjs";
6
- import { T as storedAppId, b as providerDownloadPath, x as providerUploadOutcome, y as prepareProviderDownloadDir } from "./build-cache-BsKim4V7.mjs";
7
- import { C as COMPILATION_CACHE_CORRUPT, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, s as offloadCheck, u as remotePhaseText, w as clearCorruptCompilationCache } from "./client-DhJOvSvh.mjs";
8
- import { a as missingPackageManagerRemedy, c as podsFailedRemedy, h as predictedRefusal, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-C95m--1_.mjs";
9
- import { S as xcodeFailureReport, p as printDiagnostics } from "./support-Cs24xRQa.mjs";
10
- import { f as settleFingerprintCheck, u as skippedMissReason } from "./prebuild-D0hvmO4j.mjs";
11
- import { t as buildPlacementRecord } from "./placement-log-CFT8SnlS.mjs";
12
- import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-P84h3ssa.mjs";
13
- import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-Br1tVYWX.mjs";
1
+ import { D as ownership_claim_exports, d as throwIfCancelled, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
2
+ import { E as workspaceDir } from "./workspace-state-BdZ-QgmB.mjs";
3
+ import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-DWI9tGPU.mjs";
4
+ import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote } from "./ccache-BXtzEL6M.mjs";
5
+ import { $ as cancelledFailure, A as COMPILATION_CACHE_NOT_RUN, F as compilationCacheActivityLine, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
6
+ import { E as storedAppId, S as providerUploadOutcome, b as prepareProviderDownloadDir, x as providerDownloadPath } from "./build-cache-Cqj4FGnX.mjs";
7
+ import { C as COMPILATION_CACHE_CORRUPT, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, s as offloadCheck, u as remotePhaseText, w as clearCorruptCompilationCache } from "./client-0_Mnfz0a.mjs";
8
+ import { a as missingPackageManagerRemedy, c as podsFailedRemedy, h as predictedRefusal, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-xS50Mt0V.mjs";
9
+ import { S as xcodeFailureReport, p as printDiagnostics } from "./support-D8OH0z98.mjs";
10
+ import { f as settleFingerprintCheck, u as skippedMissReason } from "./prebuild-Bhs7TTcz.mjs";
11
+ import { t as buildPlacementRecord } from "./placement-log-nnGnu8mo.mjs";
12
+ import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DTh_LxrE.mjs";
13
+ import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-BzfLigfh.mjs";
14
14
  import { rmSync } from "node:fs";
15
15
  import { join } from "node:path";
16
16
  import { machineCapacity } from "@stim-cli/core/state";
@@ -455,15 +455,28 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
455
455
  let stored = null;
456
456
  let reason = outcome.ok ? null : outcome.reason;
457
457
  if (outcome.ok) {
458
+ const rekeyed = outcome.builtFingerprint ? recipe.offload?.rekeyed?.(outcome.builtFingerprint) : void 0;
458
459
  if (!await recipe.offload.unchanged()) reason = "the checkout here changed while it built";
459
- else try {
460
- stored = await recipe.cache().store({
461
- ...cacheTarget(storeKey),
462
- sourcePath: outcome.artifactPath,
463
- overwrite: !useBuildCache
464
- }) ?? null;
465
- } catch (e) {
466
- reason = `could not store the app: ${e?.message || e}`;
460
+ else {
461
+ if (rekeyed) {
462
+ note(chalk.dim(phaseLine("fingerprint", `${shortHash(storeHash)} -> ${shortHash(rekeyed.hash)} (as ${outcome.machine} built it)`)));
463
+ storeHash = rekeyed.hash;
464
+ storeKey = rekeyed.key;
465
+ buildFailure = {
466
+ ...buildFailure,
467
+ fingerprint: storeHash,
468
+ cacheKey: storeKey
469
+ };
470
+ }
471
+ try {
472
+ stored = await recipe.cache().store({
473
+ ...cacheTarget(storeKey),
474
+ sourcePath: outcome.artifactPath,
475
+ overwrite: !useBuildCache
476
+ }) ?? null;
477
+ } catch (e) {
478
+ reason = `could not store the app: ${e?.message || e}`;
479
+ }
467
480
  }
468
481
  }
469
482
  try {
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-aULwtNly.mjs";
1
+ import { t as getExecutor } from "./exec-CGuDzt40.mjs";
2
2
  import { join } from "node:path";
3
3
  //#region src/macos/artifact-platform.ts
4
4
  async function validateMacosArtifactPlatform(context, bundle, product, signal, nodeArch = process.arch) {
@@ -1,11 +1,11 @@
1
- import { m as getProject, v as loadConfig$1 } from "./config-D5qNWJEP.mjs";
2
- import { m as peekBudget } from "./ccache-DVDO2ocE.mjs";
3
- import { z as readHostMemoryPressureAsync } from "./ios-CdAV4-1E.mjs";
4
- import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-C95m--1_.mjs";
5
- import { c as call, l as connectHost, m as requireHostedAppMode } from "./hosted-client-5ur3YpxY.mjs";
6
- import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-BEIJRJ7P.mjs";
7
- import { i as prepareHostedNative } from "./hosted-native-kaR4nUHk.mjs";
8
- import { d as peekDeviceSlots, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-Du5wBTNJ.mjs";
1
+ import { m as getProject, v as loadConfig$1 } from "./config-BW0fAtoK.mjs";
2
+ import { m as peekBudget } from "./ccache-BXtzEL6M.mjs";
3
+ import { z as readHostMemoryPressureAsync } from "./ios-BdZdNsAj.mjs";
4
+ import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-xS50Mt0V.mjs";
5
+ import { h as requireHostedAppMode, l as call, u as connectHost } from "./hosted-client-D19Lv0tg.mjs";
6
+ import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-CWsBysyN.mjs";
7
+ import { i as prepareHostedNative } from "./hosted-native-BzXIy97W.mjs";
8
+ import { d as peekDeviceSlots, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-BAkETfIl.mjs";
9
9
  import { ambientEnv } from "@stim-cli/core";
10
10
  import { automaticMachineEnabled, isJsonObject, machineCapacity, mayRunHere, parseHostedChoice, parseHostedNativeOffer, prefersRemote } from "@stim-cli/core/state";
11
11
  import { setTimeout } from "node:timers/promises";
@@ -169,6 +169,7 @@ async function probeHost(machine, platform, selectors, appMode, signal) {
169
169
  let choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsed?.platform === platform ? parsed.choice : null;
170
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
171
  if (!isJsonObject(offer.capacity) || offer.declined !== null && typeof offer.declined !== "string") throw new Error("unreadable device offer");
172
+ const installImage = parsed?.platform === "android" ? parsed.installImage : void 0;
172
173
  return {
173
174
  probe: {
174
175
  machine,
@@ -188,7 +189,8 @@ async function probeHost(machine, platform, selectors, appMode, signal) {
188
189
  ...choice && ("runtime" in choice || "systemImage" in choice) ? { target: {
189
190
  host,
190
191
  choice,
191
- session: null
192
+ session: null,
193
+ ...installImage ? { installImage } : {}
192
194
  } } : {}
193
195
  };
194
196
  } catch (error) {
@@ -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-aULwtNly.mjs";
2
- import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-3bF4TB8P.mjs";
3
- import { m as getProject } from "./config-D5qNWJEP.mjs";
4
- import { l as phaseLine } from "./command-output-VrXd6qPX.mjs";
5
- import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-C6UTYW2K.mjs";
6
- import { b as isPackageResolvable, v as detectIsExpo } from "./project-DCLkDM8C.mjs";
7
- import { d as resolveProjectMetro } from "./metro-mKHEMO-a.mjs";
1
+ import { D as ownership_claim_exports, T as process_identity_exports, d as throwIfCancelled, f as WorkspaceProcessCleanupError, p as withWorkspaceProcessLock, t as getExecutor, u as cancelledError } from "./exec-CGuDzt40.mjs";
2
+ import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-BdZ-QgmB.mjs";
3
+ import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
4
+ import { m as getProject } from "./config-BW0fAtoK.mjs";
5
+ import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-B5IBDfTx.mjs";
6
+ import { b as isPackageResolvable, v as detectIsExpo } from "./project-DWEXiBA9.mjs";
7
+ import { d as resolveProjectMetro } from "./metro-B5PVz0Wv.mjs";
8
8
  import { c as readNdjsonGenerations$1 } from "./ndjson-CrjIsGzw.mjs";
9
- import { Wt as readMetroRecords } from "./ccache-DVDO2ocE.mjs";
10
- import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-CM_HvvkS.mjs";
11
- import { ft as teardownBrowserHeld, x as resolveSupervisorTarget } from "./workspaces-BNEyJ1B_.mjs";
12
- import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-B0hCk2v-.mjs";
13
- import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CQJlcj3x.mjs";
14
- import { o as resolveWorkspaceMetroPort } from "./start-LSwIFlBv.mjs";
9
+ import { Wt as readMetroRecords } from "./ccache-BXtzEL6M.mjs";
10
+ import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-CtmYTRWm.mjs";
11
+ import { ft as teardownBrowserHeld, x as resolveSupervisorTarget } from "./workspaces-B3ahAHZc.mjs";
12
+ import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-CA0nB9Yw.mjs";
13
+ import { n as sendToOwnedPage, t as liveWebRecord } from "./page-Dj8IqvGM.mjs";
14
+ import { o as resolveWorkspaceMetroPort } from "./start-BsEV4S-s.mjs";
15
15
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.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";
16
+ import { n as windowsLauncherArgs } from "./detached-entry-tfrgGVWb.mjs";
17
+ import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-C8sC5tdl.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,28 +1,28 @@
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-3bF4TB8P.mjs";
3
- import { D as upsertProject, k as withConfigLockAsync, m as getProject, u as getConcurrencyLimits } from "./config-D5qNWJEP.mjs";
4
- import { l as phaseLine } from "./command-output-VrXd6qPX.mjs";
5
- import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-C6UTYW2K.mjs";
6
- import { f as projectRegistry, v as detectIsExpo } from "./project-DCLkDM8C.mjs";
7
- import { s as workspaceShareURL } from "./stim-desktop-1XxET4S8.mjs";
8
- import { j as hostSystemImageArch } from "./android-DsEj2CCs.mjs";
1
+ import { d as throwIfCancelled, u as cancelledError, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
2
+ import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-BdZ-QgmB.mjs";
3
+ import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
4
+ import { D as upsertProject, k as withConfigLockAsync, m as getProject, u as getConcurrencyLimits } from "./config-BW0fAtoK.mjs";
5
+ import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-B5IBDfTx.mjs";
6
+ import { f as projectRegistry, v as detectIsExpo } from "./project-DWEXiBA9.mjs";
7
+ import { s as workspaceShareURL } from "./stim-desktop-_WTria-r.mjs";
8
+ import { j as hostSystemImageArch } from "./android-Iq0M2t2d.mjs";
9
9
  import { i as createNdjsonWriter } from "./ndjson-CrjIsGzw.mjs";
10
- import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-DVDO2ocE.mjs";
11
- import { $ as tapBuildLog, Q as startBuildProgress, St as acquireBuildSlot, Tt as releaseBuildSlot, X as recordFinishedBuild, ct as recordRunStats, it as readRunEstimates, lt as statsProjectKey, rt as createRunRecorder } from "./workspaces-BNEyJ1B_.mjs";
12
- import { H as readBundleId, ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-CGdgD4x4.mjs";
13
- import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-Dw4N_RFe.mjs";
14
- import { T as storedAppId, x as providerUploadOutcome } from "./build-cache-BsKim4V7.mjs";
15
- import { m as listIosRuntimes } from "./ios-CdAV4-1E.mjs";
10
+ import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-BXtzEL6M.mjs";
11
+ import { $ as tapBuildLog, Q as startBuildProgress, St as acquireBuildSlot, Tt as releaseBuildSlot, X as recordFinishedBuild, ct as recordRunStats, it as readRunEstimates, lt as statsProjectKey, rt as createRunRecorder } from "./workspaces-B3ahAHZc.mjs";
12
+ import { H as readBundleId, ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
13
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-C8kBq9w0.mjs";
14
+ import { E as storedAppId, S as providerUploadOutcome } from "./build-cache-Cqj4FGnX.mjs";
15
+ import { m as listIosRuntimes } from "./ios-BdZdNsAj.mjs";
16
16
  import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
17
- import { S as setRemoteLogSink } from "./client-DhJOvSvh.mjs";
18
- import { d as resolveBuildPlacement } from "./selection-C95m--1_.mjs";
19
- import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-Cs24xRQa.mjs";
20
- import { f as settleFingerprintCheck } from "./prebuild-D0hvmO4j.mjs";
21
- import { n as ensureWorkspaceStorageSafely } from "./native-runtime-D4qgnjK_.mjs";
22
- import { t as acquireAndroidArtifact } from "./artifact-ta3xA0c4.mjs";
23
- import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-Epkl6gyG.mjs";
24
- import { o as lastBuildRecord } from "./ios-project-Br1tVYWX.mjs";
25
- import { t as acquireIosArtifact } from "./artifact-Cr34-Yyy.mjs";
17
+ import { S as setRemoteLogSink } from "./client-0_Mnfz0a.mjs";
18
+ import { d as resolveBuildPlacement } from "./selection-xS50Mt0V.mjs";
19
+ import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-D8OH0z98.mjs";
20
+ import { f as settleFingerprintCheck } from "./prebuild-Bhs7TTcz.mjs";
21
+ import { n as ensureWorkspaceStorageSafely } from "./native-runtime-e1OU8gEN.mjs";
22
+ import { t as acquireAndroidArtifact } from "./artifact-BMjubIP2.mjs";
23
+ import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-DuimMZKJ.mjs";
24
+ import { o as lastBuildRecord } from "./ios-project-BzfLigfh.mjs";
25
+ import { t as acquireIosArtifact } from "./artifact-BufzdGbT.mjs";
26
26
  import { constants, promises } from "node:fs";
27
27
  import { basename, join } from "node:path";
28
28
  import { hostSimulatorArch } from "@stim-cli/core";