@thenewlabs/entangle-protocol 1.0.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,850 @@
1
+ import { z } from 'zod';
2
+ export declare const RunMessageSchema: z.ZodObject<{
3
+ ctr: z.ZodNumber;
4
+ msg: z.ZodObject<{
5
+ commandId: z.ZodString;
6
+ argv: z.ZodArray<z.ZodString, "many">;
7
+ cwd: z.ZodOptional<z.ZodString>;
8
+ limits: z.ZodOptional<z.ZodObject<{
9
+ cpuMs: z.ZodOptional<z.ZodNumber>;
10
+ memMB: z.ZodOptional<z.ZodNumber>;
11
+ wallMs: z.ZodOptional<z.ZodNumber>;
12
+ maxOutBytes: z.ZodOptional<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ maxOutBytes?: number | undefined;
15
+ cpuMs?: number | undefined;
16
+ memMB?: number | undefined;
17
+ wallMs?: number | undefined;
18
+ }, {
19
+ maxOutBytes?: number | undefined;
20
+ cpuMs?: number | undefined;
21
+ memMB?: number | undefined;
22
+ wallMs?: number | undefined;
23
+ }>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ commandId: string;
26
+ argv: string[];
27
+ cwd?: string | undefined;
28
+ limits?: {
29
+ maxOutBytes?: number | undefined;
30
+ cpuMs?: number | undefined;
31
+ memMB?: number | undefined;
32
+ wallMs?: number | undefined;
33
+ } | undefined;
34
+ }, {
35
+ commandId: string;
36
+ argv: string[];
37
+ cwd?: string | undefined;
38
+ limits?: {
39
+ maxOutBytes?: number | undefined;
40
+ cpuMs?: number | undefined;
41
+ memMB?: number | undefined;
42
+ wallMs?: number | undefined;
43
+ } | undefined;
44
+ }>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ ctr: number;
47
+ msg: {
48
+ commandId: string;
49
+ argv: string[];
50
+ cwd?: string | undefined;
51
+ limits?: {
52
+ maxOutBytes?: number | undefined;
53
+ cpuMs?: number | undefined;
54
+ memMB?: number | undefined;
55
+ wallMs?: number | undefined;
56
+ } | undefined;
57
+ };
58
+ }, {
59
+ ctr: number;
60
+ msg: {
61
+ commandId: string;
62
+ argv: string[];
63
+ cwd?: string | undefined;
64
+ limits?: {
65
+ maxOutBytes?: number | undefined;
66
+ cpuMs?: number | undefined;
67
+ memMB?: number | undefined;
68
+ wallMs?: number | undefined;
69
+ } | undefined;
70
+ };
71
+ }>;
72
+ export declare const StdoutMessageSchema: z.ZodObject<{
73
+ ctr: z.ZodNumber;
74
+ msg: z.ZodObject<{
75
+ commandId: z.ZodString;
76
+ chunk: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ commandId: string;
79
+ chunk: Uint8Array<ArrayBuffer>;
80
+ }, {
81
+ commandId: string;
82
+ chunk: Uint8Array<ArrayBuffer>;
83
+ }>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ ctr: number;
86
+ msg: {
87
+ commandId: string;
88
+ chunk: Uint8Array<ArrayBuffer>;
89
+ };
90
+ }, {
91
+ ctr: number;
92
+ msg: {
93
+ commandId: string;
94
+ chunk: Uint8Array<ArrayBuffer>;
95
+ };
96
+ }>;
97
+ export declare const StderrMessageSchema: z.ZodObject<{
98
+ ctr: z.ZodNumber;
99
+ msg: z.ZodObject<{
100
+ commandId: z.ZodString;
101
+ chunk: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ commandId: string;
104
+ chunk: Uint8Array<ArrayBuffer>;
105
+ }, {
106
+ commandId: string;
107
+ chunk: Uint8Array<ArrayBuffer>;
108
+ }>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ ctr: number;
111
+ msg: {
112
+ commandId: string;
113
+ chunk: Uint8Array<ArrayBuffer>;
114
+ };
115
+ }, {
116
+ ctr: number;
117
+ msg: {
118
+ commandId: string;
119
+ chunk: Uint8Array<ArrayBuffer>;
120
+ };
121
+ }>;
122
+ export declare const ExitMessageSchema: z.ZodObject<{
123
+ ctr: z.ZodNumber;
124
+ msg: z.ZodObject<{
125
+ commandId: z.ZodString;
126
+ code: z.ZodNullable<z.ZodNumber>;
127
+ signal: z.ZodNullable<z.ZodString>;
128
+ bytesOut: z.ZodNumber;
129
+ }, "strip", z.ZodTypeAny, {
130
+ code: number | null;
131
+ commandId: string;
132
+ signal: string | null;
133
+ bytesOut: number;
134
+ }, {
135
+ code: number | null;
136
+ commandId: string;
137
+ signal: string | null;
138
+ bytesOut: number;
139
+ }>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ ctr: number;
142
+ msg: {
143
+ code: number | null;
144
+ commandId: string;
145
+ signal: string | null;
146
+ bytesOut: number;
147
+ };
148
+ }, {
149
+ ctr: number;
150
+ msg: {
151
+ code: number | null;
152
+ commandId: string;
153
+ signal: string | null;
154
+ bytesOut: number;
155
+ };
156
+ }>;
157
+ export declare const ErrorMessageSchema: z.ZodObject<{
158
+ ctr: z.ZodNumber;
159
+ msg: z.ZodObject<{
160
+ commandId: z.ZodNullable<z.ZodString>;
161
+ code: z.ZodString;
162
+ detail: z.ZodOptional<z.ZodString>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ code: string;
165
+ commandId: string | null;
166
+ detail?: string | undefined;
167
+ }, {
168
+ code: string;
169
+ commandId: string | null;
170
+ detail?: string | undefined;
171
+ }>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ ctr: number;
174
+ msg: {
175
+ code: string;
176
+ commandId: string | null;
177
+ detail?: string | undefined;
178
+ };
179
+ }, {
180
+ ctr: number;
181
+ msg: {
182
+ code: string;
183
+ commandId: string | null;
184
+ detail?: string | undefined;
185
+ };
186
+ }>;
187
+ export declare const AbortMessageSchema: z.ZodObject<{
188
+ ctr: z.ZodNumber;
189
+ msg: z.ZodObject<{
190
+ commandId: z.ZodString;
191
+ reason: z.ZodOptional<z.ZodString>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ commandId: string;
194
+ reason?: string | undefined;
195
+ }, {
196
+ commandId: string;
197
+ reason?: string | undefined;
198
+ }>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ ctr: number;
201
+ msg: {
202
+ commandId: string;
203
+ reason?: string | undefined;
204
+ };
205
+ }, {
206
+ ctr: number;
207
+ msg: {
208
+ commandId: string;
209
+ reason?: string | undefined;
210
+ };
211
+ }>;
212
+ export declare const KeepaliveMessageSchema: z.ZodObject<{
213
+ ctr: z.ZodNumber;
214
+ msg: z.ZodObject<{
215
+ t: z.ZodNumber;
216
+ }, "strip", z.ZodTypeAny, {
217
+ t: number;
218
+ }, {
219
+ t: number;
220
+ }>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ ctr: number;
223
+ msg: {
224
+ t: number;
225
+ };
226
+ }, {
227
+ ctr: number;
228
+ msg: {
229
+ t: number;
230
+ };
231
+ }>;
232
+ export declare const Auth2MessageSchema: z.ZodObject<{
233
+ ok: z.ZodBoolean;
234
+ nonceB: z.ZodString;
235
+ nonceC: z.ZodString;
236
+ expiryTs: z.ZodNumber;
237
+ policyHash: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
239
+ ok: boolean;
240
+ nonceB: string;
241
+ nonceC: string;
242
+ expiryTs: number;
243
+ policyHash: string;
244
+ }, {
245
+ ok: boolean;
246
+ nonceB: string;
247
+ nonceC: string;
248
+ expiryTs: number;
249
+ policyHash: string;
250
+ }>;
251
+ export type RunMessage = z.infer<typeof RunMessageSchema>;
252
+ export type StdoutMessage = z.infer<typeof StdoutMessageSchema>;
253
+ export type StderrMessage = z.infer<typeof StderrMessageSchema>;
254
+ export type ExitMessage = z.infer<typeof ExitMessageSchema>;
255
+ export type ErrorMessage = z.infer<typeof ErrorMessageSchema>;
256
+ export type AbortMessage = z.infer<typeof AbortMessageSchema>;
257
+ export type KeepaliveMessage = z.infer<typeof KeepaliveMessageSchema>;
258
+ export type Auth2Message = z.infer<typeof Auth2MessageSchema>;
259
+ export declare const TtyOpenMessageSchema: z.ZodObject<{
260
+ ctr: z.ZodNumber;
261
+ msg: z.ZodObject<{
262
+ sessionId: z.ZodString;
263
+ cwd: z.ZodOptional<z.ZodString>;
264
+ cols: z.ZodNumber;
265
+ rows: z.ZodNumber;
266
+ }, "strip", z.ZodTypeAny, {
267
+ sessionId: string;
268
+ cols: number;
269
+ rows: number;
270
+ cwd?: string | undefined;
271
+ }, {
272
+ sessionId: string;
273
+ cols: number;
274
+ rows: number;
275
+ cwd?: string | undefined;
276
+ }>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ ctr: number;
279
+ msg: {
280
+ sessionId: string;
281
+ cols: number;
282
+ rows: number;
283
+ cwd?: string | undefined;
284
+ };
285
+ }, {
286
+ ctr: number;
287
+ msg: {
288
+ sessionId: string;
289
+ cols: number;
290
+ rows: number;
291
+ cwd?: string | undefined;
292
+ };
293
+ }>;
294
+ export declare const TtyDataMessageSchema: z.ZodObject<{
295
+ ctr: z.ZodNumber;
296
+ msg: z.ZodObject<{
297
+ sessionId: z.ZodString;
298
+ chunk: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ chunk: Uint8Array<ArrayBuffer>;
301
+ sessionId: string;
302
+ }, {
303
+ chunk: Uint8Array<ArrayBuffer>;
304
+ sessionId: string;
305
+ }>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ ctr: number;
308
+ msg: {
309
+ chunk: Uint8Array<ArrayBuffer>;
310
+ sessionId: string;
311
+ };
312
+ }, {
313
+ ctr: number;
314
+ msg: {
315
+ chunk: Uint8Array<ArrayBuffer>;
316
+ sessionId: string;
317
+ };
318
+ }>;
319
+ export declare const TtyResizeMessageSchema: z.ZodObject<{
320
+ ctr: z.ZodNumber;
321
+ msg: z.ZodObject<{
322
+ sessionId: z.ZodString;
323
+ cols: z.ZodNumber;
324
+ rows: z.ZodNumber;
325
+ }, "strip", z.ZodTypeAny, {
326
+ sessionId: string;
327
+ cols: number;
328
+ rows: number;
329
+ }, {
330
+ sessionId: string;
331
+ cols: number;
332
+ rows: number;
333
+ }>;
334
+ }, "strip", z.ZodTypeAny, {
335
+ ctr: number;
336
+ msg: {
337
+ sessionId: string;
338
+ cols: number;
339
+ rows: number;
340
+ };
341
+ }, {
342
+ ctr: number;
343
+ msg: {
344
+ sessionId: string;
345
+ cols: number;
346
+ rows: number;
347
+ };
348
+ }>;
349
+ export declare const TtySignalMessageSchema: z.ZodObject<{
350
+ ctr: z.ZodNumber;
351
+ msg: z.ZodObject<{
352
+ sessionId: z.ZodString;
353
+ signal: z.ZodEnum<["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]>;
354
+ }, "strip", z.ZodTypeAny, {
355
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT";
356
+ sessionId: string;
357
+ }, {
358
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT";
359
+ sessionId: string;
360
+ }>;
361
+ }, "strip", z.ZodTypeAny, {
362
+ ctr: number;
363
+ msg: {
364
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT";
365
+ sessionId: string;
366
+ };
367
+ }, {
368
+ ctr: number;
369
+ msg: {
370
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT";
371
+ sessionId: string;
372
+ };
373
+ }>;
374
+ export declare const TtyExitMessageSchema: z.ZodObject<{
375
+ ctr: z.ZodNumber;
376
+ msg: z.ZodObject<{
377
+ sessionId: z.ZodString;
378
+ code: z.ZodNullable<z.ZodNumber>;
379
+ signal: z.ZodNullable<z.ZodString>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ code: number | null;
382
+ signal: string | null;
383
+ sessionId: string;
384
+ }, {
385
+ code: number | null;
386
+ signal: string | null;
387
+ sessionId: string;
388
+ }>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ ctr: number;
391
+ msg: {
392
+ code: number | null;
393
+ signal: string | null;
394
+ sessionId: string;
395
+ };
396
+ }, {
397
+ ctr: number;
398
+ msg: {
399
+ code: number | null;
400
+ signal: string | null;
401
+ sessionId: string;
402
+ };
403
+ }>;
404
+ export type TtyOpenMessage = z.infer<typeof TtyOpenMessageSchema>;
405
+ export type TtyDataMessage = z.infer<typeof TtyDataMessageSchema>;
406
+ export type TtyResizeMessage = z.infer<typeof TtyResizeMessageSchema>;
407
+ export type TtySignalMessage = z.infer<typeof TtySignalMessageSchema>;
408
+ export type TtyExitMessage = z.infer<typeof TtyExitMessageSchema>;
409
+ export declare enum ErrorCode {
410
+ AUTH_FAILED = "auth_failed",
411
+ TOOL_NOT_ALLOWED = "tool_not_allowed",
412
+ ARG_LIMIT_EXCEEDED = "arg_limit_exceeded",
413
+ CWD_NOT_ALLOWED = "cwd_not_allowed",
414
+ RESOURCE_EXCEEDED = "resource_exceeded",
415
+ MULTI_RUN_NOT_ALLOWED = "multi_run_not_allowed",
416
+ UNKNOWN_COMMAND_ID = "unknown_command_id",
417
+ INTERNAL_ERROR = "internal_error",
418
+ STREAM_LIMIT_EXCEEDED = "stream_limit_exceeded",
419
+ UNKNOWN_STREAM_ID = "unknown_stream_id",
420
+ INVALID_STREAM_MODE = "invalid_stream_mode"
421
+ }
422
+ export declare const StreamOpenMessageSchema: z.ZodObject<{
423
+ ctr: z.ZodNumber;
424
+ msg: z.ZodObject<{
425
+ v: z.ZodLiteral<1>;
426
+ kind: z.ZodLiteral<"open">;
427
+ sid: z.ZodString;
428
+ mode: z.ZodEnum<["pty", "cmd"]>;
429
+ pty: z.ZodOptional<z.ZodObject<{
430
+ cols: z.ZodNumber;
431
+ rows: z.ZodNumber;
432
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
433
+ }, "strip", z.ZodTypeAny, {
434
+ cols: number;
435
+ rows: number;
436
+ env?: Record<string, string> | undefined;
437
+ }, {
438
+ cols: number;
439
+ rows: number;
440
+ env?: Record<string, string> | undefined;
441
+ }>>;
442
+ exec: z.ZodOptional<z.ZodObject<{
443
+ argv: z.ZodArray<z.ZodString, "many">;
444
+ cwd: z.ZodOptional<z.ZodString>;
445
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
446
+ stdin: z.ZodOptional<z.ZodBoolean>;
447
+ }, "strip", z.ZodTypeAny, {
448
+ argv: string[];
449
+ cwd?: string | undefined;
450
+ env?: Record<string, string> | undefined;
451
+ stdin?: boolean | undefined;
452
+ }, {
453
+ argv: string[];
454
+ cwd?: string | undefined;
455
+ env?: Record<string, string> | undefined;
456
+ stdin?: boolean | undefined;
457
+ }>>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ v: 1;
460
+ kind: "open";
461
+ sid: string;
462
+ mode: "pty" | "cmd";
463
+ pty?: {
464
+ cols: number;
465
+ rows: number;
466
+ env?: Record<string, string> | undefined;
467
+ } | undefined;
468
+ exec?: {
469
+ argv: string[];
470
+ cwd?: string | undefined;
471
+ env?: Record<string, string> | undefined;
472
+ stdin?: boolean | undefined;
473
+ } | undefined;
474
+ }, {
475
+ v: 1;
476
+ kind: "open";
477
+ sid: string;
478
+ mode: "pty" | "cmd";
479
+ pty?: {
480
+ cols: number;
481
+ rows: number;
482
+ env?: Record<string, string> | undefined;
483
+ } | undefined;
484
+ exec?: {
485
+ argv: string[];
486
+ cwd?: string | undefined;
487
+ env?: Record<string, string> | undefined;
488
+ stdin?: boolean | undefined;
489
+ } | undefined;
490
+ }>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ ctr: number;
493
+ msg: {
494
+ v: 1;
495
+ kind: "open";
496
+ sid: string;
497
+ mode: "pty" | "cmd";
498
+ pty?: {
499
+ cols: number;
500
+ rows: number;
501
+ env?: Record<string, string> | undefined;
502
+ } | undefined;
503
+ exec?: {
504
+ argv: string[];
505
+ cwd?: string | undefined;
506
+ env?: Record<string, string> | undefined;
507
+ stdin?: boolean | undefined;
508
+ } | undefined;
509
+ };
510
+ }, {
511
+ ctr: number;
512
+ msg: {
513
+ v: 1;
514
+ kind: "open";
515
+ sid: string;
516
+ mode: "pty" | "cmd";
517
+ pty?: {
518
+ cols: number;
519
+ rows: number;
520
+ env?: Record<string, string> | undefined;
521
+ } | undefined;
522
+ exec?: {
523
+ argv: string[];
524
+ cwd?: string | undefined;
525
+ env?: Record<string, string> | undefined;
526
+ stdin?: boolean | undefined;
527
+ } | undefined;
528
+ };
529
+ }>;
530
+ export declare const StreamDataMessageSchema: z.ZodObject<{
531
+ ctr: z.ZodNumber;
532
+ msg: z.ZodObject<{
533
+ v: z.ZodLiteral<1>;
534
+ kind: z.ZodLiteral<"data">;
535
+ sid: z.ZodString;
536
+ chunk: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ chunk: Uint8Array<ArrayBuffer>;
539
+ v: 1;
540
+ kind: "data";
541
+ sid: string;
542
+ }, {
543
+ chunk: Uint8Array<ArrayBuffer>;
544
+ v: 1;
545
+ kind: "data";
546
+ sid: string;
547
+ }>;
548
+ }, "strip", z.ZodTypeAny, {
549
+ ctr: number;
550
+ msg: {
551
+ chunk: Uint8Array<ArrayBuffer>;
552
+ v: 1;
553
+ kind: "data";
554
+ sid: string;
555
+ };
556
+ }, {
557
+ ctr: number;
558
+ msg: {
559
+ chunk: Uint8Array<ArrayBuffer>;
560
+ v: 1;
561
+ kind: "data";
562
+ sid: string;
563
+ };
564
+ }>;
565
+ export declare const StreamResizeMessageSchema: z.ZodObject<{
566
+ ctr: z.ZodNumber;
567
+ msg: z.ZodObject<{
568
+ v: z.ZodLiteral<1>;
569
+ kind: z.ZodLiteral<"pty-resize">;
570
+ sid: z.ZodString;
571
+ cols: z.ZodNumber;
572
+ rows: z.ZodNumber;
573
+ }, "strip", z.ZodTypeAny, {
574
+ cols: number;
575
+ rows: number;
576
+ v: 1;
577
+ kind: "pty-resize";
578
+ sid: string;
579
+ }, {
580
+ cols: number;
581
+ rows: number;
582
+ v: 1;
583
+ kind: "pty-resize";
584
+ sid: string;
585
+ }>;
586
+ }, "strip", z.ZodTypeAny, {
587
+ ctr: number;
588
+ msg: {
589
+ cols: number;
590
+ rows: number;
591
+ v: 1;
592
+ kind: "pty-resize";
593
+ sid: string;
594
+ };
595
+ }, {
596
+ ctr: number;
597
+ msg: {
598
+ cols: number;
599
+ rows: number;
600
+ v: 1;
601
+ kind: "pty-resize";
602
+ sid: string;
603
+ };
604
+ }>;
605
+ export declare const StreamSignalMessageSchema: z.ZodObject<{
606
+ ctr: z.ZodNumber;
607
+ msg: z.ZodObject<{
608
+ v: z.ZodLiteral<1>;
609
+ kind: z.ZodLiteral<"signal">;
610
+ sid: z.ZodString;
611
+ signal: z.ZodEnum<["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT", "SIGKILL"]>;
612
+ }, "strip", z.ZodTypeAny, {
613
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT" | "SIGKILL";
614
+ v: 1;
615
+ kind: "signal";
616
+ sid: string;
617
+ }, {
618
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT" | "SIGKILL";
619
+ v: 1;
620
+ kind: "signal";
621
+ sid: string;
622
+ }>;
623
+ }, "strip", z.ZodTypeAny, {
624
+ ctr: number;
625
+ msg: {
626
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT" | "SIGKILL";
627
+ v: 1;
628
+ kind: "signal";
629
+ sid: string;
630
+ };
631
+ }, {
632
+ ctr: number;
633
+ msg: {
634
+ signal: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT" | "SIGKILL";
635
+ v: 1;
636
+ kind: "signal";
637
+ sid: string;
638
+ };
639
+ }>;
640
+ export declare const StreamCloseMessageSchema: z.ZodObject<{
641
+ ctr: z.ZodNumber;
642
+ msg: z.ZodObject<{
643
+ v: z.ZodLiteral<1>;
644
+ kind: z.ZodLiteral<"close">;
645
+ sid: z.ZodString;
646
+ }, "strip", z.ZodTypeAny, {
647
+ v: 1;
648
+ kind: "close";
649
+ sid: string;
650
+ }, {
651
+ v: 1;
652
+ kind: "close";
653
+ sid: string;
654
+ }>;
655
+ }, "strip", z.ZodTypeAny, {
656
+ ctr: number;
657
+ msg: {
658
+ v: 1;
659
+ kind: "close";
660
+ sid: string;
661
+ };
662
+ }, {
663
+ ctr: number;
664
+ msg: {
665
+ v: 1;
666
+ kind: "close";
667
+ sid: string;
668
+ };
669
+ }>;
670
+ export declare const StreamOpenedMessageSchema: z.ZodObject<{
671
+ ctr: z.ZodNumber;
672
+ msg: z.ZodObject<{
673
+ v: z.ZodLiteral<1>;
674
+ kind: z.ZodLiteral<"opened">;
675
+ sid: z.ZodString;
676
+ startedAt: z.ZodNumber;
677
+ mode: z.ZodEnum<["pty", "cmd"]>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ v: 1;
680
+ kind: "opened";
681
+ sid: string;
682
+ mode: "pty" | "cmd";
683
+ startedAt: number;
684
+ }, {
685
+ v: 1;
686
+ kind: "opened";
687
+ sid: string;
688
+ mode: "pty" | "cmd";
689
+ startedAt: number;
690
+ }>;
691
+ }, "strip", z.ZodTypeAny, {
692
+ ctr: number;
693
+ msg: {
694
+ v: 1;
695
+ kind: "opened";
696
+ sid: string;
697
+ mode: "pty" | "cmd";
698
+ startedAt: number;
699
+ };
700
+ }, {
701
+ ctr: number;
702
+ msg: {
703
+ v: 1;
704
+ kind: "opened";
705
+ sid: string;
706
+ mode: "pty" | "cmd";
707
+ startedAt: number;
708
+ };
709
+ }>;
710
+ export declare const StreamExitMessageSchema: z.ZodObject<{
711
+ ctr: z.ZodNumber;
712
+ msg: z.ZodObject<{
713
+ v: z.ZodLiteral<1>;
714
+ kind: z.ZodLiteral<"exit">;
715
+ sid: z.ZodString;
716
+ code: z.ZodNullable<z.ZodNumber>;
717
+ signal: z.ZodNullable<z.ZodString>;
718
+ usage: z.ZodOptional<z.ZodObject<{
719
+ cpu_ms: z.ZodNumber;
720
+ rss_max: z.ZodNumber;
721
+ }, "strip", z.ZodTypeAny, {
722
+ cpu_ms: number;
723
+ rss_max: number;
724
+ }, {
725
+ cpu_ms: number;
726
+ rss_max: number;
727
+ }>>;
728
+ }, "strip", z.ZodTypeAny, {
729
+ code: number | null;
730
+ signal: string | null;
731
+ v: 1;
732
+ kind: "exit";
733
+ sid: string;
734
+ usage?: {
735
+ cpu_ms: number;
736
+ rss_max: number;
737
+ } | undefined;
738
+ }, {
739
+ code: number | null;
740
+ signal: string | null;
741
+ v: 1;
742
+ kind: "exit";
743
+ sid: string;
744
+ usage?: {
745
+ cpu_ms: number;
746
+ rss_max: number;
747
+ } | undefined;
748
+ }>;
749
+ }, "strip", z.ZodTypeAny, {
750
+ ctr: number;
751
+ msg: {
752
+ code: number | null;
753
+ signal: string | null;
754
+ v: 1;
755
+ kind: "exit";
756
+ sid: string;
757
+ usage?: {
758
+ cpu_ms: number;
759
+ rss_max: number;
760
+ } | undefined;
761
+ };
762
+ }, {
763
+ ctr: number;
764
+ msg: {
765
+ code: number | null;
766
+ signal: string | null;
767
+ v: 1;
768
+ kind: "exit";
769
+ sid: string;
770
+ usage?: {
771
+ cpu_ms: number;
772
+ rss_max: number;
773
+ } | undefined;
774
+ };
775
+ }>;
776
+ export declare const StreamClosedMessageSchema: z.ZodObject<{
777
+ ctr: z.ZodNumber;
778
+ msg: z.ZodObject<{
779
+ v: z.ZodLiteral<1>;
780
+ kind: z.ZodLiteral<"closed">;
781
+ sid: z.ZodString;
782
+ }, "strip", z.ZodTypeAny, {
783
+ v: 1;
784
+ kind: "closed";
785
+ sid: string;
786
+ }, {
787
+ v: 1;
788
+ kind: "closed";
789
+ sid: string;
790
+ }>;
791
+ }, "strip", z.ZodTypeAny, {
792
+ ctr: number;
793
+ msg: {
794
+ v: 1;
795
+ kind: "closed";
796
+ sid: string;
797
+ };
798
+ }, {
799
+ ctr: number;
800
+ msg: {
801
+ v: 1;
802
+ kind: "closed";
803
+ sid: string;
804
+ };
805
+ }>;
806
+ export declare const StreamErrorMessageSchema: z.ZodObject<{
807
+ ctr: z.ZodNumber;
808
+ msg: z.ZodObject<{
809
+ v: z.ZodLiteral<1>;
810
+ kind: z.ZodLiteral<"error">;
811
+ sid: z.ZodString;
812
+ message: z.ZodString;
813
+ }, "strip", z.ZodTypeAny, {
814
+ message: string;
815
+ v: 1;
816
+ kind: "error";
817
+ sid: string;
818
+ }, {
819
+ message: string;
820
+ v: 1;
821
+ kind: "error";
822
+ sid: string;
823
+ }>;
824
+ }, "strip", z.ZodTypeAny, {
825
+ ctr: number;
826
+ msg: {
827
+ message: string;
828
+ v: 1;
829
+ kind: "error";
830
+ sid: string;
831
+ };
832
+ }, {
833
+ ctr: number;
834
+ msg: {
835
+ message: string;
836
+ v: 1;
837
+ kind: "error";
838
+ sid: string;
839
+ };
840
+ }>;
841
+ export type StreamOpenMessage = z.infer<typeof StreamOpenMessageSchema>;
842
+ export type StreamDataMessage = z.infer<typeof StreamDataMessageSchema>;
843
+ export type StreamResizeMessage = z.infer<typeof StreamResizeMessageSchema>;
844
+ export type StreamSignalMessage = z.infer<typeof StreamSignalMessageSchema>;
845
+ export type StreamCloseMessage = z.infer<typeof StreamCloseMessageSchema>;
846
+ export type StreamOpenedMessage = z.infer<typeof StreamOpenedMessageSchema>;
847
+ export type StreamExitMessage = z.infer<typeof StreamExitMessageSchema>;
848
+ export type StreamClosedMessage = z.infer<typeof StreamClosedMessageSchema>;
849
+ export type StreamErrorMessage = z.infer<typeof StreamErrorMessageSchema>;
850
+ //# sourceMappingURL=messages.d.ts.map