stim 1.19.0 → 1.20.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/README.md +20 -3
  2. package/dist/{activity-BSw0x84R.mjs → activity-BrGh9EAI.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-Bjxu_VmX.mjs → agent-device-usage-output-DVyv_hWj.mjs} +7 -7
  4. package/dist/android-0vv-OruW.mjs +6 -0
  5. package/dist/android-Brx6EKvJ.mjs +1258 -0
  6. package/dist/{android-BdQC6zs1.mjs → android-BsYNR81W.mjs} +103 -45
  7. package/dist/{android-DE5g_5gv.mjs → android-CK3fpEyZ.mjs} +2 -2
  8. package/dist/{android-cas-C87geAg-.mjs → android-cas-DCAuXryb.mjs} +9 -5
  9. package/dist/android-cas-compiler.mjs +1 -1
  10. package/dist/api-run.mjs +159 -8
  11. package/dist/{api-DIf_s86s.mjs → api-zuX3ynYN.mjs} +5 -1
  12. package/dist/api.d.mts +98 -4
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-CFI4ptUL.mjs → app-install-0LgaQRT7.mjs} +9 -8
  15. package/dist/artifact-CnC0mfov.mjs +807 -0
  16. package/dist/artifact-DClXJNWx.mjs +772 -0
  17. package/dist/artifact-lifecycle-DzPpBYvK.mjs +30 -0
  18. package/dist/{browser-web-CDhqQxhv.mjs → browser-web-CzBmhmgs.mjs} +19 -19
  19. package/dist/{budget-Dz-kyXLv.mjs → budget-BONq9vXY.mjs} +3101 -3062
  20. package/dist/build-BixRI6sB.mjs +462 -0
  21. package/dist/{build-facts-B87vo-Im.d.mts → build-facts-DcLv2HSd.d.mts} +1 -32
  22. package/dist/build-plan-CP0tckNU.mjs +553 -0
  23. package/dist/{cache-manifest-DiwKSyv9.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{manifest-CX0d1IkZ.mjs → ccache-CjHQ5F8g.mjs} +13 -19
  26. package/dist/{chrome-BTUOo8p2.mjs → chrome-Dp2lMLBe.mjs} +1 -1
  27. package/dist/{cli-C9Zvgbdc.mjs → cli-B2R8wH1F.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-CuUo8Nvg.mjs → client-BLy1Pw2V.mjs} +89 -307
  30. package/dist/collector-run.d.mts +4 -0
  31. package/dist/collector-run.mjs +7 -7
  32. package/dist/{command-output-Bt8ygHE7.mjs → command-output-BjPN99ZB.mjs} +2 -2
  33. package/dist/{config-DC5jEtd1.mjs → config-D0LhTY3S.mjs} +8 -12
  34. package/dist/{created-devices-D0s26Hx5.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
  35. package/dist/{dependency-state-DKaS1OM9.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
  36. package/dist/{detached-entry-pB_IPfV4.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
  37. package/dist/{dev-client-CDY_zAmD.mjs → dev-client-ClATaJoH.mjs} +2 -2
  38. package/dist/{device-BHw0WlHl.mjs → device-B7lsC0K1.mjs} +8 -8
  39. package/dist/device-DVCwAFlX.mjs +727 -0
  40. package/dist/{device-capacity-BoN1jQkO.mjs → device-capacity-Ca_ke1LE.mjs} +13 -14
  41. package/dist/device-host-worker.mjs +38 -18
  42. package/dist/device-ios-CRUqPxKw.mjs +413 -0
  43. package/dist/{device-lease-Cu7PtQpZ.mjs → device-lease-DHOBXGgS.mjs} +135 -22
  44. package/dist/{device-lease-run-D38SnZtt.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
  45. package/dist/{device-pool-CP4rAsHx.mjs → device-pool-L2-5GxMy.mjs} +3 -3
  46. package/dist/{device-remote-B5GiUifk.mjs → device-remote-Bmg42063.mjs} +17 -68
  47. package/dist/doctor-C2MSuMMg.mjs +515 -0
  48. package/dist/{doctor-PRJH94v6.mjs → doctor-DPAqhVCK.mjs} +333 -744
  49. package/dist/{doctor-watchman-wZhyTdp4.mjs → doctor-watchman-CB4NnVZm.mjs} +13 -12
  50. package/dist/{simslim-D9LkJxIO.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
  51. package/dist/{stim-installations-DbmUjsLv.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
  52. package/dist/{error-diagnostics--v5HGOU0.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
  53. package/dist/errors-DzkMYh8Q.mjs +205 -0
  54. package/dist/{exec-i8GDPwq9.mjs → exec-B81Qodjn.mjs} +40 -10
  55. package/dist/{gc-CyHMcKcn.mjs → gc-PWp34zGb.mjs} +21 -20
  56. package/dist/{device-ios-B2ruohE-.mjs → gradle-C2OEKCCI.mjs} +21 -650
  57. package/dist/{guide-dRaQJJk9.mjs → guide-Dai9lphv.mjs} +504 -117
  58. package/dist/{hosted-android-Bs7fytj7.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
  59. package/dist/{hosted-client-C5G4h_OJ.mjs → hosted-client-Io01s5By.mjs} +9 -3
  60. package/dist/{hosted-ios-Bik035eL.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
  61. package/dist/{hosted-logs-CI9Az9a4.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
  62. package/dist/{hosted-macos-DABm3ScO.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
  63. package/dist/{hosted-native-DbV2aUVw.mjs → hosted-native-BdAQi21M.mjs} +17 -14
  64. package/dist/{idle-shutdown-DYiMBn34.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
  65. package/dist/{ios-DYUr9LGc.mjs → ios-BZ9dg2Fr.mjs} +8 -7
  66. package/dist/{ios-BWbHFZVz.mjs → ios-CXLIUxXJ.mjs} +180 -24
  67. package/dist/ios-CZuv6gRv.mjs +1112 -0
  68. package/dist/{ios-DCrkgXEM.mjs → ios-VGvNdsv2.mjs} +1 -1
  69. package/dist/{ios-device-CrW8aMb5.mjs → ios-device-B1B14xND.mjs} +1 -1
  70. package/dist/{ios-device-CJ_ZOGky.mjs → ios-device-BreZOpM0.mjs} +3 -3
  71. package/dist/ios-project-B9drt_aY.mjs +197 -0
  72. package/dist/{ios-state-By0XuLTQ.mjs → ios-state-CjrL2qv-.mjs} +1 -1
  73. package/dist/js-swap-C8icNYIY.mjs +432 -0
  74. package/dist/launch-DxH0THLP.mjs +745 -0
  75. package/dist/{react-native-ios-CSpIxexZ.mjs → launch-YrbqaIFj.mjs} +59 -612
  76. package/dist/{launch-verify-DCveSE6d.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
  77. package/dist/{logs-Bao1HOMy.mjs → logs-DHaRNfg7.mjs} +11 -11
  78. package/dist/macos-C0iljhsN.mjs +2 -0
  79. package/dist/{macos-ciyBdTY5.mjs → macos-V_3Ui7g4.mjs} +42 -50
  80. package/dist/macos-run.mjs +1 -1
  81. package/dist/maintenance-run.mjs +13 -10
  82. package/dist/{metro-DI2AjPF_.mjs → metro-D_j9sN-B.mjs} +18 -5
  83. package/dist/{metro-gateway-BxpJLIwh.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
  84. package/dist/miss-reason-BPAzZS0r.mjs +238 -0
  85. package/dist/{named-ports-B4iWH4E-.mjs → named-ports-C2lvoPsb.mjs} +3 -3
  86. package/dist/native-android-lHzaew7r.mjs +226 -0
  87. package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
  88. package/dist/{native-runtime-BGxsbfny.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
  89. package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
  90. package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
  91. package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
  92. package/dist/offload-worker.d.mts +41 -7
  93. package/dist/offload-worker.mjs +409 -74
  94. package/dist/{ownership-EB0ySdGK.mjs → ownership-DXzMMSx6.mjs} +2 -2
  95. package/dist/{placement-log-Dxe34rJm.mjs → placement-log-reFbjqEr.mjs} +1 -1
  96. package/dist/plan-BDk2AeY_.mjs +260 -0
  97. package/dist/plan-placement-D_YYlE6N.mjs +73 -0
  98. package/dist/{ports-ByPc0_97.mjs → ports-jzvAJXXL.mjs} +3 -3
  99. package/dist/{prebuild-BKJ3wJI1.mjs → prebuild-Bw44QxVh.mjs} +4 -4
  100. package/dist/{preview-BbSottmO.mjs → preview-BaBJ72Al.mjs} +50 -32
  101. package/dist/project-B8_duAzW.mjs +1067 -0
  102. package/dist/project-plan-BPwbLwQu.mjs +10 -0
  103. package/dist/{pull-request-IHNdMnG8.mjs → pull-request-vOhLNmIb.mjs} +1 -1
  104. package/dist/pull-requests.mjs +1 -1
  105. package/dist/react-native-android-chm1DMlA.mjs +921 -0
  106. package/dist/react-native-build-oAw6gQeW.mjs +239 -0
  107. package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
  108. package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
  109. package/dist/{recordings-Bv8McZN4.mjs → recordings-Bk-VivUV.mjs} +1 -1
  110. package/dist/{reload-rAPdqeRR.mjs → reload-D34GkY78.mjs} +17 -13
  111. package/dist/remote-BU9UyhCJ.mjs +192 -0
  112. package/dist/{remote-cache-N3hAEaAL.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
  113. package/dist/result-BDoRk1k3.mjs +186 -0
  114. package/dist/{run-lAkle1-c.mjs → run-qvff78hv.mjs} +3 -3
  115. package/dist/{server-bare-CkIjnegq.mjs → server-bare-dWjAarki.mjs} +5 -5
  116. package/dist/server-command-7XIKlWtO.mjs +69 -0
  117. package/dist/{server-expo-n3tUi3Em.mjs → server-expo-CsYu2aKL.mjs} +107 -82
  118. package/dist/server-expo-DV43vep4.mjs +2 -0
  119. package/dist/{settings-CxgngUZk.mjs → settings-Bbztm4oV.mjs} +179 -129
  120. package/dist/{settings-2am7TSxp.mjs → settings-CT3E71-i.mjs} +6 -6
  121. package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
  122. package/dist/settings.schema.json +84 -0
  123. package/dist/simslim-ChMfe8rg.mjs +149 -0
  124. package/dist/{slot-launch-HV_KtPIw.mjs → slot-launch-B9hn96wd.mjs} +6 -6
  125. package/dist/{stage-BgaZJVZY.mjs → stage-BNKKdDNc.mjs} +6 -3
  126. package/dist/start-CbQCSnXQ.mjs +2 -0
  127. package/dist/{start-DtxthMfI.mjs → start-CdvcTaXr.mjs} +97 -68
  128. package/dist/{state-Tp4uImDS.mjs → state-Boo0IMJq.mjs} +1 -1
  129. package/dist/{state-D2KtnALG.mjs → state-DI84A-uu.mjs} +29 -10
  130. package/dist/{stats-8EJ5ivFT.mjs → stats-BIIDrjA8.mjs} +5 -5
  131. package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
  132. package/dist/{status-BOyp0CUl.mjs → status-DARMkc9q.mjs} +81 -293
  133. package/dist/status-watch-DvmI3SmN.mjs +296 -0
  134. package/dist/{stim-desktop-C65jk_q2.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
  135. package/dist/{stop-DRipAg-e.mjs → stop-CCZS-C9m.mjs} +2 -2
  136. package/dist/{stop-D0UIpZuh.mjs → stop-WQPQHLuy.mjs} +5 -5
  137. package/dist/{stop-zDlknFoz.mjs → stop-iNemHsJC.mjs} +21 -20
  138. package/dist/supervisor-run.d.mts +7 -2
  139. package/dist/supervisor-run.mjs +32 -20
  140. package/dist/{support-DsNaFg6D.mjs → support-CnE_SIjt.mjs} +17 -7
  141. package/dist/{support-CNqYkV0y.mjs → support-DCco5fut.mjs} +61 -8
  142. package/dist/{swiftpm-macos-aJzPAj1t.mjs → swiftpm-macos-afeNUExW.mjs} +5 -5
  143. package/dist/tailnet-CoJUb2tB.mjs +265 -0
  144. package/dist/toolchain-BIupIro1.mjs +2 -0
  145. package/dist/{toolchain-C3xSoyUl.mjs → toolchain-DqyDXs30.mjs} +206 -53
  146. package/dist/{trigger-CAhmG-4s.mjs → trigger-C0MWBi8O.mjs} +2 -2
  147. package/dist/trigger-SHLOWJ4O.mjs +2 -0
  148. package/dist/{warm-progress-pFLB2e6P.mjs → warm-progress-C3ASD6z5.mjs} +6 -6
  149. package/dist/{watchman-BL1IdOtq.mjs → watchman-CQl51YZu.mjs} +6 -6
  150. package/dist/{web-DbbrPUn0.mjs → web-B3eldHFH.mjs} +9 -13
  151. package/dist/web-BLXpOe6b.mjs +2 -0
  152. package/dist/web-run.mjs +10 -10
  153. package/dist/{workspace-state-CR9X86xJ.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
  154. package/dist/{workspaces-Djb2gfi9.mjs → workspaces-D2xSHBDY.mjs} +1260 -1258
  155. package/dist/{worktree-BL4M1rhB.mjs → worktree-BxDqaTev.mjs} +84 -48
  156. package/dist/worktree-q7_OZNY0.mjs +2 -0
  157. package/package.json +8 -6
  158. package/shim/native-android.gradle +101 -0
  159. package/dist/android-BXc6BmEi.mjs +0 -3732
  160. package/dist/android-BvV1gGdN.mjs +0 -4
  161. package/dist/ios-ITYno9rO.mjs +0 -2241
  162. package/dist/macos-nIOATJmR.mjs +0 -2
  163. package/dist/metro-store-BAHFcJm6.mjs +0 -106
  164. package/dist/miss-reason-CjQCOKqq.mjs +0 -1743
  165. package/dist/plan-placement-BVY59qa8.mjs +0 -290
  166. package/dist/project-B5eQ1USs.mjs +0 -612
  167. package/dist/react-native-ios-BMh2i25I.mjs +0 -2
  168. package/dist/server-expo-DGsdUGX2.mjs +0 -2
  169. package/dist/start-D8NbxNBb.mjs +0 -2
  170. package/dist/trigger-CoalsMTV.mjs +0 -2
  171. package/dist/web-DFpFeZu5.mjs +0 -2
  172. package/dist/worktree-DV-A0LNL.mjs +0 -2
@@ -0,0 +1,192 @@
1
+ import { z as deviceSlotPlatforms } from "./config-D0LhTY3S.mjs";
2
+ import { F as parseIosRemote, H as remoteIosSetting, L as publicUrlSetting, V as remoteEasFallbackSetting, tt as tunnelModeSetting } from "./settings-Bbztm4oV.mjs";
3
+ import { l as phaseLine } from "./command-output-BjPN99ZB.mjs";
4
+ import { n as devicePlacementRecord } from "./placement-log-reFbjqEr.mjs";
5
+ import { c as devicePlacementLine } from "./build-plan-CP0tckNU.mjs";
6
+ import "./device-remote-Bmg42063.mjs";
7
+ import { b as resolveSimulatorAppFlag } from "./support-DCco5fut.mjs";
8
+ import chalk from "chalk";
9
+ //#region src/commands/ios/remote.ts
10
+ function resolveIosRemote({ opts, settings, physical, recorded }) {
11
+ const target = opts.remote !== void 0 ? parseIosRemote(opts.remote) : remoteIosSetting(settings);
12
+ if (physical && target?.kind === "machine") return { failure: {
13
+ code: "STIM_BAD_ARG",
14
+ message: "--device builds for a phone connected to this machine, and --remote installs on a remote one.",
15
+ remedy: "Pass only one of --device and --remote; unset ios.remote for a local phone."
16
+ } };
17
+ const machine = target?.kind === "machine" ? target.machine : null;
18
+ if (recorded && recorded.machine !== machine && machine !== "auto") return { failure: {
19
+ code: "STIM_BAD_ARG",
20
+ message: `This workspace's iOS simulator runs on ${recorded.machine}; run stim stop first.`
21
+ } };
22
+ return {
23
+ machine,
24
+ backend: !physical && target?.kind === "backend" ? target.backend : null,
25
+ recorded
26
+ };
27
+ }
28
+ function selectIosTarget({ root, slot, opts, settings, physical, appMode, metroCheck, d }) {
29
+ let recorded;
30
+ try {
31
+ recorded = d.readHostedIos(root, slot)[slot];
32
+ } catch (error) {
33
+ return { failure: {
34
+ code: "STIM_HOSTING_REFUSED",
35
+ message: error.message,
36
+ ...error instanceof Error && "remedy" in error && typeof error.remedy === "string" ? { remedy: error.remedy } : {}
37
+ } };
38
+ }
39
+ const selection = resolveIosRemote({
40
+ opts,
41
+ settings,
42
+ physical,
43
+ recorded
44
+ });
45
+ if ("failure" in selection) return selection;
46
+ const localIos = selection.machine ? deviceSlotPlatforms(d.getProject(root), slot)?.ios : void 0;
47
+ if (selection.machine !== "auto" && selection.machine && localIos?.owned && localIos.deviceUdid) {
48
+ let localRunning = true;
49
+ try {
50
+ localRunning = d.listAllIosSims({ timeoutMs: 5e3 }).some((sim) => sim.udid === localIos.deviceUdid && sim.state !== "Shutdown");
51
+ } catch {}
52
+ if (localRunning) return { failure: {
53
+ code: "STIM_BAD_ARG",
54
+ message: `This workspace's iOS simulator for slot ${slot} runs on this Mac; run stim stop first.`
55
+ } };
56
+ }
57
+ if (selection.machine !== "auto" && selection.machine && appMode === "development" && !metroCheck) return { failure: {
58
+ code: "STIM_BAD_ARG",
59
+ message: "Hosted Debug runs require the local Metro supervisor; --no-metro-check cannot be used.",
60
+ remedy: "Run stim stop; stim start, then retry without --no-metro-check."
61
+ } };
62
+ return selection;
63
+ }
64
+ async function selectIosPlacement(args) {
65
+ const selection = selectIosTarget(args);
66
+ if ("failure" in selection || selection.machine !== "auto") return selection;
67
+ const { root, slot, d, opts, deviceType, runtime, noWait, phase, log, release, appMode, metroCheck } = args;
68
+ const viewer = resolveSimulatorAppFlag(opts.simulatorApp, args.physical, null);
69
+ if ("refusal" in viewer) return { failure: viewer.refusal };
70
+ const refusal = args.validateSelectors();
71
+ if (refusal) return { failure: refusal };
72
+ const easFallback = args.supportsRemote && remoteEasFallbackSetting(args.settings);
73
+ try {
74
+ const placed = await d.automaticDevicePlacement({
75
+ root,
76
+ slot,
77
+ platform: "ios",
78
+ selectors: hostedIosSelectors(deviceType, runtime),
79
+ appMode,
80
+ buildMachine: opts.remoteBuild,
81
+ noWait,
82
+ ...easFallback ? { eas: () => d.checkEasFallback({
83
+ root,
84
+ platform: "ios",
85
+ slot,
86
+ release,
87
+ isExpo: d.detectIsExpo(root),
88
+ tunnelMode: tunnelModeSetting(args.settings),
89
+ publicUrl: publicUrlSetting(args.settings),
90
+ deviceTypeFlag: opts.deviceType,
91
+ localOnlyFlags: typeof opts.runtime === "string" ? ["--runtime"] : []
92
+ }) } : {}
93
+ });
94
+ phase("placement:", devicePlacementLine(placed.placement, placed.skipped));
95
+ log?.(devicePlacementRecord({
96
+ platform: "ios",
97
+ fromFlag: opts.remote !== void 0,
98
+ easFallback,
99
+ placed
100
+ }));
101
+ if (placed.placement.decision === "eas") return {
102
+ ...selection,
103
+ machine: null,
104
+ backend: "eas",
105
+ recorded: void 0,
106
+ auto: { target: null },
107
+ devicePlacement: placed.placement
108
+ };
109
+ if (placed.target && appMode === "development" && !metroCheck) return { failure: {
110
+ code: "STIM_BAD_ARG",
111
+ message: "Hosted Debug runs require the local Metro supervisor; --no-metro-check cannot be used.",
112
+ remedy: "Run stim stop; stim start, then retry without --no-metro-check."
113
+ } };
114
+ return {
115
+ ...selection,
116
+ machine: placed.target?.host.machine ?? null,
117
+ recorded: void 0,
118
+ auto: { target: placed.target },
119
+ budget: placed.target ? {
120
+ reclaimed: [],
121
+ refusal: null
122
+ } : void 0,
123
+ devicePlacement: placed.placement
124
+ };
125
+ } catch (error) {
126
+ return { failure: {
127
+ code: error.code ?? "STIM_HOSTING_REFUSED",
128
+ message: error.message,
129
+ ...error instanceof Error && "remedy" in error && typeof error.remedy === "string" ? { remedy: error.remedy } : {}
130
+ } };
131
+ }
132
+ }
133
+ function hostedIosSelectors(deviceType, runtime) {
134
+ return {
135
+ ...deviceType ? { deviceType } : {},
136
+ ...runtime ? { runtime } : {}
137
+ };
138
+ }
139
+ async function connectIosTarget(selection, selectors, d, appMode) {
140
+ if (selection.auto) return { target: selection.auto.target };
141
+ if (!selection.machine) return { target: null };
142
+ try {
143
+ return { target: await d.prepareHostedIos(selection.machine, selectors, selection.recorded, appMode) };
144
+ } catch (error) {
145
+ return { failure: {
146
+ code: error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : "STIM_HOSTING_REFUSED",
147
+ message: error instanceof Error ? error.message : String(error),
148
+ ...error instanceof Error && "remedy" in error && typeof error.remedy === "string" ? { remedy: error.remedy } : {}
149
+ } };
150
+ }
151
+ }
152
+ async function iosPlacementBudget(d, root, note, hosted, automatic, simSnapshot) {
153
+ if (automatic) return {
154
+ ...automatic,
155
+ refusal: hosted ? null : automatic.refusal
156
+ };
157
+ return hosted ? {
158
+ reclaimed: [],
159
+ refusal: null
160
+ } : d.budgetGate({
161
+ root,
162
+ note,
163
+ simSnapshot
164
+ });
165
+ }
166
+ function hostedIosMetroNote(hosted, settings, note, simulatorApp) {
167
+ if (hosted && (settings.iosSimulatorApp !== void 0 || simulatorApp !== void 0)) note(chalk.dim(phaseLine("device", "iosSimulatorApp is ignored on a hosting Mac; the simulator boots headless.")));
168
+ if (hosted && (publicUrlSetting(settings) || tunnelModeSetting(settings))) note(chalk.dim(phaseLine("metro", "metro.publicUrl and metro.tunnel are ignored on a hosting Mac; Metro uses the private tailnet bridge.")));
169
+ }
170
+ async function connectIosBackend(root, backend, deviceType, d) {
171
+ if (!backend) return {
172
+ remote: null,
173
+ arch: null
174
+ };
175
+ const resolved = await d.resolveRemoteContext({
176
+ root,
177
+ backend,
178
+ easBin: d.resolveEasCliBin(root)?.file ?? null,
179
+ deviceType: deviceType?.trim() || null
180
+ });
181
+ if ("failed" in resolved) return { failure: {
182
+ code: resolved.code ?? "STIM_NO_REMOTE_SESSION",
183
+ message: resolved.failed,
184
+ remedy: resolved.remedy
185
+ } };
186
+ return {
187
+ remote: d.remoteIosDeps(resolved.ctx),
188
+ arch: await d.readRemoteSimulatorArch(resolved.ctx.existingDaemon)
189
+ };
190
+ }
191
+ //#endregion
192
+ export { iosPlacementBudget as a, hostedIosSelectors as i, connectIosTarget as n, selectIosPlacement as o, hostedIosMetroNote as r, connectIosBackend as t };
@@ -1,9 +1,9 @@
1
- import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
1
+ import { t as getExecutor } from "./exec-B81Qodjn.mjs";
2
+ import { w as workspaceLogsDir } from "./workspace-state-CSIFuuDa.mjs";
2
3
  import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
3
- import { x as workspaceLogsDir } from "./workspace-state-CR9X86xJ.mjs";
4
- import { v as resolvePackageJson } from "./project-B5eQ1USs.mjs";
5
- import { r as createNdjsonWriter } from "./ndjson-LGZAMsqa.mjs";
6
- import { n as expoBinFromPackage, r as expoBinPath, s as findBinUpward } from "./server-expo-n3tUi3Em.mjs";
4
+ import { S as resolvePackageJson } from "./project-B8_duAzW.mjs";
5
+ import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
6
+ import { n as expoBinFromPackage, r as expoBinPath, s as findBinUpward } from "./server-expo-CsYu2aKL.mjs";
7
7
  import { createRequire } from "node:module";
8
8
  import { existsSync, readFileSync } from "node:fs";
9
9
  import { join } from "node:path";
@@ -0,0 +1,186 @@
1
+ import { y as workspaceAgentDeviceDir } from "./workspace-state-CSIFuuDa.mjs";
2
+ import { i as formatDuration, l as phaseLine } from "./command-output-BjPN99ZB.mjs";
3
+ import { i as workspaceLinkLine } from "./stim-desktop-8GQX2OV8.mjs";
4
+ import { Dt as recordFinishedBuild } from "./budget-BONq9vXY.mjs";
5
+ import { a as easAuthNote, n as UPLOAD_TIMEOUT_MS, r as cacheLevel, s as isEasAuthFailureText } from "./remote-cache-Bsts6f6Y.mjs";
6
+ import "./launch-verify-BzRdbuO1.mjs";
7
+ import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine } from "./ccache-CjHQ5F8g.mjs";
8
+ import { a as PLATFORM } from "./support-CnE_SIjt.mjs";
9
+ import { buildDiagnostics } from "@stim-cli/core/state";
10
+ import chalk from "chalk";
11
+ //#region src/commands/android/result.ts
12
+ function androidFacts({ root, slot, serial, avdName = null, deviceName = null, systemImage = null, deviceProfile = null, fingerprint, cacheKey = null, variant = null, metroPort = null, cacheHit, cacheSkipped = false, waitedForBuild = null, appPath, bundleId, installSkipped = false, launched, ccache = CCACHE_UNAVAILABLE, logs, debugHttpHost = null, debugHttpHostNote = null, devClientUrl = null, durationMs, lease, devServer = null, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null, host }) {
13
+ return {
14
+ platform: PLATFORM,
15
+ ...host ? { host } : {},
16
+ ...slot && slot !== "default" ? { slot } : {},
17
+ serial: serial ?? null,
18
+ avdName: avdName ?? null,
19
+ deviceName: deviceName ?? avdName ?? null,
20
+ systemImage: systemImage ?? null,
21
+ deviceProfile: deviceProfile ?? null,
22
+ fingerprint: fingerprint ?? null,
23
+ cacheKey: cacheKey ?? null,
24
+ variant: variant ?? null,
25
+ metroPort: metroPort ?? null,
26
+ cacheHit: cacheLevel(cacheHit),
27
+ cacheSkipped: Boolean(cacheSkipped),
28
+ buildMachine,
29
+ ...builtOn ? { builtOn } : {},
30
+ ...offloadedTo ? { offloadedTo } : {},
31
+ ...offloadFallback ? { offloadFallback } : {},
32
+ waitedForBuild: waitedForBuild ? {
33
+ pid: waitedForBuild.pid ?? null,
34
+ ms: waitedForBuild.ms ?? 0
35
+ } : null,
36
+ appPath: appPath ?? null,
37
+ bundleId: bundleId ?? null,
38
+ installSkipped: Boolean(installSkipped),
39
+ launched: launched === "unverified" || launched === "bundling" ? launched : Boolean(launched),
40
+ ccache,
41
+ debugHttpHost: debugHttpHost ?? null,
42
+ debugHttpHostNote: debugHttpHostNote ?? null,
43
+ devClientUrl: devClientUrl ?? null,
44
+ logs: logs ?? null,
45
+ ...root && !host ? { agentDevice: { stateDir: workspaceAgentDeviceDir(root) } } : {},
46
+ durationMs: typeof durationMs === "number" && Number.isFinite(durationMs) ? durationMs : null,
47
+ ...lease === void 0 ? {} : { lease },
48
+ ...devServer ? { devServer } : {}
49
+ };
50
+ }
51
+ function lastBuildRecord({ devicePlacement, fingerprint, cacheKey, cacheHit, cacheSkipped = false, durationMs, appPath, bundleId, startedAt, status, errorCode = null, avdName = null, deviceName = null, missReason = null, diagnostics = null, configuration = null, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null }) {
52
+ const record = {
53
+ platform: PLATFORM,
54
+ avdName: avdName ?? null,
55
+ deviceName: deviceName ?? avdName ?? null,
56
+ fingerprint: fingerprint ?? null,
57
+ cacheKey: cacheKey ?? null,
58
+ cacheHit: cacheLevel(cacheHit),
59
+ cacheSkipped: Boolean(cacheSkipped),
60
+ durationMs: Number.isFinite(durationMs) ? durationMs : null,
61
+ appPath: appPath ?? null,
62
+ bundleId: bundleId ?? null,
63
+ startedAt,
64
+ status,
65
+ configuration: configuration ?? null
66
+ };
67
+ if (errorCode) record.errorCode = errorCode;
68
+ if (devicePlacement) record.devicePlacement = devicePlacement;
69
+ record.buildMachine = buildMachine;
70
+ if (builtOn) record.builtOn = builtOn;
71
+ if (offloadedTo) record.offloadedTo = offloadedTo;
72
+ if (offloadFallback) record.offloadFallback = offloadFallback;
73
+ if (missReason && !cacheLevel(cacheHit)) record.missReason = missReason;
74
+ const recorded = status === "failed" ? buildDiagnostics(diagnostics) : [];
75
+ if (recorded.length) record.diagnostics = recorded;
76
+ return record;
77
+ }
78
+ async function finishAndroidUpload(uploadPending, remote, phase) {
79
+ if (!uploadPending) return false;
80
+ const upload = await uploadPending;
81
+ if (upload?.uploaded) phase("cache", `uploaded (${remote?.name})`);
82
+ else if (upload?.timedOut) {
83
+ phase("cache", chalk.yellow(`${remote?.name} upload still running after ${formatDuration(UPLOAD_TIMEOUT_MS)}; not waiting`));
84
+ return true;
85
+ } else if (upload?.failed) {
86
+ const authNote = remote?.name === "eas" && isEasAuthFailureText(upload.failed) ? easAuthNote({
87
+ code: "logged-out",
88
+ reason: upload.failed,
89
+ phase: "upload"
90
+ }) : null;
91
+ phase("cache", chalk.yellow(authNote || `${remote?.name} upload failed: ${upload.failed}`));
92
+ }
93
+ return false;
94
+ }
95
+ function reportAndroidResult({ host, root, slot, json, useBuildCache, variant, release, runtimeKind = release ? "embedded-js" : "metro", metroCheck, metroPort, logsDir, serial, apkPath, androidPackage, installSkipped, record, waitedForBuild, remote, providerName, launchState, launchWarning, launched, ccache, durationMs, writer, emit, lease, recordRun, reclaimed = [], devServer = null, links }) {
96
+ const offloadedTo = record.offloadedTo ?? null;
97
+ recordRun({
98
+ failed: false,
99
+ cacheHit: cacheLevel(record.cacheHit),
100
+ waited: waitedForBuild,
101
+ durationMs,
102
+ offloadedTo
103
+ });
104
+ const facts = androidFacts({
105
+ host,
106
+ root,
107
+ slot,
108
+ serial,
109
+ avdName: record.avdName,
110
+ deviceName: record.deviceName,
111
+ systemImage: record.systemImage,
112
+ deviceProfile: record.deviceProfile,
113
+ debugHttpHost: launched.debugHttpHost ?? null,
114
+ debugHttpHostNote: launched.debugHttpHostNote ?? null,
115
+ devClientUrl: launched.devClientUrl ?? null,
116
+ fingerprint: record.fingerprint,
117
+ cacheKey: record.cacheKey,
118
+ variant,
119
+ metroPort,
120
+ cacheHit: record.cacheHit,
121
+ cacheSkipped: record.cacheSkipped || !useBuildCache,
122
+ waitedForBuild,
123
+ appPath: apkPath,
124
+ bundleId: androidPackage,
125
+ installSkipped,
126
+ launched: launchState,
127
+ ccache,
128
+ logs: logsDir,
129
+ durationMs,
130
+ lease,
131
+ devServer,
132
+ buildMachine: record.buildMachine,
133
+ builtOn: record.builtOn ?? void 0,
134
+ offloadedTo,
135
+ offloadFallback: record.offloadFallback ?? null
136
+ });
137
+ writer.close();
138
+ if (record.devicePlacement) facts.devicePlacement = record.devicePlacement;
139
+ if (json) emit(JSON.stringify({
140
+ ...facts,
141
+ ...links ? { links } : {},
142
+ ...reclaimed.length ? { reclaimed } : {}
143
+ }));
144
+ else {
145
+ const summary = `${launchWarning ? "WARNING" : "OK"}: ${androidPackage} launched on ${host ? `${host.device?.name ?? "Android emulator"} on ${host.machine}` : serial}, ${runtimeKind === "process" ? `${variant ?? "debug"} (native process, no Metro)` : runtimeKind === "embedded-js" ? `${variant} (embedded JS, no Metro)` : `Metro port ${metroPort}`} (${cacheOutcome(record.cacheHit, remote?.name ?? providerName, offloadedTo)})`;
146
+ const outcome = launchWarning ? chalk.yellow(`${summary} -- ${launchWarning}`) : launchState === "unverified" ? chalk.yellow(`${summary} -- launch UNVERIFIED`) : launchState === "bundling" ? chalk.green(`${summary} -- bundle requested, still building`) : chalk.green(summary);
147
+ const deviceName = record.avdName || record.deviceName || serial;
148
+ const cacheResult = useBuildCache ? cacheOutcome(record.cacheHit, remote?.name ?? providerName, offloadedTo) : `bypassed; ${cacheOutcome(false, null, offloadedTo)}`;
149
+ const metroResult = runtimeKind === "process" ? "native process (no Metro)" : runtimeKind === "embedded-js" ? `embedded (${variant})` : !metroCheck ? `check skipped on port ${metroPort}` : launchState === "unverified" ? `state unverified on port ${metroPort}` : `running on port ${metroPort}${devServer ? ` (started: ${devServer.reason})` : ""}`;
150
+ emit([
151
+ outcome,
152
+ phaseLine("device", host ? `${deviceName} on ${host.machine}` : `${deviceName} (${serial})`),
153
+ phaseLine("app", androidPackage),
154
+ phaseLine(runtimeKind === "process" ? "runtime" : "metro", metroResult),
155
+ phaseLine("cache", cacheResult),
156
+ ...ccache.status === "not-run" ? [phaseLine("compilation cache", ccacheActivityLine(ccache))] : [],
157
+ phaseLine("logs", logsDir || "unavailable (remote device)"),
158
+ ...!host ? [phaseLine("agent-device", `AGENT_DEVICE_STATE_DIR=${workspaceAgentDeviceDir(root)}`)] : []
159
+ ].join("\n"));
160
+ if (links) console.error(chalk.dim(workspaceLinkLine(links)));
161
+ }
162
+ return facts;
163
+ }
164
+ function cacheOutcome(cacheHit, providerName = null, offloadedTo = null) {
165
+ if (cacheHit === "remote") return `cache hit from ${providerName || "the remote cache"}`;
166
+ if (cacheHit === "local") return "cache hit";
167
+ return offloadedTo ? `built on ${offloadedTo}` : "built";
168
+ }
169
+ function persistLastBuild({ recordBuild = recordFinishedBuild, root, record, startedAt, durationMs, status, errorCode = null, diagnostics = null, out }) {
170
+ const lastBuild = lastBuildRecord({
171
+ ...record,
172
+ startedAt,
173
+ durationMs,
174
+ status,
175
+ errorCode,
176
+ diagnostics
177
+ });
178
+ try {
179
+ recordBuild(root, lastBuild);
180
+ } catch (err) {
181
+ out(phaseLine("state", chalk.yellow(`could not record lastBuild: ${err?.message || err}`)));
182
+ }
183
+ return lastBuild;
184
+ }
185
+ //#endregion
186
+ export { reportAndroidResult as a, persistLastBuild as i, finishAndroidUpload as n, lastBuildRecord as r, androidFacts as t };
@@ -1,7 +1,7 @@
1
1
  import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
- import { a as macosRuntimeClaim, i as macosProcess, r as macosLogFile, s as updateMacosRecord } from "./state-Tp4uImDS.mjs";
4
- import { r as createNdjsonWriter } from "./ndjson-LGZAMsqa.mjs";
2
+ import { t as getExecutor } from "./exec-B81Qodjn.mjs";
3
+ import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
4
+ import { a as macosRuntimeClaim, i as macosProcess, r as macosLogFile, s as updateMacosRecord } from "./state-Boo0IMJq.mjs";
5
5
  import { readMacosRecord } from "@stim-cli/core/state";
6
6
  import { LOG_ROTATE_BYTES } from "@stim-cli/core";
7
7
  import { StringDecoder } from "node:string_decoder";
@@ -1,7 +1,7 @@
1
1
  import { i as __require, r as __commonJSMin } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
- import { O as projectMetroSharedCache } from "./settings-CxgngUZk.mjs";
4
- import { a as metroStoreRoot, c as supervisorError, o as registerMetroStore, t as appendCacheStore } from "./metro-store-BAHFcJm6.mjs";
2
+ import { t as getExecutor } from "./exec-B81Qodjn.mjs";
3
+ import { K as resolveProjectSettings } from "./settings-Bbztm4oV.mjs";
4
+ import { c as registerMetroStore, f as resolveMetroSharedCache, n as supervisorError, r as appendCacheStore, s as metroStoreRoot } from "./errors-DzkMYh8Q.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import { isAbsolute, join, relative, sep } from "node:path";
7
7
  //#endregion
@@ -290,7 +290,7 @@ function closeHttpServer(httpServer, timeoutMs) {
290
290
  }
291
291
  });
292
292
  }
293
- async function startBareServer({ root, port, logsDir, writer = null, deps = null, reporterFactory = void 0, cacheStore = void 0, fileStore = void 0, closeTimeoutMs = 5e3, resetCache = false }) {
293
+ async function startBareServer({ root, port, logsDir, writer = null, deps = null, reporterFactory = void 0, cacheStore = void 0, fileStore = void 0, closeTimeoutMs = 5e3, resetCache = false, settings }) {
294
294
  const { metro, devMiddleware, serverApi } = deps || resolveBareDeps(root);
295
295
  const makeReporter = reporterFactory === void 0 ? loadNdjsonReporter(root) : reporterFactory;
296
296
  const config = await metro.loadConfig({
@@ -302,7 +302,7 @@ async function startBareServer({ root, port, logsDir, writer = null, deps = null
302
302
  root,
303
303
  config,
304
304
  writer,
305
- enabled: cacheStore === void 0 ? projectMetroSharedCache(root) : cacheStore,
305
+ enabled: cacheStore === void 0 ? resolveMetroSharedCache(settings ?? resolveProjectSettings(root).settings) : cacheStore,
306
306
  FileStore: fileStore === void 0 ? loadFileStore(root) : fileStore
307
307
  }) && normalizeMetroTransformerPaths(config, root)) writer?.write({
308
308
  src: "metro",
@@ -0,0 +1,69 @@
1
+ import { t as getExecutor } from "./exec-B81Qodjn.mjs";
2
+ import { n as METRO_COMMAND_PORT } from "./settings-Bbztm4oV.mjs";
3
+ import { w as MODE_COMMAND } from "./project-B8_duAzW.mjs";
4
+ import { d as signalProcessTree } from "./metro-D_j9sN-B.mjs";
5
+ import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
6
+ import { f as recordFromLine, m as superviseChildServer } from "./server-expo-CsYu2aKL.mjs";
7
+ import { join } from "node:path";
8
+ import { LOG_ROTATE_BYTES } from "@stim-cli/core";
9
+ //#region src/supervisor/server-command.ts
10
+ function processGroupAlive(pgid) {
11
+ try {
12
+ process.kill(-pgid, 0);
13
+ return true;
14
+ } catch (err) {
15
+ return err.code === "EPERM";
16
+ }
17
+ }
18
+ function commandArgv(command, port) {
19
+ return command.map((arg) => arg.replaceAll(METRO_COMMAND_PORT, String(port)));
20
+ }
21
+ async function startCommandServer({ root, port, logsDir, command, writer = null, spawnFn = null, signalTree = signalProcessTree, groupAlive = processGroupAlive, killTimeoutMs = 5e3, platform = process.platform }) {
22
+ const log = writer || createNdjsonWriter(join(logsDir, "metro.ndjson"), { maxBytes: LOG_ROTATE_BYTES });
23
+ const spawn = spawnFn || ((cmd, args, opts) => getExecutor().spawn(cmd, args, opts));
24
+ const [program, ...args] = commandArgv(command, port);
25
+ log.write({
26
+ src: "metro",
27
+ level: "debug",
28
+ event: "cache_store_skipped",
29
+ msg: "metro.command starts the dev server, so Stim does not add its shared Metro transform store"
30
+ });
31
+ const group = platform !== "win32";
32
+ const child = spawn(program, args, {
33
+ cwd: root,
34
+ stdio: [
35
+ "ignore",
36
+ "pipe",
37
+ "pipe"
38
+ ],
39
+ detached: group,
40
+ env: {
41
+ ...process.env,
42
+ FORCE_COLOR: "0"
43
+ }
44
+ });
45
+ return superviseChildServer({
46
+ mode: MODE_COMMAND,
47
+ child,
48
+ log,
49
+ toRecord: (chunk, stream) => recordFromLine(chunk, {
50
+ stream,
51
+ source: "command"
52
+ }),
53
+ signal: (sig) => {
54
+ if (!child.pid) return false;
55
+ try {
56
+ return signalTree(child.pid, sig, {
57
+ group,
58
+ platform
59
+ });
60
+ } catch {
61
+ return false;
62
+ }
63
+ },
64
+ alive: group ? () => Boolean(child.pid) && groupAlive(child.pid) : null,
65
+ killTimeoutMs
66
+ });
67
+ }
68
+ //#endregion
69
+ export { startCommandServer };