stim 1.18.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 (178) hide show
  1. package/README.md +21 -4
  2. package/dist/{activity-BxnkDZDi.mjs → activity-BrGh9EAI.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-CZ66YA4T.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-DC3ZLuw0.mjs → android-BsYNR81W.mjs} +103 -45
  7. package/dist/{android-CBwCNicO.mjs → android-CK3fpEyZ.mjs} +2 -2
  8. package/dist/{android-cas-BBFyr9CA.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-D0VtFhqk.mjs → api-zuX3ynYN.mjs} +9 -7
  12. package/dist/api.d.mts +104 -4
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-D-PUENug.mjs → app-install-0LgaQRT7.mjs} +39 -18
  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/{web-DTU0uiWj.mjs → browser-web-CzBmhmgs.mjs} +136 -174
  19. package/dist/{budget-DIhL2BKx.mjs → budget-BONq9vXY.mjs} +3096 -3244
  20. package/dist/build-BixRI6sB.mjs +462 -0
  21. package/dist/build-plan-CP0tckNU.mjs +553 -0
  22. package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/ccache-CjHQ5F8g.mjs +142 -0
  25. package/dist/{chrome-DJnmnS5q.mjs → chrome-Dp2lMLBe.mjs} +1 -1
  26. package/dist/{cli-DNJMwADx.mjs → cli-B2R8wH1F.mjs} +20 -20
  27. package/dist/cli.mjs +1 -1
  28. package/dist/{client-DzhapoMB.mjs → client-BLy1Pw2V.mjs} +172 -165
  29. package/dist/collector-run.d.mts +10 -0
  30. package/dist/collector-run.mjs +7 -7
  31. package/dist/{command-output-CBtzyIgF.mjs → command-output-BjPN99ZB.mjs} +2 -2
  32. package/dist/{config-CgYMahz7.mjs → config-D0LhTY3S.mjs} +13 -13
  33. package/dist/{created-devices-DKbeWsiK.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
  34. package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
  35. package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
  36. package/dist/{dev-client-CLnIH02x.mjs → dev-client-ClATaJoH.mjs} +2 -2
  37. package/dist/{device-D7oCHGWi.mjs → device-B7lsC0K1.mjs} +8 -8
  38. package/dist/device-DVCwAFlX.mjs +727 -0
  39. package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-Ca_ke1LE.mjs} +25 -15
  40. package/dist/device-host-worker.mjs +38 -18
  41. package/dist/{device-ios-6MewKKnc.mjs → device-ios-CRUqPxKw.mjs} +12 -11
  42. package/dist/{device-lease-Co-EwifR.mjs → device-lease-DHOBXGgS.mjs} +135 -22
  43. package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
  44. package/dist/{device-pool-F5WvRPtD.mjs → device-pool-L2-5GxMy.mjs} +3 -3
  45. package/dist/{device-remote-tHbd1fKy.mjs → device-remote-Bmg42063.mjs} +17 -69
  46. package/dist/doctor-C2MSuMMg.mjs +515 -0
  47. package/dist/{doctor-B9ckYUoU.mjs → doctor-DPAqhVCK.mjs} +334 -721
  48. package/dist/doctor-watchman-CB4NnVZm.mjs +260 -0
  49. package/dist/{simslim-EHBQ2R4G.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
  50. package/dist/{stim-installations-aR_WsNOA.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
  51. package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
  52. package/dist/errors-DzkMYh8Q.mjs +205 -0
  53. package/dist/{exec-DWhCZDGm.mjs → exec-B81Qodjn.mjs} +69 -15
  54. package/dist/{gc-Dh6mXOKC.mjs → gc-PWp34zGb.mjs} +23 -22
  55. package/dist/{gradle-C6GKnunQ.mjs → gradle-C2OEKCCI.mjs} +50 -125
  56. package/dist/{guide-tm6igAaa.mjs → guide-Dai9lphv.mjs} +862 -538
  57. package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
  58. package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-Io01s5By.mjs} +9 -3
  59. package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
  60. package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
  61. package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
  62. package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-BdAQi21M.mjs} +23 -16
  63. package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
  64. package/dist/ios-BZ9dg2Fr.mjs +9 -0
  65. package/dist/{ios-B3SbOWdw.mjs → ios-CXLIUxXJ.mjs} +180 -24
  66. package/dist/ios-CZuv6gRv.mjs +1112 -0
  67. package/dist/{ios-Bvbf0SGY.mjs → ios-VGvNdsv2.mjs} +1 -1
  68. package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-B1B14xND.mjs} +1 -1
  69. package/dist/{ios-device-vOaByMhw.mjs → ios-device-BreZOpM0.mjs} +3 -3
  70. package/dist/ios-project-B9drt_aY.mjs +197 -0
  71. package/dist/{ios-state-B2pES6Vs.mjs → ios-state-CjrL2qv-.mjs} +1 -1
  72. package/dist/js-swap-C8icNYIY.mjs +432 -0
  73. package/dist/launch-DxH0THLP.mjs +745 -0
  74. package/dist/launch-YrbqaIFj.mjs +1530 -0
  75. package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
  76. package/dist/{logs-1Ylc1Ri6.mjs → logs-DHaRNfg7.mjs} +11 -11
  77. package/dist/macos-C0iljhsN.mjs +2 -0
  78. package/dist/{macos-DF6C7wUU.mjs → macos-V_3Ui7g4.mjs} +125 -155
  79. package/dist/macos-run.mjs +1 -1
  80. package/dist/maintenance-run.mjs +13 -10
  81. package/dist/{metro-Dh8T4Ytd.mjs → metro-D_j9sN-B.mjs} +209 -43
  82. package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
  83. package/dist/miss-reason-BPAzZS0r.mjs +238 -0
  84. package/dist/{named-ports-BFIz1Shz.mjs → named-ports-C2lvoPsb.mjs} +12 -5
  85. package/dist/native-android-lHzaew7r.mjs +226 -0
  86. package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
  87. package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
  88. package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
  89. package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
  90. package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
  91. package/dist/offload-worker.d.mts +12 -6
  92. package/dist/offload-worker.mjs +409 -73
  93. package/dist/{ownership-D6Se7gg_.mjs → ownership-DXzMMSx6.mjs} +2 -2
  94. package/dist/{placement-log-BcPhRwR4.mjs → placement-log-reFbjqEr.mjs} +7 -3
  95. package/dist/plan-BDk2AeY_.mjs +260 -0
  96. package/dist/plan-placement-D_YYlE6N.mjs +73 -0
  97. package/dist/{ports-BLTtfBq-.mjs → ports-jzvAJXXL.mjs} +3 -3
  98. package/dist/{prebuild-juCyreaR.mjs → prebuild-Bw44QxVh.mjs} +4 -4
  99. package/dist/{preview-D5V07Nrl.mjs → preview-BaBJ72Al.mjs} +51 -34
  100. package/dist/project-B8_duAzW.mjs +1067 -0
  101. package/dist/project-plan-BPwbLwQu.mjs +10 -0
  102. package/dist/{pull-request-u4vp7zmK.mjs → pull-request-vOhLNmIb.mjs} +1 -1
  103. package/dist/pull-requests.mjs +1 -1
  104. package/dist/react-native-android-chm1DMlA.mjs +921 -0
  105. package/dist/react-native-build-oAw6gQeW.mjs +239 -0
  106. package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
  107. package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
  108. package/dist/{recordings-BAWltsVt.mjs → recordings-Bk-VivUV.mjs} +1 -1
  109. package/dist/{reload-DvyWzVjJ.mjs → reload-D34GkY78.mjs} +17 -14
  110. package/dist/remote-BU9UyhCJ.mjs +192 -0
  111. package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
  112. package/dist/result-BDoRk1k3.mjs +186 -0
  113. package/dist/{run-vhtDgpHO.mjs → run-qvff78hv.mjs} +3 -3
  114. package/dist/{server-bare-B9E7S1aR.mjs → server-bare-dWjAarki.mjs} +6 -6
  115. package/dist/server-command-7XIKlWtO.mjs +69 -0
  116. package/dist/{server-expo-DoBHhuzK.mjs → server-expo-CsYu2aKL.mjs} +107 -82
  117. package/dist/server-expo-DV43vep4.mjs +2 -0
  118. package/dist/settings-Bbztm4oV.mjs +1503 -0
  119. package/dist/{settings-Byp2AQ_E.mjs → settings-CT3E71-i.mjs} +6 -7
  120. package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
  121. package/dist/settings.schema.json +156 -6
  122. package/dist/simslim-ChMfe8rg.mjs +149 -0
  123. package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-B9hn96wd.mjs} +6 -6
  124. package/dist/{stage-g_WqWeaE.mjs → stage-BNKKdDNc.mjs} +6 -3
  125. package/dist/start-CbQCSnXQ.mjs +2 -0
  126. package/dist/{start-D-IeOyoK.mjs → start-CdvcTaXr.mjs} +113 -77
  127. package/dist/{state-xnqpx3AD.mjs → state-Boo0IMJq.mjs} +4 -2
  128. package/dist/{state-BG-aAk4k.mjs → state-DI84A-uu.mjs} +29 -10
  129. package/dist/{stats-DY6ekz8F.mjs → stats-BIIDrjA8.mjs} +6 -6
  130. package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
  131. package/dist/{status-DCjZeE-K.mjs → status-DARMkc9q.mjs} +80 -294
  132. package/dist/status-watch-DvmI3SmN.mjs +296 -0
  133. package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
  134. package/dist/{stop-DIJtD2GL.mjs → stop-CCZS-C9m.mjs} +2 -2
  135. package/dist/stop-WQPQHLuy.mjs +72 -0
  136. package/dist/{stop-BTjs3xbc.mjs → stop-iNemHsJC.mjs} +81 -33
  137. package/dist/supervisor-run.d.mts +7 -2
  138. package/dist/supervisor-run.mjs +32 -20
  139. package/dist/{support-Bwvbrq5-.mjs → support-CnE_SIjt.mjs} +17 -7
  140. package/dist/{support-BaayeYCf.mjs → support-DCco5fut.mjs} +61 -8
  141. package/dist/swiftpm-macos-afeNUExW.mjs +119 -0
  142. package/dist/{native-run-B06FkmZx.mjs → tailnet-CoJUb2tB.mjs} +113 -6
  143. package/dist/toolchain-BIupIro1.mjs +2 -0
  144. package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-DqyDXs30.mjs} +225 -315
  145. package/dist/{trigger-CJMhwXe8.mjs → trigger-C0MWBi8O.mjs} +3 -3
  146. package/dist/trigger-SHLOWJ4O.mjs +2 -0
  147. package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-C3ASD6z5.mjs} +134 -37
  148. package/dist/{status-Dcr0Qexd.mjs → watchman-CQl51YZu.mjs} +75 -7
  149. package/dist/web-B3eldHFH.mjs +123 -0
  150. package/dist/web-BLXpOe6b.mjs +2 -0
  151. package/dist/web-run.mjs +10 -10
  152. package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
  153. package/dist/{workspaces-xXItD8Dj.mjs → workspaces-D2xSHBDY.mjs} +1297 -1211
  154. package/dist/{worktree-BSYlofkq.mjs → worktree-BxDqaTev.mjs} +102 -63
  155. package/dist/worktree-q7_OZNY0.mjs +2 -0
  156. package/package.json +8 -6
  157. package/shim/bundle-response.cjs +2 -1
  158. package/shim/bundle-response.d.cts +1 -1
  159. package/shim/expo-metro-config.cjs +1 -1
  160. package/shim/native-android.gradle +101 -0
  161. package/dist/android-BKA16DTf.mjs +0 -4
  162. package/dist/android-BvwuMUJ9.mjs +0 -3572
  163. package/dist/guide-status-Bhf9SJXc.mjs +0 -125
  164. package/dist/ios-CPdkoKaa.mjs +0 -3953
  165. package/dist/ios-DNpdygiv.mjs +0 -7
  166. package/dist/macos-Ck7OBMNY.mjs +0 -2
  167. package/dist/metro-store-BAHFcJm6.mjs +0 -106
  168. package/dist/plan-placement-CtxkCO54.mjs +0 -1859
  169. package/dist/project-C3ChRLZy.mjs +0 -212
  170. package/dist/projects-DD7dBTCj.mjs +0 -92
  171. package/dist/server-expo-Db9HBUoa.mjs +0 -2
  172. package/dist/settings-CQyMElEP.mjs +0 -701
  173. package/dist/start-NTc1Ifqs.mjs +0 -2
  174. package/dist/stop-BGhKMOuH.mjs +0 -48
  175. package/dist/trigger-DWAq9hkw.mjs +0 -2
  176. package/dist/web-B6_bFDn7.mjs +0 -2
  177. package/dist/worktree-BJfnU6r5.mjs +0 -2
  178. package/dist/worktree-CsKYexJM.mjs +0 -753
@@ -0,0 +1,434 @@
1
+ import { t as getExecutor } from "./exec-B81Qodjn.mjs";
2
+ import { r as register } from "./cache-manifest-qA3dT2x2.mjs";
3
+ import { Et as repoRoot, H as remoteIosSetting, Q as settingShapeErrors, W as resolveCacheProviderConfig, mt as gitCommonDir, q as resolveSettings } from "./settings-Bbztm4oV.mjs";
4
+ import { T as filesystemBuildCapability, b as buildCacheKey } from "./device-lease-DHOBXGgS.mjs";
5
+ import { g as sharedCompilationCache } from "./workspace-state-CSIFuuDa.mjs";
6
+ import { f as NativeXcodeError, h as selectNativeXcodeProject, m as pbxString } from "./project-B8_duAzW.mjs";
7
+ import { It as statsProjectKey } from "./budget-BONq9vXY.mjs";
8
+ import { l as artifactCachePolicy, p as resolveOptimizations } from "./errors-DzkMYh8Q.mjs";
9
+ import { a as nativeTransferRefusal } from "./client-BLy1Pw2V.mjs";
10
+ import { i as skippedMissReason, t as explainBuildMiss } from "./miss-reason-BPAzZS0r.mjs";
11
+ import { C as compilationCacheSettings, D as parseXcodeMajor, E as parseSwiftVersion, f as podsAreStale, g as runPodInstall, h as runCaptured, p as readPodState, r as iosToolchain, x as buildXcode, y as HEARTBEAT_INTERVAL_MS } from "./toolchain-DqyDXs30.mjs";
12
+ import { n as planFlagRefusal, t as planCachedBuild } from "./build-plan-CP0tckNU.mjs";
13
+ import { a as deviceModelRefusal, h as resolveDeviceType, m as resolveConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-DCco5fut.mjs";
14
+ import { t as IosRecipeRefusal } from "./ios-project-B9drt_aY.mjs";
15
+ import { d as gateProfileForDevice, i as DEFAULT_DEPS, r as iosProcessRuntime } from "./launch-YrbqaIFj.mjs";
16
+ import { a as nativeXcodeSources, i as nativeXcodePackages, n as nativeXcodeInputSnapshot, t as nativeXcodeHasPackages } from "./native-xcode-inputs-eutS19jU.mjs";
17
+ import { existsSync } from "node:fs";
18
+ import { join } from "node:path";
19
+ //#region src/integrations/native-xcode-ios.ts
20
+ function toolchain(sdk) {
21
+ const executor = getExecutor();
22
+ const identity = {
23
+ xcode: executor.runFile("xcodebuild", ["-version"], { timeoutMs: 1e4 }),
24
+ sdk: executor.runFile("xcodebuild", [
25
+ "-version",
26
+ "-sdk",
27
+ sdk
28
+ ], { timeoutMs: 1e4 }),
29
+ swift: executor.runFile("xcrun", ["swift", "--version"], { timeoutMs: 1e4 }),
30
+ clang: executor.runFile("xcrun", ["clang", "--version"], { timeoutMs: 1e4 }),
31
+ developer: executor.runFile("xcode-select", ["-p"], { timeoutMs: 1e4 }),
32
+ developerOverride: process.env.DEVELOPER_DIR ?? "",
33
+ toolchains: process.env.TOOLCHAINS ?? ""
34
+ };
35
+ if (!identity.xcode.trim() || !identity.sdk.trim() || !identity.swift.trim() || !identity.clang.trim() || !identity.developer.trim()) throw new Error("An Xcode toolchain probe returned no identity.");
36
+ return identity;
37
+ }
38
+ function refusal(error) {
39
+ return error instanceof NativeXcodeError ? {
40
+ code: error.code,
41
+ message: error.message,
42
+ remedy: error.remedy
43
+ } : {
44
+ code: "STIM_BAD_ARG",
45
+ message: error.message,
46
+ remedy: "Check the native Xcode project and its selected toolchain, then retry."
47
+ };
48
+ }
49
+ function settingsContext(root) {
50
+ return {
51
+ projectPath: root,
52
+ gitCommonDir: gitCommonDir(root),
53
+ repoRoot: repoRoot(root)
54
+ };
55
+ }
56
+ function nativeRecipe(root, context) {
57
+ const configuration = context.configuration ?? "Debug";
58
+ let selected = selectNativeXcodeProject(root, context.buildScheme, configuration);
59
+ let tools = null;
60
+ let snapshot = null;
61
+ let ineligible = null;
62
+ const mutations = [];
63
+ const identity = (value) => ({
64
+ hash: value.hash,
65
+ key: buildCacheKey("ios", value.hash, {
66
+ configuration,
67
+ scheme: selected.scheme,
68
+ isSimulator: context.target.sdk === "iphonesimulator",
69
+ ...context.target.keyArch ? { arch: context.target.keyArch } : {}
70
+ })
71
+ });
72
+ const reselect = () => {
73
+ try {
74
+ selected = selectNativeXcodeProject(root, context.buildScheme, configuration);
75
+ } catch (error) {
76
+ throw new IosRecipeRefusal(refusal(error));
77
+ }
78
+ };
79
+ const read = () => {
80
+ if (!tools) return { cacheIneligible: ineligible ?? "Xcode toolchain identity is unavailable" };
81
+ reselect();
82
+ return nativeXcodeInputSnapshot(root, selected, {
83
+ sdk: context.target.sdk,
84
+ architecture: context.target.keyArch,
85
+ toolchain: tools,
86
+ optimizations: context.optimizations
87
+ }, repoRoot(root) ?? root);
88
+ };
89
+ return {
90
+ async identity() {
91
+ try {
92
+ tools = toolchain(context.target.sdk);
93
+ } catch (error) {
94
+ ineligible = `Xcode toolchain identity is unavailable: ${error.message}`;
95
+ return { cacheIneligible: ineligible };
96
+ }
97
+ const value = read();
98
+ if ("cacheIneligible" in value) {
99
+ ineligible = value.cacheIneligible;
100
+ return value;
101
+ }
102
+ snapshot = value;
103
+ return identity(value);
104
+ },
105
+ cache: () => filesystemBuildCapability({ sources: snapshot ? nativeXcodeSources(snapshot) : null }),
106
+ async prepare(beforePrepare) {
107
+ const pods = readPodState(root, root);
108
+ const state = podsAreStale(pods.lockText, pods.manifestText);
109
+ if (pods.hasPodfile && (state.stale || state.noPods)) {
110
+ beforePrepare();
111
+ context.step("pods");
112
+ const result = await runPodInstall(root, context.logWriter(), {
113
+ directory: root,
114
+ estimateMs: context.estimates().podsMs
115
+ });
116
+ if (result.failed) throw new IosRecipeRefusal({
117
+ code: result.code ?? "STIM_DEPS_FAILED",
118
+ message: result.reason,
119
+ remedy: result.remedy ?? `See ${context.logFile}.`,
120
+ lines: result.lastLines
121
+ });
122
+ context.setPodsMs(result.durationMs ?? 0);
123
+ mutations.push("pod install");
124
+ reselect();
125
+ }
126
+ if (nativeXcodeHasPackages(selected)) {
127
+ beforePrepare();
128
+ context.phase("packages", "resolving Swift package dependencies");
129
+ const result = await runCaptured({
130
+ cmd: "xcodebuild",
131
+ args: [
132
+ selected.container.flag,
133
+ selected.container.path,
134
+ "-scheme",
135
+ selected.scheme,
136
+ "-resolvePackageDependencies",
137
+ "-clonedSourcePackagesDirPath",
138
+ nativeXcodePackages(root)
139
+ ],
140
+ cwd: root,
141
+ env: {
142
+ ...process.env,
143
+ NSUnbufferedIO: "YES",
144
+ FORCE_COLOR: "0"
145
+ },
146
+ spawn: (file, args, opts) => getExecutor().spawn(file, args, opts),
147
+ now: Date.now,
148
+ heartbeatMs: HEARTBEAT_INTERVAL_MS,
149
+ onHeartbeat: context.note,
150
+ logWriter: context.logWriter(),
151
+ event: "swift_packages",
152
+ label: "packages"
153
+ });
154
+ if (result.error || result.code !== 0) throw new IosRecipeRefusal({
155
+ code: "STIM_DEPS_FAILED",
156
+ message: "Xcode could not resolve Swift package dependencies.",
157
+ remedy: `Resolve the selected scheme's packages in Xcode and inspect ${context.logFile}.`,
158
+ lines: result.transcript.slice(-10)
159
+ });
160
+ mutations.push("Swift package resolution");
161
+ }
162
+ },
163
+ async reconcile() {
164
+ const current = snapshot && !mutations.length ? snapshot : read();
165
+ if ("cacheIneligible" in current) {
166
+ ineligible = current.cacheIneligible;
167
+ snapshot = null;
168
+ } else snapshot = current;
169
+ return {
170
+ identity: snapshot ? identity(snapshot) : null,
171
+ rekeyedBy: mutations,
172
+ mutationLabel: mutations.join(", ")
173
+ };
174
+ },
175
+ async validate() {
176
+ if (!snapshot) return null;
177
+ try {
178
+ tools = toolchain(context.target.sdk);
179
+ const after = read();
180
+ return !("cacheIneligible" in after) && after.hash === snapshot.hash ? identity(snapshot) : null;
181
+ } catch {
182
+ return null;
183
+ }
184
+ },
185
+ validateExternal() {
186
+ throw new IosRecipeRefusal({
187
+ code: "STIM_BAD_ARG",
188
+ message: "This native Xcode integration does not use external EAS builds.",
189
+ remedy: "Build the native project with stim ios."
190
+ });
191
+ },
192
+ async materialize(path) {
193
+ if (context.device) {
194
+ const gate = gateProfileForDevice({
195
+ appPath: path,
196
+ udid: context.device.udid,
197
+ configuration
198
+ });
199
+ if (!gate.ok) throw new IosRecipeRefusal({
200
+ code: gate.code,
201
+ message: gate.reason,
202
+ remedy: gate.remedy
203
+ });
204
+ }
205
+ return path;
206
+ },
207
+ compile: () => buildXcode({
208
+ root,
209
+ project: selected.container,
210
+ scheme: selected.scheme,
211
+ configuration,
212
+ applicationTarget: {
213
+ name: selected.targetName,
214
+ projectPath: selected.targetProject.path
215
+ },
216
+ sdk: context.target.sdk,
217
+ udid: context.target.udid,
218
+ destination: context.target.destination,
219
+ arch: context.target.arch,
220
+ logWriter: context.logWriter(),
221
+ estimateMs: context.estimates().coldBuildMs,
222
+ extraArgs: nativeXcodeHasPackages(selected) ? [
223
+ "-clonedSourcePackagesDirPath",
224
+ nativeXcodePackages(root),
225
+ "-disableAutomaticPackageResolution"
226
+ ] : [],
227
+ compilationCache: ({ derivedDataPath }) => {
228
+ const casPath = sharedCompilationCache();
229
+ const settings = compilationCacheSettings({
230
+ workspaceRoot: root,
231
+ derivedDataPath,
232
+ casPath,
233
+ xcodeMajor: parseXcodeMajor(tools?.xcode),
234
+ swiftVersion: parseSwiftVersion(tools?.swift),
235
+ swiftCacheCompatible: (!process.env.SWIFT_ENABLE_EXPLICIT_MODULES || process.env.SWIFT_ENABLE_EXPLICIT_MODULES === "YES") && !selected.projects.some((project) => [...project.objects.values()].some((entry) => {
236
+ if (entry.isa !== "XCBuildConfiguration" || pbxString(entry.name) !== configuration) return false;
237
+ const targetSettings = entry.buildSettings;
238
+ const explicitModules = pbxString(targetSettings?.SWIFT_ENABLE_EXPLICIT_MODULES);
239
+ return explicitModules !== null && explicitModules !== "YES";
240
+ })),
241
+ optimizations: context.optimizations
242
+ });
243
+ if (settings.length && context.optimizations.compilationCache) register({
244
+ dir: casPath,
245
+ name: "Xcode compilation cache",
246
+ prune: "atomic",
247
+ note: "shared Xcode compilation cache"
248
+ });
249
+ return settings;
250
+ }
251
+ }),
252
+ explain(rekeyedBy) {
253
+ if (!snapshot) return {
254
+ reason: skippedMissReason(ineligible ?? "Native build inputs are not cacheable"),
255
+ diff: null
256
+ };
257
+ return {
258
+ reason: explainBuildMiss({
259
+ root,
260
+ platform: "ios",
261
+ current: {
262
+ hash: snapshot.hash,
263
+ sources: nativeXcodeSources(snapshot)
264
+ },
265
+ rekeyedBy
266
+ }).reason,
267
+ diff: null
268
+ };
269
+ },
270
+ untrackedLine: () => null,
271
+ legacyCache: null,
272
+ offload: {
273
+ context: () => {
274
+ const runtime = context.target.sdk === "iphonesimulator" ? context.target.offloadRuntime() : null;
275
+ return {
276
+ runtime,
277
+ unsupported: context.target.offloadRefusal ?? (context.device ? "Physical native Xcode builds build here" : !context.cache.write ? "the build cache is off" : !runtime ? "no simulator runtime is available for worker selection" : !snapshot ? "the native inputs have no verified identity" : nativeTransferRefusal(repoRoot(root) ?? root, snapshot))
278
+ };
279
+ },
280
+ target: (runtime) => ({
281
+ platform: "ios",
282
+ native: "xcode",
283
+ local: {
284
+ ...iosToolchain(root, "xcode"),
285
+ ...context.target.hostedArchitecture ? { arch: context.target.hostedArchitecture === "x86_64" ? "x64" : "arm64" } : {}
286
+ },
287
+ runtime,
288
+ cocoapodsPinned: false
289
+ }),
290
+ request: (runtime) => {
291
+ if (!snapshot) throw new Error("Native Xcode offload needs a verified artifact input identity.");
292
+ return {
293
+ platform: "ios",
294
+ runtime,
295
+ configuration,
296
+ scheme: selected.scheme,
297
+ isExpo: false,
298
+ optimizations: context.optimizations,
299
+ native: {
300
+ provider: "xcode",
301
+ snapshot,
302
+ cacheKey: identity(snapshot).key,
303
+ arch: context.target.keyArch
304
+ }
305
+ };
306
+ },
307
+ unchanged: async () => {
308
+ const current = read();
309
+ return snapshot !== null && !("cacheIneligible" in current) && current.hash === snapshot.hash;
310
+ }
311
+ }
312
+ };
313
+ }
314
+ async function planNativeXcode(root, options) {
315
+ if (options.easProfile !== void 0) return { refusal: planFlagRefusal("--eas-profile") };
316
+ try {
317
+ const context = settingsContext(root);
318
+ const settings = resolveSettings(context);
319
+ const errors = settingShapeErrors(settings);
320
+ if (errors.length) throw new NativeXcodeError(errors.join("; "), "Correct the project settings and retry.");
321
+ if (remoteIosSetting(settings)) throw new NativeXcodeError("Native Xcode planning does not resolve hosted placement.", "Unset ios.remote to plan a local build, or run stim ios without --plan.");
322
+ const layers = DEFAULT_DEPS.settingsLayers(context);
323
+ const modelRefusal = deviceModelRefusal({
324
+ slot: options.slot ?? "default",
325
+ deviceTypeFlag: options.deviceType,
326
+ runtimeFlag: options.runtime,
327
+ deviceType: resolveDeviceType(options.deviceType, settings),
328
+ runtime: resolveRuntime(options.runtime, settings),
329
+ deviceTypeOrigin: DEFAULT_DEPS.settingOriginScope(layers, "ios.deviceType"),
330
+ runtimeOrigin: DEFAULT_DEPS.settingOriginScope(layers, "ios.runtime"),
331
+ physical: false,
332
+ remoteBackend: null,
333
+ listRuntimes: DEFAULT_DEPS.listIosRuntimes
334
+ });
335
+ if (modelRefusal) return { refusal: modelRefusal };
336
+ const configuration = resolveConfiguration(options.configuration, settings) ?? "Debug";
337
+ const selection = selectNativeXcodeProject(root, resolveSchemeSelection(options, settings), configuration);
338
+ const optimizations = resolveOptimizations(settings);
339
+ const architecture = simulatorBuildArch({
340
+ physical: false,
341
+ remoteArch: null,
342
+ hostArch: process.arch === "arm64" ? "arm64" : "x86_64",
343
+ configuration
344
+ });
345
+ const snapshot = nativeXcodeInputSnapshot(root, selection, {
346
+ sdk: "iphonesimulator",
347
+ architecture,
348
+ toolchain: toolchain("iphonesimulator"),
349
+ optimizations: optimizations.ios
350
+ }, context.repoRoot ?? root);
351
+ if ("cacheIneligible" in snapshot) throw new NativeXcodeError(`No reusable native artifact can be predicted: ${snapshot.cacheIneligible}.`, "Run stim ios without --plan; it can prepare dependencies and build locally without artifact caching.");
352
+ const key = buildCacheKey("ios", snapshot.hash, {
353
+ configuration,
354
+ scheme: selection.scheme,
355
+ isSimulator: true,
356
+ ...architecture ? { arch: architecture } : {}
357
+ });
358
+ return await planCachedBuild({
359
+ root,
360
+ platform: "ios",
361
+ slot: options.slot ?? "default",
362
+ projectKey: statsProjectKey({
363
+ root,
364
+ commonDir: context.gitCommonDir,
365
+ repoRoot: context.repoRoot
366
+ }),
367
+ isExpo: false,
368
+ fingerprint: snapshot.hash,
369
+ sources: nativeXcodeSources(snapshot),
370
+ cacheKey: key,
371
+ cachePolicy: artifactCachePolicy(optimizations, options.buildCache !== false, false),
372
+ providerConfig: resolveCacheProviderConfig(context),
373
+ expoRemote: null
374
+ }, {
375
+ ...DEFAULT_DEPS,
376
+ planPrebuild: () => "none",
377
+ note: (line) => console.error(line)
378
+ });
379
+ } catch (error) {
380
+ return { refusal: refusal(error) };
381
+ }
382
+ }
383
+ function nativeXcodeIosProject(root) {
384
+ return {
385
+ isExpo: false,
386
+ targets: [
387
+ "simulator",
388
+ "physical",
389
+ "hosted"
390
+ ],
391
+ eas: false,
392
+ runtimeKind: () => "process",
393
+ plan: (options) => planNativeXcode(root, options),
394
+ bundleId: () => null,
395
+ schemeProblem(scheme, configuration) {
396
+ try {
397
+ selectNativeXcodeProject(root, scheme, configuration ?? "Debug");
398
+ return null;
399
+ } catch (error) {
400
+ return refusal(error);
401
+ }
402
+ },
403
+ runtime: () => iosProcessRuntime(async () => ({
404
+ ok: true,
405
+ prepared: { metroPort: null }
406
+ })),
407
+ artifact: (context) => nativeRecipe(root, context)
408
+ };
409
+ }
410
+ function nativeXcodeDoctor(root) {
411
+ return { inspect({ options, settings }) {
412
+ if (options.platform && options.platform !== "ios") return [];
413
+ try {
414
+ const selection = selectNativeXcodeProject(root, resolveSchemeSelection({}, settings), resolveConfiguration(void 0, settings) ?? "Debug");
415
+ const podfile = existsSync(join(root, "Podfile"));
416
+ return [{
417
+ level: "note",
418
+ title: "Native Xcode application",
419
+ detail: `${selection.scheme} (${selection.configuration}) uses native process readiness without Metro.${podfile ? " CocoaPods dependencies are prepared from the project root." : ""}`,
420
+ fix: null
421
+ }];
422
+ } catch (error) {
423
+ const problem = refusal(error);
424
+ return [{
425
+ level: "cost",
426
+ title: "Native Xcode selection",
427
+ detail: problem.message,
428
+ fix: problem.remedy
429
+ }];
430
+ }
431
+ } };
432
+ }
433
+ //#endregion
434
+ export { nativeXcodeDoctor, nativeXcodeIosProject };
@@ -1,7 +1,7 @@
1
1
  import { dirname } from "path";
2
- import { LEVELS, SOURCES, levelRank, parseNdjsonLine, readNdjsonGenerations as readNdjsonGenerations$1, runId } from "@stim-cli/core/state";
3
- import { closeSync, mkdirSync, openSync, writeSync } from "fs";
4
- import { rotateLog } from "@stim-cli/core";
2
+ import { LEVELS, SOURCES, levelRank, parseNdjsonLine, parseNdjsonText, readNdjsonGenerations as readNdjsonGenerations$1, runId } from "@stim-cli/core/state";
3
+ import { closeSync, openSync, writeSync } from "fs";
4
+ import { ensurePrivateDir, rotateLog } from "@stim-cli/core";
5
5
  //#region src/ndjson.ts
6
6
  const ROTATE_CHECK_MS = 1e3;
7
7
  function formatNdjsonLine(record) {
@@ -21,8 +21,8 @@ function createNdjsonWriter(file, { truncate = false, fields = {}, maxBytes, now
21
21
  let lastError = null;
22
22
  let closed = false;
23
23
  function open() {
24
- mkdirSync(dirname(file), { recursive: true });
25
- fd = openSync(file, freshFile ? "w" : "a");
24
+ ensurePrivateDir(dirname(file));
25
+ fd = openSync(file, freshFile ? "w" : "a", 384);
26
26
  freshFile = false;
27
27
  }
28
28
  function rotateIfDue(limit) {
@@ -115,4 +115,4 @@ function stamp(record) {
115
115
  };
116
116
  }
117
117
  //#endregion
118
- export { parseNdjsonLine as a, levelRank as i, SOURCES as n, readNdjsonGenerations$1 as o, createNdjsonWriter as r, LEVELS as t };
118
+ export { parseNdjsonLine as a, levelRank as i, SOURCES as n, parseNdjsonText as o, createNdjsonWriter as r, readNdjsonGenerations$1 as s, LEVELS as t };
@@ -1,10 +1,10 @@
1
- import "./state-lKh8shBp.mjs";
2
1
  import { n as CcacheActivity, r as CompilationCacheActivity } from "./build-facts-DcLv2HSd.mjs";
2
+ import "./settings-vk3mJGSm.mjs";
3
3
  import "./ndjson-Du3j0AQ9.mjs";
4
4
  import "@stim-cli/core/state";
5
5
  import { readFileSync } from "fs";
6
6
  import "@expo/fingerprint";
7
- import "@stim-cli/core/protocol";
7
+ import { BuildStartParams } from "@stim-cli/core/protocol";
8
8
  //#region src/optimizations.d.ts
9
9
  interface Optimizations {
10
10
  buildCache: boolean;
@@ -41,13 +41,15 @@ interface AndroidBuildOptions {
41
41
  gradleBuildCache: boolean;
42
42
  pch: "auto" | "on" | "off";
43
43
  compilerCache: "ccache" | "none";
44
+ gradleRoot?: string | null;
45
+ module?: string | null;
44
46
  }
45
47
  //#endregion
46
48
  //#region src/offload/worker.d.ts
47
- /** One file of the client's checkout, as `git ls-files -co --exclude-standard` lists it. */
49
+ /** One entry of the source transfer: a visible file of the checkout, or a native build's file or directory input. */
48
50
  interface ManifestEntry {
49
51
  path: string;
50
- kind: "file" | "exec" | "link";
52
+ kind: "file" | "exec" | "link" | "directory";
51
53
  size: number;
52
54
  sha256: string;
53
55
  }
@@ -71,9 +73,11 @@ interface WorkerJob {
71
73
  isExpo: boolean;
72
74
  configuration: string | null;
73
75
  scheme: string | null;
76
+ iosProjectPath?: string | null;
74
77
  runtime: string | null;
75
78
  android: AndroidBuildOptions | null;
76
- expectedFingerprint: string;
79
+ expectedFingerprint: string | null;
80
+ native?: BuildStartParams["native"];
77
81
  optimizations: Optimizations["ios"] | null;
78
82
  /** How long the client's Gradle daemon stays warm after an Android build; 0 or absent stops it when the build ends. */
79
83
  gradleDaemonIdleMs?: number;
@@ -95,7 +99,9 @@ type WorkerResult = {
95
99
  size: number;
96
100
  sha256: string;
97
101
  };
98
- fingerprint: string;
102
+ fingerprint: string | null;
103
+ androidPackage?: string;
104
+ sourceDigest?: string;
99
105
  compilationCache: CompilationCacheActivity | CcacheActivity | Record<string, never>;
100
106
  timings: WorkerTimings;
101
107
  } | {