@opengeni/agent-proto 0.2.1 → 0.4.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.
@@ -0,0 +1,1625 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "opengeni.agent.v1";
3
+ export declare enum ErrorCode {
4
+ ERROR_CODE_UNSPECIFIED = 0,
5
+ /** ERROR_CODE_UNSUPPORTED - The requested op is not implemented / not permitted on this platform. */
6
+ ERROR_CODE_UNSUPPORTED = 1,
7
+ /** ERROR_CODE_OS - A filesystem/exec/git op failed at the OS layer (see `detail`). */
8
+ ERROR_CODE_OS = 2,
9
+ /** ERROR_CODE_NOT_FOUND - The path/ref/target referenced by the op does not exist. */
10
+ ERROR_CODE_NOT_FOUND = 3,
11
+ /** ERROR_CODE_CONSENT_REQUIRED - The op was rejected by consent/capability gating (e.g. screen-control off). */
12
+ ERROR_CODE_CONSENT_REQUIRED = 4,
13
+ /** ERROR_CODE_TIMEOUT - The op timed out inside the agent. */
14
+ ERROR_CODE_TIMEOUT = 5,
15
+ /** ERROR_CODE_DRAINING - The agent is shutting down / draining and cannot accept new work. */
16
+ ERROR_CODE_DRAINING = 6,
17
+ /** ERROR_CODE_PROTOCOL - A protocol-level violation (bad envelope, unknown op for this version). */
18
+ ERROR_CODE_PROTOCOL = 7,
19
+ /** ERROR_CODE_STREAM - A required stream channel could not be opened on the relay. */
20
+ ERROR_CODE_STREAM = 8,
21
+ /** ERROR_CODE_AGENT_OFFLINE - The control plane synthesized this because no agent responded (offline). */
22
+ ERROR_CODE_AGENT_OFFLINE = 9,
23
+ /** ERROR_CODE_FENCED - An epoch fence rejected a stale op; caller should re-resolve and retry. */
24
+ ERROR_CODE_FENCED = 10,
25
+ /**
26
+ * ERROR_CODE_PAYLOAD_TOO_LARGE - The op's reply would exceed the transport's negotiated max payload and could
27
+ * not be published (e.g. a full-res screenshot, or an unbounded file read/exec
28
+ * output). The agent's wire-seam backstop synthesizes THIS instead of letting
29
+ * the oversized publish fail silently and the caller time out opaquely.
30
+ * Not retryable — the same op would produce the same oversized reply.
31
+ */
32
+ ERROR_CODE_PAYLOAD_TOO_LARGE = 11
33
+ }
34
+ export declare function errorCodeFromJSON(object: any): ErrorCode;
35
+ export declare function errorCodeToJSON(object: ErrorCode): string;
36
+ /** The operating system family the agent runs on. */
37
+ export declare enum Os {
38
+ OS_UNSPECIFIED = 0,
39
+ OS_LINUX = 1,
40
+ OS_MACOS = 2,
41
+ OS_WINDOWS = 3
42
+ }
43
+ export declare function osFromJSON(object: any): Os;
44
+ export declare function osToJSON(object: Os): string;
45
+ /** CPU architecture. */
46
+ export declare enum Arch {
47
+ ARCH_UNSPECIFIED = 0,
48
+ ARCH_X86_64 = 1,
49
+ ARCH_AARCH64 = 2
50
+ }
51
+ export declare function archFromJSON(object: any): Arch;
52
+ export declare function archToJSON(object: Arch): string;
53
+ /** The kind of byte stream a relay channel carries. */
54
+ export declare enum StreamKind {
55
+ STREAM_KIND_UNSPECIFIED = 0,
56
+ /** STREAM_KIND_PTY - An interactive pseudo-terminal (ttyd-equivalent). */
57
+ STREAM_KIND_PTY = 1,
58
+ /** STREAM_KIND_DESKTOP - A desktop framebuffer (noVNC-equivalent) for view + computer-use. */
59
+ STREAM_KIND_DESKTOP = 2,
60
+ /**
61
+ * STREAM_KIND_BROWSER - Browser-native encoded frames from one BrowserSession target. The payload is
62
+ * the canonical OpenGeni browser-frame message, not a desktop capture.
63
+ */
64
+ STREAM_KIND_BROWSER = 3,
65
+ /**
66
+ * STREAM_KIND_COMPUTER - Native app/window/screen frames from one ComputerSession target. Browser and
67
+ * Computer frames share the relay transport, but never the resource label.
68
+ */
69
+ STREAM_KIND_COMPUTER = 4
70
+ }
71
+ export declare function streamKindFromJSON(object: any): StreamKind;
72
+ export declare function streamKindToJSON(object: StreamKind): string;
73
+ export declare enum DeviceAuthState {
74
+ DEVICE_AUTH_STATE_UNSPECIFIED = 0,
75
+ /** DEVICE_AUTH_STATE_PENDING - The user has not yet completed the flow; keep polling. */
76
+ DEVICE_AUTH_STATE_PENDING = 1,
77
+ /** DEVICE_AUTH_STATE_AUTHORIZED - The user authorized; `credentials` are present. */
78
+ DEVICE_AUTH_STATE_AUTHORIZED = 2,
79
+ /** DEVICE_AUTH_STATE_DENIED - The user explicitly denied the request. */
80
+ DEVICE_AUTH_STATE_DENIED = 3,
81
+ /** DEVICE_AUTH_STATE_EXPIRED - The device_code expired before authorization. */
82
+ DEVICE_AUTH_STATE_EXPIRED = 4,
83
+ /** DEVICE_AUTH_STATE_SLOW_DOWN - The agent is polling too fast and must slow down. */
84
+ DEVICE_AUTH_STATE_SLOW_DOWN = 5
85
+ }
86
+ export declare function deviceAuthStateFromJSON(object: any): DeviceAuthState;
87
+ export declare function deviceAuthStateToJSON(object: DeviceAuthState): string;
88
+ export declare enum FsEntryKind {
89
+ FS_ENTRY_KIND_UNSPECIFIED = 0,
90
+ FS_ENTRY_KIND_FILE = 1,
91
+ FS_ENTRY_KIND_DIRECTORY = 2,
92
+ FS_ENTRY_KIND_SYMLINK = 3
93
+ }
94
+ export declare function fsEntryKindFromJSON(object: any): FsEntryKind;
95
+ export declare function fsEntryKindToJSON(object: FsEntryKind): string;
96
+ export declare enum GitOp {
97
+ GIT_OP_UNSPECIFIED = 0,
98
+ GIT_OP_STATUS = 1,
99
+ GIT_OP_DIFF = 2,
100
+ GIT_OP_LOG = 3,
101
+ GIT_OP_ADD = 4,
102
+ GIT_OP_COMMIT = 5,
103
+ GIT_OP_BRANCH = 6,
104
+ GIT_OP_CHECKOUT = 7,
105
+ GIT_OP_PULL = 8,
106
+ GIT_OP_PUSH = 9,
107
+ /** GIT_OP_RAW - Any other subcommand, passed through verbatim via `args`. */
108
+ GIT_OP_RAW = 15
109
+ }
110
+ export declare function gitOpFromJSON(object: any): GitOp;
111
+ export declare function gitOpToJSON(object: GitOp): string;
112
+ export declare enum GoingOfflineReason {
113
+ GOING_OFFLINE_REASON_UNSPECIFIED = 0,
114
+ /** GOING_OFFLINE_REASON_USER_STOP - The user stopped the foreground process. */
115
+ GOING_OFFLINE_REASON_USER_STOP = 1,
116
+ /** GOING_OFFLINE_REASON_UPDATE - The agent is restarting itself for a self-update. */
117
+ GOING_OFFLINE_REASON_UPDATE = 2,
118
+ /** GOING_OFFLINE_REASON_HOST_SHUTDOWN - The host is shutting down / suspending. */
119
+ GOING_OFFLINE_REASON_HOST_SHUTDOWN = 3
120
+ }
121
+ export declare function goingOfflineReasonFromJSON(object: any): GoingOfflineReason;
122
+ export declare function goingOfflineReasonToJSON(object: GoingOfflineReason): string;
123
+ /** The logical byte stream an op-frame Data chunk belongs to. */
124
+ export declare enum OpChannel {
125
+ OP_CHANNEL_UNSPECIFIED = 0,
126
+ OP_CHANNEL_STDOUT = 1,
127
+ OP_CHANNEL_STDERR = 2,
128
+ /** OP_CHANNEL_CONTENT - Non-exec content (fs_read bodies and similar). */
129
+ OP_CHANNEL_CONTENT = 3
130
+ }
131
+ export declare function opChannelFromJSON(object: any): OpChannel;
132
+ export declare function opChannelToJSON(object: OpChannel): string;
133
+ /**
134
+ * An op's lifecycle state on the runner: accepted → running → complete(retained)
135
+ * → gc; or lost. `lost` is always TYPED (see OpLostReason) — never a silent gap.
136
+ */
137
+ export declare enum OpState {
138
+ OP_STATE_UNSPECIFIED = 0,
139
+ OP_STATE_ACCEPTED = 1,
140
+ OP_STATE_RUNNING = 2,
141
+ OP_STATE_COMPLETE = 3,
142
+ OP_STATE_LOST = 4
143
+ }
144
+ export declare function opStateFromJSON(object: any): OpState;
145
+ export declare function opStateToJSON(object: OpState): string;
146
+ /** Why a lost op is lost (present iff OpStatus.state == OP_STATE_LOST). */
147
+ export declare enum OpLostReason {
148
+ OP_LOST_REASON_UNSPECIFIED = 0,
149
+ /**
150
+ * OP_LOST_REASON_EVICTED - A completed op's retained result was evicted (bounded LRU registry) before a
151
+ * final ack arrived — a loud, counted event, surfaced honestly on a late query.
152
+ */
153
+ OP_LOST_REASON_EVICTED = 1,
154
+ /**
155
+ * OP_LOST_REASON_AGENT_RESTARTED - The runner process restarted and the op's in-memory scope did not survive
156
+ * (until the journal + scope re-adoption of a later milestone).
157
+ */
158
+ OP_LOST_REASON_AGENT_RESTARTED = 2
159
+ }
160
+ export declare function opLostReasonFromJSON(object: any): OpLostReason;
161
+ export declare function opLostReasonToJSON(object: OpLostReason): string;
162
+ export declare enum StreamRole {
163
+ STREAM_ROLE_UNSPECIFIED = 0,
164
+ /** STREAM_ROLE_AGENT - The agent producing pty/desktop bytes. */
165
+ STREAM_ROLE_AGENT = 1,
166
+ /** STREAM_ROLE_CLIENT - The viewer/pty client consuming them (and sending input back). */
167
+ STREAM_ROLE_CLIENT = 2
168
+ }
169
+ export declare function streamRoleFromJSON(object: any): StreamRole;
170
+ export declare function streamRoleToJSON(object: StreamRole): string;
171
+ export declare enum StreamCloseReason {
172
+ STREAM_CLOSE_REASON_UNSPECIFIED = 0,
173
+ /** STREAM_CLOSE_REASON_NORMAL - Normal end (pty exited, viewer left). */
174
+ STREAM_CLOSE_REASON_NORMAL = 1,
175
+ /** STREAM_CLOSE_REASON_PROCESS_EXIT - The producing process ended. */
176
+ STREAM_CLOSE_REASON_PROCESS_EXIT = 2,
177
+ /** STREAM_CLOSE_REASON_FENCED - The epoch fence invalidated the channel (a swap-away). */
178
+ STREAM_CLOSE_REASON_FENCED = 3,
179
+ /** STREAM_CLOSE_REASON_TRANSPORT_ERROR - A relay/transport error (the client should reconnect+resume). */
180
+ STREAM_CLOSE_REASON_TRANSPORT_ERROR = 4,
181
+ /** STREAM_CLOSE_REASON_RATE_LIMITED - Rate-limit / backpressure shed the channel. */
182
+ STREAM_CLOSE_REASON_RATE_LIMITED = 5
183
+ }
184
+ export declare function streamCloseReasonFromJSON(object: any): StreamCloseReason;
185
+ export declare function streamCloseReasonToJSON(object: StreamCloseReason): string;
186
+ export declare enum PointerAction {
187
+ POINTER_ACTION_UNSPECIFIED = 0,
188
+ POINTER_ACTION_MOVE = 1,
189
+ POINTER_ACTION_DOWN = 2,
190
+ POINTER_ACTION_UP = 3,
191
+ POINTER_ACTION_CLICK = 4,
192
+ POINTER_ACTION_DOUBLE_CLICK = 5
193
+ }
194
+ export declare function pointerActionFromJSON(object: any): PointerAction;
195
+ export declare function pointerActionToJSON(object: PointerAction): string;
196
+ export declare enum PointerButton {
197
+ POINTER_BUTTON_UNSPECIFIED = 0,
198
+ POINTER_BUTTON_LEFT = 1,
199
+ POINTER_BUTTON_RIGHT = 2,
200
+ POINTER_BUTTON_MIDDLE = 3
201
+ }
202
+ export declare function pointerButtonFromJSON(object: any): PointerButton;
203
+ export declare function pointerButtonToJSON(object: PointerButton): string;
204
+ export declare enum KeyAction {
205
+ KEY_ACTION_UNSPECIFIED = 0,
206
+ KEY_ACTION_DOWN = 1,
207
+ KEY_ACTION_UP = 2,
208
+ KEY_ACTION_PRESS = 3
209
+ }
210
+ export declare function keyActionFromJSON(object: any): KeyAction;
211
+ export declare function keyActionToJSON(object: KeyAction): string;
212
+ /**
213
+ * A typed error returned by the agent (or synthesized by the control plane for
214
+ * a non-responding agent). `code` is a stable machine-readable discriminant;
215
+ * `message` is human-facing; `retryable` lets the turn layer decide whether to
216
+ * pause-and-retry (a reconnect blip) versus surface a hard failure.
217
+ */
218
+ export interface AgentError {
219
+ code: ErrorCode;
220
+ message: string;
221
+ retryable: boolean;
222
+ /** Optional structured detail (e.g. an OS errno, a git exit code) for logs. */
223
+ detail: {
224
+ [key: string]: string;
225
+ };
226
+ }
227
+ export interface AgentError_DetailEntry {
228
+ key: string;
229
+ value: string;
230
+ }
231
+ /**
232
+ * The agent's self-description, sent on connect (the "hello") and refreshed on
233
+ * reconnect. The control plane folds this into the negotiated SessionCapabilities
234
+ * document (every capability cell is available:false+reason, never absent).
235
+ */
236
+ export interface Hello {
237
+ agentId: string;
238
+ workspaceId: string;
239
+ /** Semantic version of the running agent binary (drives staged self-update). */
240
+ agentVersion: string;
241
+ os: Os;
242
+ arch: Arch;
243
+ /** Human-friendly machine name (hostname by default; user-overridable). */
244
+ machineName: string;
245
+ /** The agent-reported working root the control plane treats as the sandbox cwd. */
246
+ workspaceRoot: string;
247
+ /** Capabilities the agent can serve given its platform + consent grants. */
248
+ capabilities: Capabilities | undefined;
249
+ /** The update channel this agent follows (stable|beta), for fleet-pinning. */
250
+ updateChannel: string;
251
+ /**
252
+ * A resume token minted by a prior connection, echoed so the control plane can
253
+ * recognize a reconnect (vs a fresh enrollment) and fence by epoch. Empty on
254
+ * first connect.
255
+ */
256
+ resumeToken: string;
257
+ }
258
+ /**
259
+ * What the agent is able and consented to do. Each bool is a hard capability
260
+ * gate; the control plane maps a false to a CapabilityUnavailableReason.
261
+ */
262
+ export interface Capabilities {
263
+ /** Channel-A structural surface (always true for a connected agent). */
264
+ exec: boolean;
265
+ filesystem: boolean;
266
+ git: boolean;
267
+ /** An interactive PTY can be opened over the relay. */
268
+ pty: boolean;
269
+ /** A desktop framebuffer is available (a display exists or Xvfb is enabled). */
270
+ desktop: boolean;
271
+ /** The user consented to whole-machine access during enrollment. */
272
+ consentedWholeMachine: boolean;
273
+ /** The user consented to screen capture + synthetic input (computer-use). */
274
+ consentedScreenControl: boolean;
275
+ /** Display detail (absent => headless / no display). */
276
+ display: Display | undefined;
277
+ /**
278
+ * When a display physically EXISTS but the OS withholds the screen-CAPTURE grant
279
+ * (macOS Screen Recording / TCC), `desktop` is reported false and this carries a
280
+ * human, actionable reason (e.g. "grant Screen Recording in System Settings").
281
+ * Empty when capture is permitted or the platform has no separate capture grant
282
+ * (Linux/x11). Advertised at Hello so the control plane degrades the desktop cell
283
+ * with a legible hint instead of offering a desktop it cannot capture — the
284
+ * machine that "claims a display it can't capture" bug the 0.1.3 incident exposed.
285
+ */
286
+ desktopUnavailableReason: string;
287
+ /**
288
+ * The runner speaks the op-stream protocol (OpStart/OpFrame/OpAck; see the
289
+ * op-stream section below). Advertised at Hello; the server uses the streaming
290
+ * path only when this is true AND its own feature flag is on, else the legacy
291
+ * monolithic ops run exactly as today. Additive — absent (false) on an older
292
+ * runner means "legacy path", no version coupling.
293
+ */
294
+ opStream: boolean;
295
+ /**
296
+ * A local attached-browser bridge is available. The bridge inventories live
297
+ * browser-profile endpoints separately from this machine enrollment because
298
+ * one machine may host multiple Chrome profiles.
299
+ */
300
+ browserBridge: boolean;
301
+ }
302
+ /**
303
+ * Capabilities of one live browser-profile bridge endpoint. This describes the
304
+ * transport endpoint only; reusable login/profile state is a separate control-
305
+ * plane BrowserIdentity resource.
306
+ */
307
+ export interface AttachedBrowserDeviceCapabilities {
308
+ tabInventory: boolean;
309
+ debuggerAttachment: boolean;
310
+ semanticObservation: boolean;
311
+ screenshots: boolean;
312
+ liveFrames: boolean;
313
+ humanInput: boolean;
314
+ diagnostics: boolean;
315
+ rawCdp: boolean;
316
+ linkedComputer: boolean;
317
+ }
318
+ export interface AttachedBrowserDeviceAnnouncement {
319
+ id: string;
320
+ name: string;
321
+ /** Empty means Chrome did not expose a profile label. */
322
+ profileLabel: string;
323
+ browserName: string;
324
+ browserVersion: string;
325
+ extensionVersion: string;
326
+ platform: Os;
327
+ arch: Arch;
328
+ /** Changes whenever this extension/native-host connection restarts. */
329
+ connectionGeneration: string;
330
+ inventoryRevision: string;
331
+ tabCount: number;
332
+ capabilities: AttachedBrowserDeviceCapabilities | undefined;
333
+ }
334
+ /**
335
+ * One complete, monotonically-versioned snapshot from the machine's browser
336
+ * bridge. Presence on a heartbeat makes the list authoritative, including an
337
+ * empty list; absence means an older/no-bridge agent and changes nothing.
338
+ */
339
+ export interface AttachedBrowserInventorySnapshot {
340
+ bridgeGeneration: string;
341
+ revision: string;
342
+ devices: AttachedBrowserDeviceAnnouncement[];
343
+ }
344
+ /** Detail about the agent's graphical display, when one is present. */
345
+ export interface Display {
346
+ /** e.g. ":0", ":99" (Xvfb), or a platform handle. */
347
+ id: string;
348
+ width: number;
349
+ height: number;
350
+ /** True when backed by a virtual framebuffer (Xvfb) rather than a real screen. */
351
+ virtual: boolean;
352
+ }
353
+ /**
354
+ * The agent begins enrollment by asking the control plane to start a device
355
+ * flow. The control plane returns a user-code + verification URL the user visits
356
+ * to consent (whole-machine + optional screen-control) and authorize.
357
+ */
358
+ export interface DeviceAuthStartRequest {
359
+ /**
360
+ * The agent's stable install identity (a per-install keypair fingerprint),
361
+ * bound to the enrollment so the issued credentials are non-transferable.
362
+ */
363
+ installFingerprint: string;
364
+ os: Os;
365
+ arch: Arch;
366
+ machineName: string;
367
+ /** The update channel the user selected at install time. */
368
+ updateChannel: string;
369
+ }
370
+ export interface DeviceAuthStartResponse {
371
+ /** Short code the user types at the verification URL. */
372
+ userCode: string;
373
+ /** The opaque device code the agent polls with. */
374
+ deviceCode: string;
375
+ /** Where the user goes to authorize (e.g. https://get.opengeni.ai/device). */
376
+ verificationUri: string;
377
+ /** A pre-filled convenience URL embedding the user_code. */
378
+ verificationUriComplete: string;
379
+ /** Seconds the device_code remains valid. */
380
+ expiresInSeconds: number;
381
+ /** Minimum seconds the agent must wait between polls. */
382
+ pollIntervalSeconds: number;
383
+ }
384
+ /** The agent polls until the user authorizes (or it expires / is denied). */
385
+ export interface DeviceAuthPollRequest {
386
+ deviceCode: string;
387
+ }
388
+ export interface DeviceAuthPollResponse {
389
+ state: DeviceAuthState;
390
+ /** Present only when state == AUTHORIZED. */
391
+ credentials: EnrollmentCredentials | undefined;
392
+ }
393
+ /**
394
+ * The scoped credentials persisted (0600) on the machine after enrollment.
395
+ * These are workspace-scoped — they can address only this workspace's agents.
396
+ */
397
+ export interface EnrollmentCredentials {
398
+ agentId: string;
399
+ workspaceId: string;
400
+ /**
401
+ * The NATS CONNECT AUTH-TOKEN the agent presents (the signed `oge_` enrollment
402
+ * bearer). The server runs with AUTH CALLOUT (M-AUTH): on connect
403
+ * the agent passes this as the auth-token; nats-server issues an authorization
404
+ * request to the control-plane's callout responder, which validates the bearer
405
+ * and returns a SIGNED user JWT scoping the connection to pub/sub ONLY
406
+ * `agent.<ws>.>` (+ `_INBOX.>`). That per-subject scope IS the per-workspace
407
+ * tenancy boundary — there is NO per-machine creds file to ship. (Field name kept
408
+ * for proto stability; it now carries the bearer, not an operator creds-file body.)
409
+ */
410
+ natsCredentials: string;
411
+ /**
412
+ * The NATS server URL(s) to dial. For the control plane these are `wss://` URLs
413
+ * (the relay-symmetric TLS ingress) so the agent rides the same TLS endpoint as
414
+ * the stream relay — no separate public TCP load balancer.
415
+ */
416
+ natsUrls: string[];
417
+ /** The relay edge base URL for opening stream channels. */
418
+ relayUrl: string;
419
+ /** The minisign public key the agent pins for self-update verification. */
420
+ updatePubkey: string;
421
+ /** Whether the user consented to whole-machine access. */
422
+ consentedWholeMachine: boolean;
423
+ /** Whether the user consented to screen capture + synthetic input. */
424
+ consentedScreenControl: boolean;
425
+ /**
426
+ * The agent's PRODUCER token for the relay edge (the relay-dial
427
+ * protocol). Presented as `StreamOpen.token` when the agent registers a
428
+ * pty/desktop channel (role=AGENT). It is a control-plane-minted, workspace+agent
429
+ * -scoped `ogr_` HMAC token the relay verifies on its own merits — DISTINCT from
430
+ * the viewer's `ogs_` stream token (which the control plane mints per viewer and
431
+ * the relay also verifies). The relay pairs the producer and consumer by the
432
+ * channel key once BOTH tokens pass. Additive proto3 field; empty for an
433
+ * enrollment minted before the relay-token plane is configured (the agent then
434
+ * presents an empty token the relay rejects, surfacing the gap loudly).
435
+ */
436
+ relayToken: string;
437
+ }
438
+ export interface ExecRequest {
439
+ /** argv[0] is the program; the agent does NOT shell-interpret unless `shell`. */
440
+ command: string[];
441
+ /** When true, `command` is joined and run through the platform shell. */
442
+ shell: boolean;
443
+ /** Working directory; defaults to the agent's workspace_root when empty. */
444
+ cwd: string;
445
+ /** Extra environment variables layered over the agent's environment. */
446
+ env: {
447
+ [key: string]: string;
448
+ };
449
+ /** Optional stdin fed to the process. */
450
+ stdin: Uint8Array;
451
+ /** Optional hard wall-clock timeout; 0 means no process deadline. */
452
+ timeoutMs: number;
453
+ }
454
+ export interface ExecRequest_EnvEntry {
455
+ key: string;
456
+ value: string;
457
+ }
458
+ export interface ExecResponse {
459
+ exitCode: number;
460
+ stdout: Uint8Array;
461
+ stderr: Uint8Array;
462
+ /** True when the process was killed by `timeout_ms`. */
463
+ timedOut: boolean;
464
+ /** Wall-clock duration the process ran. */
465
+ durationMs: string;
466
+ }
467
+ export interface FsReadRequest {
468
+ path: string;
469
+ /** Optional byte offset + length for ranged reads (0 length => to EOF). */
470
+ offset: string;
471
+ length: string;
472
+ }
473
+ export interface FsReadResponse {
474
+ content: Uint8Array;
475
+ /** Total size of the file (so a ranged read knows there is more). */
476
+ totalSize: string;
477
+ }
478
+ export interface FsWriteRequest {
479
+ path: string;
480
+ content: Uint8Array;
481
+ /** Create parent directories as needed. */
482
+ createParents: boolean;
483
+ /** Append rather than truncate-and-write. */
484
+ append: boolean;
485
+ /** POSIX mode for a newly created file (e.g. 0644); 0 => platform default. */
486
+ mode: number;
487
+ }
488
+ export interface FsWriteResponse {
489
+ bytesWritten: string;
490
+ }
491
+ export interface FsListRequest {
492
+ path: string;
493
+ /** Recurse into subdirectories. */
494
+ recursive: boolean;
495
+ }
496
+ export interface FsListResponse {
497
+ entries: FsEntry[];
498
+ }
499
+ export interface FsEntry {
500
+ name: string;
501
+ /** Path relative to the listed directory. */
502
+ path: string;
503
+ kind: FsEntryKind;
504
+ size: string;
505
+ /** Last-modified time, unix epoch ms. */
506
+ modifiedMs: string;
507
+ mode: number;
508
+ }
509
+ export interface FsMkdirRequest {
510
+ path: string;
511
+ /** Create intermediate directories (mkdir -p). */
512
+ parents: boolean;
513
+ mode: number;
514
+ }
515
+ export interface FsMkdirResponse {
516
+ }
517
+ export interface FsMoveRequest {
518
+ from: string;
519
+ to: string;
520
+ /** Overwrite the destination if it exists. */
521
+ overwrite: boolean;
522
+ }
523
+ export interface FsMoveResponse {
524
+ }
525
+ export interface FsStatRequest {
526
+ path: string;
527
+ }
528
+ export interface FsStatResponse {
529
+ /** Absent when the path does not exist (the op still succeeds; `exists=false`). */
530
+ exists: boolean;
531
+ entry: FsEntry | undefined;
532
+ }
533
+ export interface FsRemoveRequest {
534
+ path: string;
535
+ /** Remove directories recursively. */
536
+ recursive: boolean;
537
+ }
538
+ export interface FsRemoveResponse {
539
+ }
540
+ /**
541
+ * A single git operation. The agent runs git against the repo rooted at `cwd`
542
+ * (or workspace_root) and returns structured results where it can, falling back
543
+ * to raw stdout for pass-through subcommands.
544
+ */
545
+ export interface GitRequest {
546
+ op: GitOp;
547
+ /** Repo working directory; defaults to workspace_root. */
548
+ cwd: string;
549
+ /** Free-form args for ops that pass through (e.g. log/diff flags). */
550
+ args: string[];
551
+ }
552
+ export interface GitResponse {
553
+ exitCode: number;
554
+ /** Raw stdout/stderr for pass-through fidelity. */
555
+ stdout: Uint8Array;
556
+ stderr: Uint8Array;
557
+ /** Structured status, present for GIT_OP_STATUS. */
558
+ status: GitStatus | undefined;
559
+ }
560
+ export interface GitStatus {
561
+ branch: string;
562
+ /** The upstream tracking branch, if any. */
563
+ upstream: string;
564
+ ahead: number;
565
+ behind: number;
566
+ files: GitFileStatus[];
567
+ clean: boolean;
568
+ }
569
+ export interface GitFileStatus {
570
+ path: string;
571
+ /** Two-letter porcelain code (e.g. " M", "??", "A "). */
572
+ code: string;
573
+ staged: boolean;
574
+ }
575
+ /**
576
+ * Open a PTY. The agent allocates a pseudo-terminal, spawns the shell/command,
577
+ * and registers a relay stream channel of kind PTY. The returned `channel`
578
+ * identifies the stream the viewer connects to.
579
+ */
580
+ export interface PtyOpenRequest {
581
+ /** Shell/command to run; empty => the user's default login shell. */
582
+ command: string[];
583
+ cwd: string;
584
+ env: {
585
+ [key: string]: string;
586
+ };
587
+ cols: number;
588
+ rows: number;
589
+ /** The TERM value to advertise (e.g. "xterm-256color"). */
590
+ term: string;
591
+ }
592
+ export interface PtyOpenRequest_EnvEntry {
593
+ key: string;
594
+ value: string;
595
+ }
596
+ export interface PtyOpenResponse {
597
+ /** A handle for subsequent resize/close control ops. */
598
+ ptyId: string;
599
+ /** The relay stream channel carrying the PTY bytes. */
600
+ channel: StreamChannel | undefined;
601
+ }
602
+ /**
603
+ * Write input bytes to a PTY. (Bulk interactive bytes normally ride the stream
604
+ * plane as StreamFrames; this control op exists for programmatic injection.)
605
+ */
606
+ export interface PtyWriteRequest {
607
+ ptyId: string;
608
+ data: Uint8Array;
609
+ }
610
+ export interface PtyWriteResponse {
611
+ bytesWritten: string;
612
+ }
613
+ export interface PtyResizeRequest {
614
+ ptyId: string;
615
+ cols: number;
616
+ rows: number;
617
+ }
618
+ export interface PtyResizeResponse {
619
+ }
620
+ export interface PtyCloseRequest {
621
+ ptyId: string;
622
+ }
623
+ export interface PtyCloseResponse {
624
+ /** The exit code of the PTY's root process, if it had exited. */
625
+ exitCode: number;
626
+ }
627
+ /**
628
+ * Ensure a desktop framebuffer stream exists, registering a relay channel of
629
+ * kind DESKTOP. Idempotent: repeated calls return the same live channel.
630
+ */
631
+ export interface DesktopEnsureRequest {
632
+ /** Request a specific geometry (0 => the display's native geometry). */
633
+ width: number;
634
+ height: number;
635
+ }
636
+ export interface DesktopEnsureResponse {
637
+ channel: StreamChannel | undefined;
638
+ display: Display | undefined;
639
+ }
640
+ /**
641
+ * Inject one synthetic computer-use input event on the machine's desktop — the
642
+ * CONTROL-PLANE twin of the relay DesktopInput (the agent drives its OWN screen
643
+ * for computer-use; there is no human viewer channel). Reuses the relay
644
+ * DesktopInput event shapes; there is no channel_id (this goes straight to the
645
+ * display, not a relay channel). Injection is gated on consented_screen_control:
646
+ * an ungated call fails with ERROR_CODE_CONSENT_REQUIRED and never touches the OS.
647
+ */
648
+ export interface DesktopInputRequest {
649
+ event: {
650
+ $case: "pointer";
651
+ pointer: PointerEvent;
652
+ } | {
653
+ $case: "key";
654
+ key: KeyEvent;
655
+ } | {
656
+ $case: "scroll";
657
+ scroll: ScrollEvent;
658
+ } | undefined;
659
+ }
660
+ export interface DesktopInputResponse {
661
+ }
662
+ /**
663
+ * Capture a single screenshot of the machine's desktop as a PNG. A VIEW op: it
664
+ * needs a display, NOT screen-control consent (the view/control decoupling), so
665
+ * it is not consent-gated. Returns the encoded image plus its geometry so the
666
+ * caller can size a canvas without decoding.
667
+ */
668
+ export interface DesktopScreenshotRequest {
669
+ }
670
+ export interface DesktopScreenshotResponse {
671
+ png: Uint8Array;
672
+ /**
673
+ * The geometry of the ENCODED image (what a viewer/model actually sees). When
674
+ * the raw capture is too large to fit the control-plane transport's max payload,
675
+ * the agent DOWNSCALES the PNG so the reply publishes (a full-res Retina/busy
676
+ * screen can exceed NATS's 1 MiB default); width/height then describe the
677
+ * downscaled image, and `native_width`/`native_height` below carry the original.
678
+ */
679
+ width: number;
680
+ height: number;
681
+ /**
682
+ * The ORIGINAL (pre-downscale) capture geometry. Equal to width/height when no
683
+ * downscale was needed. The computer-use coordinate mapping scales a model click
684
+ * (expressed in the ENCODED pixel space it saw) back up to this native pixel
685
+ * space before injecting, so clicks land correctly even on a downscaled frame.
686
+ * 0 (unset by an older agent) MUST be read as "same as width/height" (no scale).
687
+ */
688
+ nativeWidth: number;
689
+ nativeHeight: number;
690
+ }
691
+ /**
692
+ * Ensure the agent-owned browserd sidecar for one physical attached-browser
693
+ * generation. The authenticated control plane supplies the placement-scoped
694
+ * authority; the runner writes it owner-only and never places it in argv/logs.
695
+ */
696
+ export interface BrowserControlEnsureRequest {
697
+ scopeId: string;
698
+ scopeGeneration: string;
699
+ adminToken: string;
700
+ allowedOrigins: string[];
701
+ }
702
+ export interface BrowserControlEnsureResponse {
703
+ port: number;
704
+ sidecarGeneration: string;
705
+ }
706
+ /**
707
+ * Open one browserd frame subscription and relay its canonical binary browser
708
+ * frame messages over a fresh STREAM_KIND_BROWSER channel. browserd remains
709
+ * loopback-only; only the short-lived view grant crosses this local boundary.
710
+ */
711
+ export interface BrowserFramesOpenRequest {
712
+ scopeId: string;
713
+ scopeGeneration: string;
714
+ browserSessionId: string;
715
+ controllerGeneration: string;
716
+ targetId: string;
717
+ viewToken: string;
718
+ expiresAtMs: string;
719
+ format: string;
720
+ quality: number;
721
+ maxWidth: number;
722
+ maxHeight: number;
723
+ everyNthFrame: number;
724
+ }
725
+ export interface BrowserFramesOpenResponse {
726
+ channel: StreamChannel | undefined;
727
+ }
728
+ /**
729
+ * ComputerSession equivalent of BrowserFramesOpen. The relay carries the same
730
+ * canonical binary frame envelope, while the distinct resource id keeps
731
+ * controller authorization and URL routing unambiguous.
732
+ */
733
+ export interface ComputerFramesOpenRequest {
734
+ scopeId: string;
735
+ scopeGeneration: string;
736
+ computerSessionId: string;
737
+ controllerGeneration: string;
738
+ targetId: string;
739
+ viewToken: string;
740
+ expiresAtMs: string;
741
+ format: string;
742
+ quality: number;
743
+ maxWidth: number;
744
+ maxHeight: number;
745
+ everyNthFrame: number;
746
+ }
747
+ export interface ComputerFramesOpenResponse {
748
+ channel: StreamChannel | undefined;
749
+ }
750
+ /**
751
+ * The agent's periodic liveness ping. Carries a metrics sample so the control
752
+ * plane can upsert the machine's last-sample without a separate RPC. The
753
+ * `seq` increments per heartbeat so the control plane can detect a gap.
754
+ */
755
+ export interface Heartbeat {
756
+ seq: string;
757
+ /** Agent monotonic uptime in ms. */
758
+ uptimeMs: string;
759
+ /**
760
+ * The number of sessions currently sharing this machine (lease refcount as the
761
+ * agent sees it; the authoritative count lives in Postgres).
762
+ */
763
+ activeSessions: number;
764
+ metrics: MetricsSample | undefined;
765
+ /**
766
+ * True when the agent is draining for a pending self-update (prefer other
767
+ * sandboxes for new work).
768
+ */
769
+ draining: boolean;
770
+ /**
771
+ * The runner's measured host capacity — the upward report the server paces
772
+ * against (LIMITS-DOCTRINE: the runner holds no concurrency policy; the
773
+ * swarm/scheduler reads this and decides how much to throw at the machine).
774
+ */
775
+ capacity: HostCapacitySample | undefined;
776
+ /**
777
+ * Point-in-time op-admission counts (queues only ever fill once a derived
778
+ * pathology breaker saturates — nonzero queued figures are telemetry-worthy).
779
+ */
780
+ admission: AdmissionTelemetry | undefined;
781
+ /** Full live browser-profile inventory, when this runner has a browser bridge. */
782
+ attachedBrowserInventory: AttachedBrowserInventorySnapshot | undefined;
783
+ }
784
+ /**
785
+ * A point-in-time host-capacity sample: the impure sampler's reading of
786
+ * MemAvailable, spool-filesystem free space, fd/pid headroom, and CPUs. Every
787
+ * runner-side budget/breaker is a fraction of these (rule R), so this is also
788
+ * how the server understands what the machine can take.
789
+ */
790
+ export interface HostCapacitySample {
791
+ memAvailableBytes: string;
792
+ diskFreeBytes: string;
793
+ fdHeadroom: string;
794
+ pidHeadroom: string;
795
+ nproc: string;
796
+ }
797
+ /** Point-in-time op-admission counts, per class. */
798
+ export interface AdmissionTelemetry {
799
+ lightRunning: string;
800
+ lightQueued: string;
801
+ heavyRunning: string;
802
+ heavyQueued: string;
803
+ /**
804
+ * Jobs with a live mailbox (running + completed-retained awaiting final
805
+ * ack) — the op-engine's routing-table size.
806
+ */
807
+ liveOps: string;
808
+ /**
809
+ * Op frames dropped by the fire-and-forget publish path (bulk lane down or
810
+ * its channel full). Protocol-healed by replay; recorded so an undersized
811
+ * lane is visible before it matters (monotonic).
812
+ */
813
+ opFramesDroppedTotal: string;
814
+ /**
815
+ * Completed ops evicted before their final ack (dropped results) — the
816
+ * registry's loud counter (monotonic).
817
+ */
818
+ evictedUnackedTotal: string;
819
+ }
820
+ export interface HeartbeatAck {
821
+ /** The control plane may instruct the agent to adjust its heartbeat cadence. */
822
+ nextIntervalMs: number;
823
+ /** The control plane may signal a pending fleet action (e.g. update available). */
824
+ updateAvailable: boolean;
825
+ }
826
+ /** On-demand metrics request (the dashboard force-poll path). */
827
+ export interface MetricsRequest {
828
+ }
829
+ /** A point-in-time machine metrics sample. */
830
+ export interface MetricsSample {
831
+ /** Unix epoch ms when sampled. */
832
+ sampledAtMs: string;
833
+ /** CPU utilization 0..100 (whole machine). */
834
+ cpuPercent: number;
835
+ /** Load averages. */
836
+ load1: number;
837
+ load5: number;
838
+ load15: number;
839
+ memUsedBytes: string;
840
+ memTotalBytes: string;
841
+ diskUsedBytes: string;
842
+ diskTotalBytes: string;
843
+ /** A contention signal (run-queue length / pressure), if available. */
844
+ runQueue: number;
845
+ /** Per-GPU samples, when GPUs are present. */
846
+ gpus: GpuSample[];
847
+ }
848
+ export interface GpuSample {
849
+ name: string;
850
+ /** Utilization 0..100. */
851
+ utilPercent: number;
852
+ memUsedBytes: string;
853
+ memTotalBytes: string;
854
+ }
855
+ /**
856
+ * A cheap liveness probe — the control plane requests it to test that a
857
+ * responder exists on the subject (the NATS "is there an agent" check).
858
+ */
859
+ export interface PingRequest {
860
+ /** Echoed back so the caller can correlate / measure RTT. */
861
+ nonce: string;
862
+ }
863
+ export interface PingResponse {
864
+ nonce: string;
865
+ /** The agent's monotonic clock, for skew estimation. */
866
+ agentMonotonicMs: string;
867
+ }
868
+ /**
869
+ * Sent by the agent on a clean stop (SIGINT/SIGTERM) so the lease flips to
870
+ * offline IMMEDIATELY rather than waiting on heartbeat dead-detection.
871
+ */
872
+ export interface GoingOffline {
873
+ reason: GoingOfflineReason;
874
+ /** Optional human note (e.g. "user pressed Ctrl-C"). */
875
+ message: string;
876
+ }
877
+ /**
878
+ * On reconnect, the agent presents its resume token; the control plane fences by
879
+ * epoch and either accepts the resume (same machine, new connection generation)
880
+ * or, if the token is unknown/stale, requires a fresh hello.
881
+ */
882
+ export interface ResumeRequest {
883
+ agentId: string;
884
+ resumeToken: string;
885
+ /** The lease epoch the agent last observed, for the integer fence. */
886
+ lastKnownEpoch: number;
887
+ }
888
+ export interface ResumeResponse {
889
+ accepted: boolean;
890
+ /**
891
+ * The new lease epoch the control plane assigned to this connection. Any op
892
+ * fenced by an older epoch must re-resolve and retry.
893
+ */
894
+ epoch: number;
895
+ /** A fresh resume token for the NEXT reconnect (tokens rotate per generation). */
896
+ resumeToken: string;
897
+ }
898
+ /** The agent asks whether a newer build is available for its channel + target. */
899
+ export interface UpdateCheckRequest {
900
+ currentVersion: string;
901
+ channel: string;
902
+ os: Os;
903
+ arch: Arch;
904
+ }
905
+ export interface UpdateCheckResponse {
906
+ updateAvailable: boolean;
907
+ manifest: UpdateManifest | undefined;
908
+ }
909
+ /**
910
+ * A signed channel manifest. It is itself minisign-signed out-of-band; this
911
+ * message is the decoded body the updater reasons over.
912
+ */
913
+ export interface UpdateManifest {
914
+ channel: string;
915
+ version: string;
916
+ /** The minimum version still permitted (downgrade-attack protection). */
917
+ minSupported: string;
918
+ /** Staged-rollout gate: an agent applies when blake3(agentId+salt)%100 < percent. */
919
+ rolloutPercent: number;
920
+ cohortSalt: string;
921
+ artifacts: UpdateArtifact[];
922
+ notesUrl: string;
923
+ signedAtMs: string;
924
+ /** When true, override drain and update mid-session (security CVE path). */
925
+ force: boolean;
926
+ }
927
+ export interface UpdateArtifact {
928
+ /** Target triple, e.g. "x86_64-unknown-linux-musl". */
929
+ target: string;
930
+ url: string;
931
+ size: string;
932
+ sha256: string;
933
+ /** URL of the detached minisign signature for the artifact. */
934
+ minisigUrl: string;
935
+ }
936
+ /**
937
+ * Before applying, the updater asks the control plane whether it may proceed
938
+ * (the control plane reads the Postgres lease refcount). The agent drains until
939
+ * the refcount reaches zero or a grace window elapses.
940
+ */
941
+ export interface UpdateMayProceedRequest {
942
+ agentId: string;
943
+ targetVersion: string;
944
+ }
945
+ export interface UpdateMayProceedResponse {
946
+ mayProceed: boolean;
947
+ /** When false, the number of live sessions blocking the update. */
948
+ activeSessions: number;
949
+ }
950
+ /**
951
+ * The terminal outcome of an op — carried in the Exit frame body AND echoed in
952
+ * OpStatus once complete. Digests/totals are keyed by channel name
953
+ * ("stdout"/"stderr"/"content") for a byte-exact assembly proof.
954
+ */
955
+ export interface OpExit {
956
+ exitCode: number;
957
+ /** Hit the runner-enforced deadline (process-tree killed). */
958
+ timedOut: boolean;
959
+ /** Cancelled via OpCancel. */
960
+ cancelled: boolean;
961
+ durationMs: string;
962
+ /** channel name → blake3 hex digest of the full channel stream. */
963
+ digests: {
964
+ [key: string]: string;
965
+ };
966
+ /** channel name → total bytes emitted on the channel. */
967
+ totals: {
968
+ [key: string]: string;
969
+ };
970
+ /**
971
+ * Set iff the RUNNER failed the op with a typed reason ("OP_OVERFLOW" /
972
+ * "OP_SPOOL_IO" / "OP_PIPE_IO"); empty for every child-decided outcome
973
+ * (exit/timeout/cancel). Never an exit-code sentinel — ambiguous renderings
974
+ * are outlawed (FAILURE-VISIBILITY.md).
975
+ */
976
+ failureCode: string;
977
+ /**
978
+ * Structured detail for failure_code (exact counters: retained bytes, the
979
+ * IO error text, captured byte totals) — the out-of-band plane's food.
980
+ */
981
+ failureDetail: {
982
+ [key: string]: string;
983
+ };
984
+ }
985
+ export interface OpExit_DigestsEntry {
986
+ key: string;
987
+ value: string;
988
+ }
989
+ export interface OpExit_TotalsEntry {
990
+ key: string;
991
+ value: string;
992
+ }
993
+ export interface OpExit_FailureDetailEntry {
994
+ key: string;
995
+ value: string;
996
+ }
997
+ /**
998
+ * The op-begin for a STREAMING fs_write (M7): the target is set up here; the bytes
999
+ * arrive as chunked, idempotent WriteChunk request/replies (no reverse streaming).
1000
+ */
1001
+ export interface FsWriteBegin {
1002
+ path: string;
1003
+ /** Create parent directories as needed. */
1004
+ createParents: boolean;
1005
+ /** POSIX mode for a newly created file (0 => platform default). */
1006
+ mode: number;
1007
+ /**
1008
+ * Editor safety (M6): the expected blake3 hex digest of the file's CURRENT
1009
+ * content for a read-modify-write; empty for a plain write. On a re-dispatch a
1010
+ * mismatch REFUSES rather than double-applying a diff.
1011
+ */
1012
+ expectedBaseDigest: string;
1013
+ }
1014
+ /**
1015
+ * Start an op (server→runner). IDEMPOTENT by op_id (= ControlRequest.request_id):
1016
+ * a known op_id returns its current status and NEVER re-runs — this closes the
1017
+ * at-least-once re-run hazard (a re-dispatched turn re-issues OpStart{same id} and
1018
+ * attaches).
1019
+ */
1020
+ export interface OpStart {
1021
+ op: {
1022
+ $case: "exec";
1023
+ exec: ExecRequest;
1024
+ } | {
1025
+ $case: "fsRead";
1026
+ fsRead: FsReadRequest;
1027
+ } | {
1028
+ $case: "fsWrite";
1029
+ fsWrite: FsWriteBegin;
1030
+ } | undefined;
1031
+ /** Initial send credit in bytes (0 => the runner default, ~4 MiB). */
1032
+ windowBytes: string;
1033
+ /**
1034
+ * Absolute runner-enforced deadline, unix-epoch ms (0 = none). Runner-side
1035
+ * enforcement is authoritative (process-tree kill + Exit{timed_out}); the
1036
+ * server wall-clock is advisory.
1037
+ */
1038
+ deadlineMs: string;
1039
+ /** The originating session id, for per-origin fair admission. */
1040
+ originId: string;
1041
+ }
1042
+ export interface OpStarted {
1043
+ accepted: boolean;
1044
+ status: OpStatus | undefined;
1045
+ }
1046
+ /**
1047
+ * Cancel an op (server→runner). Idempotent; triggers the #344 process-tree kill and
1048
+ * a terminal frame. Reply is OpStatus.
1049
+ */
1050
+ export interface OpCancel {
1051
+ opId: string;
1052
+ }
1053
+ /** Query an op's status (server→runner). Reply is OpStatus. */
1054
+ export interface OpQuery {
1055
+ opId: string;
1056
+ }
1057
+ /**
1058
+ * Re-attach to an op after a reconnect or a missed frame (server→runner): the
1059
+ * runner re-publishes frames ≥ from_seq from its ring/spool, then resumes live
1060
+ * flow. Reply is OpStatus.
1061
+ */
1062
+ export interface OpAttach {
1063
+ opId: string;
1064
+ /** Resume from this exclusive sequence (the consumer's cumulative-ack floor). */
1065
+ fromSeq: string;
1066
+ /**
1067
+ * Attach generation (B2): monotonic (the consumer's Temporal attempt number).
1068
+ * The runner serves replay/credit only for the HIGHEST generation seen; a
1069
+ * lower-generation (zombie) consumer's acks are ignored.
1070
+ */
1071
+ attachGeneration: string;
1072
+ /**
1073
+ * The fresh send-credit window for the resumed attachment, in bytes
1074
+ * (0 => reuse the window granted at OpStart). OpAck's absolute credit_bytes
1075
+ * resizes it thereafter.
1076
+ */
1077
+ windowBytes: string;
1078
+ }
1079
+ /**
1080
+ * The current status of an op (server←runner reply to OpCancel/OpQuery/OpAttach,
1081
+ * and embedded in OpStarted).
1082
+ */
1083
+ export interface OpStatus {
1084
+ opId: string;
1085
+ state: OpState;
1086
+ /**
1087
+ * The next sequence number the runner will assign (the high watermark, for gap
1088
+ * detection).
1089
+ */
1090
+ nextSeq: string;
1091
+ /** Present iff state == OP_STATE_COMPLETE. */
1092
+ exit: OpExit | undefined;
1093
+ /** Present iff state == OP_STATE_LOST. */
1094
+ lostReason: OpLostReason;
1095
+ }
1096
+ /**
1097
+ * One chunk of a streaming upload (server→runner): plain idempotent request/reply
1098
+ * per chunk (≤512 KiB). A duplicate (op_id, seq) is acked WITHOUT re-applying.
1099
+ */
1100
+ export interface WriteChunk {
1101
+ opId: string;
1102
+ /** The op-scoped monotonic chunk sequence. */
1103
+ seq: string;
1104
+ bytes: Uint8Array;
1105
+ /** The final chunk: commit = digest-verify then atomic rename (M7). */
1106
+ last: boolean;
1107
+ /**
1108
+ * Byte offset this chunk writes at (M7: writes land in an op-scoped temp file,
1109
+ * committed on the last chunk — an aborted transfer leaves no visible file).
1110
+ */
1111
+ offset: string;
1112
+ }
1113
+ export interface WriteChunkAck {
1114
+ seq: string;
1115
+ }
1116
+ /**
1117
+ * A runner→server op frame, published fire-and-forget on the op subject
1118
+ * (`agent.<ws>.<id>.op.<op_id>`). `seq` is a SINGLE monotonic sequence per op
1119
+ * across ALL body kinds (Progress frames consume sequence numbers too, so gap
1120
+ * detection is uniform).
1121
+ */
1122
+ export interface OpFrame {
1123
+ opId: string;
1124
+ seq: string;
1125
+ body: {
1126
+ $case: "data";
1127
+ data: OpData;
1128
+ } | {
1129
+ $case: "progress";
1130
+ progress: OpProgress;
1131
+ } | {
1132
+ $case: "exit";
1133
+ exit: OpExit;
1134
+ } | undefined;
1135
+ }
1136
+ /** A chunk of op output on a channel (≤128 KiB per frame). */
1137
+ export interface OpData {
1138
+ channel: OpChannel;
1139
+ bytes: Uint8Array;
1140
+ }
1141
+ /**
1142
+ * A liveness tick: the op is alive but produced no Data. Emitted every 5s while an
1143
+ * op is live and quiet; consumes a sequence number like any frame.
1144
+ */
1145
+ export interface OpProgress {
1146
+ }
1147
+ /**
1148
+ * A server→runner cumulative ack + credit replenishment, published fire-and-forget
1149
+ * on the ack subject (`agent.<ws>.<id>.ack`). Best-effort, healed by repetition.
1150
+ */
1151
+ export interface OpAck {
1152
+ opId: string;
1153
+ /** Cumulative: every frame with seq ≤ acked_seq is acknowledged. */
1154
+ ackedSeq: string;
1155
+ /** The replenished ABSOLUTE send-credit window in bytes. */
1156
+ creditBytes: string;
1157
+ /** The server has fully consumed the terminal frame → the runner may GC the op. */
1158
+ final: boolean;
1159
+ /**
1160
+ * The consumer's attach generation (matches OpAttach.attach_generation; the
1161
+ * consumer's Temporal attempt number). The runner honors this ack — its floor
1162
+ * advance AND its credit grant — ONLY for the HIGHEST generation it has seen for
1163
+ * the op; a lower-generation (zombie) ack is ignored. This must ride the wire
1164
+ * (not be inferred from monotonic acked_seq alone) because credit_bytes is an
1165
+ * ABSOLUTE window REPLACEMENT: a stale consumer's ack could otherwise shrink the
1166
+ * live consumer's window (stall) or grant unintended credit (B2).
1167
+ */
1168
+ attachGeneration: string;
1169
+ }
1170
+ /**
1171
+ * Wraps an op-specific request. `request_id` correlates a response to a request
1172
+ * even over fan-out; `epoch` carries the lease/active epoch the control plane
1173
+ * resolved this op against, so the agent can reject a stale op (ERROR_CODE_FENCED).
1174
+ */
1175
+ export interface ControlRequest {
1176
+ requestId: string;
1177
+ epoch: number;
1178
+ op: {
1179
+ $case: "ping";
1180
+ ping: PingRequest;
1181
+ } | {
1182
+ $case: "hello";
1183
+ hello: Hello;
1184
+ } | {
1185
+ $case: "resume";
1186
+ resume: ResumeRequest;
1187
+ } | {
1188
+ $case: "exec";
1189
+ exec: ExecRequest;
1190
+ } | {
1191
+ $case: "fsRead";
1192
+ fsRead: FsReadRequest;
1193
+ } | {
1194
+ $case: "fsWrite";
1195
+ fsWrite: FsWriteRequest;
1196
+ } | {
1197
+ $case: "fsList";
1198
+ fsList: FsListRequest;
1199
+ } | {
1200
+ $case: "fsMkdir";
1201
+ fsMkdir: FsMkdirRequest;
1202
+ } | {
1203
+ $case: "fsMove";
1204
+ fsMove: FsMoveRequest;
1205
+ } | {
1206
+ $case: "fsStat";
1207
+ fsStat: FsStatRequest;
1208
+ } | {
1209
+ $case: "fsRemove";
1210
+ fsRemove: FsRemoveRequest;
1211
+ } | {
1212
+ $case: "git";
1213
+ git: GitRequest;
1214
+ } | {
1215
+ $case: "ptyOpen";
1216
+ ptyOpen: PtyOpenRequest;
1217
+ } | {
1218
+ $case: "ptyWrite";
1219
+ ptyWrite: PtyWriteRequest;
1220
+ } | {
1221
+ $case: "ptyResize";
1222
+ ptyResize: PtyResizeRequest;
1223
+ } | {
1224
+ $case: "ptyClose";
1225
+ ptyClose: PtyCloseRequest;
1226
+ } | {
1227
+ $case: "desktopEnsure";
1228
+ desktopEnsure: DesktopEnsureRequest;
1229
+ } | {
1230
+ $case: "metrics";
1231
+ metrics: MetricsRequest;
1232
+ } | {
1233
+ $case: "updateMayProceed";
1234
+ updateMayProceed: UpdateMayProceedRequest;
1235
+ } | {
1236
+ $case: "desktopInput";
1237
+ desktopInput: DesktopInputRequest;
1238
+ } | {
1239
+ $case: "desktopScreenshot";
1240
+ desktopScreenshot: DesktopScreenshotRequest;
1241
+ } | //
1242
+ /**
1243
+ * Op-stream (v1.1), additive. All ride the same rpc subject; each has an
1244
+ * idempotent, typed reply in ControlResponse.result below.
1245
+ */
1246
+ {
1247
+ $case: "opStart";
1248
+ opStart: OpStart;
1249
+ } | {
1250
+ $case: "opCancel";
1251
+ opCancel: OpCancel;
1252
+ } | {
1253
+ $case: "opQuery";
1254
+ opQuery: OpQuery;
1255
+ } | {
1256
+ $case: "opAttach";
1257
+ opAttach: OpAttach;
1258
+ } | {
1259
+ $case: "writeChunk";
1260
+ writeChunk: WriteChunk;
1261
+ } | {
1262
+ $case: "browserControlEnsure";
1263
+ browserControlEnsure: BrowserControlEnsureRequest;
1264
+ } | {
1265
+ $case: "browserFramesOpen";
1266
+ browserFramesOpen: BrowserFramesOpenRequest;
1267
+ } | {
1268
+ $case: "computerFramesOpen";
1269
+ computerFramesOpen: ComputerFramesOpenRequest;
1270
+ } | undefined;
1271
+ }
1272
+ /** Wraps an op-specific response, or an error. `request_id` echoes the request. */
1273
+ export interface ControlResponse {
1274
+ requestId: string;
1275
+ /** Present when the op failed; when set, `result` is empty. */
1276
+ error: AgentError | undefined;
1277
+ result: {
1278
+ $case: "ping";
1279
+ ping: PingResponse;
1280
+ } | {
1281
+ $case: "hello";
1282
+ hello: HelloAck;
1283
+ } | {
1284
+ $case: "resume";
1285
+ resume: ResumeResponse;
1286
+ } | {
1287
+ $case: "exec";
1288
+ exec: ExecResponse;
1289
+ } | {
1290
+ $case: "fsRead";
1291
+ fsRead: FsReadResponse;
1292
+ } | {
1293
+ $case: "fsWrite";
1294
+ fsWrite: FsWriteResponse;
1295
+ } | {
1296
+ $case: "fsList";
1297
+ fsList: FsListResponse;
1298
+ } | {
1299
+ $case: "fsMkdir";
1300
+ fsMkdir: FsMkdirResponse;
1301
+ } | {
1302
+ $case: "fsMove";
1303
+ fsMove: FsMoveResponse;
1304
+ } | {
1305
+ $case: "fsStat";
1306
+ fsStat: FsStatResponse;
1307
+ } | {
1308
+ $case: "fsRemove";
1309
+ fsRemove: FsRemoveResponse;
1310
+ } | {
1311
+ $case: "git";
1312
+ git: GitResponse;
1313
+ } | {
1314
+ $case: "ptyOpen";
1315
+ ptyOpen: PtyOpenResponse;
1316
+ } | {
1317
+ $case: "ptyWrite";
1318
+ ptyWrite: PtyWriteResponse;
1319
+ } | {
1320
+ $case: "ptyResize";
1321
+ ptyResize: PtyResizeResponse;
1322
+ } | {
1323
+ $case: "ptyClose";
1324
+ ptyClose: PtyCloseResponse;
1325
+ } | {
1326
+ $case: "desktopEnsure";
1327
+ desktopEnsure: DesktopEnsureResponse;
1328
+ } | {
1329
+ $case: "metrics";
1330
+ metrics: MetricsSample;
1331
+ } | {
1332
+ $case: "updateMayProceed";
1333
+ updateMayProceed: UpdateMayProceedResponse;
1334
+ } | {
1335
+ $case: "desktopInput";
1336
+ desktopInput: DesktopInputResponse;
1337
+ } | {
1338
+ $case: "desktopScreenshot";
1339
+ desktopScreenshot: DesktopScreenshotResponse;
1340
+ } | //
1341
+ /**
1342
+ * Op-stream (v1.1) replies, additive. OpStart → OpStarted; OpCancel / OpQuery /
1343
+ * OpAttach all reply OpStatus (op_status); WriteChunk → WriteChunkAck.
1344
+ */
1345
+ {
1346
+ $case: "opStart";
1347
+ opStart: OpStarted;
1348
+ } | {
1349
+ $case: "opStatus";
1350
+ opStatus: OpStatus;
1351
+ } | {
1352
+ $case: "writeChunk";
1353
+ writeChunk: WriteChunkAck;
1354
+ } | {
1355
+ $case: "browserControlEnsure";
1356
+ browserControlEnsure: BrowserControlEnsureResponse;
1357
+ } | {
1358
+ $case: "browserFramesOpen";
1359
+ browserFramesOpen: BrowserFramesOpenResponse;
1360
+ } | {
1361
+ $case: "computerFramesOpen";
1362
+ computerFramesOpen: ComputerFramesOpenResponse;
1363
+ } | undefined;
1364
+ }
1365
+ /**
1366
+ * The control plane's acknowledgement of a Hello, carrying the epoch it assigned
1367
+ * and a resume token for the next reconnect.
1368
+ */
1369
+ export interface HelloAck {
1370
+ epoch: number;
1371
+ resumeToken: string;
1372
+ /** The heartbeat interval the agent should use. */
1373
+ heartbeatIntervalMs: number;
1374
+ }
1375
+ /**
1376
+ * Wraps a message the AGENT originates (not a reply to a ControlRequest):
1377
+ * heartbeats, the clean going-offline signal. These are published on the agent's
1378
+ * outbound subject; the control plane folds them into lease/metrics state.
1379
+ */
1380
+ export interface AgentEvent {
1381
+ agentId: string;
1382
+ event: {
1383
+ $case: "heartbeat";
1384
+ heartbeat: Heartbeat;
1385
+ } | {
1386
+ $case: "goingOffline";
1387
+ goingOffline: GoingOffline;
1388
+ } | undefined;
1389
+ }
1390
+ /** The control plane's ack of an AgentEvent (e.g. a HeartbeatAck). */
1391
+ export interface AgentEventAck {
1392
+ ack: {
1393
+ $case: "heartbeat";
1394
+ heartbeat: HeartbeatAck;
1395
+ } | undefined;
1396
+ }
1397
+ /**
1398
+ * Identifies a relay stream channel. The viewer/pty client connects to the
1399
+ * relay with this channel's coordinates plus a scoped `ogs_` token; the agent
1400
+ * dials out and registers the same channel. `{workspace_id, agent_id, port}`
1401
+ * is the routing key.
1402
+ */
1403
+ export interface StreamChannel {
1404
+ channelId: string;
1405
+ workspaceId: string;
1406
+ agentId: string;
1407
+ kind: StreamKind;
1408
+ /** The logical port the channel maps to (so resolveExposedPort can address it). */
1409
+ port: number;
1410
+ }
1411
+ /**
1412
+ * Open a stream channel on the relay. Sent by both ends (agent registers; client
1413
+ * attaches) as the first frame of a relay connection.
1414
+ */
1415
+ export interface StreamOpen {
1416
+ channel: StreamChannel | undefined;
1417
+ /**
1418
+ * The scoped stream token (`ogs_` envelope) authorizing this channel; the
1419
+ * relay validates authenticity + the lease/active-epoch fence.
1420
+ */
1421
+ token: string;
1422
+ /** Whether the sender is the producing agent or the consuming viewer. */
1423
+ role: StreamRole;
1424
+ /**
1425
+ * For resume: the last frame sequence the sender successfully processed, so
1426
+ * the peer can replay from there after a reconnect blip.
1427
+ */
1428
+ resumeFromSeq: string;
1429
+ }
1430
+ /** The relay's acknowledgement of a StreamOpen. */
1431
+ export interface StreamOpenAck {
1432
+ accepted: boolean;
1433
+ error: AgentError | undefined;
1434
+ /** The sequence the peer will resume sending from. */
1435
+ resumeFromSeq: string;
1436
+ }
1437
+ /**
1438
+ * A data frame carrying raw stream bytes in either direction. `seq` is a
1439
+ * monotonic per-channel-per-direction counter enabling resume-from-seq. For a
1440
+ * DESKTOP channel `data` is an encoded framebuffer chunk; for PTY it is raw tty
1441
+ * bytes. Input (client→agent) for desktop computer-use rides DesktopInput
1442
+ * instead so synthetic events are typed, not opaque bytes.
1443
+ */
1444
+ export interface StreamFrame {
1445
+ channelId: string;
1446
+ seq: string;
1447
+ data: Uint8Array;
1448
+ /** Unix epoch ms the frame was produced (for latency/lag metrics). */
1449
+ producedAtMs: string;
1450
+ }
1451
+ /**
1452
+ * Close a stream channel. Either end may send it; the relay tears down the
1453
+ * channel and notifies the peer.
1454
+ */
1455
+ export interface StreamClose {
1456
+ channelId: string;
1457
+ reason: StreamCloseReason;
1458
+ message: string;
1459
+ }
1460
+ /**
1461
+ * Typed computer-use input from a client to a desktop channel (client→agent).
1462
+ * Synthetic input is gated on consented_screen_control; an ungated input op
1463
+ * fails with ERROR_CODE_CONSENT_REQUIRED.
1464
+ */
1465
+ export interface DesktopInput {
1466
+ channelId: string;
1467
+ event: {
1468
+ $case: "pointer";
1469
+ pointer: PointerEvent;
1470
+ } | {
1471
+ $case: "key";
1472
+ key: KeyEvent;
1473
+ } | {
1474
+ $case: "scroll";
1475
+ scroll: ScrollEvent;
1476
+ } | undefined;
1477
+ }
1478
+ export interface PointerEvent {
1479
+ x: number;
1480
+ y: number;
1481
+ action: PointerAction;
1482
+ button: PointerButton;
1483
+ }
1484
+ export interface KeyEvent {
1485
+ /** A platform-independent key name (e.g. "Enter", "a", "ctrl+c") OR text to type. */
1486
+ key: string;
1487
+ isText: boolean;
1488
+ action: KeyAction;
1489
+ }
1490
+ export interface ScrollEvent {
1491
+ x: number;
1492
+ y: number;
1493
+ deltaX: number;
1494
+ deltaY: number;
1495
+ }
1496
+ export declare const AgentError: MessageFns<AgentError>;
1497
+ export declare const AgentError_DetailEntry: MessageFns<AgentError_DetailEntry>;
1498
+ export declare const Hello: MessageFns<Hello>;
1499
+ export declare const Capabilities: MessageFns<Capabilities>;
1500
+ export declare const AttachedBrowserDeviceCapabilities: MessageFns<AttachedBrowserDeviceCapabilities>;
1501
+ export declare const AttachedBrowserDeviceAnnouncement: MessageFns<AttachedBrowserDeviceAnnouncement>;
1502
+ export declare const AttachedBrowserInventorySnapshot: MessageFns<AttachedBrowserInventorySnapshot>;
1503
+ export declare const Display: MessageFns<Display>;
1504
+ export declare const DeviceAuthStartRequest: MessageFns<DeviceAuthStartRequest>;
1505
+ export declare const DeviceAuthStartResponse: MessageFns<DeviceAuthStartResponse>;
1506
+ export declare const DeviceAuthPollRequest: MessageFns<DeviceAuthPollRequest>;
1507
+ export declare const DeviceAuthPollResponse: MessageFns<DeviceAuthPollResponse>;
1508
+ export declare const EnrollmentCredentials: MessageFns<EnrollmentCredentials>;
1509
+ export declare const ExecRequest: MessageFns<ExecRequest>;
1510
+ export declare const ExecRequest_EnvEntry: MessageFns<ExecRequest_EnvEntry>;
1511
+ export declare const ExecResponse: MessageFns<ExecResponse>;
1512
+ export declare const FsReadRequest: MessageFns<FsReadRequest>;
1513
+ export declare const FsReadResponse: MessageFns<FsReadResponse>;
1514
+ export declare const FsWriteRequest: MessageFns<FsWriteRequest>;
1515
+ export declare const FsWriteResponse: MessageFns<FsWriteResponse>;
1516
+ export declare const FsListRequest: MessageFns<FsListRequest>;
1517
+ export declare const FsListResponse: MessageFns<FsListResponse>;
1518
+ export declare const FsEntry: MessageFns<FsEntry>;
1519
+ export declare const FsMkdirRequest: MessageFns<FsMkdirRequest>;
1520
+ export declare const FsMkdirResponse: MessageFns<FsMkdirResponse>;
1521
+ export declare const FsMoveRequest: MessageFns<FsMoveRequest>;
1522
+ export declare const FsMoveResponse: MessageFns<FsMoveResponse>;
1523
+ export declare const FsStatRequest: MessageFns<FsStatRequest>;
1524
+ export declare const FsStatResponse: MessageFns<FsStatResponse>;
1525
+ export declare const FsRemoveRequest: MessageFns<FsRemoveRequest>;
1526
+ export declare const FsRemoveResponse: MessageFns<FsRemoveResponse>;
1527
+ export declare const GitRequest: MessageFns<GitRequest>;
1528
+ export declare const GitResponse: MessageFns<GitResponse>;
1529
+ export declare const GitStatus: MessageFns<GitStatus>;
1530
+ export declare const GitFileStatus: MessageFns<GitFileStatus>;
1531
+ export declare const PtyOpenRequest: MessageFns<PtyOpenRequest>;
1532
+ export declare const PtyOpenRequest_EnvEntry: MessageFns<PtyOpenRequest_EnvEntry>;
1533
+ export declare const PtyOpenResponse: MessageFns<PtyOpenResponse>;
1534
+ export declare const PtyWriteRequest: MessageFns<PtyWriteRequest>;
1535
+ export declare const PtyWriteResponse: MessageFns<PtyWriteResponse>;
1536
+ export declare const PtyResizeRequest: MessageFns<PtyResizeRequest>;
1537
+ export declare const PtyResizeResponse: MessageFns<PtyResizeResponse>;
1538
+ export declare const PtyCloseRequest: MessageFns<PtyCloseRequest>;
1539
+ export declare const PtyCloseResponse: MessageFns<PtyCloseResponse>;
1540
+ export declare const DesktopEnsureRequest: MessageFns<DesktopEnsureRequest>;
1541
+ export declare const DesktopEnsureResponse: MessageFns<DesktopEnsureResponse>;
1542
+ export declare const DesktopInputRequest: MessageFns<DesktopInputRequest>;
1543
+ export declare const DesktopInputResponse: MessageFns<DesktopInputResponse>;
1544
+ export declare const DesktopScreenshotRequest: MessageFns<DesktopScreenshotRequest>;
1545
+ export declare const DesktopScreenshotResponse: MessageFns<DesktopScreenshotResponse>;
1546
+ export declare const BrowserControlEnsureRequest: MessageFns<BrowserControlEnsureRequest>;
1547
+ export declare const BrowserControlEnsureResponse: MessageFns<BrowserControlEnsureResponse>;
1548
+ export declare const BrowserFramesOpenRequest: MessageFns<BrowserFramesOpenRequest>;
1549
+ export declare const BrowserFramesOpenResponse: MessageFns<BrowserFramesOpenResponse>;
1550
+ export declare const ComputerFramesOpenRequest: MessageFns<ComputerFramesOpenRequest>;
1551
+ export declare const ComputerFramesOpenResponse: MessageFns<ComputerFramesOpenResponse>;
1552
+ export declare const Heartbeat: MessageFns<Heartbeat>;
1553
+ export declare const HostCapacitySample: MessageFns<HostCapacitySample>;
1554
+ export declare const AdmissionTelemetry: MessageFns<AdmissionTelemetry>;
1555
+ export declare const HeartbeatAck: MessageFns<HeartbeatAck>;
1556
+ export declare const MetricsRequest: MessageFns<MetricsRequest>;
1557
+ export declare const MetricsSample: MessageFns<MetricsSample>;
1558
+ export declare const GpuSample: MessageFns<GpuSample>;
1559
+ export declare const PingRequest: MessageFns<PingRequest>;
1560
+ export declare const PingResponse: MessageFns<PingResponse>;
1561
+ export declare const GoingOffline: MessageFns<GoingOffline>;
1562
+ export declare const ResumeRequest: MessageFns<ResumeRequest>;
1563
+ export declare const ResumeResponse: MessageFns<ResumeResponse>;
1564
+ export declare const UpdateCheckRequest: MessageFns<UpdateCheckRequest>;
1565
+ export declare const UpdateCheckResponse: MessageFns<UpdateCheckResponse>;
1566
+ export declare const UpdateManifest: MessageFns<UpdateManifest>;
1567
+ export declare const UpdateArtifact: MessageFns<UpdateArtifact>;
1568
+ export declare const UpdateMayProceedRequest: MessageFns<UpdateMayProceedRequest>;
1569
+ export declare const UpdateMayProceedResponse: MessageFns<UpdateMayProceedResponse>;
1570
+ export declare const OpExit: MessageFns<OpExit>;
1571
+ export declare const OpExit_DigestsEntry: MessageFns<OpExit_DigestsEntry>;
1572
+ export declare const OpExit_TotalsEntry: MessageFns<OpExit_TotalsEntry>;
1573
+ export declare const OpExit_FailureDetailEntry: MessageFns<OpExit_FailureDetailEntry>;
1574
+ export declare const FsWriteBegin: MessageFns<FsWriteBegin>;
1575
+ export declare const OpStart: MessageFns<OpStart>;
1576
+ export declare const OpStarted: MessageFns<OpStarted>;
1577
+ export declare const OpCancel: MessageFns<OpCancel>;
1578
+ export declare const OpQuery: MessageFns<OpQuery>;
1579
+ export declare const OpAttach: MessageFns<OpAttach>;
1580
+ export declare const OpStatus: MessageFns<OpStatus>;
1581
+ export declare const WriteChunk: MessageFns<WriteChunk>;
1582
+ export declare const WriteChunkAck: MessageFns<WriteChunkAck>;
1583
+ export declare const OpFrame: MessageFns<OpFrame>;
1584
+ export declare const OpData: MessageFns<OpData>;
1585
+ export declare const OpProgress: MessageFns<OpProgress>;
1586
+ export declare const OpAck: MessageFns<OpAck>;
1587
+ export declare const ControlRequest: MessageFns<ControlRequest>;
1588
+ export declare const ControlResponse: MessageFns<ControlResponse>;
1589
+ export declare const HelloAck: MessageFns<HelloAck>;
1590
+ export declare const AgentEvent: MessageFns<AgentEvent>;
1591
+ export declare const AgentEventAck: MessageFns<AgentEventAck>;
1592
+ export declare const StreamChannel: MessageFns<StreamChannel>;
1593
+ export declare const StreamOpen: MessageFns<StreamOpen>;
1594
+ export declare const StreamOpenAck: MessageFns<StreamOpenAck>;
1595
+ export declare const StreamFrame: MessageFns<StreamFrame>;
1596
+ export declare const StreamClose: MessageFns<StreamClose>;
1597
+ export declare const DesktopInput: MessageFns<DesktopInput>;
1598
+ export declare const PointerEvent: MessageFns<PointerEvent>;
1599
+ export declare const KeyEvent: MessageFns<KeyEvent>;
1600
+ export declare const ScrollEvent: MessageFns<ScrollEvent>;
1601
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1602
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
1603
+ $case: string;
1604
+ } ? {
1605
+ [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
1606
+ } & {
1607
+ $case: T["$case"];
1608
+ } : T extends {} ? {
1609
+ [K in keyof T]?: DeepPartial<T[K]>;
1610
+ } : Partial<T>;
1611
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
1612
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
1613
+ [K in keyof P]: Exact<P[K], I[K]>;
1614
+ } & {
1615
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
1616
+ };
1617
+ export interface MessageFns<T> {
1618
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
1619
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
1620
+ fromJSON(object: any): T;
1621
+ toJSON(message: T): unknown;
1622
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
1623
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
1624
+ }
1625
+ export {};