@fnndsc/calypso 0.6.1 → 0.7.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.
@@ -1,1568 +0,0 @@
1
- /**
2
- * @file The wire-contract message schemas.
3
- *
4
- * Two discriminated unions, one per direction, keyed on a `type` tag:
5
- * {@link clientMessageSchema} (surface → daemon) and
6
- * {@link serverMessageSchema} (daemon → surface). Every request carries a
7
- * correlation `id` so its reply and any streamed output can be matched to
8
- * it, and output events carry the sink channel they belong to. These schemas
9
- * are the single source of truth for the protocol; the human-readable
10
- * description in `docs/calypso.adoc` is checked against them.
11
- *
12
- * @module
13
- */
14
- import { z } from 'zod';
15
- /** The sink channel an output event belongs to. */
16
- export declare const channelSchema: z.ZodEnum<["data", "err", "status"]>;
17
- /** Capabilities an attaching surface can safely execute on its own machine. */
18
- export declare const surfaceCapabilitiesMessageSchema: z.ZodObject<{
19
- shellCommands: z.ZodBoolean;
20
- hiddenInput: z.ZodOptional<z.ZodBoolean>;
21
- }, "strip", z.ZodTypeAny, {
22
- shellCommands: boolean;
23
- hiddenInput?: boolean | undefined;
24
- }, {
25
- shellCommands: boolean;
26
- hiddenInput?: boolean | undefined;
27
- }>;
28
- /** Attach to a session: declares the contract version, token, and surface capabilities. */
29
- export declare const attachMessageSchema: z.ZodObject<{
30
- type: z.ZodLiteral<"attach">;
31
- protocolVersion: z.ZodNumber;
32
- token: z.ZodString;
33
- session: z.ZodOptional<z.ZodString>;
34
- capabilities: z.ZodOptional<z.ZodObject<{
35
- shellCommands: z.ZodBoolean;
36
- hiddenInput: z.ZodOptional<z.ZodBoolean>;
37
- }, "strip", z.ZodTypeAny, {
38
- shellCommands: boolean;
39
- hiddenInput?: boolean | undefined;
40
- }, {
41
- shellCommands: boolean;
42
- hiddenInput?: boolean | undefined;
43
- }>>;
44
- }, "strip", z.ZodTypeAny, {
45
- type: "attach";
46
- protocolVersion: number;
47
- token: string;
48
- session?: string | undefined;
49
- capabilities?: {
50
- shellCommands: boolean;
51
- hiddenInput?: boolean | undefined;
52
- } | undefined;
53
- }, {
54
- type: "attach";
55
- protocolVersion: number;
56
- token: string;
57
- session?: string | undefined;
58
- capabilities?: {
59
- shellCommands: boolean;
60
- hiddenInput?: boolean | undefined;
61
- } | undefined;
62
- }>;
63
- /** Execute one input line, correlated by `id`. */
64
- export declare const executeMessageSchema: z.ZodObject<{
65
- type: z.ZodLiteral<"execute">;
66
- id: z.ZodString;
67
- line: z.ZodString;
68
- }, "strip", z.ZodTypeAny, {
69
- type: "execute";
70
- id: string;
71
- line: string;
72
- }, {
73
- type: "execute";
74
- id: string;
75
- line: string;
76
- }>;
77
- /** Requests cancellation of the caller's currently executing command. */
78
- export declare const cancelMessageSchema: z.ZodObject<{
79
- type: z.ZodLiteral<"cancel">;
80
- id: z.ZodString;
81
- }, "strip", z.ZodTypeAny, {
82
- type: "cancel";
83
- id: string;
84
- }, {
85
- type: "cancel";
86
- id: string;
87
- }>;
88
- /** Request completion candidates for a partial line, correlated by `id`. */
89
- export declare const completeRequestSchema: z.ZodObject<{
90
- type: z.ZodLiteral<"complete">;
91
- id: z.ZodString;
92
- prefix: z.ZodString;
93
- }, "strip", z.ZodTypeAny, {
94
- type: "complete";
95
- id: string;
96
- prefix: string;
97
- }, {
98
- type: "complete";
99
- id: string;
100
- prefix: string;
101
- }>;
102
- /** Answers a prompt the daemon requested during a command, correlated by `promptId`. */
103
- export declare const promptAnswerMessageSchema: z.ZodObject<{
104
- type: z.ZodLiteral<"promptAnswer">;
105
- promptId: z.ZodString;
106
- answer: z.ZodString;
107
- }, "strip", z.ZodTypeAny, {
108
- type: "promptAnswer";
109
- promptId: string;
110
- answer: string;
111
- }, {
112
- type: "promptAnswer";
113
- promptId: string;
114
- answer: string;
115
- }>;
116
- /** Reports a prompt failure to the daemon (surface cannot or did not answer), correlated by `promptId`. */
117
- export declare const promptErrorMessageSchema: z.ZodObject<{
118
- type: z.ZodLiteral<"promptError">;
119
- promptId: z.ZodString;
120
- reason: z.ZodString;
121
- }, "strip", z.ZodTypeAny, {
122
- type: "promptError";
123
- promptId: string;
124
- reason: string;
125
- }, {
126
- type: "promptError";
127
- promptId: string;
128
- reason: string;
129
- }>;
130
- /** Returns the output of a pipeline segment the daemon asked the surface to run, correlated by `pipeId`. */
131
- export declare const pipeResultMessageSchema: z.ZodObject<{
132
- type: z.ZodLiteral<"pipeResult">;
133
- pipeId: z.ZodString;
134
- output: z.ZodString;
135
- }, "strip", z.ZodTypeAny, {
136
- type: "pipeResult";
137
- pipeId: string;
138
- output: string;
139
- }, {
140
- type: "pipeResult";
141
- pipeId: string;
142
- output: string;
143
- }>;
144
- /** Returns a pipeline-segment failure to the daemon, correlated by `pipeId`. */
145
- export declare const pipeErrorMessageSchema: z.ZodObject<{
146
- type: z.ZodLiteral<"pipeError">;
147
- pipeId: z.ZodString;
148
- reason: z.ZodString;
149
- }, "strip", z.ZodTypeAny, {
150
- type: "pipeError";
151
- reason: string;
152
- pipeId: string;
153
- }, {
154
- type: "pipeError";
155
- reason: string;
156
- pipeId: string;
157
- }>;
158
- /** Returns the exit code of a shell command the daemon asked the surface to run. */
159
- export declare const shellResultMessageSchema: z.ZodObject<{
160
- type: z.ZodLiteral<"shellResult">;
161
- shellId: z.ZodString;
162
- exitCode: z.ZodNumber;
163
- }, "strip", z.ZodTypeAny, {
164
- type: "shellResult";
165
- shellId: string;
166
- exitCode: number;
167
- }, {
168
- type: "shellResult";
169
- shellId: string;
170
- exitCode: number;
171
- }>;
172
- /** Returns a surface shell-launch failure to the daemon, correlated by `shellId`. */
173
- export declare const shellErrorMessageSchema: z.ZodObject<{
174
- type: z.ZodLiteral<"shellError">;
175
- shellId: z.ZodString;
176
- reason: z.ZodString;
177
- }, "strip", z.ZodTypeAny, {
178
- type: "shellError";
179
- reason: string;
180
- shellId: string;
181
- }, {
182
- type: "shellError";
183
- reason: string;
184
- shellId: string;
185
- }>;
186
- /** Returns the edited content from a local-edit the daemon requested, correlated by `editId`. */
187
- export declare const editResultMessageSchema: z.ZodObject<{
188
- type: z.ZodLiteral<"editResult">;
189
- editId: z.ZodString;
190
- content: z.ZodString;
191
- changed: z.ZodBoolean;
192
- }, "strip", z.ZodTypeAny, {
193
- type: "editResult";
194
- editId: string;
195
- content: string;
196
- changed: boolean;
197
- }, {
198
- type: "editResult";
199
- editId: string;
200
- content: string;
201
- changed: boolean;
202
- }>;
203
- /** Reports a local-edit failure to the daemon, correlated by `editId`. */
204
- export declare const editErrorMessageSchema: z.ZodObject<{
205
- type: z.ZodLiteral<"editError">;
206
- editId: z.ZodString;
207
- reason: z.ZodString;
208
- }, "strip", z.ZodTypeAny, {
209
- type: "editError";
210
- reason: string;
211
- editId: string;
212
- }, {
213
- type: "editError";
214
- reason: string;
215
- editId: string;
216
- }>;
217
- /** Any message a surface may send to the daemon. */
218
- export declare const clientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
219
- type: z.ZodLiteral<"attach">;
220
- protocolVersion: z.ZodNumber;
221
- token: z.ZodString;
222
- session: z.ZodOptional<z.ZodString>;
223
- capabilities: z.ZodOptional<z.ZodObject<{
224
- shellCommands: z.ZodBoolean;
225
- hiddenInput: z.ZodOptional<z.ZodBoolean>;
226
- }, "strip", z.ZodTypeAny, {
227
- shellCommands: boolean;
228
- hiddenInput?: boolean | undefined;
229
- }, {
230
- shellCommands: boolean;
231
- hiddenInput?: boolean | undefined;
232
- }>>;
233
- }, "strip", z.ZodTypeAny, {
234
- type: "attach";
235
- protocolVersion: number;
236
- token: string;
237
- session?: string | undefined;
238
- capabilities?: {
239
- shellCommands: boolean;
240
- hiddenInput?: boolean | undefined;
241
- } | undefined;
242
- }, {
243
- type: "attach";
244
- protocolVersion: number;
245
- token: string;
246
- session?: string | undefined;
247
- capabilities?: {
248
- shellCommands: boolean;
249
- hiddenInput?: boolean | undefined;
250
- } | undefined;
251
- }>, z.ZodObject<{
252
- type: z.ZodLiteral<"execute">;
253
- id: z.ZodString;
254
- line: z.ZodString;
255
- }, "strip", z.ZodTypeAny, {
256
- type: "execute";
257
- id: string;
258
- line: string;
259
- }, {
260
- type: "execute";
261
- id: string;
262
- line: string;
263
- }>, z.ZodObject<{
264
- type: z.ZodLiteral<"cancel">;
265
- id: z.ZodString;
266
- }, "strip", z.ZodTypeAny, {
267
- type: "cancel";
268
- id: string;
269
- }, {
270
- type: "cancel";
271
- id: string;
272
- }>, z.ZodObject<{
273
- type: z.ZodLiteral<"complete">;
274
- id: z.ZodString;
275
- prefix: z.ZodString;
276
- }, "strip", z.ZodTypeAny, {
277
- type: "complete";
278
- id: string;
279
- prefix: string;
280
- }, {
281
- type: "complete";
282
- id: string;
283
- prefix: string;
284
- }>, z.ZodObject<{
285
- type: z.ZodLiteral<"promptAnswer">;
286
- promptId: z.ZodString;
287
- answer: z.ZodString;
288
- }, "strip", z.ZodTypeAny, {
289
- type: "promptAnswer";
290
- promptId: string;
291
- answer: string;
292
- }, {
293
- type: "promptAnswer";
294
- promptId: string;
295
- answer: string;
296
- }>, z.ZodObject<{
297
- type: z.ZodLiteral<"promptError">;
298
- promptId: z.ZodString;
299
- reason: z.ZodString;
300
- }, "strip", z.ZodTypeAny, {
301
- type: "promptError";
302
- promptId: string;
303
- reason: string;
304
- }, {
305
- type: "promptError";
306
- promptId: string;
307
- reason: string;
308
- }>, z.ZodObject<{
309
- type: z.ZodLiteral<"pipeResult">;
310
- pipeId: z.ZodString;
311
- output: z.ZodString;
312
- }, "strip", z.ZodTypeAny, {
313
- type: "pipeResult";
314
- pipeId: string;
315
- output: string;
316
- }, {
317
- type: "pipeResult";
318
- pipeId: string;
319
- output: string;
320
- }>, z.ZodObject<{
321
- type: z.ZodLiteral<"pipeError">;
322
- pipeId: z.ZodString;
323
- reason: z.ZodString;
324
- }, "strip", z.ZodTypeAny, {
325
- type: "pipeError";
326
- reason: string;
327
- pipeId: string;
328
- }, {
329
- type: "pipeError";
330
- reason: string;
331
- pipeId: string;
332
- }>, z.ZodObject<{
333
- type: z.ZodLiteral<"shellResult">;
334
- shellId: z.ZodString;
335
- exitCode: z.ZodNumber;
336
- }, "strip", z.ZodTypeAny, {
337
- type: "shellResult";
338
- shellId: string;
339
- exitCode: number;
340
- }, {
341
- type: "shellResult";
342
- shellId: string;
343
- exitCode: number;
344
- }>, z.ZodObject<{
345
- type: z.ZodLiteral<"shellError">;
346
- shellId: z.ZodString;
347
- reason: z.ZodString;
348
- }, "strip", z.ZodTypeAny, {
349
- type: "shellError";
350
- reason: string;
351
- shellId: string;
352
- }, {
353
- type: "shellError";
354
- reason: string;
355
- shellId: string;
356
- }>, z.ZodObject<{
357
- type: z.ZodLiteral<"editResult">;
358
- editId: z.ZodString;
359
- content: z.ZodString;
360
- changed: z.ZodBoolean;
361
- }, "strip", z.ZodTypeAny, {
362
- type: "editResult";
363
- editId: string;
364
- content: string;
365
- changed: boolean;
366
- }, {
367
- type: "editResult";
368
- editId: string;
369
- content: string;
370
- changed: boolean;
371
- }>, z.ZodObject<{
372
- type: z.ZodLiteral<"editError">;
373
- editId: z.ZodString;
374
- reason: z.ZodString;
375
- }, "strip", z.ZodTypeAny, {
376
- type: "editError";
377
- reason: string;
378
- editId: string;
379
- }, {
380
- type: "editError";
381
- reason: string;
382
- editId: string;
383
- }>]>;
384
- /** A message a surface sends to the daemon. */
385
- export type ClientMessage = z.infer<typeof clientMessageSchema>;
386
- /**
387
- * Acknowledges a successful attach. The optional `stack` block reports the
388
- * daemon's own installed versions and build hash, so a remote surface can
389
- * greet with the truth of the process it attached to rather than whatever is
390
- * installed client-side; older daemons simply omit it.
391
- */
392
- export declare const attachedMessageSchema: z.ZodObject<{
393
- type: z.ZodLiteral<"attached">;
394
- session: z.ZodString;
395
- protocolVersion: z.ZodNumber;
396
- stack: z.ZodOptional<z.ZodObject<{
397
- chell: z.ZodString;
398
- calypso: z.ZodString;
399
- build: z.ZodString;
400
- brasa: z.ZodOptional<z.ZodString>;
401
- chili: z.ZodOptional<z.ZodString>;
402
- salsa: z.ZodOptional<z.ZodString>;
403
- cumin: z.ZodOptional<z.ZodString>;
404
- }, "strip", z.ZodTypeAny, {
405
- chell: string;
406
- calypso: string;
407
- build: string;
408
- brasa?: string | undefined;
409
- chili?: string | undefined;
410
- salsa?: string | undefined;
411
- cumin?: string | undefined;
412
- }, {
413
- chell: string;
414
- calypso: string;
415
- build: string;
416
- brasa?: string | undefined;
417
- chili?: string | undefined;
418
- salsa?: string | undefined;
419
- cumin?: string | undefined;
420
- }>>;
421
- }, "strip", z.ZodTypeAny, {
422
- type: "attached";
423
- protocolVersion: number;
424
- session: string;
425
- stack?: {
426
- chell: string;
427
- calypso: string;
428
- build: string;
429
- brasa?: string | undefined;
430
- chili?: string | undefined;
431
- salsa?: string | undefined;
432
- cumin?: string | undefined;
433
- } | undefined;
434
- }, {
435
- type: "attached";
436
- protocolVersion: number;
437
- session: string;
438
- stack?: {
439
- chell: string;
440
- calypso: string;
441
- build: string;
442
- brasa?: string | undefined;
443
- chili?: string | undefined;
444
- salsa?: string | undefined;
445
- cumin?: string | undefined;
446
- } | undefined;
447
- }>;
448
- /** The final result of one executed line: one envelope per command. */
449
- export declare const resultMessageSchema: z.ZodObject<{
450
- type: z.ZodLiteral<"result">;
451
- id: z.ZodString;
452
- envelopes: z.ZodArray<z.ZodObject<{
453
- status: z.ZodEnum<["ok", "error"]>;
454
- rendered: z.ZodString;
455
- renderedErr: z.ZodOptional<z.ZodString>;
456
- model: z.ZodOptional<z.ZodObject<{
457
- kind: z.ZodString;
458
- data: z.ZodUnknown;
459
- }, "strip", z.ZodTypeAny, {
460
- kind: string;
461
- data?: unknown;
462
- }, {
463
- kind: string;
464
- data?: unknown;
465
- }>>;
466
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
467
- type: z.ZodEnum<["error", "warning"]>;
468
- message: z.ZodString;
469
- }, "strip", z.ZodTypeAny, {
470
- type: "error" | "warning";
471
- message: string;
472
- }, {
473
- type: "error" | "warning";
474
- message: string;
475
- }>, "many">>;
476
- trace: z.ZodOptional<z.ZodObject<{
477
- input: z.ZodString;
478
- proposed: z.ZodString;
479
- validated: z.ZodBoolean;
480
- executed: z.ZodOptional<z.ZodString>;
481
- }, "strip", z.ZodTypeAny, {
482
- input: string;
483
- proposed: string;
484
- validated: boolean;
485
- executed?: string | undefined;
486
- }, {
487
- input: string;
488
- proposed: string;
489
- validated: boolean;
490
- executed?: string | undefined;
491
- }>>;
492
- }, "strip", z.ZodTypeAny, {
493
- status: "error" | "ok";
494
- rendered: string;
495
- renderedErr?: string | undefined;
496
- model?: {
497
- kind: string;
498
- data?: unknown;
499
- } | undefined;
500
- errors?: {
501
- type: "error" | "warning";
502
- message: string;
503
- }[] | undefined;
504
- trace?: {
505
- input: string;
506
- proposed: string;
507
- validated: boolean;
508
- executed?: string | undefined;
509
- } | undefined;
510
- }, {
511
- status: "error" | "ok";
512
- rendered: string;
513
- renderedErr?: string | undefined;
514
- model?: {
515
- kind: string;
516
- data?: unknown;
517
- } | undefined;
518
- errors?: {
519
- type: "error" | "warning";
520
- message: string;
521
- }[] | undefined;
522
- trace?: {
523
- input: string;
524
- proposed: string;
525
- validated: boolean;
526
- executed?: string | undefined;
527
- } | undefined;
528
- }>, "many">;
529
- }, "strip", z.ZodTypeAny, {
530
- type: "result";
531
- id: string;
532
- envelopes: {
533
- status: "error" | "ok";
534
- rendered: string;
535
- renderedErr?: string | undefined;
536
- model?: {
537
- kind: string;
538
- data?: unknown;
539
- } | undefined;
540
- errors?: {
541
- type: "error" | "warning";
542
- message: string;
543
- }[] | undefined;
544
- trace?: {
545
- input: string;
546
- proposed: string;
547
- validated: boolean;
548
- executed?: string | undefined;
549
- } | undefined;
550
- }[];
551
- }, {
552
- type: "result";
553
- id: string;
554
- envelopes: {
555
- status: "error" | "ok";
556
- rendered: string;
557
- renderedErr?: string | undefined;
558
- model?: {
559
- kind: string;
560
- data?: unknown;
561
- } | undefined;
562
- errors?: {
563
- type: "error" | "warning";
564
- message: string;
565
- }[] | undefined;
566
- trace?: {
567
- input: string;
568
- proposed: string;
569
- validated: boolean;
570
- executed?: string | undefined;
571
- } | undefined;
572
- }[];
573
- }>;
574
- /** The reply to a completion request. */
575
- export declare const completeReplySchema: z.ZodObject<{
576
- type: z.ZodLiteral<"complete">;
577
- id: z.ZodString;
578
- prefix: z.ZodString;
579
- candidates: z.ZodArray<z.ZodString, "many">;
580
- }, "strip", z.ZodTypeAny, {
581
- type: "complete";
582
- id: string;
583
- prefix: string;
584
- candidates: string[];
585
- }, {
586
- type: "complete";
587
- id: string;
588
- prefix: string;
589
- candidates: string[];
590
- }>;
591
- /** A streamed output event on one channel, correlated to its command. */
592
- export declare const outputMessageSchema: z.ZodObject<{
593
- type: z.ZodLiteral<"output">;
594
- id: z.ZodString;
595
- channel: z.ZodEnum<["data", "err", "status"]>;
596
- chunk: z.ZodString;
597
- }, "strip", z.ZodTypeAny, {
598
- type: "output";
599
- id: string;
600
- channel: "data" | "status" | "err";
601
- chunk: string;
602
- }, {
603
- type: "output";
604
- id: string;
605
- channel: "data" | "status" | "err";
606
- chunk: string;
607
- }>;
608
- /** The operation producing structured progress. */
609
- export declare const progressOperationSchema: z.ZodEnum<["upload", "download", "pull", "workflow", "pipeline", "group"]>;
610
- /** Broad class of progress producer. */
611
- export declare const progressKindSchema: z.ZodEnum<["transfer", "retrieve", "workflow", "inspection"]>;
612
- /** Lifecycle phase of a progress operation. */
613
- export declare const progressPhaseSchema: z.ZodEnum<["scanning", "transferring", "watching", "retrying", "reading", "complete", "failed"]>;
614
- /** Unit used by the primary progress counter. */
615
- export declare const progressUnitSchema: z.ZodEnum<["files", "bytes", "series", "jobs", "nodes"]>;
616
- /** State of the operation or item being reported. */
617
- export declare const progressStatusSchema: z.ZodEnum<["running", "done", "unconfirmed", "stalled", "timeout", "error", "unknown"]>;
618
- /** A structured progress event correlated to a command. */
619
- export declare const progressMessageSchema: z.ZodObject<{
620
- type: z.ZodLiteral<"progress">;
621
- id: z.ZodString;
622
- operation: z.ZodEnum<["upload", "download", "pull", "workflow", "pipeline", "group"]>;
623
- kind: z.ZodOptional<z.ZodEnum<["transfer", "retrieve", "workflow", "inspection"]>>;
624
- phase: z.ZodEnum<["scanning", "transferring", "watching", "retrying", "reading", "complete", "failed"]>;
625
- label: z.ZodOptional<z.ZodString>;
626
- itemId: z.ZodOptional<z.ZodString>;
627
- current: z.ZodOptional<z.ZodNumber>;
628
- total: z.ZodOptional<z.ZodNumber>;
629
- percent: z.ZodOptional<z.ZodNumber>;
630
- unit: z.ZodOptional<z.ZodEnum<["files", "bytes", "series", "jobs", "nodes"]>>;
631
- status: z.ZodOptional<z.ZodEnum<["running", "done", "unconfirmed", "stalled", "timeout", "error", "unknown"]>>;
632
- }, "strip", z.ZodTypeAny, {
633
- type: "progress";
634
- id: string;
635
- operation: "upload" | "download" | "pull" | "workflow" | "pipeline" | "group";
636
- phase: "complete" | "scanning" | "transferring" | "watching" | "retrying" | "reading" | "failed";
637
- status?: "error" | "unknown" | "running" | "done" | "unconfirmed" | "stalled" | "timeout" | undefined;
638
- kind?: "workflow" | "transfer" | "retrieve" | "inspection" | undefined;
639
- label?: string | undefined;
640
- itemId?: string | undefined;
641
- current?: number | undefined;
642
- total?: number | undefined;
643
- percent?: number | undefined;
644
- unit?: "files" | "bytes" | "series" | "jobs" | "nodes" | undefined;
645
- }, {
646
- type: "progress";
647
- id: string;
648
- operation: "upload" | "download" | "pull" | "workflow" | "pipeline" | "group";
649
- phase: "complete" | "scanning" | "transferring" | "watching" | "retrying" | "reading" | "failed";
650
- status?: "error" | "unknown" | "running" | "done" | "unconfirmed" | "stalled" | "timeout" | undefined;
651
- kind?: "workflow" | "transfer" | "retrieve" | "inspection" | undefined;
652
- label?: string | undefined;
653
- itemId?: string | undefined;
654
- current?: number | undefined;
655
- total?: number | undefined;
656
- percent?: number | undefined;
657
- unit?: "files" | "bytes" | "series" | "jobs" | "nodes" | undefined;
658
- }>;
659
- /** The progress payload before command correlation is added by the daemon. */
660
- export type ProgressEvent = Omit<z.infer<typeof progressMessageSchema>, 'type' | 'id'>;
661
- /** A session-bus broadcast: an envelope tagged with its originating surface. */
662
- export declare const sessionMessageSchema: z.ZodObject<{
663
- type: z.ZodLiteral<"session">;
664
- surface: z.ZodString;
665
- envelope: z.ZodObject<{
666
- status: z.ZodEnum<["ok", "error"]>;
667
- rendered: z.ZodString;
668
- renderedErr: z.ZodOptional<z.ZodString>;
669
- model: z.ZodOptional<z.ZodObject<{
670
- kind: z.ZodString;
671
- data: z.ZodUnknown;
672
- }, "strip", z.ZodTypeAny, {
673
- kind: string;
674
- data?: unknown;
675
- }, {
676
- kind: string;
677
- data?: unknown;
678
- }>>;
679
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
680
- type: z.ZodEnum<["error", "warning"]>;
681
- message: z.ZodString;
682
- }, "strip", z.ZodTypeAny, {
683
- type: "error" | "warning";
684
- message: string;
685
- }, {
686
- type: "error" | "warning";
687
- message: string;
688
- }>, "many">>;
689
- trace: z.ZodOptional<z.ZodObject<{
690
- input: z.ZodString;
691
- proposed: z.ZodString;
692
- validated: z.ZodBoolean;
693
- executed: z.ZodOptional<z.ZodString>;
694
- }, "strip", z.ZodTypeAny, {
695
- input: string;
696
- proposed: string;
697
- validated: boolean;
698
- executed?: string | undefined;
699
- }, {
700
- input: string;
701
- proposed: string;
702
- validated: boolean;
703
- executed?: string | undefined;
704
- }>>;
705
- }, "strip", z.ZodTypeAny, {
706
- status: "error" | "ok";
707
- rendered: string;
708
- renderedErr?: string | undefined;
709
- model?: {
710
- kind: string;
711
- data?: unknown;
712
- } | undefined;
713
- errors?: {
714
- type: "error" | "warning";
715
- message: string;
716
- }[] | undefined;
717
- trace?: {
718
- input: string;
719
- proposed: string;
720
- validated: boolean;
721
- executed?: string | undefined;
722
- } | undefined;
723
- }, {
724
- status: "error" | "ok";
725
- rendered: string;
726
- renderedErr?: string | undefined;
727
- model?: {
728
- kind: string;
729
- data?: unknown;
730
- } | undefined;
731
- errors?: {
732
- type: "error" | "warning";
733
- message: string;
734
- }[] | undefined;
735
- trace?: {
736
- input: string;
737
- proposed: string;
738
- validated: boolean;
739
- executed?: string | undefined;
740
- } | undefined;
741
- }>;
742
- }, "strip", z.ZodTypeAny, {
743
- type: "session";
744
- surface: string;
745
- envelope: {
746
- status: "error" | "ok";
747
- rendered: string;
748
- renderedErr?: string | undefined;
749
- model?: {
750
- kind: string;
751
- data?: unknown;
752
- } | undefined;
753
- errors?: {
754
- type: "error" | "warning";
755
- message: string;
756
- }[] | undefined;
757
- trace?: {
758
- input: string;
759
- proposed: string;
760
- validated: boolean;
761
- executed?: string | undefined;
762
- } | undefined;
763
- };
764
- }, {
765
- type: "session";
766
- surface: string;
767
- envelope: {
768
- status: "error" | "ok";
769
- rendered: string;
770
- renderedErr?: string | undefined;
771
- model?: {
772
- kind: string;
773
- data?: unknown;
774
- } | undefined;
775
- errors?: {
776
- type: "error" | "warning";
777
- message: string;
778
- }[] | undefined;
779
- trace?: {
780
- input: string;
781
- proposed: string;
782
- validated: boolean;
783
- executed?: string | undefined;
784
- } | undefined;
785
- };
786
- }>;
787
- /** A boundary error: a refused attach, a malformed message, correlated when possible. */
788
- export declare const errorMessageSchema: z.ZodObject<{
789
- type: z.ZodLiteral<"error">;
790
- id: z.ZodOptional<z.ZodString>;
791
- reason: z.ZodString;
792
- }, "strip", z.ZodTypeAny, {
793
- type: "error";
794
- reason: string;
795
- id?: string | undefined;
796
- }, {
797
- type: "error";
798
- reason: string;
799
- id?: string | undefined;
800
- }>;
801
- /**
802
- * A prompt request the daemon raises during a command: the surface that
803
- * submitted the command must answer it (with `promptAnswer`) before the
804
- * command can proceed. `hidden` requests no-echo entry (password).
805
- */
806
- export declare const promptMessageSchema: z.ZodObject<{
807
- type: z.ZodLiteral<"prompt">;
808
- promptId: z.ZodString;
809
- message: z.ZodString;
810
- hidden: z.ZodBoolean;
811
- }, "strip", z.ZodTypeAny, {
812
- type: "prompt";
813
- message: string;
814
- promptId: string;
815
- hidden: boolean;
816
- }, {
817
- type: "prompt";
818
- message: string;
819
- promptId: string;
820
- hidden: boolean;
821
- }>;
822
- /**
823
- * The engine-known facts a prompt reflects, independent of any theme.
824
- *
825
- * The daemon knows the session context but not how a given surface renders it,
826
- * so it ships these facts and each surface themes them with its own settings.
827
- * Rendering inputs a surface owns (theme, segments, terminal width) are not
828
- * carried here.
829
- */
830
- export declare const promptContextSchema: z.ZodObject<{
831
- user: z.ZodString;
832
- uri: z.ZodString;
833
- cwd: z.ZodString;
834
- pacsserver: z.ZodNullable<z.ZodString>;
835
- physicalMode: z.ZodBoolean;
836
- lastExitCode: z.ZodNumber;
837
- lastCommandDurationMs: z.ZodNumber;
838
- procWarmup: z.ZodOptional<z.ZodObject<{
839
- loaded: z.ZodNumber;
840
- total: z.ZodOptional<z.ZodNumber>;
841
- restored: z.ZodOptional<z.ZodBoolean>;
842
- state: z.ZodOptional<z.ZodEnum<["cold", "cached", "failed"]>>;
843
- }, "strip", z.ZodTypeAny, {
844
- loaded: number;
845
- total?: number | undefined;
846
- restored?: boolean | undefined;
847
- state?: "failed" | "cold" | "cached" | undefined;
848
- }, {
849
- loaded: number;
850
- total?: number | undefined;
851
- restored?: boolean | undefined;
852
- state?: "failed" | "cold" | "cached" | undefined;
853
- }>>;
854
- }, "strip", z.ZodTypeAny, {
855
- user: string;
856
- uri: string;
857
- cwd: string;
858
- pacsserver: string | null;
859
- physicalMode: boolean;
860
- lastExitCode: number;
861
- lastCommandDurationMs: number;
862
- procWarmup?: {
863
- loaded: number;
864
- total?: number | undefined;
865
- restored?: boolean | undefined;
866
- state?: "failed" | "cold" | "cached" | undefined;
867
- } | undefined;
868
- }, {
869
- user: string;
870
- uri: string;
871
- cwd: string;
872
- pacsserver: string | null;
873
- physicalMode: boolean;
874
- lastExitCode: number;
875
- lastCommandDurationMs: number;
876
- procWarmup?: {
877
- loaded: number;
878
- total?: number | undefined;
879
- restored?: boolean | undefined;
880
- state?: "failed" | "cold" | "cached" | undefined;
881
- } | undefined;
882
- }>;
883
- export type PromptContext = z.infer<typeof promptContextSchema>;
884
- /**
885
- * The prompt context, pushed by the daemon with each result and on any context
886
- * change. The daemon knows the session context; each surface renders it with
887
- * its own theme, so prompt themes are a per-surface choice rather than the
888
- * daemon's.
889
- */
890
- export declare const promptLineMessageSchema: z.ZodObject<{
891
- type: z.ZodLiteral<"promptline">;
892
- context: z.ZodObject<{
893
- user: z.ZodString;
894
- uri: z.ZodString;
895
- cwd: z.ZodString;
896
- pacsserver: z.ZodNullable<z.ZodString>;
897
- physicalMode: z.ZodBoolean;
898
- lastExitCode: z.ZodNumber;
899
- lastCommandDurationMs: z.ZodNumber;
900
- procWarmup: z.ZodOptional<z.ZodObject<{
901
- loaded: z.ZodNumber;
902
- total: z.ZodOptional<z.ZodNumber>;
903
- restored: z.ZodOptional<z.ZodBoolean>;
904
- state: z.ZodOptional<z.ZodEnum<["cold", "cached", "failed"]>>;
905
- }, "strip", z.ZodTypeAny, {
906
- loaded: number;
907
- total?: number | undefined;
908
- restored?: boolean | undefined;
909
- state?: "failed" | "cold" | "cached" | undefined;
910
- }, {
911
- loaded: number;
912
- total?: number | undefined;
913
- restored?: boolean | undefined;
914
- state?: "failed" | "cold" | "cached" | undefined;
915
- }>>;
916
- }, "strip", z.ZodTypeAny, {
917
- user: string;
918
- uri: string;
919
- cwd: string;
920
- pacsserver: string | null;
921
- physicalMode: boolean;
922
- lastExitCode: number;
923
- lastCommandDurationMs: number;
924
- procWarmup?: {
925
- loaded: number;
926
- total?: number | undefined;
927
- restored?: boolean | undefined;
928
- state?: "failed" | "cold" | "cached" | undefined;
929
- } | undefined;
930
- }, {
931
- user: string;
932
- uri: string;
933
- cwd: string;
934
- pacsserver: string | null;
935
- physicalMode: boolean;
936
- lastExitCode: number;
937
- lastCommandDurationMs: number;
938
- procWarmup?: {
939
- loaded: number;
940
- total?: number | undefined;
941
- restored?: boolean | undefined;
942
- state?: "failed" | "cold" | "cached" | undefined;
943
- } | undefined;
944
- }>;
945
- }, "strip", z.ZodTypeAny, {
946
- type: "promptline";
947
- context: {
948
- user: string;
949
- uri: string;
950
- cwd: string;
951
- pacsserver: string | null;
952
- physicalMode: boolean;
953
- lastExitCode: number;
954
- lastCommandDurationMs: number;
955
- procWarmup?: {
956
- loaded: number;
957
- total?: number | undefined;
958
- restored?: boolean | undefined;
959
- state?: "failed" | "cold" | "cached" | undefined;
960
- } | undefined;
961
- };
962
- }, {
963
- type: "promptline";
964
- context: {
965
- user: string;
966
- uri: string;
967
- cwd: string;
968
- pacsserver: string | null;
969
- physicalMode: boolean;
970
- lastExitCode: number;
971
- lastCommandDurationMs: number;
972
- procWarmup?: {
973
- loaded: number;
974
- total?: number | undefined;
975
- restored?: boolean | undefined;
976
- state?: "failed" | "cold" | "cached" | undefined;
977
- } | undefined;
978
- };
979
- }>;
980
- /**
981
- * Asks the surface to run a pipeline segment on its own machine (never on the
982
- * daemon host) and return the output. `input` and the reply's `output` are
983
- * base64, since segment data is arbitrary bytes.
984
- */
985
- export declare const pipeMessageSchema: z.ZodObject<{
986
- type: z.ZodLiteral<"pipe">;
987
- pipeId: z.ZodString;
988
- command: z.ZodString;
989
- input: z.ZodString;
990
- }, "strip", z.ZodTypeAny, {
991
- type: "pipe";
992
- input: string;
993
- pipeId: string;
994
- command: string;
995
- }, {
996
- type: "pipe";
997
- input: string;
998
- pipeId: string;
999
- command: string;
1000
- }>;
1001
- /** Asks the surface to run a shell command on its own machine, never on the daemon host. */
1002
- export declare const shellMessageSchema: z.ZodObject<{
1003
- type: z.ZodLiteral<"shell">;
1004
- shellId: z.ZodString;
1005
- command: z.ZodString;
1006
- }, "strip", z.ZodTypeAny, {
1007
- type: "shell";
1008
- shellId: string;
1009
- command: string;
1010
- }, {
1011
- type: "shell";
1012
- shellId: string;
1013
- command: string;
1014
- }>;
1015
- /**
1016
- * Asks the surface to open content in its local editor (never on the daemon
1017
- * host) and return the edited result.
1018
- */
1019
- export declare const editMessageSchema: z.ZodObject<{
1020
- type: z.ZodLiteral<"edit">;
1021
- editId: z.ZodString;
1022
- content: z.ZodString;
1023
- extension: z.ZodOptional<z.ZodString>;
1024
- }, "strip", z.ZodTypeAny, {
1025
- type: "edit";
1026
- editId: string;
1027
- content: string;
1028
- extension?: string | undefined;
1029
- }, {
1030
- type: "edit";
1031
- editId: string;
1032
- content: string;
1033
- extension?: string | undefined;
1034
- }>;
1035
- /** Any message the daemon may send to a surface. */
1036
- export declare const serverMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1037
- type: z.ZodLiteral<"attached">;
1038
- session: z.ZodString;
1039
- protocolVersion: z.ZodNumber;
1040
- stack: z.ZodOptional<z.ZodObject<{
1041
- chell: z.ZodString;
1042
- calypso: z.ZodString;
1043
- build: z.ZodString;
1044
- brasa: z.ZodOptional<z.ZodString>;
1045
- chili: z.ZodOptional<z.ZodString>;
1046
- salsa: z.ZodOptional<z.ZodString>;
1047
- cumin: z.ZodOptional<z.ZodString>;
1048
- }, "strip", z.ZodTypeAny, {
1049
- chell: string;
1050
- calypso: string;
1051
- build: string;
1052
- brasa?: string | undefined;
1053
- chili?: string | undefined;
1054
- salsa?: string | undefined;
1055
- cumin?: string | undefined;
1056
- }, {
1057
- chell: string;
1058
- calypso: string;
1059
- build: string;
1060
- brasa?: string | undefined;
1061
- chili?: string | undefined;
1062
- salsa?: string | undefined;
1063
- cumin?: string | undefined;
1064
- }>>;
1065
- }, "strip", z.ZodTypeAny, {
1066
- type: "attached";
1067
- protocolVersion: number;
1068
- session: string;
1069
- stack?: {
1070
- chell: string;
1071
- calypso: string;
1072
- build: string;
1073
- brasa?: string | undefined;
1074
- chili?: string | undefined;
1075
- salsa?: string | undefined;
1076
- cumin?: string | undefined;
1077
- } | undefined;
1078
- }, {
1079
- type: "attached";
1080
- protocolVersion: number;
1081
- session: string;
1082
- stack?: {
1083
- chell: string;
1084
- calypso: string;
1085
- build: string;
1086
- brasa?: string | undefined;
1087
- chili?: string | undefined;
1088
- salsa?: string | undefined;
1089
- cumin?: string | undefined;
1090
- } | undefined;
1091
- }>, z.ZodObject<{
1092
- type: z.ZodLiteral<"result">;
1093
- id: z.ZodString;
1094
- envelopes: z.ZodArray<z.ZodObject<{
1095
- status: z.ZodEnum<["ok", "error"]>;
1096
- rendered: z.ZodString;
1097
- renderedErr: z.ZodOptional<z.ZodString>;
1098
- model: z.ZodOptional<z.ZodObject<{
1099
- kind: z.ZodString;
1100
- data: z.ZodUnknown;
1101
- }, "strip", z.ZodTypeAny, {
1102
- kind: string;
1103
- data?: unknown;
1104
- }, {
1105
- kind: string;
1106
- data?: unknown;
1107
- }>>;
1108
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1109
- type: z.ZodEnum<["error", "warning"]>;
1110
- message: z.ZodString;
1111
- }, "strip", z.ZodTypeAny, {
1112
- type: "error" | "warning";
1113
- message: string;
1114
- }, {
1115
- type: "error" | "warning";
1116
- message: string;
1117
- }>, "many">>;
1118
- trace: z.ZodOptional<z.ZodObject<{
1119
- input: z.ZodString;
1120
- proposed: z.ZodString;
1121
- validated: z.ZodBoolean;
1122
- executed: z.ZodOptional<z.ZodString>;
1123
- }, "strip", z.ZodTypeAny, {
1124
- input: string;
1125
- proposed: string;
1126
- validated: boolean;
1127
- executed?: string | undefined;
1128
- }, {
1129
- input: string;
1130
- proposed: string;
1131
- validated: boolean;
1132
- executed?: string | undefined;
1133
- }>>;
1134
- }, "strip", z.ZodTypeAny, {
1135
- status: "error" | "ok";
1136
- rendered: string;
1137
- renderedErr?: string | undefined;
1138
- model?: {
1139
- kind: string;
1140
- data?: unknown;
1141
- } | undefined;
1142
- errors?: {
1143
- type: "error" | "warning";
1144
- message: string;
1145
- }[] | undefined;
1146
- trace?: {
1147
- input: string;
1148
- proposed: string;
1149
- validated: boolean;
1150
- executed?: string | undefined;
1151
- } | undefined;
1152
- }, {
1153
- status: "error" | "ok";
1154
- rendered: string;
1155
- renderedErr?: string | undefined;
1156
- model?: {
1157
- kind: string;
1158
- data?: unknown;
1159
- } | undefined;
1160
- errors?: {
1161
- type: "error" | "warning";
1162
- message: string;
1163
- }[] | undefined;
1164
- trace?: {
1165
- input: string;
1166
- proposed: string;
1167
- validated: boolean;
1168
- executed?: string | undefined;
1169
- } | undefined;
1170
- }>, "many">;
1171
- }, "strip", z.ZodTypeAny, {
1172
- type: "result";
1173
- id: string;
1174
- envelopes: {
1175
- status: "error" | "ok";
1176
- rendered: string;
1177
- renderedErr?: string | undefined;
1178
- model?: {
1179
- kind: string;
1180
- data?: unknown;
1181
- } | undefined;
1182
- errors?: {
1183
- type: "error" | "warning";
1184
- message: string;
1185
- }[] | undefined;
1186
- trace?: {
1187
- input: string;
1188
- proposed: string;
1189
- validated: boolean;
1190
- executed?: string | undefined;
1191
- } | undefined;
1192
- }[];
1193
- }, {
1194
- type: "result";
1195
- id: string;
1196
- envelopes: {
1197
- status: "error" | "ok";
1198
- rendered: string;
1199
- renderedErr?: string | undefined;
1200
- model?: {
1201
- kind: string;
1202
- data?: unknown;
1203
- } | undefined;
1204
- errors?: {
1205
- type: "error" | "warning";
1206
- message: string;
1207
- }[] | undefined;
1208
- trace?: {
1209
- input: string;
1210
- proposed: string;
1211
- validated: boolean;
1212
- executed?: string | undefined;
1213
- } | undefined;
1214
- }[];
1215
- }>, z.ZodObject<{
1216
- type: z.ZodLiteral<"complete">;
1217
- id: z.ZodString;
1218
- prefix: z.ZodString;
1219
- candidates: z.ZodArray<z.ZodString, "many">;
1220
- }, "strip", z.ZodTypeAny, {
1221
- type: "complete";
1222
- id: string;
1223
- prefix: string;
1224
- candidates: string[];
1225
- }, {
1226
- type: "complete";
1227
- id: string;
1228
- prefix: string;
1229
- candidates: string[];
1230
- }>, z.ZodObject<{
1231
- type: z.ZodLiteral<"output">;
1232
- id: z.ZodString;
1233
- channel: z.ZodEnum<["data", "err", "status"]>;
1234
- chunk: z.ZodString;
1235
- }, "strip", z.ZodTypeAny, {
1236
- type: "output";
1237
- id: string;
1238
- channel: "data" | "status" | "err";
1239
- chunk: string;
1240
- }, {
1241
- type: "output";
1242
- id: string;
1243
- channel: "data" | "status" | "err";
1244
- chunk: string;
1245
- }>, z.ZodObject<{
1246
- type: z.ZodLiteral<"progress">;
1247
- id: z.ZodString;
1248
- operation: z.ZodEnum<["upload", "download", "pull", "workflow", "pipeline", "group"]>;
1249
- kind: z.ZodOptional<z.ZodEnum<["transfer", "retrieve", "workflow", "inspection"]>>;
1250
- phase: z.ZodEnum<["scanning", "transferring", "watching", "retrying", "reading", "complete", "failed"]>;
1251
- label: z.ZodOptional<z.ZodString>;
1252
- itemId: z.ZodOptional<z.ZodString>;
1253
- current: z.ZodOptional<z.ZodNumber>;
1254
- total: z.ZodOptional<z.ZodNumber>;
1255
- percent: z.ZodOptional<z.ZodNumber>;
1256
- unit: z.ZodOptional<z.ZodEnum<["files", "bytes", "series", "jobs", "nodes"]>>;
1257
- status: z.ZodOptional<z.ZodEnum<["running", "done", "unconfirmed", "stalled", "timeout", "error", "unknown"]>>;
1258
- }, "strip", z.ZodTypeAny, {
1259
- type: "progress";
1260
- id: string;
1261
- operation: "upload" | "download" | "pull" | "workflow" | "pipeline" | "group";
1262
- phase: "complete" | "scanning" | "transferring" | "watching" | "retrying" | "reading" | "failed";
1263
- status?: "error" | "unknown" | "running" | "done" | "unconfirmed" | "stalled" | "timeout" | undefined;
1264
- kind?: "workflow" | "transfer" | "retrieve" | "inspection" | undefined;
1265
- label?: string | undefined;
1266
- itemId?: string | undefined;
1267
- current?: number | undefined;
1268
- total?: number | undefined;
1269
- percent?: number | undefined;
1270
- unit?: "files" | "bytes" | "series" | "jobs" | "nodes" | undefined;
1271
- }, {
1272
- type: "progress";
1273
- id: string;
1274
- operation: "upload" | "download" | "pull" | "workflow" | "pipeline" | "group";
1275
- phase: "complete" | "scanning" | "transferring" | "watching" | "retrying" | "reading" | "failed";
1276
- status?: "error" | "unknown" | "running" | "done" | "unconfirmed" | "stalled" | "timeout" | undefined;
1277
- kind?: "workflow" | "transfer" | "retrieve" | "inspection" | undefined;
1278
- label?: string | undefined;
1279
- itemId?: string | undefined;
1280
- current?: number | undefined;
1281
- total?: number | undefined;
1282
- percent?: number | undefined;
1283
- unit?: "files" | "bytes" | "series" | "jobs" | "nodes" | undefined;
1284
- }>, z.ZodObject<{
1285
- type: z.ZodLiteral<"session">;
1286
- surface: z.ZodString;
1287
- envelope: z.ZodObject<{
1288
- status: z.ZodEnum<["ok", "error"]>;
1289
- rendered: z.ZodString;
1290
- renderedErr: z.ZodOptional<z.ZodString>;
1291
- model: z.ZodOptional<z.ZodObject<{
1292
- kind: z.ZodString;
1293
- data: z.ZodUnknown;
1294
- }, "strip", z.ZodTypeAny, {
1295
- kind: string;
1296
- data?: unknown;
1297
- }, {
1298
- kind: string;
1299
- data?: unknown;
1300
- }>>;
1301
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1302
- type: z.ZodEnum<["error", "warning"]>;
1303
- message: z.ZodString;
1304
- }, "strip", z.ZodTypeAny, {
1305
- type: "error" | "warning";
1306
- message: string;
1307
- }, {
1308
- type: "error" | "warning";
1309
- message: string;
1310
- }>, "many">>;
1311
- trace: z.ZodOptional<z.ZodObject<{
1312
- input: z.ZodString;
1313
- proposed: z.ZodString;
1314
- validated: z.ZodBoolean;
1315
- executed: z.ZodOptional<z.ZodString>;
1316
- }, "strip", z.ZodTypeAny, {
1317
- input: string;
1318
- proposed: string;
1319
- validated: boolean;
1320
- executed?: string | undefined;
1321
- }, {
1322
- input: string;
1323
- proposed: string;
1324
- validated: boolean;
1325
- executed?: string | undefined;
1326
- }>>;
1327
- }, "strip", z.ZodTypeAny, {
1328
- status: "error" | "ok";
1329
- rendered: string;
1330
- renderedErr?: string | undefined;
1331
- model?: {
1332
- kind: string;
1333
- data?: unknown;
1334
- } | undefined;
1335
- errors?: {
1336
- type: "error" | "warning";
1337
- message: string;
1338
- }[] | undefined;
1339
- trace?: {
1340
- input: string;
1341
- proposed: string;
1342
- validated: boolean;
1343
- executed?: string | undefined;
1344
- } | undefined;
1345
- }, {
1346
- status: "error" | "ok";
1347
- rendered: string;
1348
- renderedErr?: string | undefined;
1349
- model?: {
1350
- kind: string;
1351
- data?: unknown;
1352
- } | undefined;
1353
- errors?: {
1354
- type: "error" | "warning";
1355
- message: string;
1356
- }[] | undefined;
1357
- trace?: {
1358
- input: string;
1359
- proposed: string;
1360
- validated: boolean;
1361
- executed?: string | undefined;
1362
- } | undefined;
1363
- }>;
1364
- }, "strip", z.ZodTypeAny, {
1365
- type: "session";
1366
- surface: string;
1367
- envelope: {
1368
- status: "error" | "ok";
1369
- rendered: string;
1370
- renderedErr?: string | undefined;
1371
- model?: {
1372
- kind: string;
1373
- data?: unknown;
1374
- } | undefined;
1375
- errors?: {
1376
- type: "error" | "warning";
1377
- message: string;
1378
- }[] | undefined;
1379
- trace?: {
1380
- input: string;
1381
- proposed: string;
1382
- validated: boolean;
1383
- executed?: string | undefined;
1384
- } | undefined;
1385
- };
1386
- }, {
1387
- type: "session";
1388
- surface: string;
1389
- envelope: {
1390
- status: "error" | "ok";
1391
- rendered: string;
1392
- renderedErr?: string | undefined;
1393
- model?: {
1394
- kind: string;
1395
- data?: unknown;
1396
- } | undefined;
1397
- errors?: {
1398
- type: "error" | "warning";
1399
- message: string;
1400
- }[] | undefined;
1401
- trace?: {
1402
- input: string;
1403
- proposed: string;
1404
- validated: boolean;
1405
- executed?: string | undefined;
1406
- } | undefined;
1407
- };
1408
- }>, z.ZodObject<{
1409
- type: z.ZodLiteral<"error">;
1410
- id: z.ZodOptional<z.ZodString>;
1411
- reason: z.ZodString;
1412
- }, "strip", z.ZodTypeAny, {
1413
- type: "error";
1414
- reason: string;
1415
- id?: string | undefined;
1416
- }, {
1417
- type: "error";
1418
- reason: string;
1419
- id?: string | undefined;
1420
- }>, z.ZodObject<{
1421
- type: z.ZodLiteral<"prompt">;
1422
- promptId: z.ZodString;
1423
- message: z.ZodString;
1424
- hidden: z.ZodBoolean;
1425
- }, "strip", z.ZodTypeAny, {
1426
- type: "prompt";
1427
- message: string;
1428
- promptId: string;
1429
- hidden: boolean;
1430
- }, {
1431
- type: "prompt";
1432
- message: string;
1433
- promptId: string;
1434
- hidden: boolean;
1435
- }>, z.ZodObject<{
1436
- type: z.ZodLiteral<"promptline">;
1437
- context: z.ZodObject<{
1438
- user: z.ZodString;
1439
- uri: z.ZodString;
1440
- cwd: z.ZodString;
1441
- pacsserver: z.ZodNullable<z.ZodString>;
1442
- physicalMode: z.ZodBoolean;
1443
- lastExitCode: z.ZodNumber;
1444
- lastCommandDurationMs: z.ZodNumber;
1445
- procWarmup: z.ZodOptional<z.ZodObject<{
1446
- loaded: z.ZodNumber;
1447
- total: z.ZodOptional<z.ZodNumber>;
1448
- restored: z.ZodOptional<z.ZodBoolean>;
1449
- state: z.ZodOptional<z.ZodEnum<["cold", "cached", "failed"]>>;
1450
- }, "strip", z.ZodTypeAny, {
1451
- loaded: number;
1452
- total?: number | undefined;
1453
- restored?: boolean | undefined;
1454
- state?: "failed" | "cold" | "cached" | undefined;
1455
- }, {
1456
- loaded: number;
1457
- total?: number | undefined;
1458
- restored?: boolean | undefined;
1459
- state?: "failed" | "cold" | "cached" | undefined;
1460
- }>>;
1461
- }, "strip", z.ZodTypeAny, {
1462
- user: string;
1463
- uri: string;
1464
- cwd: string;
1465
- pacsserver: string | null;
1466
- physicalMode: boolean;
1467
- lastExitCode: number;
1468
- lastCommandDurationMs: number;
1469
- procWarmup?: {
1470
- loaded: number;
1471
- total?: number | undefined;
1472
- restored?: boolean | undefined;
1473
- state?: "failed" | "cold" | "cached" | undefined;
1474
- } | undefined;
1475
- }, {
1476
- user: string;
1477
- uri: string;
1478
- cwd: string;
1479
- pacsserver: string | null;
1480
- physicalMode: boolean;
1481
- lastExitCode: number;
1482
- lastCommandDurationMs: number;
1483
- procWarmup?: {
1484
- loaded: number;
1485
- total?: number | undefined;
1486
- restored?: boolean | undefined;
1487
- state?: "failed" | "cold" | "cached" | undefined;
1488
- } | undefined;
1489
- }>;
1490
- }, "strip", z.ZodTypeAny, {
1491
- type: "promptline";
1492
- context: {
1493
- user: string;
1494
- uri: string;
1495
- cwd: string;
1496
- pacsserver: string | null;
1497
- physicalMode: boolean;
1498
- lastExitCode: number;
1499
- lastCommandDurationMs: number;
1500
- procWarmup?: {
1501
- loaded: number;
1502
- total?: number | undefined;
1503
- restored?: boolean | undefined;
1504
- state?: "failed" | "cold" | "cached" | undefined;
1505
- } | undefined;
1506
- };
1507
- }, {
1508
- type: "promptline";
1509
- context: {
1510
- user: string;
1511
- uri: string;
1512
- cwd: string;
1513
- pacsserver: string | null;
1514
- physicalMode: boolean;
1515
- lastExitCode: number;
1516
- lastCommandDurationMs: number;
1517
- procWarmup?: {
1518
- loaded: number;
1519
- total?: number | undefined;
1520
- restored?: boolean | undefined;
1521
- state?: "failed" | "cold" | "cached" | undefined;
1522
- } | undefined;
1523
- };
1524
- }>, z.ZodObject<{
1525
- type: z.ZodLiteral<"pipe">;
1526
- pipeId: z.ZodString;
1527
- command: z.ZodString;
1528
- input: z.ZodString;
1529
- }, "strip", z.ZodTypeAny, {
1530
- type: "pipe";
1531
- input: string;
1532
- pipeId: string;
1533
- command: string;
1534
- }, {
1535
- type: "pipe";
1536
- input: string;
1537
- pipeId: string;
1538
- command: string;
1539
- }>, z.ZodObject<{
1540
- type: z.ZodLiteral<"shell">;
1541
- shellId: z.ZodString;
1542
- command: z.ZodString;
1543
- }, "strip", z.ZodTypeAny, {
1544
- type: "shell";
1545
- shellId: string;
1546
- command: string;
1547
- }, {
1548
- type: "shell";
1549
- shellId: string;
1550
- command: string;
1551
- }>, z.ZodObject<{
1552
- type: z.ZodLiteral<"edit">;
1553
- editId: z.ZodString;
1554
- content: z.ZodString;
1555
- extension: z.ZodOptional<z.ZodString>;
1556
- }, "strip", z.ZodTypeAny, {
1557
- type: "edit";
1558
- editId: string;
1559
- content: string;
1560
- extension?: string | undefined;
1561
- }, {
1562
- type: "edit";
1563
- editId: string;
1564
- content: string;
1565
- extension?: string | undefined;
1566
- }>]>;
1567
- /** A message the daemon sends to a surface. */
1568
- export type ServerMessage = z.infer<typeof serverMessageSchema>;