stim 1.20.2 → 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.
- package/README.md +141 -8
- package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
- package/dist/act-DsuqEkiM.mjs +2801 -0
- package/dist/activity-CMLmzp7o.mjs +1397 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
- package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
- package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
- package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
- package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/android-project-DVWyCbWU.d.mts +391 -0
- package/dist/api.d.mts +810 -64
- package/dist/api.mjs +782 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
- package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
- package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
- package/dist/budget-Cvwn54qV.mjs +9285 -0
- package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
- package/dist/build-cache-Dv7RN200.mjs +602 -0
- package/dist/build-plan-DUC8Ka9y.mjs +248 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-OyRoEuSr.mjs +1577 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
- package/dist/config-DlrsduwG.mjs +955 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
- package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
- package/dist/device-DklWZLqb.mjs +1068 -0
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
- package/dist/device-host-worker.mjs +76 -79
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
- package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
- package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
- package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/doctor-thjWAV0z.mjs +2 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
- package/dist/exec-DEoAhcze.mjs +858 -0
- package/dist/exec-DnYc4HGH.d.mts +78 -0
- package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
- package/dist/gc-DnNDQyaP.mjs +3 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
- package/dist/idle-C4cZ757K.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
- package/dist/ios-CDvlmUs7.d.mts +24 -0
- package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
- package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
- package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
- package/dist/ios-signing-BtAffm0A.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
- package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
- package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
- package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
- package/dist/logs-BfwwadsZ.mjs +479 -0
- package/dist/logs-jTS_lHSo.mjs +248 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
- package/dist/macos-NfV2D7dO.mjs +694 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +123 -248
- package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
- package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
- package/dist/native-android-CqgnOgsT.mjs +645 -0
- package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-NwUuxbkg.mjs +276 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
- package/dist/native-source-Y0yLhFyQ.mjs +133 -0
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +59 -41
- package/dist/offload-worker.mjs +478 -115
- package/dist/operation-exec-BW0em61G.mjs +171 -0
- package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
- package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
- package/dist/prebuild-D4JoEAEs.mjs +484 -0
- package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
- package/dist/pull-request-eODyIqZF.d.mts +124 -0
- package/dist/pull-requests.d.mts +2 -120
- package/dist/pull-requests.mjs +2 -2
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
- package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
- package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
- package/dist/registration-BcRgF6Ox.mjs +51 -0
- package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
- package/dist/reload-D7AVlb8N.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
- package/dist/result-D2Ykz_iD.mjs +435 -0
- package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
- package/dist/selection-DSMbWEX2.mjs +620 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
- package/dist/server-expo-D58c9L0M.mjs +2 -0
- package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
- package/dist/settings-DpR-1Wnn.mjs +114 -0
- package/dist/settings-write-CzD60rOD.mjs +360 -0
- package/dist/settings.schema.json +176 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-Bps5oius.mjs +200 -0
- package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
- package/dist/start-EojN4WFz.mjs +1364 -0
- package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
- package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
- package/dist/stats-report-BzaPrRm6.mjs +16 -0
- package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
- package/dist/status-EvrK72L2.mjs +2 -0
- package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
- package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
- package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +56 -28
- package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
- package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
- package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
- package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
- package/dist/toolchain-BY8X8HXx.mjs +2 -0
- package/dist/toolchain-DpJMHq0n.mjs +876 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
- package/dist/trigger-yb_nFzPF.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
- package/dist/web-CZ07gd77.mjs +2 -0
- package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
- package/dist/web-run.mjs +13 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
- package/dist/worktree-ZqZVjD9K.mjs +2 -0
- package/dist/xcode-BXn9-xYx.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-audio/Main.java +24 -0
- package/shim/android-audio/README.md +17 -0
- package/shim/android-audio.jar +0 -0
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/macos-Ch5VJmcS.mjs +0 -584
- package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/settings-vk3mJGSm.d.mts +0 -13
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/start-BWqzODpb.mjs +0 -1116
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { v as withDirLock$1, y as withDirLockAsync$1 } from "./paths-DQtTgsBf.mjs";
|
|
2
|
+
import { d as getConfigDir } from "./config-DlrsduwG.mjs";
|
|
3
3
|
import { renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { createdDevicesFile, createdDevicesLock, readCreatedDevices, readCreatedDevices as readCreatedDevices$1 } from "@stim-cli/core/state";
|
|
5
4
|
import { ensurePrivateDir } from "@stim-cli/core";
|
|
5
|
+
import { createdDevicesFile, createdDevicesLock, readCreatedDevices, readCreatedDevices as readCreatedDevices$1 } from "@stim-cli/core/state";
|
|
6
6
|
//#region src/devices/created-devices.ts
|
|
7
7
|
function update(platform, change) {
|
|
8
8
|
const dir = getConfigDir();
|
|
@@ -34,5 +34,15 @@ 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 atomically forgets the device. The synchronous transaction decides whether to commit the removal; cancellation stops admission. */
|
|
38
|
+
function forgetCreatedDeviceAsync(platform, id, signal, transaction = (forget) => {
|
|
39
|
+
forget();
|
|
40
|
+
return true;
|
|
41
|
+
}) {
|
|
42
|
+
return withDirLockAsync$1(createdDevicesLock(), () => transaction(() => forgetCreatedDevice(platform, id)), {
|
|
43
|
+
ensureParent: () => ensurePrivateDir(getConfigDir()),
|
|
44
|
+
signal
|
|
45
|
+
});
|
|
46
|
+
}
|
|
37
47
|
//#endregion
|
|
38
|
-
export {
|
|
48
|
+
export { recordCreatedDevice as i, forgetCreatedDeviceAsync as n, readCreatedDevices$1 as r, forgetCreatedDevice as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { Mt as repoRoot } from "./settings-C7O8A6ZI.mjs";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative } from "node:path";
|
|
5
5
|
//#region src/dependency-state.ts
|
|
@@ -19,6 +19,22 @@ function installedNpmTreeIsValid(projectRoot) {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
async function installedNpmTreeIsValidAsync(projectRoot) {
|
|
23
|
+
try {
|
|
24
|
+
await getExecutor().runFileAsync("npm", [
|
|
25
|
+
"ls",
|
|
26
|
+
"--all",
|
|
27
|
+
"--json",
|
|
28
|
+
"--silent"
|
|
29
|
+
], {
|
|
30
|
+
cwd: projectRoot,
|
|
31
|
+
timeoutMs: 3e4
|
|
32
|
+
});
|
|
33
|
+
return true;
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
22
38
|
const DEPENDENCY_STATES = [
|
|
23
39
|
{
|
|
24
40
|
lock: "pnpm-lock.yaml",
|
|
@@ -50,8 +66,7 @@ const DEPENDENCY_STATES = [
|
|
|
50
66
|
command: "npm ci"
|
|
51
67
|
}
|
|
52
68
|
];
|
|
53
|
-
function dependencyState(projectRoot) {
|
|
54
|
-
const root = repoRoot(projectRoot) ?? projectRoot;
|
|
69
|
+
function dependencyState(projectRoot, root = repoRoot(projectRoot) ?? projectRoot) {
|
|
55
70
|
let dir = projectRoot;
|
|
56
71
|
while (true) {
|
|
57
72
|
const state = DEPENDENCY_STATES.find((candidate) => existsSync(join(dir, candidate.lock)));
|
|
@@ -73,4 +88,4 @@ function hasInstalledDependencies(projectRoot, markers = [
|
|
|
73
88
|
return markers.some((entry) => existsSync(join(projectRoot, entry)));
|
|
74
89
|
}
|
|
75
90
|
//#endregion
|
|
76
|
-
export { hasInstalledDependencies as n, installedNpmTreeIsValid as r, dependencyState as t };
|
|
91
|
+
export { installedNpmTreeIsValidAsync as i, hasInstalledDependencies as n, installedNpmTreeIsValid as r, dependencyState as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as resolvePackageJson, b as isPackageResolvable } from "./project-wM_XFTvE.mjs";
|
|
2
|
+
import { An as readBundleSchemes, kn as pickDevClientScheme } from "./budget-Cvwn54qV.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
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { l as
|
|
4
|
-
import { l as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as clearDeviceIdleShutdown } from "./idle-shutdown-
|
|
11
|
-
import { i as countLiveOwnedDevices,
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { D as withConfigLock, G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync, _ as loadConfig, a as clearDevice, b as releaseAndroidConsolePort, i as clearAndroidBootPending, j as acquireAvdClaim, t as allConsolePortsAndSerials, w as setDevice } from "./config-DlrsduwG.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-gwpm28fu.mjs";
|
|
4
|
+
import { l as androidDataPartitionSizeGbSetting, o as androidAvdConfigSetting } from "./settings-C7O8A6ZI.mjs";
|
|
5
|
+
import { s as ownedDeviceLabel } from "./project-wM_XFTvE.mjs";
|
|
6
|
+
import { c as pidExists } from "./metro-DiXtA3Ty.mjs";
|
|
7
|
+
import { A as teardownParkedAvd, D as teardownOwnedAvd } from "./workspaces-CpANmBlq.mjs";
|
|
8
|
+
import { A as listAdbDevices, B as ownedAvdDeviceProfile, F as listAvdsAsync, H as ownedAvdMatchesConfiguration, I as listInstalledSystemImages, K as ownedAvdSystemImage, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, _ as avdPoolConfiguration, _t as parkedMaxSetting, b as configureNewOwnedAvd, et as resolveOwnedAvdSerialAsync, f as assertOwnedAvdStopped, ft as adoptParked, ht as isLegacyDeletionClaim, j as listAdbDevicesAsync, n as OWNED_AVD_CONFIG_DEFAULTS, ot as waitForBoot, t as DEFAULT_AVD_DEVICE_PROFILE, vt as readParked, x as createOwnedAvd, y as bootAndroidEmulator, z as nextConsolePort } from "./android-C7sVmyI9.mjs";
|
|
9
|
+
import { I as memoryCulpritAdvice, N as memoryCulpritsUnder, P as readHostMemoryPressure, d as listAllIosSims } from "./ios-hcBpnEGk.mjs";
|
|
10
|
+
import { t as clearDeviceIdleShutdown } from "./idle-shutdown-DDg3SdvY.mjs";
|
|
11
|
+
import { i as countLiveOwnedDevices, m as withDeviceBootAdmission, n as DeviceAdmissionRefusal } from "./device-capacity-DK5_EwRS.mjs";
|
|
12
|
+
import { i as ensureOwnedIosDevice, r as ensureIosBooted } from "./device-ios-DoB6KFCO.mjs";
|
|
13
|
+
import { t as reconcileSimSlim } from "./simslim-BNckWpXi.mjs";
|
|
14
14
|
import { claimRemoveCommand, clearClaimChild, markClaimChildPending, processGroupAlive, releaseClaim, setClaimChild } from "@stim-cli/core/ownership-claim";
|
|
15
|
-
import { captureProcessIdentity } from "@stim-cli/core/process-identity";
|
|
16
15
|
import { randomUUID } from "node:crypto";
|
|
17
|
-
import
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
18
17
|
import { isDeepStrictEqual } from "node:util";
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
import { captureProcessIdentity } from "@stim-cli/core/process-identity";
|
|
20
|
+
import chalk from "chalk";
|
|
19
21
|
import { request } from "node:http";
|
|
20
22
|
//#region src/engine/metro-warmup.ts
|
|
21
23
|
const WARMUP_TIMEOUT_MS = 6e4;
|
|
@@ -93,7 +95,7 @@ function findOtherOwner(avdName, projectPath, selectedSlot = "default") {
|
|
|
93
95
|
return null;
|
|
94
96
|
}
|
|
95
97
|
async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, systemImage, deviceProfile, configuration, configure, teardown = teardownOwnedAvd }) {
|
|
96
|
-
const { claim, reservation, previous, avdName } =
|
|
98
|
+
const { claim, reservation, previous, avdName } = await withConfigLockAsync(() => {
|
|
97
99
|
const previous = deviceSlotPlatforms(loadConfig()?.projects?.[projectPath], slot)?.android;
|
|
98
100
|
if (previous?.avdName && previous.avdName !== previousAvdName) throw new Error(`Another Stim run assigned AVD ${previous.avdName} to this workspace. Retry to use it.`);
|
|
99
101
|
if (readParked("android").some((entry) => entry.name === ownedAvdName(label)) || findOtherOwner(ownedAvdName(label), projectPath, slot)) label = `${label}-${randomUUID().slice(0, 8)}`;
|
|
@@ -165,9 +167,9 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
|
|
|
165
167
|
const message = String(error?.message || error);
|
|
166
168
|
if (!message.includes("already exists")) throw error;
|
|
167
169
|
try {
|
|
168
|
-
if (!
|
|
169
|
-
|
|
170
|
-
const resolved =
|
|
170
|
+
if (!(await listAvdsAsync()).includes(avdName)) throw new AvdRecoveryError(`AVD ${avdName} already exists on disk but is not listed by the emulator. ${message}`, "Run `npx stim gc` to inspect orphaned owned AVDs, then `npx stim gc --delete` to reclaim those safe to delete. Retry `stim android` after cleanup; keep any AVD that GC cannot verify.", error);
|
|
171
|
+
await withConfigLockAsync(assertReservation);
|
|
172
|
+
const resolved = await resolveOwnedAvdSerialAsync(avdName);
|
|
171
173
|
if (resolved.missing || resolved.notOwned) throw new Error(`AVD ${avdName} could not be verified for recovery. Retry after checking its registration.`, { cause: error });
|
|
172
174
|
if (!resolved.serial) assertOwnedAvdStopped(avdName);
|
|
173
175
|
prepared = {
|
|
@@ -181,7 +183,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
|
|
|
181
183
|
} : {}
|
|
182
184
|
};
|
|
183
185
|
} catch (recoveryError) {
|
|
184
|
-
|
|
186
|
+
await withConfigLockAsync(() => {
|
|
185
187
|
if (!isDeepStrictEqual(currentRecord(), reservation)) return;
|
|
186
188
|
if (previous) setDevice(projectPath, "android", previous, slot);
|
|
187
189
|
else clearDevice(projectPath, "android", slot, avdName);
|
|
@@ -195,7 +197,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
|
|
|
195
197
|
} catch (error) {
|
|
196
198
|
configurationFailure = { error };
|
|
197
199
|
}
|
|
198
|
-
if (!configurationFailure)
|
|
200
|
+
if (!configurationFailure) await withConfigLockAsync(() => {
|
|
199
201
|
assertReservation();
|
|
200
202
|
setDevice(projectPath, "android", {
|
|
201
203
|
avdName,
|
|
@@ -218,7 +220,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
|
|
|
218
220
|
}
|
|
219
221
|
if (configurationFailure) {
|
|
220
222
|
const { error } = configurationFailure;
|
|
221
|
-
const cleanup = teardown(avdName, {
|
|
223
|
+
const cleanup = await teardown(avdName, {
|
|
222
224
|
del: true,
|
|
223
225
|
owner: {
|
|
224
226
|
projectPath,
|
|
@@ -248,7 +250,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
248
250
|
let replacedProfile = null;
|
|
249
251
|
if (record?.setupIncomplete && record.avdName) {
|
|
250
252
|
const avdName = record.avdName;
|
|
251
|
-
const cleanup = teardownAvd(avdName, {
|
|
253
|
+
const cleanup = await teardownAvd(avdName, {
|
|
252
254
|
del: true,
|
|
253
255
|
owner: {
|
|
254
256
|
projectPath,
|
|
@@ -268,7 +270,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
268
270
|
const avdName = record.avdName;
|
|
269
271
|
if (!record.bootPending) throw new AvdRecoveryError(`this project's emulator ${avdName} uses system image ${currentImage}, but ${requestedImage} was requested. --system-image replaces only an emulator that never finished a boot, and this one has.`, "Run `stim worktree remove` (or `stim gc --delete`) to reap the current emulator, then `stim android` again to create the requested one, or pass `--slot <name>` to create it beside the current one.");
|
|
270
272
|
replacedProfile = ownedAvdDeviceProfile(avdName);
|
|
271
|
-
const cleanup = teardownAvd(avdName, {
|
|
273
|
+
const cleanup = await teardownAvd(avdName, {
|
|
272
274
|
del: true,
|
|
273
275
|
owner: {
|
|
274
276
|
projectPath,
|
|
@@ -288,7 +290,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
288
290
|
const configurationBeforeDefaults = avdPoolConfiguration(androidDataPartitionSizeGbSetting(settings), projectAvdConfig, deviceProfile);
|
|
289
291
|
if (record?.avdName) {
|
|
290
292
|
if (record.owned) {
|
|
291
|
-
const resolved =
|
|
293
|
+
const resolved = await resolveOwnedAvdSerialAsync(record.avdName);
|
|
292
294
|
const currentProfile = resolved.notOwned || resolved.missing ? null : ownedAvdDeviceProfile(record.avdName);
|
|
293
295
|
if (requestedProfile && currentProfile && currentProfile !== requestedProfile) throw new AvdRecoveryError(`this project's emulator uses device profile ${currentProfile}, but ${requestedProfile} was requested. Stim will not silently boot a different model.`, "Run `stim worktree remove` (or `stim gc --delete`) to reap the current emulator, then `stim android` again to create the requested one, or pass `--slot <name>` to create it beside the current one.");
|
|
294
296
|
if (resolved.notOwned) note(chalk.yellow(`Note: recorded AVD ${record.avdName} is not Stim-owned -- creating a fresh owned AVD instead of reusing it.`));
|
|
@@ -326,8 +328,8 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
326
328
|
deviceProfile: currentProfile
|
|
327
329
|
};
|
|
328
330
|
}
|
|
329
|
-
} else if (
|
|
330
|
-
if (!
|
|
331
|
+
} else if ((await listAvdsAsync()).includes(record.avdName)) {
|
|
332
|
+
if (!(await listAdbDevicesAsync()).emulators.some((e) => e.consolePort === record.consolePort)) {
|
|
331
333
|
note(chalk.yellow(`Note: assigned AVD ${record.avdName} (emulator-${record.consolePort}) is shut down and is not owned by Stim, so it will not be booted automatically.`));
|
|
332
334
|
note(chalk.dim("Boot it yourself, or run `stim gc --delete` to clear the assignment so Stim can create an owned AVD."));
|
|
333
335
|
}
|
|
@@ -342,9 +344,9 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
342
344
|
const candidates = readParked("android").filter((entry) => entry.systemImage === systemImage && (entry.configuration === configuration || entry.configuration === configurationBeforeDefaults)).toSorted((a, b) => a.parkedAt.localeCompare(b.parkedAt));
|
|
343
345
|
for (const parked of candidates) {
|
|
344
346
|
if (isLegacyDeletionClaim(parked.deletionClaim)) continue;
|
|
345
|
-
const resolved =
|
|
347
|
+
const resolved = await resolveOwnedAvdSerialAsync(parked.name);
|
|
346
348
|
if (resolved.missing) {
|
|
347
|
-
const result = teardownParkedAvd(parked.name);
|
|
349
|
+
const result = await teardownParkedAvd(parked.name);
|
|
348
350
|
if (result.status === "failed") out(phaseLine("device", `kept ${parked.name}: ${result.reason}`));
|
|
349
351
|
continue;
|
|
350
352
|
}
|
|
@@ -356,7 +358,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
|
|
|
356
358
|
continue;
|
|
357
359
|
}
|
|
358
360
|
if (ownedAvdSystemImage(parked.name) !== systemImage || !ownedAvdMatchesConfiguration(parked.name, parked.configuration)) {
|
|
359
|
-
const result = teardownParkedAvd(parked.name);
|
|
361
|
+
const result = await teardownParkedAvd(parked.name);
|
|
360
362
|
if (result.status === "failed") out(phaseLine("device", `kept ${parked.name}: ${result.reason}`));
|
|
361
363
|
continue;
|
|
362
364
|
}
|
|
@@ -478,7 +480,7 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
|
|
|
478
480
|
const serial = `emulator-${claim.consolePort}`;
|
|
479
481
|
try {
|
|
480
482
|
reportAndroidMemoryPressure(out);
|
|
481
|
-
const pid = bootAndroidEmulator(avdName, claim.consolePort, { logFile });
|
|
483
|
+
const pid = await bootAndroidEmulator(avdName, claim.consolePort, { logFile });
|
|
482
484
|
out(chalk.dim(phaseLine("device", `waiting for ${serial} to finish booting`)));
|
|
483
485
|
const result = await waitForAndroidBoot({
|
|
484
486
|
serial,
|
|
@@ -488,9 +490,10 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
|
|
|
488
490
|
out
|
|
489
491
|
});
|
|
490
492
|
if (result.failed) throw new AvdBootError(result.reason, result.remedy);
|
|
491
|
-
const running =
|
|
493
|
+
const running = await getAvdNameForSerialAsync(serial);
|
|
492
494
|
if (running && running !== avdName) throw new Error(`${serial} is running AVD ${running}, not this workspace's owned AVD ${avdName}; refusing to use it.`);
|
|
493
495
|
clearAndroidBootPending(projectPath, avdName, slot);
|
|
496
|
+
await muteBootedEmulator(serial, avdName, out);
|
|
494
497
|
const { bootPending: _booted, ...booted } = claim;
|
|
495
498
|
return {
|
|
496
499
|
...booted,
|
|
@@ -507,6 +510,59 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
|
|
|
507
510
|
out
|
|
508
511
|
});
|
|
509
512
|
}
|
|
513
|
+
async function muteBootedEmulator(serial, avdName, out) {
|
|
514
|
+
const exec = getExecutor();
|
|
515
|
+
try {
|
|
516
|
+
const helper = ["../shim/android-audio.jar", "../../shim/android-audio.jar"].map((path) => fileURLToPath(new URL(path, import.meta.url))).find(existsSync);
|
|
517
|
+
if (!helper) throw new Error("Stim installation is missing shim/android-audio.jar.");
|
|
518
|
+
const remote = `/data/local/tmp/stim-audio-${randomUUID()}.jar`;
|
|
519
|
+
const adb = async (args) => {
|
|
520
|
+
if (await getAvdNameForSerialAsync(serial) !== avdName) throw new Error("The emulator no longer matches this workspace; media volume was not confirmed.");
|
|
521
|
+
return exec.runFileAsync("adb", [
|
|
522
|
+
"-s",
|
|
523
|
+
serial,
|
|
524
|
+
...args
|
|
525
|
+
], { timeoutMs: 3e4 });
|
|
526
|
+
};
|
|
527
|
+
try {
|
|
528
|
+
await adb([
|
|
529
|
+
"push",
|
|
530
|
+
helper,
|
|
531
|
+
remote
|
|
532
|
+
]);
|
|
533
|
+
await adb([
|
|
534
|
+
"shell",
|
|
535
|
+
`CLASSPATH=${remote}`,
|
|
536
|
+
"app_process",
|
|
537
|
+
"/system/bin",
|
|
538
|
+
"dev.stim.audio.Main",
|
|
539
|
+
"0"
|
|
540
|
+
]);
|
|
541
|
+
} finally {
|
|
542
|
+
await adb([
|
|
543
|
+
"shell",
|
|
544
|
+
"rm",
|
|
545
|
+
"-f",
|
|
546
|
+
remote
|
|
547
|
+
]);
|
|
548
|
+
}
|
|
549
|
+
const readback = await exec.runFileAsync("adb", [
|
|
550
|
+
"-s",
|
|
551
|
+
serial,
|
|
552
|
+
"shell",
|
|
553
|
+
"cmd",
|
|
554
|
+
"media_session",
|
|
555
|
+
"volume",
|
|
556
|
+
"--stream",
|
|
557
|
+
"3",
|
|
558
|
+
"--get"
|
|
559
|
+
], { timeoutMs: 3e4 });
|
|
560
|
+
if (!/\bvolume is 0 in range \[0\.\.\d+\]/.test(readback)) throw new Error("Android did not confirm media volume zero for this emulator.");
|
|
561
|
+
out(chalk.dim(phaseLine("device", "emulator media muted; turn on Media sound in its Stim Desktop options")));
|
|
562
|
+
} catch (error) {
|
|
563
|
+
out(chalk.yellow(phaseLine("device", `Could not mute emulator media: ${error instanceof Error ? error.message : String(error)}`)));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
510
566
|
function reportAndroidMemoryPressure(out) {
|
|
511
567
|
const pressure = readHostMemoryPressure();
|
|
512
568
|
if (pressure === "warning" || pressure === "critical") {
|
|
@@ -571,7 +627,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
|
|
|
571
627
|
};
|
|
572
628
|
let resolved;
|
|
573
629
|
try {
|
|
574
|
-
resolved =
|
|
630
|
+
resolved = await resolveOwnedAvdSerialAsync(device.avdName);
|
|
575
631
|
} catch (e) {
|
|
576
632
|
return {
|
|
577
633
|
failed: true,
|
|
@@ -616,7 +672,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
|
|
|
616
672
|
out(chalk.dim(phaseLine("device", `booting ${avdName} as ${serial}`)));
|
|
617
673
|
let pid = null;
|
|
618
674
|
try {
|
|
619
|
-
pid = bootAndroidEmulator(avdName, claim.consolePort, { logFile });
|
|
675
|
+
pid = await bootAndroidEmulator(avdName, claim.consolePort, { logFile });
|
|
620
676
|
} catch (e) {
|
|
621
677
|
releaseAndroidConsolePort(projectPath, claim.consolePort, slot);
|
|
622
678
|
return {
|
|
@@ -632,6 +688,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
|
|
|
632
688
|
out
|
|
633
689
|
});
|
|
634
690
|
if (result.failed) releaseAndroidConsolePort(projectPath, claim.consolePort, slot);
|
|
691
|
+
else await muteBootedEmulator(serial, avdName, out);
|
|
635
692
|
return booted(result);
|
|
636
693
|
};
|
|
637
694
|
try {
|