stim 1.9.0 → 1.10.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 (83) hide show
  1. package/dist/{android-_y4Ohi5z.mjs → android-787HhP5w.mjs} +119 -29
  2. package/dist/{android-BPGizezh.mjs → android-DBkeHwpm.mjs} +168 -95
  3. package/dist/{android-DEgo4oCo.mjs → android-DPov-fv2.mjs} +2 -2
  4. package/dist/{android-cas-eiExNLf7.mjs → android-cas-CITmIeWY.mjs} +9 -8
  5. package/dist/android-cas-compiler.mjs +1 -1
  6. package/dist/{app-install-Uf3a83Tv.mjs → app-install-CrJ6t_bv.mjs} +2 -2
  7. package/dist/budget-BP4jZZL4.mjs +620 -0
  8. package/dist/build-progress-BXx-ZBe4.mjs +512 -0
  9. package/dist/{cache-manifest-Dg7OnMrp.mjs → cache-manifest-Pubfp8wV.mjs} +1 -1
  10. package/dist/cache-manifest.mjs +1 -1
  11. package/dist/cli.mjs +16 -16
  12. package/dist/collector-run.d.mts +5 -1
  13. package/dist/collector-run.mjs +7 -7
  14. package/dist/{command-output-gByVmIjy.mjs → command-output-D5z2_bcF.mjs} +1 -1
  15. package/dist/{config-Cp9lM3wX.mjs → config-BEq0Qw_a.mjs} +14 -131
  16. package/dist/{dependency-state-Bq5DcLGn.mjs → dependency-state-r9UesA9a.mjs} +2 -2
  17. package/dist/{deps-Cip5vUm1.mjs → deps-DP4eWqea.mjs} +3 -3
  18. package/dist/{detached-entry-KEu0_AXL.mjs → detached-entry-DJHoca49.mjs} +1 -1
  19. package/dist/{dev-client-HyqISM0h.mjs → dev-client-92U593KT.mjs} +137 -250
  20. package/dist/{device-D4U-xLty.mjs → device-DhTZe7L4.mjs} +7 -7
  21. package/dist/{build-lock-DPXPLgTc.mjs → device-lease-CbEaIk7b.mjs} +370 -12
  22. package/dist/{device-pool-CnTAz8X1.mjs → device-pool-Di8Q-9Ro.mjs} +4 -4
  23. package/dist/{device-remote-AQ5rQPqr.mjs → device-remote-Dy1jGj3U.mjs} +547 -468
  24. package/dist/{doctor-B_Ei3bZu.mjs → doctor-B-inAJmt.mjs} +58 -22
  25. package/dist/{error-diagnostics-Vfz83GCF.mjs → error-diagnostics-xxWKNO3-.mjs} +11 -12
  26. package/dist/{exec-jIAlgilk.mjs → exec-DK8KaVHK.mjs} +3 -2
  27. package/dist/{gc-Ckw8RQHi.mjs → gc-ChPFZMRC.mjs} +500 -1114
  28. package/dist/{guide-BiAbhs1J.mjs → guide-DwmaD_Wa.mjs} +882 -528
  29. package/dist/guide-status-CWvti2Lg.mjs +125 -0
  30. package/dist/idle-DpRLp5lj.mjs +157 -0
  31. package/dist/in-use-CjUluqIX.mjs +245 -0
  32. package/dist/{ios-BL2NFckr.mjs → ios-B2Fpqvlb.mjs} +25 -59
  33. package/dist/{ios-BzUJWk1K.mjs → ios-Dd-hYJBh.mjs} +130 -89
  34. package/dist/{ios-device-DPsSm0v_.mjs → ios-device-BiOsSVzd.mjs} +1 -1
  35. package/dist/{ios-device-D972i9wf.mjs → ios-device-CtRdEVjx.mjs} +3 -3
  36. package/dist/{launch-verify-Q_OtW1Rf.mjs → launch-verify-CQS_Kg-C.mjs} +5 -5
  37. package/dist/{logs-CI9NQSK7.mjs → logs-MARIy6m9.mjs} +9 -9
  38. package/dist/{metro-DrLHaMn2.mjs → metro-BWLOJ_Wr.mjs} +116 -10
  39. package/dist/{named-ports-CmLQSIRj.mjs → named-ports-DiTfSz6p.mjs} +4 -4
  40. package/dist/{ndjson-9uFNRwfe.mjs → ndjson-CDY9IkVC.mjs} +3 -56
  41. package/dist/{ndjson-DvHSsNU9.d.mts → ndjson-Du3j0AQ9.d.mts} +1 -0
  42. package/dist/{ownership-D15Op8vN.mjs → ownership-D2xbLVoz.mjs} +2 -3
  43. package/dist/ownership-DZjdx8Gq.mjs +1180 -0
  44. package/dist/{ports-BNKoWVWZ.mjs → ports-CLSSFOuz.mjs} +3 -3
  45. package/dist/{project-DS112DYB.mjs → project-BXZzOABt.mjs} +2 -2
  46. package/dist/{reload-ZNJUo1pl.mjs → reload-DoETJ3rl.mjs} +9 -10
  47. package/dist/{server-bare-DWkkcIxV.mjs → server-bare-DVbb7kXH.mjs} +1 -1
  48. package/dist/{server-expo-B_lctBR3.mjs → server-expo-BvOCeakp.mjs} +4 -4
  49. package/dist/server-expo-DBVTdult.mjs +2 -0
  50. package/dist/{settings-D030k0t4.mjs → settings-DOugPlPz.mjs} +16 -428
  51. package/dist/{settings-BKNh5rl4.mjs → settings-EWYNwe72.mjs} +16 -14
  52. package/dist/settings.schema.json +75 -0
  53. package/dist/{simslim-B_LsGLuJ.mjs → simslim-Ca3487H6.mjs} +182 -5
  54. package/dist/{slot-launch-DU9A-gYw.mjs → slot-launch-C5cg0fmk.mjs} +4 -4
  55. package/dist/{spawn-claims-Dn3C_N6w.mjs → spawn-claims-CUleC2cM.mjs} +1 -1
  56. package/dist/{start-DYkkKF0s.mjs → start-F9gv5dcC.mjs} +147 -98
  57. package/dist/start-VoFsPSes.mjs +2 -0
  58. package/dist/{state-NcJzMEBF.mjs → state-WGdIbi_d.mjs} +2 -2
  59. package/dist/{stats-DG9e66Rz.mjs → stats-BAgJaLA4.mjs} +1 -1
  60. package/dist/{stats-B63-JVAY.mjs → stats-DBYJ5bxL.mjs} +4 -4
  61. package/dist/{status-S6ehL4Ui.mjs → status-DLCD-o3s.mjs} +63 -231
  62. package/dist/status-Dr4fRkym.mjs +216 -0
  63. package/dist/{guide-status-BAMVU0ZA.mjs → stim-installations-CINXy_su.mjs} +3 -124
  64. package/dist/{stop-BO28HGqF.mjs → stop-Dj4pfmyv.mjs} +22 -18
  65. package/dist/{stop-T1R-cZRz.mjs → stop-ZvOeTmKb.mjs} +2 -2
  66. package/dist/supervisor-run.d.mts +11 -2
  67. package/dist/supervisor-run.mjs +185 -17
  68. package/dist/{workspace-process-lock-DWaiRD0e.mjs → workspace-process-lock-BXA96myD.mjs} +2 -2
  69. package/dist/workspaces-BTUyFfkv.mjs +1003 -0
  70. package/dist/{worktree-DKhSF0UX.mjs → worktree-4aZg2NnI.mjs} +1 -1
  71. package/dist/{worktree-LGB-UwgG.mjs → worktree-BMS7GeqB.mjs} +40 -122
  72. package/dist/{worktree-R_cUlE7s.mjs → worktree-BlizKDpZ.mjs} +143 -18
  73. package/dist/{xcode-BZqyxh3e.mjs → xcode-B2tBkf0m.mjs} +9 -158
  74. package/package.json +6 -5
  75. package/dist/build-progress-CVqkfPC6.mjs +0 -188
  76. package/dist/device-lease-Crs-HkJY.mjs +0 -366
  77. package/dist/logs-query-Cqma3WIu.mjs +0 -298
  78. package/dist/ownership-DCQPuWEc.mjs +0 -489
  79. package/dist/public-http-probe-CyMDrQ3c.mjs +0 -61
  80. package/dist/server-expo-CeILEu86.mjs +0 -2
  81. package/dist/sim-pool-KaIsp2Ft.mjs +0 -723
  82. package/dist/spawn-entry-nCE6m770.mjs +0 -14
  83. package/dist/workspace-state-DF2gCFhx.mjs +0 -169
@@ -1,23 +1,28 @@
1
- import { N as readJsonObject, g as loadConfig, l as getConcurrencyLimits, o as configCorruptRepair } from "./config-Cp9lM3wX.mjs";
2
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
3
- import { d as sharedBuildCache, g as workspaceDerivedData } from "./workspace-state-DF2gCFhx.mjs";
4
- import { D as temporaryRoot, T as makeTemporaryDirectory, _ as repoRoot, a as dirtyFingerprintFiles, f as listWorktrees, p as locallyKnownUpstream, s as gitCommonDir, w as filesystemDevice, y as resolveSourceCheckout } from "./worktree-R_cUlE7s.mjs";
5
- import { a as detectIsExpo, n as appProjectProblem, o as findProjectRoot } from "./project-DS112DYB.mjs";
6
- import { C as projectOptimizations, D as remoteIosSetting, E as remoteAndroidSetting, F as unknownSettingKeys, M as settingShapeErrors, N as settingsLayers, V as settingDefinition, Y as resolveOptimizations, _ as iosSimSlimProfileSetting, i as SETTING_SHAPE_REMEDY, j as settingOrigin, k as resolveSettings, n as PATH_SETTINGS, q as compilerCacheFallbackMessage, r as SETTINGS_WITH_RESOLVE_TIME_FALLBACK, v as mergeSettingsLayers } from "./settings-D030k0t4.mjs";
7
- import { C as listAdbDevices, S as hostSystemImageArch } from "./android-_y4Ohi5z.mjs";
8
- import { d as quotedPath, f as refuseNoProject, l as phaseLine, u as plural } from "./command-output-gByVmIjy.mjs";
9
- import { l as diffFingerprintSources, n as listBuildLocks, p as fingerprintProject } from "./build-lock-DPXPLgTc.mjs";
10
- import { b as resolveEasCliBin, o as parkedMaxSetting, p as checkEasAuth$1, t as POOL_SETTING_REMEDY, v as ownerFromConfig, y as providerFromConfig } from "./sim-pool-KaIsp2Ft.mjs";
11
- import { A as readHostMemoryPressure, k as hostMemoryPressureAdvice, u as listAllIosSims } from "./ios-BL2NFckr.mjs";
12
- import { _ as listBuildSlots, h as podInstallCommand, i as ccacheEnabled, o as detectXcodeMajor } from "./xcode-BZqyxh3e.mjs";
13
- import { a as liveOwnedDeviceCount, n as simslimIsOnPath } from "./simslim-B_LsGLuJ.mjs";
14
- import { d as projectCmakeLauncher, g as androidPathRoomRemedy, h as androidPathRoomMessage, i as apkOutputsDir, m as androidPathRoom, r as resolveAndroidCompilerCache, t as readAndroidCasToolchain } from "./android-cas-eiExNLf7.mjs";
15
- import { i as inspectStimVersions, n as recordDoctorRun, r as compareStimVersions } from "./guide-status-BAMVU0ZA.mjs";
16
- import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-Bq5DcLGn.mjs";
1
+ import { g as loadConfig$1, l as getConcurrencyLimits, o as configCorruptRepair } from "./config-BEq0Qw_a.mjs";
2
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
3
+ import { D as workspaceDerivedData, S as sharedBuildCache } from "./metro-BWLOJ_Wr.mjs";
4
+ import { D as makeTemporaryDirectory, E as filesystemDevice, a as dirtyFingerprintFiles, h as locallyKnownUpstream, k as temporaryRoot, m as listWorktrees, s as gitCommonDir, x as resolveSourceCheckout, y as repoRoot } from "./worktree-BlizKDpZ.mjs";
5
+ import { a as detectIsExpo, n as appProjectProblem, o as findProjectRoot } from "./project-BXZzOABt.mjs";
6
+ import { d as quotedPath, f as refuseNoProject, l as phaseLine, u as plural } from "./command-output-D5z2_bcF.mjs";
7
+ import { T as fingerprintProject, h as listBuildLocks, x as diffFingerprintSources } from "./device-lease-CbEaIk7b.mjs";
8
+ import { S as hostSystemImageArch, w as listAdbDevices } from "./android-787HhP5w.mjs";
9
+ import { F as settingsLayers, H as compilerCacheFallbackMessage, L as unknownSettingKeys, N as settingOrigin, O as remoteAndroidSetting, P as settingShapeErrors, T as projectOptimizations, W as resolveOptimizations, a as SETTING_SHAPE_REMEDY, i as SETTINGS_WITH_RESOLVE_TIME_FALLBACK, j as resolveSettings, k as remoteIosSetting, n as PATH_SETTINGS, v as iosSimSlimProfileSetting, y as mergeSettingsLayers } from "./settings-DOugPlPz.mjs";
10
+ import { h as POOL_SETTING_REMEDY, y as parkedMaxSetting } from "./ownership-DZjdx8Gq.mjs";
11
+ import { O as hostMemoryPressureAdvice, k as readHostMemoryPressure, l as listAllIosSims } from "./ios-B2Fpqvlb.mjs";
12
+ import { o as listBuildSlots } from "./in-use-CjUluqIX.mjs";
13
+ import { L as ownerFromConfig, M as checkEasAuth$1, R as providerFromConfig, _ as easCliSupport, g as MIN_EAS_CLI_SIMULATOR_VERSION, s as readInstalledEasCliVersion, v as easCliUpgradeRemedy, z as resolveEasCliBin } from "./device-remote-Dy1jGj3U.mjs";
14
+ import { n as inspectStimVersions, t as compareStimVersions } from "./stim-installations-CINXy_su.mjs";
15
+ import { a as liveOwnedDeviceCount, l as MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION, n as simslimIsOnPath } from "./simslim-Ca3487H6.mjs";
16
+ import { n as budgetLine, r as inspectBudget } from "./budget-BP4jZZL4.mjs";
17
+ import { d as projectCmakeLauncher, g as androidPathRoomRemedy, h as androidPathRoomMessage, i as apkOutputsDir, m as androidPathRoom, r as resolveAndroidCompilerCache, t as readAndroidCasToolchain } from "./android-cas-CITmIeWY.mjs";
18
+ import { h as podInstallCommand, i as ccacheEnabled, o as detectXcodeMajor } from "./xcode-B2tBkf0m.mjs";
19
+ import { n as recordDoctorRun } from "./guide-status-CWvti2Lg.mjs";
20
+ import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-r9UesA9a.mjs";
17
21
  import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
18
22
  import { InvalidArgumentError } from "commander";
19
23
  import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
20
24
  import { dirname, isAbsolute, join, relative, resolve, sep } from "path";
25
+ import { readJsonObject, settingDefinition } from "@stim-cli/core/state";
21
26
  import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "node:path";
22
27
  import { homedir } from "os";
23
28
  import chalk from "chalk";
@@ -895,7 +900,11 @@ function checkConcurrency({ maxBuilds = 0, maxDevices = 0, liveDevices = 0, acti
895
900
  if (!maxBuilds && !maxDevices) return null;
896
901
  return finding("note", "Concurrency limits are set", `${`maxBuilds ${maxBuilds || "unlimited"}, maxDevices ${maxDevices || "unlimited"}`}. Right now ${liveDevices} Stim device(s) are booted and ${activeBuilds} build slot(s) are in use on this machine. At the device cap a new \`stim ios\`/\`android\` is refused with STIM_AT_CAPACITY (stop an environment or raise it); at the build cap a compile waits for a free slot.`, null);
897
902
  }
898
- function checkRemoteDevice({ configured = null, daemonInEnv = false, agentDeviceOnPath = false, easCliResolvable = false } = {}) {
903
+ function readProjectEasCliVersion(projectRoot) {
904
+ const bin = resolveEasCliBin(projectRoot);
905
+ return bin ? readInstalledEasCliVersion(bin.file, projectRoot) : null;
906
+ }
907
+ function checkRemoteDevice({ configured = null, daemonInEnv = false, agentDeviceOnPath = false, easCliResolvable = false, readEasCliVersion = () => null } = {}) {
899
908
  if (!configured) return null;
900
909
  if (!agentDeviceOnPath) return finding("cost", "A remote device is configured, but agent-device is missing", `agent-device drives the selected remote backend. Without it, \`stim ios --remote ${configured}\` and \`stim android --remote ${configured}\` refuse before device work.`, "npm i -g agent-device");
901
910
  if (configured === "proxy") {
@@ -903,8 +912,25 @@ function checkRemoteDevice({ configured = null, daemonInEnv = false, agentDevice
903
912
  return finding("cost", "The remote proxy credentials are missing", "The proxy backend requires AGENT_DEVICE_DAEMON_BASE_URL and AGENT_DEVICE_DAEMON_AUTH_TOKEN.", "Export AGENT_DEVICE_DAEMON_BASE_URL and AGENT_DEVICE_DAEMON_AUTH_TOKEN.");
904
913
  }
905
914
  if (!easCliResolvable) return finding("cost", "A remote device is configured, but there is no eas-cli to create a session with", "The eas backend creates an EAS Simulator session. It needs eas-cli and an account with EAS Simulator access. Neither a project copy nor one on PATH was found.", "Install eas-cli.");
915
+ const easCli = easCliSupport(readEasCliVersion(), MIN_EAS_CLI_SIMULATOR_VERSION);
916
+ if (!easCli.supported) return finding("cost", easCli.version ? `A remote device is configured, but eas-cli ${easCli.version} has no EAS Simulator commands` : "A remote device is configured, but the eas-cli version could not be read", `The eas backend runs \`eas simulator:*\` commands, which need eas-cli ${MIN_EAS_CLI_SIMULATOR_VERSION} or later. \`stim ios --remote eas\` and \`stim android --remote eas\` refuse with STIM_REMOTE_EAS_UNAVAILABLE before device work.`, `${easCliUpgradeRemedy(MIN_EAS_CLI_SIMULATOR_VERSION)}.`);
906
917
  return finding("note", "This project uses a remote device", "`ios --remote eas` / `android --remote eas` create an EAS Simulator session named stim-<label> and end it on `stop` and `worktree remove`. The build still runs on this machine; only the device is elsewhere. Native device logs are not captured on a remote device -- the Metro half of the timeline is unaffected.", null);
907
918
  }
919
+ function checkEasBuildDownload({ easJson = false, remoteEas = false, easCliResolvable = false, readEasCliVersion = () => null } = {}) {
920
+ if (!easJson || remoteEas || !easCliResolvable) return null;
921
+ const easCli = easCliSupport(readEasCliVersion(), MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION);
922
+ if (easCli.supported) return null;
923
+ return finding("cost", easCli.version ? `eas-cli ${easCli.version} cannot download EAS builds for --eas-profile` : "The eas-cli version could not be read for --eas-profile", `\`stim ios --eas-profile\` and \`stim android --eas-profile\` download a finished EAS development build with \`eas build:download --build-id\`, which needs eas-cli ${MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION} or later. Older versions refuse with STIM_EAS_UNAVAILABLE before any download.`, `${easCliUpgradeRemedy(MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION)}.`);
924
+ }
925
+ function projectEasBuildDownloadFinding(projectRoot, remoteBackends, lookupEasCli) {
926
+ const easJson = existsSync$1(join(projectRoot, "eas.json"));
927
+ return checkEasBuildDownload({
928
+ easJson,
929
+ remoteEas: remoteBackends.includes("eas"),
930
+ easCliResolvable: easJson && (lookupEasCli ? lookupEasCli() : Boolean(resolveEasCliBin(projectRoot))),
931
+ readEasCliVersion: () => readProjectEasCliVersion(projectRoot)
932
+ });
933
+ }
908
934
  function checkSimSlim({ configured = false, profileError = null, onPath = false } = {}) {
909
935
  if (profileError) return finding("cost", "The SimSlim profile is invalid", profileError, "Set ios.simslimProfile to a readable JSON profile inside the repository.");
910
936
  if (!configured) return finding("note", "SimSlim is recommended for parallel iOS simulator work", "A reviewed profile can reduce background simulator services and memory use. It is optional: disabling services can affect tests that depend on them, and installing the binary alone does not apply a profile.", "Run `stim guide lifecycle simslim` to install SimSlim and configure ios.simslimProfile. Stim does not enable a profile through doctor --fix.");
@@ -1012,8 +1038,10 @@ function runDoctor(projectRoot, { readFile = readFileSync$1, xcodeMajor = null,
1012
1038
  configured: backend,
1013
1039
  daemonInEnv,
1014
1040
  agentDeviceOnPath,
1015
- easCliResolvable
1041
+ easCliResolvable,
1042
+ readEasCliVersion: () => readProjectEasCliVersion(projectRoot)
1016
1043
  })).filter((remoteFinding) => remoteFinding !== null);
1044
+ const easBuildDownloadFinding = projectEasBuildDownloadFinding(projectRoot, remoteBackends, lookupEasCli);
1017
1045
  const memoryAdvice = localIos && !remoteIosSetting(projectSettings) ? hostMemoryPressureAdvice(memoryPressure()) : null;
1018
1046
  return [
1019
1047
  checkAppProject(projectRoot),
@@ -1035,6 +1063,7 @@ function runDoctor(projectRoot, { readFile = readFileSync$1, xcodeMajor = null,
1035
1063
  checkAndroidPathRoom(projectRoot, platform, host),
1036
1064
  remoteBuildCache ? checkBuildCacheProvider(appConfig, sdkMajor, isExpo, dynamicConfig) : null,
1037
1065
  easFinding,
1066
+ easBuildDownloadFinding,
1038
1067
  concurrencyFinding,
1039
1068
  memoryAdvice ? finding("cost", "Host memory pressure can stall the iOS simulator", memoryAdvice, "Free host memory, then retry. Run `stim guide lifecycle simslim` for the optional memory reduction setup.") : null,
1040
1069
  simslimFinding,
@@ -1102,7 +1131,7 @@ function countLiveDevices() {
1102
1131
  adb = listAdbDevices() || adb;
1103
1132
  } catch {}
1104
1133
  try {
1105
- config = loadConfig();
1134
+ config = loadConfig$1();
1106
1135
  } catch {}
1107
1136
  return liveOwnedDeviceCount({
1108
1137
  sims,
@@ -1289,12 +1318,16 @@ function stimVersionLines(report) {
1289
1318
  phaseLine("installs", paths + versions)
1290
1319
  ];
1291
1320
  }
1292
- function doctorSuccessLines(platform, stim) {
1321
+ function budgetLines(budget) {
1322
+ return budget ? [phaseLine("budget", budgetLine(budget))] : [];
1323
+ }
1324
+ function doctorSuccessLines(platform, stim, budget = null) {
1293
1325
  const lines = [
1294
1326
  `Doctor (${doctorTarget(platform)})`,
1295
1327
  phaseLine("result", "PASS"),
1296
1328
  phaseLine("findings", "0"),
1297
1329
  ...stimVersionLines(stim),
1330
+ ...budgetLines(budget),
1298
1331
  "",
1299
1332
  "Project",
1300
1333
  phaseLine("project", "source checkout, dependencies, local upstream"),
@@ -1405,18 +1438,21 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
1405
1438
  }
1406
1439
  const shadowed = shadowedStimFinding(stim);
1407
1440
  if (shadowed) findings.push(shadowed);
1441
+ const budget = await inspectBudget(root);
1442
+ findings.push(...budget.findings);
1408
1443
  if (opts.json) {
1409
1444
  console.log(JSON.stringify({
1410
1445
  project: root,
1411
1446
  platform: opts.platform ?? null,
1412
1447
  stim,
1448
+ budget: budget.report,
1413
1449
  findings
1414
1450
  }));
1415
1451
  recordDoctorRun(root, opts.platform, version);
1416
1452
  return;
1417
1453
  }
1418
1454
  if (findings.length === 0) {
1419
- const lines = doctorSuccessLines(opts.platform, stim);
1455
+ const lines = doctorSuccessLines(opts.platform, stim, budget.report);
1420
1456
  for (const [index, line] of lines.entries()) if (index === 1) console.log(chalk.green(line));
1421
1457
  else if (line && !line.startsWith(" ")) console.log(chalk.bold(line));
1422
1458
  else console.log(chalk.dim(line));
@@ -1425,7 +1461,7 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
1425
1461
  }
1426
1462
  const ordered = findings.toSorted((a, b) => a.level === b.level ? 0 : a.level === "cost" ? -1 : 1);
1427
1463
  console.log(chalk.bold(`Doctor (${doctorTarget(opts.platform)})`));
1428
- for (const line of stimVersionLines(stim)) console.log(chalk.dim(line));
1464
+ for (const line of [...stimVersionLines(stim), ...budgetLines(budget.report)]) console.log(chalk.dim(line));
1429
1465
  for (const f of ordered) {
1430
1466
  const tag = f.level === "cost" ? chalk.yellow("costs time") : chalk.dim("note");
1431
1467
  console.log(`\n${tag} ${chalk.bold(f.title)}`);
@@ -1,15 +1,14 @@
1
- import { A as withDirLock, H as deviceSlotKey, U as deviceSlotPlatforms, f as getProject } from "./config-Cp9lM3wX.mjs";
2
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
3
- import { r as readWorkspaceState } from "./workspace-state-DF2gCFhx.mjs";
4
- import { d as readWorkspaceLaunches } from "./state-NcJzMEBF.mjs";
5
- import { r as deviceConsoleLevel } from "./ios-device-DPsSm0v_.mjs";
6
- import { c as resolveProjectMetro } from "./metro-DrLHaMn2.mjs";
7
- import { r as androidHome, s as androidToolCwd } from "./android-_y4Ohi5z.mjs";
8
- import { n as parseLogcatLine, t as androidClockOffset } from "./android-DEgo4oCo.mjs";
9
- import { v as launchErrorPreview } from "./command-output-gByVmIjy.mjs";
10
- import { a as parseLease, n as fileLeaseIo, t as deviceLeasePath } from "./device-lease-Crs-HkJY.mjs";
11
- import { f as sortByTs, n as attachExpoErrorContext, u as readLogRecords } from "./logs-query-Cqma3WIu.mjs";
1
+ import { R as deviceSlotKey, f as getProject, z as deviceSlotPlatforms } from "./config-BEq0Qw_a.mjs";
2
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
3
+ import { P as withDirLock, m as readWorkspaceState$1, s as resolveProjectMetro } from "./metro-BWLOJ_Wr.mjs";
4
+ import { d as readWorkspaceLaunches } from "./state-WGdIbi_d.mjs";
5
+ import { v as launchErrorPreview } from "./command-output-D5z2_bcF.mjs";
6
+ import { a as parseLease, n as fileLeaseIo, t as deviceLeasePath } from "./device-lease-CbEaIk7b.mjs";
7
+ import { r as androidHome, s as androidToolCwd } from "./android-787HhP5w.mjs";
8
+ import { r as deviceConsoleLevel } from "./ios-device-BiOsSVzd.mjs";
9
+ import { n as parseLogcatLine, t as androidClockOffset } from "./android-DPov-fv2.mjs";
12
10
  import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
11
+ import { attachExpoErrorContext, readLogRecords, sortByTs } from "@stim-cli/core/state";
13
12
  import { basename, dirname, join, resolve, sep } from "node:path";
14
13
  import { createHash, randomUUID } from "node:crypto";
15
14
  import { homedir } from "node:os";
@@ -405,7 +404,7 @@ function captureWorkspaceCrashes(root, logsDir) {
405
404
  since: Number(since),
406
405
  until,
407
406
  physical: attempt?.physical === true,
408
- appPath: attempt?.appPath ?? readWorkspaceState(root)?.lastBuild?.appPath
407
+ appPath: attempt?.appPath ?? readWorkspaceState$1(root)?.lastBuild?.appPath
409
408
  }, logsDir);
410
409
  } catch {}
411
410
  }
@@ -27,7 +27,7 @@ let active = {
27
27
  throw nameTimeout(error, cmd, timeoutMs);
28
28
  }
29
29
  },
30
- runFile(file, args = [], { timeoutMs, killSignal, cwd, env, omitEnv } = {}) {
30
+ runFile(file, args = [], { timeoutMs, killSignal, cwd, env, omitEnv, input, untrimmed } = {}) {
31
31
  const opts = {
32
32
  encoding: "utf-8",
33
33
  stdio: [
@@ -40,6 +40,7 @@ let active = {
40
40
  if (timeoutMs) opts.timeout = timeoutMs;
41
41
  if (killSignal) opts.killSignal = killSignal;
42
42
  if (cwd) opts.cwd = cwd;
43
+ if (input !== void 0) opts.input = input;
43
44
  if (env || omitEnv?.length) {
44
45
  const childEnv = {
45
46
  ...process.env,
@@ -55,7 +56,7 @@ let active = {
55
56
  const message = `Command failed: ${[file, ...args].join(" ")}${stderr ? `\n${stderr}` : ""}`;
56
57
  throw Object.assign(new Error(message), result);
57
58
  }
58
- return String(result.stdout).trim();
59
+ return untrimmed ? String(result.stdout) : String(result.stdout).trim();
59
60
  },
60
61
  runFileAsync(file, args = [], { timeoutMs, killSignal, cwd, env, omitEnv } = {}) {
61
62
  const command = [file, ...args].join(" ");