stim 1.3.1 → 1.5.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 (67) hide show
  1. package/README.md +16 -3
  2. package/dist/{android-hMj83VpN.mjs → android-DJWiTBkz.mjs} +65 -72
  3. package/dist/{android-cas-DXorPCi_.mjs → android-cas-CSS8gjR7.mjs} +15 -12
  4. package/dist/{android-CT-PkXUh.mjs → android-sobvO9ia.mjs} +197 -114
  5. package/dist/{app-install-DIp9riNx.mjs → app-install--PAocWvq.mjs} +2 -2
  6. package/dist/{build-slots-C4AouyNz.mjs → build-slots-CuPszJDu.mjs} +7 -8
  7. package/dist/{cache-manifest-CXR-Y8pH.mjs → cache-manifest-uoOKhgUD.mjs} +1 -1
  8. package/dist/cache-manifest.mjs +1 -1
  9. package/dist/cli.mjs +14 -13
  10. package/dist/collector-run.mjs +4 -4
  11. package/dist/{command-output-8wHMEde0.mjs → command-output-BuIb_ZOI.mjs} +1 -4
  12. package/dist/{config-CcefMY2Q.mjs → config-DMP7L7H6.mjs} +52 -52
  13. package/dist/dependency-state-CTL8A9p3.mjs +76 -0
  14. package/dist/{deps-0Yt0Inly.mjs → deps-BAGOnrc7.mjs} +1 -1
  15. package/dist/{dev-client-VfSZNLT4.mjs → dev-client-BoifdqkU.mjs} +12 -12
  16. package/dist/{device-Bbv45Z9Z.mjs → device-BUw4JBuH.mjs} +7 -7
  17. package/dist/{xcode-xnxyvJkD.mjs → device-DvKJ454A.mjs} +208 -967
  18. package/dist/{device-lease-CJwK7OZr.mjs → device-lease-r7yEQ1R8.mjs} +3 -3
  19. package/dist/{device-pool-CcBNTvM7.mjs → device-pool-DU4FQKp5.mjs} +4 -4
  20. package/dist/{device-remote-DAA0Zm6Z.mjs → device-remote-BTUqbl0i.mjs} +7 -6
  21. package/dist/{doctor-B4EITgQB.mjs → doctor-Di_B26uh.mjs} +396 -117
  22. package/dist/{error-diagnostics-DwhNBFDU.mjs → error-diagnostics-CTePWAzW.mjs} +7 -6
  23. package/dist/{gc-BRu62v4o.mjs → gc-C20dWw_8.mjs} +61 -27
  24. package/dist/{guide-D95E0u3i.mjs → guide-sAnoty2y.mjs} +151 -20
  25. package/dist/guide-status-BF6RsJJp.mjs +271 -0
  26. package/dist/{ios-DAju3TVy.mjs → ios-BdpkncL6.mjs} +2667 -2607
  27. package/dist/{ios-device-CWOM_S44.mjs → ios-device-DJOi9FR5.mjs} +1 -1
  28. package/dist/{logs-CAdwW6c2.mjs → logs-BfQdIhiF.mjs} +5 -5
  29. package/dist/metro-ato6ef3J.mjs +99 -0
  30. package/dist/named-ports-DH9SXd0f.mjs +137 -0
  31. package/dist/{ownership-8O073GIC.mjs → ownership-CD_XnpDu.mjs} +5 -5
  32. package/dist/{ownership-DXcol4oU.mjs → ownership-CVY9cqCr.mjs} +6 -6
  33. package/dist/ports-A6uTJSPj.mjs +39 -0
  34. package/dist/ports-BZprTJRa.mjs +90 -0
  35. package/dist/{project-fKmuIaMI.mjs → project-B_SDt4ip.mjs} +2 -2
  36. package/dist/{reclaim-CUmwucWG.mjs → reclaim-C_rB25f4.mjs} +20 -13
  37. package/dist/{reload-CWpXoOgN.mjs → reload-CYBJbJfI.mjs} +8 -8
  38. package/dist/rolldown-runtime-BsOwBuO_.mjs +30 -0
  39. package/dist/{server-bare-DEzPZLvf.mjs → server-bare-H3pAhbMs.mjs} +11 -35
  40. package/dist/server-expo-CSwUVYOa.mjs +2 -0
  41. package/dist/{server-expo-DizT4OMk.mjs → server-expo-Ds8_mfng.mjs} +6 -14
  42. package/dist/{settings-DEJf6_kJ.mjs → settings-kO2ZqIKy.mjs} +2 -2
  43. package/dist/{slot-launch-CZklomj6.mjs → slot-launch-BpHiHH6A.mjs} +4 -4
  44. package/dist/{start-B5G4NjiA.mjs → start-DiEfqEWk.mjs} +20 -22
  45. package/dist/state-CnWzvCWP.mjs +131 -0
  46. package/dist/{stats-CaaQr4yN.mjs → stats-DHrO0frH.mjs} +4 -4
  47. package/dist/{stats-BR-kwj0B.mjs → stats-Fo9ACIv7.mjs} +1 -1
  48. package/dist/{status-CI9clRSb.mjs → status-J5LAXpag.mjs} +15 -12
  49. package/dist/{stop-CjlgDk0a.mjs → stop-0jJNahwN.mjs} +15 -14
  50. package/dist/{stop-CQhffpmX.mjs → stop-CM1fejKW.mjs} +2 -2
  51. package/dist/supervisor-run.d.mts +7 -28
  52. package/dist/supervisor-run.mjs +20 -11
  53. package/dist/{teardown--gESs9ck.mjs → teardown-CAVcWeRD.mjs} +148 -109
  54. package/dist/{workspace-process-lock-IBj1Towr.mjs → workspace-process-lock-Bz19_R9R.mjs} +4 -4
  55. package/dist/workspace-state-WVwWw_hB.mjs +146 -0
  56. package/dist/{worktree-DtQGO9-s.mjs → worktree-CeUKDAQw.mjs} +38 -34
  57. package/dist/{worktree-Eq6TLH8N.mjs → worktree-DJnBbQZ9.mjs} +79 -22
  58. package/dist/xcode-BqDeRkpT.mjs +860 -0
  59. package/package.json +7 -7
  60. package/shim/expo-metro-config.cjs +11 -17
  61. package/dist/doctor-BueDfLYG.mjs +0 -530
  62. package/dist/metro-CORqXyTL.mjs +0 -184
  63. package/dist/ownership-claim-BtPtJVmq.mjs +0 -584
  64. package/dist/server-expo-44em5Pmg.mjs +0 -2
  65. package/dist/state-B3XA2wp2.mjs +0 -268
  66. package/shim/metro-cache-generation.cjs +0 -20
  67. package/shim/metro-cache-generation.d.cts +0 -5
@@ -1,9 +1,10 @@
1
+ import { n as __exportAll, r as __reExport } from "./rolldown-runtime-BsOwBuO_.mjs";
1
2
  import { t as getExecutor } from "./exec-CyylIdq9.mjs";
3
+ import { join } from "node:path";
2
4
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
3
5
  import { homedir } from "os";
4
- import { dirname, isAbsolute, join, normalize } from "path";
5
- import { withDirLock } from "@stim-cli/core";
6
- import { capture, check, decode } from "unique-pid";
6
+ import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize } from "path";
7
+ import { configDir, withDirLock } from "@stim-cli/core";
7
8
  //#region src/device-slots.ts
8
9
  const DEFAULT_DEVICE_SLOT = "default";
9
10
  function validateDeviceSlot(slot = "default") {
@@ -114,7 +115,7 @@ function resolveWorkspaceRealish(workspacePath) {
114
115
  } catch {
115
116
  return null;
116
117
  }
117
- current = `${target.startsWith("/") ? target : normalize(join(dirname(prefix), target))}${normalized.slice(prefix.length)}`;
118
+ current = `${target.startsWith("/") ? target : normalize(join$1(dirname$1(prefix), target))}${normalized.slice(prefix.length)}`;
118
119
  followedSymlink = true;
119
120
  break;
120
121
  }
@@ -136,7 +137,7 @@ function listMountedVolumes({ statFn = statSync } = {}) {
136
137
  }
137
138
  try {
138
139
  for (const name of readdirSync("/Volumes")) {
139
- const path = join("/Volumes", name);
140
+ const path = join$1("/Volumes", name);
140
141
  let entryDev;
141
142
  try {
142
143
  entryDev = statFn(path).dev;
@@ -175,50 +176,41 @@ function formatBytes(bytes) {
175
176
  return `${Math.round(bytes / 1024)}K`;
176
177
  }
177
178
  //#endregion
178
- //#region src/process-identity.ts
179
- function sameProcessRecord(a, b) {
180
- if (!a || !b) return !a && !b;
181
- return a.pid === b.pid && a.processToken === b.processToken;
182
- }
183
- function captureProcessIdentity(pid) {
184
- const result = capture(pid);
185
- if (result.ok) return {
186
- ok: true,
187
- token: result.value
188
- };
189
- return {
190
- ok: false,
191
- reason: `${result.error.code} (${result.error.message})`
192
- };
193
- }
194
- function captureProcessToken(pid) {
195
- const captured = captureProcessIdentity(pid);
196
- return captured.ok ? captured.token : null;
197
- }
198
- function inspectProcessIdentity(record) {
199
- if (!record || typeof record.processToken !== "string") return "unknown";
200
- const decoded = decode(record.processToken);
201
- if (!decoded.ok || decoded.value.pid !== record.pid) return "unknown";
202
- const result = check(record.processToken);
203
- return result.ok ? result.value : "unknown";
204
- }
205
- async function waitForProcessExit(record, timeoutMs) {
206
- const deadline = Date.now() + timeoutMs;
207
- while (Date.now() <= deadline) {
208
- const identity = inspectProcessIdentity(record);
209
- if (identity === "different" || identity === "gone") return true;
210
- if (Date.now() >= deadline) return false;
211
- await new Promise((resolve) => setTimeout(resolve, 100));
212
- }
213
- return false;
179
+ //#region src/ownership-claim.ts
180
+ var ownership_claim_exports = /* @__PURE__ */ __exportAll({});
181
+ import * as import__stim_cli_core_ownership_claim from "@stim-cli/core/ownership-claim";
182
+ __reExport(ownership_claim_exports, import__stim_cli_core_ownership_claim);
183
+ //#endregion
184
+ //#region src/avd-claim.ts
185
+ function acquireAvdClaim(avdName) {
186
+ const root = join(configDir(), "avd-locks", `${encodeURIComponent(avdName.toLowerCase())}.lock`);
187
+ const label = `AVD ${avdName}`;
188
+ const attempt = (0, ownership_claim_exports.tryAcquireClaim)({
189
+ root,
190
+ mode: "exclusive",
191
+ label
192
+ });
193
+ if (attempt.pending) (0, ownership_claim_exports.releaseClaim)(attempt.pending);
194
+ if (attempt.acquired) return attempt.acquired;
195
+ throw new ownership_claim_exports.ClaimRefusedError({
196
+ root,
197
+ claimPath: attempt.held?.path ?? attempt.waitingFor?.[0]?.path ?? root,
198
+ label,
199
+ reason: "another operation is creating, recovering, or tearing down this AVD"
200
+ });
214
201
  }
215
202
  //#endregion
203
+ //#region src/process-identity.ts
204
+ var process_identity_exports = /* @__PURE__ */ __exportAll({});
205
+ import * as import__stim_cli_core_process_identity from "@stim-cli/core/process-identity";
206
+ __reExport(process_identity_exports, import__stim_cli_core_process_identity);
207
+ //#endregion
216
208
  //#region src/config.ts
217
209
  function getConfigDir() {
218
- return process.env.STIM_HOME || join(homedir(), ".stim");
210
+ return process.env.STIM_HOME || join$1(homedir(), ".stim");
219
211
  }
220
212
  function getConfigPath() {
221
- return join(getConfigDir(), "config.json");
213
+ return join$1(getConfigDir(), "config.json");
222
214
  }
223
215
  function ensureDir() {
224
216
  const dir = getConfigDir();
@@ -226,7 +218,7 @@ function ensureDir() {
226
218
  }
227
219
  const LOCK_DIR_NAME = "config.lock";
228
220
  function lockPath() {
229
- return join(getConfigDir(), LOCK_DIR_NAME);
221
+ return join$1(getConfigDir(), LOCK_DIR_NAME);
230
222
  }
231
223
  function withConfigLock(fn) {
232
224
  return withDirLock(lockPath(), fn, { ensureParent: ensureDir });
@@ -308,7 +300,7 @@ function getProject(projectPath) {
308
300
  return loadConfig()?.projects?.[projectPath] || null;
309
301
  }
310
302
  function requireAbsoluteProjectPath(projectPath) {
311
- if (isAbsolute(projectPath)) return;
303
+ if (isAbsolute$1(projectPath)) return;
312
304
  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.`);
313
305
  }
314
306
  function upsertProject(projectPath, fields) {
@@ -321,7 +313,7 @@ function upsertProject(projectPath, fields) {
321
313
  };
322
314
  cfg.projects[projectPath] = {
323
315
  ...existing,
324
- ...fields
316
+ ...typeof fields === "function" ? fields(existing) : fields
325
317
  };
326
318
  saveConfig(cfg);
327
319
  return cfg.projects[projectPath];
@@ -331,6 +323,8 @@ function removeProject(projectPath) {
331
323
  withConfigLock(() => {
332
324
  const cfg = loadConfig();
333
325
  if (!cfg?.projects?.[projectPath]) return;
326
+ if (Object.keys(cfg.projects[projectPath].ports ?? {}).length) throw new Error(`Named ports remain for ${projectPath}; stop or release them before removing its registry entry.`);
327
+ for (const { platforms } of projectDeviceSlots(cfg.projects[projectPath])) if (platforms.android?.owned && platforms.android.avdName) (0, ownership_claim_exports.releaseClaim)(acquireAvdClaim(platforms.android.avdName));
334
328
  delete cfg.projects[projectPath];
335
329
  saveConfig(cfg);
336
330
  });
@@ -339,7 +333,10 @@ function claimMetroPort(projectPath, port) {
339
333
  return withConfigLock(() => {
340
334
  const cfg = ensureConfig();
341
335
  if (!cfg.projects[projectPath]) throw new Error(`Project not registered: ${projectPath}`);
342
- for (const [path, proj] of Object.entries(cfg.projects)) if (path !== projectPath && proj?.metroPort === port) return null;
336
+ for (const [path, proj] of Object.entries(cfg.projects)) {
337
+ if (path !== projectPath && proj?.metroPort === port) return null;
338
+ if (Object.values(proj?.ports ?? {}).includes(port)) return null;
339
+ }
343
340
  cfg.projects[projectPath].metroPort = port;
344
341
  saveConfig(cfg);
345
342
  return port;
@@ -364,13 +361,16 @@ function releaseAndroidConsolePort(projectPath, consolePort, slot = "default") {
364
361
  return true;
365
362
  });
366
363
  }
367
- function clearDevice(projectPath, platform, slot = "default") {
368
- withConfigLock(() => {
364
+ function clearDevice(projectPath, platform, slot = "default", expectedId) {
365
+ return withConfigLock(() => {
369
366
  const cfg = loadConfig();
370
367
  const project = cfg?.projects?.[projectPath];
371
- if (!cfg || !project) return;
368
+ if (!cfg || !project) return false;
369
+ const current = deviceSlotPlatforms(project, slot)?.[platform];
370
+ if (expectedId !== void 0 && (platform === "ios" ? current?.deviceUdid : current?.avdName) !== expectedId) return false;
372
371
  removeSlotDevice(project, platform, slot);
373
372
  saveConfig(cfg);
373
+ return true;
374
374
  });
375
375
  }
376
376
  function setSupervisor(projectPath, { pid, port, startedAt, processToken }) {
@@ -396,7 +396,7 @@ function clearSupervisor(projectPath, expected) {
396
396
  const cfg = loadConfig();
397
397
  const current = cfg?.projects?.[projectPath]?.supervisor;
398
398
  if (!current) return true;
399
- if (expected !== void 0 && !sameProcessRecord(current, expected)) return false;
399
+ if (expected !== void 0 && !(0, process_identity_exports.sameProcessRecord)(current, expected)) return false;
400
400
  delete cfg.projects[projectPath].supervisor;
401
401
  saveConfig(cfg);
402
402
  return true;
@@ -459,4 +459,4 @@ function allConsolePortsAndSerials({ isMounted = isOnMountedVolume } = {}) {
459
459
  return result;
460
460
  }
461
461
  //#endregion
462
- export { directorySize as A, removeSlotDevice as B, withConfigLock as C, sameProcessRecord as D, inspectProcessIdentity as E, assignSlotDevice as F, deviceSlotKey as I, deviceSlotPlatforms as L, isOnMountedVolume as M, listMountedVolumes as N, waitForProcessExit as O, volumeRootFor as P, parseDeviceSlotKey as R, upsertProject as S, captureProcessToken as T, validateDeviceSlot as V, releaseAndroidConsolePort as _, clearSupervisor as a, setDevice as b, findEnclosingWorktreeRoot as c, getConfigPath as d, getProject as f, loadConfig as g, isPathPrefix as h, clearDevice as i, formatBytes as j, withDirLock 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, removeProject as v, captureProcessIdentity as w, setSupervisor as x, saveConfig as y, projectDeviceSlots as z };
462
+ export { isOnMountedVolume as A, withConfigLock as C, withDirLock as D, ownership_claim_exports as E, deviceSlotPlatforms as F, parseDeviceSlotKey as I, projectDeviceSlots as L, volumeRootFor as M, assignSlotDevice as N, directorySize as O, deviceSlotKey as P, removeSlotDevice as R, upsertProject as S, acquireAvdClaim as T, releaseAndroidConsolePort as _, clearSupervisor as a, setDevice as b, findEnclosingWorktreeRoot as c, getConfigPath as d, getProject as f, loadConfig as g, isPathPrefix as h, clearDevice as i, listMountedVolumes as j, formatBytes 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, removeProject as v, process_identity_exports as w, setSupervisor as x, saveConfig as y, validateDeviceSlot as z };
@@ -0,0 +1,76 @@
1
+ import { t as getExecutor } from "./exec-CyylIdq9.mjs";
2
+ import { g as repoRoot } from "./worktree-DJnBbQZ9.mjs";
3
+ import { existsSync } from "node:fs";
4
+ import { dirname, join, relative } from "node:path";
5
+ //#region src/dependency-state.ts
6
+ function installedNpmTreeIsValid(projectRoot) {
7
+ try {
8
+ getExecutor().runFile("npm", [
9
+ "ls",
10
+ "--all",
11
+ "--json",
12
+ "--silent"
13
+ ], {
14
+ cwd: projectRoot,
15
+ timeoutMs: 3e4
16
+ });
17
+ return true;
18
+ } catch {
19
+ return false;
20
+ }
21
+ }
22
+ const DEPENDENCY_STATES = [
23
+ {
24
+ lock: "pnpm-lock.yaml",
25
+ installed: ["node_modules"],
26
+ command: "pnpm install"
27
+ },
28
+ {
29
+ lock: "yarn.lock",
30
+ installed: [
31
+ "node_modules",
32
+ ".pnp.cjs",
33
+ ".pnp.js"
34
+ ],
35
+ command: "yarn install"
36
+ },
37
+ {
38
+ lock: "bun.lock",
39
+ installed: ["node_modules"],
40
+ command: "bun install"
41
+ },
42
+ {
43
+ lock: "bun.lockb",
44
+ installed: ["node_modules"],
45
+ command: "bun install"
46
+ },
47
+ {
48
+ lock: "package-lock.json",
49
+ installed: ["node_modules"],
50
+ command: "npm ci"
51
+ }
52
+ ];
53
+ function dependencyState(projectRoot) {
54
+ const root = repoRoot(projectRoot) ?? projectRoot;
55
+ let dir = projectRoot;
56
+ while (true) {
57
+ const state = DEPENDENCY_STATES.find((candidate) => existsSync(join(dir, candidate.lock)));
58
+ if (state) return {
59
+ ...state,
60
+ root: dir
61
+ };
62
+ if (dir === root) return null;
63
+ const parent = dirname(dir);
64
+ if (parent === dir || relative(root, parent).startsWith("..")) return null;
65
+ dir = parent;
66
+ }
67
+ }
68
+ function hasInstalledDependencies(projectRoot, markers = [
69
+ "node_modules",
70
+ ".pnp.cjs",
71
+ ".pnp.js"
72
+ ]) {
73
+ return markers.some((entry) => existsSync(join(projectRoot, entry)));
74
+ }
75
+ //#endregion
76
+ export { hasInstalledDependencies as n, installedNpmTreeIsValid as r, dependencyState as t };
@@ -1,6 +1,6 @@
1
1
  import { t as getExecutor } from "./exec-CyylIdq9.mjs";
2
2
  import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-C7IlIzd7.mjs";
3
- import { f as startBuildHeartbeat, h as bundlerPin, r as HEARTBEAT_INTERVAL_MS } from "./xcode-xnxyvJkD.mjs";
3
+ import { d as startBuildHeartbeat, m as bundlerPin, n as HEARTBEAT_INTERVAL_MS } from "./xcode-BqDeRkpT.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  import { dirname, join, relative, resolve, sep } from "node:path";
6
6
  import { homedir } from "node:os";
@@ -1,15 +1,15 @@
1
1
  import { t as getExecutor } from "./exec-CyylIdq9.mjs";
2
- import { y as ensureWorkspaceStorage } from "./state-B3XA2wp2.mjs";
3
- import { C as removeTemporaryEntry, S as makeTemporaryDirectory } from "./worktree-Eq6TLH8N.mjs";
4
- import { i as detectIsExpo, o as isPackageResolvable } from "./project-fKmuIaMI.mjs";
2
+ import { E as ownership_claim_exports } from "./config-DMP7L7H6.mjs";
3
+ import { c as ensureWorkspaceStorage } from "./workspace-state-WVwWw_hB.mjs";
4
+ import { T as removeTemporaryEntry, w as makeTemporaryDirectory } from "./worktree-DJnBbQZ9.mjs";
5
+ import { i as detectIsExpo, o as isPackageResolvable } from "./project-B_SDt4ip.mjs";
5
6
  import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-C7IlIzd7.mjs";
6
- import { t as NOT_OURS_FOREIGN_CWD } from "./metro-CORqXyTL.mjs";
7
- import { r as claimFailure } from "./ownership-claim-BtPtJVmq.mjs";
8
- import { V as releaseBuildLock, z as acquireBuildLock } from "./android-hMj83VpN.mjs";
9
- import { i as expoBinRefusal, r as expoBinPath, t as cleanLine } from "./server-expo-DizT4OMk.mjs";
10
- import { x as resolveEasCliBin } from "./teardown--gESs9ck.mjs";
11
- import { i as LAUNCH_BUNDLING, s as LAUNCH_UNVERIFIED } from "./app-install-DIp9riNx.mjs";
12
- import { f as startBuildHeartbeat, p as tailLines, r as HEARTBEAT_INTERVAL_MS } from "./xcode-xnxyvJkD.mjs";
7
+ import { t as NOT_OURS_FOREIGN_CWD } from "./metro-ato6ef3J.mjs";
8
+ import { V as releaseBuildLock, z as acquireBuildLock } from "./android-DJWiTBkz.mjs";
9
+ import { i as expoBinRefusal, r as expoBinPath, t as cleanLine } from "./server-expo-Ds8_mfng.mjs";
10
+ import { S as resolveEasCliBin } from "./teardown-CAVcWeRD.mjs";
11
+ import { i as LAUNCH_BUNDLING, s as LAUNCH_UNVERIFIED } from "./app-install--PAocWvq.mjs";
12
+ import { d as startBuildHeartbeat, f as tailLines, n as HEARTBEAT_INTERVAL_MS } from "./xcode-BqDeRkpT.mjs";
13
13
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
14
14
  import { createHash } from "node:crypto";
15
15
  import { basename, join } from "node:path";
@@ -50,7 +50,7 @@ function selectEasBuild(builds, { platform, profile, fingerprint, projectId, phy
50
50
  if (!Array.isArray(builds)) throw new Error("EAS build:list did not return an array.");
51
51
  for (const value of builds) {
52
52
  const build = object(value);
53
- if (typeof build.id === "string" && build.id.length > 0 && build.status === "FINISHED" && build.platform === platform.toUpperCase() && build.buildProfile === profile && object(build.fingerprint).hash === fingerprint && object(build.project).id === projectId && (platform !== "ios" || build.isForIosSimulator === !physical) && build.distribution === "INTERNAL" && typeof object(build.artifacts).applicationArchiveUrl === "string") return build.id;
53
+ if (typeof build.id === "string" && build.id.length > 0 && build.status === "FINISHED" && build.platform === platform.toUpperCase() && build.buildProfile === profile && object(build.fingerprint).hash === fingerprint && (object(build.app).id ?? object(build.project).id) === projectId && (platform !== "ios" || build.isForIosSimulator === !physical) && build.distribution === "INTERNAL" && typeof object(build.artifacts).applicationArchiveUrl === "string") return build.id;
54
54
  }
55
55
  return null;
56
56
  }
@@ -161,7 +161,7 @@ async function resolveEasDevelopmentBuild({ root, platform, profile, note, isExp
161
161
  cacheHit: "remote"
162
162
  };
163
163
  } catch (error) {
164
- const claim = claimFailure(error, null);
164
+ const claim = (0, ownership_claim_exports.claimFailure)(error, null);
165
165
  if (claim) return {
166
166
  ok: false,
167
167
  code: claim.code,
@@ -1,10 +1,10 @@
1
- import { V as validateDeviceSlot } from "./config-CcefMY2Q.mjs";
2
- import { a as findProjectRoot } from "./project-fKmuIaMI.mjs";
3
- import { r as clockTime } from "./command-output-8wHMEde0.mjs";
4
- import { C as memoizeEmulatorProbe, P as resolvePhysicalDevice, i as androidPoolNoCandidatesRefusal, j as probeEmulatorSerial, k as physicalDeviceModel, r as androidPoolCandidates, y as listAdbDevices } from "./android-hMj83VpN.mjs";
5
- import { f as takeLease, l as releaseWorkspaceLeases, n as fileLeaseIo, o as parseLeaseDuration } from "./device-lease-CJwK7OZr.mjs";
6
- import { d as waitForDevice, s as parseDeviceWait, t as selectFromPool } from "./device-pool-CcBNTvM7.mjs";
7
- import { c as listIosDevices, o as iosPoolCandidates, s as iosPoolNoCandidatesRefusal, u as resolveIosPhysicalDevice } from "./ios-device-CWOM_S44.mjs";
1
+ import { z as validateDeviceSlot } from "./config-DMP7L7H6.mjs";
2
+ import { a as findProjectRoot } from "./project-B_SDt4ip.mjs";
3
+ import { r as clockTime } from "./command-output-BuIb_ZOI.mjs";
4
+ import { C as memoizeEmulatorProbe, P as resolvePhysicalDevice, i as androidPoolNoCandidatesRefusal, j as probeEmulatorSerial, k as physicalDeviceModel, r as androidPoolCandidates, y as listAdbDevices } from "./android-DJWiTBkz.mjs";
5
+ import { f as takeLease, l as releaseWorkspaceLeases, n as fileLeaseIo, o as parseLeaseDuration } from "./device-lease-r7yEQ1R8.mjs";
6
+ import { d as waitForDevice, s as parseDeviceWait, t as selectFromPool } from "./device-pool-DU4FQKp5.mjs";
7
+ import { c as listIosDevices, o as iosPoolCandidates, s as iosPoolNoCandidatesRefusal, u as resolveIosPhysicalDevice } from "./ios-device-DJOi9FR5.mjs";
8
8
  import chalk from "chalk";
9
9
  //#region src/commands/device.ts
10
10
  const DEFAULT_FOR = "5m";