@ai-matrx/desktop-protocol 0.1.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,2330 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod-free type twins of the wire error shapes, for the zod-free entries (`./frame`, error.ts).
5
+ * schema/errors.ts asserts at compile time that these equal the zod-inferred types, so they can
6
+ * never drift (see the `_assert*` lines there).
7
+ */
8
+ type ErrorCodeName = "AUTH_REQUIRED" | "AUTH_INVALID" | "AUTH_EXPIRED" | "AUTH_FORBIDDEN" | "AUTH_DEVICE_REVOKED" | "PERMISSION_DENIED_OS" | "NOT_FOUND" | "CONFLICT" | "INVALID_PARAMS" | "RESOURCE_BUSY" | "RESOURCE_GONE" | "CANCELLED" | "TIMEOUT" | "PLATFORM_UNSUPPORTED" | "RATE_LIMITED" | "INTERNAL" | "PROTOCOL_VERSION_UNSUPPORTED" | "PROTOCOL_ERROR" | "UNKNOWN_OPERATION" | "DEVICE_OFFLINE" | "PAYLOAD_TOO_LARGE";
9
+ type ErrorReasonName = "not_a_directory" | "is_a_directory" | "directory_not_empty" | "already_exists" | "stale_write" | "binary_content" | "not_utf8_boundary" | "patch_no_match" | "patch_ambiguous" | "resource_exited" | "resource_expired" | "control_taken" | "window_exhausted";
10
+ interface ErrorData {
11
+ reason?: ErrorReasonName | undefined;
12
+ cap?: string | undefined;
13
+ op?: string | undefined;
14
+ path?: string | undefined;
15
+ settings_url?: string | undefined;
16
+ retry_after_ms?: number | undefined;
17
+ limit_bytes?: number | undefined;
18
+ upgrade?: {
19
+ min_version: string;
20
+ max_version: string;
21
+ download_url?: string | undefined;
22
+ } | undefined;
23
+ }
24
+
25
+ /**
26
+ * The one error type every package entry throws. It carries the wire ErrorCode (SPEC §5), so a
27
+ * caller branches on `code`/`retryable`/`data.reason` and never parses a message. Zod-free on
28
+ * purpose: `./frame` (the relay hot path) throws it without pulling the schema graph.
29
+ */
30
+
31
+ declare class DesktopProtocolError extends Error {
32
+ readonly code: ErrorCodeName;
33
+ readonly retryable: boolean;
34
+ readonly data: ErrorData | undefined;
35
+ constructor(code: ErrorCodeName, message: string, options?: {
36
+ retryable?: boolean;
37
+ data?: ErrorData;
38
+ cause?: unknown;
39
+ });
40
+ /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
41
+ toBody(): {
42
+ code: ErrorCodeName;
43
+ message: string;
44
+ retryable: boolean;
45
+ data?: ErrorData;
46
+ };
47
+ }
48
+ declare function isDesktopProtocolError(value: unknown): value is DesktopProtocolError;
49
+
50
+ /** @ai-matrx/desktop-protocol — the JSON envelope (SPEC §4). Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
51
+
52
+ /**
53
+ * Heartbeat. Sent as these EXACT bytes; the relay answers via the Durable Object
54
+ * setWebSocketAutoResponse pair, so a heartbeat never wakes a hibernated object.
55
+ * Interval 25 s (device and clients); 2 missed pongs = reconnect.
56
+ */
57
+ declare const PING_TEXT: "{\"type\":\"ping\"}";
58
+ declare const PONG_TEXT: "{\"type\":\"pong\"}";
59
+ declare const CloseCode: {
60
+ readonly NORMAL: 1000;
61
+ readonly GOING_AWAY: 1001;
62
+ readonly AUTH_INVALID: 4001;
63
+ readonly AUTH_FORBIDDEN: 4003;
64
+ readonly DEVICE_NOT_FOUND: 4004;
65
+ readonly AUTH_EXPIRED: 4008;
66
+ readonly REPLACED: 4009;
67
+ readonly DEVICE_REVOKED: 4010;
68
+ readonly PROTOCOL_ERROR: 4400;
69
+ readonly UPGRADE_REQUIRED: 4426;
70
+ };
71
+ declare const ClientType: z.ZodEnum<{
72
+ screen: "screen";
73
+ web: "web";
74
+ extension: "extension";
75
+ server: "server";
76
+ test: "test";
77
+ }>;
78
+ type ClientType = z.output<typeof ClientType>;
79
+ declare const Limits: z.ZodObject<{
80
+ max_message_bytes: z.ZodInt;
81
+ max_frame_payload_bytes: z.ZodInt;
82
+ default_window_bytes: z.ZodInt;
83
+ max_streams_per_client: z.ZodInt;
84
+ max_resources_per_user: z.ZodInt;
85
+ }, z.core.$strict>;
86
+ type Limits = z.output<typeof Limits>;
87
+ declare const OpDescriptor: z.ZodObject<{
88
+ cap: z.ZodString;
89
+ op: z.ZodString;
90
+ since: z.ZodString;
91
+ }, z.core.$strict>;
92
+ type OpDescriptor = z.output<typeof OpDescriptor>;
93
+ declare const Welcome: z.ZodObject<{
94
+ protocol_version: z.ZodString;
95
+ session_id: z.ZodString;
96
+ client_id: z.ZodString;
97
+ device_id: z.ZodString;
98
+ device_name: z.ZodString;
99
+ app_version: z.ZodString;
100
+ platform: z.ZodEnum<{
101
+ darwin: "darwin";
102
+ win32: "win32";
103
+ linux: "linux";
104
+ }>;
105
+ ops: z.ZodArray<z.ZodObject<{
106
+ cap: z.ZodString;
107
+ op: z.ZodString;
108
+ since: z.ZodString;
109
+ }, z.core.$strict>>;
110
+ limits: z.ZodObject<{
111
+ max_message_bytes: z.ZodInt;
112
+ max_frame_payload_bytes: z.ZodInt;
113
+ default_window_bytes: z.ZodInt;
114
+ max_streams_per_client: z.ZodInt;
115
+ max_resources_per_user: z.ZodInt;
116
+ }, z.core.$strict>;
117
+ server_time_ms: z.ZodInt;
118
+ }, z.core.$strict>;
119
+ type Welcome = z.output<typeof Welcome>;
120
+ declare const HelloMsg: z.ZodObject<{
121
+ type: z.ZodLiteral<"hello">;
122
+ id: z.ZodString;
123
+ protocolVersion: z.ZodString;
124
+ clientType: z.ZodEnum<{
125
+ screen: "screen";
126
+ web: "web";
127
+ extension: "extension";
128
+ server: "server";
129
+ test: "test";
130
+ }>;
131
+ clientVersion: z.ZodString;
132
+ }, z.core.$strict>;
133
+ type HelloMsg = z.output<typeof HelloMsg>;
134
+ declare const RequestMsg: z.ZodObject<{
135
+ id: z.ZodString;
136
+ type: z.ZodLiteral<"request">;
137
+ cap: z.ZodString;
138
+ op: z.ZodString;
139
+ params: z.ZodUnknown;
140
+ }, z.core.$strict>;
141
+ type RequestMsg = z.output<typeof RequestMsg>;
142
+ declare const ResponseMsg: z.ZodObject<{
143
+ id: z.ZodString;
144
+ type: z.ZodLiteral<"response">;
145
+ result: z.ZodUnknown;
146
+ }, z.core.$strict>;
147
+ type ResponseMsg = z.output<typeof ResponseMsg>;
148
+ declare const ErrorMsg: z.ZodObject<{
149
+ id: z.ZodString;
150
+ type: z.ZodLiteral<"error">;
151
+ error: z.ZodObject<{
152
+ code: z.ZodEnum<{
153
+ AUTH_REQUIRED: "AUTH_REQUIRED";
154
+ AUTH_INVALID: "AUTH_INVALID";
155
+ AUTH_EXPIRED: "AUTH_EXPIRED";
156
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
157
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
158
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
159
+ NOT_FOUND: "NOT_FOUND";
160
+ CONFLICT: "CONFLICT";
161
+ INVALID_PARAMS: "INVALID_PARAMS";
162
+ RESOURCE_BUSY: "RESOURCE_BUSY";
163
+ RESOURCE_GONE: "RESOURCE_GONE";
164
+ CANCELLED: "CANCELLED";
165
+ TIMEOUT: "TIMEOUT";
166
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
167
+ RATE_LIMITED: "RATE_LIMITED";
168
+ INTERNAL: "INTERNAL";
169
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
170
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
171
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
172
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
173
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
174
+ }>;
175
+ message: z.ZodString;
176
+ retryable: z.ZodBoolean;
177
+ data: z.ZodOptional<z.ZodObject<{
178
+ reason: z.ZodOptional<z.ZodEnum<{
179
+ not_a_directory: "not_a_directory";
180
+ is_a_directory: "is_a_directory";
181
+ directory_not_empty: "directory_not_empty";
182
+ already_exists: "already_exists";
183
+ stale_write: "stale_write";
184
+ binary_content: "binary_content";
185
+ not_utf8_boundary: "not_utf8_boundary";
186
+ patch_no_match: "patch_no_match";
187
+ patch_ambiguous: "patch_ambiguous";
188
+ resource_exited: "resource_exited";
189
+ resource_expired: "resource_expired";
190
+ control_taken: "control_taken";
191
+ window_exhausted: "window_exhausted";
192
+ }>>;
193
+ cap: z.ZodOptional<z.ZodString>;
194
+ op: z.ZodOptional<z.ZodString>;
195
+ path: z.ZodOptional<z.ZodString>;
196
+ settings_url: z.ZodOptional<z.ZodString>;
197
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
198
+ limit_bytes: z.ZodOptional<z.ZodInt>;
199
+ upgrade: z.ZodOptional<z.ZodObject<{
200
+ min_version: z.ZodString;
201
+ max_version: z.ZodString;
202
+ download_url: z.ZodOptional<z.ZodURL>;
203
+ }, z.core.$strict>>;
204
+ }, z.core.$strict>>;
205
+ }, z.core.$strict>;
206
+ }, z.core.$strict>;
207
+ type ErrorMsg = z.output<typeof ErrorMsg>;
208
+ declare const StreamMeta: z.ZodDiscriminatedUnion<[z.ZodObject<{
209
+ kind: z.ZodLiteral<"open">;
210
+ sid: z.ZodInt;
211
+ window_bytes: z.ZodInt;
212
+ resource_id: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strict>, z.ZodObject<{
214
+ kind: z.ZodLiteral<"snapshot">;
215
+ cols: z.ZodInt;
216
+ rows: z.ZodInt;
217
+ }, z.core.$strict>, z.ZodObject<{
218
+ kind: z.ZodLiteral<"gap">;
219
+ from_seq: z.ZodInt;
220
+ to_seq: z.ZodInt;
221
+ }, z.core.$strict>], "kind">;
222
+ type StreamMeta = z.output<typeof StreamMeta>;
223
+ declare const StreamMsg: z.ZodObject<{
224
+ id: z.ZodString;
225
+ type: z.ZodLiteral<"stream">;
226
+ seq: z.ZodInt;
227
+ meta: z.ZodDiscriminatedUnion<[z.ZodObject<{
228
+ kind: z.ZodLiteral<"open">;
229
+ sid: z.ZodInt;
230
+ window_bytes: z.ZodInt;
231
+ resource_id: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strict>, z.ZodObject<{
233
+ kind: z.ZodLiteral<"snapshot">;
234
+ cols: z.ZodInt;
235
+ rows: z.ZodInt;
236
+ }, z.core.$strict>, z.ZodObject<{
237
+ kind: z.ZodLiteral<"gap">;
238
+ from_seq: z.ZodInt;
239
+ to_seq: z.ZodInt;
240
+ }, z.core.$strict>], "kind">;
241
+ }, z.core.$strict>;
242
+ type StreamMsg = z.output<typeof StreamMsg>;
243
+ declare const EndReason: z.ZodEnum<{
244
+ error: "error";
245
+ resource_exited: "resource_exited";
246
+ completed: "completed";
247
+ cancelled: "cancelled";
248
+ detached: "detached";
249
+ }>;
250
+ type EndReason = z.output<typeof EndReason>;
251
+ declare const EndMsg: z.ZodObject<{
252
+ id: z.ZodString;
253
+ type: z.ZodLiteral<"end">;
254
+ seq: z.ZodInt;
255
+ reason: z.ZodOptional<z.ZodEnum<{
256
+ error: "error";
257
+ resource_exited: "resource_exited";
258
+ completed: "completed";
259
+ cancelled: "cancelled";
260
+ detached: "detached";
261
+ }>>;
262
+ }, z.core.$strict>;
263
+ type EndMsg = z.output<typeof EndMsg>;
264
+ declare const CancelMsg: z.ZodObject<{
265
+ id: z.ZodString;
266
+ type: z.ZodLiteral<"cancel">;
267
+ }, z.core.$strict>;
268
+ type CancelMsg = z.output<typeof CancelMsg>;
269
+ /** Grant n more payload bytes for the stream opened by request `id` (either direction). */
270
+ declare const CreditMsg: z.ZodObject<{
271
+ id: z.ZodString;
272
+ type: z.ZodLiteral<"credit">;
273
+ n: z.ZodInt;
274
+ }, z.core.$strict>;
275
+ type CreditMsg = z.output<typeof CreditMsg>;
276
+ declare const EventMsg: z.ZodObject<{
277
+ type: z.ZodLiteral<"event">;
278
+ cap: z.ZodString;
279
+ name: z.ZodString;
280
+ payload: z.ZodUnknown;
281
+ resourceId: z.ZodOptional<z.ZodString>;
282
+ }, z.core.$strict>;
283
+ type EventMsg = z.output<typeof EventMsg>;
284
+ /** Client↔relay only; the relay consumes these and never forwards them to the core. */
285
+ declare const RelayMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
286
+ type: z.ZodLiteral<"relay">;
287
+ op: z.ZodLiteral<"reauth">;
288
+ token: z.ZodString;
289
+ }, z.core.$strict>], "op">;
290
+ type RelayMsg = z.output<typeof RelayMsg>;
291
+ declare const ClientToCoreMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
292
+ type: z.ZodLiteral<"hello">;
293
+ id: z.ZodString;
294
+ protocolVersion: z.ZodString;
295
+ clientType: z.ZodEnum<{
296
+ screen: "screen";
297
+ web: "web";
298
+ extension: "extension";
299
+ server: "server";
300
+ test: "test";
301
+ }>;
302
+ clientVersion: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ id: z.ZodString;
305
+ type: z.ZodLiteral<"request">;
306
+ cap: z.ZodString;
307
+ op: z.ZodString;
308
+ params: z.ZodUnknown;
309
+ }, z.core.$strict>, z.ZodObject<{
310
+ id: z.ZodString;
311
+ type: z.ZodLiteral<"cancel">;
312
+ }, z.core.$strict>, z.ZodObject<{
313
+ id: z.ZodString;
314
+ type: z.ZodLiteral<"credit">;
315
+ n: z.ZodInt;
316
+ }, z.core.$strict>], "type">;
317
+ type ClientToCoreMsg = z.output<typeof ClientToCoreMsg>;
318
+ declare const CoreToClientMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
319
+ id: z.ZodString;
320
+ type: z.ZodLiteral<"response">;
321
+ result: z.ZodUnknown;
322
+ }, z.core.$strict>, z.ZodObject<{
323
+ id: z.ZodString;
324
+ type: z.ZodLiteral<"error">;
325
+ error: z.ZodObject<{
326
+ code: z.ZodEnum<{
327
+ AUTH_REQUIRED: "AUTH_REQUIRED";
328
+ AUTH_INVALID: "AUTH_INVALID";
329
+ AUTH_EXPIRED: "AUTH_EXPIRED";
330
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
331
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
332
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
333
+ NOT_FOUND: "NOT_FOUND";
334
+ CONFLICT: "CONFLICT";
335
+ INVALID_PARAMS: "INVALID_PARAMS";
336
+ RESOURCE_BUSY: "RESOURCE_BUSY";
337
+ RESOURCE_GONE: "RESOURCE_GONE";
338
+ CANCELLED: "CANCELLED";
339
+ TIMEOUT: "TIMEOUT";
340
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
341
+ RATE_LIMITED: "RATE_LIMITED";
342
+ INTERNAL: "INTERNAL";
343
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
344
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
345
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
346
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
347
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
348
+ }>;
349
+ message: z.ZodString;
350
+ retryable: z.ZodBoolean;
351
+ data: z.ZodOptional<z.ZodObject<{
352
+ reason: z.ZodOptional<z.ZodEnum<{
353
+ not_a_directory: "not_a_directory";
354
+ is_a_directory: "is_a_directory";
355
+ directory_not_empty: "directory_not_empty";
356
+ already_exists: "already_exists";
357
+ stale_write: "stale_write";
358
+ binary_content: "binary_content";
359
+ not_utf8_boundary: "not_utf8_boundary";
360
+ patch_no_match: "patch_no_match";
361
+ patch_ambiguous: "patch_ambiguous";
362
+ resource_exited: "resource_exited";
363
+ resource_expired: "resource_expired";
364
+ control_taken: "control_taken";
365
+ window_exhausted: "window_exhausted";
366
+ }>>;
367
+ cap: z.ZodOptional<z.ZodString>;
368
+ op: z.ZodOptional<z.ZodString>;
369
+ path: z.ZodOptional<z.ZodString>;
370
+ settings_url: z.ZodOptional<z.ZodString>;
371
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
372
+ limit_bytes: z.ZodOptional<z.ZodInt>;
373
+ upgrade: z.ZodOptional<z.ZodObject<{
374
+ min_version: z.ZodString;
375
+ max_version: z.ZodString;
376
+ download_url: z.ZodOptional<z.ZodURL>;
377
+ }, z.core.$strict>>;
378
+ }, z.core.$strict>>;
379
+ }, z.core.$strict>;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ id: z.ZodString;
382
+ type: z.ZodLiteral<"stream">;
383
+ seq: z.ZodInt;
384
+ meta: z.ZodDiscriminatedUnion<[z.ZodObject<{
385
+ kind: z.ZodLiteral<"open">;
386
+ sid: z.ZodInt;
387
+ window_bytes: z.ZodInt;
388
+ resource_id: z.ZodOptional<z.ZodString>;
389
+ }, z.core.$strict>, z.ZodObject<{
390
+ kind: z.ZodLiteral<"snapshot">;
391
+ cols: z.ZodInt;
392
+ rows: z.ZodInt;
393
+ }, z.core.$strict>, z.ZodObject<{
394
+ kind: z.ZodLiteral<"gap">;
395
+ from_seq: z.ZodInt;
396
+ to_seq: z.ZodInt;
397
+ }, z.core.$strict>], "kind">;
398
+ }, z.core.$strict>, z.ZodObject<{
399
+ id: z.ZodString;
400
+ type: z.ZodLiteral<"end">;
401
+ seq: z.ZodInt;
402
+ reason: z.ZodOptional<z.ZodEnum<{
403
+ error: "error";
404
+ resource_exited: "resource_exited";
405
+ completed: "completed";
406
+ cancelled: "cancelled";
407
+ detached: "detached";
408
+ }>>;
409
+ }, z.core.$strict>, z.ZodObject<{
410
+ id: z.ZodString;
411
+ type: z.ZodLiteral<"credit">;
412
+ n: z.ZodInt;
413
+ }, z.core.$strict>, z.ZodObject<{
414
+ type: z.ZodLiteral<"event">;
415
+ cap: z.ZodString;
416
+ name: z.ZodString;
417
+ payload: z.ZodUnknown;
418
+ resourceId: z.ZodOptional<z.ZodString>;
419
+ }, z.core.$strict>], "type">;
420
+ type CoreToClientMsg = z.output<typeof CoreToClientMsg>;
421
+
422
+ /** @ai-matrx/desktop-protocol — error model (SPEC §5). Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */
423
+
424
+ declare const ErrorCode: z.ZodEnum<{
425
+ AUTH_REQUIRED: "AUTH_REQUIRED";
426
+ AUTH_INVALID: "AUTH_INVALID";
427
+ AUTH_EXPIRED: "AUTH_EXPIRED";
428
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
429
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
430
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
431
+ NOT_FOUND: "NOT_FOUND";
432
+ CONFLICT: "CONFLICT";
433
+ INVALID_PARAMS: "INVALID_PARAMS";
434
+ RESOURCE_BUSY: "RESOURCE_BUSY";
435
+ RESOURCE_GONE: "RESOURCE_GONE";
436
+ CANCELLED: "CANCELLED";
437
+ TIMEOUT: "TIMEOUT";
438
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
439
+ RATE_LIMITED: "RATE_LIMITED";
440
+ INTERNAL: "INTERNAL";
441
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
442
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
443
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
444
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
445
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
446
+ }>;
447
+ type ErrorCode = z.output<typeof ErrorCode>;
448
+ /** Machine reason under a code, so clients branch without parsing messages. */
449
+ declare const ErrorReason: z.ZodEnum<{
450
+ not_a_directory: "not_a_directory";
451
+ is_a_directory: "is_a_directory";
452
+ directory_not_empty: "directory_not_empty";
453
+ already_exists: "already_exists";
454
+ stale_write: "stale_write";
455
+ binary_content: "binary_content";
456
+ not_utf8_boundary: "not_utf8_boundary";
457
+ patch_no_match: "patch_no_match";
458
+ patch_ambiguous: "patch_ambiguous";
459
+ resource_exited: "resource_exited";
460
+ resource_expired: "resource_expired";
461
+ control_taken: "control_taken";
462
+ window_exhausted: "window_exhausted";
463
+ }>;
464
+ type ErrorReason = z.output<typeof ErrorReason>;
465
+ declare const ProtocolErrorBody: z.ZodObject<{
466
+ code: z.ZodEnum<{
467
+ AUTH_REQUIRED: "AUTH_REQUIRED";
468
+ AUTH_INVALID: "AUTH_INVALID";
469
+ AUTH_EXPIRED: "AUTH_EXPIRED";
470
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
471
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
472
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
473
+ NOT_FOUND: "NOT_FOUND";
474
+ CONFLICT: "CONFLICT";
475
+ INVALID_PARAMS: "INVALID_PARAMS";
476
+ RESOURCE_BUSY: "RESOURCE_BUSY";
477
+ RESOURCE_GONE: "RESOURCE_GONE";
478
+ CANCELLED: "CANCELLED";
479
+ TIMEOUT: "TIMEOUT";
480
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
481
+ RATE_LIMITED: "RATE_LIMITED";
482
+ INTERNAL: "INTERNAL";
483
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
484
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
485
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
486
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
487
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
488
+ }>;
489
+ message: z.ZodString;
490
+ retryable: z.ZodBoolean;
491
+ data: z.ZodOptional<z.ZodObject<{
492
+ reason: z.ZodOptional<z.ZodEnum<{
493
+ not_a_directory: "not_a_directory";
494
+ is_a_directory: "is_a_directory";
495
+ directory_not_empty: "directory_not_empty";
496
+ already_exists: "already_exists";
497
+ stale_write: "stale_write";
498
+ binary_content: "binary_content";
499
+ not_utf8_boundary: "not_utf8_boundary";
500
+ patch_no_match: "patch_no_match";
501
+ patch_ambiguous: "patch_ambiguous";
502
+ resource_exited: "resource_exited";
503
+ resource_expired: "resource_expired";
504
+ control_taken: "control_taken";
505
+ window_exhausted: "window_exhausted";
506
+ }>>;
507
+ cap: z.ZodOptional<z.ZodString>;
508
+ op: z.ZodOptional<z.ZodString>;
509
+ path: z.ZodOptional<z.ZodString>;
510
+ settings_url: z.ZodOptional<z.ZodString>;
511
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
512
+ limit_bytes: z.ZodOptional<z.ZodInt>;
513
+ upgrade: z.ZodOptional<z.ZodObject<{
514
+ min_version: z.ZodString;
515
+ max_version: z.ZodString;
516
+ download_url: z.ZodOptional<z.ZodURL>;
517
+ }, z.core.$strict>>;
518
+ }, z.core.$strict>>;
519
+ }, z.core.$strict>;
520
+ type ProtocolErrorBody = z.output<typeof ProtocolErrorBody>;
521
+
522
+ /** @ai-matrx/desktop-protocol — the op and event registries (Router, client and Python are generated from these). */
523
+
524
+ type OpSpec = {
525
+ readonly params: z.ZodType;
526
+ readonly result: z.ZodType;
527
+ readonly kind: "unary" | "stream" | "resource";
528
+ readonly since: "1.0";
529
+ readonly errors: readonly z.infer<typeof ErrorCode>[];
530
+ };
531
+ declare const OPS: {
532
+ readonly "sysinfo.get": {
533
+ readonly params: z.ZodObject<{}, z.core.$strict>;
534
+ readonly result: z.ZodObject<{
535
+ device_id: z.ZodString;
536
+ device_name: z.ZodString;
537
+ hostname: z.ZodString;
538
+ platform: z.ZodEnum<{
539
+ darwin: "darwin";
540
+ win32: "win32";
541
+ linux: "linux";
542
+ }>;
543
+ os_version: z.ZodString;
544
+ arch: z.ZodEnum<{
545
+ arm64: "arm64";
546
+ x64: "x64";
547
+ }>;
548
+ app_version: z.ZodString;
549
+ protocol_version: z.ZodString;
550
+ user: z.ZodObject<{
551
+ username: z.ZodString;
552
+ shell: z.ZodString;
553
+ }, z.core.$strict>;
554
+ paths: z.ZodObject<{
555
+ home: z.ZodString;
556
+ desktop: z.ZodString;
557
+ documents: z.ZodString;
558
+ downloads: z.ZodString;
559
+ app_data: z.ZodString;
560
+ temp: z.ZodString;
561
+ }, z.core.$strict>;
562
+ cpu: z.ZodObject<{
563
+ model: z.ZodString;
564
+ cores: z.ZodInt;
565
+ }, z.core.$strict>;
566
+ memory: z.ZodObject<{
567
+ total_bytes: z.ZodInt;
568
+ free_bytes: z.ZodInt;
569
+ }, z.core.$strict>;
570
+ uptime_seconds: z.ZodInt;
571
+ on_battery: z.ZodNullable<z.ZodBoolean>;
572
+ sleep_prevented: z.ZodBoolean;
573
+ permissions: z.ZodArray<z.ZodObject<{
574
+ name: z.ZodEnum<{
575
+ full_disk_access: "full_disk_access";
576
+ accessibility: "accessibility";
577
+ screen_recording: "screen_recording";
578
+ microphone: "microphone";
579
+ camera: "camera";
580
+ automation: "automation";
581
+ contacts: "contacts";
582
+ calendars: "calendars";
583
+ photos: "photos";
584
+ location: "location";
585
+ local_network: "local_network";
586
+ bluetooth: "bluetooth";
587
+ notifications: "notifications";
588
+ }>;
589
+ state: z.ZodEnum<{
590
+ granted: "granted";
591
+ denied: "denied";
592
+ not_determined: "not_determined";
593
+ not_applicable: "not_applicable";
594
+ }>;
595
+ settings_url: z.ZodNullable<z.ZodString>;
596
+ }, z.core.$strict>>;
597
+ }, z.core.$strict>;
598
+ readonly kind: "unary";
599
+ readonly since: "1.0";
600
+ readonly errors: readonly ["INTERNAL"];
601
+ };
602
+ readonly "fs.list": {
603
+ readonly params: z.ZodObject<{
604
+ path: z.ZodString;
605
+ recursive: z.ZodDefault<z.ZodBoolean>;
606
+ depth: z.ZodDefault<z.ZodInt>;
607
+ pattern: z.ZodOptional<z.ZodString>;
608
+ limit: z.ZodDefault<z.ZodInt>;
609
+ page_token: z.ZodOptional<z.ZodString>;
610
+ show_hidden: z.ZodDefault<z.ZodBoolean>;
611
+ sort: z.ZodDefault<z.ZodEnum<{
612
+ kind: "kind";
613
+ name: "name";
614
+ size: "size";
615
+ mtime: "mtime";
616
+ }>>;
617
+ }, z.core.$strict>;
618
+ readonly result: z.ZodObject<{
619
+ entries: z.ZodArray<z.ZodObject<{
620
+ name: z.ZodString;
621
+ path: z.ZodString;
622
+ kind: z.ZodEnum<{
623
+ file: "file";
624
+ dir: "dir";
625
+ symlink: "symlink";
626
+ }>;
627
+ size: z.ZodInt;
628
+ mtime: z.ZodNumber;
629
+ mtime_ms: z.ZodInt;
630
+ mode: z.ZodInt;
631
+ target: z.ZodNullable<z.ZodString>;
632
+ hidden: z.ZodBoolean;
633
+ }, z.core.$strict>>;
634
+ truncated: z.ZodBoolean;
635
+ next_page_token: z.ZodNullable<z.ZodString>;
636
+ scanned: z.ZodInt;
637
+ }, z.core.$strict>;
638
+ readonly kind: "unary";
639
+ readonly since: "1.0";
640
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
641
+ };
642
+ readonly "fs.stat": {
643
+ readonly params: z.ZodObject<{
644
+ path: z.ZodString;
645
+ }, z.core.$strict>;
646
+ readonly result: z.ZodObject<{
647
+ name: z.ZodString;
648
+ path: z.ZodString;
649
+ kind: z.ZodEnum<{
650
+ file: "file";
651
+ dir: "dir";
652
+ symlink: "symlink";
653
+ }>;
654
+ size: z.ZodInt;
655
+ mtime: z.ZodNumber;
656
+ mtime_ms: z.ZodInt;
657
+ mode: z.ZodInt;
658
+ target: z.ZodNullable<z.ZodString>;
659
+ hidden: z.ZodBoolean;
660
+ }, z.core.$strict>;
661
+ readonly kind: "unary";
662
+ readonly since: "1.0";
663
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
664
+ };
665
+ readonly "fs.read": {
666
+ readonly params: z.ZodObject<{
667
+ path: z.ZodString;
668
+ encoding: z.ZodDefault<z.ZodEnum<{
669
+ utf8: "utf8";
670
+ base64: "base64";
671
+ }>>;
672
+ offset: z.ZodDefault<z.ZodInt>;
673
+ limit: z.ZodDefault<z.ZodInt>;
674
+ }, z.core.$strict>;
675
+ readonly result: z.ZodObject<{
676
+ content: z.ZodString;
677
+ encoding: z.ZodEnum<{
678
+ utf8: "utf8";
679
+ base64: "base64";
680
+ }>;
681
+ size: z.ZodInt;
682
+ offset: z.ZodInt;
683
+ next_offset: z.ZodInt;
684
+ truncated: z.ZodBoolean;
685
+ mime: z.ZodNullable<z.ZodString>;
686
+ mtime_ms: z.ZodInt;
687
+ }, z.core.$strict>;
688
+ readonly kind: "unary";
689
+ readonly since: "1.0";
690
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "PAYLOAD_TOO_LARGE"];
691
+ };
692
+ readonly "fs.read_stream": {
693
+ readonly params: z.ZodObject<{
694
+ path: z.ZodString;
695
+ offset: z.ZodDefault<z.ZodInt>;
696
+ length: z.ZodOptional<z.ZodInt>;
697
+ window_bytes: z.ZodOptional<z.ZodInt>;
698
+ }, z.core.$strict>;
699
+ readonly result: z.ZodObject<{
700
+ size: z.ZodInt;
701
+ mime: z.ZodNullable<z.ZodString>;
702
+ mtime_ms: z.ZodInt;
703
+ }, z.core.$strict>;
704
+ readonly kind: "stream";
705
+ readonly since: "1.0";
706
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "CANCELLED"];
707
+ };
708
+ readonly "fs.write": {
709
+ readonly params: z.ZodObject<{
710
+ path: z.ZodString;
711
+ content: z.ZodString;
712
+ encoding: z.ZodDefault<z.ZodEnum<{
713
+ utf8: "utf8";
714
+ base64: "base64";
715
+ }>>;
716
+ mode: z.ZodOptional<z.ZodInt>;
717
+ create_parents: z.ZodDefault<z.ZodBoolean>;
718
+ if_match_mtime_ms: z.ZodOptional<z.ZodInt>;
719
+ exclusive: z.ZodDefault<z.ZodBoolean>;
720
+ }, z.core.$strict>;
721
+ readonly result: z.ZodObject<{
722
+ path: z.ZodString;
723
+ size: z.ZodInt;
724
+ mtime_ms: z.ZodInt;
725
+ created: z.ZodBoolean;
726
+ }, z.core.$strict>;
727
+ readonly kind: "unary";
728
+ readonly since: "1.0";
729
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "CONFLICT", "PAYLOAD_TOO_LARGE"];
730
+ };
731
+ readonly "fs.mkdir": {
732
+ readonly params: z.ZodObject<{
733
+ path: z.ZodString;
734
+ parents: z.ZodDefault<z.ZodBoolean>;
735
+ }, z.core.$strict>;
736
+ readonly result: z.ZodObject<{
737
+ path: z.ZodString;
738
+ created: z.ZodBoolean;
739
+ }, z.core.$strict>;
740
+ readonly kind: "unary";
741
+ readonly since: "1.0";
742
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "CONFLICT"];
743
+ };
744
+ readonly "fs.move": {
745
+ readonly params: z.ZodObject<{
746
+ from_path: z.ZodString;
747
+ to_path: z.ZodString;
748
+ overwrite: z.ZodDefault<z.ZodBoolean>;
749
+ }, z.core.$strict>;
750
+ readonly result: z.ZodObject<{
751
+ from_path: z.ZodString;
752
+ to_path: z.ZodString;
753
+ }, z.core.$strict>;
754
+ readonly kind: "unary";
755
+ readonly since: "1.0";
756
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "CONFLICT"];
757
+ };
758
+ readonly "fs.delete": {
759
+ readonly params: z.ZodObject<{
760
+ path: z.ZodString;
761
+ recursive: z.ZodDefault<z.ZodBoolean>;
762
+ to_trash: z.ZodDefault<z.ZodBoolean>;
763
+ }, z.core.$strict>;
764
+ readonly result: z.ZodObject<{
765
+ deleted: z.ZodLiteral<true>;
766
+ trashed_to: z.ZodNullable<z.ZodString>;
767
+ }, z.core.$strict>;
768
+ readonly kind: "unary";
769
+ readonly since: "1.0";
770
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
771
+ };
772
+ readonly "fs.watch": {
773
+ readonly params: z.ZodObject<{
774
+ path: z.ZodString;
775
+ recursive: z.ZodDefault<z.ZodBoolean>;
776
+ ignore: z.ZodDefault<z.ZodArray<z.ZodString>>;
777
+ debounce_ms: z.ZodDefault<z.ZodInt>;
778
+ }, z.core.$strict>;
779
+ readonly result: z.ZodObject<{
780
+ resource_id: z.ZodString;
781
+ path: z.ZodString;
782
+ }, z.core.$strict>;
783
+ readonly kind: "resource";
784
+ readonly since: "1.0";
785
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "RATE_LIMITED"];
786
+ };
787
+ readonly "fs.patch": {
788
+ readonly params: z.ZodObject<{
789
+ path: z.ZodString;
790
+ edits: z.ZodArray<z.ZodObject<{
791
+ old_text: z.ZodString;
792
+ new_text: z.ZodString;
793
+ replace_all: z.ZodDefault<z.ZodBoolean>;
794
+ }, z.core.$strict>>;
795
+ create_if_missing: z.ZodDefault<z.ZodBoolean>;
796
+ }, z.core.$strict>;
797
+ readonly result: z.ZodObject<{
798
+ path: z.ZodString;
799
+ applied: z.ZodInt;
800
+ size: z.ZodInt;
801
+ mtime_ms: z.ZodInt;
802
+ }, z.core.$strict>;
803
+ readonly kind: "unary";
804
+ readonly since: "1.0";
805
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "CONFLICT"];
806
+ };
807
+ readonly "fs.search_paths": {
808
+ readonly params: z.ZodObject<{
809
+ pattern: z.ZodString;
810
+ cwd: z.ZodString;
811
+ hidden: z.ZodDefault<z.ZodBoolean>;
812
+ max_results: z.ZodDefault<z.ZodInt>;
813
+ }, z.core.$strict>;
814
+ readonly result: z.ZodObject<{
815
+ paths: z.ZodArray<z.ZodString>;
816
+ truncated: z.ZodBoolean;
817
+ }, z.core.$strict>;
818
+ readonly kind: "unary";
819
+ readonly since: "1.0";
820
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "TIMEOUT"];
821
+ };
822
+ readonly "fs.search_content": {
823
+ readonly params: z.ZodObject<{
824
+ query: z.ZodString;
825
+ cwd: z.ZodString;
826
+ regex: z.ZodDefault<z.ZodBoolean>;
827
+ case_sensitive: z.ZodDefault<z.ZodBoolean>;
828
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
829
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
830
+ max_results: z.ZodDefault<z.ZodInt>;
831
+ }, z.core.$strict>;
832
+ readonly result: z.ZodObject<{
833
+ results: z.ZodArray<z.ZodObject<{
834
+ path: z.ZodString;
835
+ lines: z.ZodString;
836
+ line_number: z.ZodInt;
837
+ submatches: z.ZodArray<z.ZodObject<{
838
+ match: z.ZodString;
839
+ start: z.ZodInt;
840
+ end: z.ZodInt;
841
+ }, z.core.$strict>>;
842
+ }, z.core.$strict>>;
843
+ truncated: z.ZodBoolean;
844
+ }, z.core.$strict>;
845
+ readonly kind: "unary";
846
+ readonly since: "1.0";
847
+ readonly errors: readonly ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL", "TIMEOUT"];
848
+ };
849
+ readonly "exec.pty.start": {
850
+ readonly params: z.ZodObject<{
851
+ cols: z.ZodInt;
852
+ rows: z.ZodInt;
853
+ cwd: z.ZodOptional<z.ZodString>;
854
+ shell: z.ZodOptional<z.ZodString>;
855
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
856
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
857
+ name: z.ZodOptional<z.ZodString>;
858
+ window_bytes: z.ZodOptional<z.ZodInt>;
859
+ }, z.core.$strict>;
860
+ readonly result: z.ZodObject<{
861
+ resource_id: z.ZodString;
862
+ pid: z.ZodInt;
863
+ shell: z.ZodString;
864
+ cwd: z.ZodString;
865
+ title: z.ZodString;
866
+ name: z.ZodNullable<z.ZodString>;
867
+ cols: z.ZodInt;
868
+ rows: z.ZodInt;
869
+ state: z.ZodEnum<{
870
+ running: "running";
871
+ exited: "exited";
872
+ }>;
873
+ exit_code: z.ZodNullable<z.ZodInt>;
874
+ exit_signal: z.ZodNullable<z.ZodEnum<{
875
+ SIGINT: "SIGINT";
876
+ SIGTERM: "SIGTERM";
877
+ SIGKILL: "SIGKILL";
878
+ SIGHUP: "SIGHUP";
879
+ SIGQUIT: "SIGQUIT";
880
+ SIGTSTP: "SIGTSTP";
881
+ SIGCONT: "SIGCONT";
882
+ SIGUSR1: "SIGUSR1";
883
+ SIGUSR2: "SIGUSR2";
884
+ }>>;
885
+ last_seq: z.ZodInt;
886
+ created_at_ms: z.ZodInt;
887
+ controller_client_id: z.ZodNullable<z.ZodString>;
888
+ attached_clients: z.ZodInt;
889
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
890
+ }, z.core.$strict>;
891
+ readonly kind: "resource";
892
+ readonly since: "1.0";
893
+ readonly errors: readonly ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "PLATFORM_UNSUPPORTED", "INTERNAL"];
894
+ };
895
+ readonly "exec.pty.write": {
896
+ readonly params: z.ZodObject<{
897
+ resource_id: z.ZodString;
898
+ data: z.ZodString;
899
+ }, z.core.$strict>;
900
+ readonly result: z.ZodObject<{
901
+ written: z.ZodInt;
902
+ }, z.core.$strict>;
903
+ readonly kind: "unary";
904
+ readonly since: "1.0";
905
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN", "INVALID_PARAMS"];
906
+ };
907
+ readonly "exec.pty.resize": {
908
+ readonly params: z.ZodObject<{
909
+ resource_id: z.ZodString;
910
+ cols: z.ZodInt;
911
+ rows: z.ZodInt;
912
+ }, z.core.$strict>;
913
+ readonly result: z.ZodObject<{
914
+ cols: z.ZodInt;
915
+ rows: z.ZodInt;
916
+ }, z.core.$strict>;
917
+ readonly kind: "unary";
918
+ readonly since: "1.0";
919
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN"];
920
+ };
921
+ readonly "exec.pty.signal": {
922
+ readonly params: z.ZodObject<{
923
+ resource_id: z.ZodString;
924
+ signal: z.ZodEnum<{
925
+ SIGINT: "SIGINT";
926
+ SIGTERM: "SIGTERM";
927
+ SIGKILL: "SIGKILL";
928
+ SIGHUP: "SIGHUP";
929
+ SIGQUIT: "SIGQUIT";
930
+ SIGTSTP: "SIGTSTP";
931
+ SIGCONT: "SIGCONT";
932
+ SIGUSR1: "SIGUSR1";
933
+ SIGUSR2: "SIGUSR2";
934
+ }>;
935
+ }, z.core.$strict>;
936
+ readonly result: z.ZodObject<{
937
+ delivered: z.ZodBoolean;
938
+ }, z.core.$strict>;
939
+ readonly kind: "unary";
940
+ readonly since: "1.0";
941
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED"];
942
+ };
943
+ readonly "exec.pty.kill": {
944
+ readonly params: z.ZodObject<{
945
+ resource_id: z.ZodString;
946
+ grace_ms: z.ZodDefault<z.ZodInt>;
947
+ }, z.core.$strict>;
948
+ readonly result: z.ZodObject<{
949
+ exit_code: z.ZodNullable<z.ZodInt>;
950
+ exit_signal: z.ZodNullable<z.ZodEnum<{
951
+ SIGINT: "SIGINT";
952
+ SIGTERM: "SIGTERM";
953
+ SIGKILL: "SIGKILL";
954
+ SIGHUP: "SIGHUP";
955
+ SIGQUIT: "SIGQUIT";
956
+ SIGTSTP: "SIGTSTP";
957
+ SIGCONT: "SIGCONT";
958
+ SIGUSR1: "SIGUSR1";
959
+ SIGUSR2: "SIGUSR2";
960
+ }>>;
961
+ }, z.core.$strict>;
962
+ readonly kind: "unary";
963
+ readonly since: "1.0";
964
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN"];
965
+ };
966
+ readonly "exec.list": {
967
+ readonly params: z.ZodObject<{}, z.core.$strict>;
968
+ readonly result: z.ZodObject<{
969
+ sessions: z.ZodArray<z.ZodObject<{
970
+ resource_id: z.ZodString;
971
+ pid: z.ZodInt;
972
+ shell: z.ZodString;
973
+ cwd: z.ZodString;
974
+ title: z.ZodString;
975
+ name: z.ZodNullable<z.ZodString>;
976
+ cols: z.ZodInt;
977
+ rows: z.ZodInt;
978
+ state: z.ZodEnum<{
979
+ running: "running";
980
+ exited: "exited";
981
+ }>;
982
+ exit_code: z.ZodNullable<z.ZodInt>;
983
+ exit_signal: z.ZodNullable<z.ZodEnum<{
984
+ SIGINT: "SIGINT";
985
+ SIGTERM: "SIGTERM";
986
+ SIGKILL: "SIGKILL";
987
+ SIGHUP: "SIGHUP";
988
+ SIGQUIT: "SIGQUIT";
989
+ SIGTSTP: "SIGTSTP";
990
+ SIGCONT: "SIGCONT";
991
+ SIGUSR1: "SIGUSR1";
992
+ SIGUSR2: "SIGUSR2";
993
+ }>>;
994
+ last_seq: z.ZodInt;
995
+ created_at_ms: z.ZodInt;
996
+ controller_client_id: z.ZodNullable<z.ZodString>;
997
+ attached_clients: z.ZodInt;
998
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
999
+ }, z.core.$strict>>;
1000
+ }, z.core.$strict>;
1001
+ readonly kind: "unary";
1002
+ readonly since: "1.0";
1003
+ readonly errors: readonly ["INTERNAL"];
1004
+ };
1005
+ readonly "exec.run": {
1006
+ readonly params: z.ZodObject<{
1007
+ command: z.ZodString;
1008
+ cwd: z.ZodOptional<z.ZodString>;
1009
+ cwd_key: z.ZodOptional<z.ZodString>;
1010
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1011
+ stdin: z.ZodOptional<z.ZodString>;
1012
+ timeout: z.ZodDefault<z.ZodInt>;
1013
+ max_output_bytes: z.ZodDefault<z.ZodInt>;
1014
+ }, z.core.$strict>;
1015
+ readonly result: z.ZodObject<{
1016
+ exit_code: z.ZodInt;
1017
+ stdout: z.ZodString;
1018
+ stderr: z.ZodString;
1019
+ cwd: z.ZodString;
1020
+ duration_ms: z.ZodInt;
1021
+ timed_out: z.ZodBoolean;
1022
+ output_truncated: z.ZodBoolean;
1023
+ }, z.core.$strict>;
1024
+ readonly kind: "unary";
1025
+ readonly since: "1.0";
1026
+ readonly errors: readonly ["INVALID_PARAMS", "NOT_FOUND", "TIMEOUT", "CANCELLED", "INTERNAL"];
1027
+ };
1028
+ readonly "session.attach": {
1029
+ readonly params: z.ZodObject<{
1030
+ resource_id: z.ZodString;
1031
+ mode: z.ZodDefault<z.ZodEnum<{
1032
+ control: "control";
1033
+ read_only: "read_only";
1034
+ }>>;
1035
+ since_seq: z.ZodOptional<z.ZodInt>;
1036
+ window_bytes: z.ZodOptional<z.ZodInt>;
1037
+ }, z.core.$strict>;
1038
+ readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
1039
+ kind: z.ZodLiteral<"pty">;
1040
+ pty: z.ZodObject<{
1041
+ resource_id: z.ZodString;
1042
+ pid: z.ZodInt;
1043
+ shell: z.ZodString;
1044
+ cwd: z.ZodString;
1045
+ title: z.ZodString;
1046
+ name: z.ZodNullable<z.ZodString>;
1047
+ cols: z.ZodInt;
1048
+ rows: z.ZodInt;
1049
+ state: z.ZodEnum<{
1050
+ running: "running";
1051
+ exited: "exited";
1052
+ }>;
1053
+ exit_code: z.ZodNullable<z.ZodInt>;
1054
+ exit_signal: z.ZodNullable<z.ZodEnum<{
1055
+ SIGINT: "SIGINT";
1056
+ SIGTERM: "SIGTERM";
1057
+ SIGKILL: "SIGKILL";
1058
+ SIGHUP: "SIGHUP";
1059
+ SIGQUIT: "SIGQUIT";
1060
+ SIGTSTP: "SIGTSTP";
1061
+ SIGCONT: "SIGCONT";
1062
+ SIGUSR1: "SIGUSR1";
1063
+ SIGUSR2: "SIGUSR2";
1064
+ }>>;
1065
+ last_seq: z.ZodInt;
1066
+ created_at_ms: z.ZodInt;
1067
+ controller_client_id: z.ZodNullable<z.ZodString>;
1068
+ attached_clients: z.ZodInt;
1069
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
1070
+ }, z.core.$strict>;
1071
+ }, z.core.$strict>, z.ZodObject<{
1072
+ kind: z.ZodLiteral<"watch">;
1073
+ resource_id: z.ZodString;
1074
+ path: z.ZodString;
1075
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
1076
+ }, z.core.$strict>], "kind">;
1077
+ readonly kind: "stream";
1078
+ readonly since: "1.0";
1079
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN", "RESOURCE_BUSY"];
1080
+ };
1081
+ readonly "session.detach": {
1082
+ readonly params: z.ZodObject<{
1083
+ resource_id: z.ZodString;
1084
+ }, z.core.$strict>;
1085
+ readonly result: z.ZodObject<{
1086
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
1087
+ }, z.core.$strict>;
1088
+ readonly kind: "unary";
1089
+ readonly since: "1.0";
1090
+ readonly errors: readonly ["RESOURCE_GONE"];
1091
+ };
1092
+ readonly "session.release": {
1093
+ readonly params: z.ZodObject<{
1094
+ resource_id: z.ZodString;
1095
+ }, z.core.$strict>;
1096
+ readonly result: z.ZodObject<{
1097
+ released: z.ZodLiteral<true>;
1098
+ }, z.core.$strict>;
1099
+ readonly kind: "unary";
1100
+ readonly since: "1.0";
1101
+ readonly errors: readonly ["RESOURCE_GONE", "AUTH_FORBIDDEN"];
1102
+ };
1103
+ readonly "session.list": {
1104
+ readonly params: z.ZodObject<{}, z.core.$strict>;
1105
+ readonly result: z.ZodObject<{
1106
+ resources: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1107
+ kind: z.ZodLiteral<"pty">;
1108
+ pty: z.ZodObject<{
1109
+ resource_id: z.ZodString;
1110
+ pid: z.ZodInt;
1111
+ shell: z.ZodString;
1112
+ cwd: z.ZodString;
1113
+ title: z.ZodString;
1114
+ name: z.ZodNullable<z.ZodString>;
1115
+ cols: z.ZodInt;
1116
+ rows: z.ZodInt;
1117
+ state: z.ZodEnum<{
1118
+ running: "running";
1119
+ exited: "exited";
1120
+ }>;
1121
+ exit_code: z.ZodNullable<z.ZodInt>;
1122
+ exit_signal: z.ZodNullable<z.ZodEnum<{
1123
+ SIGINT: "SIGINT";
1124
+ SIGTERM: "SIGTERM";
1125
+ SIGKILL: "SIGKILL";
1126
+ SIGHUP: "SIGHUP";
1127
+ SIGQUIT: "SIGQUIT";
1128
+ SIGTSTP: "SIGTSTP";
1129
+ SIGCONT: "SIGCONT";
1130
+ SIGUSR1: "SIGUSR1";
1131
+ SIGUSR2: "SIGUSR2";
1132
+ }>>;
1133
+ last_seq: z.ZodInt;
1134
+ created_at_ms: z.ZodInt;
1135
+ controller_client_id: z.ZodNullable<z.ZodString>;
1136
+ attached_clients: z.ZodInt;
1137
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
1138
+ }, z.core.$strict>;
1139
+ }, z.core.$strict>, z.ZodObject<{
1140
+ kind: z.ZodLiteral<"watch">;
1141
+ resource_id: z.ZodString;
1142
+ path: z.ZodString;
1143
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
1144
+ }, z.core.$strict>], "kind">>;
1145
+ }, z.core.$strict>;
1146
+ readonly kind: "unary";
1147
+ readonly since: "1.0";
1148
+ readonly errors: readonly ["INTERNAL"];
1149
+ };
1150
+ };
1151
+ type OpName = keyof typeof OPS;
1152
+ type OpParams<N extends OpName> = z.input<(typeof OPS)[N]["params"]>;
1153
+ type OpResult<N extends OpName> = z.output<(typeof OPS)[N]["result"]>;
1154
+ declare const EVENTS: {
1155
+ readonly "fs.changed": z.ZodObject<{
1156
+ changes: z.ZodArray<z.ZodObject<{
1157
+ type: z.ZodEnum<{
1158
+ created: "created";
1159
+ deleted: "deleted";
1160
+ modified: "modified";
1161
+ moved: "moved";
1162
+ }>;
1163
+ path: z.ZodString;
1164
+ to_path: z.ZodOptional<z.ZodString>;
1165
+ kind: z.ZodEnum<{
1166
+ unknown: "unknown";
1167
+ file: "file";
1168
+ dir: "dir";
1169
+ symlink: "symlink";
1170
+ }>;
1171
+ }, z.core.$strict>>;
1172
+ overflow: z.ZodBoolean;
1173
+ }, z.core.$strict>;
1174
+ readonly "exec.exited": z.ZodObject<{
1175
+ exit_code: z.ZodNullable<z.ZodInt>;
1176
+ exit_signal: z.ZodNullable<z.ZodEnum<{
1177
+ SIGINT: "SIGINT";
1178
+ SIGTERM: "SIGTERM";
1179
+ SIGKILL: "SIGKILL";
1180
+ SIGHUP: "SIGHUP";
1181
+ SIGQUIT: "SIGQUIT";
1182
+ SIGTSTP: "SIGTSTP";
1183
+ SIGCONT: "SIGCONT";
1184
+ SIGUSR1: "SIGUSR1";
1185
+ SIGUSR2: "SIGUSR2";
1186
+ }>>;
1187
+ }, z.core.$strict>;
1188
+ readonly "exec.title": z.ZodObject<{
1189
+ title: z.ZodString;
1190
+ }, z.core.$strict>;
1191
+ readonly "exec.cwd": z.ZodObject<{
1192
+ cwd: z.ZodString;
1193
+ }, z.core.$strict>;
1194
+ readonly "session.control_changed": z.ZodObject<{
1195
+ controller_client_id: z.ZodNullable<z.ZodString>;
1196
+ your_mode: z.ZodEnum<{
1197
+ control: "control";
1198
+ read_only: "read_only";
1199
+ }>;
1200
+ }, z.core.$strict>;
1201
+ readonly "relay.device_status": z.ZodObject<{
1202
+ online: z.ZodBoolean;
1203
+ since_ms: z.ZodInt;
1204
+ app_version: z.ZodNullable<z.ZodString>;
1205
+ protocol_version: z.ZodNullable<z.ZodString>;
1206
+ }, z.core.$strict>;
1207
+ readonly "relay.auth_expiring": z.ZodObject<{
1208
+ expires_at_ms: z.ZodInt;
1209
+ }, z.core.$strict>;
1210
+ };
1211
+ type EventName = keyof typeof EVENTS;
1212
+ /**
1213
+ * Every schema that lands in the generated JSON Schema `$defs` under a stable name (and so becomes a
1214
+ * named Pydantic model). Order is the emission order. A test asserts every exported schema of
1215
+ * src/schema/* is either listed here or is a documented alias of a listed one.
1216
+ * Registered into a PRIVATE zod registry by scripts/generate.ts — never `.meta()`/`.describe()`,
1217
+ * which write zod's process-global registry as an import side effect.
1218
+ */
1219
+ declare const NAMED_SCHEMAS: {
1220
+ readonly ProtocolVersion: z.ZodString;
1221
+ readonly RequestId: z.ZodString;
1222
+ readonly ResourceId: z.ZodString;
1223
+ readonly DeviceId: z.ZodString;
1224
+ readonly AbsPath: z.ZodString;
1225
+ readonly ErrorCode: z.ZodEnum<{
1226
+ AUTH_REQUIRED: "AUTH_REQUIRED";
1227
+ AUTH_INVALID: "AUTH_INVALID";
1228
+ AUTH_EXPIRED: "AUTH_EXPIRED";
1229
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
1230
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
1231
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
1232
+ NOT_FOUND: "NOT_FOUND";
1233
+ CONFLICT: "CONFLICT";
1234
+ INVALID_PARAMS: "INVALID_PARAMS";
1235
+ RESOURCE_BUSY: "RESOURCE_BUSY";
1236
+ RESOURCE_GONE: "RESOURCE_GONE";
1237
+ CANCELLED: "CANCELLED";
1238
+ TIMEOUT: "TIMEOUT";
1239
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
1240
+ RATE_LIMITED: "RATE_LIMITED";
1241
+ INTERNAL: "INTERNAL";
1242
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
1243
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
1244
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
1245
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
1246
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1247
+ }>;
1248
+ readonly ErrorReason: z.ZodEnum<{
1249
+ not_a_directory: "not_a_directory";
1250
+ is_a_directory: "is_a_directory";
1251
+ directory_not_empty: "directory_not_empty";
1252
+ already_exists: "already_exists";
1253
+ stale_write: "stale_write";
1254
+ binary_content: "binary_content";
1255
+ not_utf8_boundary: "not_utf8_boundary";
1256
+ patch_no_match: "patch_no_match";
1257
+ patch_ambiguous: "patch_ambiguous";
1258
+ resource_exited: "resource_exited";
1259
+ resource_expired: "resource_expired";
1260
+ control_taken: "control_taken";
1261
+ window_exhausted: "window_exhausted";
1262
+ }>;
1263
+ readonly ProtocolErrorBody: z.ZodObject<{
1264
+ code: z.ZodEnum<{
1265
+ AUTH_REQUIRED: "AUTH_REQUIRED";
1266
+ AUTH_INVALID: "AUTH_INVALID";
1267
+ AUTH_EXPIRED: "AUTH_EXPIRED";
1268
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
1269
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
1270
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
1271
+ NOT_FOUND: "NOT_FOUND";
1272
+ CONFLICT: "CONFLICT";
1273
+ INVALID_PARAMS: "INVALID_PARAMS";
1274
+ RESOURCE_BUSY: "RESOURCE_BUSY";
1275
+ RESOURCE_GONE: "RESOURCE_GONE";
1276
+ CANCELLED: "CANCELLED";
1277
+ TIMEOUT: "TIMEOUT";
1278
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
1279
+ RATE_LIMITED: "RATE_LIMITED";
1280
+ INTERNAL: "INTERNAL";
1281
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
1282
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
1283
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
1284
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
1285
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1286
+ }>;
1287
+ message: z.ZodString;
1288
+ retryable: z.ZodBoolean;
1289
+ data: z.ZodOptional<z.ZodObject<{
1290
+ reason: z.ZodOptional<z.ZodEnum<{
1291
+ not_a_directory: "not_a_directory";
1292
+ is_a_directory: "is_a_directory";
1293
+ directory_not_empty: "directory_not_empty";
1294
+ already_exists: "already_exists";
1295
+ stale_write: "stale_write";
1296
+ binary_content: "binary_content";
1297
+ not_utf8_boundary: "not_utf8_boundary";
1298
+ patch_no_match: "patch_no_match";
1299
+ patch_ambiguous: "patch_ambiguous";
1300
+ resource_exited: "resource_exited";
1301
+ resource_expired: "resource_expired";
1302
+ control_taken: "control_taken";
1303
+ window_exhausted: "window_exhausted";
1304
+ }>>;
1305
+ cap: z.ZodOptional<z.ZodString>;
1306
+ op: z.ZodOptional<z.ZodString>;
1307
+ path: z.ZodOptional<z.ZodString>;
1308
+ settings_url: z.ZodOptional<z.ZodString>;
1309
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
1310
+ limit_bytes: z.ZodOptional<z.ZodInt>;
1311
+ upgrade: z.ZodOptional<z.ZodObject<{
1312
+ min_version: z.ZodString;
1313
+ max_version: z.ZodString;
1314
+ download_url: z.ZodOptional<z.ZodURL>;
1315
+ }, z.core.$strict>>;
1316
+ }, z.core.$strict>>;
1317
+ }, z.core.$strict>;
1318
+ readonly FrameHeader: z.ZodObject<{
1319
+ version: z.ZodLiteral<1>;
1320
+ flags: z.ZodInt;
1321
+ channel: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<255>]>;
1322
+ cid: z.ZodInt;
1323
+ sid: z.ZodInt;
1324
+ seq: z.ZodInt;
1325
+ }, z.core.$strict>;
1326
+ readonly ClientType: z.ZodEnum<{
1327
+ screen: "screen";
1328
+ web: "web";
1329
+ extension: "extension";
1330
+ server: "server";
1331
+ test: "test";
1332
+ }>;
1333
+ readonly Limits: z.ZodObject<{
1334
+ max_message_bytes: z.ZodInt;
1335
+ max_frame_payload_bytes: z.ZodInt;
1336
+ default_window_bytes: z.ZodInt;
1337
+ max_streams_per_client: z.ZodInt;
1338
+ max_resources_per_user: z.ZodInt;
1339
+ }, z.core.$strict>;
1340
+ readonly OpDescriptor: z.ZodObject<{
1341
+ cap: z.ZodString;
1342
+ op: z.ZodString;
1343
+ since: z.ZodString;
1344
+ }, z.core.$strict>;
1345
+ readonly Welcome: z.ZodObject<{
1346
+ protocol_version: z.ZodString;
1347
+ session_id: z.ZodString;
1348
+ client_id: z.ZodString;
1349
+ device_id: z.ZodString;
1350
+ device_name: z.ZodString;
1351
+ app_version: z.ZodString;
1352
+ platform: z.ZodEnum<{
1353
+ darwin: "darwin";
1354
+ win32: "win32";
1355
+ linux: "linux";
1356
+ }>;
1357
+ ops: z.ZodArray<z.ZodObject<{
1358
+ cap: z.ZodString;
1359
+ op: z.ZodString;
1360
+ since: z.ZodString;
1361
+ }, z.core.$strict>>;
1362
+ limits: z.ZodObject<{
1363
+ max_message_bytes: z.ZodInt;
1364
+ max_frame_payload_bytes: z.ZodInt;
1365
+ default_window_bytes: z.ZodInt;
1366
+ max_streams_per_client: z.ZodInt;
1367
+ max_resources_per_user: z.ZodInt;
1368
+ }, z.core.$strict>;
1369
+ server_time_ms: z.ZodInt;
1370
+ }, z.core.$strict>;
1371
+ readonly HelloMsg: z.ZodObject<{
1372
+ type: z.ZodLiteral<"hello">;
1373
+ id: z.ZodString;
1374
+ protocolVersion: z.ZodString;
1375
+ clientType: z.ZodEnum<{
1376
+ screen: "screen";
1377
+ web: "web";
1378
+ extension: "extension";
1379
+ server: "server";
1380
+ test: "test";
1381
+ }>;
1382
+ clientVersion: z.ZodString;
1383
+ }, z.core.$strict>;
1384
+ readonly RequestMsg: z.ZodObject<{
1385
+ id: z.ZodString;
1386
+ type: z.ZodLiteral<"request">;
1387
+ cap: z.ZodString;
1388
+ op: z.ZodString;
1389
+ params: z.ZodUnknown;
1390
+ }, z.core.$strict>;
1391
+ readonly ResponseMsg: z.ZodObject<{
1392
+ id: z.ZodString;
1393
+ type: z.ZodLiteral<"response">;
1394
+ result: z.ZodUnknown;
1395
+ }, z.core.$strict>;
1396
+ readonly ErrorMsg: z.ZodObject<{
1397
+ id: z.ZodString;
1398
+ type: z.ZodLiteral<"error">;
1399
+ error: z.ZodObject<{
1400
+ code: z.ZodEnum<{
1401
+ AUTH_REQUIRED: "AUTH_REQUIRED";
1402
+ AUTH_INVALID: "AUTH_INVALID";
1403
+ AUTH_EXPIRED: "AUTH_EXPIRED";
1404
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
1405
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
1406
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
1407
+ NOT_FOUND: "NOT_FOUND";
1408
+ CONFLICT: "CONFLICT";
1409
+ INVALID_PARAMS: "INVALID_PARAMS";
1410
+ RESOURCE_BUSY: "RESOURCE_BUSY";
1411
+ RESOURCE_GONE: "RESOURCE_GONE";
1412
+ CANCELLED: "CANCELLED";
1413
+ TIMEOUT: "TIMEOUT";
1414
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
1415
+ RATE_LIMITED: "RATE_LIMITED";
1416
+ INTERNAL: "INTERNAL";
1417
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
1418
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
1419
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
1420
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
1421
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1422
+ }>;
1423
+ message: z.ZodString;
1424
+ retryable: z.ZodBoolean;
1425
+ data: z.ZodOptional<z.ZodObject<{
1426
+ reason: z.ZodOptional<z.ZodEnum<{
1427
+ not_a_directory: "not_a_directory";
1428
+ is_a_directory: "is_a_directory";
1429
+ directory_not_empty: "directory_not_empty";
1430
+ already_exists: "already_exists";
1431
+ stale_write: "stale_write";
1432
+ binary_content: "binary_content";
1433
+ not_utf8_boundary: "not_utf8_boundary";
1434
+ patch_no_match: "patch_no_match";
1435
+ patch_ambiguous: "patch_ambiguous";
1436
+ resource_exited: "resource_exited";
1437
+ resource_expired: "resource_expired";
1438
+ control_taken: "control_taken";
1439
+ window_exhausted: "window_exhausted";
1440
+ }>>;
1441
+ cap: z.ZodOptional<z.ZodString>;
1442
+ op: z.ZodOptional<z.ZodString>;
1443
+ path: z.ZodOptional<z.ZodString>;
1444
+ settings_url: z.ZodOptional<z.ZodString>;
1445
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
1446
+ limit_bytes: z.ZodOptional<z.ZodInt>;
1447
+ upgrade: z.ZodOptional<z.ZodObject<{
1448
+ min_version: z.ZodString;
1449
+ max_version: z.ZodString;
1450
+ download_url: z.ZodOptional<z.ZodURL>;
1451
+ }, z.core.$strict>>;
1452
+ }, z.core.$strict>>;
1453
+ }, z.core.$strict>;
1454
+ }, z.core.$strict>;
1455
+ readonly StreamMeta: z.ZodDiscriminatedUnion<[z.ZodObject<{
1456
+ kind: z.ZodLiteral<"open">;
1457
+ sid: z.ZodInt;
1458
+ window_bytes: z.ZodInt;
1459
+ resource_id: z.ZodOptional<z.ZodString>;
1460
+ }, z.core.$strict>, z.ZodObject<{
1461
+ kind: z.ZodLiteral<"snapshot">;
1462
+ cols: z.ZodInt;
1463
+ rows: z.ZodInt;
1464
+ }, z.core.$strict>, z.ZodObject<{
1465
+ kind: z.ZodLiteral<"gap">;
1466
+ from_seq: z.ZodInt;
1467
+ to_seq: z.ZodInt;
1468
+ }, z.core.$strict>], "kind">;
1469
+ readonly StreamMsg: z.ZodObject<{
1470
+ id: z.ZodString;
1471
+ type: z.ZodLiteral<"stream">;
1472
+ seq: z.ZodInt;
1473
+ meta: z.ZodDiscriminatedUnion<[z.ZodObject<{
1474
+ kind: z.ZodLiteral<"open">;
1475
+ sid: z.ZodInt;
1476
+ window_bytes: z.ZodInt;
1477
+ resource_id: z.ZodOptional<z.ZodString>;
1478
+ }, z.core.$strict>, z.ZodObject<{
1479
+ kind: z.ZodLiteral<"snapshot">;
1480
+ cols: z.ZodInt;
1481
+ rows: z.ZodInt;
1482
+ }, z.core.$strict>, z.ZodObject<{
1483
+ kind: z.ZodLiteral<"gap">;
1484
+ from_seq: z.ZodInt;
1485
+ to_seq: z.ZodInt;
1486
+ }, z.core.$strict>], "kind">;
1487
+ }, z.core.$strict>;
1488
+ readonly EndReason: z.ZodEnum<{
1489
+ error: "error";
1490
+ resource_exited: "resource_exited";
1491
+ completed: "completed";
1492
+ cancelled: "cancelled";
1493
+ detached: "detached";
1494
+ }>;
1495
+ readonly EndMsg: z.ZodObject<{
1496
+ id: z.ZodString;
1497
+ type: z.ZodLiteral<"end">;
1498
+ seq: z.ZodInt;
1499
+ reason: z.ZodOptional<z.ZodEnum<{
1500
+ error: "error";
1501
+ resource_exited: "resource_exited";
1502
+ completed: "completed";
1503
+ cancelled: "cancelled";
1504
+ detached: "detached";
1505
+ }>>;
1506
+ }, z.core.$strict>;
1507
+ readonly CancelMsg: z.ZodObject<{
1508
+ id: z.ZodString;
1509
+ type: z.ZodLiteral<"cancel">;
1510
+ }, z.core.$strict>;
1511
+ readonly CreditMsg: z.ZodObject<{
1512
+ id: z.ZodString;
1513
+ type: z.ZodLiteral<"credit">;
1514
+ n: z.ZodInt;
1515
+ }, z.core.$strict>;
1516
+ readonly EventMsg: z.ZodObject<{
1517
+ type: z.ZodLiteral<"event">;
1518
+ cap: z.ZodString;
1519
+ name: z.ZodString;
1520
+ payload: z.ZodUnknown;
1521
+ resourceId: z.ZodOptional<z.ZodString>;
1522
+ }, z.core.$strict>;
1523
+ readonly RelayMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
1524
+ type: z.ZodLiteral<"relay">;
1525
+ op: z.ZodLiteral<"reauth">;
1526
+ token: z.ZodString;
1527
+ }, z.core.$strict>], "op">;
1528
+ readonly ClientToCoreMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
1529
+ type: z.ZodLiteral<"hello">;
1530
+ id: z.ZodString;
1531
+ protocolVersion: z.ZodString;
1532
+ clientType: z.ZodEnum<{
1533
+ screen: "screen";
1534
+ web: "web";
1535
+ extension: "extension";
1536
+ server: "server";
1537
+ test: "test";
1538
+ }>;
1539
+ clientVersion: z.ZodString;
1540
+ }, z.core.$strict>, z.ZodObject<{
1541
+ id: z.ZodString;
1542
+ type: z.ZodLiteral<"request">;
1543
+ cap: z.ZodString;
1544
+ op: z.ZodString;
1545
+ params: z.ZodUnknown;
1546
+ }, z.core.$strict>, z.ZodObject<{
1547
+ id: z.ZodString;
1548
+ type: z.ZodLiteral<"cancel">;
1549
+ }, z.core.$strict>, z.ZodObject<{
1550
+ id: z.ZodString;
1551
+ type: z.ZodLiteral<"credit">;
1552
+ n: z.ZodInt;
1553
+ }, z.core.$strict>], "type">;
1554
+ readonly CoreToClientMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
1555
+ id: z.ZodString;
1556
+ type: z.ZodLiteral<"response">;
1557
+ result: z.ZodUnknown;
1558
+ }, z.core.$strict>, z.ZodObject<{
1559
+ id: z.ZodString;
1560
+ type: z.ZodLiteral<"error">;
1561
+ error: z.ZodObject<{
1562
+ code: z.ZodEnum<{
1563
+ AUTH_REQUIRED: "AUTH_REQUIRED";
1564
+ AUTH_INVALID: "AUTH_INVALID";
1565
+ AUTH_EXPIRED: "AUTH_EXPIRED";
1566
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
1567
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
1568
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
1569
+ NOT_FOUND: "NOT_FOUND";
1570
+ CONFLICT: "CONFLICT";
1571
+ INVALID_PARAMS: "INVALID_PARAMS";
1572
+ RESOURCE_BUSY: "RESOURCE_BUSY";
1573
+ RESOURCE_GONE: "RESOURCE_GONE";
1574
+ CANCELLED: "CANCELLED";
1575
+ TIMEOUT: "TIMEOUT";
1576
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
1577
+ RATE_LIMITED: "RATE_LIMITED";
1578
+ INTERNAL: "INTERNAL";
1579
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
1580
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
1581
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
1582
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
1583
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1584
+ }>;
1585
+ message: z.ZodString;
1586
+ retryable: z.ZodBoolean;
1587
+ data: z.ZodOptional<z.ZodObject<{
1588
+ reason: z.ZodOptional<z.ZodEnum<{
1589
+ not_a_directory: "not_a_directory";
1590
+ is_a_directory: "is_a_directory";
1591
+ directory_not_empty: "directory_not_empty";
1592
+ already_exists: "already_exists";
1593
+ stale_write: "stale_write";
1594
+ binary_content: "binary_content";
1595
+ not_utf8_boundary: "not_utf8_boundary";
1596
+ patch_no_match: "patch_no_match";
1597
+ patch_ambiguous: "patch_ambiguous";
1598
+ resource_exited: "resource_exited";
1599
+ resource_expired: "resource_expired";
1600
+ control_taken: "control_taken";
1601
+ window_exhausted: "window_exhausted";
1602
+ }>>;
1603
+ cap: z.ZodOptional<z.ZodString>;
1604
+ op: z.ZodOptional<z.ZodString>;
1605
+ path: z.ZodOptional<z.ZodString>;
1606
+ settings_url: z.ZodOptional<z.ZodString>;
1607
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
1608
+ limit_bytes: z.ZodOptional<z.ZodInt>;
1609
+ upgrade: z.ZodOptional<z.ZodObject<{
1610
+ min_version: z.ZodString;
1611
+ max_version: z.ZodString;
1612
+ download_url: z.ZodOptional<z.ZodURL>;
1613
+ }, z.core.$strict>>;
1614
+ }, z.core.$strict>>;
1615
+ }, z.core.$strict>;
1616
+ }, z.core.$strict>, z.ZodObject<{
1617
+ id: z.ZodString;
1618
+ type: z.ZodLiteral<"stream">;
1619
+ seq: z.ZodInt;
1620
+ meta: z.ZodDiscriminatedUnion<[z.ZodObject<{
1621
+ kind: z.ZodLiteral<"open">;
1622
+ sid: z.ZodInt;
1623
+ window_bytes: z.ZodInt;
1624
+ resource_id: z.ZodOptional<z.ZodString>;
1625
+ }, z.core.$strict>, z.ZodObject<{
1626
+ kind: z.ZodLiteral<"snapshot">;
1627
+ cols: z.ZodInt;
1628
+ rows: z.ZodInt;
1629
+ }, z.core.$strict>, z.ZodObject<{
1630
+ kind: z.ZodLiteral<"gap">;
1631
+ from_seq: z.ZodInt;
1632
+ to_seq: z.ZodInt;
1633
+ }, z.core.$strict>], "kind">;
1634
+ }, z.core.$strict>, z.ZodObject<{
1635
+ id: z.ZodString;
1636
+ type: z.ZodLiteral<"end">;
1637
+ seq: z.ZodInt;
1638
+ reason: z.ZodOptional<z.ZodEnum<{
1639
+ error: "error";
1640
+ resource_exited: "resource_exited";
1641
+ completed: "completed";
1642
+ cancelled: "cancelled";
1643
+ detached: "detached";
1644
+ }>>;
1645
+ }, z.core.$strict>, z.ZodObject<{
1646
+ id: z.ZodString;
1647
+ type: z.ZodLiteral<"credit">;
1648
+ n: z.ZodInt;
1649
+ }, z.core.$strict>, z.ZodObject<{
1650
+ type: z.ZodLiteral<"event">;
1651
+ cap: z.ZodString;
1652
+ name: z.ZodString;
1653
+ payload: z.ZodUnknown;
1654
+ resourceId: z.ZodOptional<z.ZodString>;
1655
+ }, z.core.$strict>], "type">;
1656
+ readonly OsPermissionName: z.ZodEnum<{
1657
+ full_disk_access: "full_disk_access";
1658
+ accessibility: "accessibility";
1659
+ screen_recording: "screen_recording";
1660
+ microphone: "microphone";
1661
+ camera: "camera";
1662
+ automation: "automation";
1663
+ contacts: "contacts";
1664
+ calendars: "calendars";
1665
+ photos: "photos";
1666
+ location: "location";
1667
+ local_network: "local_network";
1668
+ bluetooth: "bluetooth";
1669
+ notifications: "notifications";
1670
+ }>;
1671
+ readonly SysinfoGetParams: z.ZodObject<{}, z.core.$strict>;
1672
+ readonly SysinfoGetResult: z.ZodObject<{
1673
+ device_id: z.ZodString;
1674
+ device_name: z.ZodString;
1675
+ hostname: z.ZodString;
1676
+ platform: z.ZodEnum<{
1677
+ darwin: "darwin";
1678
+ win32: "win32";
1679
+ linux: "linux";
1680
+ }>;
1681
+ os_version: z.ZodString;
1682
+ arch: z.ZodEnum<{
1683
+ arm64: "arm64";
1684
+ x64: "x64";
1685
+ }>;
1686
+ app_version: z.ZodString;
1687
+ protocol_version: z.ZodString;
1688
+ user: z.ZodObject<{
1689
+ username: z.ZodString;
1690
+ shell: z.ZodString;
1691
+ }, z.core.$strict>;
1692
+ paths: z.ZodObject<{
1693
+ home: z.ZodString;
1694
+ desktop: z.ZodString;
1695
+ documents: z.ZodString;
1696
+ downloads: z.ZodString;
1697
+ app_data: z.ZodString;
1698
+ temp: z.ZodString;
1699
+ }, z.core.$strict>;
1700
+ cpu: z.ZodObject<{
1701
+ model: z.ZodString;
1702
+ cores: z.ZodInt;
1703
+ }, z.core.$strict>;
1704
+ memory: z.ZodObject<{
1705
+ total_bytes: z.ZodInt;
1706
+ free_bytes: z.ZodInt;
1707
+ }, z.core.$strict>;
1708
+ uptime_seconds: z.ZodInt;
1709
+ on_battery: z.ZodNullable<z.ZodBoolean>;
1710
+ sleep_prevented: z.ZodBoolean;
1711
+ permissions: z.ZodArray<z.ZodObject<{
1712
+ name: z.ZodEnum<{
1713
+ full_disk_access: "full_disk_access";
1714
+ accessibility: "accessibility";
1715
+ screen_recording: "screen_recording";
1716
+ microphone: "microphone";
1717
+ camera: "camera";
1718
+ automation: "automation";
1719
+ contacts: "contacts";
1720
+ calendars: "calendars";
1721
+ photos: "photos";
1722
+ location: "location";
1723
+ local_network: "local_network";
1724
+ bluetooth: "bluetooth";
1725
+ notifications: "notifications";
1726
+ }>;
1727
+ state: z.ZodEnum<{
1728
+ granted: "granted";
1729
+ denied: "denied";
1730
+ not_determined: "not_determined";
1731
+ not_applicable: "not_applicable";
1732
+ }>;
1733
+ settings_url: z.ZodNullable<z.ZodString>;
1734
+ }, z.core.$strict>>;
1735
+ }, z.core.$strict>;
1736
+ readonly FsKind: z.ZodEnum<{
1737
+ file: "file";
1738
+ dir: "dir";
1739
+ symlink: "symlink";
1740
+ }>;
1741
+ readonly FsEntry: z.ZodObject<{
1742
+ name: z.ZodString;
1743
+ path: z.ZodString;
1744
+ kind: z.ZodEnum<{
1745
+ file: "file";
1746
+ dir: "dir";
1747
+ symlink: "symlink";
1748
+ }>;
1749
+ size: z.ZodInt;
1750
+ mtime: z.ZodNumber;
1751
+ mtime_ms: z.ZodInt;
1752
+ mode: z.ZodInt;
1753
+ target: z.ZodNullable<z.ZodString>;
1754
+ hidden: z.ZodBoolean;
1755
+ }, z.core.$strict>;
1756
+ readonly FsListParams: z.ZodObject<{
1757
+ path: z.ZodString;
1758
+ recursive: z.ZodDefault<z.ZodBoolean>;
1759
+ depth: z.ZodDefault<z.ZodInt>;
1760
+ pattern: z.ZodOptional<z.ZodString>;
1761
+ limit: z.ZodDefault<z.ZodInt>;
1762
+ page_token: z.ZodOptional<z.ZodString>;
1763
+ show_hidden: z.ZodDefault<z.ZodBoolean>;
1764
+ sort: z.ZodDefault<z.ZodEnum<{
1765
+ kind: "kind";
1766
+ name: "name";
1767
+ size: "size";
1768
+ mtime: "mtime";
1769
+ }>>;
1770
+ }, z.core.$strict>;
1771
+ readonly FsListResult: z.ZodObject<{
1772
+ entries: z.ZodArray<z.ZodObject<{
1773
+ name: z.ZodString;
1774
+ path: z.ZodString;
1775
+ kind: z.ZodEnum<{
1776
+ file: "file";
1777
+ dir: "dir";
1778
+ symlink: "symlink";
1779
+ }>;
1780
+ size: z.ZodInt;
1781
+ mtime: z.ZodNumber;
1782
+ mtime_ms: z.ZodInt;
1783
+ mode: z.ZodInt;
1784
+ target: z.ZodNullable<z.ZodString>;
1785
+ hidden: z.ZodBoolean;
1786
+ }, z.core.$strict>>;
1787
+ truncated: z.ZodBoolean;
1788
+ next_page_token: z.ZodNullable<z.ZodString>;
1789
+ scanned: z.ZodInt;
1790
+ }, z.core.$strict>;
1791
+ readonly FsStatParams: z.ZodObject<{
1792
+ path: z.ZodString;
1793
+ }, z.core.$strict>;
1794
+ readonly FsEncoding: z.ZodEnum<{
1795
+ utf8: "utf8";
1796
+ base64: "base64";
1797
+ }>;
1798
+ readonly FsReadParams: z.ZodObject<{
1799
+ path: z.ZodString;
1800
+ encoding: z.ZodDefault<z.ZodEnum<{
1801
+ utf8: "utf8";
1802
+ base64: "base64";
1803
+ }>>;
1804
+ offset: z.ZodDefault<z.ZodInt>;
1805
+ limit: z.ZodDefault<z.ZodInt>;
1806
+ }, z.core.$strict>;
1807
+ readonly FsReadResult: z.ZodObject<{
1808
+ content: z.ZodString;
1809
+ encoding: z.ZodEnum<{
1810
+ utf8: "utf8";
1811
+ base64: "base64";
1812
+ }>;
1813
+ size: z.ZodInt;
1814
+ offset: z.ZodInt;
1815
+ next_offset: z.ZodInt;
1816
+ truncated: z.ZodBoolean;
1817
+ mime: z.ZodNullable<z.ZodString>;
1818
+ mtime_ms: z.ZodInt;
1819
+ }, z.core.$strict>;
1820
+ readonly FsReadStreamParams: z.ZodObject<{
1821
+ path: z.ZodString;
1822
+ offset: z.ZodDefault<z.ZodInt>;
1823
+ length: z.ZodOptional<z.ZodInt>;
1824
+ window_bytes: z.ZodOptional<z.ZodInt>;
1825
+ }, z.core.$strict>;
1826
+ readonly FsReadStreamResult: z.ZodObject<{
1827
+ size: z.ZodInt;
1828
+ mime: z.ZodNullable<z.ZodString>;
1829
+ mtime_ms: z.ZodInt;
1830
+ }, z.core.$strict>;
1831
+ readonly FsWriteParams: z.ZodObject<{
1832
+ path: z.ZodString;
1833
+ content: z.ZodString;
1834
+ encoding: z.ZodDefault<z.ZodEnum<{
1835
+ utf8: "utf8";
1836
+ base64: "base64";
1837
+ }>>;
1838
+ mode: z.ZodOptional<z.ZodInt>;
1839
+ create_parents: z.ZodDefault<z.ZodBoolean>;
1840
+ if_match_mtime_ms: z.ZodOptional<z.ZodInt>;
1841
+ exclusive: z.ZodDefault<z.ZodBoolean>;
1842
+ }, z.core.$strict>;
1843
+ readonly FsWriteResult: z.ZodObject<{
1844
+ path: z.ZodString;
1845
+ size: z.ZodInt;
1846
+ mtime_ms: z.ZodInt;
1847
+ created: z.ZodBoolean;
1848
+ }, z.core.$strict>;
1849
+ readonly FsMkdirParams: z.ZodObject<{
1850
+ path: z.ZodString;
1851
+ parents: z.ZodDefault<z.ZodBoolean>;
1852
+ }, z.core.$strict>;
1853
+ readonly FsMkdirResult: z.ZodObject<{
1854
+ path: z.ZodString;
1855
+ created: z.ZodBoolean;
1856
+ }, z.core.$strict>;
1857
+ readonly FsMoveParams: z.ZodObject<{
1858
+ from_path: z.ZodString;
1859
+ to_path: z.ZodString;
1860
+ overwrite: z.ZodDefault<z.ZodBoolean>;
1861
+ }, z.core.$strict>;
1862
+ readonly FsMoveResult: z.ZodObject<{
1863
+ from_path: z.ZodString;
1864
+ to_path: z.ZodString;
1865
+ }, z.core.$strict>;
1866
+ readonly FsDeleteParams: z.ZodObject<{
1867
+ path: z.ZodString;
1868
+ recursive: z.ZodDefault<z.ZodBoolean>;
1869
+ to_trash: z.ZodDefault<z.ZodBoolean>;
1870
+ }, z.core.$strict>;
1871
+ readonly FsDeleteResult: z.ZodObject<{
1872
+ deleted: z.ZodLiteral<true>;
1873
+ trashed_to: z.ZodNullable<z.ZodString>;
1874
+ }, z.core.$strict>;
1875
+ readonly FsWatchParams: z.ZodObject<{
1876
+ path: z.ZodString;
1877
+ recursive: z.ZodDefault<z.ZodBoolean>;
1878
+ ignore: z.ZodDefault<z.ZodArray<z.ZodString>>;
1879
+ debounce_ms: z.ZodDefault<z.ZodInt>;
1880
+ }, z.core.$strict>;
1881
+ readonly FsWatchResult: z.ZodObject<{
1882
+ resource_id: z.ZodString;
1883
+ path: z.ZodString;
1884
+ }, z.core.$strict>;
1885
+ readonly FsPatchParams: z.ZodObject<{
1886
+ path: z.ZodString;
1887
+ edits: z.ZodArray<z.ZodObject<{
1888
+ old_text: z.ZodString;
1889
+ new_text: z.ZodString;
1890
+ replace_all: z.ZodDefault<z.ZodBoolean>;
1891
+ }, z.core.$strict>>;
1892
+ create_if_missing: z.ZodDefault<z.ZodBoolean>;
1893
+ }, z.core.$strict>;
1894
+ readonly FsPatchResult: z.ZodObject<{
1895
+ path: z.ZodString;
1896
+ applied: z.ZodInt;
1897
+ size: z.ZodInt;
1898
+ mtime_ms: z.ZodInt;
1899
+ }, z.core.$strict>;
1900
+ readonly FsSearchPathsParams: z.ZodObject<{
1901
+ pattern: z.ZodString;
1902
+ cwd: z.ZodString;
1903
+ hidden: z.ZodDefault<z.ZodBoolean>;
1904
+ max_results: z.ZodDefault<z.ZodInt>;
1905
+ }, z.core.$strict>;
1906
+ readonly FsSearchPathsResult: z.ZodObject<{
1907
+ paths: z.ZodArray<z.ZodString>;
1908
+ truncated: z.ZodBoolean;
1909
+ }, z.core.$strict>;
1910
+ readonly FsSearchContentParams: z.ZodObject<{
1911
+ query: z.ZodString;
1912
+ cwd: z.ZodString;
1913
+ regex: z.ZodDefault<z.ZodBoolean>;
1914
+ case_sensitive: z.ZodDefault<z.ZodBoolean>;
1915
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
1916
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
1917
+ max_results: z.ZodDefault<z.ZodInt>;
1918
+ }, z.core.$strict>;
1919
+ readonly FsSearchContentResult: z.ZodObject<{
1920
+ results: z.ZodArray<z.ZodObject<{
1921
+ path: z.ZodString;
1922
+ lines: z.ZodString;
1923
+ line_number: z.ZodInt;
1924
+ submatches: z.ZodArray<z.ZodObject<{
1925
+ match: z.ZodString;
1926
+ start: z.ZodInt;
1927
+ end: z.ZodInt;
1928
+ }, z.core.$strict>>;
1929
+ }, z.core.$strict>>;
1930
+ truncated: z.ZodBoolean;
1931
+ }, z.core.$strict>;
1932
+ readonly FsChange: z.ZodObject<{
1933
+ type: z.ZodEnum<{
1934
+ created: "created";
1935
+ deleted: "deleted";
1936
+ modified: "modified";
1937
+ moved: "moved";
1938
+ }>;
1939
+ path: z.ZodString;
1940
+ to_path: z.ZodOptional<z.ZodString>;
1941
+ kind: z.ZodEnum<{
1942
+ unknown: "unknown";
1943
+ file: "file";
1944
+ dir: "dir";
1945
+ symlink: "symlink";
1946
+ }>;
1947
+ }, z.core.$strict>;
1948
+ readonly FsChangedEvent: z.ZodObject<{
1949
+ changes: z.ZodArray<z.ZodObject<{
1950
+ type: z.ZodEnum<{
1951
+ created: "created";
1952
+ deleted: "deleted";
1953
+ modified: "modified";
1954
+ moved: "moved";
1955
+ }>;
1956
+ path: z.ZodString;
1957
+ to_path: z.ZodOptional<z.ZodString>;
1958
+ kind: z.ZodEnum<{
1959
+ unknown: "unknown";
1960
+ file: "file";
1961
+ dir: "dir";
1962
+ symlink: "symlink";
1963
+ }>;
1964
+ }, z.core.$strict>>;
1965
+ overflow: z.ZodBoolean;
1966
+ }, z.core.$strict>;
1967
+ readonly Signal: z.ZodEnum<{
1968
+ SIGINT: "SIGINT";
1969
+ SIGTERM: "SIGTERM";
1970
+ SIGKILL: "SIGKILL";
1971
+ SIGHUP: "SIGHUP";
1972
+ SIGQUIT: "SIGQUIT";
1973
+ SIGTSTP: "SIGTSTP";
1974
+ SIGCONT: "SIGCONT";
1975
+ SIGUSR1: "SIGUSR1";
1976
+ SIGUSR2: "SIGUSR2";
1977
+ }>;
1978
+ readonly ExecPtyStartParams: z.ZodObject<{
1979
+ cols: z.ZodInt;
1980
+ rows: z.ZodInt;
1981
+ cwd: z.ZodOptional<z.ZodString>;
1982
+ shell: z.ZodOptional<z.ZodString>;
1983
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1984
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1985
+ name: z.ZodOptional<z.ZodString>;
1986
+ window_bytes: z.ZodOptional<z.ZodInt>;
1987
+ }, z.core.$strict>;
1988
+ readonly PtyInfo: z.ZodObject<{
1989
+ resource_id: z.ZodString;
1990
+ pid: z.ZodInt;
1991
+ shell: z.ZodString;
1992
+ cwd: z.ZodString;
1993
+ title: z.ZodString;
1994
+ name: z.ZodNullable<z.ZodString>;
1995
+ cols: z.ZodInt;
1996
+ rows: z.ZodInt;
1997
+ state: z.ZodEnum<{
1998
+ running: "running";
1999
+ exited: "exited";
2000
+ }>;
2001
+ exit_code: z.ZodNullable<z.ZodInt>;
2002
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2003
+ SIGINT: "SIGINT";
2004
+ SIGTERM: "SIGTERM";
2005
+ SIGKILL: "SIGKILL";
2006
+ SIGHUP: "SIGHUP";
2007
+ SIGQUIT: "SIGQUIT";
2008
+ SIGTSTP: "SIGTSTP";
2009
+ SIGCONT: "SIGCONT";
2010
+ SIGUSR1: "SIGUSR1";
2011
+ SIGUSR2: "SIGUSR2";
2012
+ }>>;
2013
+ last_seq: z.ZodInt;
2014
+ created_at_ms: z.ZodInt;
2015
+ controller_client_id: z.ZodNullable<z.ZodString>;
2016
+ attached_clients: z.ZodInt;
2017
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2018
+ }, z.core.$strict>;
2019
+ readonly ExecPtyWriteParams: z.ZodObject<{
2020
+ resource_id: z.ZodString;
2021
+ data: z.ZodString;
2022
+ }, z.core.$strict>;
2023
+ readonly ExecPtyWriteResult: z.ZodObject<{
2024
+ written: z.ZodInt;
2025
+ }, z.core.$strict>;
2026
+ readonly ExecPtyResizeParams: z.ZodObject<{
2027
+ resource_id: z.ZodString;
2028
+ cols: z.ZodInt;
2029
+ rows: z.ZodInt;
2030
+ }, z.core.$strict>;
2031
+ readonly ExecPtyResizeResult: z.ZodObject<{
2032
+ cols: z.ZodInt;
2033
+ rows: z.ZodInt;
2034
+ }, z.core.$strict>;
2035
+ readonly ExecPtySignalParams: z.ZodObject<{
2036
+ resource_id: z.ZodString;
2037
+ signal: z.ZodEnum<{
2038
+ SIGINT: "SIGINT";
2039
+ SIGTERM: "SIGTERM";
2040
+ SIGKILL: "SIGKILL";
2041
+ SIGHUP: "SIGHUP";
2042
+ SIGQUIT: "SIGQUIT";
2043
+ SIGTSTP: "SIGTSTP";
2044
+ SIGCONT: "SIGCONT";
2045
+ SIGUSR1: "SIGUSR1";
2046
+ SIGUSR2: "SIGUSR2";
2047
+ }>;
2048
+ }, z.core.$strict>;
2049
+ readonly ExecPtySignalResult: z.ZodObject<{
2050
+ delivered: z.ZodBoolean;
2051
+ }, z.core.$strict>;
2052
+ readonly ExecPtyKillParams: z.ZodObject<{
2053
+ resource_id: z.ZodString;
2054
+ grace_ms: z.ZodDefault<z.ZodInt>;
2055
+ }, z.core.$strict>;
2056
+ readonly ExecPtyKillResult: z.ZodObject<{
2057
+ exit_code: z.ZodNullable<z.ZodInt>;
2058
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2059
+ SIGINT: "SIGINT";
2060
+ SIGTERM: "SIGTERM";
2061
+ SIGKILL: "SIGKILL";
2062
+ SIGHUP: "SIGHUP";
2063
+ SIGQUIT: "SIGQUIT";
2064
+ SIGTSTP: "SIGTSTP";
2065
+ SIGCONT: "SIGCONT";
2066
+ SIGUSR1: "SIGUSR1";
2067
+ SIGUSR2: "SIGUSR2";
2068
+ }>>;
2069
+ }, z.core.$strict>;
2070
+ readonly ExecListParams: z.ZodObject<{}, z.core.$strict>;
2071
+ readonly ExecListResult: z.ZodObject<{
2072
+ sessions: z.ZodArray<z.ZodObject<{
2073
+ resource_id: z.ZodString;
2074
+ pid: z.ZodInt;
2075
+ shell: z.ZodString;
2076
+ cwd: z.ZodString;
2077
+ title: z.ZodString;
2078
+ name: z.ZodNullable<z.ZodString>;
2079
+ cols: z.ZodInt;
2080
+ rows: z.ZodInt;
2081
+ state: z.ZodEnum<{
2082
+ running: "running";
2083
+ exited: "exited";
2084
+ }>;
2085
+ exit_code: z.ZodNullable<z.ZodInt>;
2086
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2087
+ SIGINT: "SIGINT";
2088
+ SIGTERM: "SIGTERM";
2089
+ SIGKILL: "SIGKILL";
2090
+ SIGHUP: "SIGHUP";
2091
+ SIGQUIT: "SIGQUIT";
2092
+ SIGTSTP: "SIGTSTP";
2093
+ SIGCONT: "SIGCONT";
2094
+ SIGUSR1: "SIGUSR1";
2095
+ SIGUSR2: "SIGUSR2";
2096
+ }>>;
2097
+ last_seq: z.ZodInt;
2098
+ created_at_ms: z.ZodInt;
2099
+ controller_client_id: z.ZodNullable<z.ZodString>;
2100
+ attached_clients: z.ZodInt;
2101
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2102
+ }, z.core.$strict>>;
2103
+ }, z.core.$strict>;
2104
+ readonly ExecRunParams: z.ZodObject<{
2105
+ command: z.ZodString;
2106
+ cwd: z.ZodOptional<z.ZodString>;
2107
+ cwd_key: z.ZodOptional<z.ZodString>;
2108
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2109
+ stdin: z.ZodOptional<z.ZodString>;
2110
+ timeout: z.ZodDefault<z.ZodInt>;
2111
+ max_output_bytes: z.ZodDefault<z.ZodInt>;
2112
+ }, z.core.$strict>;
2113
+ readonly ExecRunResult: z.ZodObject<{
2114
+ exit_code: z.ZodInt;
2115
+ stdout: z.ZodString;
2116
+ stderr: z.ZodString;
2117
+ cwd: z.ZodString;
2118
+ duration_ms: z.ZodInt;
2119
+ timed_out: z.ZodBoolean;
2120
+ output_truncated: z.ZodBoolean;
2121
+ }, z.core.$strict>;
2122
+ readonly ExecExitedEvent: z.ZodObject<{
2123
+ exit_code: z.ZodNullable<z.ZodInt>;
2124
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2125
+ SIGINT: "SIGINT";
2126
+ SIGTERM: "SIGTERM";
2127
+ SIGKILL: "SIGKILL";
2128
+ SIGHUP: "SIGHUP";
2129
+ SIGQUIT: "SIGQUIT";
2130
+ SIGTSTP: "SIGTSTP";
2131
+ SIGCONT: "SIGCONT";
2132
+ SIGUSR1: "SIGUSR1";
2133
+ SIGUSR2: "SIGUSR2";
2134
+ }>>;
2135
+ }, z.core.$strict>;
2136
+ readonly ExecTitleEvent: z.ZodObject<{
2137
+ title: z.ZodString;
2138
+ }, z.core.$strict>;
2139
+ readonly ExecCwdEvent: z.ZodObject<{
2140
+ cwd: z.ZodString;
2141
+ }, z.core.$strict>;
2142
+ readonly SessionAttachParams: z.ZodObject<{
2143
+ resource_id: z.ZodString;
2144
+ mode: z.ZodDefault<z.ZodEnum<{
2145
+ control: "control";
2146
+ read_only: "read_only";
2147
+ }>>;
2148
+ since_seq: z.ZodOptional<z.ZodInt>;
2149
+ window_bytes: z.ZodOptional<z.ZodInt>;
2150
+ }, z.core.$strict>;
2151
+ readonly ResourceInfo: z.ZodDiscriminatedUnion<[z.ZodObject<{
2152
+ kind: z.ZodLiteral<"pty">;
2153
+ pty: z.ZodObject<{
2154
+ resource_id: z.ZodString;
2155
+ pid: z.ZodInt;
2156
+ shell: z.ZodString;
2157
+ cwd: z.ZodString;
2158
+ title: z.ZodString;
2159
+ name: z.ZodNullable<z.ZodString>;
2160
+ cols: z.ZodInt;
2161
+ rows: z.ZodInt;
2162
+ state: z.ZodEnum<{
2163
+ running: "running";
2164
+ exited: "exited";
2165
+ }>;
2166
+ exit_code: z.ZodNullable<z.ZodInt>;
2167
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2168
+ SIGINT: "SIGINT";
2169
+ SIGTERM: "SIGTERM";
2170
+ SIGKILL: "SIGKILL";
2171
+ SIGHUP: "SIGHUP";
2172
+ SIGQUIT: "SIGQUIT";
2173
+ SIGTSTP: "SIGTSTP";
2174
+ SIGCONT: "SIGCONT";
2175
+ SIGUSR1: "SIGUSR1";
2176
+ SIGUSR2: "SIGUSR2";
2177
+ }>>;
2178
+ last_seq: z.ZodInt;
2179
+ created_at_ms: z.ZodInt;
2180
+ controller_client_id: z.ZodNullable<z.ZodString>;
2181
+ attached_clients: z.ZodInt;
2182
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2183
+ }, z.core.$strict>;
2184
+ }, z.core.$strict>, z.ZodObject<{
2185
+ kind: z.ZodLiteral<"watch">;
2186
+ resource_id: z.ZodString;
2187
+ path: z.ZodString;
2188
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2189
+ }, z.core.$strict>], "kind">;
2190
+ readonly SessionDetachParams: z.ZodObject<{
2191
+ resource_id: z.ZodString;
2192
+ }, z.core.$strict>;
2193
+ readonly SessionDetachResult: z.ZodObject<{
2194
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2195
+ }, z.core.$strict>;
2196
+ readonly SessionReleaseParams: z.ZodObject<{
2197
+ resource_id: z.ZodString;
2198
+ }, z.core.$strict>;
2199
+ readonly SessionReleaseResult: z.ZodObject<{
2200
+ released: z.ZodLiteral<true>;
2201
+ }, z.core.$strict>;
2202
+ readonly SessionListParams: z.ZodObject<{}, z.core.$strict>;
2203
+ readonly SessionListResult: z.ZodObject<{
2204
+ resources: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2205
+ kind: z.ZodLiteral<"pty">;
2206
+ pty: z.ZodObject<{
2207
+ resource_id: z.ZodString;
2208
+ pid: z.ZodInt;
2209
+ shell: z.ZodString;
2210
+ cwd: z.ZodString;
2211
+ title: z.ZodString;
2212
+ name: z.ZodNullable<z.ZodString>;
2213
+ cols: z.ZodInt;
2214
+ rows: z.ZodInt;
2215
+ state: z.ZodEnum<{
2216
+ running: "running";
2217
+ exited: "exited";
2218
+ }>;
2219
+ exit_code: z.ZodNullable<z.ZodInt>;
2220
+ exit_signal: z.ZodNullable<z.ZodEnum<{
2221
+ SIGINT: "SIGINT";
2222
+ SIGTERM: "SIGTERM";
2223
+ SIGKILL: "SIGKILL";
2224
+ SIGHUP: "SIGHUP";
2225
+ SIGQUIT: "SIGQUIT";
2226
+ SIGTSTP: "SIGTSTP";
2227
+ SIGCONT: "SIGCONT";
2228
+ SIGUSR1: "SIGUSR1";
2229
+ SIGUSR2: "SIGUSR2";
2230
+ }>>;
2231
+ last_seq: z.ZodInt;
2232
+ created_at_ms: z.ZodInt;
2233
+ controller_client_id: z.ZodNullable<z.ZodString>;
2234
+ attached_clients: z.ZodInt;
2235
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2236
+ }, z.core.$strict>;
2237
+ }, z.core.$strict>, z.ZodObject<{
2238
+ kind: z.ZodLiteral<"watch">;
2239
+ resource_id: z.ZodString;
2240
+ path: z.ZodString;
2241
+ orphan_expires_at_ms: z.ZodNullable<z.ZodInt>;
2242
+ }, z.core.$strict>], "kind">>;
2243
+ }, z.core.$strict>;
2244
+ readonly SessionControlChangedEvent: z.ZodObject<{
2245
+ controller_client_id: z.ZodNullable<z.ZodString>;
2246
+ your_mode: z.ZodEnum<{
2247
+ control: "control";
2248
+ read_only: "read_only";
2249
+ }>;
2250
+ }, z.core.$strict>;
2251
+ readonly RelayDeviceStatusEvent: z.ZodObject<{
2252
+ online: z.ZodBoolean;
2253
+ since_ms: z.ZodInt;
2254
+ app_version: z.ZodNullable<z.ZodString>;
2255
+ protocol_version: z.ZodNullable<z.ZodString>;
2256
+ }, z.core.$strict>;
2257
+ readonly RelayAuthExpiringEvent: z.ZodObject<{
2258
+ expires_at_ms: z.ZodInt;
2259
+ }, z.core.$strict>;
2260
+ readonly RelayCallRequest: z.ZodObject<{
2261
+ cap: z.ZodString;
2262
+ op: z.ZodString;
2263
+ params: z.ZodUnknown;
2264
+ timeout_ms: z.ZodDefault<z.ZodInt>;
2265
+ }, z.core.$strict>;
2266
+ readonly RelayCallResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
2267
+ ok: z.ZodLiteral<true>;
2268
+ result: z.ZodUnknown;
2269
+ }, z.core.$strict>, z.ZodObject<{
2270
+ ok: z.ZodLiteral<false>;
2271
+ error: z.ZodObject<{
2272
+ code: z.ZodEnum<{
2273
+ AUTH_REQUIRED: "AUTH_REQUIRED";
2274
+ AUTH_INVALID: "AUTH_INVALID";
2275
+ AUTH_EXPIRED: "AUTH_EXPIRED";
2276
+ AUTH_FORBIDDEN: "AUTH_FORBIDDEN";
2277
+ AUTH_DEVICE_REVOKED: "AUTH_DEVICE_REVOKED";
2278
+ PERMISSION_DENIED_OS: "PERMISSION_DENIED_OS";
2279
+ NOT_FOUND: "NOT_FOUND";
2280
+ CONFLICT: "CONFLICT";
2281
+ INVALID_PARAMS: "INVALID_PARAMS";
2282
+ RESOURCE_BUSY: "RESOURCE_BUSY";
2283
+ RESOURCE_GONE: "RESOURCE_GONE";
2284
+ CANCELLED: "CANCELLED";
2285
+ TIMEOUT: "TIMEOUT";
2286
+ PLATFORM_UNSUPPORTED: "PLATFORM_UNSUPPORTED";
2287
+ RATE_LIMITED: "RATE_LIMITED";
2288
+ INTERNAL: "INTERNAL";
2289
+ PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
2290
+ PROTOCOL_ERROR: "PROTOCOL_ERROR";
2291
+ UNKNOWN_OPERATION: "UNKNOWN_OPERATION";
2292
+ DEVICE_OFFLINE: "DEVICE_OFFLINE";
2293
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
2294
+ }>;
2295
+ message: z.ZodString;
2296
+ retryable: z.ZodBoolean;
2297
+ data: z.ZodOptional<z.ZodObject<{
2298
+ reason: z.ZodOptional<z.ZodEnum<{
2299
+ not_a_directory: "not_a_directory";
2300
+ is_a_directory: "is_a_directory";
2301
+ directory_not_empty: "directory_not_empty";
2302
+ already_exists: "already_exists";
2303
+ stale_write: "stale_write";
2304
+ binary_content: "binary_content";
2305
+ not_utf8_boundary: "not_utf8_boundary";
2306
+ patch_no_match: "patch_no_match";
2307
+ patch_ambiguous: "patch_ambiguous";
2308
+ resource_exited: "resource_exited";
2309
+ resource_expired: "resource_expired";
2310
+ control_taken: "control_taken";
2311
+ window_exhausted: "window_exhausted";
2312
+ }>>;
2313
+ cap: z.ZodOptional<z.ZodString>;
2314
+ op: z.ZodOptional<z.ZodString>;
2315
+ path: z.ZodOptional<z.ZodString>;
2316
+ settings_url: z.ZodOptional<z.ZodString>;
2317
+ retry_after_ms: z.ZodOptional<z.ZodInt>;
2318
+ limit_bytes: z.ZodOptional<z.ZodInt>;
2319
+ upgrade: z.ZodOptional<z.ZodObject<{
2320
+ min_version: z.ZodString;
2321
+ max_version: z.ZodString;
2322
+ download_url: z.ZodOptional<z.ZodURL>;
2323
+ }, z.core.$strict>>;
2324
+ }, z.core.$strict>>;
2325
+ }, z.core.$strict>;
2326
+ }, z.core.$strict>], "ok">;
2327
+ };
2328
+ type NamedSchemaId = keyof typeof NAMED_SCHEMAS;
2329
+
2330
+ export { StreamMsg as A, ClientType as C, DesktopProtocolError as D, EndReason as E, HelloMsg as H, Limits as L, NAMED_SCHEMAS as N, type OpName as O, PING_TEXT as P, RelayMsg as R, StreamMeta as S, Welcome as W, type OpParams as a, type OpResult as b, OPS as c, EVENTS as d, CancelMsg as e, ClientToCoreMsg as f, CloseCode as g, CoreToClientMsg as h, isDesktopProtocolError as i, CreditMsg as j, EndMsg as k, ErrorCode as l, type ErrorCodeName as m, type ErrorData as n, ErrorMsg as o, ErrorReason as p, type ErrorReasonName as q, EventMsg as r, type EventName as s, type NamedSchemaId as t, OpDescriptor as u, type OpSpec as v, PONG_TEXT as w, ProtocolErrorBody as x, RequestMsg as y, ResponseMsg as z };