stim 1.16.0 → 1.17.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 (107) hide show
  1. package/dist/{activity-BxwdD81S.mjs → activity-IRvJY_ru.mjs} +23 -3
  2. package/dist/{agent-device-usage-output-Dpih1Tfa.mjs → agent-device-usage-output-BK41vnzN.mjs} +3 -3
  3. package/dist/{android-Ift4kVvt.mjs → android--GorydsK.mjs} +679 -317
  4. package/dist/{android-B_NumVyQ.mjs → android-B_YNZy61.mjs} +7 -43
  5. package/dist/{android-r2rBL8kV.mjs → android-DE4v59Mb.mjs} +12 -3
  6. package/dist/{android-cas-8U4DPqeR.mjs → android-cas-ZFpjJBL_.mjs} +6 -5
  7. package/dist/{app-install-CKWdbXIX.mjs → app-install-VPkI5WEg.mjs} +6 -5
  8. package/dist/{budget-DjrURfQn.mjs → budget-DM984mnd.mjs} +34 -18
  9. package/dist/{build-plan-DjeSb2Xl.mjs → build-plan-CmQCoyT-.mjs} +345 -86
  10. package/dist/{build-slots-rUk77xqh.mjs → build-slots-41v_d2x9.mjs} +35 -25
  11. package/dist/{cli-BkYZ_6hy.mjs → cli-Daxug5-K.mjs} +17 -17
  12. package/dist/cli.mjs +1 -1
  13. package/dist/collector-run.mjs +3 -3
  14. package/dist/{command-output-DnJMdEY-.mjs → command-output-CDAIFD-8.mjs} +3 -3
  15. package/dist/{created-devices-D5owjN4C.mjs → created-devices-CpvzBL25.mjs} +1 -1
  16. package/dist/{dependency-state-B6cMXZab.mjs → dependency-state-CLcBHH2M.mjs} +1 -1
  17. package/dist/{deps-urbmfXig.mjs → deps-DNWaQs4V.mjs} +1 -1
  18. package/dist/{dev-client-CroAIjjj.mjs → dev-client-B-XC4uRH.mjs} +2 -2
  19. package/dist/{device-DZQjF7H5.mjs → device-C8IOoJPv.mjs} +7 -7
  20. package/dist/device-capacity-D0GWHnTM.mjs +580 -0
  21. package/dist/device-host-worker.mjs +436 -154
  22. package/dist/{device-ios-BadmeL2V.mjs → device-ios-Bc7vbGwl.mjs} +75 -44
  23. package/dist/{device-lease-D-hLqx1b.mjs → device-lease-DpoS36_u.mjs} +2 -2
  24. package/dist/{device-lease-run-CqjShqWW.mjs → device-lease-run-B8YltIH_.mjs} +3 -3
  25. package/dist/{device-pool-CUaEWMMm.mjs → device-pool-3o7s5lo4.mjs} +2 -2
  26. package/dist/{device-remote-D5WVWqOq.mjs → device-remote-hFSkpfQu.mjs} +12 -12
  27. package/dist/{doctor-Cimf-gGB.mjs → doctor-Cnk9d7Hm.mjs} +32 -51
  28. package/dist/{error-diagnostics-B9L4Ae0x.mjs → error-diagnostics-C-NMnhrk.mjs} +7 -7
  29. package/dist/{gc-Bqy4bjEu.mjs → gc-DxCL2A46.mjs} +308 -26
  30. package/dist/{gradle-BsO1MdsH.mjs → gradle-D7-L2Th3.mjs} +3 -3
  31. package/dist/{guide-B_uyKTxW.mjs → guide-DjrTQGik.mjs} +1662 -565
  32. package/dist/{guide-status-CjEZMAD4.mjs → guide-status-Du-ZQ3FD.mjs} +1 -1
  33. package/dist/hosted-android-DwLS4Mse.mjs +32 -0
  34. package/dist/{hosted-client-a-WmqE2L.mjs → hosted-client-wk1W_CNW.mjs} +2 -3
  35. package/dist/hosted-ios-aMo7Cljf.mjs +15 -0
  36. package/dist/{hosted-logs-D5g041Q3.mjs → hosted-logs-DqYmWtXc.mjs} +16 -16
  37. package/dist/{hosted-macos-BSZyIb3y.mjs → hosted-macos-dlHXEeF5.mjs} +4 -4
  38. package/dist/{hosted-ios-CIWelIqf.mjs → hosted-native-C9xJ9rpA.mjs} +77 -42
  39. package/dist/{idle-DYVymG92.mjs → idle-B2m-Ovod.mjs} +122 -58
  40. package/dist/{idle-shutdown-CTsDnAde.mjs → idle-shutdown-_3oOV1V_.mjs} +25 -17
  41. package/dist/{in-use-DvBw0Kxo.mjs → in-use-CvGOUn-x.mjs} +11 -11
  42. package/dist/{ios-aq3QoGI3.mjs → ios-DE6duQoz.mjs} +170 -88
  43. package/dist/{ios-BaInn3sW.mjs → ios-DSfnPfse.mjs} +4 -4
  44. package/dist/{ios-device-FfCN_C8p.mjs → ios-device-pAN4t54-.mjs} +1 -1
  45. package/dist/ios-state-8L3lgum6.mjs +89 -0
  46. package/dist/{launch-verify-2DBRizjo.mjs → launch-verify-lTnWZikR.mjs} +2 -2
  47. package/dist/{logs-CHEVK8zD.mjs → logs-DUoKlDoS.mjs} +36 -23
  48. package/dist/{client-BTY686R6.mjs → machines-C2XiNwh9.mjs} +278 -20
  49. package/dist/{macos-CSYEAFmF.mjs → macos-32po3kUq.mjs} +14 -14
  50. package/dist/macos-run.mjs +1 -1
  51. package/dist/maintenance-run.mjs +2 -2
  52. package/dist/{metro-BeK1ZPz1.mjs → metro-g8NqiJp-.mjs} +1 -1
  53. package/dist/{metro-gateway-BJ-rxQAB.mjs → metro-gateway-DmslUM30.mjs} +22 -3
  54. package/dist/{named-ports-Bk_YXEmE.mjs → named-ports-C8m8EQs2.mjs} +2 -2
  55. package/dist/{native-run-NaBrRFtQ.mjs → native-run-D1Q56rAD.mjs} +17 -6
  56. package/dist/{native-runtime-DBzRnEKS.mjs → native-runtime-DhJI3IVQ.mjs} +6 -6
  57. package/dist/offload-worker.mjs +8 -8
  58. package/dist/{teardown-CL6vDs2Y.mjs → ownership-BMLqyBgJ.mjs} +603 -26
  59. package/dist/{ownership-DiA16AsN.mjs → ownership-DyRQru0q.mjs} +2 -2
  60. package/dist/{ports-R2k4Knz3.mjs → ports-4nYqxPWC.mjs} +2 -2
  61. package/dist/{prebuild-D2fsca_Z.mjs → prebuild-D7RUMkwN.mjs} +3 -3
  62. package/dist/{preview-DhVbvPAZ.mjs → preview-CxPRIEht.mjs} +7 -7
  63. package/dist/{project-Du91Ilvc.mjs → project-D47Rh0ly.mjs} +7 -2
  64. package/dist/{recordings-BIXOzVnr.mjs → recordings-BNgsD1Tr.mjs} +1 -1
  65. package/dist/{reload-rM9jV1fz.mjs → reload-qZei6iWn.mjs} +62 -35
  66. package/dist/{remote-cache-C8-V13XN.mjs → remote-cache-Ci4DQYYj.mjs} +3 -3
  67. package/dist/{run-f4vI6EnK.mjs → run-CkE9y0nc.mjs} +1 -1
  68. package/dist/{server-bare-CpPGmnmO.mjs → server-bare-BkrSxSsZ.mjs} +1 -1
  69. package/dist/{server-expo-MC0rHlOC.mjs → server-expo-CHTyXD0G.mjs} +2 -2
  70. package/dist/server-expo-CeakhI8P.mjs +2 -0
  71. package/dist/{settings-oTSkkNrM.mjs → settings-Cfd-0r2d.mjs} +10 -9
  72. package/dist/{settings-ZkDzkzvB.mjs → settings-SR9OmW9h.mjs} +3 -3
  73. package/dist/settings.schema.json +42 -13
  74. package/dist/{simslim-B8-7AoTI.mjs → simslim-BWNrc3M3.mjs} +3 -3
  75. package/dist/{slot-launch-B8VrHxn1.mjs → slot-launch-DmjBmpQV.mjs} +8 -8
  76. package/dist/{start-CX8Ig-U2.mjs → start-BopZcr4n.mjs} +1 -1
  77. package/dist/{start-ClDfwXa4.mjs → start-uee1wWjY.mjs} +11 -11
  78. package/dist/{state-DcW6vOd_.mjs → state-BKa8wNN5.mjs} +1 -1
  79. package/dist/{state-3DwSQIBK.mjs → state-DyaNTgfR.mjs} +1 -1
  80. package/dist/{state-C1jB7Q8q.mjs → state-PeQiJuIu.mjs} +2 -2
  81. package/dist/{stats-CEZ_i5je.mjs → stats-Bq4fJOdB.mjs} +7 -4
  82. package/dist/{status-BuvBFeII.mjs → status-CzS4bPO9.mjs} +4 -4
  83. package/dist/{status-Cs7VLg9D.mjs → status-dXX2JX1C.mjs} +125 -35
  84. package/dist/{stop-Dt_dM16A.mjs → stop-BCwvvs7F.mjs} +2 -2
  85. package/dist/{stop-Bffozsac.mjs → stop-BjizrQwv.mjs} +48 -27
  86. package/dist/{stop-B0Yxtmiy.mjs → stop-Cr1d8DSE.mjs} +4 -4
  87. package/dist/{stop-cause-CidxIqup.mjs → stop-cause-rhmGfwvt.mjs} +1 -1
  88. package/dist/supervisor-run.d.mts +7 -4
  89. package/dist/supervisor-run.mjs +26 -28
  90. package/dist/{support-D4aYJniO.mjs → support-BJPgYCu-.mjs} +44 -19
  91. package/dist/{support-CAP8qDUF.mjs → support-F9-sr0Oi.mjs} +6 -6
  92. package/dist/{toolchain-DkUflduf.mjs → toolchain-CNIBTIOv.mjs} +7 -7
  93. package/dist/{warm-progress-CpGv3Wb6.mjs → warm-progress-DF4JRvYI.mjs} +3 -3
  94. package/dist/watchman-APYjXSQa.mjs +48 -0
  95. package/dist/{web-DWUaMp8P.mjs → web-exQtGkoc.mjs} +12 -13
  96. package/dist/web-run.mjs +4 -4
  97. package/dist/{workspace-process-lock-BL7Q0HCO.mjs → workspace-process-lock-2mNzOlaB.mjs} +3 -2
  98. package/dist/{workspace-state-B8-aJ1_5.mjs → workspace-state-DqcCbpE7.mjs} +2 -2
  99. package/dist/{workspaces-BV4pdHFz.mjs → workspaces-Bcib97-6.mjs} +3 -3
  100. package/dist/{worktree-jnG8Iph5.mjs → worktree-Dc98cE6_.mjs} +1 -1
  101. package/dist/{worktree-K-xj9Db0.mjs → worktree-ZpZR3S1k.mjs} +141 -40
  102. package/package.json +5 -5
  103. package/dist/device-capacity-BHwxNBlu.mjs +0 -136
  104. package/dist/ios-state-DS5UpYTH.mjs +0 -48
  105. package/dist/machines-BIBUdhpj.mjs +0 -265
  106. package/dist/ownership-hCkPzGmr.mjs +0 -571
  107. package/dist/server-expo-CVqO2c35.mjs +0 -2
@@ -1,56 +1,20 @@
1
1
  import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
2
  import { C as saveConfig, D as withConfigLock$1, H as projectDeviceSlots, I as assignSlotDevice, U as removeSlotDevice, _ as loadConfig$1, c as ensureConfig, d as getConfigDir, f as getConfigPath$1, z as deviceSlotPlatforms } from "./config-D0DbpZtM.mjs";
3
3
  import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-BmRm1qV0.mjs";
4
- import { c as androidDataPartitionSizeBytes } from "./settings-oTSkkNrM.mjs";
5
- import { o as pidExists, u as signalProcessTree } from "./metro-BeK1ZPz1.mjs";
6
- import { n as readCreatedDevices$1, r as recordCreatedDevice, t as forgetCreatedDevice } from "./created-devices-D5owjN4C.mjs";
4
+ import { s as androidDataPartitionSizeBytes } from "./settings-Cfd-0r2d.mjs";
5
+ import { o as pidExists, u as signalProcessTree } from "./metro-g8NqiJp-.mjs";
6
+ import { n as readCreatedDevices$1, r as recordCreatedDevice, t as forgetCreatedDevice } from "./created-devices-CpvzBL25.mjs";
7
7
  import { n as settingDefault, r as stimDesktopInstalled, t as STIM_DESKTOP_OPEN_OPTIONS } from "./stim-desktop-Cnz8CPnl.mjs";
8
8
  import { join } from "node:path";
9
9
  import { existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
10
10
  import { homedir, tmpdir } from "os";
11
11
  import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, resolve as resolve$1 } from "path";
12
- import { ANDROID_EMULATOR_APPS, loadConfig, settingDefinition } from "@stim-cli/core/state";
12
+ import { ANDROID_EMULATOR_APPS, getParkedMax, loadConfig, settingDefinition } from "@stim-cli/core/state";
13
13
  import { isDeepStrictEqual } from "node:util";
14
+ //#region src/devices/sim-pool.ts
14
15
  const POOL_SETTING_REMEDY = "Run `stim guide settings` for the device pool bounds and where it can be set.";
15
- const MAX_SETTING = {
16
- ios: {
17
- key: "iosParkedMax",
18
- env: "STIM_POOL_IOS_PARKED_MAX"
19
- },
20
- android: {
21
- key: "androidParkedMax",
22
- env: "STIM_POOL_ANDROID_PARKED_MAX"
23
- }
24
- };
25
- function parseMax(raw, strings) {
26
- const value = strings && typeof raw === "string" ? /^\d+$/.test(raw.trim()) ? Number(raw.trim()) : NaN : raw;
27
- if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) return null;
28
- return value;
29
- }
30
- function parkedMaxSetting(platform, { config, env = process.env } = {}) {
31
- const { key, env: envKey } = MAX_SETTING[platform];
32
- const fromEnv = env[envKey];
33
- const explicit = fromEnv !== void 0 && fromEnv !== "";
34
- const pool = (config === void 0 ? loadConfig$1() : config)?.pool;
35
- if (!explicit && pool !== void 0 && (pool === null || typeof pool !== "object" || Array.isArray(pool))) return {
36
- max: 0,
37
- error: "Invalid pool value. Expected an object with simulator and emulator bounds."
38
- };
39
- const fromConfig = pool !== null && typeof pool === "object" && !Array.isArray(pool) ? pool[key] : void 0;
40
- const raw = explicit ? fromEnv : fromConfig;
41
- if (raw === void 0) return {
42
- max: env.STIM_HOME ? 0 : 3,
43
- error: null
44
- };
45
- const parsed = parseMax(raw, explicit);
46
- if (parsed === null) return {
47
- max: 0,
48
- error: `Invalid ${explicit ? envKey : `pool.${key}`} value ${JSON.stringify(raw)}. Expected a whole number of parked ${platform === "ios" ? "simulators" : "emulators"}, 0 or more.`
49
- };
50
- return {
51
- max: explicit ? parsed : env.STIM_HOME ? 0 : parsed,
52
- error: null
53
- };
16
+ function parkedMaxSetting(platform, options = {}) {
17
+ return getParkedMax(platform, options);
54
18
  }
55
19
  function isParkedRecord(value, platform) {
56
20
  if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
@@ -1,5 +1,5 @@
1
1
  import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
- import { u as androidToolCwd } from "./android-B_NumVyQ.mjs";
2
+ import { u as androidToolCwd } from "./android-B_YNZy61.mjs";
3
3
  //#region src/collector/android.ts
4
4
  const LEVEL_BY_LETTER = {
5
5
  V: "debug",
@@ -45,7 +45,16 @@ function parseLogcatTimestamp({ month, day, hour, minute, second, millis }, now
45
45
  }
46
46
  function parseLogcatLine(line, { now = Date.now, clockOffsetMs = null } = {}) {
47
47
  if (typeof line !== "string") return null;
48
- const epoch = LOGCAT_EPOCH.exec(line.trimEnd());
48
+ const thread = /^\s*(\d+)\.(\d{3,6})\s+(\d+)\s+\d+\s+([A-Z])\s+(.*?):\s?(.*)$/.exec(line.trimEnd());
49
+ const epoch = thread ? [
50
+ thread[0],
51
+ thread[1],
52
+ thread[2],
53
+ thread[4],
54
+ thread[5],
55
+ thread[3],
56
+ thread[6]
57
+ ] : LOGCAT_EPOCH.exec(line.trimEnd());
49
58
  if (epoch) {
50
59
  const [, seconds, fraction, letter, tag, pid, msg] = epoch;
51
60
  if (!letter || !tag || !msg?.trim()) return null;
@@ -205,4 +214,4 @@ function watchAppPid({ serial, packageName, pid, intervalMs = null, exec = null,
205
214
  };
206
215
  }
207
216
  //#endregion
208
- export { watchAppPid as a, waitForAppPid as i, parseLogcatLine as n, startAndroidLogcat as r, androidClockOffset as t };
217
+ export { waitForAppPid as a, startAndroidLogcat as i, parseLogcatLine as n, watchAppPid as o, parsePidof as r, androidClockOffset as t };
@@ -1,11 +1,12 @@
1
1
  import { d as getConfigDir } from "./config-D0DbpZtM.mjs";
2
2
  import { r as register } from "./cache-manifest-DnUHBJaU.mjs";
3
- import { u as ensureWorkspaceStorage, w as withDirLock } from "./workspace-state-B8-aJ1_5.mjs";
3
+ import { u as ensureWorkspaceStorage, w as withDirLock$1 } from "./workspace-state-DqcCbpE7.mjs";
4
4
  import { createHash, randomUUID } from "node:crypto";
5
- import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, symlinkSync, writeFileSync } from "node:fs";
5
+ import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
6
6
  import { join } from "node:path";
7
+ import { quotedPath } from "@stim-cli/core";
7
8
  import { isJsonObject, readJsonFile } from "@stim-cli/core/state";
8
- import { fileURLToPath } from "node:url";
9
+ import { fileURLToPath, pathToFileURL } from "node:url";
9
10
  //#region src/engine/android-cas.ts
10
11
  const CAS_TOOLCHAIN_FIELDS = [
11
12
  "clang",
@@ -121,11 +122,11 @@ function resolveAndroidCas(root, env = process.env) {
121
122
  const context = join(state, "context.json");
122
123
  mkdirSync(state, { recursive: true });
123
124
  mkdirSync(dir, { recursive: true });
124
- withDirLock(join(state, "setup.lock"), () => {
125
+ withDirLock$1(join(state, "setup.lock"), () => {
125
126
  for (const name of ["clang", "clang++"]) {
126
127
  const path = join(state, name);
127
128
  const temporary = `${path}.${randomUUID()}.tmp`;
128
- symlinkSync(scripts[3], temporary);
129
+ writeFileSync(temporary, `#!/bin/sh\nexec ${quotedPath(process.execPath)} --input-type=module --eval ${quotedPath(`import ${JSON.stringify(pathToFileURL(scripts[3]).href)}`)} "$0" "$@"\n`, { mode: 493 });
129
130
  renameSync(temporary, path);
130
131
  }
131
132
  const temporary = `${context}.${process.pid}.tmp`;
@@ -1,5 +1,5 @@
1
1
  import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
- import { D as uninstallIosApp, M as deviceHoldsApk, N as deviceHoldsBundle, l as iosSimulatorFailureAdvice, m as listUserApps } from "./ios-BaInn3sW.mjs";
2
+ import { D as uninstallIosApp, M as deviceHoldsApk, N as deviceHoldsBundle, l as iosSimulatorFailureAdvice, m as listUserApps } from "./ios-DSfnPfse.mjs";
3
3
  import { t as DEV_MENU_LAUNCH_ARGS } from "./ios-device-Ee7sDXfp.mjs";
4
4
  import { join } from "node:path";
5
5
  //#region src/engine/app-schemes.ts
@@ -656,13 +656,14 @@ function stopRunningAndroidApp(serial, packageName, exec) {
656
656
  }
657
657
  return { restartedPid: pid };
658
658
  }
659
- function launchAndroidApp({ serial, packageName, metroPort, devClientScheme = null, physical = false }, { exec = null } = {}) {
659
+ function launchAndroidApp({ serial, packageName, metroPort, devClientScheme = null, physical = false, bridgePort }, { exec = null } = {}) {
660
660
  const e = exec || getExecutor();
661
661
  const restart = stopRunningAndroidApp(serial, packageName, e);
662
662
  if (restart.failed) return restart;
663
663
  const reversed = reverseMetroPorts({
664
664
  serial,
665
- metroPort
665
+ metroPort: bridgePort ?? metroPort,
666
+ devicePorts: [metroPort]
666
667
  }, { exec: e });
667
668
  if (reversed.failed) return reversed;
668
669
  const prefs = writeDebugHttpHost({
@@ -675,7 +676,7 @@ function launchAndroidApp({ serial, packageName, metroPort, devClientScheme = nu
675
676
  if (!prefs.ok && Number(metroPort) !== 8081) {
676
677
  const fallback = reverseMetroPorts({
677
678
  serial,
678
- metroPort,
679
+ metroPort: bridgePort ?? metroPort,
679
680
  devicePorts: [DEFAULT_METRO_PORT]
680
681
  }, { exec: e });
681
682
  if (fallback.failed) return fallback;
@@ -848,4 +849,4 @@ function androidAppProcess(serial, packageName, { exec = null } = {}) {
848
849
  }
849
850
  }
850
851
  //#endregion
851
- export { pickDevClientScheme as C, restartedAppNote as S, schemesFromInfoPlist as T, installIosApp as _, IOS_DEV_MENU_OFF_DEFAULTS_PLIST as a, launchAndroidReleaseApp as b, androidDevClientUrl as c, devClientUrl as d, deviceShellArg as f, installConflictKind as g, installAndroidApp as h, INSTALL_ERROR as i, clearOtherUserApps as l, hasMetroReverse as m, ANDROID_DISABLE_AUTO_LAUNCH_EXTRA as n, LAUNCH_ERROR as o, ensureMetroReverse as p, DEFAULT_METRO_PORT as r, androidAppProcess as s, ADB_INSTALL_TIMEOUT_MS as t, devClientDeepLink as u, iosAppProcess as v, readBundleSchemes as w, launchIosApp as x, launchAndroidApp as y };
852
+ export { reverseMetroPorts as C, schemesFromInfoPlist as D, readBundleSchemes as E, restartedAppNote as S, pickDevClientScheme as T, installIosApp as _, IOS_DEV_MENU_OFF_DEFAULTS_PLIST as a, launchAndroidReleaseApp as b, androidDevClientUrl as c, devClientUrl as d, deviceShellArg as f, installConflictKind as g, installAndroidApp as h, INSTALL_ERROR as i, clearOtherUserApps as l, hasMetroReverse as m, ANDROID_DISABLE_AUTO_LAUNCH_EXTRA as n, LAUNCH_ERROR as o, ensureMetroReverse as p, DEFAULT_METRO_PORT as r, androidAppProcess as s, ADB_INSTALL_TIMEOUT_MS as t, devClientDeepLink as u, iosAppProcess as v, writeDebugHttpHost as w, launchIosApp as x, launchAndroidApp as y };
@@ -2,24 +2,24 @@ import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
2
  import { A as directorySize, D as withConfigLock$1, F as volumeRootFor, H as projectDeviceSlots, M as isOnMountedVolume, P as measuredDirectorySize, _ as loadConfig$1, a as clearDevice, d as getConfigDir, j as formatBytes, o as clearSupervisor, p as getProject, z as deviceSlotPlatforms } from "./config-D0DbpZtM.mjs";
3
3
  import { t as process_identity_exports } from "./process-identity-BmRm1qV0.mjs";
4
4
  import { i as registeredCaches } from "./cache-manifest-DnUHBJaU.mjs";
5
- import { l as phaseLine, o as formatLongDuration, u as plural } from "./command-output-DnJMdEY-.mjs";
6
- import { l as resolveProjectMetro, r as killMetroTree } from "./metro-BeK1ZPz1.mjs";
7
- import { d as sharedBuildCache, r as readWorkspaceState$1, v as workspaceDir } from "./workspace-state-B8-aJ1_5.mjs";
8
- import { a as capacity, l as environmentState, u as formatSpace } from "./status-BuvBFeII.mjs";
9
- import { i as recordGcResult, n as withIdleWorkspace, o as canonicalPath } from "./in-use-DvBw0Kxo.mjs";
10
- import { i as createDeviceProcessTables, p as workspaceActivity } from "./activity-BxwdD81S.mjs";
11
- import { h as listBuildLocks, i as listLeaseFiles, r as leaseIsExpired } from "./device-lease-D-hLqx1b.mjs";
12
- import { n as listBuildSlots } from "./build-slots-rUk77xqh.mjs";
13
- import { l as readPidFile, s as clearWorkspaceSupervisor } from "./state-DcW6vOd_.mjs";
14
- import { C as parseSubscriberNames, D as parseWatchmanPid, E as parseWatchmanClients, T as parseWatchRoots, i as idleShutdownCandidates, n as collectOwnedDeviceActivity, o as shutDownIdleDevices, s as workspaceBuildInProgress, t as collectIdleDevices, w as parseTriggerCount } from "./idle-DYVymG92.mjs";
15
- import { A as listAvds, I as ownedAvdDirectory, at as isStimOwnedSim, ct as dropParked, it as isStimOwnedAvd, pt as readParked, z as ownedAvdSerialResolver } from "./android-B_NumVyQ.mjs";
16
- import { _ as parseRuntimeVersion, f as listIosDeviceTypes, u as listAllIosSims } from "./ios-BaInn3sW.mjs";
17
- import { c as teardownParkedIosSim, i as teardownOwnedAvd, n as eraseParkedIosSim, o as teardownOwnedIosSim, s as teardownParkedAvd, t as eraseParkedAvd } from "./teardown-CL6vDs2Y.mjs";
18
- import { n as workspaceProcessLockError, t as withWorkspaceProcessLock } from "./workspace-process-lock-BL7Q0HCO.mjs";
19
- import { t as resolveSupervisorTarget } from "./ownership-hCkPzGmr.mjs";
20
- import { a as collectWorkspaceOutputs, r as clearWorkspaceOutputs } from "./workspaces-BV4pdHFz.mjs";
5
+ import { l as phaseLine, o as formatLongDuration, u as plural } from "./command-output-CDAIFD-8.mjs";
6
+ import { l as resolveProjectMetro, r as killMetroTree } from "./metro-g8NqiJp-.mjs";
7
+ import { d as sharedBuildCache, r as readWorkspaceState$1, v as workspaceDir } from "./workspace-state-DqcCbpE7.mjs";
8
+ import { a as capacity, l as environmentState, u as formatSpace } from "./status-CzS4bPO9.mjs";
9
+ import { i as recordGcResult, n as withIdleWorkspace, o as canonicalPath } from "./in-use-CvGOUn-x.mjs";
10
+ import { i as createDeviceProcessTables, p as workspaceActivity } from "./activity-IRvJY_ru.mjs";
11
+ import { h as listBuildLocks, i as listLeaseFiles, r as leaseIsExpired } from "./device-lease-DpoS36_u.mjs";
12
+ import { n as listBuildSlots } from "./build-slots-41v_d2x9.mjs";
13
+ import { l as readPidFile, s as clearWorkspaceSupervisor } from "./state-BKa8wNN5.mjs";
14
+ import { a as parseWatchmanPid, i as parseWatchmanClients, n as parseTriggerCount, r as parseWatchRoots, t as parseSubscriberNames } from "./watchman-APYjXSQa.mjs";
15
+ import { A as listAvds, I as ownedAvdDirectory, at as isStimOwnedSim, ct as dropParked, it as isStimOwnedAvd, pt as readParked, z as ownedAvdSerialResolver } from "./android-B_YNZy61.mjs";
16
+ import { _ as parseRuntimeVersion, f as listIosDeviceTypes, u as listAllIosSims } from "./ios-DSfnPfse.mjs";
17
+ import { _ as teardownParkedAvd, d as eraseParkedAvd, f as eraseParkedIosSim, g as teardownOwnedIosSim, m as teardownOwnedAvd, t as resolveSupervisorTarget, v as teardownParkedIosSim } from "./ownership-BMLqyBgJ.mjs";
18
+ import { n as workspaceProcessLockError, t as withWorkspaceProcessLock } from "./workspace-process-lock-2mNzOlaB.mjs";
19
+ import { i as idleShutdownCandidates, n as collectOwnedDeviceActivity, o as shutDownIdleDevices, s as workspaceBuildInProgress, t as collectIdleDevices } from "./idle-B2m-Ovod.mjs";
20
+ import { a as collectWorkspaceOutputs, r as clearWorkspaceOutputs } from "./workspaces-Bcib97-6.mjs";
21
21
  import { n as supervisorError } from "./errors-B6W7FkxQ.mjs";
22
- import { l as withdrawDevServerStopRequest, s as requestDevServerStop } from "./stop-cause-CidxIqup.mjs";
22
+ import { l as withdrawDevServerStopRequest, s as requestDevServerStop } from "./stop-cause-rhmGfwvt.mjs";
23
23
  import { existsSync, readFileSync, statSync, statfsSync } from "node:fs";
24
24
  import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
25
25
  import { existsSync as existsSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync as statSync$1 } from "fs";
@@ -2614,6 +2614,22 @@ async function enforceBudget({ root, note, dryRun = false, budget: resolved }, o
2614
2614
  short
2615
2615
  };
2616
2616
  }
2617
+ async function peekBudget(root, overrides = {}) {
2618
+ const outcome = await enforceBudget({
2619
+ root,
2620
+ note: () => {},
2621
+ dryRun: true
2622
+ }, {
2623
+ ...overrides,
2624
+ step: async () => ({
2625
+ targets: [],
2626
+ failures: 0
2627
+ })
2628
+ });
2629
+ if (outcome.status !== "ok") return outcome.refusal.message;
2630
+ const shortfall = describeShortfall(outcome.budget, outcome.measure, outcome.short);
2631
+ return shortfall.length ? shortfall.join("; ") : null;
2632
+ }
2617
2633
  async function budgetGate(args, overrides = {}) {
2618
2634
  const outcome = await enforceBudget(args, overrides);
2619
2635
  return {
@@ -2697,4 +2713,4 @@ function budgetLine(report) {
2697
2713
  return `${report.volumes.length ? `${report.volumes.map((v) => `${v.freeGb} GB free on ${v.volume}`).join(", ")} (reclaims below ${Math.max(budget.minFreeDiskGb, budget.hardFloorDiskGb)} GB, ${budget.hardFloorDiskGb ? `refuses below ${budget.hardFloorDiskGb} GB` : "never refuses"})` : "disk budget off"}; ${report.memory ? `roughly ${report.memory.committedGb} GB of a ${budget.maxCommittedMemoryGb} GB memory budget committed` : "memory budget off"}`;
2698
2714
  }
2699
2715
  //#endregion
2700
- export { isWorkspacesScope as A, memoryCacheKind as B, unverifiedDeviceCommand as C, includesParkedDevices as D, includesArchives as E, trimCaches as F, reclaimMemory as G, memoryScope as H, GRADLE_DAEMONS_KIND as I, attributeMachineUsage as J, scopedMemoryReport as K, WATCHMAN_KIND as L, previewScopedEmptying as M, selectCaches as N, includesRecordings as O, selectsBeyondCaches as P, collectMemoryReport as R, findStaleProjectDevices as S, emptyCaches as T, memorySweepIsScoped as U, memoryLines as V, memoryWorkPending as W, discoverCaches as X, readFootprints as Y, sizeCaches as Z, describeUnverifiableDevices as _, machineNumber as a, findOrphanedDevices as b, stopOwnedMetroForReset as c, collectParkedAvds as d, collectParkedSims as f, describeParkedSims as g, deleteProjectDevices as h, inspectBudget as i, planCacheEmptying as j, includesWorkspaceOutputs as k, DEVICE_LIST_TIMEOUT_MS$1 as l, deleteParkedSims as m, budgetLine as n, readVolumeSpace as o, deleteParkedAvds as p, phase as q, enforceBudget as r, resolveBudget as s, budgetGate as t, collectDeviceLeases as u, deviceSweepIsScoped as v, withAndroidAvdSizes as w, findStaleDeviceRecords as x, eraseParkedDevices as y, inspectWatchmanMemory as z };
2716
+ export { includesWorkspaceOutputs as A, inspectWatchmanMemory as B, findStaleProjectDevices as C, includesArchives as D, emptyCaches as E, selectsBeyondCaches as F, memoryWorkPending as G, memoryLines as H, trimCaches as I, phase as J, reclaimMemory as K, GRADLE_DAEMONS_KIND as L, planCacheEmptying as M, previewScopedEmptying as N, includesParkedDevices as O, selectCaches as P, sizeCaches as Q, WATCHMAN_KIND as R, findStaleDeviceRecords as S, withAndroidAvdSizes as T, memoryScope as U, memoryCacheKind as V, memorySweepIsScoped as W, readFootprints as X, attributeMachineUsage as Y, discoverCaches as Z, describeParkedSims as _, machineNumber as a, eraseParkedDevices as b, resolveBudget as c, collectDeviceLeases as d, collectParkedAvds as f, deleteProjectDevices as g, deleteParkedSims as h, inspectBudget as i, isWorkspacesScope as j, includesRecordings as k, stopOwnedMetroForReset as l, deleteParkedAvds as m, budgetLine as n, peekBudget as o, collectParkedSims as p, scopedMemoryReport as q, enforceBudget as r, readVolumeSpace as s, budgetGate as t, DEVICE_LIST_TIMEOUT_MS$1 as u, describeUnverifiableDevices as v, unverifiedDeviceCommand as w, findOrphanedDevices as x, deviceSweepIsScoped as y, collectMemoryReport as z };