@nexus-code/remote-protocol 0.0.0-stage → 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/view.d.ts ADDED
@@ -0,0 +1,1120 @@
1
+ /**
2
+ * A chat as another device draws it: the conversation the serving device's
3
+ * app already made of its program's log, trimmed of what only that app
4
+ * uses. The shapes follow the desktop app's chat model, so its chat view can
5
+ * draw a remote one as it draws its own; Claude Code's and Codex's own
6
+ * formats stay on the serving device, which keeps up with their versions.
7
+ *
8
+ * An item or call of a kind this version does not know stays parseable
9
+ * (UnknownItemSchema): a newer device may send more, and an older one skips it.
10
+ */
11
+ import { z } from "zod";
12
+ /** An image a message or a tool result holds. Its bytes stay on the serving device in v1. */
13
+ export declare const ImageRefSchema: z.ZodObject<{
14
+ mediaType: z.ZodString;
15
+ /** How many bytes the image takes. */
16
+ bytes: z.ZodNumber;
17
+ }, "strip", z.ZodTypeAny, {
18
+ mediaType: string;
19
+ bytes: number;
20
+ }, {
21
+ mediaType: string;
22
+ bytes: number;
23
+ }>;
24
+ export type ImageRef = z.infer<typeof ImageRefSchema>;
25
+ export declare const UserItemSchema: z.ZodObject<{
26
+ kind: z.ZodLiteral<"user">;
27
+ key: z.ZodString;
28
+ text: z.ZodString;
29
+ images: z.ZodArray<z.ZodObject<{
30
+ mediaType: z.ZodString;
31
+ /** How many bytes the image takes. */
32
+ bytes: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ mediaType: string;
35
+ bytes: number;
36
+ }, {
37
+ mediaType: string;
38
+ bytes: number;
39
+ }>, "many">;
40
+ /** sent: written to the program; taken: the program read it. */
41
+ state: z.ZodEnum<["sent", "taken"]>;
42
+ /** Written during a turn and not read yet: it waits above the composer. */
43
+ queued: z.ZodOptional<z.ZodBoolean>;
44
+ at: z.ZodOptional<z.ZodNumber>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ kind: "user";
47
+ key: string;
48
+ text: string;
49
+ images: {
50
+ mediaType: string;
51
+ bytes: number;
52
+ }[];
53
+ state: "sent" | "taken";
54
+ at?: number | undefined;
55
+ queued?: boolean | undefined;
56
+ }, {
57
+ kind: "user";
58
+ key: string;
59
+ text: string;
60
+ images: {
61
+ mediaType: string;
62
+ bytes: number;
63
+ }[];
64
+ state: "sent" | "taken";
65
+ at?: number | undefined;
66
+ queued?: boolean | undefined;
67
+ }>;
68
+ export declare const AssistantBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
69
+ type: z.ZodLiteral<"text">;
70
+ text: z.ZodString;
71
+ }, "strip", z.ZodTypeAny, {
72
+ type: "text";
73
+ text: string;
74
+ }, {
75
+ type: "text";
76
+ text: string;
77
+ }>, z.ZodObject<{
78
+ type: z.ZodLiteral<"thinking">;
79
+ text: z.ZodString;
80
+ }, "strip", z.ZodTypeAny, {
81
+ type: "thinking";
82
+ text: string;
83
+ }, {
84
+ type: "thinking";
85
+ text: string;
86
+ }>, z.ZodObject<{
87
+ type: z.ZodLiteral<"tool">;
88
+ toolUseId: z.ZodString;
89
+ }, "strip", z.ZodTypeAny, {
90
+ type: "tool";
91
+ toolUseId: string;
92
+ }, {
93
+ type: "tool";
94
+ toolUseId: string;
95
+ }>]>;
96
+ export declare const AssistantItemSchema: z.ZodObject<{
97
+ kind: z.ZodLiteral<"assistant">;
98
+ key: z.ZodString;
99
+ messageId: z.ZodString;
100
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
101
+ type: z.ZodLiteral<"text">;
102
+ text: z.ZodString;
103
+ }, "strip", z.ZodTypeAny, {
104
+ type: "text";
105
+ text: string;
106
+ }, {
107
+ type: "text";
108
+ text: string;
109
+ }>, z.ZodObject<{
110
+ type: z.ZodLiteral<"thinking">;
111
+ text: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ type: "thinking";
114
+ text: string;
115
+ }, {
116
+ type: "thinking";
117
+ text: string;
118
+ }>, z.ZodObject<{
119
+ type: z.ZodLiteral<"tool">;
120
+ toolUseId: z.ZodString;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type: "tool";
123
+ toolUseId: string;
124
+ }, {
125
+ type: "tool";
126
+ toolUseId: string;
127
+ }>]>, "many">;
128
+ at: z.ZodOptional<z.ZodNumber>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ kind: "assistant";
131
+ key: string;
132
+ messageId: string;
133
+ blocks: ({
134
+ type: "text";
135
+ text: string;
136
+ } | {
137
+ type: "thinking";
138
+ text: string;
139
+ } | {
140
+ type: "tool";
141
+ toolUseId: string;
142
+ })[];
143
+ at?: number | undefined;
144
+ }, {
145
+ kind: "assistant";
146
+ key: string;
147
+ messageId: string;
148
+ blocks: ({
149
+ type: "text";
150
+ text: string;
151
+ } | {
152
+ type: "thinking";
153
+ text: string;
154
+ } | {
155
+ type: "tool";
156
+ toolUseId: string;
157
+ })[];
158
+ at?: number | undefined;
159
+ }>;
160
+ export type ViewAssistantItem = z.infer<typeof AssistantItemSchema>;
161
+ export declare const NoticeItemSchema: z.ZodObject<{
162
+ kind: z.ZodLiteral<"notice">;
163
+ key: z.ZodString;
164
+ /** interrupted, exited, restarted, compacted, cleared, error…: a code the app names. */
165
+ code: z.ZodString;
166
+ detail: z.ZodOptional<z.ZodString>;
167
+ at: z.ZodOptional<z.ZodNumber>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ code: string;
170
+ kind: "notice";
171
+ key: string;
172
+ at?: number | undefined;
173
+ detail?: string | undefined;
174
+ }, {
175
+ code: string;
176
+ kind: "notice";
177
+ key: string;
178
+ at?: number | undefined;
179
+ detail?: string | undefined;
180
+ }>;
181
+ /** A message the program took that the user did not write: another session's, a channel's. */
182
+ export declare const ReceivedItemSchema: z.ZodObject<{
183
+ kind: z.ZodLiteral<"received">;
184
+ key: z.ZodString;
185
+ from: z.ZodObject<{
186
+ kind: z.ZodString;
187
+ name: z.ZodOptional<z.ZodString>;
188
+ agent: z.ZodOptional<z.ZodString>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ kind: string;
191
+ name?: string | undefined;
192
+ agent?: string | undefined;
193
+ }, {
194
+ kind: string;
195
+ name?: string | undefined;
196
+ agent?: string | undefined;
197
+ }>;
198
+ text: z.ZodString;
199
+ at: z.ZodOptional<z.ZodNumber>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ from: {
202
+ kind: string;
203
+ name?: string | undefined;
204
+ agent?: string | undefined;
205
+ };
206
+ kind: "received";
207
+ key: string;
208
+ text: string;
209
+ at?: number | undefined;
210
+ }, {
211
+ from: {
212
+ kind: string;
213
+ name?: string | undefined;
214
+ agent?: string | undefined;
215
+ };
216
+ kind: "received";
217
+ key: string;
218
+ text: string;
219
+ at?: number | undefined;
220
+ }>;
221
+ export declare const TaskEndItemSchema: z.ZodObject<{
222
+ kind: z.ZodLiteral<"task_end">;
223
+ key: z.ZodString;
224
+ taskId: z.ZodString;
225
+ status: z.ZodString;
226
+ description: z.ZodOptional<z.ZodString>;
227
+ taskType: z.ZodOptional<z.ZodString>;
228
+ summary: z.ZodOptional<z.ZodString>;
229
+ toolUseId: z.ZodOptional<z.ZodString>;
230
+ wakes: z.ZodOptional<z.ZodBoolean>;
231
+ at: z.ZodOptional<z.ZodNumber>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ status: string;
234
+ kind: "task_end";
235
+ key: string;
236
+ taskId: string;
237
+ at?: number | undefined;
238
+ toolUseId?: string | undefined;
239
+ description?: string | undefined;
240
+ taskType?: string | undefined;
241
+ summary?: string | undefined;
242
+ wakes?: boolean | undefined;
243
+ }, {
244
+ status: string;
245
+ kind: "task_end";
246
+ key: string;
247
+ taskId: string;
248
+ at?: number | undefined;
249
+ toolUseId?: string | undefined;
250
+ description?: string | undefined;
251
+ taskType?: string | undefined;
252
+ summary?: string | undefined;
253
+ wakes?: boolean | undefined;
254
+ }>;
255
+ export declare const ShellItemSchema: z.ZodObject<{
256
+ kind: z.ZodLiteral<"shell">;
257
+ key: z.ZodString;
258
+ command: z.ZodString;
259
+ stdout: z.ZodOptional<z.ZodString>;
260
+ stderr: z.ZodOptional<z.ZodString>;
261
+ at: z.ZodOptional<z.ZodNumber>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ kind: "shell";
264
+ key: string;
265
+ command: string;
266
+ at?: number | undefined;
267
+ stdout?: string | undefined;
268
+ stderr?: string | undefined;
269
+ }, {
270
+ kind: "shell";
271
+ key: string;
272
+ command: string;
273
+ at?: number | undefined;
274
+ stdout?: string | undefined;
275
+ stderr?: string | undefined;
276
+ }>;
277
+ /** The item kinds this version knows. */
278
+ export declare const ITEM_KINDS: ReadonlySet<string>;
279
+ /**
280
+ * An item of a kind this version does not know: kept so the list stays
281
+ * whole, and not drawn. A known kind that does not fit its shape is no such item.
282
+ */
283
+ export declare const UnknownItemSchema: z.ZodObject<{
284
+ kind: z.ZodEffects<z.ZodString, string, string>;
285
+ key: z.ZodString;
286
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
287
+ kind: z.ZodEffects<z.ZodString, string, string>;
288
+ key: z.ZodString;
289
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
290
+ kind: z.ZodEffects<z.ZodString, string, string>;
291
+ key: z.ZodString;
292
+ }, z.ZodTypeAny, "passthrough">>;
293
+ export declare const ViewItemSchema: z.ZodUnion<[z.ZodObject<{
294
+ kind: z.ZodLiteral<"user">;
295
+ key: z.ZodString;
296
+ text: z.ZodString;
297
+ images: z.ZodArray<z.ZodObject<{
298
+ mediaType: z.ZodString;
299
+ /** How many bytes the image takes. */
300
+ bytes: z.ZodNumber;
301
+ }, "strip", z.ZodTypeAny, {
302
+ mediaType: string;
303
+ bytes: number;
304
+ }, {
305
+ mediaType: string;
306
+ bytes: number;
307
+ }>, "many">;
308
+ /** sent: written to the program; taken: the program read it. */
309
+ state: z.ZodEnum<["sent", "taken"]>;
310
+ /** Written during a turn and not read yet: it waits above the composer. */
311
+ queued: z.ZodOptional<z.ZodBoolean>;
312
+ at: z.ZodOptional<z.ZodNumber>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ kind: "user";
315
+ key: string;
316
+ text: string;
317
+ images: {
318
+ mediaType: string;
319
+ bytes: number;
320
+ }[];
321
+ state: "sent" | "taken";
322
+ at?: number | undefined;
323
+ queued?: boolean | undefined;
324
+ }, {
325
+ kind: "user";
326
+ key: string;
327
+ text: string;
328
+ images: {
329
+ mediaType: string;
330
+ bytes: number;
331
+ }[];
332
+ state: "sent" | "taken";
333
+ at?: number | undefined;
334
+ queued?: boolean | undefined;
335
+ }>, z.ZodObject<{
336
+ kind: z.ZodLiteral<"assistant">;
337
+ key: z.ZodString;
338
+ messageId: z.ZodString;
339
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
340
+ type: z.ZodLiteral<"text">;
341
+ text: z.ZodString;
342
+ }, "strip", z.ZodTypeAny, {
343
+ type: "text";
344
+ text: string;
345
+ }, {
346
+ type: "text";
347
+ text: string;
348
+ }>, z.ZodObject<{
349
+ type: z.ZodLiteral<"thinking">;
350
+ text: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ type: "thinking";
353
+ text: string;
354
+ }, {
355
+ type: "thinking";
356
+ text: string;
357
+ }>, z.ZodObject<{
358
+ type: z.ZodLiteral<"tool">;
359
+ toolUseId: z.ZodString;
360
+ }, "strip", z.ZodTypeAny, {
361
+ type: "tool";
362
+ toolUseId: string;
363
+ }, {
364
+ type: "tool";
365
+ toolUseId: string;
366
+ }>]>, "many">;
367
+ at: z.ZodOptional<z.ZodNumber>;
368
+ }, "strip", z.ZodTypeAny, {
369
+ kind: "assistant";
370
+ key: string;
371
+ messageId: string;
372
+ blocks: ({
373
+ type: "text";
374
+ text: string;
375
+ } | {
376
+ type: "thinking";
377
+ text: string;
378
+ } | {
379
+ type: "tool";
380
+ toolUseId: string;
381
+ })[];
382
+ at?: number | undefined;
383
+ }, {
384
+ kind: "assistant";
385
+ key: string;
386
+ messageId: string;
387
+ blocks: ({
388
+ type: "text";
389
+ text: string;
390
+ } | {
391
+ type: "thinking";
392
+ text: string;
393
+ } | {
394
+ type: "tool";
395
+ toolUseId: string;
396
+ })[];
397
+ at?: number | undefined;
398
+ }>, z.ZodObject<{
399
+ kind: z.ZodLiteral<"notice">;
400
+ key: z.ZodString;
401
+ /** interrupted, exited, restarted, compacted, cleared, error…: a code the app names. */
402
+ code: z.ZodString;
403
+ detail: z.ZodOptional<z.ZodString>;
404
+ at: z.ZodOptional<z.ZodNumber>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ code: string;
407
+ kind: "notice";
408
+ key: string;
409
+ at?: number | undefined;
410
+ detail?: string | undefined;
411
+ }, {
412
+ code: string;
413
+ kind: "notice";
414
+ key: string;
415
+ at?: number | undefined;
416
+ detail?: string | undefined;
417
+ }>, z.ZodObject<{
418
+ kind: z.ZodLiteral<"received">;
419
+ key: z.ZodString;
420
+ from: z.ZodObject<{
421
+ kind: z.ZodString;
422
+ name: z.ZodOptional<z.ZodString>;
423
+ agent: z.ZodOptional<z.ZodString>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ kind: string;
426
+ name?: string | undefined;
427
+ agent?: string | undefined;
428
+ }, {
429
+ kind: string;
430
+ name?: string | undefined;
431
+ agent?: string | undefined;
432
+ }>;
433
+ text: z.ZodString;
434
+ at: z.ZodOptional<z.ZodNumber>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ from: {
437
+ kind: string;
438
+ name?: string | undefined;
439
+ agent?: string | undefined;
440
+ };
441
+ kind: "received";
442
+ key: string;
443
+ text: string;
444
+ at?: number | undefined;
445
+ }, {
446
+ from: {
447
+ kind: string;
448
+ name?: string | undefined;
449
+ agent?: string | undefined;
450
+ };
451
+ kind: "received";
452
+ key: string;
453
+ text: string;
454
+ at?: number | undefined;
455
+ }>, z.ZodObject<{
456
+ kind: z.ZodLiteral<"task_end">;
457
+ key: z.ZodString;
458
+ taskId: z.ZodString;
459
+ status: z.ZodString;
460
+ description: z.ZodOptional<z.ZodString>;
461
+ taskType: z.ZodOptional<z.ZodString>;
462
+ summary: z.ZodOptional<z.ZodString>;
463
+ toolUseId: z.ZodOptional<z.ZodString>;
464
+ wakes: z.ZodOptional<z.ZodBoolean>;
465
+ at: z.ZodOptional<z.ZodNumber>;
466
+ }, "strip", z.ZodTypeAny, {
467
+ status: string;
468
+ kind: "task_end";
469
+ key: string;
470
+ taskId: string;
471
+ at?: number | undefined;
472
+ toolUseId?: string | undefined;
473
+ description?: string | undefined;
474
+ taskType?: string | undefined;
475
+ summary?: string | undefined;
476
+ wakes?: boolean | undefined;
477
+ }, {
478
+ status: string;
479
+ kind: "task_end";
480
+ key: string;
481
+ taskId: string;
482
+ at?: number | undefined;
483
+ toolUseId?: string | undefined;
484
+ description?: string | undefined;
485
+ taskType?: string | undefined;
486
+ summary?: string | undefined;
487
+ wakes?: boolean | undefined;
488
+ }>, z.ZodObject<{
489
+ kind: z.ZodLiteral<"shell">;
490
+ key: z.ZodString;
491
+ command: z.ZodString;
492
+ stdout: z.ZodOptional<z.ZodString>;
493
+ stderr: z.ZodOptional<z.ZodString>;
494
+ at: z.ZodOptional<z.ZodNumber>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ kind: "shell";
497
+ key: string;
498
+ command: string;
499
+ at?: number | undefined;
500
+ stdout?: string | undefined;
501
+ stderr?: string | undefined;
502
+ }, {
503
+ kind: "shell";
504
+ key: string;
505
+ command: string;
506
+ at?: number | undefined;
507
+ stdout?: string | undefined;
508
+ stderr?: string | undefined;
509
+ }>, z.ZodObject<{
510
+ kind: z.ZodEffects<z.ZodString, string, string>;
511
+ key: z.ZodString;
512
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
513
+ kind: z.ZodEffects<z.ZodString, string, string>;
514
+ key: z.ZodString;
515
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
516
+ kind: z.ZodEffects<z.ZodString, string, string>;
517
+ key: z.ZodString;
518
+ }, z.ZodTypeAny, "passthrough">>]>;
519
+ export type ViewItem = z.infer<typeof ViewItemSchema>;
520
+ /** Most characters of a tool's result text sent; the rest is cut (`truncated`). */
521
+ export declare const MAX_RESULT_TEXT: number;
522
+ export declare const ViewToolCallSchema: z.ZodObject<{
523
+ id: z.ZodString;
524
+ name: z.ZodString;
525
+ displayName: z.ZodOptional<z.ZodString>;
526
+ input: z.ZodUnknown;
527
+ /** streaming, running, done, error, denied, stopped. */
528
+ status: z.ZodString;
529
+ result: z.ZodOptional<z.ZodObject<{
530
+ text: z.ZodString;
531
+ isError: z.ZodBoolean;
532
+ /** The program's structured result: a run's stdout, an edit's patch. */
533
+ structured: z.ZodOptional<z.ZodUnknown>;
534
+ images: z.ZodArray<z.ZodObject<{
535
+ mediaType: z.ZodString;
536
+ /** How many bytes the image takes. */
537
+ bytes: z.ZodNumber;
538
+ }, "strip", z.ZodTypeAny, {
539
+ mediaType: string;
540
+ bytes: number;
541
+ }, {
542
+ mediaType: string;
543
+ bytes: number;
544
+ }>, "many">;
545
+ /** The text was longer than MAX_RESULT_TEXT and is cut there. */
546
+ truncated: z.ZodOptional<z.ZodBoolean>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ text: string;
549
+ images: {
550
+ mediaType: string;
551
+ bytes: number;
552
+ }[];
553
+ isError: boolean;
554
+ structured?: unknown;
555
+ truncated?: boolean | undefined;
556
+ }, {
557
+ text: string;
558
+ images: {
559
+ mediaType: string;
560
+ bytes: number;
561
+ }[];
562
+ isError: boolean;
563
+ structured?: unknown;
564
+ truncated?: boolean | undefined;
565
+ }>>;
566
+ /** The agent call it runs under; null on the main thread. */
567
+ parentToolUseId: z.ZodNullable<z.ZodString>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ status: string;
570
+ id: string;
571
+ name: string;
572
+ parentToolUseId: string | null;
573
+ displayName?: string | undefined;
574
+ input?: unknown;
575
+ result?: {
576
+ text: string;
577
+ images: {
578
+ mediaType: string;
579
+ bytes: number;
580
+ }[];
581
+ isError: boolean;
582
+ structured?: unknown;
583
+ truncated?: boolean | undefined;
584
+ } | undefined;
585
+ }, {
586
+ status: string;
587
+ id: string;
588
+ name: string;
589
+ parentToolUseId: string | null;
590
+ displayName?: string | undefined;
591
+ input?: unknown;
592
+ result?: {
593
+ text: string;
594
+ images: {
595
+ mediaType: string;
596
+ bytes: number;
597
+ }[];
598
+ isError: boolean;
599
+ structured?: unknown;
600
+ truncated?: boolean | undefined;
601
+ } | undefined;
602
+ }>;
603
+ export type ViewToolCall = z.infer<typeof ViewToolCallSchema>;
604
+ /** A tool the program asks to run, which the user allows or denies. */
605
+ export declare const ViewPermissionSchema: z.ZodObject<{
606
+ requestId: z.ZodString;
607
+ toolName: z.ZodString;
608
+ displayName: z.ZodOptional<z.ZodString>;
609
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
610
+ description: z.ZodOptional<z.ZodString>;
611
+ decisionReason: z.ZodOptional<z.ZodString>;
612
+ toolUseId: z.ZodOptional<z.ZodString>;
613
+ /** A subagent's request. */
614
+ agentId: z.ZodOptional<z.ZodString>;
615
+ /** The call as the card previews it, when the input alone does not tell it. */
616
+ preview: z.ZodOptional<z.ZodObject<{
617
+ id: z.ZodString;
618
+ name: z.ZodString;
619
+ displayName: z.ZodOptional<z.ZodString>;
620
+ input: z.ZodUnknown;
621
+ /** streaming, running, done, error, denied, stopped. */
622
+ status: z.ZodString;
623
+ result: z.ZodOptional<z.ZodObject<{
624
+ text: z.ZodString;
625
+ isError: z.ZodBoolean;
626
+ /** The program's structured result: a run's stdout, an edit's patch. */
627
+ structured: z.ZodOptional<z.ZodUnknown>;
628
+ images: z.ZodArray<z.ZodObject<{
629
+ mediaType: z.ZodString;
630
+ /** How many bytes the image takes. */
631
+ bytes: z.ZodNumber;
632
+ }, "strip", z.ZodTypeAny, {
633
+ mediaType: string;
634
+ bytes: number;
635
+ }, {
636
+ mediaType: string;
637
+ bytes: number;
638
+ }>, "many">;
639
+ /** The text was longer than MAX_RESULT_TEXT and is cut there. */
640
+ truncated: z.ZodOptional<z.ZodBoolean>;
641
+ }, "strip", z.ZodTypeAny, {
642
+ text: string;
643
+ images: {
644
+ mediaType: string;
645
+ bytes: number;
646
+ }[];
647
+ isError: boolean;
648
+ structured?: unknown;
649
+ truncated?: boolean | undefined;
650
+ }, {
651
+ text: string;
652
+ images: {
653
+ mediaType: string;
654
+ bytes: number;
655
+ }[];
656
+ isError: boolean;
657
+ structured?: unknown;
658
+ truncated?: boolean | undefined;
659
+ }>>;
660
+ /** The agent call it runs under; null on the main thread. */
661
+ parentToolUseId: z.ZodNullable<z.ZodString>;
662
+ }, "strip", z.ZodTypeAny, {
663
+ status: string;
664
+ id: string;
665
+ name: string;
666
+ parentToolUseId: string | null;
667
+ displayName?: string | undefined;
668
+ input?: unknown;
669
+ result?: {
670
+ text: string;
671
+ images: {
672
+ mediaType: string;
673
+ bytes: number;
674
+ }[];
675
+ isError: boolean;
676
+ structured?: unknown;
677
+ truncated?: boolean | undefined;
678
+ } | undefined;
679
+ }, {
680
+ status: string;
681
+ id: string;
682
+ name: string;
683
+ parentToolUseId: string | null;
684
+ displayName?: string | undefined;
685
+ input?: unknown;
686
+ result?: {
687
+ text: string;
688
+ images: {
689
+ mediaType: string;
690
+ bytes: number;
691
+ }[];
692
+ isError: boolean;
693
+ structured?: unknown;
694
+ truncated?: boolean | undefined;
695
+ } | undefined;
696
+ }>>;
697
+ }, "strip", z.ZodTypeAny, {
698
+ input: Record<string, unknown>;
699
+ requestId: string;
700
+ toolName: string;
701
+ toolUseId?: string | undefined;
702
+ description?: string | undefined;
703
+ displayName?: string | undefined;
704
+ decisionReason?: string | undefined;
705
+ agentId?: string | undefined;
706
+ preview?: {
707
+ status: string;
708
+ id: string;
709
+ name: string;
710
+ parentToolUseId: string | null;
711
+ displayName?: string | undefined;
712
+ input?: unknown;
713
+ result?: {
714
+ text: string;
715
+ images: {
716
+ mediaType: string;
717
+ bytes: number;
718
+ }[];
719
+ isError: boolean;
720
+ structured?: unknown;
721
+ truncated?: boolean | undefined;
722
+ } | undefined;
723
+ } | undefined;
724
+ }, {
725
+ input: Record<string, unknown>;
726
+ requestId: string;
727
+ toolName: string;
728
+ toolUseId?: string | undefined;
729
+ description?: string | undefined;
730
+ displayName?: string | undefined;
731
+ decisionReason?: string | undefined;
732
+ agentId?: string | undefined;
733
+ preview?: {
734
+ status: string;
735
+ id: string;
736
+ name: string;
737
+ parentToolUseId: string | null;
738
+ displayName?: string | undefined;
739
+ input?: unknown;
740
+ result?: {
741
+ text: string;
742
+ images: {
743
+ mediaType: string;
744
+ bytes: number;
745
+ }[];
746
+ isError: boolean;
747
+ structured?: unknown;
748
+ truncated?: boolean | undefined;
749
+ } | undefined;
750
+ } | undefined;
751
+ }>;
752
+ export type ViewPermission = z.infer<typeof ViewPermissionSchema>;
753
+ /** A task the program runs beside the turn: a background run, a subagent. */
754
+ export declare const ViewTaskSchema: z.ZodObject<{
755
+ taskId: z.ZodString;
756
+ type: z.ZodString;
757
+ description: z.ZodString;
758
+ status: z.ZodString;
759
+ toolUseId: z.ZodOptional<z.ZodString>;
760
+ startedAt: z.ZodOptional<z.ZodNumber>;
761
+ endedAt: z.ZodOptional<z.ZodNumber>;
762
+ summary: z.ZodOptional<z.ZodString>;
763
+ activity: z.ZodOptional<z.ZodString>;
764
+ }, "strip", z.ZodTypeAny, {
765
+ type: string;
766
+ status: string;
767
+ taskId: string;
768
+ description: string;
769
+ toolUseId?: string | undefined;
770
+ summary?: string | undefined;
771
+ startedAt?: number | undefined;
772
+ endedAt?: number | undefined;
773
+ activity?: string | undefined;
774
+ }, {
775
+ type: string;
776
+ status: string;
777
+ taskId: string;
778
+ description: string;
779
+ toolUseId?: string | undefined;
780
+ summary?: string | undefined;
781
+ startedAt?: number | undefined;
782
+ endedAt?: number | undefined;
783
+ activity?: string | undefined;
784
+ }>;
785
+ export type ViewTask = z.infer<typeof ViewTaskSchema>;
786
+ /** The reply being written: what the program streamed of its next message so far. */
787
+ export declare const ViewStreamingSchema: z.ZodObject<{
788
+ messageId: z.ZodString;
789
+ blocks: z.ZodArray<z.ZodObject<{
790
+ type: z.ZodEnum<["text", "thinking", "tool_use"]>;
791
+ text: z.ZodString;
792
+ toolUseId: z.ZodOptional<z.ZodString>;
793
+ }, "strip", z.ZodTypeAny, {
794
+ type: "text" | "thinking" | "tool_use";
795
+ text: string;
796
+ toolUseId?: string | undefined;
797
+ }, {
798
+ type: "text" | "thinking" | "tool_use";
799
+ text: string;
800
+ toolUseId?: string | undefined;
801
+ }>, "many">;
802
+ }, "strip", z.ZodTypeAny, {
803
+ messageId: string;
804
+ blocks: {
805
+ type: "text" | "thinking" | "tool_use";
806
+ text: string;
807
+ toolUseId?: string | undefined;
808
+ }[];
809
+ }, {
810
+ messageId: string;
811
+ blocks: {
812
+ type: "text" | "thinking" | "tool_use";
813
+ text: string;
814
+ toolUseId?: string | undefined;
815
+ }[];
816
+ }>;
817
+ export type ViewStreaming = z.infer<typeof ViewStreamingSchema>;
818
+ /** Where a chat stands, apart from its messages. */
819
+ export declare const ChatStatusSchema: z.ZodObject<{
820
+ agent: z.ZodEnum<["claude", "codex"]>;
821
+ title: z.ZodString;
822
+ /** The model it runs, as its program names it. */
823
+ model: z.ZodOptional<z.ZodString>;
824
+ effort: z.ZodOptional<z.ZodString>;
825
+ permissionMode: z.ZodOptional<z.ZodString>;
826
+ /** A turn is under way. */
827
+ running: z.ZodBoolean;
828
+ process: z.ZodEnum<["none", "running", "exited"]>;
829
+ turn: z.ZodNullable<z.ZodObject<{
830
+ startedAt: z.ZodOptional<z.ZodNumber>;
831
+ outputTokens: z.ZodNumber;
832
+ /** requesting, compacting… */
833
+ status: z.ZodOptional<z.ZodString>;
834
+ }, "strip", z.ZodTypeAny, {
835
+ outputTokens: number;
836
+ status?: string | undefined;
837
+ startedAt?: number | undefined;
838
+ }, {
839
+ outputTokens: number;
840
+ status?: string | undefined;
841
+ startedAt?: number | undefined;
842
+ }>>;
843
+ streaming: z.ZodNullable<z.ZodObject<{
844
+ messageId: z.ZodString;
845
+ blocks: z.ZodArray<z.ZodObject<{
846
+ type: z.ZodEnum<["text", "thinking", "tool_use"]>;
847
+ text: z.ZodString;
848
+ toolUseId: z.ZodOptional<z.ZodString>;
849
+ }, "strip", z.ZodTypeAny, {
850
+ type: "text" | "thinking" | "tool_use";
851
+ text: string;
852
+ toolUseId?: string | undefined;
853
+ }, {
854
+ type: "text" | "thinking" | "tool_use";
855
+ text: string;
856
+ toolUseId?: string | undefined;
857
+ }>, "many">;
858
+ }, "strip", z.ZodTypeAny, {
859
+ messageId: string;
860
+ blocks: {
861
+ type: "text" | "thinking" | "tool_use";
862
+ text: string;
863
+ toolUseId?: string | undefined;
864
+ }[];
865
+ }, {
866
+ messageId: string;
867
+ blocks: {
868
+ type: "text" | "thinking" | "tool_use";
869
+ text: string;
870
+ toolUseId?: string | undefined;
871
+ }[];
872
+ }>>;
873
+ permissions: z.ZodArray<z.ZodObject<{
874
+ requestId: z.ZodString;
875
+ toolName: z.ZodString;
876
+ displayName: z.ZodOptional<z.ZodString>;
877
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
878
+ description: z.ZodOptional<z.ZodString>;
879
+ decisionReason: z.ZodOptional<z.ZodString>;
880
+ toolUseId: z.ZodOptional<z.ZodString>;
881
+ /** A subagent's request. */
882
+ agentId: z.ZodOptional<z.ZodString>;
883
+ /** The call as the card previews it, when the input alone does not tell it. */
884
+ preview: z.ZodOptional<z.ZodObject<{
885
+ id: z.ZodString;
886
+ name: z.ZodString;
887
+ displayName: z.ZodOptional<z.ZodString>;
888
+ input: z.ZodUnknown;
889
+ /** streaming, running, done, error, denied, stopped. */
890
+ status: z.ZodString;
891
+ result: z.ZodOptional<z.ZodObject<{
892
+ text: z.ZodString;
893
+ isError: z.ZodBoolean;
894
+ /** The program's structured result: a run's stdout, an edit's patch. */
895
+ structured: z.ZodOptional<z.ZodUnknown>;
896
+ images: z.ZodArray<z.ZodObject<{
897
+ mediaType: z.ZodString;
898
+ /** How many bytes the image takes. */
899
+ bytes: z.ZodNumber;
900
+ }, "strip", z.ZodTypeAny, {
901
+ mediaType: string;
902
+ bytes: number;
903
+ }, {
904
+ mediaType: string;
905
+ bytes: number;
906
+ }>, "many">;
907
+ /** The text was longer than MAX_RESULT_TEXT and is cut there. */
908
+ truncated: z.ZodOptional<z.ZodBoolean>;
909
+ }, "strip", z.ZodTypeAny, {
910
+ text: string;
911
+ images: {
912
+ mediaType: string;
913
+ bytes: number;
914
+ }[];
915
+ isError: boolean;
916
+ structured?: unknown;
917
+ truncated?: boolean | undefined;
918
+ }, {
919
+ text: string;
920
+ images: {
921
+ mediaType: string;
922
+ bytes: number;
923
+ }[];
924
+ isError: boolean;
925
+ structured?: unknown;
926
+ truncated?: boolean | undefined;
927
+ }>>;
928
+ /** The agent call it runs under; null on the main thread. */
929
+ parentToolUseId: z.ZodNullable<z.ZodString>;
930
+ }, "strip", z.ZodTypeAny, {
931
+ status: string;
932
+ id: string;
933
+ name: string;
934
+ parentToolUseId: string | null;
935
+ displayName?: string | undefined;
936
+ input?: unknown;
937
+ result?: {
938
+ text: string;
939
+ images: {
940
+ mediaType: string;
941
+ bytes: number;
942
+ }[];
943
+ isError: boolean;
944
+ structured?: unknown;
945
+ truncated?: boolean | undefined;
946
+ } | undefined;
947
+ }, {
948
+ status: string;
949
+ id: string;
950
+ name: string;
951
+ parentToolUseId: string | null;
952
+ displayName?: string | undefined;
953
+ input?: unknown;
954
+ result?: {
955
+ text: string;
956
+ images: {
957
+ mediaType: string;
958
+ bytes: number;
959
+ }[];
960
+ isError: boolean;
961
+ structured?: unknown;
962
+ truncated?: boolean | undefined;
963
+ } | undefined;
964
+ }>>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ input: Record<string, unknown>;
967
+ requestId: string;
968
+ toolName: string;
969
+ toolUseId?: string | undefined;
970
+ description?: string | undefined;
971
+ displayName?: string | undefined;
972
+ decisionReason?: string | undefined;
973
+ agentId?: string | undefined;
974
+ preview?: {
975
+ status: string;
976
+ id: string;
977
+ name: string;
978
+ parentToolUseId: string | null;
979
+ displayName?: string | undefined;
980
+ input?: unknown;
981
+ result?: {
982
+ text: string;
983
+ images: {
984
+ mediaType: string;
985
+ bytes: number;
986
+ }[];
987
+ isError: boolean;
988
+ structured?: unknown;
989
+ truncated?: boolean | undefined;
990
+ } | undefined;
991
+ } | undefined;
992
+ }, {
993
+ input: Record<string, unknown>;
994
+ requestId: string;
995
+ toolName: string;
996
+ toolUseId?: string | undefined;
997
+ description?: string | undefined;
998
+ displayName?: string | undefined;
999
+ decisionReason?: string | undefined;
1000
+ agentId?: string | undefined;
1001
+ preview?: {
1002
+ status: string;
1003
+ id: string;
1004
+ name: string;
1005
+ parentToolUseId: string | null;
1006
+ displayName?: string | undefined;
1007
+ input?: unknown;
1008
+ result?: {
1009
+ text: string;
1010
+ images: {
1011
+ mediaType: string;
1012
+ bytes: number;
1013
+ }[];
1014
+ isError: boolean;
1015
+ structured?: unknown;
1016
+ truncated?: boolean | undefined;
1017
+ } | undefined;
1018
+ } | undefined;
1019
+ }>, "many">;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ agent: "claude" | "codex";
1022
+ title: string;
1023
+ running: boolean;
1024
+ process: "running" | "none" | "exited";
1025
+ turn: {
1026
+ outputTokens: number;
1027
+ status?: string | undefined;
1028
+ startedAt?: number | undefined;
1029
+ } | null;
1030
+ streaming: {
1031
+ messageId: string;
1032
+ blocks: {
1033
+ type: "text" | "thinking" | "tool_use";
1034
+ text: string;
1035
+ toolUseId?: string | undefined;
1036
+ }[];
1037
+ } | null;
1038
+ permissions: {
1039
+ input: Record<string, unknown>;
1040
+ requestId: string;
1041
+ toolName: string;
1042
+ toolUseId?: string | undefined;
1043
+ description?: string | undefined;
1044
+ displayName?: string | undefined;
1045
+ decisionReason?: string | undefined;
1046
+ agentId?: string | undefined;
1047
+ preview?: {
1048
+ status: string;
1049
+ id: string;
1050
+ name: string;
1051
+ parentToolUseId: string | null;
1052
+ displayName?: string | undefined;
1053
+ input?: unknown;
1054
+ result?: {
1055
+ text: string;
1056
+ images: {
1057
+ mediaType: string;
1058
+ bytes: number;
1059
+ }[];
1060
+ isError: boolean;
1061
+ structured?: unknown;
1062
+ truncated?: boolean | undefined;
1063
+ } | undefined;
1064
+ } | undefined;
1065
+ }[];
1066
+ model?: string | undefined;
1067
+ effort?: string | undefined;
1068
+ permissionMode?: string | undefined;
1069
+ }, {
1070
+ agent: "claude" | "codex";
1071
+ title: string;
1072
+ running: boolean;
1073
+ process: "running" | "none" | "exited";
1074
+ turn: {
1075
+ outputTokens: number;
1076
+ status?: string | undefined;
1077
+ startedAt?: number | undefined;
1078
+ } | null;
1079
+ streaming: {
1080
+ messageId: string;
1081
+ blocks: {
1082
+ type: "text" | "thinking" | "tool_use";
1083
+ text: string;
1084
+ toolUseId?: string | undefined;
1085
+ }[];
1086
+ } | null;
1087
+ permissions: {
1088
+ input: Record<string, unknown>;
1089
+ requestId: string;
1090
+ toolName: string;
1091
+ toolUseId?: string | undefined;
1092
+ description?: string | undefined;
1093
+ displayName?: string | undefined;
1094
+ decisionReason?: string | undefined;
1095
+ agentId?: string | undefined;
1096
+ preview?: {
1097
+ status: string;
1098
+ id: string;
1099
+ name: string;
1100
+ parentToolUseId: string | null;
1101
+ displayName?: string | undefined;
1102
+ input?: unknown;
1103
+ result?: {
1104
+ text: string;
1105
+ images: {
1106
+ mediaType: string;
1107
+ bytes: number;
1108
+ }[];
1109
+ isError: boolean;
1110
+ structured?: unknown;
1111
+ truncated?: boolean | undefined;
1112
+ } | undefined;
1113
+ } | undefined;
1114
+ }[];
1115
+ model?: string | undefined;
1116
+ effort?: string | undefined;
1117
+ permissionMode?: string | undefined;
1118
+ }>;
1119
+ export type ChatStatus = z.infer<typeof ChatStatusSchema>;
1120
+ //# sourceMappingURL=view.d.ts.map