@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,10 +1,10 @@
1
- import { Fi as HostedDeviceRequest, Jt as BuildHistoryEntry, Li as HostedDeviceSession, Mi as HostedDeviceOfferRequest, Ni as HostedDevicePhase, Pi as HostedDevicePlatform, Sa as HostedAppDelivery, d as HostedLogsPage, en as BuildPlanPayload, il as NdjsonRecord, ji as HostedDeviceOffer, u as HostedLogsCursor, ua as HostedAppLaunch, wa as HostedAppOffer, zn as StatusPayload } from "./index-VDWBflH3.mjs";
1
+ import { $i as HostedDevicePlatform, Aa as HostedAppLaunch, Cr as ArchivedWorkspace, Ga as HostedAppOffer, Hr as MaintenanceStatus, Ln as MacosBuildPlanPayload, On as EnvironmentState, Qi as HostedDevicePhase, Sr as ArchivedUsage, T as HostedLogsPage, Ua as HostedAppDelivery, Xi as HostedDeviceOffer, Yl as NdjsonRecord, Zi as HostedDeviceOfferRequest, a as MachineView, d as WorktreeRow, ea as HostedDeviceRequest, er as StatusPayload, hn as BuildPlanPayload, i as ArchivedSummary, ln as BuildHistoryEntry, na as HostedDeviceSession, t as KeyedDelta, u as WorkspaceSummary, ur as WorktreeFacts, w as HostedLogsCursor, xo as SettingWriteResult, yo as SettingScope } from "./index-DKq1j8dw.mjs";
2
2
  //#region protocol.d.ts
3
- declare const PROTOCOL_VERSION = 1;
3
+ declare const PROTOCOL_VERSION = 2;
4
4
  declare const PROTOCOL_SCHEMA_FILE = "protocol.schema.json";
5
5
  /**
6
- * `read` serves state. `control` also runs {@link ACTIONS}; only the Mac grants it. `build` lets another Mac run
7
- * project code here to build for it; it never comes with `read` or `control`, and only the Mac approves it.
6
+ * `read` serves state. `control` also runs {@link ACTIONS}; only the machine grants it. `build` lets another machine run
7
+ * project code here to build for it; it never comes with `read` or `control`, and only the machine approves it.
8
8
  * `device-host` permits a client's native app code in its own hosted sessions, and grants no other capability.
9
9
  */
10
10
  declare const CAPABILITIES: readonly ["read", "control", "build", "device-host"];
@@ -30,63 +30,68 @@ type Capability = (typeof CAPABILITIES)[number];
30
30
  * `hosted-ios-process` and `hosted-android-process` accept native app offers in process mode, with live process readiness and no Metro.
31
31
  * `native-xcode-build` accepts native Xcode provider requests with a separate source-transfer identity.
32
32
  * `native-xcode-toolchain` accepts native Xcode discovery without unrelated platform or Ruby probes.
33
+ * `build-artifact-cache` offers and fetches exact completed native Xcode archives without a build job.
33
34
  * `native-gradle-build` accepts declared Gradle transfer inputs with no reusable artifact identity.
35
+ * `native-gradle-artifact-cache` applies caller cache policy to verified worker-scoped APK reuse.
36
+ * `react-native-peer-cache` offers development archives with build-proven fingerprints, options and toolchains.
37
+ * `native-gradle-peer-cache` queries and fetches completed APKs after rechecking worker-private inputs.
38
+ * `swiftpm-peer-cache` queries and fetches completed SwiftPM apps after rechecking worker-private inputs.
39
+ * `build-dependency-cache` checks dependency warmth against the requested project and install selection.
34
40
  * `server-update` is `server.update.status`, `server.update.start` and `server.update.chunk`.
41
+ * `status-views` is `workspaces.subscribe`, `workspace.subscribe`, `machine.subscribe`, `builds.history`,
42
+ * `archived.list`, `worktrees.list` and `maintenance.get`.
43
+ * `desktop-reports` serves cached doctor/GC reports to the authenticated local Desktop connection.
44
+ * `desktop-report-platform` accepts an optional ios/android selector for Desktop doctor reports.
45
+ * `desktop-settings` reads settings for a selected folder on the authenticated local Desktop connection.
46
+ * `desktop-settings-write` mutates settings on the proved local Desktop connection.
47
+ * `desktop-stop` streams private Desktop workspace or slot stop progress and its terminal result.
48
+ * `desktop-start` streams dev-server startup progress and its result on the proved local Desktop connection.
49
+ * `desktop-run` streams platform build/install/launch progress and facts on the proved local Desktop connection.
50
+ * `desktop-build` streams build-only progress and artifact facts on the proved local Desktop connection.
51
+ * `desktop-plan` reads next-build reports for selected folders on the proved local Desktop connection.
52
+ * `desktop-reload` streams reload output and its terminal result on the proved local Desktop connection.
35
53
  */
36
- declare const FEATURES: readonly ["physical-ios", "physical-android", "notifications", "macos-window", "macos-windows", "macos-window-select", "macos-window-control", "macos-keyboard-extended", "device-frames", "macos-hosted", "ios-hosted", "android-hosted", "hosted-ios-agent", "hosted-android-agent", "duo-frames", "workspace-diff", "hosted-congestion", "hosted-ios-data", "hosted-ios-process", "native-xcode-build", "native-xcode-toolchain", "native-gradle-build", "hosted-android-data", "hosted-android-process", "server-update"];
54
+ declare const FEATURES: readonly ["physical-ios", "physical-android", "notifications", "macos-window", "macos-windows", "macos-window-select", "macos-window-control", "macos-keyboard-extended", "device-frames", "macos-hosted", "ios-hosted", "android-hosted", "hosted-ios-agent", "hosted-android-agent", "duo-frames", "workspace-diff", "hosted-congestion", "hosted-ios-data", "hosted-ios-process", "native-xcode-build", "native-xcode-toolchain", "build-artifact-cache", "native-gradle-build", "native-gradle-artifact-cache", "native-gradle-peer-cache", "react-native-peer-cache", "swiftpm-peer-cache", "build-dependency-cache", "hosted-android-data", "hosted-android-process", "server-update", "status-views", "desktop-reports", "desktop-report-platform", "desktop-settings", "desktop-settings-write", "desktop-full-logs", "desktop-doctor-run", "desktop-machine-access", "desktop-stop", "desktop-reload", "desktop-start", "desktop-run", "desktop-build", "desktop-gc", "desktop-worktree-remove", "desktop-worktree-warm", "desktop-plan"];
37
55
  type Feature = (typeof FEATURES)[number];
38
- declare const METHODS: readonly ["hello", "route.setup", "status.subscribe", "logs.query", "logs.subscribe", "stats.get", "settings.get", "workspace.files", "workspace.diff", "frames.subscribe", "frames.keyframe", "frames.seek", "frames.live", "replay.range", "archive.detail", "replay.keyframe", "recording.set", "build.plan", "machine.get", "machine.history", "machine.details", "unsubscribe", "action", "control.begin", "control.end", "input.touch", "input.text", "input.button", "input.rotate", "input.posture", "input.simulator", "input.scroll", "input.key", "input.window", "push.register", "push.unregister", "notifications.list", "build.offer", "build.sync", "build.start", "build.cancel", "build.artifact", "build.attach", "device-host.offer", "device-host.reserve", "device-host.attach", "device-host.stop", "device-host.app.offer", "device-host.app.chunk", "device-host.app.handoff", "device-host.app.launch", "device-host.app.attach", "device-host.logs.query", "device-host.metro.open", "device-host.metro.close", "device-host.frames.subscribe", "device-host.frames.keyframe", "device-host.frames.congested", "device-host.unsubscribe", "device-host.control.begin", "device-host.control.end", "device-host.input.touch", "device-host.input.text", "device-host.input.scroll", "device-host.input.key", "device-host.input.button", "device-host.input.rotate", "device-host.input.posture", "device-host.input.window", "server.update.status", "server.update.start", "server.update.chunk", "machines.update.start", "machines.update.status", "device-host.sessions", "device-host.sessions.stop"];
56
+ declare const METHODS: readonly ["hello", "desktop.authenticate", "desktop.reports.get", "desktop.reports.subscribe", "desktop.reports.invalidate", "desktop.settings.get", "desktop.settings.write", "desktop.logs.subscribe", "desktop.doctor.run", "desktop.machine-access.subscribe", "desktop.stop.subscribe", "desktop.reload.subscribe", "desktop.start.subscribe", "desktop.run.subscribe", "desktop.build.subscribe", "desktop.gc.subscribe", "desktop.worktree.remove.subscribe", "desktop.worktree.warm.subscribe", "desktop.plan.get", "desktop.plan.cancel", "route.setup", "status.subscribe", "workspaces.subscribe", "workspace.subscribe", "machine.subscribe", "builds.history", "archived.list", "worktrees.list", "maintenance.get", "logs.query", "logs.subscribe", "stats.get", "settings.get", "workspace.files", "workspace.diff", "frames.subscribe", "frames.keyframe", "frames.seek", "frames.live", "replay.range", "archive.detail", "replay.keyframe", "recording.set", "build.plan", "machine.get", "machine.history", "machine.details", "unsubscribe", "action", "control.begin", "control.end", "input.touch", "input.text", "input.button", "input.rotate", "input.posture", "input.simulator", "input.scroll", "input.key", "input.window", "push.register", "push.unregister", "notifications.list", "build.offer", "build.sync", "build.start", "build.cancel", "build.artifact", "build.cached-artifact", "build.attach", "device-host.offer", "device-host.reserve", "device-host.attach", "device-host.stop", "device-host.app.offer", "device-host.app.chunk", "device-host.app.handoff", "device-host.app.launch", "device-host.app.attach", "device-host.logs.query", "device-host.metro.open", "device-host.metro.close", "device-host.frames.subscribe", "device-host.frames.keyframe", "device-host.frames.congested", "device-host.unsubscribe", "device-host.control.begin", "device-host.control.end", "device-host.input.touch", "device-host.input.text", "device-host.input.scroll", "device-host.input.key", "device-host.input.button", "device-host.input.rotate", "device-host.input.posture", "device-host.input.window", "server.update.status", "server.update.start", "server.update.chunk", "machines.update.start", "machines.update.status", "device-host.sessions", "device-host.sessions.stop"];
39
57
  /**
40
- * The methods that update this server's `stim-server service`. A Mac this one approved for `build` or
58
+ * The methods that update this server's `stim-server service`. A machine this one approved for `build` or
41
59
  * `device-host` may call them; they need neither `read` nor `control`.
42
60
  */
43
61
  declare const SERVER_UPDATE_METHODS: readonly ["server.update.status", "server.update.start", "server.update.chunk"];
44
62
  /** The methods a connection with the `build` capability may call; they need `build`, not `read`. */
45
- declare const BUILD_METHODS: readonly ["build.offer", "build.sync", "build.start", "build.cancel", "build.artifact", "build.attach"];
63
+ declare const BUILD_METHODS: readonly ["build.offer", "build.sync", "build.start", "build.cancel", "build.artifact", "build.cached-artifact", "build.attach"];
46
64
  /** Methods restricted to explicitly approved device-host clients. */
47
65
  declare const DEVICE_HOST_METHODS: readonly ["device-host.offer", "device-host.reserve", "device-host.attach", "device-host.stop", "device-host.app.offer", "device-host.app.chunk", "device-host.app.handoff", "device-host.app.launch", "device-host.app.attach", "device-host.logs.query", "device-host.metro.open", "device-host.metro.close", "device-host.frames.subscribe", "device-host.frames.keyframe", "device-host.frames.congested", "device-host.unsubscribe", "device-host.control.begin", "device-host.control.end", "device-host.input.touch", "device-host.input.text", "device-host.input.scroll", "device-host.input.key", "device-host.input.button", "device-host.input.rotate", "device-host.input.posture", "device-host.input.window"];
48
66
  type Method = (typeof METHODS)[number];
49
67
  declare const PUSH_TOKEN_PATTERN = "^(Expo|Exponent)PushToken\\[[^\\]\\s]{1,256}\\]$";
50
68
  /**
51
69
  * `unauthorized`, `pairing-expired` and `protocol-unsupported` refuse the client until it pairs again or
52
- * updates; `approval-pending` refuses a build client until the Mac approves it; clients retry the others.
70
+ * updates; `unknown-secret` means the server does not hold the pairing token or setup ticket (yet), so a client with a
71
+ * setup ticket retries until setup runs; clients retry the others. A network connection's refusals during the
72
+ * handshake arrive as the WebSocket close reason.
53
73
  */
54
- declare const ERROR_CODES: readonly ["unauthorized", "pairing-expired", "protocol-unsupported", "approval-pending", "identity-unavailable", "bad-request", "unknown-method", "already-authenticated", "unknown-subscription", "unknown-workspace", "limit-exceeded", "slow-client", "status-failed", "logs-failed", "stim-failed", "frames-failed", "forbidden", "unknown-action", "action-busy", "action-failed", "device-busy", "unknown-session", "no-recording", "build-refused", "build-busy"];
74
+ declare const ERROR_CODES: readonly ["unauthorized", "pairing-expired", "protocol-unsupported", "unknown-secret", "bad-request", "unknown-method", "already-authenticated", "unknown-subscription", "unknown-workspace", "limit-exceeded", "slow-client", "status-failed", "logs-failed", "stim-failed", "frames-failed", "forbidden", "unknown-action", "action-busy", "action-failed", "device-busy", "unknown-session", "no-recording", "build-refused", "build-busy"];
55
75
  type ErrorCode = (typeof ERROR_CODES)[number];
56
76
  type RequestId = number | string;
57
- /** Spends a single-use pairing token; the result carries the new device token. */
58
- interface PairingAuth {
59
- pairingToken: string;
60
- deviceName: string;
61
- }
62
- /** Presents the device token a previous pairing returned. */
63
- interface DeviceAuth {
64
- deviceToken: string;
65
- }
66
77
  /**
67
- * Asks, from another Mac on the tailnet, to build here. The result carries a device token with no
68
- * capabilities and `approval`; the token authenticates once the Mac approves the request.
78
+ * The first request on a connection, after the Noise handshake on a network connection or none on the local Unix
79
+ * socket. Authentication already happened; capabilities come from the server's record of the client's key.
69
80
  */
70
- interface BuildRequestAuth {
71
- request: "build";
72
- deviceName: string;
73
- setupTicket?: string;
74
- }
75
- /** Requests explicit device hosting approval; grants no read, control or build access. */
76
- interface DeviceHostRequestAuth {
77
- request: "device-host";
78
- deviceName: string;
79
- setupTicket?: string;
80
- }
81
81
  interface HelloParams {
82
- protocol: number;
83
82
  /** `runId` is the CLI invocation's id: letters, digits, `.`, `_`, `-`, at most 64. The server puts it on its log lines for the connection. */
84
83
  client: {
85
84
  name: string;
86
85
  version: string;
87
86
  runId?: string;
88
87
  };
89
- auth: PairingAuth | DeviceAuth | BuildRequestAuth | DeviceHostRequestAuth;
88
+ /**
89
+ * Which of the key's own records this connection acts as: its `build` or `device-host` approval. Without it, the
90
+ * pairing in `devices.json`. It never widens what a record allows.
91
+ */
92
+ access?: "build" | "device-host";
93
+ /** On the local Unix socket only: asks for the private Desktop bootstrap challenge. It grants nothing by itself. */
94
+ desktopBootstrap?: true;
90
95
  }
91
96
  interface HelloResult {
92
97
  /** Present when the server runs under Stim Host: the grants macOS gives that app, or null if unavailable. */
@@ -97,31 +102,34 @@ interface HelloResult {
97
102
  } | null;
98
103
  protocol: number;
99
104
  /**
100
- * The Mac's name, this package's version, the version of the `stim` it runs, and the home directory of the
101
- * user it runs as, so clients can show paths under it as `~/...`. A pending approval result has no `home`.
105
+ * The machine's name, this package's version, the version of the `stim` it runs, and the home directory of the
106
+ * user it runs as, so clients can show paths under it as `~/...`.
102
107
  */
108
+ /** `port`, on the local socket only, is the server's TCP port, so a client can tell which server answered. */
103
109
  server: {
104
110
  name: string;
105
111
  version: string;
106
112
  stim: string;
107
113
  home?: string;
114
+ id?: string;
115
+ port?: number;
108
116
  };
109
117
  capabilities: Capability[];
110
118
  features: Feature[];
111
119
  /** The actions this device may run: every one of {@link ACTIONS} with `control`, none without. */
112
120
  actions: ActionName[];
113
- /** The paired device this connection authenticated as, as `stim-server devices` lists it. */
121
+ /** The record this connection authenticated as, as `stim-server devices` lists it; `local` on the Unix socket. */
114
122
  device: {
115
123
  id: string;
116
124
  name: string;
117
125
  };
118
- /** Present only when the hello spent a pairing token or requested build or device-host access. The server keeps only its hash. */
119
- deviceToken?: string;
120
- /** Present only on a build or device-host request, which the server then closes; the request lapses at `expiresAt`. */
121
- approval?: {
122
- state: "pending";
123
- expiresAt: string;
124
- };
126
+ /** Present only for a requested private bootstrap on the local Unix socket. */
127
+ desktopBootstrap?: DesktopBootstrapChallenge;
128
+ }
129
+ /** Per-connection nonce and HMAC-SHA256 proof under the parent's private key, with the `server:` domain. */
130
+ interface DesktopBootstrapChallenge {
131
+ nonce: string;
132
+ proof: string;
125
133
  }
126
134
  interface SubscribeResult {
127
135
  subscription: string;
@@ -149,6 +157,14 @@ interface LogFilter {
149
157
  errors?: boolean;
150
158
  tail?: number;
151
159
  }
160
+ /** Complete retained output on the private local Desktop connection; slot and time bounds are applied by Desktop. */
161
+ interface DesktopLogFilter {
162
+ workspace: string;
163
+ sources?: LogSource[];
164
+ level?: LogLevel;
165
+ grep?: string;
166
+ errors?: boolean;
167
+ }
152
168
  /** One record as `stim logs --json` prints it. */
153
169
  type LogRecord = NdjsonRecord;
154
170
  interface LogsQueryResult {
@@ -162,6 +178,47 @@ interface WorkspaceParams {
162
178
  type StatsResult = Record<string, unknown>;
163
179
  /** `stim settings --json`; the CLI masks sensitive values. */
164
180
  type SettingsResult = Record<string, unknown>;
181
+ /** One settings mutation from the Desktop that started this server. Values use CLI text syntax. */
182
+ type DesktopSettingsWriteParams = {
183
+ cwd: string;
184
+ key: string;
185
+ scope?: SettingScope;
186
+ } & ({
187
+ action: "set";
188
+ value: string;
189
+ } | {
190
+ action: "unset";
191
+ });
192
+ /** A masked write result or the CLI's typed refusal; transport failures use the RPC error channel. */
193
+ type DesktopSettingsWriteResult = SettingWriteResult | {
194
+ code: string;
195
+ message: string;
196
+ remedy: string | null;
197
+ };
198
+ interface DesktopPlanRefusal {
199
+ code: string;
200
+ message: string;
201
+ remedy: string | null;
202
+ }
203
+ type DesktopReportTarget = {
204
+ report: "doctor";
205
+ cwd: string;
206
+ platform?: "ios" | "android";
207
+ } | {
208
+ report: "gc";
209
+ };
210
+ interface DesktopReportSnapshot {
211
+ pending: boolean;
212
+ value: Record<string, unknown> | null;
213
+ error?: string;
214
+ measuredAt?: string;
215
+ }
216
+ interface DesktopReportEvent {
217
+ event: "desktop-report";
218
+ subscription: string;
219
+ target: DesktopReportTarget;
220
+ snapshot: DesktopReportSnapshot;
221
+ }
165
222
  /** `web` is the workspace's Stim-owned Chrome page, from `stim web`; it has only the default slot. */
166
223
  declare const PLATFORMS: readonly ["ios", "android", "web", "macos"];
167
224
  type Platform = (typeof PLATFORMS)[number];
@@ -228,7 +285,7 @@ interface KeyframeParams {
228
285
  }
229
286
  /**
230
287
  * Plays recorded footage into a video subscription instead of the live screen: the frame at `at` (epoch
231
- * milliseconds on the Mac's clock) arrives at once, as the access units from the keyframe before it, then playback
288
+ * milliseconds on the machine's clock) arrives at once, as the access units from the keyframe before it, then playback
232
289
  * goes on at `rate` times real time. A `rate` of 0 stays paused on that frame. Time where nothing was recorded is
233
290
  * skipped.
234
291
  */
@@ -253,7 +310,7 @@ interface ReplayTarget {
253
310
  platform: Platform;
254
311
  slot?: string;
255
312
  }
256
- /** A time range with recorded footage, in epoch milliseconds on the Mac's clock. */
313
+ /** A time range with recorded footage, in epoch milliseconds on the machine's clock. */
257
314
  interface ReplaySpan {
258
315
  start: number;
259
316
  end: number;
@@ -281,6 +338,67 @@ interface ReplayRange {
281
338
  spans: ReplaySpan[];
282
339
  markers: ReplayMarker[];
283
340
  }
341
+ /** A workspace path from the workspace list. */
342
+ interface WorkspaceRef {
343
+ workspace: string;
344
+ }
345
+ /** The workspace list, all at once: every workspace's summary, the unprovisioned worktrees and the archives' summary. */
346
+ interface WorkspacesSnapshot {
347
+ workspaces: WorkspaceSummary[];
348
+ worktrees: WorktreeRow[];
349
+ archived: ArchivedSummary;
350
+ }
351
+ /**
352
+ * The workspace list of a `workspaces.subscribe` subscription. Its first event, `seq` 0, carries `snapshot`; each
353
+ * later one carries what changed since the previous event, `seq` one higher: whole workspaces and worktrees to insert or
354
+ * replace by `path`, the paths that are gone, and the archives' summary when it changed. A client that misses a `seq`
355
+ * subscribes again for a new snapshot.
356
+ */
357
+ interface WorkspacesEvent {
358
+ event: "workspaces";
359
+ subscription: string;
360
+ seq: number;
361
+ snapshot?: WorkspacesSnapshot;
362
+ workspaces?: KeyedDelta<WorkspaceSummary>;
363
+ worktrees?: KeyedDelta<WorktreeRow>;
364
+ archived?: ArchivedSummary;
365
+ }
366
+ /**
367
+ * One workspace, as `stim status --json` prints its environment, on subscribing and on every change to it. `environment`
368
+ * is null while no workspace has that path.
369
+ */
370
+ interface WorkspaceEvent {
371
+ event: "workspace";
372
+ subscription: string;
373
+ seq: number;
374
+ environment: EnvironmentState | null;
375
+ }
376
+ /** The machine on subscribing and on every change, with the usage history and own leases a `status` event carries. */
377
+ interface MachineEvent {
378
+ event: "machine";
379
+ subscription: string;
380
+ seq: number;
381
+ machine: MachineView;
382
+ usage?: UsageHistory;
383
+ /** `grantedAt` of the device leases this server holds for phones; absent when it holds none. */
384
+ ownLeases?: string[];
385
+ }
386
+ /** A workspace's full build history, newest first per platform. */
387
+ interface BuildsHistoryResult {
388
+ builds: EnvironmentState["builds"];
389
+ }
390
+ /** `before` is the `next` of the previous page; `limit` is at most {@link ARCHIVED_PAGE_LIMIT}. */
391
+ interface ArchivedListParams {
392
+ before?: string;
393
+ limit?: number;
394
+ }
395
+ declare const ARCHIVED_PAGE_LIMIT = 50;
396
+ /** A page of archives, newest removal first, the usage of all of them, and the cursor of the next page or null. */
397
+ interface ArchivedListResult {
398
+ archived: ArchivedWorkspace[];
399
+ usage: ArchivedUsage;
400
+ next: string | null;
401
+ }
284
402
  /** An archived[].id from status; the original workspace is not required. */
285
403
  interface ArchiveDetailParams {
286
404
  archive: string;
@@ -294,7 +412,7 @@ interface ArchiveDetailResult {
294
412
  spans: ReplaySpan[];
295
413
  }[];
296
414
  }
297
- /** A device slot, as {@link ReplayTarget} names it, and a time in epoch milliseconds on the Mac's clock. */
415
+ /** A device slot, as {@link ReplayTarget} names it, and a time in epoch milliseconds on the machine's clock. */
298
416
  interface ReplayKeyframeParams extends ReplayTarget {
299
417
  at: number;
300
418
  }
@@ -341,7 +459,7 @@ declare const VIDEO_ARTWORK = 32;
341
459
  /**
342
460
  * The layout of a binary video message, big-endian: u8 version ({@link VIDEO_HEADER_VERSION}), u8 flags
343
461
  * ({@link VIDEO_KEYFRAME}, posture bits and {@link VIDEO_ARTWORK}), u16 header length, u32 sequence number of the messages sent on this subscription, f64 capture time in milliseconds since the
344
- * epoch on the Mac's clock, u16 width, u16 height, u8 subscription id length N, N bytes of ASCII subscription
462
+ * epoch on the machine's clock, u16 width, u16 height, u8 subscription id length N, N bytes of ASCII subscription
345
463
  * id. After the header comes one Annex-B H.264 access unit; a keyframe carries its SPS and PPS. The stream has
346
464
  * no B-frames, so each access unit is shown as it arrives.
347
465
  */
@@ -499,22 +617,105 @@ interface BuildPlanParams {
499
617
  }
500
618
  /** `stim ios|android --plan --json`. It builds, boots and installs nothing, and writes no Stim state. */
501
619
  type BuildPlanResult = BuildPlanPayload;
502
- /** A client's repository on a remote Mac: letters, digits, `.`, `_` and `-`, at most 80. */
620
+ /** A client's repository on a remote machine: letters, digits, `.`, `_` and `-`, at most 80. */
503
621
  declare const BUILD_REPO_PATTERN = "^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$";
504
622
  /** A version-manager Ruby installation name, without path separators. */
505
623
  declare const BUILD_RUBY_VERSION_PATTERN = "^(?!\\.{1,2}$)[^/\\\\\\u0000\\r\\n]+$";
506
- /** Asks a remote Mac what it can build, how busy it is, and how warm its copy of `repo` is. */
624
+ /** Asks a remote machine what it can build, how busy it is, and how warm its copy of `repo` is. */
507
625
  interface BuildOfferParams {
508
626
  repo: string;
509
627
  /** sha256 of the repository's lockfile, compared with the one the machine last installed from. */
510
628
  lockfile?: string;
629
+ /** The dependency installation to compare with the lockfile, supported by `build-dependency-cache`. */
630
+ dependencies?: {
631
+ project: string;
632
+ packageName: string | null;
633
+ };
511
634
  /** The project's normalized .ruby-version; absent uses the worker's default Ruby. */
512
635
  rubyVersion?: string;
513
636
  native?: "xcode" | "gradle";
637
+ artifact?: BuildArtifactIdentity;
638
+ gradleArtifact?: BuildGradleArtifactQuery;
639
+ reactNativeArtifact?: BuildReactNativeArtifactQuery;
640
+ swiftpmArtifact?: BuildSwiftpmArtifactQuery;
641
+ }
642
+ /** A post-mutation React Native fingerprint and the requested development build. */
643
+ type BuildReactNativeArtifactQuery = {
644
+ project: string;
645
+ fingerprint: string;
646
+ isExpo: boolean;
647
+ } & ({
648
+ platform: "ios";
649
+ toolchain: {
650
+ stimBuild: string;
651
+ arch: string;
652
+ xcode: string;
653
+ simulatorSdk: string;
654
+ cocoapods: string;
655
+ };
656
+ ios: {
657
+ runtime: string;
658
+ configuration: string;
659
+ scheme: string | null;
660
+ projectPath: string;
661
+ optimizations: {
662
+ compilationCache: boolean;
663
+ swiftCompilationCache: boolean | null;
664
+ prefixMapping: boolean;
665
+ };
666
+ };
667
+ } | {
668
+ platform: "android";
669
+ toolchain: {
670
+ stimBuild: string;
671
+ jdk: string;
672
+ };
673
+ android: BuildAndroidOptions;
674
+ });
675
+ /** A declared native Gradle request with a resolved variant, excluding worker-private inputs and APK identity. */
676
+ interface BuildGradleArtifactQuery {
677
+ project: string;
678
+ sourceDigest: string;
679
+ inputs: GradleOffloadInputs;
680
+ android: BuildAndroidOptions & {
681
+ variant: string;
682
+ };
683
+ }
684
+ /** A complete SwiftPM source transfer and repeatable build; private input values stay on the worker. */
685
+ interface BuildSwiftpmArtifactQuery {
686
+ project: string;
687
+ sourceDigest: string;
688
+ stimBuild: string;
689
+ inputs: {
690
+ complete: true;
691
+ ignored: string[];
692
+ outputs: string[];
693
+ localFiles: string[];
694
+ environment: string[];
695
+ };
696
+ build: {
697
+ product: string;
698
+ infoPlist: string;
699
+ resources: Record<string, string>;
700
+ assetCatalog: string | null;
701
+ };
514
702
  }
515
- /** The toolchain a build must match exactly on both Macs. */
703
+ /** A native artifact identity whose key includes its complete inputs, target and toolchain. */
704
+ interface BuildArtifactIdentity {
705
+ fingerprint: string;
706
+ cacheKey: string;
707
+ }
708
+ interface CachedBuildArtifact extends BuildArtifactIdentity {
709
+ name: string;
710
+ size: number;
711
+ sha256: string;
712
+ androidPackage?: string;
713
+ }
714
+ /** The toolchain a build must match exactly on both machines. */
516
715
  interface BuildToolchain {
517
716
  stimBuild: string | null;
717
+ /** The OS stim-server runs on, as Node names it; absent from a stim-server older than this field. */
718
+ os?: string;
518
719
  arch: string;
519
720
  xcode: string | null;
520
721
  simulatorSdk: string | null;
@@ -532,7 +733,7 @@ interface BuildToolchain {
532
733
  } | null;
533
734
  }
534
735
  /**
535
- * How busy the remote Mac is. `running` counts offloaded builds and `max` is how many it runs at once.
736
+ * How busy the remote machine is. `running` counts offloaded builds and `max` is how many it runs at once.
536
737
  * `cpus`, `loadPerCore` (5-minute load average per CPU), `builds` (its own Stim native builds plus the offloaded
537
738
  * ones), `maxBuilds` (its `concurrency.maxBuilds`, 0 when unlimited), `maxLoadPerCore`, `memoryUsedBytes`
538
739
  * (Activity Monitor's Memory Used) and `memoryTotalBytes` are absent from a stim-server older than them. `declined` is why it would refuse a build now, null when it would take one.
@@ -559,6 +760,7 @@ interface BuildOfferResult {
559
760
  dependencies: boolean;
560
761
  build: boolean;
561
762
  };
763
+ artifact?: CachedBuildArtifact | null;
562
764
  }
563
765
  /** One file of the client's checkout. A `link` blob holds the symlink's target. */
564
766
  interface BuildFile {
@@ -620,6 +822,11 @@ interface BuildStartParams {
620
822
  provider: "gradle";
621
823
  sourceDigest: string;
622
824
  inputs: GradleOffloadInputs;
825
+ cache?: {
826
+ read: boolean;
827
+ write: boolean;
828
+ remote: boolean;
829
+ };
623
830
  };
624
831
  packageName?: string | null;
625
832
  isExpo?: boolean;
@@ -631,8 +838,10 @@ interface BuildStartParams {
631
838
  bundleId: string;
632
839
  resources?: Record<string, string>;
633
840
  assetCatalog?: string | null;
841
+ artifactInputs?: BuildSwiftpmArtifactQuery["inputs"];
634
842
  } | null;
635
843
  stimBuild: string;
844
+ cacheArtifact?: boolean;
636
845
  }
637
846
  interface BuildJobParams {
638
847
  job: string;
@@ -647,7 +856,7 @@ interface BuildArtifactResult {
647
856
  size: number;
648
857
  sha256: string;
649
858
  /**
650
- * For a macOS job, a single-use token for the staged bundle this Mac keeps for a while, which a hosted session of a
859
+ * For a macOS job, a single-use token for the staged bundle this machine keeps for a while, which a hosted session of a
651
860
  * device-host client on the same tailnet node can take with `device-host.app.handoff`.
652
861
  */
653
862
  handoff?: string;
@@ -681,7 +890,7 @@ interface MachineVolume {
681
890
  interface MachineUsage {
682
891
  volumes: MachineVolume[];
683
892
  /**
684
- * `usedBytes` is the Mac's memory in use, as Activity Monitor's "Memory Used" counts it: app memory, wired and
893
+ * `usedBytes` is the machine's memory in use, as Activity Monitor's "Memory Used" counts it: app memory, wired and
685
894
  * compressed. `pressure` is the macOS memory pressure level. Both are null on other systems or when they cannot
686
895
  * be read.
687
896
  */
@@ -697,7 +906,7 @@ interface MachineUsage {
697
906
  cpus: number;
698
907
  };
699
908
  /**
700
- * `usage` is the Mac's overall CPU busy fraction (0..1), from the tick delta between this call and the
909
+ * `usage` is the machine's overall CPU busy fraction (0..1), from the tick delta between this call and the
701
910
  * previous one. Null on the first call of a server process, since there is no previous sample yet.
702
911
  */
703
912
  cpu: {
@@ -727,7 +936,7 @@ interface MachineHistory {
727
936
  samples: UsageSample[];
728
937
  }
729
938
  /**
730
- * The Mac's disk and build detail: the payloads of the `stim gc --json` dry run and of `stim stats --json`, both run in
939
+ * The machine's disk and build detail: the payloads of the `stim gc --json` dry run and of `stim stats --json`, both run in
731
940
  * the home directory. A part is null when its command failed, and its `gcError` or `statsError` says why.
732
941
  * `measuredAt` is when the commands started. The server keeps one result for 60 seconds, shared by every connection.
733
942
  */
@@ -737,7 +946,7 @@ interface MachineDetails {
737
946
  stats: Record<string, unknown> | null;
738
947
  statsError?: string;
739
948
  /**
740
- * `remoteMachines` from `stim doctor --json --platform ios`; empty when `remote.machines` names none. The reply
949
+ * `remoteMachines` from `stim doctor --json`; empty when `remote.machines` names none. The reply
741
950
  * never waits for doctor: `buildMachines` and `buildMachinesError` are the last result a background doctor run
742
951
  * settled, `buildMachinesAt` is when it settled, and `buildMachinesPending` is true while that result is stale
743
952
  * (or absent) and a refresh is running. A client that wants the refreshed result asks `machine.details` again.
@@ -747,8 +956,8 @@ interface MachineDetails {
747
956
  buildMachinesAt?: string;
748
957
  buildMachinesPending?: boolean;
749
958
  /**
750
- * The builds this Mac ran for other Macs, one entry per client, from the audit log. `today` is
751
- * this Mac's local calendar day. Absent from a server older than this field.
959
+ * The builds this machine ran for other machines, one entry per client, from the audit log. `today` is
960
+ * this machine's local calendar day. Absent from a server older than this field.
752
961
  */
753
962
  buildClients?: BuildClientSummary[];
754
963
  measuredAt: string;
@@ -824,7 +1033,7 @@ interface QuietHours {
824
1033
  /**
825
1034
  * Asks the server to push this device's notifications through the Expo push service to `token`, an Expo push
826
1035
  * token, for at least one event. Registering again replaces the previous registration. `ref` is echoed as
827
- * `data.ref` in every push, so the phone can tell which Mac sent it. `stuckMinutes` is how long a driven workspace
1036
+ * `data.ref` in every push, so the phone can tell which machine sent it. `stuckMinutes` is how long a driven workspace
828
1037
  * must show no activity to look stuck, 15 by default. `levels` sets each event's delivery; an event it leaves out
829
1038
  * is silent. An older server ignores `levels`. `agentOnly` is accepted from older phones and ignored.
830
1039
  */
@@ -919,7 +1128,7 @@ interface ServerUpdatePackage {
919
1128
  }
920
1129
  /**
921
1130
  * What `server.update.start` installs: an exact stim-server `release` from the public npm registry, or the
922
- * `packages` of a client's own build, which the Mac takes only while its `server.acceptClientBuilds` is true.
1131
+ * `packages` of a client's own build, which the machine takes only while its `server.acceptClientBuilds` is true.
923
1132
  */
924
1133
  type ServerUpdateStartParams = {
925
1134
  release: string;
@@ -968,8 +1177,8 @@ interface ServerUpdateStatus {
968
1177
  last: ServerUpdateOutcome | null;
969
1178
  }
970
1179
  /**
971
- * Where an update this Mac asked `machine` for stands: the host's own `server.update.status`, or why it could not be
972
- * read (`unreachable`, also while the host restarts), and how much of this Mac's build it has sent.
1180
+ * Where an update this machine asked `machine` for stands: the host's own `server.update.status`, or why it could not be
1181
+ * read (`unreachable`, also while the host restarts), and how much of this machine's build it has sent.
973
1182
  */
974
1183
  interface MachineUpdateStatus {
975
1184
  remote: ServerUpdateStatus | null;
@@ -1188,10 +1397,173 @@ interface Methods {
1188
1397
  params: HelloParams;
1189
1398
  result: HelloResult;
1190
1399
  };
1400
+ "desktop.authenticate": {
1401
+ params: {
1402
+ proof: string;
1403
+ };
1404
+ result: {
1405
+ authorized: true;
1406
+ };
1407
+ };
1408
+ "desktop.reports.get": {
1409
+ params: DesktopReportTarget;
1410
+ result: DesktopReportSnapshot;
1411
+ };
1412
+ "desktop.reports.subscribe": {
1413
+ params: DesktopReportTarget;
1414
+ result: SubscribeResult;
1415
+ };
1416
+ "desktop.reports.invalidate": {
1417
+ params?: Record<string, never>;
1418
+ result: Record<string, never>;
1419
+ };
1420
+ "desktop.settings.get": {
1421
+ params: {
1422
+ cwd: string;
1423
+ };
1424
+ result: SettingsResult;
1425
+ };
1426
+ "desktop.settings.write": {
1427
+ params: DesktopSettingsWriteParams;
1428
+ result: DesktopSettingsWriteResult;
1429
+ };
1430
+ "desktop.logs.subscribe": {
1431
+ params: DesktopLogFilter;
1432
+ result: SubscribeResult;
1433
+ };
1434
+ "desktop.doctor.run": {
1435
+ params: {
1436
+ cwd: string;
1437
+ platform?: "ios" | "android";
1438
+ };
1439
+ result: Record<string, unknown>;
1440
+ };
1441
+ "desktop.machine-access.subscribe": {
1442
+ params: {
1443
+ cwd: string;
1444
+ ticket?: string;
1445
+ };
1446
+ result: SubscribeResult;
1447
+ };
1448
+ "desktop.stop.subscribe": {
1449
+ params: {
1450
+ cwd: string;
1451
+ slot?: string;
1452
+ };
1453
+ result: SubscribeResult;
1454
+ };
1455
+ "desktop.reload.subscribe": {
1456
+ params: {
1457
+ cwd: string;
1458
+ platform?: ReloadPlatform;
1459
+ };
1460
+ result: SubscribeResult;
1461
+ };
1462
+ "desktop.start.subscribe": {
1463
+ params: {
1464
+ cwd: string;
1465
+ remote?: boolean;
1466
+ resetCache?: boolean;
1467
+ waitSeconds?: number;
1468
+ };
1469
+ result: SubscribeResult;
1470
+ };
1471
+ "desktop.run.subscribe": {
1472
+ params: {
1473
+ cwd: string;
1474
+ options: PlatformRunOptions;
1475
+ };
1476
+ result: SubscribeResult;
1477
+ };
1478
+ "desktop.plan.get": {
1479
+ params: {
1480
+ cwd: string;
1481
+ request?: string;
1482
+ } & ({
1483
+ platform: "ios" | "android";
1484
+ slot?: string;
1485
+ } | {
1486
+ platform: "macos";
1487
+ });
1488
+ result: BuildPlanPayload | MacosBuildPlanPayload | DesktopPlanRefusal;
1489
+ };
1490
+ "desktop.plan.cancel": {
1491
+ params: {
1492
+ request: string;
1493
+ };
1494
+ result: {
1495
+ cancelled: boolean;
1496
+ refusal?: DesktopPlanRefusal;
1497
+ };
1498
+ };
1499
+ "desktop.build.subscribe": {
1500
+ params: {
1501
+ cwd: string;
1502
+ options: PlatformBuildOptions;
1503
+ };
1504
+ result: SubscribeResult;
1505
+ };
1506
+ "desktop.gc.subscribe": {
1507
+ params: {
1508
+ cwd: string;
1509
+ cache?: string;
1510
+ olderThan?: number;
1511
+ worktrees?: boolean;
1512
+ delete?: boolean;
1513
+ idleMs?: number;
1514
+ };
1515
+ result: SubscribeResult;
1516
+ };
1517
+ "desktop.worktree.warm.subscribe": {
1518
+ params: {
1519
+ cwd: string;
1520
+ };
1521
+ result: SubscribeResult;
1522
+ };
1523
+ "desktop.worktree.remove.subscribe": {
1524
+ params: {
1525
+ cwd: string;
1526
+ target?: string;
1527
+ force?: boolean;
1528
+ };
1529
+ result: SubscribeResult;
1530
+ };
1191
1531
  "status.subscribe": {
1192
1532
  params?: Record<string, never>;
1193
1533
  result: SubscribeResult;
1194
1534
  };
1535
+ "workspaces.subscribe": {
1536
+ params?: Record<string, never>;
1537
+ result: SubscribeResult;
1538
+ };
1539
+ "workspace.subscribe": {
1540
+ params: WorkspaceRef;
1541
+ result: SubscribeResult;
1542
+ };
1543
+ "machine.subscribe": {
1544
+ params?: Record<string, never>;
1545
+ result: SubscribeResult;
1546
+ };
1547
+ "builds.history": {
1548
+ params: WorkspaceRef;
1549
+ result: BuildsHistoryResult;
1550
+ };
1551
+ "archived.list": {
1552
+ params?: ArchivedListParams;
1553
+ result: ArchivedListResult;
1554
+ };
1555
+ "worktrees.list": {
1556
+ params?: Record<string, never>;
1557
+ result: {
1558
+ worktrees: WorktreeFacts[];
1559
+ };
1560
+ };
1561
+ "maintenance.get": {
1562
+ params?: Record<string, never>;
1563
+ result: {
1564
+ maintenance: MaintenanceStatus | null;
1565
+ };
1566
+ };
1195
1567
  "logs.query": {
1196
1568
  params: LogFilter;
1197
1569
  result: LogsQueryResult;
@@ -1340,6 +1712,16 @@ interface Methods {
1340
1712
  params: BuildJobParams;
1341
1713
  result: BuildArtifactResult;
1342
1714
  };
1715
+ "build.cached-artifact": {
1716
+ params: {
1717
+ repo: string;
1718
+ artifact: BuildArtifactIdentity;
1719
+ gradleArtifact?: BuildGradleArtifactQuery;
1720
+ reactNativeArtifact?: BuildReactNativeArtifactQuery;
1721
+ swiftpmArtifact?: BuildSwiftpmArtifactQuery;
1722
+ };
1723
+ result: CachedBuildArtifact | null;
1724
+ };
1343
1725
  "build.attach": {
1344
1726
  params: BuildJobParams;
1345
1727
  result: BuildAttachResult;
@@ -1531,7 +1913,192 @@ interface BuildProgressEvent {
1531
1913
  record?: Record<string, unknown>;
1532
1914
  outcome?: BuildJobOutcome;
1533
1915
  }
1534
- type ServerEvent = BuildProgressEvent | NotificationEvent | StatusEvent | LogsEvent | LogsEndedEvent | FrameEvent | DeviceFrameEvent | MacosWindowsEvent | FrameDelayedEvent | ReplayEndedEvent | ErrorEvent | ControlEndedEvent;
1916
+ /** Progress chunks from a private Desktop stop, before its terminal event. */
1917
+ interface DesktopStopProgressEvent {
1918
+ event: "desktop-stop-progress";
1919
+ subscription: string;
1920
+ stream: "stdout" | "stderr";
1921
+ message: string;
1922
+ }
1923
+ /** The stop's CLI-compatible JSON, exit status and human summary or refusal. */
1924
+ interface DesktopStopEndedEvent {
1925
+ event: "desktop-stop-ended";
1926
+ subscription: string;
1927
+ exitCode: 0 | 1;
1928
+ stdout: string;
1929
+ message: string;
1930
+ }
1931
+ /** Progress chunks from a private Desktop reload, before its terminal event. */
1932
+ interface DesktopReloadProgressEvent {
1933
+ event: "desktop-reload-progress";
1934
+ subscription: string;
1935
+ stream: "stdout" | "stderr";
1936
+ message: string;
1937
+ }
1938
+ /** The reload's CLI-compatible JSON, exit status and human summary or refusal. */
1939
+ interface DesktopReloadEndedEvent {
1940
+ event: "desktop-reload-ended";
1941
+ subscription: string;
1942
+ exitCode: 0 | 1;
1943
+ stdout: string;
1944
+ message: string;
1945
+ }
1946
+ /** Progress chunks from a private Desktop start, before its terminal event. */
1947
+ interface DesktopStartProgressEvent {
1948
+ event: "desktop-start-progress";
1949
+ subscription: string;
1950
+ stream: "stdout" | "stderr";
1951
+ message: string;
1952
+ }
1953
+ /** The start's CLI-compatible JSON, exit status and human summary or refusal. */
1954
+ interface DesktopStartEndedEvent {
1955
+ event: "desktop-start-ended";
1956
+ subscription: string;
1957
+ exitCode: 0 | 1;
1958
+ stdout: string;
1959
+ message: string;
1960
+ }
1961
+ interface NativeRunOptions {
1962
+ slot?: string;
1963
+ metroCheck?: boolean;
1964
+ buildCache?: boolean;
1965
+ remoteBuild?: string;
1966
+ remote?: string;
1967
+ device?: string | boolean;
1968
+ wait?: string | boolean;
1969
+ easProfile?: string;
1970
+ }
1971
+ /** Artifact-only selectors shared by the in-process API and private Desktop transport. */
1972
+ type PlatformBuildOptions = {
1973
+ platform: "ios";
1974
+ configuration?: string;
1975
+ scheme?: string;
1976
+ /** Defaults to the host simulator architecture for Debug, or all architectures otherwise. */
1977
+ arch?: "arm64" | "x86_64" | "all";
1978
+ buildCache?: boolean;
1979
+ remoteBuild?: string;
1980
+ } | {
1981
+ platform: "android";
1982
+ variant?: string;
1983
+ abi?: "arm64-v8a" | "armeabi-v7a" | "x86" | "x86_64" | "all";
1984
+ buildCache?: boolean;
1985
+ remoteBuild?: string;
1986
+ } | {
1987
+ platform: "macos";
1988
+ remoteBuild?: string;
1989
+ };
1990
+ /** Build, install and launch selectors shared by the in-process API and private Desktop transport. */
1991
+ type PlatformRunOptions = (NativeRunOptions & {
1992
+ platform: "ios";
1993
+ configuration?: string;
1994
+ scheme?: string;
1995
+ deviceType?: string;
1996
+ runtime?: string;
1997
+ simulatorApp?: string;
1998
+ }) | (NativeRunOptions & {
1999
+ platform: "android";
2000
+ variant?: string;
2001
+ systemImage?: string;
2002
+ deviceProfile?: string;
2003
+ }) | {
2004
+ platform: "macos";
2005
+ remoteBuild?: string;
2006
+ remote?: string;
2007
+ } | {
2008
+ platform: "web";
2009
+ headed?: boolean;
2010
+ };
2011
+ /** Progress from a private Desktop platform run, before its terminal event. */
2012
+ interface DesktopRunProgressEvent {
2013
+ event: "desktop-run-progress";
2014
+ subscription: string;
2015
+ stream: "stdout" | "stderr";
2016
+ message: string;
2017
+ }
2018
+ /** The run's typed API result or refusal, exit status and summary. */
2019
+ interface DesktopRunEndedEvent {
2020
+ event: "desktop-run-ended";
2021
+ subscription: string;
2022
+ exitCode: 0 | 1;
2023
+ stdout: string;
2024
+ message: string;
2025
+ }
2026
+ /** Progress from a private Desktop artifact build, before its terminal event. */
2027
+ interface DesktopBuildProgressEvent {
2028
+ event: "desktop-build-progress";
2029
+ subscription: string;
2030
+ stream: "stdout" | "stderr";
2031
+ message: string;
2032
+ }
2033
+ /** The build's typed API result or refusal, exit status and summary. */
2034
+ interface DesktopBuildEndedEvent {
2035
+ event: "desktop-build-ended";
2036
+ subscription: string;
2037
+ exitCode: 0 | 1;
2038
+ stdout: string;
2039
+ message: string;
2040
+ }
2041
+ /** Progress from private Desktop garbage collection, before its terminal event. */
2042
+ interface DesktopGcProgressEvent {
2043
+ event: "desktop-gc-progress";
2044
+ subscription: string;
2045
+ stream: "stdout" | "stderr";
2046
+ message: string;
2047
+ }
2048
+ /** The GC JSON report or typed refusal, exit status and summary. */
2049
+ interface DesktopGcEndedEvent {
2050
+ event: "desktop-gc-ended";
2051
+ subscription: string;
2052
+ exitCode: 0 | 1;
2053
+ stdout: string;
2054
+ message: string;
2055
+ }
2056
+ /** Progress from private Desktop worktree removal, before its terminal event. */
2057
+ interface DesktopWorktreeRemoveProgressEvent {
2058
+ event: "desktop-worktree-remove-progress";
2059
+ subscription: string;
2060
+ stream: "stdout" | "stderr";
2061
+ message: string;
2062
+ }
2063
+ /** The removal result or typed refusal, exit status and summary. */
2064
+ interface DesktopWorktreeRemoveEndedEvent {
2065
+ event: "desktop-worktree-remove-ended";
2066
+ subscription: string;
2067
+ exitCode: 0 | 1;
2068
+ stdout: string;
2069
+ message: string;
2070
+ }
2071
+ /** Progress from private Desktop worktree warming, before its terminal event. */
2072
+ interface DesktopWorktreeWarmProgressEvent {
2073
+ event: "desktop-worktree-warm-progress";
2074
+ subscription: string;
2075
+ stream: "stdout" | "stderr";
2076
+ message: string;
2077
+ }
2078
+ /** The warming result or typed refusal, exit status and summary. */
2079
+ interface DesktopWorktreeWarmEndedEvent {
2080
+ event: "desktop-worktree-warm-ended";
2081
+ subscription: string;
2082
+ exitCode: 0 | 1;
2083
+ stdout: string;
2084
+ message: string;
2085
+ }
2086
+ /** Progress from a private Desktop machine-access request. */
2087
+ interface DesktopMachineAccessProgressEvent {
2088
+ event: "desktop-machine-access-progress";
2089
+ subscription: string;
2090
+ stream: "stdout" | "stderr";
2091
+ message: string;
2092
+ }
2093
+ /** The machine-access report or typed refusal after cleanup completes. */
2094
+ interface DesktopMachineAccessEndedEvent {
2095
+ event: "desktop-machine-access-ended";
2096
+ subscription: string;
2097
+ exitCode: 0 | 1;
2098
+ stdout: string;
2099
+ message: string;
2100
+ }
2101
+ type ServerEvent = DesktopMachineAccessProgressEvent | DesktopMachineAccessEndedEvent | DesktopWorktreeWarmProgressEvent | DesktopWorktreeWarmEndedEvent | DesktopWorktreeRemoveProgressEvent | DesktopWorktreeRemoveEndedEvent | DesktopGcProgressEvent | DesktopGcEndedEvent | DesktopBuildProgressEvent | DesktopBuildEndedEvent | DesktopRunProgressEvent | DesktopRunEndedEvent | DesktopStartProgressEvent | DesktopStartEndedEvent | DesktopReloadProgressEvent | DesktopReloadEndedEvent | DesktopStopProgressEvent | DesktopStopEndedEvent | DesktopReportEvent | BuildProgressEvent | NotificationEvent | StatusEvent | WorkspacesEvent | WorkspaceEvent | MachineEvent | LogsEvent | LogsEndedEvent | FrameEvent | DeviceFrameEvent | MacosWindowsEvent | FrameDelayedEvent | ReplayEndedEvent | ErrorEvent | ControlEndedEvent;
1535
2102
  type ServerMessage = ServerResponse | ServerEvent;
1536
2103
  type ServeRoute = {
1537
2104
  state: "routed";
@@ -1549,4 +2116,4 @@ type ServeRoute = {
1549
2116
  port: number;
1550
2117
  };
1551
2118
  //#endregion
1552
- export { FRAME_EDGE as $, TouchPhase as $n, Methods as $t, BuildToolchain as A, ReplayMarker as An, LOG_LEVELS as At, DEVICE_HOST_METHODS as B, ServerResponse as Bn, MAX_INPUT_TEXT as Bt, BuildPlanResult as C, ROTATE_DIRECTIONS as Cn, InputTextParams as Ct, BuildStartParams as D, ReplayEndedEvent as Dn, KeyModifier as Dt, BuildRequestAuth as E, ReloadPlatform as En, KEY_MODIFIERS as Et, ControlBeginParams as F, RotateDirection as Fn, LogRecord as Ft, DeviceHostRequestAuth as G, ServerUpdateStatus as Gn, MachineHistoryParams as Gt, DeviceAuth as H, ServerUpdatePackage as Hn, METHODS as Ht, ControlBeginResult as I, SERVER_UPDATE_METHODS as In, LogSource as It, DuoFramePose as J, SimulatorOptions as Jn, MachineVolume as Jt, DevicePosture as K, SettingsResult as Kn, MachineUpdateStatus as Kt, ControlEndParams as L, ServeRoute as Ln, LogsEndedEvent as Lt, CONTROL_END_REASONS as M, ReplaySpan as Mn, LegacyPushEvent as Mt, Capability as N, ReplayTarget as Nn, LogFilter as Nt, BuildSyncParams as O, ReplayKeyframe as On, KeyframeParams as Ot, ClientRequest as P, RequestId as Pn, LogLevel as Pt, FEATURES as Q, TOUCH_PHASES as Qn, Method as Qt, ControlEndedEvent as R, ServerEvent as Rn, LogsEvent as Rt, BuildPlanParams as S, REPLAY_RATES as Sn, InputSimulatorParams as St, BuildProgressEvent as T, RecordingSetResult as Tn, InputWindowParams as Tt, DeviceFrameArtwork as U, ServerUpdateProgress as Un, MachineDetails as Ut, DEVICE_POSTURES as V, ServerUpdateOutcome as Vn, MAX_LOG_TAIL as Vt, DeviceFrameEvent as W, ServerUpdateStartParams as Wn, MachineHistory as Wt, ErrorCode as X, StatusEvent as Xn, MacosWindowsEvent as Xt, ERROR_CODES as Y, StatsResult as Yn, MacosWindow as Yt, ErrorEvent as Z, SubscribeResult as Zn, MemoryPressure as Zt, BuildJobParams as _, PushEvent as _n, InputKey as _t, ArchiveDetailParams as a, NotificationSuppression as an, VIDEO_CODECS as ar, FramesLiveParams as at, BuildOfferParams as b, RELOAD_PLATFORMS as bn, InputRotateParams as bt, BUILD_REPO_PATTERN as c, NotificationsListResult as cn, VIDEO_KEYFRAME as cr, FramesSubscribeResult as ct, BuildArtifactResult as d, PROTOCOL_VERSION as dn, VideoPacket as dr, HelloResult as dt, NOTIFICATION_LEVELS as en, UnsubscribeParams as er, FRAME_FPS as et, BuildAttachResult as f, PUSH_EVENTS as fn, WorkspaceDiff as fr, HostedSessionRow as ft, BuildJobOutcome as g, ProtocolError as gn, WorkspacePatch as gr, InputButtonParams as gt, BuildFile as h, Platform as hn, WorkspaceParams as hr, InputButton as ht, ActionResult as i, NotificationLevel as in, VIDEO_ARTWORK as ir, FrameTarget as it, CAPABILITIES as j, ReplayRange as jn, LOG_SOURCES as jt, BuildSyncResult as k, ReplayKeyframeParams as kn, LEGACY_PUSH_EVENTS as kt, BUILD_RUBY_VERSION_PATTERN as l, PLATFORMS as ln, VIDEO_UNFOLDED as lr, GradleOffloadInputs as lt, BuildClientSummary as m, PairingAuth as mn, WorkspaceFiles as mr, INPUT_KEYS as mt, ActionName as n, NotificationEntry as nn, UsageSample as nr, FrameDelayedEvent as nt, ArchiveDetailResult as o, NotificationTarget as on, VIDEO_FOLDED as or, FramesSeekParams as ot, BuildCapacity as p, PUSH_TOKEN_PATTERN as pn, WorkspaceFile as pr, INPUT_BUTTONS as pt, DeviceUsageSeries as q, SimulatorCommand as qn, MachineUsage as qt, ActionParams as r, NotificationEvent as rn, UsageSeries as rr, FrameEvent as rt, BUILD_METHODS as s, NotificationsListParams as sn, VIDEO_HEADER_VERSION as sr, FramesSeekResult as st, ACTIONS as t, NOTIFICATION_SUPPRESSIONS as tn, UsageHistory as tr, Feature as tt, BuildAndroidOptions as u, PROTOCOL_SCHEMA_FILE as un, VideoCodec as ur, HelloParams as ut, BuildMachineCapacity as v, PushRegisterParams as vn, InputKeyParams as vt, BuildPlatform as w, RecordingSetParams as wn, InputTouchParams as wt, BuildOfferResult as x, REPLAY_MARKER_KINDS as xn, InputScrollParams as xt, BuildMachineReport as y, QuietHours as yn, InputPostureParams as yt, ControlPlatform as z, ServerMessage as zn, LogsQueryResult as zt };
2119
+ export { DesktopGcEndedEvent as $, QuietHours as $n, WorkspacesEvent as $r, InputScrollParams as $t, BuildProgressEvent as A, MemoryPressure as An, StatusEvent as Ar, FEATURES as At, CachedBuildArtifact as B, NotificationsListParams as Bn, VIDEO_FOLDED as Br, FramesSubscribeResult as Bt, BuildMachineCapacity as C, MachineHistory as Cn, ServerUpdateProgress as Cr, DeviceFrameEvent as Ct, BuildPlanParams as D, MachineVolume as Dn, SimulatorCommand as Dr, ERROR_CODES as Dt, BuildOfferResult as E, MachineUsage as En, SettingsResult as Er, DuoFramePose as Et, BuildSyncResult as F, NotificationEntry as Fn, UsageHistory as Fr, FrameEvent as Ft, ControlEndParams as G, PUSH_EVENTS as Gn, VideoPacket as Gr, INPUT_BUTTONS as Gt, ClientRequest as H, PLATFORMS as Hn, VIDEO_KEYFRAME as Hr, HelloParams as Ht, BuildToolchain as I, NotificationEvent as In, UsageSample as Ir, FrameTarget as It, DEVICE_HOST_METHODS as J, PlatformBuildOptions as Jn, WorkspaceFile as Jr, InputButtonParams as Jt, ControlEndedEvent as K, PUSH_TOKEN_PATTERN as Kn, WorkspaceDiff as Kr, INPUT_KEYS as Kt, BuildsHistoryResult as L, NotificationLevel as Ln, UsageSeries as Lr, FramesLiveParams as Lt, BuildStartParams as M, Methods as Mn, TOUCH_PHASES as Mr, FRAME_FPS as Mt, BuildSwiftpmArtifactQuery as N, NOTIFICATION_LEVELS as Nn, TouchPhase as Nr, Feature as Nt, BuildPlanResult as O, MacosWindow as On, SimulatorOptions as Or, ErrorCode as Ot, BuildSyncParams as P, NOTIFICATION_SUPPRESSIONS as Pn, UnsubscribeParams as Pr, FrameDelayedEvent as Pt, DesktopBuildProgressEvent as Q, PushRegisterParams as Qn, WorkspaceRef as Qr, InputRotateParams as Qt, CAPABILITIES as R, NotificationSuppression as Rn, VIDEO_ARTWORK as Rr, FramesSeekParams as Rt, BuildJobParams as S, MachineEvent as Sn, ServerUpdatePackage as Sr, DeviceFrameArtwork as St, BuildOfferParams as T, MachineUpdateStatus as Tn, ServerUpdateStatus as Tr, DeviceUsageSeries as Tt, ControlBeginParams as U, PROTOCOL_SCHEMA_FILE as Un, VIDEO_UNFOLDED as Ur, HelloResult as Ut, Capability as V, NotificationsListResult as Vn, VIDEO_HEADER_VERSION as Vr, GradleOffloadInputs as Vt, ControlBeginResult as W, PROTOCOL_VERSION as Wn, VideoCodec as Wr, HostedSessionRow as Wt, DesktopBootstrapChallenge as X, ProtocolError as Xn, WorkspaceParams as Xr, InputKeyParams as Xt, DEVICE_POSTURES as Y, PlatformRunOptions as Yn, WorkspaceFiles as Yr, InputKey as Yt, DesktopBuildEndedEvent as Z, PushEvent as Zn, WorkspacePatch as Zr, InputPostureParams as Zt, BuildCapacity as _, LogsQueryResult as _n, ServeRoute as _r, DesktopStopProgressEvent as _t, ActionResult as a, KeyModifier as an, RecordingSetResult as ar, DesktopReloadEndedEvent as at, BuildGradleArtifactQuery as b, METHODS as bn, ServerResponse as br, DesktopWorktreeWarmEndedEvent as bt, ArchivedListParams as c, LOG_LEVELS as cn, ReplayKeyframe as cr, DesktopReportSnapshot as ct, BUILD_REPO_PATTERN as d, LogFilter as dn, ReplayRange as dr, DesktopRunProgressEvent as dt, WorkspacesSnapshot as ei, InputSimulatorParams as en, RELOAD_PLATFORMS as er, DesktopGcProgressEvent as et, BUILD_RUBY_VERSION_PATTERN as f, LogLevel as fn, ReplaySpan as fr, DesktopSettingsWriteParams as ft, BuildAttachResult as g, LogsEvent as gn, SERVER_UPDATE_METHODS as gr, DesktopStopEndedEvent as gt, BuildArtifactResult as h, LogsEndedEvent as hn, RotateDirection as hr, DesktopStartProgressEvent as ht, ActionParams as i, KEY_MODIFIERS as in, RecordingSetParams as ir, DesktopPlanRefusal as it, BuildReactNativeArtifactQuery as j, Method as jn, SubscribeResult as jr, FRAME_EDGE as jt, BuildPlatform as k, MacosWindowsEvent as kn, StatsResult as kr, ErrorEvent as kt, ArchivedListResult as l, LOG_SOURCES as ln, ReplayKeyframeParams as lr, DesktopReportTarget as lt, BuildArtifactIdentity as m, LogSource as mn, RequestId as mr, DesktopStartEndedEvent as mt, ARCHIVED_PAGE_LIMIT as n, InputTouchParams as nn, REPLAY_RATES as nr, DesktopMachineAccessEndedEvent as nt, ArchiveDetailParams as o, KeyframeParams as on, ReloadPlatform as or, DesktopReloadProgressEvent as ot, BuildAndroidOptions as p, LogRecord as pn, ReplayTarget as pr, DesktopSettingsWriteResult as pt, ControlPlatform as q, Platform as qn, WorkspaceEvent as qr, InputButton as qt, ActionName as r, InputWindowParams as rn, ROTATE_DIRECTIONS as rr, DesktopMachineAccessProgressEvent as rt, ArchiveDetailResult as s, LEGACY_PUSH_EVENTS as sn, ReplayEndedEvent as sr, DesktopReportEvent as st, ACTIONS as t, InputTextParams as tn, REPLAY_MARKER_KINDS as tr, DesktopLogFilter as tt, BUILD_METHODS as u, LegacyPushEvent as un, ReplayMarker as ur, DesktopRunEndedEvent as ut, BuildClientSummary as v, MAX_INPUT_TEXT as vn, ServerEvent as vr, DesktopWorktreeRemoveEndedEvent as vt, BuildMachineReport as w, MachineHistoryParams as wn, ServerUpdateStartParams as wr, DevicePosture as wt, BuildJobOutcome as x, MachineDetails as xn, ServerUpdateOutcome as xr, DesktopWorktreeWarmProgressEvent as xt, BuildFile as y, MAX_LOG_TAIL as yn, ServerMessage as yr, DesktopWorktreeRemoveProgressEvent as yt, CONTROL_END_REASONS as z, NotificationTarget as zn, VIDEO_CODECS as zr, FramesSeekResult as zt };