stim 1.23.0 → 1.24.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/README.md +3 -2
  2. package/dist/{acquire-artifact-ybouwJSR.mjs → acquire-artifact-CEs02U2o.mjs} +2 -2
  3. package/dist/{act-DG54PWtJ.mjs → act-Cyvm8xYc.mjs} +40 -25
  4. package/dist/{activity-B5RtpFda.mjs → activity-Dq3ZcdD8.mjs} +6 -6
  5. package/dist/{agent-device-usage-output-UJ5gC80l.mjs → agent-device-usage-output-CccomeE0.mjs} +5 -5
  6. package/dist/{android-C7sVmyI9.mjs → android-882m4hxX.mjs} +140 -46
  7. package/dist/{android-BoUJKbfz.mjs → android-BZppyPe_.mjs} +66 -46
  8. package/dist/{android-DR5lZ2Az.mjs → android-CX5IcRuf.mjs} +13 -3
  9. package/dist/{android-CHH4KLOR.mjs → android-DcztblCT.mjs} +5 -5
  10. package/dist/{android-cas-ngferVq2.mjs → android-cas-BtCOrNqb.mjs} +3 -3
  11. package/dist/android-cas-compiler.mjs +1 -1
  12. package/dist/api.d.mts +22 -4
  13. package/dist/api.mjs +32 -31
  14. package/dist/{artifact-5RteZem7.mjs → artifact-BR5VNArK.mjs} +17 -16
  15. package/dist/{artifact-Dwdo7k1E.mjs → artifact-Bdt_n9Jc.mjs} +17 -16
  16. package/dist/{artifact-platform-CXcmX_j3.mjs → artifact-platform-CMRc0M_r.mjs} +3 -3
  17. package/dist/{browser-web-CeEVlGug.mjs → browser-web-ycg9qWB8.mjs} +16 -17
  18. package/dist/{budget-DnPX3DXj.mjs → budget-dPGuhNai.mjs} +101 -40
  19. package/dist/{build-CqufZFqy.mjs → build-CaF574eS.mjs} +31 -28
  20. package/dist/{build-cache-Dv7RN200.mjs → build-cache-HFUQ9eLz.mjs} +152 -19
  21. package/dist/{build-plan-C8CIvRyi.mjs → build-plan-JsDUq4w1.mjs} +8 -7
  22. package/dist/{cache-manifest-DSeQjt-Q.mjs → cache-manifest-BPXRONJz.mjs} +1 -1
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-RcAy92gH.mjs → ccache-CCn1S6qG.mjs} +6 -6
  25. package/dist/{cdp-3fwICjzi.mjs → cdp-BG3FJCCx.mjs} +1 -1
  26. package/dist/{chrome-Bbw689-6.mjs → chrome-BvV8ssI3.mjs} +1 -1
  27. package/dist/{cli-D-J9fWGV.mjs → cli-xqAidP7O.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-yyso1bwi.mjs → client-18-ZowoT.mjs} +254 -28
  30. package/dist/collector-run.mjs +6 -6
  31. package/dist/{command-output-Db8BqzxH.mjs → command-output-DxC0k2rk.mjs} +3 -2
  32. package/dist/{config-DlrsduwG.mjs → config-BZhXY15H.mjs} +3 -3
  33. package/dist/{created-devices-x9rN6bhs.mjs → created-devices-D2Aca-xu.mjs} +6 -2
  34. package/dist/{dependency-state-1I9KZT1Y.mjs → dependency-state-C56ll9hY.mjs} +2 -2
  35. package/dist/{detached-entry-BwNEtIrP.mjs → detached-entry-KmieOKgN.mjs} +1 -1
  36. package/dist/{dev-client-BnYSDiKa.mjs → dev-client-w_fok0Ek.mjs} +3 -3
  37. package/dist/{device-BvzPUBs3.mjs → device-4RUugw5X.mjs} +16 -16
  38. package/dist/{device-CCkWmkAA.mjs → device-BktRGdjS.mjs} +40 -44
  39. package/dist/{device-capacity-CjaSdrhg.mjs → device-capacity-Ic-kdmEV.mjs} +20 -16
  40. package/dist/device-host-worker.mjs +17 -17
  41. package/dist/{device-ios-uOiEETX2.mjs → device-ios-DzpSlZyd.mjs} +23 -24
  42. package/dist/{device-lease-run-BgwPHc6u.mjs → device-lease-run-DUtkbqBQ.mjs} +5 -5
  43. package/dist/{device-pool-C-ptmZTa.mjs → device-pool-CgBHk401.mjs} +3 -3
  44. package/dist/{doctor-pxxvipYC.mjs → doctor-BZ6oxNum.mjs} +1 -1
  45. package/dist/{doctor-8sr2tFOL.mjs → doctor-C33AzVfR.mjs} +28 -28
  46. package/dist/{doctor-D2SN3Ltx.mjs → doctor-DZgpqR6J.mjs} +17 -16
  47. package/dist/{doctor-fingerprint-DZLoYFVb.mjs → doctor-fingerprint-zlujA1Gs.mjs} +1 -1
  48. package/dist/doctor-fingerprint.mjs +1 -1
  49. package/dist/{doctor-watchman-sy_RNhFt.mjs → doctor-watchman-B453A231.mjs} +5 -5
  50. package/dist/{eas-build-CyjU5K7E.mjs → eas-build-CxKUNHsb.mjs} +4 -4
  51. package/dist/{eas-fallback-DV3Wytf1.mjs → eas-fallback-LMxk9Kw0.mjs} +14 -14
  52. package/dist/{eas-session-ledger-BzzsX97d.mjs → eas-session-ledger-Ck6YXPAO.mjs} +12 -8
  53. package/dist/{error-diagnostics-C6sVoeqO.mjs → error-diagnostics-BkKCZq4P.mjs} +17 -42
  54. package/dist/{exec-DEoAhcze.mjs → exec-VFRpu1iA.mjs} +116 -28
  55. package/dist/{gc-DLbzvTP2.mjs → gc-DDWEAj0w.mjs} +2 -2
  56. package/dist/{gc-CDoogxAI.mjs → gc-yVKpAOKM.mjs} +205 -28
  57. package/dist/{guide-BC37GcDG.mjs → guide-Bggftwc5.mjs} +252 -73
  58. package/dist/{hosted-android-CkclQig_.mjs → hosted-android-D4dweBof.mjs} +4 -4
  59. package/dist/{hosted-client-ByuMMO5s.mjs → hosted-client-BBTVe3X6.mjs} +4 -4
  60. package/dist/{hosted-ios-DtYHeuYR.mjs → hosted-ios-Sn0djzg8.mjs} +1 -1
  61. package/dist/{hosted-logs-Br84qWy1.mjs → hosted-logs-CYIZ5ubJ.mjs} +11 -6
  62. package/dist/{hosted-macos-DdtYajZt.mjs → hosted-macos-CXjsUNBR.mjs} +7 -7
  63. package/dist/{hosted-native-UPI9zdZ4.mjs → hosted-native-Doxbfzem.mjs} +58 -11
  64. package/dist/{idle-shutdown-DO7oIRlc.mjs → idle-shutdown-BInjLKqm.mjs} +10 -10
  65. package/dist/{ios-DZZbNYlY.mjs → ios-B1FXRCMX.mjs} +71 -44
  66. package/dist/{ios-vbUOqGXu.mjs → ios-BItP6lkn.mjs} +8 -8
  67. package/dist/{ios-hcBpnEGk.mjs → ios-CVUFFZ6C.mjs} +70 -13
  68. package/dist/{ios-xtlRHaeB.mjs → ios-ENC4sRPA.mjs} +1 -1
  69. package/dist/{ios-device-BXZ0c7Kb.mjs → ios-device-B6HK951C.mjs} +1 -1
  70. package/dist/{ios-device-JC3uWM4K.mjs → ios-device-BI38NFFH.mjs} +3 -3
  71. package/dist/{ios-project-CVyNwjAF.mjs → ios-project-KYqeJURj.mjs} +5 -5
  72. package/dist/{ios-signing-BtAffm0A.mjs → ios-signing-4c_qXvQm.mjs} +2 -2
  73. package/dist/{ios-state-Dtw5K2aI.mjs → ios-state-DlElquYD.mjs} +15 -7
  74. package/dist/{js-swap-C3QxUFJR.mjs → js-swap-BvrQvXHY.mjs} +7 -6
  75. package/dist/{launch-CHY3p-yz.mjs → launch-BVlyQw3T.mjs} +51 -49
  76. package/dist/{launch-Bz7JtaC4.mjs → launch-SfzGH_s9.mjs} +48 -29
  77. package/dist/{logs-mxqsWpJs.mjs → logs-DXE32kyb.mjs} +16 -9
  78. package/dist/{logs-CtNeNDuq.mjs → logs-ovlU7m7N.mjs} +8 -6
  79. package/dist/{macos-inNFbBWc.mjs → macos-B3BveDrU.mjs} +1 -1
  80. package/dist/{macos-u0BoHKnO.mjs → macos-CCfhb-jT.mjs} +49 -42
  81. package/dist/macos-run.mjs +1 -1
  82. package/dist/maintenance-run.mjs +7 -7
  83. package/dist/{metro-DiXtA3Ty.mjs → metro-Bu8LBfzS.mjs} +4 -4
  84. package/dist/{metro-gateway-CKZqKqx7.mjs → metro-gateway-DtsOy-0P.mjs} +3 -4
  85. package/dist/{named-ports-DkEzOfzO.mjs → named-ports-BWDuU5oQ.mjs} +3 -3
  86. package/dist/{native-android-CdCSylTn.mjs → native-android-96BBizbq.mjs} +17 -17
  87. package/dist/{native-gradle-artifact-inputs-DHFnmrVf.mjs → native-gradle-artifact-inputs-BcLYBZil.mjs} +5 -5
  88. package/dist/{native-run-BUTu8T7A.mjs → native-run-BmH7U8pr.mjs} +6 -6
  89. package/dist/{native-runtime-CRSOZxKY.mjs → native-runtime-DgtJkzIa.mjs} +10 -9
  90. package/dist/{native-source-Y0yLhFyQ.mjs → native-source-D-4Dh4JU.mjs} +7 -4
  91. package/dist/{native-xcode-inputs-G6rkkhxu.mjs → native-xcode-inputs-irplbQb0.mjs} +2 -2
  92. package/dist/{native-xcode-ios-_os2PlCD.mjs → native-xcode-ios-BY-6hh6M.mjs} +18 -18
  93. package/dist/offload-worker.d.mts +7 -2
  94. package/dist/offload-worker.mjs +104 -43
  95. package/dist/{operation-exec-BW0em61G.mjs → operation-exec-CUZifp6Z.mjs} +2 -25
  96. package/dist/{ownership-C5fo5Edb.mjs → ownership-DxlZGDcV.mjs} +3 -3
  97. package/dist/{page-DBL2PiUU.mjs → page-CzEA_-5_.mjs} +2 -3
  98. package/dist/phone-reverses-BdsdesVF.mjs +57 -0
  99. package/dist/{placement-log-BnGgJRRZ.mjs → placement-log-DUvqqsB-.mjs} +1 -1
  100. package/dist/{plan-placement-BU42oOyT.mjs → plan-placement-4axc0Hs7.mjs} +3 -3
  101. package/dist/{ports-BSmQKzW7.mjs → ports-D-E_OiAO.mjs} +3 -3
  102. package/dist/{prebuild-BFm63bQ0.mjs → prebuild-DmVCf5xb.mjs} +14 -9
  103. package/dist/{project-CTLNHCfE.mjs → project-Dz-hWkb-.mjs} +21 -17
  104. package/dist/{pull-request-W1IuLXDt.mjs → pull-request-CbNlkFok.mjs} +2 -2
  105. package/dist/pull-requests.mjs +1 -1
  106. package/dist/{react-native-android-CFgUroxW.mjs → react-native-android-DOinxgwB.mjs} +75 -32
  107. package/dist/{react-native-build-CmJkTljQ.mjs → react-native-build-AuCu-aAP.mjs} +22 -19
  108. package/dist/{react-native-doctor-LTF-Xt8l.mjs → react-native-doctor-2ivJUmwZ.mjs} +10 -9
  109. package/dist/{react-native-ios-ChBF1MkB.mjs → react-native-ios-D5zTIuH8.mjs} +38 -22
  110. package/dist/{recordings-CQmfzAh7.mjs → recordings-CdPwYwvs.mjs} +1 -1
  111. package/dist/{registration-BcRgF6Ox.mjs → registration-CN6nlhcD.mjs} +1 -1
  112. package/dist/{reload-DF9hqUUB.mjs → reload-C1TTVesC.mjs} +144 -42
  113. package/dist/{reload-RBi1nj6Z.mjs → reload-Ck9RJeSq.mjs} +1 -1
  114. package/dist/{remote-BmvMCcJw.mjs → remote-DEZ7AOVq.mjs} +7 -7
  115. package/dist/{result-Cx5CRLvS.mjs → result-DqBrb12U.mjs} +40 -17
  116. package/dist/{run-DidHghD1.mjs → run-BIwoU44q.mjs} +2 -2
  117. package/dist/{selection-DSMbWEX2.mjs → selection-BLtvaqxc.mjs} +11 -5
  118. package/dist/{server-bare-CafzuyFB.mjs → server-bare-Z1ToVLPn.mjs} +2 -2
  119. package/dist/{server-command-BTiGPEjS.mjs → server-command-C0pmjNdG.mjs} +6 -6
  120. package/dist/server-expo-CEntXzRw.mjs +2 -0
  121. package/dist/{server-expo-D9lEz4aq.mjs → server-expo-Tt_hLRpy.mjs} +37 -13
  122. package/dist/{settings-C7O8A6ZI.mjs → settings-RKwY33wv.mjs} +114 -19
  123. package/dist/{settings-eKF_vJJs.mjs → settings-kkt0vP4w.mjs} +1 -1
  124. package/dist/{settings-write-79mQRr9C.mjs → settings-write--gj6MACV.mjs} +7 -7
  125. package/dist/settings.schema.json +13 -0
  126. package/dist/{simslim-BNckWpXi.mjs → simslim-CdWKT3vA.mjs} +2 -2
  127. package/dist/{slot-launch-D7M2nE4b.mjs → slot-launch-A1BgotaM.mjs} +6 -6
  128. package/dist/{stage-DKNM4ZPd.mjs → stage-ERTMh88n.mjs} +2 -3
  129. package/dist/{start-bjfiScgz.mjs → start-BKGrEhzG.mjs} +75 -35
  130. package/dist/{start-CRfN1kWV.mjs → start-Bmg_qmHi.mjs} +1 -1
  131. package/dist/{state--smjFSTL.mjs → state-B1ig0Kqy.mjs} +4 -4
  132. package/dist/{state-08I3hw3_.mjs → state-BfAltYJP.mjs} +2 -2
  133. package/dist/{stats-DioA6cBU.mjs → stats-B-ckuiUg.mjs} +5 -5
  134. package/dist/{stats-report-BzaPrRm6.mjs → stats-report-n2U5plhk.mjs} +1 -1
  135. package/dist/{status-kzbeWk4x.mjs → status-DfFp6a76.mjs} +24 -24
  136. package/dist/{status-BRROykC8.mjs → status-Fect2w9R.mjs} +1 -1
  137. package/dist/{status-Eqx_20WC.mjs → status-Pw-807f0.mjs} +1 -1
  138. package/dist/{status-watch-BIqqbJ6q.mjs → status-watch-XC7F-AMf.mjs} +5 -5
  139. package/dist/status-worker.mjs +1 -1
  140. package/dist/stim-clonefile.c +18 -0
  141. package/dist/{stim-desktop-D5OGpYZM.mjs → stim-desktop-DS0mzR8U.mjs} +2 -2
  142. package/dist/{stop-B18d8KDw.mjs → stop-BFu7X_Do.mjs} +2 -2
  143. package/dist/{stop-B2uLQfoM.mjs → stop-CL1kDHds.mjs} +55 -21
  144. package/dist/{stop-DzLJc7Ei.mjs → stop-DhclRwOO.mjs} +5 -5
  145. package/dist/supervisor-run.mjs +16 -16
  146. package/dist/{support-BTpZ6RAJ.mjs → support-B1W-hmC2.mjs} +8 -8
  147. package/dist/{support-DTBV56gy.mjs → support-B3tzVhKn.mjs} +6 -6
  148. package/dist/{swiftpm-artifact-inputs-DFcGsXDP.mjs → swiftpm-artifact-inputs-BWYPj9Sn.mjs} +4 -4
  149. package/dist/{swiftpm-macos-r_WSKlXr.mjs → swiftpm-macos-BVCP5mO4.mjs} +14 -13
  150. package/dist/{toolchain-GVgnf8d1.mjs → toolchain-BjgKdoEf.mjs} +1 -1
  151. package/dist/{toolchain-CWeGJgCc.mjs → toolchain-D3bmRMia.mjs} +57 -36
  152. package/dist/trigger-BLsHgAGR.mjs +2 -0
  153. package/dist/{trigger-Cbyc41d_.mjs → trigger-CBMe2YLH.mjs} +2 -2
  154. package/dist/{warm-progress-CA3TgT3-.mjs → warm-progress-ol0ZypEu.mjs} +6 -6
  155. package/dist/{web-CwREhjD-.mjs → web-BH7peScT.mjs} +12 -10
  156. package/dist/web-BdOFlTJr.mjs +2 -0
  157. package/dist/web-run.mjs +8 -9
  158. package/dist/windows-report.mjs +12 -1
  159. package/dist/windows-report.ps1 +1 -1
  160. package/dist/{workspace-state-U08dEzhG.mjs → workspace-state-CeBpIZgr.mjs} +11 -4
  161. package/dist/{workspaces-BxzYlo3P.mjs → workspaces-CSV2Orf4.mjs} +36 -32
  162. package/dist/{worktree-BxfVxG_b.mjs → worktree-DEDUzO_L.mjs} +1 -1
  163. package/dist/{worktree-8lqn_lBp.mjs → worktree-Dw8kfacb.mjs} +324 -99
  164. package/dist/{xcode-iQnROM5o.mjs → xcode-DHu41qQ4.mjs} +41 -27
  165. package/package.json +7 -7
  166. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +0 -211
  167. package/dist/server-expo-C-Buqvn_.mjs +0 -2
  168. package/dist/trigger-yb_nFzPF.mjs +0 -2
  169. package/dist/web-Cduk0NSE.mjs +0 -2
@@ -1,27 +1,26 @@
1
- import { _ as reportSignal, b as debugLog, m as operationState, t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { Q as openAuthenticated, _ as loadConfig$1, it as sayHello, rt as resolveEndpoint } from "./config-DlrsduwG.mjs";
3
- import { f as throwIfCancelled, o as git, s as gitAsync } from "./operation-exec-BW0em61G.mjs";
1
+ import { C as reportSignal, E as debugLog, b as operationState, c as throwIfCancelled, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { Q as openAuthenticated, _ as loadConfig$1, it as sayHello, rt as resolveEndpoint } from "./config-BZhXY15H.mjs";
3
+ import { o as git, s as gitAsync } from "./operation-exec-CUZifp6Z.mjs";
4
4
  import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
5
- import { X as emptyCaches, br as discoverCaches, nt as planCacheEmptying } from "./budget-DnPX3DXj.mjs";
5
+ import { Q as emptyCaches, Sr as discoverCaches, it as planCacheEmptying } from "./budget-dPGuhNai.mjs";
6
6
  import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
7
- import { d as runCancellationSignal } from "./native-run-BUTu8T7A.mjs";
8
- import { n as CCACHE_UNAVAILABLE, t as CCACHE_NOT_RUN } from "./ccache-RcAy92gH.mjs";
9
- import { n as COMPILATION_CACHE_UNAVAILABLE, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-iQnROM5o.mjs";
7
+ import { d as runCancellationSignal } from "./native-run-BmH7U8pr.mjs";
8
+ import { n as CCACHE_UNAVAILABLE, t as CCACHE_NOT_RUN } from "./ccache-CCn1S6qG.mjs";
9
+ import { n as COMPILATION_CACHE_UNAVAILABLE, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-DHu41qQ4.mjs";
10
10
  import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
11
- import { a as iosToolchainAsync, d as toolchainMismatches, f as workerToolchain, g as readRubyVersion } from "./toolchain-CWeGJgCc.mjs";
12
- import { l as pairedMachines, r as namedBuildMachine, t as OffloadRefusal } from "./selection-DSMbWEX2.mjs";
13
- import { r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
14
- import { a as sourceManifest, i as nativeTransferManifest, n as gitVisiblePaths, t as checkNativeTransferMembership } from "./native-source-Y0yLhFyQ.mjs";
15
- import { a as nativeGradleTransfer } from "./native-gradle-inputs-Dnh84Zbd.mjs";
11
+ import { a as iosToolchainAsync, d as toolchainMismatches, f as workerToolchain, g as readRubyVersion } from "./toolchain-D3bmRMia.mjs";
12
+ import { i as namedBuildMachine, t as OffloadRefusal, u as pairedMachines } from "./selection-BLtvaqxc.mjs";
13
+ import { n as fingerprintNativeInputs, r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
14
+ import { a as sourceManifest, i as nativeTransferManifest, n as gitVisiblePaths, r as nativeFileDigest, t as checkNativeTransferMembership } from "./native-source-D-4Dh4JU.mjs";
16
15
  import { createHash, webcrypto } from "node:crypto";
17
16
  import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, unlinkSync, writeSync } from "node:fs";
18
17
  import { isDeepStrictEqual } from "node:util";
19
- import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
20
- import { LOG_ROTATE_BYTES, ambientContext, reactNativeArtifactIdentity, reactNativeArtifactQuery, rotatedLogPath, swiftpmArtifactQuery, withDirLock } from "@stim-cli/core";
18
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
19
+ import { LOG_ROTATE_BYTES, ambientContext, dependencyLockfile, reactNativeArtifactIdentity, reactNativeArtifactQuery, rotatedLogPath, swiftpmArtifactQuery, withDirLock } from "@stim-cli/core";
21
20
  import { MAINTENANCE_LOG_NAME, OFFLOAD_MODES, automaticMachineEnabled, isJsonObject, maintenanceDir, maintenanceNdjsonFile, requireAutomaticMachine, runId, saturation, workspaceLogsDir } from "@stim-cli/core/state";
22
21
  import { WebSocket } from "ws";
23
22
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
24
- import { readFile, readlink } from "node:fs/promises";
23
+ import { access, lstat, readFile, readlink, realpath } from "node:fs/promises";
25
24
  //#region src/maintenance/log.ts
26
25
  function maintenanceLogger(settings, pass, trigger) {
27
26
  const file = maintenanceNdjsonFile();
@@ -158,6 +157,210 @@ function reportRemoteFailure(context, event, fields) {
158
157
  } catch {}
159
158
  }
160
159
  //#endregion
160
+ //#region src/integrations/native-gradle-inputs.ts
161
+ function containedPath(path) {
162
+ return typeof path === "string" && path.length > 0 && !path.includes("\\") && !path.includes(":") && !path.includes("\0") && !path.split("/").some((part) => !part || part === "." || part === ".." || part.toLowerCase() === ".git");
163
+ }
164
+ function gradleOffloadInputs(value) {
165
+ const input = value;
166
+ if (!input || typeof input !== "object" || input.complete !== true || Object.keys(input).some((key) => ![
167
+ "complete",
168
+ "ignored",
169
+ "outputs"
170
+ ].includes(key)) || !Array.isArray(input.ignored) || !input.ignored.every(containedPath) || !Array.isArray(input.outputs) || !input.outputs.every(containedPath)) throw new Error("Native Gradle offload requires android.offloadInputs with complete: true, ignored: [exact repository-relative files], and outputs: [generated repository-relative directories].");
171
+ const ignored = [...new Set(input.ignored)].toSorted();
172
+ const outputs = [...new Set(input.outputs)].toSorted();
173
+ if (ignored.some((path) => path.split("/").at(-1) === "local.properties")) throw new Error("local.properties is machine-local; remove it from android.offloadInputs.ignored.");
174
+ if (outputs.some((path) => path.split("/").some((part) => part === ".gradle" || part === ".kotlin"))) throw new Error("Gradle project state is worker-owned and cannot be declared as a generated output.");
175
+ for (const output of outputs) if (outputs.some((other) => other !== output && output.startsWith(`${other}/`))) throw new Error(`Generated output ${output} is nested inside another output declaration.`);
176
+ return {
177
+ complete: true,
178
+ ignored,
179
+ outputs
180
+ };
181
+ }
182
+ const below = (path, directory) => path === directory || path.startsWith(`${directory}/`);
183
+ function gradleStateDirectories(project) {
184
+ return [".gradle", ".kotlin"].map((name) => project ? `${project}/${name}` : name);
185
+ }
186
+ async function statIfPresent(path) {
187
+ try {
188
+ return await lstat(path);
189
+ } catch (error) {
190
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
191
+ throw error;
192
+ }
193
+ }
194
+ async function requireRealParents(repository, path, signal) {
195
+ const parts = path.split("/");
196
+ for (let index = 1; index < parts.length; index++) {
197
+ signal?.throwIfAborted();
198
+ const stat = await statIfPresent(join(repository, ...parts.slice(0, index)));
199
+ if (stat && !stat.isDirectory()) throw new Error(`Native input ${path} has a non-directory parent.`);
200
+ }
201
+ }
202
+ async function nativeGradleTransfer(root, value, signal) {
203
+ return nativeGradleInventory(root, value, [], signal, true);
204
+ }
205
+ async function nativeGradleLocalSourceDigest(root, value, localFiles, signal) {
206
+ const { project, digest } = await nativeGradleInventory(root, value, localFiles, signal, false);
207
+ return createHash("sha256").update(JSON.stringify({
208
+ project,
209
+ digest
210
+ })).digest("hex");
211
+ }
212
+ async function nativeGradleInventory(root, value, localFiles, signal, transfer) {
213
+ signal?.throwIfAborted();
214
+ const declaration = gradleOffloadInputs(value);
215
+ const repository = await realpath(await gitAsync(root, ["rev-parse", "--show-toplevel"], { signal }));
216
+ const realRoot = await realpath(root);
217
+ const project = relative(repository, realRoot).split(sep).join("/");
218
+ const local = localFiles.map((path) => resolve(realRoot, relative(root, path)));
219
+ if (project && !containedPath(project)) throw new Error("The native Gradle project leaves its repository.");
220
+ if (transfer && (await statIfPresent(join(repository, project, "buildSrc")))?.isDirectory()) throw new Error("Native Gradle offload does not support buildSrc: AGP does not report its build directories, so the worker cannot keep them.");
221
+ const state = gradleStateDirectories(project);
222
+ const files = new Map((await sourceManifest(repository, true, signal)).map((file) => [file.path, file]));
223
+ for (const path of declaration.ignored) {
224
+ await requireRealParents(repository, path, signal);
225
+ const absolute = join(repository, path);
226
+ const stat = await lstat(absolute);
227
+ if (!stat.isFile() && !stat.isSymbolicLink()) throw new Error(`Ignored native input ${path} must be an exact file or link, not a directory.`);
228
+ if (stat.isSymbolicLink()) {
229
+ const content = Buffer.from(await readlink(absolute));
230
+ files.set(path, {
231
+ path,
232
+ kind: "link",
233
+ size: content.length,
234
+ sha256: createHash("sha256").update(content).digest("hex")
235
+ });
236
+ } else files.set(path, {
237
+ path,
238
+ kind: stat.mode & 73 ? "exec" : "file",
239
+ ...await nativeFileDigest(absolute, signal)
240
+ });
241
+ }
242
+ for (const file of files.values()) {
243
+ if (local.includes(resolve(repository, file.path))) {
244
+ files.delete(file.path);
245
+ continue;
246
+ }
247
+ if (!containedPath(file.path)) throw new Error(`Native input ${file.path} is not a contained relative path.`);
248
+ await requireRealParents(repository, file.path, signal);
249
+ if (state.some((path) => below(file.path, path))) throw new Error("Gradle project state cannot be transferred as source.");
250
+ if (declaration.outputs.some((output) => below(file.path, output) || below(output, file.path))) throw new Error(`Native input ${file.path} overlaps a declared generated output.`);
251
+ if (file.path.split("/").at(-1) === "local.properties") {
252
+ if (file.kind === "link") throw new Error(`Native input ${file.path} is a machine-local properties link.`);
253
+ if ((await readFile(join(repository, file.path), {
254
+ encoding: "utf8",
255
+ signal
256
+ })).split(/\r?\n/).some((line) => line.trim() && !/^\s*[#!]/.test(line) && !/^\s*sdk\.dir\s*[:=].*[^\\]$/.test(line))) throw new Error(`Native input ${file.path} contains unsupported machine-local properties.`);
257
+ files.delete(file.path);
258
+ continue;
259
+ }
260
+ }
261
+ for (const file of files.values()) if (file.kind === "link") {
262
+ const absolute = join(repository, file.path);
263
+ const target = await readlink(absolute);
264
+ const resolved = await realpath(resolve(dirname(absolute), target));
265
+ const destination = relative(repository, resolved).split(sep).join("/");
266
+ if (isAbsolute(target) || !containedPath(destination) || !files.has(destination)) throw new Error(`Native input ${file.path} links to a target outside the declared source inventory.`);
267
+ }
268
+ for (const output of declaration.outputs) {
269
+ await requireRealParents(repository, output, signal);
270
+ const stat = await statIfPresent(join(repository, output));
271
+ if (stat && !stat.isDirectory()) throw new Error(`Generated output ${output} is not a real directory.`);
272
+ if (state.some((path) => below(output, path) || below(path, output))) throw new Error(`Generated output ${output} overlaps Gradle project state.`);
273
+ }
274
+ const empty = createHash("sha256").update("").digest("hex");
275
+ for (const path of files.keys()) {
276
+ const parts = path.split("/");
277
+ for (let index = 1; index < parts.length; index++) {
278
+ const directory = parts.slice(0, index).join("/");
279
+ files.set(directory, {
280
+ path: directory,
281
+ kind: "directory",
282
+ size: 0,
283
+ sha256: empty
284
+ });
285
+ }
286
+ }
287
+ const selected = [...files.values()].toSorted((a, b) => a.path.localeCompare(b.path));
288
+ return {
289
+ repository,
290
+ project,
291
+ declaration,
292
+ files: selected,
293
+ digest: manifestDigest(selected)
294
+ };
295
+ }
296
+ async function canonicalParent(path) {
297
+ const missing = [];
298
+ while (!await access(path).then(() => true, () => false) && dirname(path) !== path) {
299
+ missing.unshift(basename(path));
300
+ path = dirname(path);
301
+ }
302
+ return join(await realpath(path), ...missing);
303
+ }
304
+ async function nativeGradleOutputs(repository, declaration, reported, signal) {
305
+ signal?.throwIfAborted();
306
+ if (!Array.isArray(reported) || !reported.every((path) => typeof path === "string" && isAbsolute(path))) throw new Error("AGP did not report the configured native Gradle build directories.");
307
+ const real = await realpath(repository);
308
+ const reportedPaths = /* @__PURE__ */ new Set();
309
+ for (const absolute of reported) {
310
+ const resolved = resolve(absolute);
311
+ const canonical = join(await canonicalParent(dirname(resolved)), basename(resolved));
312
+ const path = relative(real, canonical).split(sep).join("/");
313
+ if (!containedPath(path)) throw new Error("A Gradle build directory leaves the transferred repository.");
314
+ await requireRealParents(repository, path, signal);
315
+ const stat = await statIfPresent(join(repository, path));
316
+ if (stat && !stat.isDirectory()) throw new Error(`Gradle build directory ${path} is not a real directory.`);
317
+ reportedPaths.add(path);
318
+ }
319
+ for (const output of declaration.outputs) if (!reportedPaths.has(output)) throw new Error(`Declared output ${output} was not reported by AGP.`);
320
+ for (const path of reportedPaths) if ((await statIfPresent(join(repository, path)))?.isDirectory() && !declaration.outputs.some((output) => below(path, output))) throw new Error(`Gradle build directory ${path} is not declared; add it to android.offloadInputs.outputs.`);
321
+ const outputs = [];
322
+ for (const path of declaration.outputs) {
323
+ signal?.throwIfAborted();
324
+ if ((await statIfPresent(join(repository, path)))?.isDirectory()) outputs.push(path);
325
+ }
326
+ return outputs;
327
+ }
328
+ function validateGradleManifest(project, declaration, files) {
329
+ gradleOffloadInputs(declaration);
330
+ if (project && !containedPath(project)) throw new Error("The native Gradle project leaves its repository.");
331
+ const excluded = [...declaration.outputs, ...gradleStateDirectories(project)];
332
+ for (const file of files) if (!containedPath(file.path) || excluded.some((path) => below(file.path, path) || file.kind !== "directory" && below(path, file.path))) throw new Error(`Native source ${file.path} overlaps worker outputs or leaves the repository.`);
333
+ for (const path of declaration.ignored) if (!files.some((file) => file.path === path && file.kind !== "directory")) throw new Error(`Declared ignored input ${path} is missing from the transfer.`);
334
+ }
335
+ async function verifyGradleTransfer(repository, project, declaration, files, digest, signal) {
336
+ signal?.throwIfAborted();
337
+ validateGradleManifest(project, declaration, files);
338
+ const excluded = [...declaration.outputs, ...gradleStateDirectories(project)];
339
+ for (const path of excluded) {
340
+ await requireRealParents(repository, path, signal);
341
+ const stat = await statIfPresent(join(repository, path));
342
+ if (stat && !stat.isDirectory()) throw new Error(`Worker output ${path} is not a real directory.`);
343
+ }
344
+ const markers = excluded.flatMap((path) => path.split("/").slice(0, -1).map((_, index) => join(repository, ...path.split("/").slice(0, index + 1))));
345
+ const snapshot = await fingerprintNativeInputs([{
346
+ name: "repository",
347
+ path: repository
348
+ }], {
349
+ excluded: [join(repository, ".git"), ...excluded.map((path) => join(repository, path))],
350
+ ignoredDirectoryMarkers: markers.filter((path) => !files.some((file) => join(repository, file.path) === path)),
351
+ parameters: null,
352
+ signal
353
+ });
354
+ const known = new Set(files.map((file) => file.path));
355
+ for (const entry of snapshot.entries) {
356
+ if (!entry.path.startsWith("repository/") || entry.path.includes("/@target")) continue;
357
+ const parts = entry.path.slice(11).split("/");
358
+ const index = parts.findIndex((_, depth) => !known.has(parts.slice(0, depth + 1).join("/")));
359
+ if (index >= 0 && (index < parts.length - 1 || entry.kind === "directory")) throw new Error(`Native Gradle directory ${parts.slice(0, index + 1).join("/")} is outside the source transfer and not a declared output reported by AGP; such directories, for example, included builds or externalNativeBuild staging, are not supported for remote builds.`);
360
+ }
361
+ return manifestDigest(await nativeTransferManifest(repository, snapshot, files, signal)) === digest;
362
+ }
363
+ //#endregion
161
364
  //#region src/offload/react-native-artifact.ts
162
365
  function reactNativeBuildQuery(build, fingerprint, project, toolchain) {
163
366
  if (build.native) return null;
@@ -176,9 +379,9 @@ function reactNativeBuildQuery(build, fingerprint, project, toolchain) {
176
379
  } } : { android: build.android }
177
380
  });
178
381
  }
179
- async function reactNativeArtifactToolchain(platform, root) {
382
+ async function reactNativeArtifactToolchain(platform, root, iosDirectory) {
180
383
  if (platform === "ios") {
181
- const tools = await iosToolchainAsync(root);
384
+ const tools = await iosToolchainAsync(root, iosDirectory);
182
385
  return tools.stimBuild && tools.xcode && tools.simulatorSdk && tools.cocoapods ? {
183
386
  ...tools,
184
387
  os: process.platform
@@ -697,16 +900,13 @@ function repoIdentity(projectRoot) {
697
900
  function repositoryIdentity(projectRoot, repoRoot, common) {
698
901
  const digest = createHash("sha256").update(common).digest("hex").slice(0, 12);
699
902
  const name = (basename(dirname(common)) || "repo").replace(/[^A-Za-z0-9._-]/g, "_").replace(/^[^A-Za-z0-9]+/, "");
700
- const lock = [
701
- "pnpm-lock.yaml",
702
- "yarn.lock",
703
- "package-lock.json"
704
- ].find((file) => existsSync(join(repoRoot, file)));
903
+ const project = relative(repoRoot, realpathSync(projectRoot));
904
+ const lock = dependencyLockfile(repoRoot, project);
705
905
  return {
706
906
  repoRoot,
707
- project: relative(repoRoot, realpathSync(projectRoot)),
907
+ project,
708
908
  repo: `${name.slice(0, 60) || "repo"}-${digest}`,
709
- lockfile: lock ? createHash("sha256").update(readFileSync(join(repoRoot, lock))).digest("hex") : null
909
+ lockfile: lock ? createHash("sha256").update(readFileSync(join(repoRoot, lock.dir, lock.file))).digest("hex") : null
710
910
  };
711
911
  }
712
912
  function dependencySelection(identity, target) {
@@ -998,10 +1198,15 @@ async function resumeJob(credential, job, abandoned, signal, native) {
998
1198
  return `no connection to it within ${RESUME_WINDOW_MS / 6e4} min (${last})`;
999
1199
  }
1000
1200
  /** Mirrors the checkout on the machine: the manifest in pages, then every blob it lacks. */
1001
- async function syncSource(connection, identity, onEnter, native, signal) {
1201
+ async function syncSource(connection, identity, onEnter, native, signal, ignored = []) {
1002
1202
  onEnter("sync");
1003
1203
  const syncStarted = Date.now();
1004
- const manifest = native && "declaration" in native ? (await nativeGradleTransfer(join(identity.repoRoot, identity.project), native.declaration, signal)).files : native ? await nativeTransferManifest(identity.repoRoot, native, await sourceManifest(identity.repoRoot, false, signal), signal) : await sourceManifest(identity.repoRoot, false, signal);
1204
+ const ignoredPaths = [];
1205
+ for (const path of ignored) {
1206
+ const inRepo = relative(identity.repoRoot, join(await realpath(dirname(path)), basename(path)));
1207
+ if (inRepo && !isAbsolute(inRepo) && inRepo !== ".." && !inRepo.startsWith(`..${sep}`)) ignoredPaths.push(inRepo.split(sep).join("/"));
1208
+ }
1209
+ const manifest = native && "declaration" in native ? (await nativeGradleTransfer(join(identity.repoRoot, identity.project), native.declaration, signal)).files : native ? await nativeTransferManifest(identity.repoRoot, native, await sourceManifest(identity.repoRoot, false, signal), signal) : await sourceManifest(identity.repoRoot, false, signal, ignoredPaths);
1005
1210
  if (native && "declaration" in native && manifestDigest(manifest) !== native.digest) return { failure: "The native Gradle source changed before upload." };
1006
1211
  const bySha = new Map(manifest.map((file) => [file.sha256, file]));
1007
1212
  const missing = [];
@@ -1132,6 +1337,21 @@ async function fetchArtifact({ connection, method, params, artifact, request, st
1132
1337
  declared
1133
1338
  };
1134
1339
  }
1340
+ function fingerprintSourcesParam(inputs, connection) {
1341
+ if (!inputs || !connection.supports("fingerprint-sources")) return {};
1342
+ return { fingerprintSources: inputs.sources.map((source) => ({
1343
+ id: source.type === "contents" ? source.id : source.filePath,
1344
+ hash: source.hash
1345
+ })) };
1346
+ }
1347
+ function fingerprintIgnoredParam(inputs, connection) {
1348
+ if (!inputs?.ignoredPaths?.length || !connection.supports("fingerprint-ignored")) return {};
1349
+ return { fingerprintIgnored: [...inputs.ignoredPaths] };
1350
+ }
1351
+ function fingerprintTrackedParam(inputs, connection) {
1352
+ if (!inputs?.trackedPaths?.length || !connection.supports("fingerprint-tracked")) return {};
1353
+ return { fingerprintTracked: [...inputs.trackedPaths] };
1354
+ }
1135
1355
  function keepCorruptCacheMessage(failed, result) {
1136
1356
  return result.code === "STIM_COMPILATION_CACHE_CORRUPT" ? {
1137
1357
  ...failed,
@@ -1262,6 +1482,8 @@ async function offloadBuild(input) {
1262
1482
  let syncMs = 0;
1263
1483
  let uploadedBytes = 0;
1264
1484
  let workerStarted = 0;
1485
+ let fingerprintInputs;
1486
+ const readFingerprintInputs = () => fingerprintInputs ??= !native && request.platform !== "macos" && input.fingerprintInputs ? input.fingerprintInputs() : Promise.resolve(null);
1265
1487
  const moveOn = (why) => {
1266
1488
  const next = choice.runnersUp.shift();
1267
1489
  if (!next) return false;
@@ -1293,7 +1515,8 @@ async function offloadBuild(input) {
1293
1515
  break;
1294
1516
  }
1295
1517
  if (choice.cacheOnly) return fail("The exact artifact is no longer available.");
1296
- const synced = await syncSource(choice.connection, identity, onEnter, nativeTransferInput(native), signal);
1518
+ const inputs = await readFingerprintInputs();
1519
+ const synced = await syncSource(choice.connection, identity, onEnter, nativeTransferInput(native), signal, inputs?.ignored);
1297
1520
  checkCancelled();
1298
1521
  if ("failure" in synced) {
1299
1522
  if (moveOn(synced.failure)) continue;
@@ -1312,6 +1535,9 @@ async function offloadBuild(input) {
1312
1535
  project: identity.project,
1313
1536
  platform: request.platform,
1314
1537
  fingerprint: request.platform === "macos" ? synced.digest : expectedFingerprint,
1538
+ ...fingerprintSourcesParam(inputs, choice.connection),
1539
+ ...fingerprintIgnoredParam(inputs, choice.connection),
1540
+ ...fingerprintTrackedParam(inputs, choice.connection),
1315
1541
  ...native ? { native: {
1316
1542
  provider: native.provider,
1317
1543
  sourceDigest: synced.digest,
@@ -1574,4 +1800,4 @@ function offloadCheck(projectRoot, targets) {
1574
1800
  };
1575
1801
  }
1576
1802
  //#endregion
1577
- export { clearCorruptCompilationCache as _, nativeTransferRefusal as a, offloadPlacement as c, simulatorRuntime as d, reactNativeArtifactReceipt as f, COMPILATION_CACHE_CORRUPT as g, setRemoteLogSink as h, closeOffload as i, placementLoad as l, reactNativeBuildQuery as m, buildPlacementCandidates as n, offloadBuild as o, reactNativeArtifactToolchain as p, chooseBuildMachine as r, offloadCheck as s, BuildConnection as t, remotePhaseText as u, maintenanceLogger as v };
1803
+ export { COMPILATION_CACHE_CORRUPT as C, setRemoteLogSink as S, maintenanceLogger as T, nativeGradleLocalSourceDigest as _, nativeTransferRefusal as a, validateGradleManifest as b, offloadPlacement as c, simulatorRuntime as d, reactNativeArtifactReceipt as f, gradleStateDirectories as g, gradleOffloadInputs as h, closeOffload as i, placementLoad as l, reactNativeBuildQuery as m, buildPlacementCandidates as n, offloadBuild as o, reactNativeArtifactToolchain as p, chooseBuildMachine as r, offloadCheck as s, BuildConnection as t, remotePhaseText as u, nativeGradleOutputs as v, clearCorruptCompilationCache as w, verifyGradleTransfer as x, nativeGradleTransfer as y };
@@ -1,12 +1,12 @@
1
- import { g as process_identity_exports } from "./exec-DEoAhcze.mjs";
1
+ import { S as process_identity_exports } from "./exec-VFRpu1iA.mjs";
2
2
  import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
3
- import { V as deviceSlotKey, q as validateDeviceSlot } from "./config-DlrsduwG.mjs";
3
+ import { V as deviceSlotKey, q as validateDeviceSlot } from "./config-BZhXY15H.mjs";
4
4
  import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
5
+ import { c as watchAppPid, i as parseLogcatLine, o as startAndroidLogcat, s as waitForAppPid, t as androidClockOffset } from "./android-CX5IcRuf.mjs";
5
6
  import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
6
- import { a as startIosDeviceConsole, i as parseDeviceConsoleLine } from "./ios-device-BXZ0c7Kb.mjs";
7
- import { a as unregisterCollector, i as registerCollector, r as readCollectors, t as collectorProcessTitle } from "./ownership-C5fo5Edb.mjs";
8
- import { a as waitForAppPid, i as startAndroidLogcat, n as parseLogcatLine, o as watchAppPid, t as androidClockOffset } from "./android-DR5lZ2Az.mjs";
9
- import { n as parseLogStreamLine, r as startIosLogStream, t as appNameFromBundleId } from "./ios-xtlRHaeB.mjs";
7
+ import { a as startIosDeviceConsole, i as parseDeviceConsoleLine } from "./ios-device-B6HK951C.mjs";
8
+ import { a as unregisterCollector, i as registerCollector, r as readCollectors, t as collectorProcessTitle } from "./ownership-DxlZGDcV.mjs";
9
+ import { n as parseLogStreamLine, r as startIosLogStream, t as appNameFromBundleId } from "./ios-ENC4sRPA.mjs";
10
10
  import { existsSync } from "node:fs";
11
11
  import { isAbsolute, join, resolve } from "node:path";
12
12
  import { LOG_ROTATE_BYTES } from "@stim-cli/core";
@@ -1,8 +1,9 @@
1
1
  import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
2
- import { t as NO_PROJECT_REFUSAL } from "./project-CTLNHCfE.mjs";
2
+ import { t as NO_PROJECT_REFUSAL } from "./project-Dz-hWkb-.mjs";
3
3
  import { quotedPath as quotedPath$1 } from "@stim-cli/core";
4
4
  import chalk from "chalk";
5
5
  //#region src/diagnostics/launch-error-preview.ts
6
+ const MAX_FRAME_LINE_LENGTH = 2048;
6
7
  function framePriority(frame, root) {
7
8
  const normalized = frame.replaceAll("\\", "/");
8
9
  if (/^\s*at (?:android\.|java\.|com\.android\.|dalvik\.)/.test(normalized)) return 2;
@@ -145,7 +146,7 @@ function launchErrorPreview(records, root, { full = false } = {}) {
145
146
  if (header) {
146
147
  flush();
147
148
  kind = /^component/i.test(header[1]) ? "Component" : "Error";
148
- } else if (/^\s*at\s+\S/.test(line) || /^\s*\S[^\n]*@\S+:\d+:\d+\s*$/.test(line) || /^\s+\S[^\n]*\([^()]+:\d+:\d+\)\s*$/.test(line)) {
149
+ } else if (line.length <= MAX_FRAME_LINE_LENGTH && (/^\s*at\s+\S/.test(line) || /^\s*\S[^\n]*@\S+:\d+:\d+\s*$/.test(line) || /^\s+\S[^\n]*\([^()]+:\d+:\d+\)\s*$/.test(line))) {
149
150
  if (!full && /\(https?:\/\/[^\s)]*$/.test(line)) return;
150
151
  frames.push(line);
151
152
  } else if (line.trim()) {
@@ -1,5 +1,5 @@
1
- import { _ as reportSignal, g as process_identity_exports, r as WorkspaceProcessCleanupError, t as getExecutor, x as ownership_claim_exports, y as trackReportResource } from "./exec-DEoAhcze.mjs";
2
- import { t as runOperationFile } from "./operation-exec-BW0em61G.mjs";
1
+ import { C as reportSignal, D as ownership_claim_exports, S as process_identity_exports, T as trackReportResource, l as WorkspaceProcessCleanupError, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
3
3
  import { join } from "node:path";
4
4
  import { ambientEnv, configDir, ensurePrivateDir } from "@stim-cli/core";
5
5
  import { allMetroPorts, cannotHost, clientIdentity, configCorruptRepair, endpoint, findEnclosingWorktreeRoot, findPeer as findPeer$1, getConcurrencyLimits, getConfigPath, getConfigPath as getConfigPath$1, getProject, getProjectSettings, getRepoSettings, isJsonObject, isPathPrefix, loadConfig, loadConfig as loadConfig$1, machineEndpoint, parseMachine, parseMachine as parseMachine$1, validateAutomaticPool, withConfigLock, withConfigLock as withConfigLock$1, withConfigLockAsync, withConfigLockAsync as withConfigLockAsync$1 } from "@stim-cli/core/state";
@@ -783,7 +783,7 @@ function releaseAndroidConsolePort(projectPath, consolePort, slot = "default") {
783
783
  });
784
784
  }
785
785
  function recordIosSchemeApprovals(projectPath, deviceUdid, schemeApprovals, slot = "default") {
786
- withConfigLock(() => {
786
+ return withConfigLockAsync(() => {
787
787
  const cfg = loadConfig();
788
788
  const ios = deviceSlotPlatforms(cfg?.projects?.[projectPath], slot)?.ios;
789
789
  if (!cfg || !ios?.owned || ios.deviceUdid !== deviceUdid) return;
@@ -1,5 +1,5 @@
1
1
  import { v as withDirLock$1, y as withDirLockAsync$1 } from "./paths-DQtTgsBf.mjs";
2
- import { d as getConfigDir } from "./config-DlrsduwG.mjs";
2
+ import { d as getConfigDir } from "./config-BZhXY15H.mjs";
3
3
  import { renameSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { ensurePrivateDir } from "@stim-cli/core";
5
5
  import { createdDevicesFile, createdDevicesLock, readCreatedDevices, readCreatedDevices as readCreatedDevices$1 } from "@stim-cli/core/state";
@@ -34,6 +34,10 @@ function recordCreatedDevice(platform, id) {
34
34
  function forgetCreatedDevice(platform, id) {
35
35
  update(platform, (entries) => entries.delete(id));
36
36
  }
37
+ /** Waits asynchronously for the ledger lock, then records the device. */
38
+ function recordCreatedDeviceAsync(platform, id) {
39
+ return withDirLockAsync$1(createdDevicesLock(), () => recordCreatedDevice(platform, id), { ensureParent: () => ensurePrivateDir(getConfigDir()) });
40
+ }
37
41
  /** Waits asynchronously for the ledger lock, then atomically forgets the device. The synchronous transaction decides whether to commit the removal; cancellation stops admission. */
38
42
  function forgetCreatedDeviceAsync(platform, id, signal, transaction = (forget) => {
39
43
  forget();
@@ -45,4 +49,4 @@ function forgetCreatedDeviceAsync(platform, id, signal, transaction = (forget) =
45
49
  });
46
50
  }
47
51
  //#endregion
48
- export { recordCreatedDevice as i, forgetCreatedDeviceAsync as n, readCreatedDevices$1 as r, forgetCreatedDevice as t };
52
+ export { recordCreatedDeviceAsync as a, recordCreatedDevice as i, forgetCreatedDeviceAsync as n, readCreatedDevices$1 as r, forgetCreatedDevice as t };
@@ -1,5 +1,5 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { Mt as repoRoot } from "./settings-C7O8A6ZI.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { Mt as repoRoot } from "./settings-RKwY33wv.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { dirname, join, relative } from "node:path";
5
5
  //#region src/dependency-state.ts
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
2
  import { openSync } from "node:fs";
3
3
  //#region src/detached-entry.ts
4
4
  const LOG_FILE_FLAG = "--log-file";
@@ -1,5 +1,5 @@
1
- import { C as resolvePackageJson, b as isPackageResolvable } from "./project-CTLNHCfE.mjs";
2
- import { An as readBundleSchemes, kn as pickDevClientScheme } from "./budget-DnPX3DXj.mjs";
1
+ import { C as resolvePackageJson, b as isPackageResolvable } from "./project-Dz-hWkb-.mjs";
2
+ import { Mn as readBundleSchemes, jn as pickDevClientScheme } from "./budget-dPGuhNai.mjs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { isJsonObject, readJsonObject } from "@stim-cli/core/state";
5
5
  //#region src/commands/dev-client.ts
@@ -40,4 +40,4 @@ function installedDevLauncherVersion(root) {
40
40
  return typeof version === "string" ? version : null;
41
41
  }
42
42
  //#endregion
43
- export { devClientTakesDevMenuParams as n, devClientScheme as t };
43
+ export { devClientTakesDevMenuParams as n, hasDevClient as r, devClientScheme as t };
@@ -1,20 +1,20 @@
1
- import { m as operationState, t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-DlrsduwG.mjs";
1
+ import { b as operationState, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-BZhXY15H.mjs";
3
3
  import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
4
- import { r as clockTime } from "./command-output-Db8BqzxH.mjs";
5
- import { Ht as makeTemporaryDirectory, K as resolveIosProjectDir, Ut as removeTemporaryEntry, q as resolveProjectSettings, tt as settingValueAt } from "./settings-C7O8A6ZI.mjs";
6
- import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-CTLNHCfE.mjs";
7
- import { In as runProcessOperation } from "./budget-DnPX3DXj.mjs";
8
- import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-B5RtpFda.mjs";
9
- import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, s as androidPoolCandidates, tt as resolvePhysicalDevice } from "./android-C7sVmyI9.mjs";
10
- import { m as resolveScheme, v as xcodebuildArgs } from "./xcode-iQnROM5o.mjs";
11
- import { a as discoverXcodeProject } from "./react-native-build-CmJkTljQ.mjs";
12
- import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-BgwPHc6u.mjs";
13
- import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-BTpZ6RAJ.mjs";
14
- import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-BtAffm0A.mjs";
15
- import { t as selectFromPool } from "./device-pool-C-ptmZTa.mjs";
16
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-JC3uWM4K.mjs";
17
- import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-G6rkkhxu.mjs";
4
+ import { r as clockTime } from "./command-output-DxC0k2rk.mjs";
5
+ import { Ht as makeTemporaryDirectory, K as resolveIosProjectDir, Ut as removeTemporaryEntry, q as resolveProjectSettings, tt as settingValueAt } from "./settings-RKwY33wv.mjs";
6
+ import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-Dz-hWkb-.mjs";
7
+ import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-882m4hxX.mjs";
8
+ import { Rn as runProcessOperation } from "./budget-dPGuhNai.mjs";
9
+ import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-Dq3ZcdD8.mjs";
10
+ import { m as resolveScheme, v as xcodebuildArgs } from "./xcode-DHu41qQ4.mjs";
11
+ import { a as discoverXcodeProject } from "./react-native-build-AuCu-aAP.mjs";
12
+ import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-DUtkbqBQ.mjs";
13
+ import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-B1W-hmC2.mjs";
14
+ import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-4c_qXvQm.mjs";
15
+ import { t as selectFromPool } from "./device-pool-CgBHk401.mjs";
16
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-BI38NFFH.mjs";
17
+ import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-irplbQb0.mjs";
18
18
  import { existsSync, readdirSync, realpathSync, statSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
20
  import { join } from "node:path";