@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.
package/dist/index.cjs ADDED
@@ -0,0 +1,876 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ AbsPath: () => AbsPath,
24
+ CancelMsg: () => CancelMsg,
25
+ ClientToCoreMsg: () => ClientToCoreMsg,
26
+ ClientType: () => ClientType,
27
+ CloseCode: () => CloseCode,
28
+ CoreToClientMsg: () => CoreToClientMsg,
29
+ CreditMsg: () => CreditMsg,
30
+ DEFAULT_MAX_FRAME_PAYLOAD_BYTES: () => DEFAULT_MAX_FRAME_PAYLOAD_BYTES,
31
+ DEFAULT_MAX_MESSAGE_BYTES: () => DEFAULT_MAX_MESSAGE_BYTES,
32
+ DEFAULT_WINDOW_BYTES: () => DEFAULT_WINDOW_BYTES,
33
+ DesktopProtocolError: () => DesktopProtocolError,
34
+ DeviceId: () => DeviceId,
35
+ EVENTS: () => EVENTS,
36
+ EndMsg: () => EndMsg,
37
+ EndReason: () => EndReason,
38
+ ErrorCode: () => ErrorCode,
39
+ ErrorMsg: () => ErrorMsg,
40
+ ErrorReason: () => ErrorReason,
41
+ EventMsg: () => EventMsg,
42
+ ExecCwdEvent: () => ExecCwdEvent,
43
+ ExecExitedEvent: () => ExecExitedEvent,
44
+ ExecListParams: () => ExecListParams,
45
+ ExecListResult: () => ExecListResult,
46
+ ExecPtyKillParams: () => ExecPtyKillParams,
47
+ ExecPtyKillResult: () => ExecPtyKillResult,
48
+ ExecPtyResizeParams: () => ExecPtyResizeParams,
49
+ ExecPtyResizeResult: () => ExecPtyResizeResult,
50
+ ExecPtySignalParams: () => ExecPtySignalParams,
51
+ ExecPtySignalResult: () => ExecPtySignalResult,
52
+ ExecPtyStartParams: () => ExecPtyStartParams,
53
+ ExecPtyStartResult: () => ExecPtyStartResult,
54
+ ExecPtyWriteParams: () => ExecPtyWriteParams,
55
+ ExecPtyWriteResult: () => ExecPtyWriteResult,
56
+ ExecRunParams: () => ExecRunParams,
57
+ ExecRunResult: () => ExecRunResult,
58
+ ExecTitleEvent: () => ExecTitleEvent,
59
+ FRAME_HEADER_BYTES: () => FRAME_HEADER_BYTES,
60
+ FRAME_STRUCT_FORMAT: () => FRAME_STRUCT_FORMAT,
61
+ FRAME_VERSION: () => FRAME_VERSION,
62
+ FrameChannel: () => FrameChannel,
63
+ FrameFlag: () => FrameFlag,
64
+ FrameHeader: () => FrameHeader,
65
+ FsChange: () => FsChange,
66
+ FsChangedEvent: () => FsChangedEvent,
67
+ FsDeleteParams: () => FsDeleteParams,
68
+ FsDeleteResult: () => FsDeleteResult,
69
+ FsEncoding: () => FsEncoding,
70
+ FsEntry: () => FsEntry,
71
+ FsKind: () => FsKind,
72
+ FsListParams: () => FsListParams,
73
+ FsListResult: () => FsListResult,
74
+ FsMkdirParams: () => FsMkdirParams,
75
+ FsMkdirResult: () => FsMkdirResult,
76
+ FsMoveParams: () => FsMoveParams,
77
+ FsMoveResult: () => FsMoveResult,
78
+ FsPatchParams: () => FsPatchParams,
79
+ FsPatchResult: () => FsPatchResult,
80
+ FsReadParams: () => FsReadParams,
81
+ FsReadResult: () => FsReadResult,
82
+ FsReadStreamParams: () => FsReadStreamParams,
83
+ FsReadStreamResult: () => FsReadStreamResult,
84
+ FsSearchContentParams: () => FsSearchContentParams,
85
+ FsSearchContentResult: () => FsSearchContentResult,
86
+ FsSearchPathsParams: () => FsSearchPathsParams,
87
+ FsSearchPathsResult: () => FsSearchPathsResult,
88
+ FsStatParams: () => FsStatParams,
89
+ FsStatResult: () => FsStatResult,
90
+ FsWatchParams: () => FsWatchParams,
91
+ FsWatchResult: () => FsWatchResult,
92
+ FsWriteParams: () => FsWriteParams,
93
+ FsWriteResult: () => FsWriteResult,
94
+ HelloMsg: () => HelloMsg,
95
+ Limits: () => Limits,
96
+ NAMED_SCHEMAS: () => NAMED_SCHEMAS,
97
+ OPS: () => OPS,
98
+ OpDescriptor: () => OpDescriptor,
99
+ OsPermissionName: () => OsPermissionName,
100
+ PING_TEXT: () => PING_TEXT,
101
+ PONG_TEXT: () => PONG_TEXT,
102
+ PROTOCOL_MAJOR: () => PROTOCOL_MAJOR,
103
+ PROTOCOL_MINOR: () => PROTOCOL_MINOR,
104
+ ProtocolErrorBody: () => ProtocolErrorBody,
105
+ ProtocolVersion: () => ProtocolVersion,
106
+ PtyInfo: () => PtyInfo,
107
+ RelayAuthExpiringEvent: () => RelayAuthExpiringEvent,
108
+ RelayCallRequest: () => RelayCallRequest,
109
+ RelayCallResponse: () => RelayCallResponse,
110
+ RelayDeviceStatusEvent: () => RelayDeviceStatusEvent,
111
+ RelayMsg: () => RelayMsg,
112
+ RelayStatusResponse: () => RelayStatusResponse,
113
+ RequestId: () => RequestId,
114
+ RequestMsg: () => RequestMsg,
115
+ ResourceId: () => ResourceId,
116
+ ResourceInfo: () => ResourceInfo,
117
+ ResponseMsg: () => ResponseMsg,
118
+ SessionAttachParams: () => SessionAttachParams,
119
+ SessionAttachResult: () => SessionAttachResult,
120
+ SessionControlChangedEvent: () => SessionControlChangedEvent,
121
+ SessionDetachParams: () => SessionDetachParams,
122
+ SessionDetachResult: () => SessionDetachResult,
123
+ SessionListParams: () => SessionListParams,
124
+ SessionListResult: () => SessionListResult,
125
+ SessionReleaseParams: () => SessionReleaseParams,
126
+ SessionReleaseResult: () => SessionReleaseResult,
127
+ Signal: () => Signal,
128
+ StreamMeta: () => StreamMeta,
129
+ StreamMsg: () => StreamMsg,
130
+ SysinfoGetParams: () => SysinfoGetParams,
131
+ SysinfoGetResult: () => SysinfoGetResult,
132
+ Welcome: () => Welcome,
133
+ assertFrameHeader: () => assertFrameHeader,
134
+ decodeFrame: () => decodeFrame,
135
+ encodeFrame: () => encodeFrame,
136
+ epochMs: () => epochMs,
137
+ hasFlag: () => hasFlag,
138
+ isDesktopProtocolError: () => isDesktopProtocolError,
139
+ nonNegInt: () => nonNegInt,
140
+ readCid: () => readCid,
141
+ stampCid: () => stampCid,
142
+ u32: () => u32
143
+ });
144
+ module.exports = __toCommonJS(src_exports);
145
+
146
+ // src/schema/primitives.ts
147
+ var import_zod = require("zod");
148
+ var PROTOCOL_MAJOR = 1;
149
+ var PROTOCOL_MINOR = 0;
150
+ var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
151
+ var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
152
+ var ResourceId = import_zod.z.string().regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);
153
+ var DeviceId = import_zod.z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/);
154
+ var AbsPath = import_zod.z.string().min(1).max(4096).regex(/^(\/|[A-Za-z]:\/)[^\\\u0000]*$/);
155
+ var u32 = import_zod.z.int().min(0).max(4294967295);
156
+ var nonNegInt = import_zod.z.int().min(0);
157
+ var epochMs = import_zod.z.int().min(0);
158
+
159
+ // src/schema/errors.ts
160
+ var import_zod2 = require("zod");
161
+ var ErrorCode = import_zod2.z.enum([
162
+ "AUTH_REQUIRED",
163
+ "AUTH_INVALID",
164
+ "AUTH_EXPIRED",
165
+ "AUTH_FORBIDDEN",
166
+ // signed in, but not this device's owner
167
+ "AUTH_DEVICE_REVOKED",
168
+ // kill switch
169
+ "PERMISSION_DENIED_OS",
170
+ "NOT_FOUND",
171
+ "CONFLICT",
172
+ "INVALID_PARAMS",
173
+ "RESOURCE_BUSY",
174
+ "RESOURCE_GONE",
175
+ "CANCELLED",
176
+ "TIMEOUT",
177
+ "PLATFORM_UNSUPPORTED",
178
+ "RATE_LIMITED",
179
+ "INTERNAL",
180
+ "PROTOCOL_VERSION_UNSUPPORTED",
181
+ // NEW: hello refused, carries data.upgrade
182
+ "PROTOCOL_ERROR",
183
+ // NEW: malformed envelope/frame, credit overrun, unknown sid
184
+ "UNKNOWN_OPERATION",
185
+ // NEW: cap.op not served by this core version
186
+ "DEVICE_OFFLINE",
187
+ // NEW: relay has no live device socket (retryable)
188
+ "PAYLOAD_TOO_LARGE"
189
+ // NEW: message or frame above limits.max_*_bytes
190
+ ]);
191
+ var ErrorReason = import_zod2.z.enum([
192
+ "not_a_directory",
193
+ "is_a_directory",
194
+ "directory_not_empty",
195
+ "already_exists",
196
+ "stale_write",
197
+ // fs.write if_match_mtime_ms mismatch → CONFLICT
198
+ "binary_content",
199
+ // utf8 read of non-UTF-8 bytes → INVALID_PARAMS
200
+ "not_utf8_boundary",
201
+ "patch_no_match",
202
+ "patch_ambiguous",
203
+ "resource_exited",
204
+ "resource_expired",
205
+ "control_taken",
206
+ // another client of the same user took control
207
+ "window_exhausted"
208
+ ]);
209
+ var ProtocolErrorBody = import_zod2.z.strictObject({
210
+ code: ErrorCode,
211
+ message: import_zod2.z.string().max(300),
212
+ // short, human, never a stack trace or a token
213
+ retryable: import_zod2.z.boolean(),
214
+ data: import_zod2.z.strictObject({
215
+ reason: ErrorReason.optional(),
216
+ cap: import_zod2.z.string().max(32).optional(),
217
+ op: import_zod2.z.string().max(64).optional(),
218
+ path: AbsPath.optional(),
219
+ settings_url: import_zod2.z.string().max(512).optional(),
220
+ // PERMISSION_DENIED_OS deep link
221
+ retry_after_ms: nonNegInt.optional(),
222
+ limit_bytes: nonNegInt.optional(),
223
+ upgrade: import_zod2.z.strictObject({
224
+ min_version: ProtocolVersion,
225
+ max_version: ProtocolVersion,
226
+ download_url: import_zod2.z.url().optional()
227
+ }).optional()
228
+ }).optional()
229
+ });
230
+
231
+ // src/schema/frame.ts
232
+ var import_zod3 = require("zod");
233
+
234
+ // src/error.ts
235
+ var DesktopProtocolError = class extends Error {
236
+ code;
237
+ retryable;
238
+ data;
239
+ constructor(code, message, options = {}) {
240
+ super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
241
+ this.name = "DesktopProtocolError";
242
+ this.code = code;
243
+ this.retryable = options.retryable ?? false;
244
+ this.data = options.data;
245
+ }
246
+ /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
247
+ toBody() {
248
+ return this.data === void 0 ? { code: this.code, message: this.message, retryable: this.retryable } : { code: this.code, message: this.message, retryable: this.retryable, data: this.data };
249
+ }
250
+ };
251
+ function isDesktopProtocolError(value) {
252
+ return value instanceof DesktopProtocolError || value instanceof Error && value.name === "DesktopProtocolError" && "code" in value;
253
+ }
254
+
255
+ // src/frame.ts
256
+ var FRAME_HEADER_BYTES = 16;
257
+ var FRAME_VERSION = 1;
258
+ var FRAME_STRUCT_FORMAT = ">BBBBIII";
259
+ var FrameFlag = { FIN: 1, REPLAY: 2 };
260
+ var FrameChannel = {
261
+ /** core→client: pty output, fs.read_stream bytes */
262
+ DATA: 0,
263
+ /** core→client: stderr of a non-pty process (reserved for exec.spawn in v1.1) */
264
+ STDERR: 1,
265
+ /** client→core: keystrokes / stdin to sid */
266
+ STDIN: 2,
267
+ /** core→client: serialized terminal screen (attach when since_seq is outside the ring) */
268
+ SNAPSHOT: 3,
269
+ /** relay↔device hop only: a JSON envelope carried inside a binary frame so the relay can route
270
+ * by cid without parsing JSON. Never seen by clients. */
271
+ ENVELOPE: 255
272
+ };
273
+ var U32_MAX = 4294967295;
274
+ var CHANNELS = new Set(Object.values(FrameChannel));
275
+ function frameError(message) {
276
+ return new DesktopProtocolError("PROTOCOL_ERROR", message);
277
+ }
278
+ function checkU32(name, value) {
279
+ if (!Number.isInteger(value) || value < 0 || value > U32_MAX) throw frameError(`frame ${name} is not a u32: ${value}`);
280
+ }
281
+ function assertFrameHeader(h) {
282
+ if (h.version !== FRAME_VERSION) throw frameError(`unsupported frame version ${String(h.version)}`);
283
+ if (!Number.isInteger(h.flags) || h.flags < 0 || h.flags > 3) throw frameError(`reserved frame flag bits set: ${h.flags}`);
284
+ if (!CHANNELS.has(h.channel)) throw frameError(`unknown frame channel ${String(h.channel)}`);
285
+ checkU32("cid", h.cid);
286
+ checkU32("sid", h.sid);
287
+ checkU32("seq", h.seq);
288
+ }
289
+ function encodeFrame(h, payload) {
290
+ assertFrameHeader(h);
291
+ const out = new Uint8Array(FRAME_HEADER_BYTES + payload.byteLength);
292
+ const v = new DataView(out.buffer);
293
+ v.setUint8(0, h.version);
294
+ v.setUint8(1, h.flags);
295
+ v.setUint8(2, h.channel);
296
+ v.setUint8(3, 0);
297
+ v.setUint32(4, h.cid);
298
+ v.setUint32(8, h.sid);
299
+ v.setUint32(12, h.seq);
300
+ out.set(payload, FRAME_HEADER_BYTES);
301
+ return out;
302
+ }
303
+ function decodeFrame(buf) {
304
+ const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
305
+ if (bytes.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${bytes.byteLength} bytes`);
306
+ const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
307
+ if (v.getUint8(3) !== 0) throw frameError("reserved frame byte 3 is not 0");
308
+ const header = {
309
+ version: v.getUint8(0),
310
+ flags: v.getUint8(1),
311
+ channel: v.getUint8(2),
312
+ cid: v.getUint32(4),
313
+ sid: v.getUint32(8),
314
+ seq: v.getUint32(12)
315
+ };
316
+ assertFrameHeader(header);
317
+ return { header, payload: bytes.subarray(FRAME_HEADER_BYTES) };
318
+ }
319
+ function readCid(frame) {
320
+ if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
321
+ return new DataView(frame.buffer, frame.byteOffset, frame.byteLength).getUint32(4);
322
+ }
323
+ function stampCid(frame, cid) {
324
+ if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
325
+ checkU32("cid", cid);
326
+ new DataView(frame.buffer, frame.byteOffset, frame.byteLength).setUint32(4, cid);
327
+ return frame;
328
+ }
329
+ function hasFlag(header, flag) {
330
+ return (header.flags & flag) !== 0;
331
+ }
332
+
333
+ // src/schema/frame.ts
334
+ var FrameHeader = import_zod3.z.strictObject({
335
+ version: import_zod3.z.literal(FRAME_VERSION),
336
+ flags: import_zod3.z.int().min(0).max(3),
337
+ channel: import_zod3.z.union([import_zod3.z.literal(0), import_zod3.z.literal(1), import_zod3.z.literal(2), import_zod3.z.literal(3), import_zod3.z.literal(255)]),
338
+ cid: u32,
339
+ sid: u32,
340
+ seq: u32
341
+ });
342
+ var DEFAULT_WINDOW_BYTES = 262144;
343
+ var DEFAULT_MAX_FRAME_PAYLOAD_BYTES = 65536;
344
+ var DEFAULT_MAX_MESSAGE_BYTES = 8388608;
345
+
346
+ // src/schema/envelope.ts
347
+ var import_zod4 = require("zod");
348
+ var ClientType = import_zod4.z.enum(["screen", "web", "extension", "server", "test"]);
349
+ var Limits = import_zod4.z.strictObject({
350
+ max_message_bytes: import_zod4.z.int().min(65536),
351
+ max_frame_payload_bytes: import_zod4.z.int().min(4096),
352
+ default_window_bytes: import_zod4.z.int().min(4096),
353
+ max_streams_per_client: import_zod4.z.int().min(1),
354
+ max_resources_per_user: import_zod4.z.int().min(1)
355
+ });
356
+ var OpDescriptor = import_zod4.z.strictObject({ cap: import_zod4.z.string().max(32), op: import_zod4.z.string().max(64), since: ProtocolVersion });
357
+ var Welcome = import_zod4.z.strictObject({
358
+ protocol_version: ProtocolVersion,
359
+ // negotiated = min(client, core) within the same major
360
+ session_id: import_zod4.z.string().min(8).max(64),
361
+ client_id: import_zod4.z.string().min(8).max(64),
362
+ // this connection's identity in the Session Manager
363
+ device_id: DeviceId,
364
+ device_name: import_zod4.z.string().max(128),
365
+ app_version: import_zod4.z.string().max(32),
366
+ platform: import_zod4.z.enum(["darwin", "win32", "linux"]),
367
+ ops: import_zod4.z.array(OpDescriptor),
368
+ limits: Limits,
369
+ server_time_ms: epochMs
370
+ });
371
+ var HelloMsg = import_zod4.z.strictObject({
372
+ type: import_zod4.z.literal("hello"),
373
+ id: RequestId,
374
+ // answered by response{id, result: Welcome} or error{id}
375
+ protocolVersion: ProtocolVersion,
376
+ clientType: ClientType,
377
+ clientVersion: import_zod4.z.string().min(1).max(32)
378
+ });
379
+ var RequestMsg = import_zod4.z.strictObject({
380
+ id: RequestId,
381
+ type: import_zod4.z.literal("request"),
382
+ cap: import_zod4.z.string().min(1).max(32),
383
+ op: import_zod4.z.string().min(1).max(64),
384
+ params: import_zod4.z.unknown()
385
+ // validated by the Router against OPS[cap.op].params — once, there
386
+ });
387
+ var ResponseMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("response"), result: import_zod4.z.unknown() });
388
+ var ErrorMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("error"), error: ProtocolErrorBody });
389
+ var StreamMeta = import_zod4.z.discriminatedUnion("kind", [
390
+ /** Binds request id → numeric sid; binary frames for this stream follow. */
391
+ import_zod4.z.strictObject({
392
+ kind: import_zod4.z.literal("open"),
393
+ sid: u32,
394
+ window_bytes: import_zod4.z.int().min(4096),
395
+ resource_id: ResourceId.optional()
396
+ }),
397
+ /** Frames after this (channel SNAPSHOT) are a serialized screen; live DATA resumes after. */
398
+ import_zod4.z.strictObject({ kind: import_zod4.z.literal("snapshot"), cols: import_zod4.z.int().min(1), rows: import_zod4.z.int().min(1) }),
399
+ /** Frames [from_seq, to_seq] are gone from the ring; a snapshot follows. */
400
+ import_zod4.z.strictObject({ kind: import_zod4.z.literal("gap"), from_seq: u32, to_seq: u32 })
401
+ ]);
402
+ var StreamMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("stream"), seq: u32, meta: StreamMeta });
403
+ var EndReason = import_zod4.z.enum(["completed", "cancelled", "detached", "resource_exited", "error"]);
404
+ var EndMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("end"), seq: u32, reason: EndReason.optional() });
405
+ var CancelMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("cancel") });
406
+ var CreditMsg = import_zod4.z.strictObject({ id: RequestId, type: import_zod4.z.literal("credit"), n: import_zod4.z.int().min(1).max(2147483647) });
407
+ var EventMsg = import_zod4.z.strictObject({
408
+ type: import_zod4.z.literal("event"),
409
+ cap: import_zod4.z.string().min(1).max(32),
410
+ name: import_zod4.z.string().min(1).max(64),
411
+ payload: import_zod4.z.unknown(),
412
+ // validated against EVENTS[cap.name]
413
+ resourceId: ResourceId.optional()
414
+ });
415
+ var RelayMsg = import_zod4.z.discriminatedUnion("op", [
416
+ /** Fresh access token before the current one expires (relay closes 4008 at exp + 60 s). */
417
+ import_zod4.z.strictObject({ type: import_zod4.z.literal("relay"), op: import_zod4.z.literal("reauth"), token: import_zod4.z.string().min(16).max(8192) })
418
+ ]);
419
+ var PING_TEXT = '{"type":"ping"}';
420
+ var PONG_TEXT = '{"type":"pong"}';
421
+ var ClientToCoreMsg = import_zod4.z.discriminatedUnion("type", [HelloMsg, RequestMsg, CancelMsg, CreditMsg]);
422
+ var CoreToClientMsg = import_zod4.z.discriminatedUnion("type", [ResponseMsg, ErrorMsg, StreamMsg, EndMsg, CreditMsg, EventMsg]);
423
+ var CloseCode = {
424
+ NORMAL: 1e3,
425
+ GOING_AWAY: 1001,
426
+ // relay deploy / app quit — reconnect immediately
427
+ AUTH_INVALID: 4001,
428
+ AUTH_FORBIDDEN: 4003,
429
+ DEVICE_NOT_FOUND: 4004,
430
+ AUTH_EXPIRED: 4008,
431
+ // no reauth before exp + 60 s
432
+ REPLACED: 4009,
433
+ // a newer device socket for the same device took over
434
+ DEVICE_REVOKED: 4010,
435
+ // kill switch — do NOT reconnect
436
+ PROTOCOL_ERROR: 4400,
437
+ UPGRADE_REQUIRED: 4426
438
+ };
439
+
440
+ // src/schema/sysinfo.ts
441
+ var import_zod5 = require("zod");
442
+ var OsPermissionName = import_zod5.z.enum([
443
+ "full_disk_access",
444
+ "accessibility",
445
+ "screen_recording",
446
+ "microphone",
447
+ "camera",
448
+ "automation",
449
+ "contacts",
450
+ "calendars",
451
+ "photos",
452
+ "location",
453
+ "local_network",
454
+ "bluetooth",
455
+ "notifications"
456
+ ]);
457
+ var SysinfoGetParams = import_zod5.z.strictObject({});
458
+ var SysinfoGetResult = import_zod5.z.strictObject({
459
+ device_id: DeviceId,
460
+ device_name: import_zod5.z.string().max(128),
461
+ hostname: import_zod5.z.string().max(255),
462
+ platform: import_zod5.z.enum(["darwin", "win32", "linux"]),
463
+ os_version: import_zod5.z.string().max(64),
464
+ arch: import_zod5.z.enum(["arm64", "x64"]),
465
+ app_version: import_zod5.z.string().max(32),
466
+ protocol_version: ProtocolVersion,
467
+ user: import_zod5.z.strictObject({ username: import_zod5.z.string().max(128), shell: import_zod5.z.string().max(512) }),
468
+ paths: import_zod5.z.strictObject({
469
+ home: AbsPath,
470
+ desktop: AbsPath,
471
+ documents: AbsPath,
472
+ downloads: AbsPath,
473
+ app_data: AbsPath,
474
+ temp: AbsPath
475
+ }),
476
+ cpu: import_zod5.z.strictObject({ model: import_zod5.z.string().max(128), cores: import_zod5.z.int().min(1) }),
477
+ memory: import_zod5.z.strictObject({ total_bytes: nonNegInt, free_bytes: nonNegInt }),
478
+ uptime_seconds: nonNegInt,
479
+ on_battery: import_zod5.z.boolean().nullable(),
480
+ sleep_prevented: import_zod5.z.boolean(),
481
+ // true while any remote session holds the power blocker
482
+ permissions: import_zod5.z.array(
483
+ import_zod5.z.strictObject({
484
+ name: OsPermissionName,
485
+ state: import_zod5.z.enum(["granted", "denied", "not_determined", "not_applicable"]),
486
+ settings_url: import_zod5.z.string().max(512).nullable()
487
+ })
488
+ )
489
+ });
490
+
491
+ // src/schema/fs.ts
492
+ var import_zod6 = require("zod");
493
+ var FsKind = import_zod6.z.enum(["file", "dir", "symlink"]);
494
+ var FsEntry = import_zod6.z.strictObject({
495
+ name: import_zod6.z.string().max(1024),
496
+ path: AbsPath,
497
+ kind: FsKind,
498
+ size: nonNegInt,
499
+ mtime: import_zod6.z.number().min(0),
500
+ // seconds, float — daemon parity
501
+ mtime_ms: epochMs,
502
+ mode: import_zod6.z.int().min(0).max(4095),
503
+ target: AbsPath.nullable(),
504
+ // symlink target, never followed
505
+ hidden: import_zod6.z.boolean()
506
+ });
507
+ var FsListParams = import_zod6.z.strictObject({
508
+ path: AbsPath,
509
+ recursive: import_zod6.z.boolean().default(false),
510
+ depth: import_zod6.z.int().min(1).max(32).default(1),
511
+ pattern: import_zod6.z.string().max(256).optional(),
512
+ // glob on name
513
+ limit: import_zod6.z.int().min(1).max(5e3).default(500),
514
+ page_token: import_zod6.z.string().max(256).optional(),
515
+ show_hidden: import_zod6.z.boolean().default(false),
516
+ sort: import_zod6.z.enum(["name", "mtime", "size", "kind"]).default("kind")
517
+ });
518
+ var FsListResult = import_zod6.z.strictObject({
519
+ entries: import_zod6.z.array(FsEntry),
520
+ truncated: import_zod6.z.boolean(),
521
+ next_page_token: import_zod6.z.string().max(256).nullable(),
522
+ scanned: nonNegInt
523
+ });
524
+ var FsStatParams = import_zod6.z.strictObject({ path: AbsPath });
525
+ var FsStatResult = FsEntry;
526
+ var FsEncoding = import_zod6.z.enum(["utf8", "base64"]);
527
+ var FsReadParams = import_zod6.z.strictObject({
528
+ path: AbsPath,
529
+ encoding: FsEncoding.default("utf8"),
530
+ offset: nonNegInt.default(0),
531
+ limit: import_zod6.z.int().min(1).max(4194304).default(262144)
532
+ });
533
+ var FsReadResult = import_zod6.z.strictObject({
534
+ content: import_zod6.z.string(),
535
+ encoding: FsEncoding,
536
+ size: nonNegInt,
537
+ offset: nonNegInt,
538
+ next_offset: nonNegInt,
539
+ truncated: import_zod6.z.boolean(),
540
+ mime: import_zod6.z.string().max(128).nullable(),
541
+ mtime_ms: epochMs
542
+ // pass back as if_match_mtime_ms to guard a later write
543
+ });
544
+ var FsReadStreamParams = import_zod6.z.strictObject({
545
+ path: AbsPath,
546
+ offset: nonNegInt.default(0),
547
+ length: nonNegInt.optional(),
548
+ // absent = to EOF
549
+ window_bytes: import_zod6.z.int().min(4096).max(16777216).optional()
550
+ });
551
+ var FsReadStreamResult = import_zod6.z.strictObject({ size: nonNegInt, mime: import_zod6.z.string().max(128).nullable(), mtime_ms: epochMs });
552
+ var FsWriteParams = import_zod6.z.strictObject({
553
+ path: AbsPath,
554
+ content: import_zod6.z.string().max(5592406),
555
+ // ≤ 4 MiB of bytes after base64 decode
556
+ encoding: FsEncoding.default("utf8"),
557
+ mode: import_zod6.z.int().min(0).max(4095).optional(),
558
+ create_parents: import_zod6.z.boolean().default(false),
559
+ /** Optimistic concurrency: CONFLICT/stale_write if the file changed since this mtime. */
560
+ if_match_mtime_ms: epochMs.optional(),
561
+ /** Refuse to replace an existing file (CONFLICT/already_exists). */
562
+ exclusive: import_zod6.z.boolean().default(false)
563
+ });
564
+ var FsWriteResult = import_zod6.z.strictObject({ path: AbsPath, size: nonNegInt, mtime_ms: epochMs, created: import_zod6.z.boolean() });
565
+ var FsMkdirParams = import_zod6.z.strictObject({ path: AbsPath, parents: import_zod6.z.boolean().default(false) });
566
+ var FsMkdirResult = import_zod6.z.strictObject({ path: AbsPath, created: import_zod6.z.boolean() });
567
+ var FsMoveParams = import_zod6.z.strictObject({ from_path: AbsPath, to_path: AbsPath, overwrite: import_zod6.z.boolean().default(false) });
568
+ var FsMoveResult = import_zod6.z.strictObject({ from_path: AbsPath, to_path: AbsPath });
569
+ var FsDeleteParams = import_zod6.z.strictObject({
570
+ path: AbsPath,
571
+ recursive: import_zod6.z.boolean().default(false),
572
+ to_trash: import_zod6.z.boolean().default(true)
573
+ });
574
+ var FsDeleteResult = import_zod6.z.strictObject({ deleted: import_zod6.z.literal(true), trashed_to: AbsPath.nullable() });
575
+ var FsWatchParams = import_zod6.z.strictObject({
576
+ path: AbsPath,
577
+ recursive: import_zod6.z.boolean().default(false),
578
+ ignore: import_zod6.z.array(import_zod6.z.string().max(256)).max(64).default([]),
579
+ debounce_ms: import_zod6.z.int().min(0).max(5e3).default(50)
580
+ });
581
+ var FsWatchResult = import_zod6.z.strictObject({ resource_id: ResourceId, path: AbsPath });
582
+ var FsPatchParams = import_zod6.z.strictObject({
583
+ path: AbsPath,
584
+ edits: import_zod6.z.array(
585
+ import_zod6.z.strictObject({
586
+ old_text: import_zod6.z.string(),
587
+ new_text: import_zod6.z.string(),
588
+ replace_all: import_zod6.z.boolean().default(false)
589
+ })
590
+ ).min(1).max(256),
591
+ create_if_missing: import_zod6.z.boolean().default(false)
592
+ });
593
+ var FsPatchResult = import_zod6.z.strictObject({ path: AbsPath, applied: nonNegInt, size: nonNegInt, mtime_ms: epochMs });
594
+ var FsSearchPathsParams = import_zod6.z.strictObject({
595
+ pattern: import_zod6.z.string().min(1).max(512),
596
+ cwd: AbsPath,
597
+ hidden: import_zod6.z.boolean().default(false),
598
+ max_results: import_zod6.z.int().min(1).max(5e3).default(100)
599
+ });
600
+ var FsSearchPathsResult = import_zod6.z.strictObject({ paths: import_zod6.z.array(AbsPath), truncated: import_zod6.z.boolean() });
601
+ var FsSearchContentParams = import_zod6.z.strictObject({
602
+ query: import_zod6.z.string().min(1).max(1024),
603
+ cwd: AbsPath,
604
+ regex: import_zod6.z.boolean().default(true),
605
+ case_sensitive: import_zod6.z.boolean().default(false),
606
+ include: import_zod6.z.array(import_zod6.z.string().max(256)).max(64).optional(),
607
+ exclude: import_zod6.z.array(import_zod6.z.string().max(256)).max(64).optional(),
608
+ max_results: import_zod6.z.int().min(1).max(5e3).default(100)
609
+ });
610
+ var FsSearchContentResult = import_zod6.z.strictObject({
611
+ results: import_zod6.z.array(
612
+ import_zod6.z.strictObject({
613
+ path: AbsPath,
614
+ lines: import_zod6.z.string(),
615
+ line_number: import_zod6.z.int().min(1),
616
+ submatches: import_zod6.z.array(import_zod6.z.strictObject({ match: import_zod6.z.string(), start: nonNegInt, end: nonNegInt }))
617
+ })
618
+ ),
619
+ truncated: import_zod6.z.boolean()
620
+ });
621
+ var FsChange = import_zod6.z.strictObject({
622
+ type: import_zod6.z.enum(["created", "modified", "deleted", "moved"]),
623
+ path: AbsPath,
624
+ to_path: AbsPath.optional(),
625
+ kind: import_zod6.z.enum(["file", "dir", "symlink", "unknown"])
626
+ });
627
+ var FsChangedEvent = import_zod6.z.strictObject({ changes: import_zod6.z.array(FsChange).min(1).max(1e3), overflow: import_zod6.z.boolean() });
628
+
629
+ // src/schema/exec.ts
630
+ var import_zod7 = require("zod");
631
+ var Signal = import_zod7.z.enum(["SIGINT", "SIGTERM", "SIGKILL", "SIGHUP", "SIGQUIT", "SIGTSTP", "SIGCONT", "SIGUSR1", "SIGUSR2"]);
632
+ var cols = import_zod7.z.int().min(2).max(1e3);
633
+ var rows = import_zod7.z.int().min(1).max(500);
634
+ var ExecPtyStartParams = import_zod7.z.strictObject({
635
+ cols,
636
+ rows,
637
+ cwd: AbsPath.optional(),
638
+ // default: home
639
+ shell: import_zod7.z.string().max(512).optional(),
640
+ // default: user's login shell (PowerShell on Windows)
641
+ args: import_zod7.z.array(import_zod7.z.string().max(4096)).max(64).optional(),
642
+ env: import_zod7.z.record(import_zod7.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), import_zod7.z.string().max(32768)).optional(),
643
+ name: import_zod7.z.string().max(64).optional(),
644
+ // tab label
645
+ window_bytes: import_zod7.z.int().min(4096).max(16777216).optional()
646
+ });
647
+ var PtyInfo = import_zod7.z.strictObject({
648
+ resource_id: ResourceId,
649
+ pid: import_zod7.z.int().min(1),
650
+ shell: import_zod7.z.string().max(512),
651
+ cwd: AbsPath,
652
+ // live, from OSC 7 / process cwd
653
+ title: import_zod7.z.string().max(256),
654
+ name: import_zod7.z.string().max(64).nullable(),
655
+ cols,
656
+ rows,
657
+ state: import_zod7.z.enum(["running", "exited"]),
658
+ exit_code: import_zod7.z.int().nullable(),
659
+ exit_signal: Signal.nullable(),
660
+ last_seq: u32,
661
+ created_at_ms: epochMs,
662
+ controller_client_id: import_zod7.z.string().max(64).nullable(),
663
+ // null = orphaned (in grace period)
664
+ attached_clients: nonNegInt,
665
+ orphan_expires_at_ms: epochMs.nullable()
666
+ });
667
+ var ExecPtyStartResult = PtyInfo;
668
+ var ExecPtyWriteParams = import_zod7.z.strictObject({ resource_id: ResourceId, data: import_zod7.z.string().min(1).max(65536) });
669
+ var ExecPtyWriteResult = import_zod7.z.strictObject({ written: nonNegInt });
670
+ var ExecPtyResizeParams = import_zod7.z.strictObject({ resource_id: ResourceId, cols, rows });
671
+ var ExecPtyResizeResult = import_zod7.z.strictObject({ cols, rows });
672
+ var ExecPtySignalParams = import_zod7.z.strictObject({ resource_id: ResourceId, signal: Signal });
673
+ var ExecPtySignalResult = import_zod7.z.strictObject({ delivered: import_zod7.z.boolean() });
674
+ var ExecPtyKillParams = import_zod7.z.strictObject({ resource_id: ResourceId, grace_ms: import_zod7.z.int().min(0).max(3e4).default(2e3) });
675
+ var ExecPtyKillResult = import_zod7.z.strictObject({ exit_code: import_zod7.z.int().nullable(), exit_signal: Signal.nullable() });
676
+ var ExecListParams = import_zod7.z.strictObject({});
677
+ var ExecListResult = import_zod7.z.strictObject({ sessions: import_zod7.z.array(PtyInfo) });
678
+ var ExecRunParams = import_zod7.z.strictObject({
679
+ command: import_zod7.z.string().min(1).max(131072),
680
+ cwd: AbsPath.optional(),
681
+ cwd_key: import_zod7.z.string().max(128).optional(),
682
+ env: import_zod7.z.record(import_zod7.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), import_zod7.z.string().max(32768)).optional(),
683
+ stdin: import_zod7.z.string().max(1048576).optional(),
684
+ timeout: import_zod7.z.int().min(1).max(3600).default(60),
685
+ // seconds, daemon parity
686
+ max_output_bytes: import_zod7.z.int().min(1024).max(8388608).default(1048576)
687
+ });
688
+ var ExecRunResult = import_zod7.z.strictObject({
689
+ exit_code: import_zod7.z.int(),
690
+ stdout: import_zod7.z.string(),
691
+ stderr: import_zod7.z.string(),
692
+ cwd: AbsPath,
693
+ duration_ms: nonNegInt,
694
+ timed_out: import_zod7.z.boolean(),
695
+ output_truncated: import_zod7.z.boolean()
696
+ });
697
+ var ExecExitedEvent = import_zod7.z.strictObject({ exit_code: import_zod7.z.int().nullable(), exit_signal: Signal.nullable() });
698
+ var ExecTitleEvent = import_zod7.z.strictObject({ title: import_zod7.z.string().max(256) });
699
+ var ExecCwdEvent = import_zod7.z.strictObject({ cwd: AbsPath });
700
+
701
+ // src/schema/session.ts
702
+ var import_zod8 = require("zod");
703
+ var SessionAttachParams = import_zod8.z.strictObject({
704
+ resource_id: ResourceId,
705
+ mode: import_zod8.z.enum(["control", "read_only"]).default("control"),
706
+ since_seq: u32.optional(),
707
+ window_bytes: import_zod8.z.int().min(4096).max(16777216).optional()
708
+ });
709
+ var ResourceInfo = import_zod8.z.discriminatedUnion("kind", [
710
+ import_zod8.z.strictObject({ kind: import_zod8.z.literal("pty"), pty: PtyInfo }),
711
+ import_zod8.z.strictObject({
712
+ kind: import_zod8.z.literal("watch"),
713
+ resource_id: ResourceId,
714
+ path: AbsPath,
715
+ orphan_expires_at_ms: epochMs.nullable()
716
+ })
717
+ ]);
718
+ var SessionAttachResult = ResourceInfo;
719
+ var SessionDetachParams = import_zod8.z.strictObject({ resource_id: ResourceId });
720
+ var SessionDetachResult = import_zod8.z.strictObject({ orphan_expires_at_ms: epochMs.nullable() });
721
+ var SessionReleaseParams = import_zod8.z.strictObject({ resource_id: ResourceId });
722
+ var SessionReleaseResult = import_zod8.z.strictObject({ released: import_zod8.z.literal(true) });
723
+ var SessionListParams = import_zod8.z.strictObject({});
724
+ var SessionListResult = import_zod8.z.strictObject({ resources: import_zod8.z.array(ResourceInfo) });
725
+ var SessionControlChangedEvent = import_zod8.z.strictObject({ controller_client_id: import_zod8.z.string().max(64).nullable(), your_mode: import_zod8.z.enum(["control", "read_only"]) });
726
+
727
+ // src/schema/relay.ts
728
+ var import_zod9 = require("zod");
729
+ var RelayDeviceStatusEvent = import_zod9.z.strictObject({
730
+ online: import_zod9.z.boolean(),
731
+ since_ms: epochMs,
732
+ app_version: import_zod9.z.string().max(32).nullable(),
733
+ protocol_version: ProtocolVersion.nullable()
734
+ });
735
+ var RelayAuthExpiringEvent = import_zod9.z.strictObject({ expires_at_ms: epochMs });
736
+ var RelayCallRequest = import_zod9.z.strictObject({
737
+ cap: import_zod9.z.string().min(1).max(32),
738
+ op: import_zod9.z.string().min(1).max(64),
739
+ params: import_zod9.z.unknown(),
740
+ timeout_ms: import_zod9.z.int().min(100).max(37e5).default(7e4)
741
+ });
742
+ var RelayCallResponse = import_zod9.z.discriminatedUnion("ok", [
743
+ import_zod9.z.strictObject({ ok: import_zod9.z.literal(true), result: import_zod9.z.unknown() }),
744
+ import_zod9.z.strictObject({ ok: import_zod9.z.literal(false), error: ProtocolErrorBody })
745
+ ]);
746
+ var RelayStatusResponse = RelayDeviceStatusEvent;
747
+
748
+ // src/schema/registry.ts
749
+ var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
750
+ var OPS = {
751
+ "sysinfo.get": { params: SysinfoGetParams, result: SysinfoGetResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
752
+ "fs.list": { params: FsListParams, result: FsListResult, kind: "unary", since: "1.0", errors: FS_ERR },
753
+ "fs.stat": { params: FsStatParams, result: FsStatResult, kind: "unary", since: "1.0", errors: FS_ERR },
754
+ "fs.read": { params: FsReadParams, result: FsReadResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "PAYLOAD_TOO_LARGE"] },
755
+ "fs.read_stream": { params: FsReadStreamParams, result: FsReadStreamResult, kind: "stream", since: "1.0", errors: [...FS_ERR, "CANCELLED"] },
756
+ "fs.write": { params: FsWriteParams, result: FsWriteResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT", "PAYLOAD_TOO_LARGE"] },
757
+ "fs.mkdir": { params: FsMkdirParams, result: FsMkdirResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
758
+ "fs.move": { params: FsMoveParams, result: FsMoveResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
759
+ "fs.delete": { params: FsDeleteParams, result: FsDeleteResult, kind: "unary", since: "1.0", errors: FS_ERR },
760
+ "fs.watch": { params: FsWatchParams, result: FsWatchResult, kind: "resource", since: "1.0", errors: [...FS_ERR, "RATE_LIMITED"] },
761
+ "fs.patch": { params: FsPatchParams, result: FsPatchResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
762
+ "fs.search_paths": { params: FsSearchPathsParams, result: FsSearchPathsResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "TIMEOUT"] },
763
+ "fs.search_content": { params: FsSearchContentParams, result: FsSearchContentResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "TIMEOUT"] },
764
+ "exec.pty.start": { params: ExecPtyStartParams, result: ExecPtyStartResult, kind: "resource", since: "1.0", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
765
+ "exec.pty.write": { params: ExecPtyWriteParams, result: ExecPtyWriteResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN", "INVALID_PARAMS"] },
766
+ "exec.pty.resize": { params: ExecPtyResizeParams, result: ExecPtyResizeResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN"] },
767
+ "exec.pty.signal": { params: ExecPtySignalParams, result: ExecPtySignalResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED"] },
768
+ "exec.pty.kill": { params: ExecPtyKillParams, result: ExecPtyKillResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN"] },
769
+ "exec.list": { params: ExecListParams, result: ExecListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
770
+ "exec.run": { params: ExecRunParams, result: ExecRunResult, kind: "unary", since: "1.0", errors: ["INVALID_PARAMS", "NOT_FOUND", "TIMEOUT", "CANCELLED", "INTERNAL"] },
771
+ "session.attach": { params: SessionAttachParams, result: SessionAttachResult, kind: "stream", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN", "RESOURCE_BUSY"] },
772
+ "session.detach": { params: SessionDetachParams, result: SessionDetachResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE"] },
773
+ "session.release": { params: SessionReleaseParams, result: SessionReleaseResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN"] },
774
+ "session.list": { params: SessionListParams, result: SessionListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] }
775
+ };
776
+ var EVENTS = {
777
+ "fs.changed": FsChangedEvent,
778
+ "exec.exited": ExecExitedEvent,
779
+ "exec.title": ExecTitleEvent,
780
+ "exec.cwd": ExecCwdEvent,
781
+ "session.control_changed": SessionControlChangedEvent,
782
+ "relay.device_status": RelayDeviceStatusEvent,
783
+ "relay.auth_expiring": RelayAuthExpiringEvent
784
+ };
785
+ var NAMED_SCHEMAS = {
786
+ ProtocolVersion,
787
+ RequestId,
788
+ ResourceId,
789
+ DeviceId,
790
+ AbsPath,
791
+ ErrorCode,
792
+ ErrorReason,
793
+ ProtocolErrorBody,
794
+ FrameHeader,
795
+ ClientType,
796
+ Limits,
797
+ OpDescriptor,
798
+ Welcome,
799
+ HelloMsg,
800
+ RequestMsg,
801
+ ResponseMsg,
802
+ ErrorMsg,
803
+ StreamMeta,
804
+ StreamMsg,
805
+ EndReason,
806
+ EndMsg,
807
+ CancelMsg,
808
+ CreditMsg,
809
+ EventMsg,
810
+ RelayMsg,
811
+ ClientToCoreMsg,
812
+ CoreToClientMsg,
813
+ OsPermissionName,
814
+ SysinfoGetParams,
815
+ SysinfoGetResult,
816
+ FsKind,
817
+ FsEntry,
818
+ FsListParams,
819
+ FsListResult,
820
+ FsStatParams,
821
+ FsEncoding,
822
+ FsReadParams,
823
+ FsReadResult,
824
+ FsReadStreamParams,
825
+ FsReadStreamResult,
826
+ FsWriteParams,
827
+ FsWriteResult,
828
+ FsMkdirParams,
829
+ FsMkdirResult,
830
+ FsMoveParams,
831
+ FsMoveResult,
832
+ FsDeleteParams,
833
+ FsDeleteResult,
834
+ FsWatchParams,
835
+ FsWatchResult,
836
+ FsPatchParams,
837
+ FsPatchResult,
838
+ FsSearchPathsParams,
839
+ FsSearchPathsResult,
840
+ FsSearchContentParams,
841
+ FsSearchContentResult,
842
+ FsChange,
843
+ FsChangedEvent,
844
+ Signal,
845
+ ExecPtyStartParams,
846
+ PtyInfo,
847
+ ExecPtyWriteParams,
848
+ ExecPtyWriteResult,
849
+ ExecPtyResizeParams,
850
+ ExecPtyResizeResult,
851
+ ExecPtySignalParams,
852
+ ExecPtySignalResult,
853
+ ExecPtyKillParams,
854
+ ExecPtyKillResult,
855
+ ExecListParams,
856
+ ExecListResult,
857
+ ExecRunParams,
858
+ ExecRunResult,
859
+ ExecExitedEvent,
860
+ ExecTitleEvent,
861
+ ExecCwdEvent,
862
+ SessionAttachParams,
863
+ ResourceInfo,
864
+ SessionDetachParams,
865
+ SessionDetachResult,
866
+ SessionReleaseParams,
867
+ SessionReleaseResult,
868
+ SessionListParams,
869
+ SessionListResult,
870
+ SessionControlChangedEvent,
871
+ RelayDeviceStatusEvent,
872
+ RelayAuthExpiringEvent,
873
+ RelayCallRequest,
874
+ RelayCallResponse
875
+ };
876
+ //# sourceMappingURL=index.cjs.map