@stim-cli/core 1.20.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +2 -0
  2. package/dist/{core-BkgfKqJ8.mjs → core-BTsCO1nW.mjs} +444 -60
  3. package/dist/{index-VDWBflH3.d.mts → index-DKq1j8dw.d.mts} +340 -91
  4. package/dist/index.d.mts +101 -5
  5. package/dist/index.mjs +3 -3
  6. package/dist/keyed-delta-BBoOeR2J.mjs +289 -0
  7. package/dist/noise-DYIbymAJ.d.mts +100 -0
  8. package/dist/noise-session.d.mts +164 -0
  9. package/dist/noise-session.mjs +402 -0
  10. package/dist/noise.d.mts +2 -0
  11. package/dist/noise.mjs +393 -0
  12. package/dist/oversight.mjs +16 -6
  13. package/dist/{ownership-claim-O31Y5iIb.mjs → ownership-claim-DHUs_Dir.mjs} +1 -1
  14. package/dist/{ownership-claim-Xxxr9MPp.d.mts → ownership-claim-RY3fbm1D.d.mts} +3 -2
  15. package/dist/ownership-claim.d.mts +2 -2
  16. package/dist/ownership-claim.mjs +2 -2
  17. package/dist/phone-protocol.d.mts +85 -16
  18. package/dist/phone-protocol.mjs +2 -2
  19. package/dist/{process-identity-BTyww2Xj.d.mts → process-identity-DVNGpF5c.d.mts} +1 -1
  20. package/dist/process-identity.d.mts +1 -1
  21. package/dist/process-identity.mjs +3 -1
  22. package/dist/{protocol-pH632kA3.d.mts → protocol-BjJt4ghB.d.mts} +632 -65
  23. package/dist/protocol.d.mts +2 -2
  24. package/dist/protocol.mjs +81 -10
  25. package/dist/receive-protocol.d.mts +1 -1
  26. package/dist/receive-protocol.mjs +20163 -14469
  27. package/dist/state.d.mts +2 -2
  28. package/dist/state.mjs +1261 -208
  29. package/dist/toolchain.d.mts +64 -0
  30. package/dist/toolchain.mjs +326 -0
  31. package/dist/workspace-link.d.mts +16 -0
  32. package/dist/workspace-link.mjs +50 -0
  33. package/package.json +21 -1
  34. package/dist/status-derived-C13g6eQt.mjs +0 -151
@@ -1,4 +1,5 @@
1
- import { o as ClaimHandle } from "./ownership-claim-Xxxr9MPp.mjs";
1
+ import { o as ClaimHandle } from "./ownership-claim-RY3fbm1D.mjs";
2
+ import { l as NoiseKeyPair } from "./noise-DYIbymAJ.mjs";
2
3
  //#region state/ndjson.d.ts
3
4
  interface NdjsonRecord {
4
5
  ts?: number;
@@ -38,12 +39,14 @@ interface AgentActionReaderOptions {
38
39
  now?: () => number;
39
40
  claimedDevice?: (session: string, sessionsDir: string) => string | null;
40
41
  }
41
- /**
42
- * Reads agent-device session actions incrementally from the supplied sessions directories. With targets,
43
- * records are restricted to those devices; without targets, retained session metadata supplies attribution.
44
- * Missing directories and unreadable files yield no records.
45
- */
46
- declare function createAgentActionReader({ sessionsDirs, targets: resolveTargets, sinceTs, now, claimedDevice }: AgentActionReaderOptions): () => NdjsonRecord[];
42
+ interface AgentRecordSelection {
43
+ tail?: number;
44
+ matches: (record: NdjsonRecord) => boolean;
45
+ }
46
+ /** Reads new agent-device actions synchronously, retaining attribution cursors between reads. */
47
+ declare function createAgentActionReader(options: AgentActionReaderOptions): () => NdjsonRecord[];
48
+ /** Reads new agent-device actions asynchronously; selection applies only to matching output from this call. */
49
+ declare function createAsyncAgentActionReader(options: AgentActionReaderOptions, signal?: AbortSignal): (selection?: AgentRecordSelection) => Promise<NdjsonRecord[]>;
47
50
  //#endregion
48
51
  //#region state/agent-device-usage.d.ts
49
52
  interface AgentDeviceUsage {
@@ -129,6 +132,33 @@ interface SwiftpmCacheUsage {
129
132
  declare function swiftpmCacheUsageFile(): string;
130
133
  declare function readSwiftpmCacheUsage(): SwiftpmCacheUsage | null;
131
134
  //#endregion
135
+ //#region state/machine-cache-usage.d.ts
136
+ interface SimRuntimeUsage {
137
+ identifier: string;
138
+ runtimeIdentifier: string;
139
+ version: string | null;
140
+ build: string | null;
141
+ bytes: number | null;
142
+ deletable: boolean;
143
+ lastUsedAt: string | null;
144
+ devices: number;
145
+ }
146
+ /** The cached measurement of other tools' machine-wide caches that gc reports and never deletes. */
147
+ interface MachineCacheUsage {
148
+ version: 1;
149
+ measuredAt: string;
150
+ roots: string[];
151
+ sizes: {
152
+ dir: string;
153
+ bytes: number | null;
154
+ }[];
155
+ runtimes: SimRuntimeUsage[] | null;
156
+ agentDeviceVersion: string | null;
157
+ xcodeBuildVersion: string | null;
158
+ }
159
+ declare function machineCacheUsageFile(): string;
160
+ declare function readMachineCacheUsage(): MachineCacheUsage | null;
161
+ //#endregion
132
162
  //#region state/build-capacity.d.ts
133
163
  declare function buildSlotsDir(): string;
134
164
  declare function buildSlotPath(index: number): string;
@@ -145,9 +175,9 @@ declare function tryAcquireBuildSlotClaim({ max, details }: {
145
175
  path: string;
146
176
  } | null;
147
177
  /**
148
- * How busy this Mac is for native builds. `loadPerCore` is the 5-minute load average divided by the CPU count,
178
+ * How busy this machine is for native builds. `loadPerCore` is the 5-minute load average divided by the CPU count,
149
179
  * rounded to one decimal. `builds` counts this Stim home's runs that hold a live native-run claim and are in
150
- * prebuild, pods or compile here, not on a remote Mac, plus the build slots this Mac holds for other Macs'
180
+ * prebuild, pods or compile here, not on a remote machine, plus the build slots this machine holds for other machines'
151
181
  * offloaded builds. `maxBuilds` is `concurrency.maxBuilds`, 0 when unlimited.
152
182
  */
153
183
  interface MachineCapacity {
@@ -158,27 +188,37 @@ interface MachineCapacity {
158
188
  maxLoadPerCore: number;
159
189
  }
160
190
  declare function machineCapacity(): MachineCapacity;
161
- /** Why a Mac with this capacity should not take another native build; null when it can. */
191
+ /** Why a machine with this capacity should not take another native build; null when it can. */
162
192
  declare function saturation(capacity: MachineCapacity): string | null;
163
193
  //#endregion
164
194
  //#region state/build-machines.d.ts
165
195
  /**
166
- * A remote Mac this Mac asked to build on. `machine` is the `remote.machines` entry; `nodeId` is the
167
- * worker's tailnet StableID pinned when the request was sent, which every later connection must match.
196
+ * What this machine keeps about a remote machine it asked for access. `machine` is the `remote.machines` entry and
197
+ * `address` the name it resolved to. Once approved, `serverKey` is the worker's pinned stim-server key: every later
198
+ * connection must prove it holds that key. While pending, `ticket` is the setup ticket this machine generated or was
199
+ * given, and `expiresAt` its expiry when known. Records of protocol 1, which pinned a tailnet node, are not read.
168
200
  */
169
- interface BuildMachineCredential {
201
+ interface MachineCredential {
170
202
  machine: string;
171
- nodeId: string;
172
- dnsName: string;
173
- deviceId: string;
174
- deviceToken: string;
203
+ transport: "tailscale";
204
+ address: string;
175
205
  state: "pending" | "approved";
176
206
  requestedAt: string;
207
+ serverKey?: string;
208
+ deviceId?: string;
209
+ ticket?: string;
177
210
  expiresAt?: string;
178
- ticketHash?: string;
179
211
  }
212
+ type BuildMachineCredential = MachineCredential;
213
+ declare const MACHINE_CREDENTIALS_VERSION = 2;
214
+ /** A stored credential, or null when it is malformed or from an older version. */
215
+ declare function parseMachineCredential(value: unknown): MachineCredential | null;
180
216
  declare function readBuildMachines(): BuildMachineCredential[];
181
217
  //#endregion
218
+ //#region state/client-identity.d.ts
219
+ /** This machine's long-term X25519 key as a client of other machines, in `$STIM_HOME/client-identity.key`. */
220
+ declare function clientIdentity(): NoiseKeyPair;
221
+ //#endregion
182
222
  //#region state/config-types.d.ts
183
223
  type SettingsObject = Record<string, unknown>;
184
224
  interface SupervisorRecord {
@@ -251,6 +291,7 @@ interface ConcurrencyLimits {
251
291
  }
252
292
  interface StimConfig {
253
293
  version?: number;
294
+ homeId?: string;
254
295
  projects: Record<string, ProjectRecord>;
255
296
  repos: Record<string, RepoRecord>;
256
297
  tempDir?: unknown;
@@ -280,6 +321,8 @@ interface StimConfig {
280
321
  logs?: unknown;
281
322
  };
282
323
  server?: {
324
+ buildsPaused?: unknown;
325
+ devicesPaused?: unknown;
283
326
  acceptClientBuilds?: unknown;
284
327
  maxLoadPerCore?: unknown;
285
328
  workerRoot?: unknown;
@@ -300,13 +343,28 @@ type Config = StimConfig;
300
343
  type AutomaticPoolRole = "build" | "device";
301
344
  declare function automaticMachineEnabled(role: AutomaticPoolRole, machine: string, config?: StimConfig | null): boolean;
302
345
  declare function requireAutomaticMachine(role: AutomaticPoolRole, machine: string): void;
303
- declare function validateAutomaticPool(role: AutomaticPoolRole, config: StimConfig): void;
346
+ /**
347
+ * Refuses a pool with no enabled member: local, or a configured remote approved for the role. `canHost` excludes
348
+ * device-pool remotes that can never host, such as a Linux machine.
349
+ */
350
+ declare function validateAutomaticPool(role: AutomaticPoolRole, config: StimConfig, canHost?: (machine: string) => boolean): void;
304
351
  //#endregion
305
352
  //#region state/config.d.ts
306
353
  declare function withConfigLock<T>(fn: () => T): T;
354
+ /** Waits for the config lock without blocking the event loop. The signal cancels acquisition; `fn` runs synchronously. */
355
+ declare function withConfigLockAsync<T>(fn: () => T, signal?: AbortSignal): Promise<T>;
307
356
  declare function configCorruptRepair(path?: string): string;
308
357
  /** The build worker root: `server.workerRoot` when it is absolute, else `$STIM_HOME/build-worker`. */
309
358
  declare function buildWorkerRoot(config?: Config | null): string;
359
+ /**
360
+ * A short directory at the drive root that stands in for the build worker directory `path` on Windows. The NDK's
361
+ * ninja is not long-path aware (STIM_PATH_TOO_LONG), and it opens paths under the checkout and under the Gradle user
362
+ * home's transforms cache, both of which are too long under the worker root. A subst drive does not help: Node's
363
+ * native realpath, which expo-modules-autolinking uses, resolves it back to the long path.
364
+ */
365
+ declare function windowsShortDir(path: string, systemDrive?: string): string;
366
+ /** The ASCII key a Windows build worker records beside a `windowsShortDir` to tell which `kind` and `path` it serves. */
367
+ declare function windowsShortDirKey(kind: "checkout" | "gradle", path: string): string;
310
368
  declare function loadConfig(): Config | null;
311
369
  declare function getProject(projectPath: string): ProjectRecord | null;
312
370
  declare function getConcurrencyLimits({ env }?: {
@@ -321,12 +379,10 @@ declare function getParkedMax(platform: "ios" | "android", { config, env }?: {
321
379
  env?: NodeJS.ProcessEnv;
322
380
  }): ParkedMax;
323
381
  declare function getProjectSettings(projectPath: string): Record<string, unknown>;
324
- declare function getProjectSetting(projectPath: string, dottedKey: string): unknown;
325
382
  declare function getRepoSettings(gitCommonDir: string): Record<string, unknown>;
326
383
  declare function isPathPrefix(prefix: string, path: string): boolean;
327
384
  declare function findEnclosingWorktreeRoot(projectPath: string): string | null;
328
385
  declare function allMetroPorts(): number[];
329
- declare function findProjectByMetroPort(port: number): string | null;
330
386
  //#endregion
331
387
  //#region state/debug-log.d.ts
332
388
  declare const DEBUG_ENV = "STIM_DEBUG";
@@ -349,6 +405,10 @@ declare function createDebugLog(component: "cli" | "server", { env, now, base }?
349
405
  base?: () => Record<string, unknown>;
350
406
  }): DebugLog;
351
407
  //#endregion
408
+ //#region state/home-identity.d.ts
409
+ /** The persistent, nonsecret identity of this Stim home; null until the CLI initializes it. */
410
+ declare function readHomeIdentity(config?: Config | null): string | null;
411
+ //#endregion
352
412
  //#region state/json-file.d.ts
353
413
  /**
354
414
  * Runs `fn` with each state file read from disk at most once: inside it, including after an `await`, `readStateFile`
@@ -452,24 +512,42 @@ declare function readLogRecords(dir: string, include?: (name: string) => boolean
452
512
  declare const NATIVE_CRASH_LOG_PREFIX = "native-crash-";
453
513
  /** Reads the CLI timeline with retained native crash records after other records at the same timestamp. */
454
514
  declare function readLogTimeline(dir: string, records?: NdjsonRecord[]): NdjsonRecord[];
515
+ declare function isExpoErrorContext(record: NdjsonRecord, event: unknown): boolean;
455
516
  type ExpoContextTarget = "msg" | "field";
456
517
  /**
457
518
  * Adds the code frame and stack lines Expo printed after each Expo error record, either joined into
458
519
  * `msg` or as a `context` string array.
459
520
  */
460
521
  declare function attachExpoErrorContext(all: NdjsonRecord[], matched: NdjsonRecord[], into?: ExpoContextTarget): NdjsonRecord[];
461
- declare function queryLogs({ slot, dir, records, sources, minLevel, since, grep, tail, errorsOnly, errorContext, now }?: {
522
+ interface LogQueryOptions {
462
523
  slot?: string;
463
- dir?: string;
464
- records?: NdjsonRecord[];
465
524
  sources?: string[];
466
525
  minLevel?: string;
467
526
  since?: string;
468
527
  grep?: string | RegExp;
469
- tail?: number;
470
528
  errorsOnly?: boolean;
471
- errorContext?: boolean;
472
529
  now?: number;
530
+ }
531
+ interface LogQueryPlan {
532
+ /** Whether a record belongs to the queried slot's timeline, before any other filter. */
533
+ inTimeline: (record: NdjsonRecord) => boolean;
534
+ matches: (record: NdjsonRecord) => boolean;
535
+ launchTs: number | null;
536
+ sinceTs: number | undefined;
537
+ /**
538
+ * Whether no record with a timestamp at most `maxTs`, or without one when `maxTs` is Infinity, can match.
539
+ * `slots` lists every `slot ?? 'default'` value the records can carry; without it, a query that depends on
540
+ * per-slot launch markers cannot rule out any timestamp.
541
+ */
542
+ excludesUpTo: (maxTs: number, slots?: ReadonlySet<unknown>) => boolean;
543
+ }
544
+ /** Decides which records a query matches from the timeline's marker records alone. */
545
+ declare function planLogQuery(markers: readonly NdjsonRecord[], { slot, sources, minLevel, since, grep, errorsOnly, now }?: LogQueryOptions): LogQueryPlan;
546
+ declare function queryLogs({ slot, dir, records, sources, minLevel, since, grep, tail, errorsOnly, errorContext, now }?: LogQueryOptions & {
547
+ dir?: string;
548
+ records?: NdjsonRecord[];
549
+ tail?: number;
550
+ errorContext?: boolean;
473
551
  }): NdjsonRecord[];
474
552
  /** Queries the JSON timeline, including Expo context fields on errors as `stim logs --json` does. */
475
553
  declare function queryJsonLogs(options?: Parameters<typeof queryLogs>[0]): NdjsonRecord[];
@@ -485,13 +563,49 @@ declare function followLogs({ dir, onRecord, criteria, intervalMs, offsets, erro
485
563
  dir: string;
486
564
  onRecord: (record: NdjsonRecord) => void;
487
565
  criteria?: QueryCriteria;
566
+ /** An explicit polling interval. Omit for filesystem hints with a ten-second repair scan. */
488
567
  intervalMs?: number;
489
568
  offsets?: Record<string, number> | null;
490
- /** Holds each Expo error until a poll adds no more of its code frame or stack lines, then attaches them. */
569
+ /** Holds each Expo error until its code frame and stack stop growing, then attaches them. */
491
570
  errorContext?: ExpoContextTarget;
492
571
  }): () => void;
493
572
  declare function sortByTs(records: NdjsonRecord[]): NdjsonRecord[];
494
573
  //#endregion
574
+ //#region state/log-reader.d.ts
575
+ interface LogDirQuery extends LogQueryOptions {
576
+ tail?: number;
577
+ /** Records from outside the directory, such as agent-device actions; they follow its records at equal timestamps. */
578
+ extra?: readonly NdjsonRecord[];
579
+ }
580
+ /**
581
+ * An indexed view of a workspace log directory, read in timestamp order without loading whole files. Each file
582
+ * generation is indexed once per process (block timestamp bounds, markers, slots and launch attempts) and later
583
+ * views read only what was appended since. Close it to release the open files.
584
+ */
585
+ interface LogDir {
586
+ /** Bytes read from each current `.ndjson` file, through its last complete line. */
587
+ readonly sizes: Record<string, number>;
588
+ /** The oldest timestamp in the directory. */
589
+ readonly firstTs: number | undefined;
590
+ /** Launch attempt records outside native crash files, in timeline order. */
591
+ launchAttempts(): NdjsonRecord[];
592
+ /** The records `queryJsonLogs` returns for this directory's timeline followed by `extra`. */
593
+ query(query?: LogDirQuery): Promise<NdjsonRecord[]>;
594
+ /** Every matching record in timestamp order, in batches of at most 500, with the same filters and context as query. */
595
+ batches(query?: Omit<LogDirQuery, "tail">): AsyncIterable<NdjsonRecord[]>;
596
+ /** Prepares the directory marker predicate for records without markers, such as attributed agent actions. */
597
+ filter(query?: LogQueryOptions): (record: NdjsonRecord) => boolean;
598
+ close(): Promise<void>;
599
+ }
600
+ /**
601
+ * Opens `dir` for reading. With `order: 'timeline'`, native crash files follow every other file at equal
602
+ * timestamps, as `readLogTimeline` orders them; with `'name'`, every file is ranked by name, as `readLogRecords`.
603
+ */
604
+ declare function openLogDir(dir: string, { order, signal }?: {
605
+ order?: "timeline" | "name";
606
+ signal?: AbortSignal;
607
+ }): Promise<LogDir>;
608
+ //#endregion
495
609
  //#region state/paths.d.ts
496
610
  declare function getConfigPath(): string;
497
611
  declare function configLockPath(): string;
@@ -523,10 +637,10 @@ declare function agentSessionsCacheFile(): string;
523
637
  declare function diskUsageCacheDir(): string;
524
638
  /** The ownership claim root that admits one disk-usage walk at a time on this machine. */
525
639
  declare function diskUsageWalkClaims(): string;
526
- /** The remote Macs this Mac paired with, each with its pinned tailnet node and device token. */
640
+ /** The remote machines this machine asked for build access, each with its pinned stim-server key once approved. */
527
641
  declare function buildMachinesFile(): string;
528
642
  declare function buildMachinesLock(): string;
529
- /** The remote Macs this Mac asked for access, separate from build credentials. */
643
+ /** The remote machines this machine asked for access, separate from build credentials. */
530
644
  declare function deviceHostMachinesFile(): string;
531
645
  declare function deviceHostMachinesLock(): string;
532
646
  declare function deviceHostMachinesClaims(): string;
@@ -547,6 +661,10 @@ declare function maintenanceRunClaims(): string;
547
661
  declare function archiveRoot(): string;
548
662
  declare function archiveDir(id: string): string;
549
663
  declare function archiveLock(): string;
664
+ /** This machine's own long-term X25519 key as a client of other machines' stim-servers. */
665
+ declare function clientIdentityKeyFile(): string;
666
+ /** The Unix socket stim-server serves this machine's own user on, without Noise or pairing. */
667
+ declare function serverLocalSocket(): string;
550
668
  declare function serverSetupDir(): string;
551
669
  declare function setupJournalFile(hash: string): string | null;
552
670
  //#endregion
@@ -582,8 +700,12 @@ declare function closedSegmentName(start: number, end: number): string;
582
700
  declare function openSegmentName(start: number): string;
583
701
  /** The segments in one device directory, oldest first. Files that are not segments are left out; `closedOnly` excludes files still being written. */
584
702
  declare function listSegments(dir: string, closedOnly?: boolean): RecordedSegment[];
703
+ /** Reads current segment files asynchronously, oldest first; cancellation propagates. */
704
+ declare function listSegmentsAsync(dir: string, closedOnly?: boolean, signal?: AbortSignal): Promise<RecordedSegment[]>;
585
705
  /** Every device slot recorded under a workspace's recordings directory. */
586
706
  declare function listRecordedDevices(recordingsDir: string, closedOnly?: boolean): RecordedDevice[];
707
+ /** Reads current device slots and their segment files asynchronously; cancellation propagates. */
708
+ declare function listRecordedDevicesAsync(recordingsDir: string, closedOnly?: boolean, signal?: AbortSignal): Promise<RecordedDevice[]>;
587
709
  declare function recordedBytes(devices: readonly RecordedDevice[]): number;
588
710
  /**
589
711
  * The oldest closed segments to delete so that one device keeps at most `footageMs` of footage. Time between
@@ -603,8 +725,9 @@ declare const RUN_ID_ENV = "STIM_RUN_ID";
603
725
  /** A run id as the CLI and stim-server accept it: letters, digits, `.`, `_` and `-`, at most 64. Null otherwise. */
604
726
  declare function validRunId(value: unknown): string | null;
605
727
  /**
606
- * The id of this CLI invocation: `STIM_RUN_ID` when it holds a valid id (Stim Desktop passes one), else a random one.
607
- * The CLI entry exports it back to `STIM_RUN_ID` so processes the run starts inherit it; this function does not.
728
+ * The run id of the ambient operation context, else of this CLI invocation: `STIM_RUN_ID` when it holds a valid id
729
+ * (Stim Desktop passes one), else a random one. The CLI entry exports it back to `STIM_RUN_ID` so processes the run
730
+ * starts inherit it; this function does not.
608
731
  */
609
732
  declare function runId(env?: NodeJS.ProcessEnv): string;
610
733
  //#endregion
@@ -677,7 +800,7 @@ interface SettingEntry {
677
800
  defaultReason?: string;
678
801
  }
679
802
  /** The payload `stim settings --json` prints. */
680
- interface SettingsPayload {
803
+ type SettingsPayload = {
681
804
  project: string | null;
682
805
  files: Partial<Record<SettingScope, string>>;
683
806
  settings: SettingEntry[];
@@ -687,6 +810,15 @@ interface SettingsPayload {
687
810
  file: string;
688
811
  value: unknown;
689
812
  }>;
813
+ };
814
+ /** The masked JSON result of a settings set or unset. */
815
+ interface SettingWriteResult {
816
+ key: string;
817
+ scope: SettingScope;
818
+ file: string;
819
+ changed: boolean;
820
+ setting: SettingEntry;
821
+ recordingsDeleted?: string[];
690
822
  }
691
823
  declare const REMOTE_DEVICE_BACKENDS: readonly RemoteDeviceBackend[];
692
824
  declare const IOS_SIMULATOR_APPS: readonly ["xcode", "siniulator", "stim-desktop"];
@@ -777,8 +909,11 @@ declare function readHostedApp(session: string, attempt: string, workerHome?: st
777
909
  //#region state/hosted-macos.d.ts
778
910
  /** App slots one host offers; a slot names the host-assigned bundle id `<bundleId>.hosted<slot>`. */
779
911
  declare const HOSTED_MACOS_APP_SLOTS = 64;
912
+ /** The drivers `hosting.agentDriver` can name: `none` and the first-party driver packages stim-server ships. */
780
913
  declare const HOSTED_AGENT_DRIVERS: readonly ["none", "agent-device"];
781
914
  type HostedAgentDriverName = (typeof HOSTED_AGENT_DRIVERS)[number];
915
+ /** A driver name a grant or access record can carry; a client resolves only the drivers it knows. */
916
+ declare function hostedAgentDriverName(value: unknown): value is string;
782
917
  /** What a host reports in a macOS offer: no simulator is created, so the choice is the host itself. */
783
918
  interface HostedMacosChoice {
784
919
  architecture: "arm64" | "x86_64";
@@ -799,21 +934,25 @@ interface HostedAgentLease {
799
934
  deviceKey: string;
800
935
  backend?: "ios-instance" | "android-instance";
801
936
  }
937
+ /**
938
+ * Agent control a driver issues for one installed hosted app. `path` is the session's base route on the host,
939
+ * `scope` the driver's handle that limits it to this one app, and `lease`, for a driver that allocates leases,
940
+ * the scope that pins the allocation.
941
+ */
942
+ interface HostedAgentIssuedGrant {
943
+ driver: string;
944
+ path: string;
945
+ token: string;
946
+ scope: string;
947
+ lease?: HostedAgentLease;
948
+ }
802
949
  /**
803
950
  * Agent control the host grants a client for one installed hosted app, sent only over that client's approved
804
951
  * device-host connection and never journaled. `none` means the host's `hosting.agentDriver` starts no driver.
805
- * `path` is the session's base route on the host, `scope` the driver's handle that limits it to this one app,
806
- * and `lease` the scope that pins the driver's lease allocation.
807
952
  */
808
953
  type HostedAgentGrant = {
809
954
  driver: "none";
810
- } | {
811
- driver: Exclude<HostedAgentDriverName, "none">;
812
- path: string;
813
- token: string;
814
- scope: string;
815
- lease: HostedAgentLease;
816
- };
955
+ } | HostedAgentIssuedGrant;
817
956
  /** `app.launch` and `app.attach` results; a host includes `agent` once the app is installed. */
818
957
  type HostedAppLaunch = HostedAppDelivery & {
819
958
  agent?: HostedAgentGrant;
@@ -827,7 +966,7 @@ type HostedAgentAccess = {
827
966
  driver: "none";
828
967
  setting: "hosting.agentDriver";
829
968
  } | {
830
- driver: "agent-device";
969
+ driver: string;
831
970
  remoteConfig: string;
832
971
  command: string;
833
972
  };
@@ -861,6 +1000,8 @@ interface DeviceHostLimits {
861
1000
  killGraceMs: number;
862
1001
  }
863
1002
  declare const DEVICE_HOST_LIMITS: Readonly<DeviceHostLimits>;
1003
+ /** How many parked sessions one reserve inspects, and possibly retires, before it creates a device. */
1004
+ declare const HOSTED_PARKED_CANDIDATES: number;
864
1005
  /** How long a cancelled hosted worker run can take to settle: SIGTERM, SIGKILL after the grace, then it is abandoned. */
865
1006
  declare function hostedWorkerSettleMs(limits?: Pick<DeviceHostLimits, "killGraceMs">): number;
866
1007
  interface HostedIosChoice {
@@ -1070,6 +1211,11 @@ declare function readBuildHistory(state: WorkspaceState | null | undefined): Par
1070
1211
  declare function readWorkspaceState(root: string): WorkspaceState | null;
1071
1212
  declare function lastUseFrom(state: WorkspaceState | null, logMtimes: readonly number[]): number;
1072
1213
  declare const MAINTENANCE_LOG_NAME = "maintenance.ndjson";
1214
+ /**
1215
+ * When the workspace was last used, in epoch milliseconds. A workspace that recorded no use falls back to the mtime
1216
+ * of its workspace.json, which is written once when the workspace is created, so it is a lower bound on the last
1217
+ * use. NaN when its state.json exists but does not parse, or when workspace.json cannot be read either.
1218
+ */
1073
1219
  declare function workspaceLastUsed(root: string): number;
1074
1220
  declare const WARM_KEY = "warm";
1075
1221
  /** How long a successful warm keeps a workspace `ready` when nothing runs in it. */
@@ -1165,7 +1311,9 @@ declare function hostedIosPlacements(state: WorkspaceState | null): Record<strin
1165
1311
  //#region state/maintenance.d.ts
1166
1312
  type MaintenanceMode = "off" | "report" | "on";
1167
1313
  type MaintenanceCheck = "pressure" | "size" | "worktree" | "sweep";
1168
- type MaintenanceActionKind = "would-clear-outputs" | "would-trim-cache" | "would-empty-cache" | "would-shutdown-device" | "would-stop-workspace" | "would-remove-worktree" | "would-remove-orphan" | "would-unregister-cache";
1314
+ type MaintenanceActionKind = "would-clear-outputs" | "would-trim-cache" | "would-empty-cache" | "would-shutdown-device" | "would-stop-workspace" | "would-remove-worktree" | "would-remove-orphan" | "would-unregister-cache" | "would-delete-parked-device" | "would-delete-devices" | "would-clear-build-dirs" | "would-delete-dependencies" | "would-stop-gradle-daemons" | "would-delete-gradle-version" | "would-delete-temp-leftovers";
1315
+ /** Disk pressure: 0 above every threshold, 1 under the budget floor, 2 under the urgent threshold, 3 under the critical threshold or the hard floor. */
1316
+ type DiskPressureLevel = 0 | 1 | 2 | 3;
1169
1317
  interface MaintenanceAction {
1170
1318
  kind: MaintenanceActionKind;
1171
1319
  target: string;
@@ -1175,13 +1323,15 @@ interface MaintenanceAction {
1175
1323
  dir?: string;
1176
1324
  olderThanDays?: number;
1177
1325
  check?: "worktree" | "sweep" | "disk";
1326
+ /** The disk pressure level that planned the action; it runs only while free disk stays under that level's floor. */
1327
+ level?: 2 | 3;
1178
1328
  }
1179
1329
  interface MaintenanceSize {
1180
1330
  name: string;
1181
1331
  dir: string;
1182
1332
  bytes: number;
1183
1333
  measuredAt: number;
1184
- category: "workspace-outputs" | "build-cache" | "metro-cache" | "compilation-cache" | "ccache" | "other";
1334
+ category: "workspace-outputs" | "build-cache" | "metro-cache" | "compilation-cache" | "ccache" | "owned-devices" | "other";
1185
1335
  workspace?: string;
1186
1336
  idleDays?: number | null;
1187
1337
  blocked?: string;
@@ -1210,6 +1360,7 @@ interface MaintenancePressure {
1210
1360
  culprits?: MemoryCulprit[];
1211
1361
  };
1212
1362
  warningSince: number | null;
1363
+ diskLevel?: DiskPressureLevel;
1213
1364
  }
1214
1365
  interface MaintenancePass {
1215
1366
  startedAt: number;
@@ -1326,7 +1477,11 @@ interface ArchivedUsage {
1326
1477
  };
1327
1478
  }
1328
1479
  declare function readArchives(): ArchivedWorkspace[];
1480
+ /** Reads current archive files asynchronously, outside the synchronous state-read cache; cancellation propagates. */
1481
+ declare function readArchivesAsync(signal?: AbortSignal): Promise<ArchivedWorkspace[]>;
1329
1482
  declare function readArchive(id: string): ArchivedWorkspace | null;
1483
+ /** Reads a current archive without the synchronous state-read cache; invalid or missing records return null. */
1484
+ declare function readArchiveAsync(id: string, signal?: AbortSignal): Promise<ArchivedWorkspace | null>;
1330
1485
  declare function readArchiveState(id: string): WorkspaceState | null;
1331
1486
  declare function archivedUsage(archives: readonly ArchivedWorkspace[]): ArchivedUsage;
1332
1487
  declare function linkReplacedArchives(archives: readonly ArchivedWorkspace[], paths: readonly string[]): ArchivedWorkspace[];
@@ -1343,6 +1498,10 @@ interface MacosBuild {
1343
1498
  startedAt: string;
1344
1499
  finishedAt?: string;
1345
1500
  durationMs?: number;
1501
+ fingerprint?: string;
1502
+ cacheKey?: string;
1503
+ cacheHit?: boolean;
1504
+ cacheSource?: "local" | "provider" | "peer";
1346
1505
  error?: string;
1347
1506
  errorCode?: string;
1348
1507
  buildMachine?: string;
@@ -1384,7 +1543,7 @@ declare const BUILD_PHASES: readonly ["prepare", "cache-lookup", "wait", "prebui
1384
1543
  type BuildPhase = (typeof BUILD_PHASES)[number];
1385
1544
  type ActiveBuildState = "running" | "stale" | "unknown";
1386
1545
  /**
1387
- * Where a running build compiles: `local`, or the remote Mac it was offloaded to, with the phase it is in there
1546
+ * Where a running build compiles: `local`, or the remote machine it was offloaded to, with the phase it is in there
1388
1547
  * (`sync`, `deps`, `prebuild`, `pods`, `build` or `fetch`) and when the offload and that phase started.
1389
1548
  */
1390
1549
  type BuildPlacement = "local" | {
@@ -1499,7 +1658,7 @@ interface LastBuildReport {
1499
1658
  buildMachine?: string;
1500
1659
  /** Where compilation ran: here or a machine name; absent when no build ran. */
1501
1660
  builtOn?: string;
1502
- /** The remote Mac that compiled the app when the build was offloaded. */
1661
+ /** The remote machine that compiled the app when the build was offloaded. */
1503
1662
  offloadedTo?: string;
1504
1663
  /** Why the run built here after it considered offloading; absent when it offloaded or never considered it. */
1505
1664
  offloadFallback?: string;
@@ -1588,7 +1747,7 @@ interface BuildPlanPayload {
1588
1747
  message: string;
1589
1748
  remedy: string;
1590
1749
  };
1591
- /** With ios.remote or android.remote set to auto or a Mac, where the plan assumes the device runs, such as `this Mac; auto may use janics-mac-mini`. */
1750
+ /** With ios.remote or android.remote set to auto or a Mac, where the plan assumes the device runs, such as `this machine; auto may use janics-mac-mini`. */
1592
1751
  placement?: string;
1593
1752
  }
1594
1753
  /** The read-only `stim macos --plan --json` payload; SwiftPM work and worker availability remain unknown. */
@@ -1596,11 +1755,11 @@ interface MacosBuildPlanPayload {
1596
1755
  platform: "macos";
1597
1756
  product: string;
1598
1757
  buildMachine: string;
1599
- fingerprint: null;
1600
- cacheKey: null;
1601
- cacheHit: false;
1758
+ fingerprint: string | null;
1759
+ cacheKey: string | null;
1760
+ cacheHit: boolean;
1602
1761
  provider: null;
1603
- cacheSkipped: false;
1762
+ cacheSkipped: boolean;
1604
1763
  prebuild: null;
1605
1764
  outcome: null;
1606
1765
  expectedMs: null;
@@ -1685,7 +1844,7 @@ type AgentTool = (typeof AGENT_TOOLS)[number];
1685
1844
  * A coding-agent session working in an environment: one whose working directory `cwd` is the environment's path,
1686
1845
  * inside it, or its git worktree root, or one that ran a Stim command in it. `title` is the short name the tool keeps
1687
1846
  * for the session, never its conversation. `lastActiveAt` is the tool's own last update, or the Stim command's time
1688
- * when that is newer. `openUrl` opens the session in the tool's desktop app when that app is installed on this Mac.
1847
+ * when that is newer. `openUrl` opens the session in the tool's desktop app when that app is installed on this machine.
1689
1848
  * `webUrl` opens a Claude Code session with Remote Control connected on claude.ai/code or in the Claude mobile app.
1690
1849
  */
1691
1850
  interface AgentSession {
@@ -1940,6 +2099,8 @@ interface EnvironmentState {
1940
2099
  android: AndroidDeviceState | null | undefined;
1941
2100
  }[];
1942
2101
  path: string;
2102
+ /** The 16-hex identity of the registered canonical project path, used by shared workspace links. */
2103
+ workspaceId?: string;
1943
2104
  /** Statically detected app platforms; always set by status, empty when none are detected. */
1944
2105
  platforms?: string[];
1945
2106
  /** Present when the app's app.json sets expo.extra.stimTutorial to a positive integer: that version. */
@@ -2057,7 +2218,7 @@ type MemorySource = (typeof MEMORY_SOURCES)[number];
2057
2218
  declare const MACHINE_OWNER_KINDS: readonly ["simulator", "emulator", "metro", "build", "browser", "macos", "server", "shared"];
2058
2219
  type MachineOwnerKind = (typeof MACHINE_OWNER_KINDS)[number];
2059
2220
  /**
2060
- * One thing using this Mac's CPU and memory now. Each process is counted in exactly one owner: the one whose root
2221
+ * One thing using this machine's CPU and memory now. Each process is counted in exactly one owner: the one whose root
2061
2222
  * process is its nearest ancestor. `workspace` and `slot` (absent for the default slot) name the workspace a
2062
2223
  * simulator, emulator, Metro, build or Chrome belongs to; a device no workspace records has a null workspace, and
2063
2224
  * machine-wide processes are `shared`. `id` is the simulator's UDID, the emulator's AVD name, Metro's port as text,
@@ -2123,13 +2284,20 @@ interface StatusCacheEntry {
2123
2284
  }
2124
2285
  /** Every finished file in the disk-usage and pull-request caches; a file being written is not listed. */
2125
2286
  declare function listStatusCacheEntries(): StatusCacheEntry[];
2126
- /** A worktree's cached pull request lookup: the branch and HEAD it was looked up for, and when. */
2287
+ /**
2288
+ * A worktree's cached pull request lookup: the branch and HEAD it was looked up for, and when. `containsHead` and
2289
+ * `endedAt` (epoch milliseconds) carry the lookup's pull request facts; entries written before them leave them out.
2290
+ * `partial` marks a lookup made without the title, checks and review decision.
2291
+ */
2127
2292
  interface PullRequestCacheEntry {
2128
2293
  path: string;
2129
2294
  branch: string;
2130
2295
  head: string;
2131
2296
  checkedAt: string;
2132
2297
  pullRequest: WorktreePullRequest | null;
2298
+ containsHead?: boolean;
2299
+ endedAt?: number | null;
2300
+ partial?: true;
2133
2301
  }
2134
2302
  /** The cached pull request lookup of the worktree at `path`, or null before one succeeded. */
2135
2303
  declare function readPullRequestCache(path: string): PullRequestCacheEntry | null;
@@ -2139,7 +2307,7 @@ declare function readDiskUsage(path: string): DiskMeasure | null;
2139
2307
  declare function readDiskUsageFailure(path: string): string | null;
2140
2308
  /** The running build's tool detail its process last wrote, when the file belongs to the build with `claimId`. */
2141
2309
  declare function readBuildDetail(root: string, claimId: string): BuildDetail | null;
2142
- /** The coding-agent sessions `status --watch` last found running on this Mac, and when it looked. */
2310
+ /** The coding-agent sessions `status --watch` last found running on this machine, and when it looked. */
2143
2311
  interface AgentSessionsCache {
2144
2312
  discoveredAt: string;
2145
2313
  sessions: AgentSession[];
@@ -2158,7 +2326,7 @@ declare function readAgentSessionsCache(): AgentSessionsCache | null;
2158
2326
  //#region state/stim-build.d.ts
2159
2327
  /**
2160
2328
  * A digest of Stim's built code: the first 16 hex characters of the sha256 over the sorted `*.mjs` names and
2161
- * bytes of a `stim` `dist` directory. A client and a remote Mac offload only when both compute the same one.
2329
+ * bytes of a `stim` `dist` directory. A client and a remote machine offload only when both compute the same one.
2162
2330
  */
2163
2331
  declare function stimBuildDigest(dir: string): string | null;
2164
2332
  //#endregion
@@ -2209,7 +2377,7 @@ interface RunSample {
2209
2377
  deviceSetup?: boolean;
2210
2378
  }
2211
2379
  type RunHistory = Partial<Record<StatsPlatform, Partial<Record<RunOutcomeKind, RunSample[]>>>>;
2212
- /** Where a compiling build ran: here, on a remote Mac, or here after offloading it failed. */
2380
+ /** Where a compiling build ran: here, on a remote machine, or here after offloading it failed. */
2213
2381
  declare const PLACEMENT_DECISIONS: readonly ["here", "offloaded", "fell-back"];
2214
2382
  type PlacementDecision = (typeof PLACEMENT_DECISIONS)[number];
2215
2383
  interface StatsPlacement {
@@ -2318,21 +2486,22 @@ declare function decodeStats(text: string): {
2318
2486
  record: StatsRecord | null;
2319
2487
  newerVersion: number | null;
2320
2488
  };
2321
- interface StatsReport {
2489
+ type StatsBuckets = {
2490
+ ios: StatsBucket | null;
2491
+ android: StatsBucket | null;
2492
+ };
2493
+ type StatsReport = {
2322
2494
  version: number;
2323
2495
  project: ({
2324
2496
  key: string;
2325
- } & StatsReport["machine"]) | null;
2326
- machine: {
2327
- ios: StatsBucket | null;
2328
- android: StatsBucket | null;
2329
- };
2497
+ } & StatsBuckets) | null;
2498
+ machine: StatsBuckets;
2330
2499
  offload: OffloadSummary;
2331
2500
  capacityRefusals?: StatsCapacityRefusal[];
2332
2501
  capacityWaits?: StatsCapacityWait[];
2333
2502
  agentDevice: AgentDeviceUsage | null;
2334
2503
  swiftpmCache: SwiftpmCacheUsage | null;
2335
- }
2504
+ };
2336
2505
  declare function readStatsReport(key: string | null, now: number): {
2337
2506
  report: StatsReport;
2338
2507
  note: string | null;
@@ -2341,19 +2510,12 @@ declare function projectRootDirectories(startDir: string): Generator<string>;
2341
2510
  declare function findProjectRoot(startDir: string): string | null;
2342
2511
  //#endregion
2343
2512
  //#region state/device-host-machines.d.ts
2344
- /** A separately approved remote Mac, pinned before sending its device token. */
2345
- interface DeviceHostMachineCredential {
2346
- machine: string;
2347
- nodeId: string;
2348
- dnsName: string;
2349
- deviceId: string;
2350
- deviceToken: string;
2351
- state: "pending" | "approved";
2352
- requestedAt: string;
2353
- expiresAt?: string;
2354
- ticketHash?: string;
2355
- }
2356
- /** An absent store is empty; unreadable or malformed credentials refuse access without discarding pins. */
2513
+ /** A remote machine this machine asked for device-host access, separate from build credentials. */
2514
+ type DeviceHostMachineCredential = MachineCredential;
2515
+ /**
2516
+ * An absent store, or one from protocol 1, is empty; an unreadable or malformed one refuses access without discarding
2517
+ * pinned keys.
2518
+ */
2357
2519
  declare function readDeviceHostMachines(): DeviceHostMachineCredential[];
2358
2520
  //#endregion
2359
2521
  //#region state/hosted-metro.d.ts
@@ -2383,6 +2545,8 @@ interface TailnetPeer {
2383
2545
  dnsName: string;
2384
2546
  /** A tailnet address of the node; WireGuard delivers packets to it only from that node. */
2385
2547
  address: string;
2548
+ /** Tailscale's `OS` for the node, such as `macOS` or `linux`; absent when the status does not report it. */
2549
+ os?: string;
2386
2550
  }
2387
2551
  declare function parseMachine(entry: string): {
2388
2552
  name: string;
@@ -2393,25 +2557,27 @@ declare function parseMachine(entry: string): {
2393
2557
  * the node's StableID, the same value `tailscale whois` reports as `Node.StableID`.
2394
2558
  */
2395
2559
  declare function findPeer(status: unknown, name: string): TailnetPeer | "missing" | "ambiguous";
2560
+ /**
2561
+ * Whether `tailscale status` reports the peer a `remote.machines` entry names as running an OS other than macOS.
2562
+ * Such a machine can build but never host simulators or emulators; an unknown OS counts as able to host.
2563
+ */
2564
+ declare function cannotHost(status: unknown, entry: string): boolean;
2396
2565
  interface Endpoint {
2397
2566
  url: string;
2398
2567
  servername: string;
2399
2568
  host: string;
2400
2569
  }
2401
2570
  /**
2402
- * Connects to the pinned node's own tailnet address rather than resolving its name, so the socket reaches the
2403
- * node whose ID was just checked. `tailscale serve` still needs the MagicDNS name for TLS (SNI and certificate)
2404
- * and for its Host routing.
2571
+ * Connects to the node's own tailnet address from `tailscale status`. `tailscale serve` still needs the MagicDNS name
2572
+ * for TLS (SNI and certificate) and for its Host routing.
2405
2573
  */
2406
2574
  declare function endpoint(peer: TailnetPeer, port: number): Endpoint;
2407
2575
  /**
2408
- * The endpoint of a paired machine's pinned node, or why Stim does not connect to it. The name must still
2409
- * resolve to exactly the pinned node; the token is never sent anywhere else.
2576
+ * Where to reach a `remote.machines` entry now, or why Stim cannot. The tailnet only carries the bytes: the Noise
2577
+ * handshake, pinned to the worker's server key, decides whether the machine answering is the one this machine paired
2578
+ * with.
2410
2579
  */
2411
- declare function pinnedEndpoint(credential: {
2412
- machine: string;
2413
- nodeId: string;
2414
- }, current: unknown): Endpoint | string;
2580
+ declare function machineEndpoint(machine: string, current: unknown): Endpoint | string;
2415
2581
  //#endregion
2416
2582
  //#region state/hosted-logs.d.ts
2417
2583
  type HostedLogsCursor = Record<string, number>;
@@ -2444,15 +2610,17 @@ declare function readHostedNativeLogsCheckpoint(home: string, platform?: "ios" |
2444
2610
  declare function readLogsSince(dir: string, cursor: HostedLogsCursor): HostedLogsPage;
2445
2611
  //#endregion
2446
2612
  //#region state/agent-device.d.ts
2447
- declare function agentDeviceStateDirs(home?: string): string[];
2613
+ declare function agentDeviceStateDirs(home?: string, env?: NodeJS.ProcessEnv): string[];
2614
+ declare function agentDeviceStateDirsAsync(home?: string, env?: NodeJS.ProcessEnv): Promise<string[]>;
2448
2615
  //#endregion
2449
2616
  //#region state/setup-journal.d.ts
2450
2617
  type SetupCapability = "build" | "device-host";
2618
+ /**
2619
+ * A `stim-server setup` run's progress, named by the `journal` value derived from its ticket. It holds no secret, so it
2620
+ * is served to whoever names it.
2621
+ */
2451
2622
  interface SetupJournal {
2452
2623
  v: 1;
2453
- client: {
2454
- nodeId: string;
2455
- };
2456
2624
  expiresAt: string;
2457
2625
  capabilities: SetupCapability[];
2458
2626
  steps: {
@@ -2474,4 +2642,85 @@ declare function readSetupJournal(hash: string): SetupJournal | null;
2474
2642
  declare function isJournalExpired(journal: SetupJournal, now?: number): boolean;
2475
2643
  declare function isSetupJournalPrunable(journal: SetupJournal, now: number): boolean;
2476
2644
  //#endregion
2477
- export { projectRootDirectories as $, SettingType as $a, readAgentDeviceUsageCache as $c, parseHostedPlatformDevice as $i, MacosAppState as $n, maintenanceDir as $o, DevServerStopRecord as $r, isJsonObject as $s, BuildPlacement as $t, DeviceHostMachineCredential as A, parseHostedAppOffer as Aa, DeviceRecord as Ac, HostedDevice as Ai, PlannedPhase as An, agentSessionsCacheFile as Ao, HostedIosStatus as Ar, buildCriteria as As, ACTIVITY_RECENCY_BASES as At, RunHistory as B, ANDROID_EMULATOR_APPS as Ba, MachineCapacity as Bc, HostedNativeOffer as Bi, TUTORIAL_VERSION as Bn, deviceHostMachinesFile as Bo, hostedAndroidRecords as Br, readLogRecords as Bs, AppPresence as Bt, pinnedEndpoint as C, HostedAppFile as Ca, withConfigLock as Cc, readWorkspaceAgent as Ci, MemorySource as Cn, footageDrops as Co, MaintenanceState as Cr, workspaceStateFile as Cs, readBuildDetail as Ct, HostedMetroRequest as D, hostedAppAttempt as Da, validateAutomaticPool as Dc, DeviceHostLimits as Di, PHYSICAL_DEVICE_CONNECTIONS as Dn, recordedBytes as Do, readMaintenanceAttempt as Dr, QueryCriteria as Ds, readPullRequestCache as Dt, HostedMetroGateway as E, hostedAppArea as Ea, requireAutomaticMachine as Ec, DEVICE_HOST_LIMITS as Ei, NativeBuildStep as En, openSegmentName as Eo, parseMaintenanceState as Er, NATIVE_CRASH_LOG_PREFIX as Es, readEndedAgentSessions as Et, HISTORY_LIMIT as F, validHostedAppBlob as Fa, SettingsObject as Fc, HostedDeviceRequest as Fi, StatsPlatform as Fn, buildMachinesLock as Fo, unreadableHostedIos as Fr, logFiles as Fs, ActivityRecencyBasis as Ft, StatsCapacityWait as G, REMOTE_DEVICE_BACKENDS as Ga, tryAcquireBuildSlotClaim as Gc, hostedDeviceId as Gi, WebBrowserState as Gn, easMachineStateRoot as Go, hostedNativeRecords as Gr, countErrorEntries as Gs, BuildCause as Gt, STATS_VERSION as H, IOS_SIMULATOR_APPS as Ha, buildSlotsDir as Hc, deviceHostArea as Hi, WORKSPACE_PHASES as Hn, deviceViewersDir as Ho, parseHostedAndroidPlacement as Hr, recordMatches as Hs, BUILD_RESULTS as Ht, OffloadSummary as I, SETTINGS_SCHEMA_FILE as Ia, StimConfig as Ic, HostedDeviceSelectors as Ii, StatusCapacity as In, configLockPath as Io, HostedAndroidPlacement as Ir, markerWindow as Is, AgentSession as It, StatsReport as J, SETTING_GROUPS as Ja, swiftpmCacheUsageFile as Jc, parseHostedChoice as Ji, WorkspaceStage as Jn, emulatorLogFile as Jo, BUILD_HISTORY_KEY as Jr, EasSessionClaim as Js, BuildHistoryEntry as Jt, StatsPlacement as K, RemoteDeviceBackend as Ka, SwiftpmCacheUsage as Kc, hostedWorkerSettleMs as Ki, WebPageState as Kn, easSessionLedgerFile as Ko, parseHostedNativePlacement as Kr, CreatedDevicePlatform as Ks, BuildDetail as Kt, PLACEMENT_DECISIONS as L, SETTINGS_SCHEMA_URL as La, SupervisorRecord as Lc, HostedDeviceSession as Li, StatusIssue as Ln, createdDevicesFile as Lo, HostedAndroidStatus as Lr, parseSince as Ls, AgentTool as Lt, BuildMachineTotals as M, readHostedAppMetadata as Ma, PlatformRecords as Mc, HostedDeviceOfferRequest as Mi, RunOutcomeKind as Mn, archiveLock as Mo, hostedIosRecords as Mr, compileGrep as Ms, APP_PROCESS_STATES as Mt, CAPACITY_REFUSAL_LIMIT as N, rememberHostedAppBlobRename as Na, ProjectRecord as Nc, HostedDevicePhase as Ni, STATUS_ISSUE_CODES as Nn, archiveRoot as No, hostedIosStatus as Nr, fileSizes as Ns, ActiveBuildState as Nt, hostedMetroGateways as O, hostedAppBlobs as Oa, ConcurrencyLimits as Oc, HostedAndroidChoice as Oi, PhysicalDeviceConnection as On, recordingDeviceName as Oo, readMaintenanceState as Or, advanceTail as Os, withDerivedFacts as Ot, CAPACITY_REFUSAL_MAX_AGE_MS as P, validHostedAppArguments as Pa, RepoRecord as Pc, HostedDevicePlatform as Pi, SimulatorState as Pn, buildMachinesFile as Po, parseHostedIosPlacement as Pr, followLogs as Ps, ActivityDriver as Pt, offloadSummary as Q, SettingScope as Qa, readAgentDeviceUsage as Qc, parseHostedOfferRequest as Qi, MacosAppRecord as Qn, maintenanceChildLogFile as Qo, DEV_SERVER_STOP_REQUEST_KEY as Qr, validEasSessionClaim as Qs, BuildPhase as Qt, ReadStatsResult as R, settingsJsonSchema as Ra, BuildMachineCredential as Rc, HostedIosChoice as Ri, StatusIssueCode as Rn, createdDevicesLock as Ro, hostedAndroidDeviceName as Rr, queryJsonLogs as Rs, AndroidDeviceState as Rt, parseMachine as S, HostedAppDelivery as Sa, loadConfig as Sc, readWarmRecord as Si, MacosBuildPlanPayload as Sn, closedSegmentName as So, MaintenanceSize as Sr, workspaceRecordingsDir as Ss, readAgentSessionsCache as St, HOSTED_METRO_REQUESTS_KEY as T, HostedAppRecord as Ta, automaticMachineEnabled as Tc, workspaceLastUsed as Ti, NATIVE_BUILD_STEPS as Tn, listSegments as To, MemoryCulprit as Tr, ERROR_SOURCES as Ts, readDiskUsageFailure as Tt, StatsBucket as U, OFFLOAD_MODES as Ua, machineCapacity as Uc, deviceHostRoot as Ui, WORKSPACE_STAGE_KINDS as Un, diskUsageCacheDir as Uo, unreadableHostedAndroid as Ur, sortByTs as Us, BuildActivity as Ut, RunSample as V, ANDROID_PCH_CHOICES as Va, buildSlotPath as Vc, assertHostedDeviceLedger as Vi, WEB_PAGE_STATES as Vn, deviceHostMachinesLock as Vo, hostedAndroidStatus as Vr, readLogTimeline as Vs, BUILD_PHASES as Vt, StatsCapacityRefusal as W, OffloadMode as Wa, saturation as Wc, hostedConsolePort as Wi, WarmStep as Wn, diskUsageWalkClaims as Wo, HostedNativePlacement as Wr, tailRead as Ws, BuildCacheHit as Wt, decodeStats as X, SettingDefinition as Xa, AgentDeviceUsageRoots as Xc, parseHostedLocalDeviceCount as Xi, WorktreeGit as Xn, gitMergeCacheDir as Xo, DEVICE_IDLE_SHUTDOWN_KEY as Xr, readCreatedDevices as Xs, BuildMissChange as Xt, StatsScope as Y, SETTING_SCOPES as Ya, AgentDeviceUsage as Yc, parseHostedDevice as Yi, WorktreeFacts as Yn, getConfigPath as Yo, BUILD_HISTORY_LIMIT as Yr, EasSessionLedgerRead as Ys, BuildMissCategory as Yt, findProjectRoot as Z, SettingEntry as Za, agentDeviceUsageFile as Zc, parseHostedNativeOffer as Zi, WorktreePullRequest as Zn, maintenanceAttemptFile as Zo, DEVICE_RECLAIM_REASON as Zr, readEasSessionLedger as Zs, BuildMissReason as Zt, Endpoint as _, parseHostedAgentGrant as _a, getProject as _c, readDevServerStopRequest as _i, MACHINE_OWNER_KINDS as _n, RECORDING_PLATFORMS as _o, MaintenanceCheck as _r, workspaceEndedAgentsLock as _s, diskUsageCacheFile as _t, parseSetupJournal as a, HOSTED_MACOS_APP_SLOTS as aa, DebugLog as ac, MAINTENANCE_LOG_NAME as ai, SOURCES as al, ChecksState as an, acceptsShape as ao, readMacosRecord as ar, setupJournalFile as as, trimCapacityWaits as at, endpoint as b, parseHostedMacosPlacement as ba, getRepoSettings as bc, readIdleStop as bi, MachineOwnerKind as bn, RecordingPlatform as bo, MaintenancePressure as br, workspaceLogsDir as bs, listStatusCacheEntries as bt, HOSTED_LOGS_FIRST_BYTES as c, HostedAgentGrant as ca, debugLoggingEnabled as cc, WARM_KEY as ci, parseNdjsonText as cl, DeviceLeaseState as cn, isLayeredSetting as co, ArchivedWorkspace as cr, sharedGradle as cs, DeviceViewersRecord as ct, HostedLogsPage as d, HostedMacosChoice as da, buildWorkerRoot as dc, WorkspaceState as di, EndedAgentSession as dn, settingValueError as do, linkReplacedArchives as dr, supervisorLogFile as ds, stimBuildDigest as dt, parseHostedRequest as ea, readJsonFile as ec, DevServerStopRequest as ei, AgentActionReaderOptions as el, BuildPlanPayload as en, SettingsPayload as eo, MacosBuild as er, maintenanceNdjsonFile as es, readRunEstimates as et, hostedMacosLogsDir as f, HostedMacosDevice as fa, configCorruptRepair as fc, buildDiagnostics as fi, EnvironmentDisk as fn, RUN_ID_ENV as fo, readArchive as fr, supervisorPidFile as fs, AgentSessionsCache as ft, readLogsSince as g, parseHostedAgentAccess as ga, getParkedMax as gc, readDevServerStop as gi, LastBuildReport as gn, RECORDING_FOOTAGE_MS as go, MaintenanceActionKind as gr, workspaceEndedAgentsFile as gs, agentSessionOf as gt, readHostedNativeLogsCheckpoint as h, hostedMacosBundleId as ha, getConcurrencyLimits as hc, readBuildHistory as hi, GitChipPart as hn, RECORDING_CAP_BYTES as ho, MaintenanceAction as hr, workspaceDerivedData as hs, StatusCacheEntry as ht, isSetupJournalPrunable as i, HOSTED_AGENT_DRIVERS as ia, DEBUG_ENV as ic, LAST_BUILD_KEYS as ii, NdjsonRecord as il, BuildWaitingFor as in, WebViewport as io, readHostedMacosApp as ir, serverSetupDir as is, trimCapacityRefusals as it, readDeviceHostMachines as j, readHostedApp as ja, DoctorRunRecord as jc, HostedDeviceOffer as ji, RemoteDeviceState as jn, archiveDir as jo, hostedIosPlacements as jr, bundleMarkerPlatform as js, AGENT_TOOLS as jt, hostedMetroRequests as k, parseHostedAppManifest as ka, Config as kc, HostedAndroidDevice as ki, PhysicalDeviceState as kn, recordingEnabled as ko, HostedIosPlacement as kr, attachExpoErrorContext as ks, withGitChip as kt, HOSTED_LOGS_PAGE_BYTES as l, HostedAgentLease as la, ParkedMax as lc, WORKSPACE_AGENT_KEY as li, readNdjsonGenerations as ll, DevicePlacement as ln, isSensitiveReference as lo, archiveEnabled as lr, sharedPods as ls, ViewedDevice as lt, parseHostedLogsCursor as m, hostedMacosAppSlot as ma, findProjectByMetroPort as mc, parseMissReason as mi, GitChip as mn, validRunId as mo, readArchives as mr, workspaceBuildDetailFile as ms, PullRequestCacheEntry as mt, SetupJournal as n, readHostedDeviceLedger as na, readStateFile as nc, IDLE_STOP_KEY as ni, createAgentActionReader as nl, BuildReport as nn, TunnelMode as no, macosAppState as nr, maintenanceStateFile as ns, readStatsReport as nt, readSetupJournal as o, HostedAgentAccess as oa, createDebugLog as oc, MetroLastStop as oi, levelRank as ol, DeviceActivity as on, coerceSettingText as oo, ArchivedBytes as or, sharedCcache as os, trimSamples as ot, hostedNativeLogsDir as p, HostedMacosPlacement as pa, findEnclosingWorktreeRoot as pc, lastUseFrom as pi, EnvironmentState as pn, runId as po, readArchiveState as pr, workspaceAgentDeviceDir as ps, ENDED_AGENT_RETENTION_MS as pt, StatsRecord as q, SETTINGS as qa, readSwiftpmCacheUsage as qc, parseHostedAndroidDevice as qi, WorkspacePhase as qn, easSessionLedgerLock as qo, unreadableHostedNative as qr, CreatedDevices as qs, BuildDiagnostic as qt, isJournalExpired as r, readHostedSessions as ra, withStateReadCache as rc, IdleStopRecord as ri, LEVELS as rl, BuildResult as rn, WEB_VIEWPORTS as ro, parseMacosRecord as rr, pullRequestCacheDir as rs, statsProjectKey as rt, agentDeviceStateDirs as s, HostedAgentDriverName as sa, debugLogDir as sc, READY_PHASE_MS as si, parseNdjsonLine as sl, DeviceAppProcess as sn, expectedShape as so, ArchivedUsage as sr, sharedCompilationCache as ss, wholePhases as st, SetupCapability as t, readHostedDevice as ta, readJsonObject as tc, DeviceIdleShutdownRecord as ti, AgentTarget as tl, BuildPlatform as tn, TUNNEL_MODES as to, MacosProcess as tr, maintenanceRunClaims as ts, readStats as tt, HostedLogsCursor as u, HostedAppLaunch as ua, allMetroPorts as uc, WarmRecord as ui, DiskMeasure as un, settingDefinition as uo, archivedUsage as ur, statsFile as us, readViewedDevices as ut, TAILNET_MACHINE_PATTERN as v, parseHostedMacosChoice as va, getProjectSetting as vc, readDeviceIdleShutdowns as vi, MEMORY_SOURCES as vn, RecordedDevice as vo, MaintenanceMode as vr, workspaceGradleBuild as vs, diskUsageFailureFile as vt, HOSTED_METRO_GATEWAYS_KEY as w, HostedAppOffer as wa, AutomaticPoolRole as wc, readWorkspaceState as wi, MetroBundleState as wn, listRecordedDevices as wo, MaintenanceStatus as wr, workspaceStateLock as ws, readDiskUsage as wt, findPeer as x, HOSTED_APP_CHUNK_BYTES as xa, isPathPrefix as xc, readLastBuilds as xi, MachineUsageState as xn, capDrops as xo, MaintenanceRecord as xr, workspaceMetadataFile as xs, pullRequestCacheFile as xt, TailnetPeer as y, parseHostedMacosDevice as ya, getProjectSettings as yc, readDevicePlacement as yi, MachineOwner as yn, RecordedSegment as yo, MaintenancePass as yr, workspaceLogErrorIndex as ys, endedAgentSessionOf as yt, RunEstimates as z, ANDROID_COMPILER_CACHE_CHOICES as za, readBuildMachines as zc, HostedIosDevice as zi, StatusPayload as zn, deviceHostMachinesClaims as zo, hostedAndroidPlacements as zr, queryLogs as zs, AndroidRuntimeFacts as zt };
2645
+ //#region state/status-views.d.ts
2646
+ /** How many of the newest archives the workspace list names. */
2647
+ declare const SUMMARY_ARCHIVES = 10;
2648
+ /** A build as a workspace summary carries it: everything but its fingerprint, miss reason and later diagnostics. */
2649
+ type SummaryBuild = Omit<LastBuildReport, "fingerprint" | "missReason">;
2650
+ type SummaryHistoryEntry = SummaryBuild & Pick<BuildHistoryEntry, "result" | "slot" | "phases">;
2651
+ type SummaryPlatforms<K extends "lastBuilds" | "builds", V> = Partial<Record<keyof NonNullable<EnvironmentState[K]>, V>>;
2652
+ /**
2653
+ * A workspace as the list of every workspace shows it: the environment `stim status --json` prints, without what only a
2654
+ * shown workspace reads. A build drops its fingerprint, miss reason and every diagnostic but the first one with a file
2655
+ * and a line. Each platform's history keeps its newest build and, while that one failed, every failure right before
2656
+ * it, which is what a failure streak counts. `logs` keeps only its error count, a pull request drops its review
2657
+ * decision and lookup time, a macOS app its launch arguments, and `agentDevice` stays only on a tutorial workspace.
2658
+ */
2659
+ type WorkspaceSummary = Omit<EnvironmentState, "logs" | "builds" | "lastBuilds" | "macos" | "agentDevice" | "worktree"> & {
2660
+ logs?: {
2661
+ errorsSinceMarker: number;
2662
+ } | null;
2663
+ lastBuilds?: SummaryPlatforms<"lastBuilds", SummaryBuild>;
2664
+ builds?: SummaryPlatforms<"builds", SummaryHistoryEntry[]>;
2665
+ macos?: Omit<NonNullable<EnvironmentState["macos"]>, "arguments"> | null;
2666
+ agentDevice?: EnvironmentState["agentDevice"];
2667
+ worktree?: (Omit<WorktreeFacts, "pullRequest"> & {
2668
+ pullRequest?: Omit<NonNullable<WorktreeFacts["pullRequest"]>, "reviewDecision" | "checkedAt"> | null;
2669
+ }) | null;
2670
+ labelOnly?: true;
2671
+ };
2672
+ /** An unprovisioned worktree as the workspace list shows it. */
2673
+ type WorktreeRow = Pick<WorktreeFacts, "path" | "branch" | "repository" | "git" | "gitChip"> & {
2674
+ pullRequest?: Omit<NonNullable<WorktreeFacts["pullRequest"]>, "reviewDecision" | "checkedAt"> | null;
2675
+ };
2676
+ /** The archives, counted, with the newest named; the rest are read a page at a time. */
2677
+ interface ArchivedSummary {
2678
+ count: number;
2679
+ bytes: number;
2680
+ newest: Pick<ArchivedWorkspace, "id" | "projectRoot" | "project" | "workspace" | "removedAt">[];
2681
+ }
2682
+ /** The machine, as the always-visible capacity, memory and maintenance indicators show it. */
2683
+ interface MachineView {
2684
+ capacity: StatusPayload["capacity"];
2685
+ machine: StatusPayload["machine"];
2686
+ deviceLeases: StatusPayload["deviceLeases"];
2687
+ simctlAvailable: boolean;
2688
+ maintenance: Omit<MaintenanceStatus, "recent" | "sizes"> | null;
2689
+ }
2690
+ interface StatusViews {
2691
+ workspaces: WorkspaceSummary[];
2692
+ worktrees: WorktreeRow[];
2693
+ archived: ArchivedSummary;
2694
+ machine: MachineView;
2695
+ /** The full environment of each workspace by path, as `stim status --json` prints it. */
2696
+ details: Map<string, StatusPayload["environments"][number]>;
2697
+ }
2698
+ /** The summary of one environment of a status payload. */
2699
+ declare function workspaceSummary(environment: StatusPayload["environments"][number]): WorkspaceSummary;
2700
+ /** The live views of a status payload as `stim status --json` prints it. */
2701
+ declare function statusViews(payload: StatusPayload): StatusViews;
2702
+ //#endregion
2703
+ //#region state/keyed-delta.d.ts
2704
+ /** The entities that changed since the last emit: whole entities to insert or replace, and keys to drop. */
2705
+ interface KeyedDelta<T> {
2706
+ upsert: T[];
2707
+ remove: string[];
2708
+ }
2709
+ /**
2710
+ * Tracks the JSON of the entities last sent on one subscription, so the next emit carries only what changed. An
2711
+ * entity counts as changed when its JSON differs, so the order of its fields matters and producers build entities
2712
+ * with a stable field order.
2713
+ */
2714
+ declare class KeyedEntities<T> {
2715
+ private sent;
2716
+ private readonly key;
2717
+ constructor(key: (entity: T) => string);
2718
+ /** Records `entities` as sent in full, for a snapshot. */
2719
+ reset(entities: readonly T[]): void;
2720
+ /** The delta from what was last sent to `entities`, recorded as sent; null when nothing changed. */
2721
+ next(entities: readonly T[]): KeyedDelta<T> | null;
2722
+ }
2723
+ /** Applies `delta` to `entities` keyed by `key`, keeping the order of `entities` and appending new keys. */
2724
+ declare function applyKeyedDelta<T>(entities: readonly T[], delta: KeyedDelta<T>, key: (entity: T) => string): T[];
2725
+ //#endregion
2726
+ export { ReadStatsResult as $, readHostedAppMetadata as $a, isPathPrefix as $c, HostedDevicePlatform as $i, parseNdjsonText as $l, StatusIssueCode as $n, recordingEnabled as $o, unreadableHostedIos as $r, openLogDir as $s, AndroidDeviceState as $t, readLogsSince as A, HostedAppLaunch as Aa, readEasSessionLedger as Ac, buildDiagnostics as Ai, tryAcquireBuildSlotClaim as Al, GitChipPart as An, isLayeredSetting as Ao, readArchives as Ar, serverSetupDir as As, StatusCacheEntry as At, HOSTED_METRO_REQUESTS_KEY as B, parseHostedMacosDevice as Ba, createDebugLog as Bc, readWarmRecord as Bi, agentDeviceUsageFile as Bl, NATIVE_BUILD_STEPS as Bn, RecordedDevice as Bo, MaintenanceSize as Br, workspaceBuildDetailFile as Bs, readDiskUsageFailure as Bt, HOSTED_LOGS_PAGE_BYTES as C, HOSTED_AGENT_DRIVERS as Ca, tailRead as Cc, MAINTENANCE_LOG_NAME as Ci, parseMachineCredential as Cl, DeviceLeaseState as Cn, TUNNEL_MODES as Co, ArchivedWorkspace as Cr, maintenanceChildLogFile as Cs, DeviceViewersRecord as Ct, hostedNativeLogsDir as D, HostedAgentGrant as Da, EasSessionClaim as Dc, WORKSPACE_AGENT_KEY as Di, buildSlotsDir as Dl, EnvironmentDisk as Dn, acceptsShape as Do, readArchive as Dr, maintenanceStateFile as Ds, AgentSessionsCache as Dt, hostedMacosLogsDir as E, HostedAgentDriverName as Ea, CreatedDevices as Ec, WARM_KEY as Ei, buildSlotPath as El, EndedAgentSession as En, WebViewport as Eo, linkReplacedArchives as Er, maintenanceRunClaims as Es, stimBuildDigest as Et, endpoint as F, hostedMacosAppSlot as Fa, readStateFile as Fc, readDevServerStopRequest as Fi, SwiftpmCacheUsage as Fl, MachineOwnerKind as Fn, runId as Fo, MaintenanceCheck as Fr, sharedPods as Fs, listStatusCacheEntries as Ft, DeviceHostMachineCredential as G, HostedAppOffer as Ga, buildWorkerRoot as Gc, DeviceHostLimits as Gi, AgentTarget as Gl, PlannedPhase as Gn, footageDrops as Go, readMaintenanceAttempt as Gr, workspaceLogErrorIndex as Gs, ACTIVITY_RECENCY_BASES as Gt, HostedMetroRequest as H, HOSTED_APP_CHUNK_BYTES as Ha, debugLoggingEnabled as Hc, readWorkspaceState as Hi, readAgentDeviceUsageCache as Hl, PHYSICAL_DEVICE_CONNECTIONS as Hn, RecordingPlatform as Ho, MaintenanceStatus as Hr, workspaceEndedAgentsFile as Hs, readPullRequestCache as Ht, findPeer as I, hostedMacosBundleId as Ia, withStateReadCache as Ic, readDeviceIdleShutdowns as Ii, readSwiftpmCacheUsage as Il, MachineUsageState as In, validRunId as Io, MaintenanceMode as Ir, statsFile as Is, pullRequestCacheFile as It, CAPACITY_REFUSAL_LIMIT as J, hostedAppAttempt as Ja, getConcurrencyLimits as Jc, HostedAndroidDevice as Ji, LEVELS as Jl, STATUS_ISSUE_CODES as Jn, listSegments as Jo, HostedIosStatus as Jr, workspaceRecordingsDir as Js, ActiveBuildState as Jt, readDeviceHostMachines as K, HostedAppRecord as Ka, configCorruptRepair as Kc, HOSTED_PARKED_CANDIDATES as Ki, createAgentActionReader as Kl, RemoteDeviceState as Kn, listRecordedDevices as Ko, readMaintenanceState as Kr, workspaceLogsDir as Ks, AGENT_TOOLS as Kt, machineEndpoint as L, parseHostedAgentAccess as La, readHomeIdentity as Lc, readDevicePlacement as Li, swiftpmCacheUsageFile as Ll, MacosBuildPlanPayload as Ln, RECORDING_CAP_BYTES as Lo, MaintenancePass as Lr, supervisorLogFile as Ls, readAgentSessionsCache as Lt, TAILNET_MACHINE_PATTERN as M, HostedMacosDevice as Ma, isJsonObject as Mc, parseMissReason as Mi, SimRuntimeUsage as Ml, MACHINE_OWNER_KINDS as Mn, settingDefinition as Mo, DiskPressureLevel as Mr, sharedCcache as Ms, diskUsageCacheFile as Mt, TailnetPeer as N, HostedMacosPlacement as Na, readJsonFile as Nc, readBuildHistory as Ni, machineCacheUsageFile as Nl, MEMORY_SOURCES as Nn, settingValueError as No, MaintenanceAction as Nr, sharedCompilationCache as Ns, diskUsageFailureFile as Nt, parseHostedLogsCursor as O, HostedAgentIssuedGrant as Oa, EasSessionLedgerRead as Oc, WarmRecord as Oi, machineCapacity as Ol, EnvironmentState as On, coerceSettingText as Oo, readArchiveAsync as Or, pullRequestCacheDir as Os, ENDED_AGENT_RETENTION_MS as Ot, cannotHost as P, hostedAgentDriverName as Pa, readJsonObject as Pc, readDevServerStop as Pi, readMachineCacheUsage as Pl, MachineOwner as Pn, RUN_ID_ENV as Po, MaintenanceActionKind as Pr, sharedGradle as Ps, endedAgentSessionOf as Pt, PLACEMENT_DECISIONS as Q, readHostedApp as Qa, getRepoSettings as Qc, HostedDevicePhase as Qi, parseNdjsonLine as Ql, StatusIssue as Qn, recordingDeviceName as Qo, parseHostedIosPlacement as Qr, LogDirQuery as Qs, AgentTool as Qt, parseMachine as R, parseHostedAgentGrant as Ra, DEBUG_ENV as Rc, readIdleStop as Ri, AgentDeviceUsage as Rl, MemorySource as Rn, RECORDING_FOOTAGE_MS as Ro, MaintenancePressure as Rr, supervisorPidFile as Rs, readBuildDetail as Rt, HOSTED_LOGS_FIRST_BYTES as S, readHostedSessions as Sa, sortByTs as Sc, LAST_BUILD_KEYS as Si, MachineCredential as Sl, DeviceAppProcess as Sn, SettingsPayload as So, ArchivedUsage as Sr, maintenanceAttemptFile as Ss, wholePhases as St, HostedLogsPage as T, HostedAgentAccess as Ta, CreatedDevicePlatform as Tc, READY_PHASE_MS as Ti, MachineCapacity as Tl, DiskMeasure as Tn, WEB_VIEWPORTS as To, archivedUsage as Tr, maintenanceNdjsonFile as Ts, readViewedDevices as Tt, hostedMetroGateways as U, HostedAppDelivery as Ua, ParkedMax as Uc, workspaceLastUsed as Ui, AgentActionReaderOptions as Ul, PhysicalDeviceConnection as Un, capDrops as Uo, MemoryCulprit as Ur, workspaceEndedAgentsLock as Us, withDerivedFacts as Ut, HostedMetroGateway as V, parseHostedMacosPlacement as Va, debugLogDir as Vc, readWorkspaceAgent as Vi, readAgentDeviceUsage as Vl, NativeBuildStep as Vn, RecordedSegment as Vo, MaintenanceState as Vr, workspaceDerivedData as Vs, readEndedAgentSessions as Vt, hostedMetroRequests as W, HostedAppFile as Wa, allMetroPorts as Wc, DEVICE_HOST_LIMITS as Wi, AgentRecordSelection as Wl, PhysicalDeviceState as Wn, closedSegmentName as Wo, parseMaintenanceState as Wr, workspaceGradleBuild as Ws, withGitChip as Wt, HISTORY_LIMIT as X, parseHostedAppManifest as Xa, getProject as Xc, HostedDeviceOffer as Xi, SOURCES as Xl, StatsPlatform as Xn, openSegmentName as Xo, hostedIosRecords as Xr, workspaceStateLock as Xs, ActivityRecencyBasis as Xt, CAPACITY_REFUSAL_MAX_AGE_MS as Y, hostedAppBlobs as Ya, getParkedMax as Yc, HostedDevice as Yi, NdjsonRecord as Yl, SimulatorState as Yn, listSegmentsAsync as Yo, hostedIosPlacements as Yr, workspaceStateFile as Ys, ActivityDriver as Yt, OffloadSummary as Z, parseHostedAppOffer as Za, getProjectSettings as Zc, HostedDeviceOfferRequest as Zi, levelRank as Zl, StatusCapacity as Zn, recordedBytes as Zo, hostedIosStatus as Zr, LogDir as Zs, AgentSession as Zt, isSetupJournalPrunable as _, parseHostedOfferRequest as _a, queryJsonLogs as _c, DevServerStopRecord as _i, StimConfig as _l, BuildReport as _n, SettingDefinition as _o, macosAppState as _r, easSessionLedgerFile as _s, readStatsReport as _t, MachineView as a, HostedNativeOffer as aa, advanceTail as ac, hostedAndroidStatus as ai, AutomaticPoolRole as al, BuildCacheHit as an, settingsJsonSchema as ao, WarmStep as ar, buildMachinesLock as as, StatsCapacityRefusal as at, agentDeviceStateDirs as b, readHostedDevice as ba, readLogTimeline as bc, IDLE_STOP_KEY as bi, BuildMachineCredential as bl, ChecksState as bn, SettingType as bo, readMacosRecord as br, getConfigPath as bs, trimCapacityWaits as bt, SummaryBuild as c, deviceHostRoot as ca, bundleMarkerPlatform as cc, HostedNativePlacement as ci, validateAutomaticPool as cl, BuildDiagnostic as cn, ANDROID_PCH_CHOICES as co, WorkspacePhase as cr, createdDevicesFile as cs, StatsRecord as ct, WorktreeRow as d, hostedWorkerSettleMs as da, followLogs as dc, unreadableHostedNative as di, DeviceRecord as dl, BuildMissChange as dn, OffloadMode as do, WorktreeGit as dr, deviceHostMachinesFile as ds, decodeStats as dt, HostedDeviceRequest as ea, ERROR_SOURCES as ec, HostedAndroidPlacement as ei, loadConfig as el, AndroidRuntimeFacts as en, rememberHostedAppBlobRename as eo, StatusPayload as er, agentSessionsCacheFile as es, RunEstimates as et, readNdjsonGenerations as eu, statusViews as f, parseHostedAndroidDevice as fa, isExpoErrorContext as fc, BUILD_HISTORY_KEY as fi, DoctorRunRecord as fl, BuildMissReason as fn, REMOTE_DEVICE_BACKENDS as fo, WorktreePullRequest as fr, deviceHostMachinesLock as fs, findProjectRoot as ft, isJournalExpired as g, parseHostedNativeOffer as ga, planLogQuery as gc, DEV_SERVER_STOP_REQUEST_KEY as gi, SettingsObject as gl, BuildPlatform as gn, SETTING_SCOPES as go, MacosProcess as gr, easMachineStateRoot as gs, readStats as gt, SetupJournal as h, parseHostedLocalDeviceCount as ha, parseSince as hc, DEVICE_RECLAIM_REASON as hi, RepoRecord as hl, BuildPlanPayload as hn, SETTING_GROUPS as ho, MacosBuild as hr, diskUsageWalkClaims as hs, readRunEstimates as ht, ArchivedSummary as i, HostedIosDevice as ia, QueryCriteria as ic, hostedAndroidRecords as ii, withConfigLockAsync as il, BuildActivity as in, SETTINGS_SCHEMA_URL as io, WORKSPACE_STAGE_KINDS as ir, buildMachinesFile as is, StatsBucket as it, Endpoint as j, HostedMacosChoice as ja, validEasSessionClaim as jc, lastUseFrom as ji, MachineCacheUsage as jl, LastBuildReport as jn, isSensitiveReference as jo, readArchivesAsync as jr, setupJournalFile as js, agentSessionOf as jt, readHostedNativeLogsCheckpoint as k, HostedAgentLease as ka, readCreatedDevices as kc, WorkspaceState as ki, saturation as kl, GitChip as kn, expectedShape as ko, readArchiveState as kr, serverLocalSocket as ks, PullRequestCacheEntry as kt, SummaryHistoryEntry as l, hostedConsolePort as la, compileGrep as lc, hostedNativeRecords as li, ConcurrencyLimits as ll, BuildHistoryEntry as ln, IOS_SIMULATOR_APPS as lo, WorkspaceStage as lr, createdDevicesLock as ls, StatsReport as lt, SetupCapability as m, parseHostedDevice as ma, markerWindow as mc, DEVICE_IDLE_SHUTDOWN_KEY as mi, ProjectRecord as ml, BuildPlacement as mn, SETTINGS as mo, MacosAppState as mr, diskUsageCacheDir as ms, projectRootDirectories as mt, KeyedEntities as n, HostedDeviceSession as na, LogQueryPlan as nc, hostedAndroidDeviceName as ni, windowsShortDirKey as nl, BUILD_PHASES as nn, validHostedAppBlob as no, WEB_PAGE_STATES as nr, archiveLock as ns, RunSample as nt, SUMMARY_ARCHIVES as o, assertHostedDeviceLedger as oa, attachExpoErrorContext as oc, parseHostedAndroidPlacement as oi, automaticMachineEnabled as ol, BuildCause as on, ANDROID_COMPILER_CACHE_CHOICES as oo, WebBrowserState as or, clientIdentityKeyFile as os, StatsCapacityWait as ot, workspaceSummary as p, parseHostedChoice as pa, logFiles as pc, BUILD_HISTORY_LIMIT as pi, PlatformRecords as pl, BuildPhase as pn, RemoteDeviceBackend as po, MacosAppRecord as pr, deviceViewersDir as ps, offloadSummary as pt, BuildMachineTotals as q, hostedAppArea as qa, findEnclosingWorktreeRoot as qc, HostedAndroidChoice as qi, createAsyncAgentActionReader as ql, RunOutcomeKind as qn, listRecordedDevicesAsync as qo, HostedIosPlacement as qr, workspaceMetadataFile as qs, APP_PROCESS_STATES as qt, applyKeyedDelta as r, HostedIosChoice as ra, NATIVE_CRASH_LOG_PREFIX as rc, hostedAndroidPlacements as ri, withConfigLock as rl, BUILD_RESULTS as rn, SETTINGS_SCHEMA_FILE as ro, WORKSPACE_PHASES as rr, archiveRoot as rs, STATS_VERSION as rt, StatusViews as s, deviceHostArea as sa, buildCriteria as sc, unreadableHostedAndroid as si, requireAutomaticMachine as sl, BuildDetail as sn, ANDROID_EMULATOR_APPS as so, WebPageState as sr, configLockPath as ss, StatsPlacement as st, KeyedDelta as t, HostedDeviceSelectors as ta, LogQueryOptions as tc, HostedAndroidStatus as ti, windowsShortDir as tl, AppPresence as tn, validHostedAppArguments as to, TUTORIAL_VERSION as tr, archiveDir as ts, RunHistory as tt, WorkspaceSummary as u, hostedDeviceId as ua, fileSizes as uc, parseHostedNativePlacement as ui, Config as ul, BuildMissCategory as un, OFFLOAD_MODES as uo, WorktreeFacts as ur, deviceHostMachinesClaims as us, StatsScope as ut, parseSetupJournal as v, parseHostedPlatformDevice as va, queryLogs as vc, DevServerStopRequest as vi, SupervisorRecord as vl, BuildResult as vn, SettingEntry as vo, parseMacosRecord as vr, easSessionLedgerLock as vs, statsProjectKey as vt, HostedLogsCursor as w, HOSTED_MACOS_APP_SLOTS as wa, countErrorEntries as wc, MetroLastStop as wi, readBuildMachines as wl, DevicePlacement as wn, TunnelMode as wo, archiveEnabled as wr, maintenanceDir as ws, ViewedDevice as wt, agentDeviceStateDirsAsync as x, readHostedDeviceLedger as xa, recordMatches as xc, IdleStopRecord as xi, MACHINE_CREDENTIALS_VERSION as xl, DeviceActivity as xn, SettingWriteResult as xo, ArchivedBytes as xr, gitMergeCacheDir as xs, trimSamples as xt, readSetupJournal as y, parseHostedRequest as ya, readLogRecords as yc, DeviceIdleShutdownRecord as yi, clientIdentity as yl, BuildWaitingFor as yn, SettingScope as yo, readHostedMacosApp as yr, emulatorLogFile as ys, trimCapacityRefusals as yt, HOSTED_METRO_GATEWAYS_KEY as z, parseHostedMacosChoice as za, DebugLog as zc, readLastBuilds as zi, AgentDeviceUsageRoots as zl, MetroBundleState as zn, RECORDING_PLATFORMS as zo, MaintenanceRecord as zr, workspaceAgentDeviceDir as zs, readDiskUsage as zt };