stim 1.9.0 → 1.10.1

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-Bu4mbDzc.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-Cfmqr3TQ.mjs} +2 -2
  7. package/dist/budget-nDCEwtJv.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-DExzPiOa.mjs} +137 -250
  20. package/dist/{device-D4U-xLty.mjs → device-Czh5kO8A.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-BBWLAr55.mjs} +4 -4
  23. package/dist/{device-remote-AQ5rQPqr.mjs → device-remote-powUHdbK.mjs} +547 -468
  24. package/dist/{doctor-B_Ei3bZu.mjs → doctor-CmqK1LcQ.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-zCDpmdHU.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--jn7pBNe.mjs +157 -0
  31. package/dist/in-use-CNIWU-r-.mjs +245 -0
  32. package/dist/{ios-BL2NFckr.mjs → ios-COGcGEcN.mjs} +39 -65
  33. package/dist/{ios-BzUJWk1K.mjs → ios-CbdqTqOc.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-DNjPXBnb.mjs} +3 -3
  36. package/dist/{launch-verify-Q_OtW1Rf.mjs → launch-verify-BhgkYAws.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-BfPNRf3-.mjs +1180 -0
  43. package/dist/{ownership-D15Op8vN.mjs → ownership-D2xbLVoz.mjs} +2 -3
  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-CymyF6Kk.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-DZUxzsjq.mjs} +182 -5
  54. package/dist/{slot-launch-DU9A-gYw.mjs → slot-launch-Dk4oTREM.mjs} +4 -4
  55. package/dist/{spawn-claims-Dn3C_N6w.mjs → spawn-claims-CUleC2cM.mjs} +1 -1
  56. package/dist/{start-DYkkKF0s.mjs → start-RbmFPeZ7.mjs} +147 -98
  57. package/dist/start-qWapeB4W.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-Dr4fRkym.mjs +216 -0
  62. package/dist/{status-S6ehL4Ui.mjs → status-Zp8kvexe.mjs} +63 -231
  63. package/dist/{guide-status-BAMVU0ZA.mjs → stim-installations-CINXy_su.mjs} +3 -124
  64. package/dist/{stop-T1R-cZRz.mjs → stop-DI4BG4Os.mjs} +2 -2
  65. package/dist/{stop-BO28HGqF.mjs → stop-DcEv5sk-.mjs} +22 -18
  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-wrH6dXfu.mjs +1003 -0
  70. package/dist/{worktree-LGB-UwgG.mjs → worktree-Bd4dRvx7.mjs} +40 -122
  71. package/dist/{worktree-R_cUlE7s.mjs → worktree-BlizKDpZ.mjs} +143 -18
  72. package/dist/{worktree-DKhSF0UX.mjs → worktree-DEG2o9F8.mjs} +1 -1
  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,10 +1,10 @@
1
1
  import { n as __exportAll, r as __reExport } from "./rolldown-runtime-BsOwBuO_.mjs";
2
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
3
- import { readFileSync } from "node:fs";
2
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
4
3
  import { InvalidArgumentError } from "commander";
5
- import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readdirSync as readdirSync$1, readlinkSync, renameSync as renameSync$1, statSync as statSync$1, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
4
+ import { existsSync, lstatSync, mkdirSync, readdirSync, readlinkSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
6
5
  import { dirname, isAbsolute, join, normalize, parse, sep } from "path";
7
- import { configDir, withDirLock } from "@stim-cli/core";
6
+ import { configDir } from "@stim-cli/core";
7
+ import { allMetroPorts, configCorruptRepair, findEnclosingWorktreeRoot, getConcurrencyLimits, getConfigPath, getConfigPath as getConfigPath$1, getProject, getProjectSettings, getRepoSettings, isPathPrefix, loadConfig, loadConfig as loadConfig$1, withConfigLock, withConfigLock as withConfigLock$1 } from "@stim-cli/core/state";
8
8
  import { join as join$1 } from "node:path";
9
9
  //#region src/devices/device-slots.ts
10
10
  const DEFAULT_DEVICE_SLOT = "default";
@@ -126,7 +126,7 @@ function resolveWorkspaceRealish(workspacePath) {
126
126
  prefix += `${sep}${segment}`;
127
127
  let st;
128
128
  try {
129
- st = lstatSync$1(prefix);
129
+ st = lstatSync(prefix);
130
130
  } catch (err) {
131
131
  if (err && err.code === "ENOENT") return normalized;
132
132
  return null;
@@ -163,7 +163,7 @@ function listWindowsVolumeRoots(statFn) {
163
163
  }
164
164
  return roots;
165
165
  }
166
- function listMountedVolumes({ statFn = statSync$1 } = {}) {
166
+ function listMountedVolumes({ statFn = statSync } = {}) {
167
167
  if (WINDOWS) return listWindowsVolumeRoots(statFn);
168
168
  const roots = ["/"];
169
169
  let rootDev;
@@ -173,7 +173,7 @@ function listMountedVolumes({ statFn = statSync$1 } = {}) {
173
173
  return roots;
174
174
  }
175
175
  try {
176
- for (const name of readdirSync$1("/Volumes")) {
176
+ for (const name of readdirSync("/Volumes")) {
177
177
  const path = join("/Volumes", name);
178
178
  let entryDev;
179
179
  try {
@@ -198,7 +198,7 @@ function uncShareIsReachable(volume, statFn) {
198
198
  return false;
199
199
  }
200
200
  }
201
- function isOnMountedVolume(path, mountedVolumes, { statFn = statSync$1 } = {}) {
201
+ function isOnMountedVolume(path, mountedVolumes, { statFn = statSync } = {}) {
202
202
  const mounted = new Set(mountedVolumes || listMountedVolumes());
203
203
  const volume = resolveVolumeRoot(path);
204
204
  if (volume === null) return false;
@@ -224,22 +224,6 @@ function formatBytes(bytes) {
224
224
  return `${Math.round(bytes / 1024)}K`;
225
225
  }
226
226
  //#endregion
227
- //#region src/json-file.ts
228
- function readJsonFile(path) {
229
- return JSON.parse(readFileSync(path, "utf-8"));
230
- }
231
- function isJsonObject(value) {
232
- return typeof value === "object" && value !== null && !Array.isArray(value);
233
- }
234
- function readJsonObject(path) {
235
- try {
236
- const value = readJsonFile(path);
237
- return isJsonObject(value) ? value : null;
238
- } catch {
239
- return null;
240
- }
241
- }
242
- //#endregion
243
227
  //#region src/ownership-claim.ts
244
228
  var ownership_claim_exports = /* @__PURE__ */ __exportAll({});
245
229
  import * as import__stim_cli_core_ownership_claim from "@stim-cli/core/ownership-claim";
@@ -286,75 +270,20 @@ function refuseRelativeStimPaths(env = process.env) {
286
270
  throw error;
287
271
  }
288
272
  }
289
- function getConfigPath() {
290
- return join(getConfigDir(), "config.json");
291
- }
292
273
  function ensureDir() {
293
274
  const dir = getConfigDir();
294
- if (!existsSync$1(dir)) mkdirSync$1(dir, { recursive: true });
295
- }
296
- const LOCK_DIR_NAME = "config.lock";
297
- function lockPath() {
298
- return join(getConfigDir(), LOCK_DIR_NAME);
299
- }
300
- function withConfigLock(fn) {
301
- return withDirLock(lockPath(), fn, { ensureParent: ensureDir });
302
- }
303
- function configCorruptRepair(path = getConfigPath()) {
304
- return `Repair the file, or move it aside to start over: mv "${path}" "${path}.broken"`;
305
- }
306
- function configCorrupt(reason, path = getConfigPath()) {
307
- const corrupt = /* @__PURE__ */ new Error(`Stim config at ${path} ${reason}\nIt holds the records of the simulators and emulators Stim owns, so it is never reset automatically.
308
- ` + configCorruptRepair(path));
309
- corrupt.code = "STIM_CONFIG_CORRUPT";
310
- return corrupt;
311
- }
312
- function loadConfig() {
313
- const p = getConfigPath();
314
- if (!existsSync$1(p)) return null;
315
- let parsed;
316
- try {
317
- parsed = readJsonFile(p);
318
- } catch (err) {
319
- if (!(err instanceof SyntaxError)) throw err;
320
- throw configCorrupt(`is not valid JSON: ${err.message}`, p);
321
- }
322
- return configFromJson(parsed, p);
323
- }
324
- function configFromJson(value, path) {
325
- if (!isJsonObject(value)) throw configCorrupt(`is not a JSON object: ${JSON.stringify(value)}`, path);
326
- return {
327
- ...value,
328
- projects: registryFromJson(value, "projects", path),
329
- repos: registryFromJson(value, "repos", path)
330
- };
331
- }
332
- /**
333
- * An array or scalar container swallows every write silently: `JSON.stringify` drops a string key set on
334
- * an array, so the record is gone by the time the file is written. Absent or null is read as empty; an
335
- * unusable container or entry is refused.
336
- */
337
- function registryFromJson(config, key, path) {
338
- const value = config[key];
339
- if (value === void 0 || value === null) return {};
340
- if (!isJsonObject(value)) throw configCorrupt(`has a ${key} that is not an object: ${JSON.stringify(value)}`, path);
341
- const registry = {};
342
- for (const [name, entry] of Object.entries(value)) {
343
- if (!isJsonObject(entry)) throw configCorrupt(`has a ${key} entry ${JSON.stringify(name)} that is not an object: ${JSON.stringify(entry)}`, path);
344
- registry[name] = entry;
345
- }
346
- return registry;
275
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
347
276
  }
348
277
  function saveConfig(config) {
349
278
  ensureDir();
350
279
  const target = getConfigPath();
351
280
  const tmp = `${target}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
352
- writeFileSync$1(tmp, JSON.stringify(config, null, 2) + "\n");
281
+ writeFileSync(tmp, JSON.stringify(config, null, 2) + "\n");
353
282
  try {
354
- renameSync$1(tmp, target);
283
+ renameSync(tmp, target);
355
284
  } catch (err) {
356
285
  try {
357
- unlinkSync$1(tmp);
286
+ unlinkSync(tmp);
358
287
  } catch {}
359
288
  throw err;
360
289
  }
@@ -379,9 +308,6 @@ function ensureConfig() {
379
308
  return fresh;
380
309
  });
381
310
  }
382
- function getProject(projectPath) {
383
- return loadConfig()?.projects?.[projectPath] || null;
384
- }
385
311
  function requireAbsoluteProjectPath(projectPath) {
386
312
  if (isAbsolute(projectPath)) return;
387
313
  throw new Error(`Project key "${projectPath}" is not an absolute path. The registry is keyed by the realpath of a workspace root, so a relative key can never resolve.`);
@@ -494,24 +420,6 @@ function clearSupervisor(projectPath, expected) {
494
420
  return true;
495
421
  });
496
422
  }
497
- function getConcurrencyLimits({ env = process.env } = {}) {
498
- const c = loadConfig()?.concurrency || {};
499
- return {
500
- maxBuilds: resolveLimit(env.STIM_MAX_BUILDS, c.maxBuilds),
501
- maxDevices: resolveLimit(env.STIM_MAX_DEVICES, c.maxDevices)
502
- };
503
- }
504
- function resolveLimit(envVal, cfgVal) {
505
- const raw = envVal !== void 0 && envVal !== null && envVal !== "" ? Number(envVal) : typeof cfgVal === "number" ? cfgVal : NaN;
506
- if (!Number.isFinite(raw) || raw <= 0) return 0;
507
- return Math.floor(raw);
508
- }
509
- function getProjectSettings(projectPath) {
510
- return getProject(projectPath)?.settings || {};
511
- }
512
- function getRepoSettings(gitCommonDir) {
513
- return loadConfig()?.repos?.[gitCommonDir]?.settings || {};
514
- }
515
423
  function targetSettings(cfg, target, create) {
516
424
  if (target.scope === "machine") return cfg;
517
425
  if (target.scope === "workspace") {
@@ -586,31 +494,6 @@ function deleteNested(obj, dottedKey) {
586
494
  }
587
495
  return true;
588
496
  }
589
- function isPathPrefix(prefix, path) {
590
- const head = comparablePath(prefix);
591
- const candidate = comparablePath(path);
592
- if (head === candidate) return true;
593
- return candidate.startsWith(head.endsWith("/") ? head : `${head}/`);
594
- }
595
- function comparablePath(path) {
596
- return sep === "/" ? path : path.replaceAll(sep, "/");
597
- }
598
- function findEnclosingWorktreeRoot(projectPath) {
599
- const cfg = loadConfig();
600
- if (!cfg?.projects) return null;
601
- let best = null;
602
- for (const [path, proj] of Object.entries(cfg.projects)) {
603
- if (!proj?.worktreeRoot) continue;
604
- if (!isPathPrefix(path, projectPath)) continue;
605
- if (!best || path.length > best.length) best = path;
606
- }
607
- return best;
608
- }
609
- function allMetroPorts() {
610
- const cfg = loadConfig();
611
- if (!cfg?.projects) return [];
612
- return Object.values(cfg.projects).map((p) => p.metroPort).filter((p) => typeof p === "number");
613
- }
614
497
  function allConsolePortsAndSerials({ isMounted = isOnMountedVolume } = {}) {
615
498
  const cfg = loadConfig();
616
499
  const result = {
@@ -619,7 +502,7 @@ function allConsolePortsAndSerials({ isMounted = isOnMountedVolume } = {}) {
619
502
  };
620
503
  if (!cfg) return result;
621
504
  for (const [path, proj] of Object.entries(cfg.projects || {})) {
622
- if (!existsSync$1(path) && isMounted(path)) continue;
505
+ if (!existsSync(path) && isMounted(path)) continue;
623
506
  for (const { platforms } of projectDeviceSlots(proj)) {
624
507
  const android = platforms.android;
625
508
  if (typeof android?.consolePort === "number") result.androidConsolePorts.push(android.consolePort);
@@ -629,4 +512,4 @@ function allConsolePortsAndSerials({ isMounted = isOnMountedVolume } = {}) {
629
512
  return result;
630
513
  }
631
514
  //#endregion
632
- export { withDirLock as A, assignSlotDevice as B, setSupervisor as C, process_identity_exports as D, writeConfigSetting as E, formatBytes as F, parseDeviceSlotOption as G, deviceSlotKey as H, isOnMountedVolume as I, validateDeviceSlot as J, projectDeviceSlots as K, listMountedVolumes as L, readJsonFile as M, readJsonObject as N, acquireAvdClaim as O, directorySize as P, measuredDirectorySize as R, setDevice as S, withConfigLock as T, deviceSlotPlatforms as U, deviceSlotFileKey as V, parseDeviceSlotKey as W, refuseRelativeStimPaths as _, clearSupervisor as a, removeProject as b, findEnclosingWorktreeRoot as c, getConfigPath as d, getProject as f, loadConfig as g, isPathPrefix as h, clearDevice as i, isJsonObject as j, ownership_claim_exports as k, getConcurrencyLimits as l, getRepoSettings as m, allMetroPorts as n, configCorruptRepair as o, getProjectSettings as p, removeSlotDevice as q, claimMetroPort as r, ensureConfig as s, allConsolePortsAndSerials as t, getConfigDir as u, releaseAndroidConsolePort as v, upsertProject as w, saveConfig as x, releaseMetroPort as y, volumeRootFor as z };
515
+ export { directorySize as A, parseDeviceSlotKey as B, setSupervisor as C, process_identity_exports as D, writeConfigSetting as E, volumeRootFor as F, projectDeviceSlots as H, assignSlotDevice as I, deviceSlotFileKey as L, isOnMountedVolume as M, listMountedVolumes as N, acquireAvdClaim as O, measuredDirectorySize as P, deviceSlotKey as R, setDevice as S, withConfigLock$1 as T, removeSlotDevice as U, parseDeviceSlotOption as V, validateDeviceSlot as W, refuseRelativeStimPaths as _, clearSupervisor as a, removeProject as b, findEnclosingWorktreeRoot as c, getConfigPath$1 as d, getProject as f, loadConfig$1 as g, isPathPrefix as h, clearDevice as i, formatBytes as j, ownership_claim_exports as k, getConcurrencyLimits as l, getRepoSettings as m, allMetroPorts as n, configCorruptRepair as o, getProjectSettings as p, claimMetroPort as r, ensureConfig as s, allConsolePortsAndSerials as t, getConfigDir as u, releaseAndroidConsolePort as v, upsertProject as w, saveConfig as x, releaseMetroPort as y, deviceSlotPlatforms as z };
@@ -1,5 +1,5 @@
1
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
2
- import { _ as repoRoot } from "./worktree-R_cUlE7s.mjs";
1
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
2
+ import { y as repoRoot } from "./worktree-BlizKDpZ.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { dirname, join, relative } from "node:path";
5
5
  //#region src/dependency-state.ts
@@ -1,7 +1,7 @@
1
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
1
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
2
+ import { n as spawnDeclared } from "./spawn-claims-CUleC2cM.mjs";
2
3
  import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
3
- import { n as spawnDeclared } from "./spawn-claims-Dn3C_N6w.mjs";
4
- import { d as startBuildHeartbeat, m as bundlerPin, n as HEARTBEAT_INTERVAL_MS } from "./xcode-BZqyxh3e.mjs";
4
+ import { d as startBuildHeartbeat, m as bundlerPin, n as HEARTBEAT_INTERVAL_MS } from "./xcode-B2tBkf0m.mjs";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { delimiter, dirname, join, relative, resolve, sep } from "node:path";
7
7
  import { homedir } from "node:os";
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-jIAlgilk.mjs";
1
+ import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
2
2
  import { openSync } from "node:fs";
3
3
  //#region src/detached-entry.ts
4
4
  const LOG_FILE_FLAG = "--log-file";