stim 1.21.0 → 1.22.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 (184) hide show
  1. package/README.md +60 -7
  2. package/dist/{acquire-artifact-CD4lbiWE.mjs → acquire-artifact-Co2k4f7O.mjs} +21 -3
  3. package/dist/{act-DHAw2A2S.mjs → act-DsuqEkiM.mjs} +298 -164
  4. package/dist/{activity-BzVfHSrY.mjs → activity-CMLmzp7o.mjs} +33 -12
  5. package/dist/{agent-device-usage-output-zh1vhbLp.mjs → agent-device-usage-output-DUFaTMdd.mjs} +7 -7
  6. package/dist/{android-BLgbNqox.mjs → android-ByRMUoiJ.mjs} +66 -52
  7. package/dist/{android-DUYkNF4u.mjs → android-C7sVmyI9.mjs} +160 -59
  8. package/dist/{android-CV_GCELZ.mjs → android-DGkNqa_c.mjs} +5 -5
  9. package/dist/{android-BEJ8Jpl7.mjs → android-DR5lZ2Az.mjs} +2 -2
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/{android-cas-Ct5b1xCK.mjs → android-cas-ngferVq2.mjs} +3 -3
  12. package/dist/{client-B7QVOlCr.d.mts → android-project-DVWyCbWU.d.mts} +145 -7
  13. package/dist/api.d.mts +132 -118
  14. package/dist/api.mjs +239 -42
  15. package/dist/{artifact-B8T3S5gi.mjs → artifact-8EY8SAPw.mjs} +40 -35
  16. package/dist/{artifact-DAuZ-FNU.mjs → artifact-DJPy518Y.mjs} +69 -40
  17. package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
  18. package/dist/{browser-web-QQzVjz3O.mjs → browser-web-Bcv99PBM.mjs} +187 -59
  19. package/dist/{budget-Bs6SxxzO.mjs → budget-Cvwn54qV.mjs} +830 -699
  20. package/dist/{build-CoPzQRNw.mjs → build-CabC3G23.mjs} +34 -27
  21. package/dist/{build-cache-DmyR9Zzc.mjs → build-cache-Dv7RN200.mjs} +4 -4
  22. package/dist/{build-plan-CaFskB7_.mjs → build-plan-DUC8Ka9y.mjs} +74 -14
  23. package/dist/{cache-manifest-DkkqguoK.mjs → cache-manifest-DSeQjt-Q.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-BJRZ9pG3.mjs → ccache-Btwc36-I.mjs} +6 -6
  26. package/dist/{cdp-CWmIUMbw.mjs → cdp-3fwICjzi.mjs} +1 -1
  27. package/dist/{chrome-B6tfCta1.mjs → chrome-Bbw689-6.mjs} +1 -1
  28. package/dist/{cli-0DYf8QhQ.mjs → cli-CHZa9Lvk.mjs} +20 -20
  29. package/dist/cli.mjs +1 -1
  30. package/dist/{client-UXD70ZbM.mjs → client-OyRoEuSr.mjs} +218 -47
  31. package/dist/collector-run.d.mts +1 -1
  32. package/dist/collector-run.mjs +6 -6
  33. package/dist/{command-output-B1UrjZHL.mjs → command-output-gwpm28fu.mjs} +1 -1
  34. package/dist/{config-CYcBF478.mjs → config-DlrsduwG.mjs} +17 -11
  35. package/dist/{created-devices-CqeBlrEn.mjs → created-devices-x9rN6bhs.mjs} +13 -3
  36. package/dist/{dependency-state-BbKQW83h.mjs → dependency-state-1I9KZT1Y.mjs} +2 -2
  37. package/dist/{detached-entry-DFRyG1_o.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
  38. package/dist/{dev-client-UOeESKm6.mjs → dev-client-BSDR5h3F.mjs} +2 -2
  39. package/dist/{device-ExJq8Ei7.mjs → device-B-L3Fbxy.mjs} +71 -14
  40. package/dist/{device-DCxH7_By.mjs → device-DklWZLqb.mjs} +16 -16
  41. package/dist/{device-capacity-CMlqEcvw.mjs → device-capacity-DK5_EwRS.mjs} +9 -10
  42. package/dist/device-host-worker.mjs +25 -32
  43. package/dist/{device-ios-DRUeKaFV.mjs → device-ios-DoB6KFCO.mjs} +39 -16
  44. package/dist/{device-lease-run-C8raGFoP.mjs → device-lease-run-xJPQ_QQG.mjs} +5 -5
  45. package/dist/{device-pool-DMRpVX9a.mjs → device-pool-BMkdsefq.mjs} +3 -3
  46. package/dist/{doctor-DTvaDOda.mjs → doctor-Bo7BXLux.mjs} +24 -37
  47. package/dist/{doctor-Dhqebm0q.mjs → doctor-D5_EzwfA.mjs} +19 -16
  48. package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
  49. package/dist/doctor-fingerprint.mjs +1 -1
  50. package/dist/{doctor-BLHCYxzi.mjs → doctor-thjWAV0z.mjs} +1 -1
  51. package/dist/{doctor-watchman-Cv1F10Kj.mjs → doctor-watchman-N2wDotwQ.mjs} +5 -5
  52. package/dist/{eas-build-BomfRnFT.mjs → eas-build-CwknaQYj.mjs} +4 -4
  53. package/dist/{eas-fallback-DJwZpy0c.mjs → eas-fallback-CSgAulr5.mjs} +27 -18
  54. package/dist/{eas-session-ledger-op6A54yi.mjs → eas-session-ledger-DlY_serQ.mjs} +8 -7
  55. package/dist/{error-diagnostics-Bf0rZvG9.mjs → error-diagnostics-DBWO2rxE.mjs} +10 -10
  56. package/dist/{exec-_UbtCQcG.mjs → exec-DEoAhcze.mjs} +155 -47
  57. package/dist/{exec-H20xSg2T.d.mts → exec-DnYc4HGH.d.mts} +17 -4
  58. package/dist/{gc-_-dCXdyL.mjs → gc-CXxN-4SE.mjs} +587 -313
  59. package/dist/gc-DnNDQyaP.mjs +3 -0
  60. package/dist/{guide-Yqwt2bd6.mjs → guide-Br0LEfKy.mjs} +239 -43
  61. package/dist/{hosted-android-Bw-honsd.mjs → hosted-android-B-9f-jkd.mjs} +6 -6
  62. package/dist/{hosted-client-DB_gBPfY.mjs → hosted-client-DZAPrcro.mjs} +4 -4
  63. package/dist/{hosted-ios-CUvOf4Vr.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
  64. package/dist/{hosted-logs-DL_P5AdN.mjs → hosted-logs-FIRx9X2f.mjs} +5 -5
  65. package/dist/{hosted-macos-QI141yKk.mjs → hosted-macos-_awYSpfv.mjs} +21 -12
  66. package/dist/{hosted-native-Ksyjgzq-.mjs → hosted-native-BdzE668-.mjs} +27 -14
  67. package/dist/{idle-BVeRGroT.d.mts → idle-C4cZ757K.d.mts} +3 -3
  68. package/dist/{idle-shutdown-DaKmZi0z.mjs → idle-shutdown-DDg3SdvY.mjs} +7 -7
  69. package/dist/ios-CDvlmUs7.d.mts +24 -0
  70. package/dist/{ios-CQ68hG9s.mjs → ios-Ds1clbIt.mjs} +8 -8
  71. package/dist/{ios-device-CwFMehUS.mjs → ios-device--h_-8ENa.mjs} +3 -3
  72. package/dist/{ios-device-CXGP1bsD.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
  73. package/dist/{ios-CpByZy12.mjs → ios-hcBpnEGk.mjs} +81 -34
  74. package/dist/{ios-ubFsBzwq.mjs → ios-pm4nL6By.mjs} +59 -50
  75. package/dist/{ios-project-WuwwBdvW.mjs → ios-project-CZhKODF3.mjs} +5 -5
  76. package/dist/{ios-signing-DTTIChGs.mjs → ios-signing-BtAffm0A.mjs} +2 -2
  77. package/dist/{ios-state-DvFX-K_l.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
  78. package/dist/{ios-qNJt4dFm.mjs → ios-xtlRHaeB.mjs} +1 -1
  79. package/dist/{js-swap-Cc1dttps.mjs → js-swap-Bwhh4S7V.mjs} +7 -29
  80. package/dist/{launch-Zq2mOSDy.mjs → launch-BjxemNpK.mjs} +40 -39
  81. package/dist/{launch-CD1yVc7U.mjs → launch-CCzXlc8r.mjs} +16 -16
  82. package/dist/{logs-BS00Anxf.mjs → logs-BfwwadsZ.mjs} +151 -24
  83. package/dist/{logs-CMm05HxN.mjs → logs-jTS_lHSo.mjs} +10 -17
  84. package/dist/{macos-B65--pPd.mjs → macos-DVlSSyUg.mjs} +1 -1
  85. package/dist/{macos-C-0qJ6zq.mjs → macos-NfV2D7dO.mjs} +143 -46
  86. package/dist/macos-run.mjs +1 -1
  87. package/dist/maintenance-run.mjs +8 -8
  88. package/dist/{metro-DEXpIhHC.mjs → metro-DiXtA3Ty.mjs} +59 -37
  89. package/dist/{metro-gateway-BMJNlj3E.mjs → metro-gateway-CKZqKqx7.mjs} +120 -22
  90. package/dist/{named-ports-BWTzt6mu.mjs → named-ports-DkEzOfzO.mjs} +40 -33
  91. package/dist/{native-android-JACyjTZs.mjs → native-android-CqgnOgsT.mjs} +43 -242
  92. package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
  93. package/dist/{native-gradle-inputs-Bep9JcSF.mjs → native-gradle-inputs-Dnh84Zbd.mjs} +3 -129
  94. package/dist/{native-run-DY_RLx3C.mjs → native-run-NwUuxbkg.mjs} +4 -5
  95. package/dist/{native-runtime-Dg1Q7tfF.mjs → native-runtime-B7KIafpM.mjs} +8 -7
  96. package/dist/native-source-Y0yLhFyQ.mjs +133 -0
  97. package/dist/{native-xcode-inputs-CB2iQeWq.mjs → native-xcode-inputs-D_VOfFL7.mjs} +2 -3
  98. package/dist/{native-xcode-ios-CXX39F7o.mjs → native-xcode-ios-BYDOHWLN.mjs} +27 -32
  99. package/dist/offload-worker.d.mts +65 -2
  100. package/dist/offload-worker.mjs +305 -73
  101. package/dist/operation-exec-BW0em61G.mjs +171 -0
  102. package/dist/{ownership-DEmM5vhh.mjs → ownership-C5fo5Edb.mjs} +3 -3
  103. package/dist/{page-CPaHeYqj.mjs → page-DBL2PiUU.mjs} +8 -4
  104. package/dist/{placement-log-BqGbTa61.mjs → placement-log-BnGgJRRZ.mjs} +1 -1
  105. package/dist/{plan-placement-Bwj-IjY1.mjs → plan-placement-DIsMtN-d.mjs} +12 -8
  106. package/dist/{ports-D-MmCTdv.mjs → ports-Cy1RkmuQ.mjs} +3 -3
  107. package/dist/{prebuild-uD_ipCxF.mjs → prebuild-D4JoEAEs.mjs} +49 -14
  108. package/dist/{project-BZNjmW_8.mjs → project-wM_XFTvE.mjs} +16 -16
  109. package/dist/{pull-request-Lfetn8Kr.mjs → pull-request-W1IuLXDt.mjs} +102 -20
  110. package/dist/{pull-request-zjCSAryH.d.mts → pull-request-eODyIqZF.d.mts} +6 -2
  111. package/dist/pull-requests.d.mts +2 -2
  112. package/dist/pull-requests.mjs +2 -2
  113. package/dist/{react-native-android-DuzH0cn3.mjs → react-native-android-6OZ7MSM7.mjs} +71 -48
  114. package/dist/{react-native-build-rhk4smwQ.mjs → react-native-build-Dvd8hC21.mjs} +8 -8
  115. package/dist/{react-native-doctor-CQpuIMso.mjs → react-native-doctor-DsoSF1Y9.mjs} +7 -7
  116. package/dist/{react-native-ios-Bhq1rJeV.mjs → react-native-ios-4u1Rn-GR.mjs} +40 -26
  117. package/dist/{recordings-DYteQSu4.mjs → recordings-CQmfzAh7.mjs} +1 -1
  118. package/dist/registration-BcRgF6Ox.mjs +51 -0
  119. package/dist/{reload-CmTRFJaX.mjs → reload-BzkYabB-.mjs} +16 -15
  120. package/dist/{reload-DzjSl5P_.mjs → reload-D7AVlb8N.mjs} +1 -1
  121. package/dist/{remote-ByYkXdGD.mjs → remote-DjGDmlTZ.mjs} +18 -15
  122. package/dist/{result-DNiS-tTP.mjs → result-D2Ykz_iD.mjs} +24 -23
  123. package/dist/{run-D23HmJMs.mjs → run-DidHghD1.mjs} +3 -2
  124. package/dist/{selection-CSl9i5qU.mjs → selection-DSMbWEX2.mjs} +6 -5
  125. package/dist/{server-bare-CxTrvDg8.mjs → server-bare-CafzuyFB.mjs} +2 -2
  126. package/dist/{server-command-CtzloH3v.mjs → server-command-C6QjeupS.mjs} +5 -5
  127. package/dist/{server-expo-DT_F_uVI.mjs → server-expo-CrjB29pq.mjs} +7 -5
  128. package/dist/server-expo-D58c9L0M.mjs +2 -0
  129. package/dist/{settings-CsJDEXgK.mjs → settings-C7O8A6ZI.mjs} +223 -243
  130. package/dist/{settings-T1gtc3bf.mjs → settings-DpR-1Wnn.mjs} +1 -1
  131. package/dist/{settings-write-HyVZ8eQ8.mjs → settings-write-CzD60rOD.mjs} +7 -6
  132. package/dist/settings.schema.json +13 -0
  133. package/dist/{simslim-Cgk17SXV.mjs → simslim-BNckWpXi.mjs} +2 -2
  134. package/dist/{slot-launch-DF8VfT64.mjs → slot-launch-CbfmNgM6.mjs} +6 -6
  135. package/dist/{stage-BIS0ydsV.mjs → stage-Bps5oius.mjs} +21 -4
  136. package/dist/{start-RChynRDp.mjs → start-Br-oxqMD.mjs} +1 -1
  137. package/dist/{start-7lpH7hmN.mjs → start-EojN4WFz.mjs} +622 -393
  138. package/dist/{state-C4ZtUisW.mjs → state--smjFSTL.mjs} +22 -7
  139. package/dist/{state-XMziexv2.mjs → state-08I3hw3_.mjs} +2 -2
  140. package/dist/{stats-53T7OTb9.mjs → stats-D3GerlFW.mjs} +5 -5
  141. package/dist/{stats-report-BFfMpWWF.mjs → stats-report-BzaPrRm6.mjs} +1 -1
  142. package/dist/{status-DqEUSSxs.mjs → status-BRROykC8.mjs} +2 -2
  143. package/dist/{status-CSi6tlRq.mjs → status-EvrK72L2.mjs} +1 -1
  144. package/dist/{status-BL7jVyAB.mjs → status-WBDajew2.mjs} +43 -29
  145. package/dist/{status-watch-GDCfqpTE.mjs → status-watch-Bg_u-pwR.mjs} +48 -16
  146. package/dist/status-worker.mjs +1 -1
  147. package/dist/{stim-desktop-C12we7lz.mjs → stim-desktop-D5OGpYZM.mjs} +2 -2
  148. package/dist/{stop-Bk_1qiV6.mjs → stop-DTZ9uTw3.mjs} +2 -2
  149. package/dist/{stop-D7h6jAXQ.mjs → stop-Dky10AEJ.mjs} +31 -22
  150. package/dist/{stop-CPzlM1L-.mjs → stop-Mv6W9FAk.mjs} +15 -16
  151. package/dist/supervisor-run.d.mts +3 -3
  152. package/dist/supervisor-run.mjs +28 -36
  153. package/dist/{support-Dlu37g6H.mjs → support-CNioewsd.mjs} +10 -10
  154. package/dist/{support-67vraa1Q.mjs → support-yUiOjnVY.mjs} +8 -8
  155. package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
  156. package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
  157. package/dist/toolchain-BY8X8HXx.mjs +2 -0
  158. package/dist/{toolchain-Hp9sCpK4.mjs → toolchain-DpJMHq0n.mjs} +9 -6
  159. package/dist/{trigger-BAahxUPq.mjs → trigger-Cbyc41d_.mjs} +3 -3
  160. package/dist/trigger-yb_nFzPF.mjs +2 -0
  161. package/dist/{warm-progress-BHX5r0Ei.mjs → warm-progress-CA3TgT3-.mjs} +29 -16
  162. package/dist/web-CZ07gd77.mjs +2 -0
  163. package/dist/{web-CJmIj6AI.mjs → web-DKx6yoFA.mjs} +11 -10
  164. package/dist/web-run.mjs +11 -9
  165. package/dist/windows-report.mjs +1 -1
  166. package/dist/{workspace-state-Cjuigeeu.mjs → workspace-state-U08dEzhG.mjs} +3 -3
  167. package/dist/{workspaces-BccMFmGQ.mjs → workspaces-CpANmBlq.mjs} +594 -266
  168. package/dist/{worktree-DQ6Zi2Mv.mjs → worktree-CHecZ4Oq.mjs} +850 -551
  169. package/dist/worktree-ZqZVjD9K.mjs +2 -0
  170. package/dist/{xcode-Zlx3qjEs.mjs → xcode-BXn9-xYx.mjs} +5 -5
  171. package/package.json +7 -7
  172. package/shim/android-audio/Main.java +24 -0
  173. package/shim/android-audio/README.md +17 -0
  174. package/shim/android-audio.jar +0 -0
  175. package/dist/gc-C-WwL0yi.mjs +0 -3
  176. package/dist/git-C3iTsJaZ.mjs +0 -73
  177. package/dist/server-expo-C-90EhcG.mjs +0 -2
  178. package/dist/settings-DkdmlelE.d.mts +0 -15
  179. package/dist/swiftpm-macos-p8WZbxKU.mjs +0 -130
  180. package/dist/toolchain-DhKwp9iI.mjs +0 -2
  181. package/dist/trigger-Bf3uDcpv.mjs +0 -2
  182. package/dist/web-DknQETPs.mjs +0 -2
  183. package/dist/workspace-process-lock-1_1OoVW5.mjs +0 -57
  184. package/dist/worktree-CK2MpJW5.mjs +0 -2
@@ -1,32 +1,200 @@
1
- import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
1
+ import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
2
  import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
- import { k as writeConfigSetting } from "./config-CYcBF478.mjs";
3
+ import { k as writeConfigSetting } from "./config-DlrsduwG.mjs";
4
4
  import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
5
- import { d as androidLayoutSetting, y as iosProjectDirSetting } from "./settings-CsJDEXgK.mjs";
6
- import { t as git } from "./git-C3iTsJaZ.mjs";
7
- import { f as projectRegistry, g as selectNativeXcodeProject } from "./project-BZNjmW_8.mjs";
5
+ import { o as git, s as gitAsync } from "./operation-exec-BW0em61G.mjs";
6
+ import { d as androidLayoutSetting, y as iosProjectDirSetting } from "./settings-C7O8A6ZI.mjs";
7
+ import { f as projectRegistry, g as selectNativeXcodeProject } from "./project-wM_XFTvE.mjs";
8
8
  import { o as parseNdjsonText } from "./ndjson-CgE_o3Dl.mjs";
9
- import { Fn as processContext } from "./budget-Bs6SxxzO.mjs";
10
- import { l as fingerprintProject, m as refingerprintAfterMutation } from "./build-cache-DmyR9Zzc.mjs";
11
- import { n as CCACHE_UNAVAILABLE, o as resolveCcache } from "./ccache-BJRZ9pG3.mjs";
12
- import { m as clearCorruptCompilationCache, p as COMPILATION_CACHE_CORRUPT } from "./client-UXD70ZbM.mjs";
13
- import { _ as runPodInstall, d as workerToolchain, m as readPodState, p as podsAreStale } from "./toolchain-Hp9sCpK4.mjs";
14
- import { r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
15
- import { f as verifyNativeTransfer, i as nativeGradleOutputs, n as gradleStateDirectories, o as validateGradleManifest, s as verifyGradleTransfer, t as gradleOffloadInputs } from "./native-gradle-inputs-Bep9JcSF.mjs";
16
- import { n as buildAndroid, o as gradlewPath, r as buildIos, u as assembleTaskFor } from "./react-native-build-rhk4smwQ.mjs";
17
- import { f as podAction } from "./support-Dlu37g6H.mjs";
18
- import { n as recordPrebuild, r as runPrebuild, t as planPrebuild } from "./prebuild-uD_ipCxF.mjs";
19
- import { n as buildAndroidOperation, t as buildIosOperation } from "./build-CoPzQRNw.mjs";
20
- import { r as stageBundle, t as resolveBundleExtras } from "./stage-BIS0ydsV.mjs";
21
- import { t as logLines } from "./run-D23HmJMs.mjs";
22
- import { r as nativeXcodeMetadataDirectories } from "./native-xcode-inputs-CB2iQeWq.mjs";
9
+ import { Fn as processContext } from "./budget-Cvwn54qV.mjs";
10
+ import { l as fingerprintProject, m as refingerprintAfterMutation } from "./build-cache-Dv7RN200.mjs";
11
+ import { n as CCACHE_UNAVAILABLE, o as resolveCcache } from "./ccache-Btwc36-I.mjs";
12
+ import { _ as clearCorruptCompilationCache, f as reactNativeArtifactReceipt, g as COMPILATION_CACHE_CORRUPT, m as reactNativeBuildQuery, p as reactNativeArtifactToolchain } from "./client-OyRoEuSr.mjs";
13
+ import { f as workerToolchain, h as readPodState, i as availableIphone, m as podsAreStale, v as runPodInstall } from "./toolchain-DpJMHq0n.mjs";
14
+ import { n as fingerprintNativeInputs, r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
15
+ import { a as sourceManifest, o as verifyNativeTransfer } from "./native-source-Y0yLhFyQ.mjs";
16
+ import { i as nativeGradleOutputs, n as gradleStateDirectories, o as validateGradleManifest, s as verifyGradleTransfer, t as gradleOffloadInputs } from "./native-gradle-inputs-Dnh84Zbd.mjs";
17
+ import { n as buildAndroid, o as gradlewPath, r as buildIos, u as assembleTaskFor } from "./react-native-build-Dvd8hC21.mjs";
18
+ import { f as podAction } from "./support-CNioewsd.mjs";
19
+ import { i as runPrebuild, r as recordPrebuild, t as planPrebuild } from "./prebuild-D4JoEAEs.mjs";
20
+ import { g as dumpApkManifest, p as apkPackage } from "./support-yUiOjnVY.mjs";
21
+ import { n as buildAndroidOperation, t as buildIosOperation } from "./build-CabC3G23.mjs";
22
+ import { i as stageBundle, n as resolveBundleExtras } from "./stage-Bps5oius.mjs";
23
+ import { t as logLines } from "./run-DidHghD1.mjs";
24
+ import { r as nativeXcodeMetadataDirectories } from "./native-xcode-inputs-D_VOfFL7.mjs";
25
+ import { n as swiftpmArtifactInputs, r as swiftpmArtifactSnapshot, t as readSwiftpmArtifactToolchain } from "./swiftpm-artifact-inputs-DFcGsXDP.mjs";
26
+ import { a as nativeGradleWorkerArtifactIdentity, i as nativeGradleArtifactSnapshotFromReceipt, o as nativeGradleWorkerScope } from "./native-gradle-artifact-inputs-DHFnmrVf.mjs";
23
27
  import { createHash } from "node:crypto";
24
28
  import { chmodSync, constants, copyFileSync, cpSync, createReadStream, createWriteStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
25
- import { basename, dirname, join, sep } from "node:path";
26
- import { withAmbientContext } from "@stim-cli/core";
29
+ import { isDeepStrictEqual } from "node:util";
30
+ import { basename, dirname, join, relative, resolve, sep } from "node:path";
31
+ import { dependencyInstall, withAmbientContext } from "@stim-cli/core";
27
32
  import { isJsonObject, windowsShortDir, windowsShortDirKey } from "@stim-cli/core/state";
33
+ import { realpath } from "node:fs/promises";
28
34
  import { pipeline } from "node:stream/promises";
29
35
  import { createGzip } from "node:zlib";
36
+ //#region src/offload/swiftpm-artifact.ts
37
+ async function readSwiftpmWorkerToolchain(context, cwd) {
38
+ const commandPath = async (name) => {
39
+ const path = getExecutor().findExecutable(name, {
40
+ cwd,
41
+ env: context.env
42
+ });
43
+ if (!path) throw new Error(`The SwiftPM tool ${name} is unavailable.`);
44
+ return realpath(path);
45
+ };
46
+ const [selected, xcrun, xcodebuild] = await Promise.all([
47
+ commandPath("swift"),
48
+ commandPath("xcrun"),
49
+ commandPath("xcodebuild")
50
+ ]);
51
+ const compiler = await realpath(await getExecutor().runFileAsync("/usr/bin/xcrun", ["--find", "swift"], {
52
+ cwd,
53
+ timeoutMs: 3e4
54
+ }));
55
+ const sdk = await realpath(context.env.SDKROOT ?? context.env.SWIFTPM_SDKROOT_macosx ?? await getExecutor().runFileAsync("/usr/bin/xcrun", [
56
+ "--sdk",
57
+ "macosx",
58
+ "--show-sdk-path"
59
+ ], {
60
+ cwd,
61
+ timeoutMs: 3e4
62
+ }));
63
+ const overrides = {};
64
+ for (const variable of ["SWIFT_EXEC", "SWIFT_EXEC_MANIFEST"]) {
65
+ const command = context.env[variable];
66
+ if (!command) continue;
67
+ const version = await getExecutor().runFileAsync(command, ["--version"], {
68
+ cwd,
69
+ timeoutMs: 3e4,
70
+ declareFor: context
71
+ });
72
+ if (!version.trim()) throw new Error(`The SwiftPM ${variable} compiler identity is unavailable.`);
73
+ overrides[variable] = {
74
+ command: await commandPath(command),
75
+ version
76
+ };
77
+ }
78
+ const checkoutRequired = Object.keys(overrides).length > 0 || selected !== await realpath("/usr/bin/swift") && selected !== compiler || xcrun !== await realpath("/usr/bin/xcrun") || xcodebuild !== await realpath("/usr/bin/xcodebuild");
79
+ return {
80
+ ...await readSwiftpmArtifactToolchain(context, void 0, cwd),
81
+ selection: {
82
+ command: selected,
83
+ compiler,
84
+ sdk,
85
+ xcrun,
86
+ xcodebuild,
87
+ overrides,
88
+ checkoutRequired
89
+ }
90
+ };
91
+ }
92
+ async function privateSnapshot(root, query, privateLockfile, toolchain, env, signal) {
93
+ const repository = resolve(root, ...query.project.split("/").filter(Boolean).map(() => ".."));
94
+ const declaration = swiftpmArtifactInputs(query.inputs);
95
+ return (await fingerprintNativeInputs([
96
+ ...declaration.ignored.map((path) => ({
97
+ name: `ignored/${path}`,
98
+ path: join(repository, path)
99
+ })),
100
+ ...declaration.localFiles.map((path, index) => ({
101
+ name: `local/${index}`,
102
+ path: resolve(root, path),
103
+ optional: true
104
+ })),
105
+ ...privateLockfile ? [{
106
+ name: "package-resolved",
107
+ path: join(root, "Package.resolved"),
108
+ optional: true
109
+ }] : []
110
+ ], {
111
+ parameters: {
112
+ toolchain,
113
+ environment: Object.fromEntries([.../* @__PURE__ */ new Set([
114
+ ...declaration.environment,
115
+ "DEVELOPER_DIR",
116
+ "TOOLCHAINS",
117
+ "SDKROOT",
118
+ "SWIFT_EXEC",
119
+ "MACOSX_DEPLOYMENT_TARGET"
120
+ ])].toSorted().map((name) => [name, env[name] ?? null]))
121
+ },
122
+ signal
123
+ })).hash;
124
+ }
125
+ /** Certifies actual worker inputs, not the client's transfer digest or cache identity. */
126
+ async function swiftpmWorkerArtifactSnapshot(root, query, toolchain, env, signal) {
127
+ signal?.throwIfAborted();
128
+ root = await realpath(root);
129
+ const repository = await realpath(await gitAsync(root, ["rev-parse", "--show-toplevel"], { signal }));
130
+ const project = relative(repository, await realpath(root)).split(sep).join("/");
131
+ const visible = await sourceManifest(repository, true, signal);
132
+ if (query.project !== project || manifestDigest(visible) !== query.sourceDigest) throw new Error("The SwiftPM worker source does not match its completed transfer.");
133
+ const declaration = swiftpmArtifactInputs(query.inputs);
134
+ const build = {
135
+ ...query.build,
136
+ resources: Object.fromEntries(Object.entries(query.build.resources).map(([name, path]) => [name, relative(root, resolve(repository, path))])),
137
+ assetCatalog: query.build.assetCatalog ? relative(root, resolve(repository, query.build.assetCatalog)) : null
138
+ };
139
+ const snapshot = await swiftpmArtifactSnapshot(root, declaration, build, {
140
+ swift: toolchain.swift,
141
+ sdk: toolchain.sdk,
142
+ xcode: toolchain.xcode,
143
+ arch: toolchain.arch
144
+ }, env, signal);
145
+ const sourcePaths = new Set(visible.map((file) => file.path));
146
+ const privatePaths = /* @__PURE__ */ new Set([...declaration.ignored.map((path) => resolve(repository, path)), ...declaration.localFiles.map((path) => resolve(root, path))]);
147
+ for (const path of [
148
+ build.infoPlist,
149
+ ...Object.values(build.resources),
150
+ build.assetCatalog
151
+ ]) {
152
+ if (path === null) continue;
153
+ const absolute = resolve(root, path);
154
+ const bundled = await fingerprintNativeInputs([{
155
+ name: "bundle",
156
+ path: absolute
157
+ }], {
158
+ parameters: null,
159
+ signal
160
+ });
161
+ for (const entry of bundled.entries) {
162
+ if (entry.kind === "directory") continue;
163
+ const file = join(absolute, entry.path === "bundle" ? "" : entry.path.slice(7));
164
+ const name = relative(repository, file).split(sep).join("/");
165
+ if (!entry.kind.startsWith("file:") || !sourcePaths.has(name) && !privatePaths.has(file)) throw new Error("SwiftPM peer caching requires every ignored bundle file in the private input declaration.");
166
+ }
167
+ }
168
+ const privateLockfile = !sourcePaths.has([project, "Package.resolved"].filter(Boolean).join("/"));
169
+ const privateHash = await privateSnapshot(root, query, privateLockfile, toolchain, env, signal);
170
+ const hash = createHash("sha256").update(JSON.stringify([
171
+ "stim-swiftpm-worker-v1",
172
+ snapshot.hash,
173
+ query,
174
+ privateHash
175
+ ])).digest("hex");
176
+ const identity = {
177
+ hash,
178
+ key: `swiftpm-peer-${hash}`
179
+ };
180
+ return {
181
+ identity,
182
+ receipt: {
183
+ query: structuredClone(query),
184
+ identity,
185
+ privateHash,
186
+ privateLockfile,
187
+ checkoutRequired: toolchain.selection.checkoutRequired
188
+ }
189
+ };
190
+ }
191
+ /** Revalidates private inputs of a receipt bound to a verified completed source transfer. */
192
+ async function swiftpmArtifactFromReceipt(root, query, receipt, toolchain, env, signal) {
193
+ signal?.throwIfAborted();
194
+ if (!isDeepStrictEqual(query, receipt.query) || typeof receipt.checkoutRequired !== "boolean" || receipt.checkoutRequired !== toolchain.selection.checkoutRequired || !/^[a-f0-9]{64}$/.test(receipt.identity.hash) || receipt.identity.key !== `swiftpm-peer-${receipt.identity.hash}`) return null;
195
+ return await privateSnapshot(root, query, receipt.privateLockfile, toolchain, env, signal) === receipt.privateHash ? receipt.identity : null;
196
+ }
197
+ //#endregion
30
198
  //#region src/offload/worker.ts
31
199
  function emit(value) {
32
200
  process.stdout.write(`${JSON.stringify(value)}\n`);
@@ -316,42 +484,18 @@ async function materialize(job, src) {
316
484
  removed
317
485
  };
318
486
  }
319
- function lockfileOf(src) {
320
- if (existsSync(join(src, "pnpm-lock.yaml"))) return {
321
- file: "pnpm-lock.yaml",
322
- command: "pnpm",
323
- args: (pkg) => [
324
- "install",
325
- "--frozen-lockfile",
326
- ...pkg ? ["--filter", `${pkg}...`] : []
327
- ]
328
- };
329
- if (existsSync(join(src, "yarn.lock"))) return {
330
- file: "yarn.lock",
331
- command: "yarn",
332
- args: () => ["install", "--frozen-lockfile"]
333
- };
334
- if (existsSync(join(src, "package-lock.json"))) return {
335
- file: "package-lock.json",
336
- command: "npm",
337
- args: () => ["ci"]
338
- };
339
- return null;
340
- }
341
487
  /** Installs JavaScript dependencies when the lockfile, or the install command, changed since the last install. */
342
488
  async function ensureDependencies(job, src) {
343
- const lock = lockfileOf(src);
344
- if (!lock) return;
345
- const args = lock.args(job.packageName);
346
- const lockfile = readFileSync(join(src, lock.file));
347
- const digest = createHash("sha256").update(lockfile).update(JSON.stringify(args)).digest("hex");
489
+ const install = dependencyInstall(src, job.packageName);
490
+ if (!install) return;
491
+ const { command, args, digest, lockfile } = install;
348
492
  const marker = join(job.area, "dependencies");
349
- const installed = () => writeFileSync(join(job.area, "lockfile"), createHash("sha256").update(lockfile).digest("hex"));
493
+ const installed = () => writeFileSync(join(job.area, "lockfile"), lockfile);
350
494
  if (existsSync(join(src, job.project, "node_modules")) && existsSync(marker)) {
351
495
  if (readFileSync(marker, "utf8") === digest) return installed();
352
496
  }
353
- note("deps", `${lock.command} ${args.join(" ")}`);
354
- const child = getExecutor().spawn(lock.command, args, {
497
+ note("deps", `${command} ${args.join(" ")}`);
498
+ const child = getExecutor().spawn(command, args, {
355
499
  cwd: src,
356
500
  env: {
357
501
  ...process.env,
@@ -374,7 +518,7 @@ async function ensureDependencies(job, src) {
374
518
  child.on("error", reject);
375
519
  child.on("exit", resolve);
376
520
  });
377
- if (code !== 0) throw new Error(`${lock.command} ${args.join(" ")} exited with ${code}: ${tail.join(" | ")}`);
521
+ if (code !== 0) throw new Error(`${command} ${args.join(" ")} exited with ${code}: ${tail.join(" | ")}`);
378
522
  writeFileSync(marker, digest);
379
523
  installed();
380
524
  }
@@ -390,7 +534,7 @@ function destination(runtime) {
390
534
  "devices",
391
535
  "available",
392
536
  "-j"
393
- ], { timeoutMs: 2e4 }) ?? "{}").devices?.[runtime] ?? []).find((each) => each.name.startsWith("iPhone"));
537
+ ], { timeoutMs: 2e4 }) ?? "{}").devices?.[runtime] ?? []).find(availableIphone);
394
538
  return device ? `id=${device.udid}` : null;
395
539
  } catch {
396
540
  return null;
@@ -487,17 +631,7 @@ async function build(job) {
487
631
  compiled = await compileNativeAndroid(job, root, log, time);
488
632
  if (!compiled.ok) return failed(compiled.code, compiled.message);
489
633
  try {
490
- const model = JSON.parse(readFileSync(join(workspaceDir(root), "gradle-build", `native-apk-${encodeURIComponent(job.android?.variant ?? "debug")}.json`), "utf8"));
491
- const outputs = await nativeGradleOutputs(src, job.native.inputs, model.buildDirectories);
492
634
  if (!await verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) throw new Error("The native source changed while the worker compiled it.");
493
- const directories = [...outputs, ...gradleStateDirectories(job.project).filter((path) => lstatSync(join(src, path), { throwIfNoEntry: false })?.isDirectory())];
494
- const receipt = join(job.area, "gradle-outputs.json");
495
- const tmp = `${receipt}.${process.pid}.tmp`;
496
- writeFileSync(tmp, JSON.stringify({
497
- project: job.project,
498
- directories
499
- }));
500
- renameSync(tmp, receipt);
501
635
  } catch (error) {
502
636
  if (compiled.temporary) rmSync(compiled.temporary, {
503
637
  recursive: true,
@@ -606,6 +740,9 @@ async function build(job) {
606
740
  if (mutations.includes("prebuild")) recordPrebuild(realRoot, platform, after.hash);
607
741
  }
608
742
  if (fingerprint !== job.expectedFingerprint) return failed("fingerprint-mismatch", `the checkout there fingerprints ${fingerprint.slice(0, 12)}, here ${job.expectedFingerprint?.slice(0, 12)}`);
743
+ const tools = job.cacheArtifact ? await reactNativeArtifactToolchain(platform, realRoot) : null;
744
+ const query = tools ? reactNativeBuildQuery(job, fingerprint, job.project, tools) : null;
745
+ const receipt = query ? reactNativeArtifactReceipt(query, tools) : null;
609
746
  compiled = platform === "android" ? await compileAndroid(job, realRoot, log, time, androidLayout) : await compileIos(job, realRoot, log, time);
610
747
  if (!compiled.ok) return failed(compiled.code, compiled.message);
611
748
  const builtFingerprint = fingerprint;
@@ -617,6 +754,8 @@ async function build(job) {
617
754
  androidLayout
618
755
  }));
619
756
  if (!settled || settled.moved) return failed("fingerprint-moved", "The inputs changed during the build there.");
757
+ const after = query && receipt ? reactNativeArtifactReceipt(query, await reactNativeArtifactToolchain(platform, realRoot)) : null;
758
+ if (receipt && after && isDeepStrictEqual(receipt, after)) compiled.reactNativeArtifact = receipt;
620
759
  }
621
760
  try {
622
761
  const out = join(job.area, "out", job.job);
@@ -645,6 +784,9 @@ async function build(job) {
645
784
  fingerprint,
646
785
  ...compiled.androidPackage ? { androidPackage: compiled.androidPackage } : {},
647
786
  ...job.native ? { sourceDigest: job.native.sourceDigest } : {},
787
+ ...compiled.cacheArtifact ? { cacheArtifact: compiled.cacheArtifact } : {},
788
+ ...compiled.reactNativeArtifact ? { reactNativeArtifact: compiled.reactNativeArtifact } : {},
789
+ ...compiled.swiftpmArtifact ? { swiftpmArtifact: compiled.swiftpmArtifact } : {},
648
790
  compilationCache: compiled.cache,
649
791
  timings
650
792
  };
@@ -771,6 +913,25 @@ async function compileNativeIos(job, root, log, time) {
771
913
  if (existsSync(logFile)) for (const record of parseNdjsonText(readFileSync(logFile, "utf8"))) log.write(record);
772
914
  }
773
915
  }
916
+ async function validateNativeAndroidOutputs(job, root) {
917
+ if (job.native?.provider !== "gradle") throw new Error("A native Gradle source declaration is required.");
918
+ try {
919
+ const src = realpathSync(join(job.area, "src"));
920
+ const model = JSON.parse(readFileSync(join(workspaceDir(root), "gradle-build", `native-apk-${encodeURIComponent(job.android?.variant ?? "debug")}.json`), "utf8"));
921
+ const outputs = await nativeGradleOutputs(src, job.native.inputs, model.buildDirectories);
922
+ if (!await verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) throw new Error("The native source changed while the worker compiled it.");
923
+ const directories = [...outputs, ...gradleStateDirectories(job.project).filter((path) => lstatSync(join(src, path), { throwIfNoEntry: false })?.isDirectory())];
924
+ const receipt = join(job.area, "gradle-outputs.json");
925
+ const tmp = `${receipt}.${process.pid}.tmp`;
926
+ writeFileSync(tmp, JSON.stringify({
927
+ project: job.project,
928
+ directories
929
+ }));
930
+ renameSync(tmp, receipt);
931
+ } catch (error) {
932
+ throw Object.assign(new Error(error.message), { code: "source-moved" });
933
+ }
934
+ }
774
935
  async function compileNativeAndroid(job, root, log, time) {
775
936
  const options = job.android;
776
937
  if (!options) return {
@@ -795,6 +956,7 @@ async function compileNativeAndroid(job, root, log, time) {
795
956
  };
796
957
  process.once("SIGTERM", stop);
797
958
  const logFile = join(workspaceLogsDir$1(root), "build-android.ndjson");
959
+ let cacheArtifact;
798
960
  note("build", `native Gradle ${options.variant ?? "debug"}`);
799
961
  try {
800
962
  rmSync(logFile, { force: true });
@@ -802,16 +964,32 @@ async function compileNativeAndroid(job, root, log, time) {
802
964
  variant: options.variant ?? void 0,
803
965
  abi: options.abi ?? "all",
804
966
  remoteBuild: "local"
805
- }, { cacheArtifacts: false })));
806
- if (built.cacheKey !== null || !built.cacheSkipped || !built.androidPackage) {
967
+ }, {
968
+ cachePolicy: job.native?.provider === "gradle" && job.native.cache ? job.native.cache : {
969
+ read: false,
970
+ write: false,
971
+ remote: false
972
+ },
973
+ artifactScope: {
974
+ key: job.native?.provider === "gradle" ? nativeGradleWorkerScope(job.native.sourceDigest, job.native.inputs) : "null",
975
+ validate: () => validateNativeAndroidOutputs(job, root),
976
+ record: (identity, receipt) => {
977
+ cacheArtifact = {
978
+ identity,
979
+ receipt
980
+ };
981
+ }
982
+ }
983
+ })));
984
+ if (!built.androidPackage) {
807
985
  rmSync(dirname(built.apkPath), {
808
986
  recursive: true,
809
987
  force: true
810
988
  });
811
989
  return {
812
990
  ok: false,
813
- code: "unexpected-cache-identity",
814
- message: "The native Gradle worker returned an unsupported artifact identity or package."
991
+ code: "invalid-package",
992
+ message: "The native Gradle worker returned no verified APK package."
815
993
  };
816
994
  }
817
995
  return {
@@ -819,12 +997,13 @@ async function compileNativeAndroid(job, root, log, time) {
819
997
  path: built.apkPath,
820
998
  temporary: dirname(built.apkPath),
821
999
  cache: built.ccache,
822
- androidPackage: built.androidPackage
1000
+ androidPackage: built.androidPackage,
1001
+ ...cacheArtifact && cacheArtifact.identity.key === built.cacheKey ? { cacheArtifact } : {}
823
1002
  };
824
1003
  } catch (error) {
825
1004
  return {
826
1005
  ok: false,
827
- code: "native-build-failed",
1006
+ code: error instanceof Error && "code" in error && error.code === "source-moved" ? "source-moved" : "native-build-failed",
828
1007
  message: error.message
829
1008
  };
830
1009
  } finally {
@@ -880,6 +1059,26 @@ async function compileMacos(context, job, root, log, time) {
880
1059
  };
881
1060
  try {
882
1061
  const extras = resolveBundleExtras(src, src, options.resources, options.assetCatalog);
1062
+ const query = job.cacheArtifact && options.artifactInputs && job.expectedFingerprint && job.stimBuild ? {
1063
+ project: job.project,
1064
+ sourceDigest: job.expectedFingerprint,
1065
+ stimBuild: job.stimBuild,
1066
+ inputs: options.artifactInputs,
1067
+ build: {
1068
+ product: options.product,
1069
+ infoPlist: options.infoPlist,
1070
+ resources: options.resources ?? {},
1071
+ assetCatalog: options.assetCatalog ?? null
1072
+ }
1073
+ } : null;
1074
+ const snapshot = async () => query ? swiftpmWorkerArtifactSnapshot(root, query, await readSwiftpmWorkerToolchain(context, root), context.env) : null;
1075
+ let before = null;
1076
+ try {
1077
+ before = await snapshot();
1078
+ } catch (error) {
1079
+ context.signal.throwIfAborted();
1080
+ note("build", `SwiftPM artifact inventory unavailable: ${String(error)}`);
1081
+ }
883
1082
  return await time("buildMs", async () => {
884
1083
  await run([
885
1084
  "build",
@@ -904,10 +1103,20 @@ async function compileMacos(context, job, root, log, time) {
904
1103
  ], true);
905
1104
  const bundle = join(job.area, "out", job.job, `${options.product}.app`);
906
1105
  await stageBundle(context, root, options.product, options.infoPlist, bin, bundle, options.bundleId, extras);
1106
+ let swiftpmArtifact = null;
1107
+ if (before) try {
1108
+ const after = await snapshot();
1109
+ if (after?.identity.hash === before.identity.hash) swiftpmArtifact = after;
1110
+ else note("build", "SwiftPM inputs changed during the build; not retaining its artifact.");
1111
+ } catch (error) {
1112
+ context.signal.throwIfAborted();
1113
+ note("build", `SwiftPM artifact inventory skipped: ${String(error)}`);
1114
+ }
907
1115
  return {
908
1116
  ok: true,
909
1117
  path: bundle,
910
- cache: {}
1118
+ cache: {},
1119
+ ...swiftpmArtifact ? { swiftpmArtifact } : {}
911
1120
  };
912
1121
  });
913
1122
  } catch (error) {
@@ -940,7 +1149,7 @@ async function compileIos(job, root, log, time) {
940
1149
  }));
941
1150
  if (!built.ok) {
942
1151
  if (built.compilationCacheCorruption) {
943
- const report = clearCorruptCompilationCache(built.compilationCacheCorruption, root);
1152
+ const report = await clearCorruptCompilationCache(built.compilationCacheCorruption, root);
944
1153
  return {
945
1154
  ok: false,
946
1155
  code: report.code,
@@ -1030,10 +1239,12 @@ async function compileAndroid(job, root, log, time, layout) {
1030
1239
  message: first ?? (built.lastLines.slice(-3).join(" | ") || built.reason)
1031
1240
  };
1032
1241
  }
1242
+ const androidPackage = built.androidPackage ?? apkPackage(await dumpApkManifest(built.apkPath));
1033
1243
  return {
1034
1244
  ok: true,
1035
1245
  path: built.apkPath,
1036
- cache: built.ccache ?? CCACHE_UNAVAILABLE
1246
+ cache: built.ccache ?? CCACHE_UNAVAILABLE,
1247
+ ...androidPackage ? { androidPackage } : {}
1037
1248
  };
1038
1249
  } finally {
1039
1250
  process.off("SIGTERM", stop);
@@ -1045,6 +1256,27 @@ async function main() {
1045
1256
  if (mode === "offer") return emit(workerToolchain(process.argv[3] ?? null));
1046
1257
  if (mode === "offer-native-xcode") return emit(workerToolchain(null, "xcode"));
1047
1258
  if (mode === "offer-native-gradle") return emit(workerToolchain(null, "gradle"));
1259
+ if (mode === "native-gradle-artifact") {
1260
+ const chunks = [];
1261
+ for await (const chunk of process.stdin) chunks.push(chunk);
1262
+ const input = JSON.parse(Buffer.concat(chunks).toString("utf8"));
1263
+ if (!/^[a-f0-9]{64}$/.test(input.sourceDigest)) throw new Error("The completed transfer identity is invalid.");
1264
+ gradleOffloadInputs(input.inputs);
1265
+ if (input.android) {
1266
+ const { android, receipt } = input;
1267
+ if (android.variant !== null && android.variant !== receipt.build.variant || (android.abi === "all" ? null : android.abi) !== receipt.abi || android.compilerCache !== receipt.build.compilerCache || android.gradleBuildCache !== receipt.build.gradleBuildCache || android.pch !== receipt.build.pch || receipt.build.cas !== null) throw new Error("The completed Gradle build choices do not match this artifact request.");
1268
+ }
1269
+ const snapshot = await workerOperation(input.root, (context) => nativeGradleArtifactSnapshotFromReceipt(input.root, input.receipt, context.env, context.signal));
1270
+ return emit({ identity: nativeGradleWorkerArtifactIdentity(snapshot.hash, nativeGradleWorkerScope(input.sourceDigest, input.inputs), input.receipt.build.variant ?? "debug", input.receipt.abi) });
1271
+ }
1272
+ if (mode === "swiftpm-artifact") {
1273
+ const chunks = [];
1274
+ for await (const chunk of process.stdin) chunks.push(chunk);
1275
+ const input = JSON.parse(Buffer.concat(chunks).toString("utf8"));
1276
+ const checkout = existsSync(input.root);
1277
+ if (!checkout && input.receipt.checkoutRequired !== false) return emit({ identity: null });
1278
+ return emit({ identity: await workerOperation(input.root, async (context) => swiftpmArtifactFromReceipt(input.root, input.query, input.receipt, await readSwiftpmWorkerToolchain(context, checkout ? input.root : process.cwd()), context.env)) });
1279
+ }
1048
1280
  if (mode === "build") {
1049
1281
  const chunks = [];
1050
1282
  for await (const chunk of process.stdin) chunks.push(chunk);
@@ -1053,7 +1285,7 @@ async function main() {
1053
1285
  ...await build(JSON.parse(Buffer.concat(chunks).toString("utf8")))
1054
1286
  });
1055
1287
  }
1056
- process.stderr.write("usage: offload-worker offer | offer-native-xcode | offer-native-gradle | build < job.json\n");
1288
+ process.stderr.write("usage: offload-worker offer | offer-native-xcode | offer-native-gradle | native-gradle-artifact | build < job.json\n");
1057
1289
  process.exitCode = 2;
1058
1290
  }
1059
1291
  main().catch((error) => {