@getorrery/protocol 0.0.0-stage → 0.2.1
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/README.md +28 -2
- package/context-api.json +86 -0
- package/package.json +19 -3
- package/protocol.d.ts +3751 -0
- package/protocol.schema.json +8653 -0
package/protocol.d.ts
ADDED
|
@@ -0,0 +1,3751 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated by `cargo xtask typegen` from harness/core/crates/orrery-proto.
|
|
4
|
+
* Do not edit by hand: CI regenerates this file and fails on a diff.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type CatalogNode = {
|
|
8
|
+
/**
|
|
9
|
+
* A stable handle for client-local state (the selected tab, open, scroll) and for `ui.intent.node`.
|
|
10
|
+
*/
|
|
11
|
+
key?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Inside a `row` or a `column`: this node's share of the space.
|
|
14
|
+
*/
|
|
15
|
+
weight?: number | null;
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
} & CatalogNode1;
|
|
18
|
+
export type CatalogNode1 =
|
|
19
|
+
| {
|
|
20
|
+
/**
|
|
21
|
+
* The contents.
|
|
22
|
+
*/
|
|
23
|
+
children?: CatalogNode[];
|
|
24
|
+
/**
|
|
25
|
+
* Cells between children.
|
|
26
|
+
*/
|
|
27
|
+
gap?: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* The most lines a wrapped row takes.
|
|
30
|
+
*/
|
|
31
|
+
maxRows?: number | null;
|
|
32
|
+
type: "row";
|
|
33
|
+
/**
|
|
34
|
+
* Wrap onto the next line when narrow.
|
|
35
|
+
*/
|
|
36
|
+
wrap?: boolean;
|
|
37
|
+
[k: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
/**
|
|
41
|
+
* The contents.
|
|
42
|
+
*/
|
|
43
|
+
children?: CatalogNode[];
|
|
44
|
+
/**
|
|
45
|
+
* Cells between children.
|
|
46
|
+
*/
|
|
47
|
+
gap?: number | null;
|
|
48
|
+
/**
|
|
49
|
+
* The most rows it takes.
|
|
50
|
+
*/
|
|
51
|
+
maxRows?: number | null;
|
|
52
|
+
type: "column";
|
|
53
|
+
/**
|
|
54
|
+
* Wrap when narrow.
|
|
55
|
+
*/
|
|
56
|
+
wrap?: boolean;
|
|
57
|
+
[k: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
/**
|
|
61
|
+
* The contents.
|
|
62
|
+
*/
|
|
63
|
+
children?: CatalogNode[];
|
|
64
|
+
/**
|
|
65
|
+
* Its title.
|
|
66
|
+
*/
|
|
67
|
+
title?: string | null;
|
|
68
|
+
type: "box";
|
|
69
|
+
[k: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
| {
|
|
72
|
+
/**
|
|
73
|
+
* The tab shown first, by key.
|
|
74
|
+
*/
|
|
75
|
+
selected?: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* The tabs.
|
|
78
|
+
*/
|
|
79
|
+
tabs: Tab[];
|
|
80
|
+
type: "tabs";
|
|
81
|
+
[k: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
| {
|
|
84
|
+
/**
|
|
85
|
+
* The contents.
|
|
86
|
+
*/
|
|
87
|
+
children?: CatalogNode[];
|
|
88
|
+
/**
|
|
89
|
+
* Whether it starts open.
|
|
90
|
+
*/
|
|
91
|
+
open?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Its title.
|
|
94
|
+
*/
|
|
95
|
+
title: string;
|
|
96
|
+
type: "collapsible";
|
|
97
|
+
[k: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
/**
|
|
101
|
+
* Its label.
|
|
102
|
+
*/
|
|
103
|
+
label?: string | null;
|
|
104
|
+
type: "divider";
|
|
105
|
+
[k: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
|
+
/**
|
|
109
|
+
* The contents.
|
|
110
|
+
*/
|
|
111
|
+
children?: CatalogNode[];
|
|
112
|
+
/**
|
|
113
|
+
* Whether it starts folded.
|
|
114
|
+
*/
|
|
115
|
+
collapsed?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Which way.
|
|
118
|
+
*/
|
|
119
|
+
dir: StackDir;
|
|
120
|
+
/**
|
|
121
|
+
* A heading.
|
|
122
|
+
*/
|
|
123
|
+
title?: string | null;
|
|
124
|
+
type: "stack";
|
|
125
|
+
[k: string]: unknown;
|
|
126
|
+
}
|
|
127
|
+
| {
|
|
128
|
+
/**
|
|
129
|
+
* Inline runs.
|
|
130
|
+
*/
|
|
131
|
+
spans?: Span[];
|
|
132
|
+
/**
|
|
133
|
+
* How it is meant.
|
|
134
|
+
*/
|
|
135
|
+
style?: TextStyle | null;
|
|
136
|
+
type: "text";
|
|
137
|
+
/**
|
|
138
|
+
* The text; `spans` replace it when present.
|
|
139
|
+
*/
|
|
140
|
+
value: string;
|
|
141
|
+
[k: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
| {
|
|
144
|
+
/**
|
|
145
|
+
* 1, 2 or 3.
|
|
146
|
+
*/
|
|
147
|
+
level?: number | null;
|
|
148
|
+
/**
|
|
149
|
+
* Its text.
|
|
150
|
+
*/
|
|
151
|
+
text: string;
|
|
152
|
+
type: "heading";
|
|
153
|
+
[k: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
| {
|
|
156
|
+
/**
|
|
157
|
+
* Where it goes.
|
|
158
|
+
*/
|
|
159
|
+
href: string;
|
|
160
|
+
/**
|
|
161
|
+
* What it says.
|
|
162
|
+
*/
|
|
163
|
+
label: string;
|
|
164
|
+
type: "link";
|
|
165
|
+
[k: string]: unknown;
|
|
166
|
+
}
|
|
167
|
+
| {
|
|
168
|
+
/**
|
|
169
|
+
* The word.
|
|
170
|
+
*/
|
|
171
|
+
text: string;
|
|
172
|
+
/**
|
|
173
|
+
* How it is meant.
|
|
174
|
+
*/
|
|
175
|
+
tone?: Tone | null;
|
|
176
|
+
type: "badge";
|
|
177
|
+
[k: string]: unknown;
|
|
178
|
+
}
|
|
179
|
+
| {
|
|
180
|
+
/**
|
|
181
|
+
* What it says.
|
|
182
|
+
*/
|
|
183
|
+
text: string;
|
|
184
|
+
/**
|
|
185
|
+
* Its title.
|
|
186
|
+
*/
|
|
187
|
+
title?: string | null;
|
|
188
|
+
/**
|
|
189
|
+
* Info, warning, error or success; never neutral.
|
|
190
|
+
*/
|
|
191
|
+
tone: Tone;
|
|
192
|
+
type: "callout";
|
|
193
|
+
[k: string]: unknown;
|
|
194
|
+
}
|
|
195
|
+
| {
|
|
196
|
+
/**
|
|
197
|
+
* Shown when there are none.
|
|
198
|
+
*/
|
|
199
|
+
empty?: string | null;
|
|
200
|
+
/**
|
|
201
|
+
* The pairs.
|
|
202
|
+
*/
|
|
203
|
+
items: KvItem[];
|
|
204
|
+
/**
|
|
205
|
+
* Still arriving.
|
|
206
|
+
*/
|
|
207
|
+
loading?: boolean;
|
|
208
|
+
type: "kv";
|
|
209
|
+
[k: string]: unknown;
|
|
210
|
+
}
|
|
211
|
+
| {
|
|
212
|
+
/**
|
|
213
|
+
* The source.
|
|
214
|
+
*/
|
|
215
|
+
code: string;
|
|
216
|
+
/**
|
|
217
|
+
* Lines to highlight, by number.
|
|
218
|
+
*/
|
|
219
|
+
highlight?: number[];
|
|
220
|
+
/**
|
|
221
|
+
* Its language, for highlighting.
|
|
222
|
+
*/
|
|
223
|
+
language?: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* Show line numbers.
|
|
226
|
+
*/
|
|
227
|
+
lineNumbers?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* The first line's number.
|
|
230
|
+
*/
|
|
231
|
+
start?: number | null;
|
|
232
|
+
type: "code";
|
|
233
|
+
[k: string]: unknown;
|
|
234
|
+
}
|
|
235
|
+
| {
|
|
236
|
+
/**
|
|
237
|
+
* False while it still streams. Absent reads as complete.
|
|
238
|
+
*/
|
|
239
|
+
complete?: boolean;
|
|
240
|
+
type: "markdown";
|
|
241
|
+
/**
|
|
242
|
+
* The source.
|
|
243
|
+
*/
|
|
244
|
+
value: string;
|
|
245
|
+
[k: string]: unknown;
|
|
246
|
+
}
|
|
247
|
+
| {
|
|
248
|
+
/**
|
|
249
|
+
* The header row.
|
|
250
|
+
*/
|
|
251
|
+
columns: Column[];
|
|
252
|
+
/**
|
|
253
|
+
* Shown when there are no rows.
|
|
254
|
+
*/
|
|
255
|
+
empty?: string | null;
|
|
256
|
+
/**
|
|
257
|
+
* Still arriving.
|
|
258
|
+
*/
|
|
259
|
+
loading?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* What choosing a row sends; the value is its `key`, else its index.
|
|
262
|
+
*/
|
|
263
|
+
rowAction?: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* The body.
|
|
266
|
+
*/
|
|
267
|
+
rows?: TableRow[];
|
|
268
|
+
type: "table";
|
|
269
|
+
[k: string]: unknown;
|
|
270
|
+
}
|
|
271
|
+
| {
|
|
272
|
+
/**
|
|
273
|
+
* What choosing sends; the value is the item's.
|
|
274
|
+
*/
|
|
275
|
+
action?: string | null;
|
|
276
|
+
/**
|
|
277
|
+
* Shown when there are none.
|
|
278
|
+
*/
|
|
279
|
+
empty?: string | null;
|
|
280
|
+
/**
|
|
281
|
+
* The entries.
|
|
282
|
+
*/
|
|
283
|
+
items: ListItem[];
|
|
284
|
+
/**
|
|
285
|
+
* Still arriving.
|
|
286
|
+
*/
|
|
287
|
+
loading?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* The value the cursor starts on.
|
|
290
|
+
*/
|
|
291
|
+
selected?: string | null;
|
|
292
|
+
/**
|
|
293
|
+
* How it is drawn.
|
|
294
|
+
*/
|
|
295
|
+
style?: ListStyle | null;
|
|
296
|
+
type: "list";
|
|
297
|
+
[k: string]: unknown;
|
|
298
|
+
}
|
|
299
|
+
| {
|
|
300
|
+
/**
|
|
301
|
+
* What choosing a node sends; the value is its `id`.
|
|
302
|
+
*/
|
|
303
|
+
action?: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* Shown when there are none.
|
|
306
|
+
*/
|
|
307
|
+
empty?: string | null;
|
|
308
|
+
/**
|
|
309
|
+
* Still arriving.
|
|
310
|
+
*/
|
|
311
|
+
loading?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* The roots.
|
|
314
|
+
*/
|
|
315
|
+
nodes: TreeNode[];
|
|
316
|
+
type: "tree";
|
|
317
|
+
[k: string]: unknown;
|
|
318
|
+
}
|
|
319
|
+
| {
|
|
320
|
+
/**
|
|
321
|
+
* Shown when there are none.
|
|
322
|
+
*/
|
|
323
|
+
empty?: string | null;
|
|
324
|
+
/**
|
|
325
|
+
* Which channel.
|
|
326
|
+
*/
|
|
327
|
+
id: string;
|
|
328
|
+
/**
|
|
329
|
+
* The lines so far.
|
|
330
|
+
*/
|
|
331
|
+
lines?: StreamLine[];
|
|
332
|
+
/**
|
|
333
|
+
* Still arriving.
|
|
334
|
+
*/
|
|
335
|
+
loading?: boolean;
|
|
336
|
+
type: "stream";
|
|
337
|
+
[k: string]: unknown;
|
|
338
|
+
}
|
|
339
|
+
| {
|
|
340
|
+
/**
|
|
341
|
+
* Shown when there are no values.
|
|
342
|
+
*/
|
|
343
|
+
empty?: string | null;
|
|
344
|
+
/**
|
|
345
|
+
* Which chart.
|
|
346
|
+
*/
|
|
347
|
+
kind: ChartKind;
|
|
348
|
+
/**
|
|
349
|
+
* What each value is.
|
|
350
|
+
*/
|
|
351
|
+
labels?: string[];
|
|
352
|
+
/**
|
|
353
|
+
* Still arriving.
|
|
354
|
+
*/
|
|
355
|
+
loading?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* The series.
|
|
358
|
+
*/
|
|
359
|
+
series: Series[];
|
|
360
|
+
/**
|
|
361
|
+
* A heading.
|
|
362
|
+
*/
|
|
363
|
+
title?: string | null;
|
|
364
|
+
type: "chart";
|
|
365
|
+
/**
|
|
366
|
+
* The values' unit.
|
|
367
|
+
*/
|
|
368
|
+
unit?: string | null;
|
|
369
|
+
[k: string]: unknown;
|
|
370
|
+
}
|
|
371
|
+
| {
|
|
372
|
+
/**
|
|
373
|
+
* How it moved: `+12%`.
|
|
374
|
+
*/
|
|
375
|
+
change?: string | null;
|
|
376
|
+
/**
|
|
377
|
+
* Shown when `value` is empty.
|
|
378
|
+
*/
|
|
379
|
+
empty?: string | null;
|
|
380
|
+
/**
|
|
381
|
+
* What it is.
|
|
382
|
+
*/
|
|
383
|
+
label: string;
|
|
384
|
+
/**
|
|
385
|
+
* Still arriving.
|
|
386
|
+
*/
|
|
387
|
+
loading?: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* How it is meant.
|
|
390
|
+
*/
|
|
391
|
+
tone?: Tone | null;
|
|
392
|
+
type: "stat";
|
|
393
|
+
/**
|
|
394
|
+
* The value, already formatted.
|
|
395
|
+
*/
|
|
396
|
+
value: string;
|
|
397
|
+
[k: string]: unknown;
|
|
398
|
+
}
|
|
399
|
+
| {
|
|
400
|
+
/**
|
|
401
|
+
* Shown when there are none.
|
|
402
|
+
*/
|
|
403
|
+
empty?: string | null;
|
|
404
|
+
/**
|
|
405
|
+
* The entries.
|
|
406
|
+
*/
|
|
407
|
+
items: TaskItem[];
|
|
408
|
+
/**
|
|
409
|
+
* Still arriving.
|
|
410
|
+
*/
|
|
411
|
+
loading?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* How it is drawn.
|
|
414
|
+
*/
|
|
415
|
+
style?: TaskStyle | null;
|
|
416
|
+
type: "task";
|
|
417
|
+
[k: string]: unknown;
|
|
418
|
+
}
|
|
419
|
+
| {
|
|
420
|
+
/**
|
|
421
|
+
* What pressing it sends.
|
|
422
|
+
*/
|
|
423
|
+
action: string;
|
|
424
|
+
/**
|
|
425
|
+
* Shown, but cannot be pressed.
|
|
426
|
+
*/
|
|
427
|
+
disabled?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* What it says.
|
|
430
|
+
*/
|
|
431
|
+
label: string;
|
|
432
|
+
/**
|
|
433
|
+
* How it is meant.
|
|
434
|
+
*/
|
|
435
|
+
tone?: ButtonTone | null;
|
|
436
|
+
type: "button";
|
|
437
|
+
[k: string]: unknown;
|
|
438
|
+
}
|
|
439
|
+
| {
|
|
440
|
+
/**
|
|
441
|
+
* What submitting sends.
|
|
442
|
+
*/
|
|
443
|
+
action?: string | null;
|
|
444
|
+
/**
|
|
445
|
+
* The inputs.
|
|
446
|
+
*/
|
|
447
|
+
fields: FormField[];
|
|
448
|
+
/**
|
|
449
|
+
* The submit button's label.
|
|
450
|
+
*/
|
|
451
|
+
submit: string;
|
|
452
|
+
type: "form";
|
|
453
|
+
[k: string]: unknown;
|
|
454
|
+
}
|
|
455
|
+
| {
|
|
456
|
+
/**
|
|
457
|
+
* What submitting sends.
|
|
458
|
+
*/
|
|
459
|
+
action: string;
|
|
460
|
+
/**
|
|
461
|
+
* What is shown next to it.
|
|
462
|
+
*/
|
|
463
|
+
label?: string | null;
|
|
464
|
+
/**
|
|
465
|
+
* The key its value is sent under.
|
|
466
|
+
*/
|
|
467
|
+
name: string;
|
|
468
|
+
/**
|
|
469
|
+
* What the empty box says.
|
|
470
|
+
*/
|
|
471
|
+
placeholder?: string | null;
|
|
472
|
+
/**
|
|
473
|
+
* How many lines tall.
|
|
474
|
+
*/
|
|
475
|
+
rows?: number | null;
|
|
476
|
+
type: "textarea";
|
|
477
|
+
/**
|
|
478
|
+
* What it starts as.
|
|
479
|
+
*/
|
|
480
|
+
value?: string | null;
|
|
481
|
+
[k: string]: unknown;
|
|
482
|
+
}
|
|
483
|
+
| {
|
|
484
|
+
/**
|
|
485
|
+
* The offered answers.
|
|
486
|
+
*/
|
|
487
|
+
choices?: Choice[];
|
|
488
|
+
/**
|
|
489
|
+
* How long there is to answer.
|
|
490
|
+
*/
|
|
491
|
+
deadline_ms?: number | null;
|
|
492
|
+
/**
|
|
493
|
+
* Used if the deadline passes.
|
|
494
|
+
*/
|
|
495
|
+
default?: string | null;
|
|
496
|
+
/**
|
|
497
|
+
* An answer outside `choices` is accepted.
|
|
498
|
+
*/
|
|
499
|
+
free?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* More than one may be picked.
|
|
502
|
+
*/
|
|
503
|
+
multi?: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* What is asked.
|
|
506
|
+
*/
|
|
507
|
+
prompt: string;
|
|
508
|
+
type: "question";
|
|
509
|
+
[k: string]: unknown;
|
|
510
|
+
}
|
|
511
|
+
| {
|
|
512
|
+
/**
|
|
513
|
+
* How much is done.
|
|
514
|
+
*/
|
|
515
|
+
done?: number | null;
|
|
516
|
+
/**
|
|
517
|
+
* What is happening.
|
|
518
|
+
*/
|
|
519
|
+
label: string;
|
|
520
|
+
/**
|
|
521
|
+
* How much there is.
|
|
522
|
+
*/
|
|
523
|
+
total?: number | null;
|
|
524
|
+
type: "progress";
|
|
525
|
+
[k: string]: unknown;
|
|
526
|
+
}
|
|
527
|
+
| {
|
|
528
|
+
/**
|
|
529
|
+
* What it shows, in words.
|
|
530
|
+
*/
|
|
531
|
+
alt: string;
|
|
532
|
+
/**
|
|
533
|
+
* The bytes, base64.
|
|
534
|
+
*/
|
|
535
|
+
data: string;
|
|
536
|
+
/**
|
|
537
|
+
* Height in pixels.
|
|
538
|
+
*/
|
|
539
|
+
h?: number | null;
|
|
540
|
+
/**
|
|
541
|
+
* `image/png`, …
|
|
542
|
+
*/
|
|
543
|
+
mime: string;
|
|
544
|
+
/**
|
|
545
|
+
* A caption.
|
|
546
|
+
*/
|
|
547
|
+
title?: string | null;
|
|
548
|
+
type: "image";
|
|
549
|
+
/**
|
|
550
|
+
* Width in pixels.
|
|
551
|
+
*/
|
|
552
|
+
w?: number | null;
|
|
553
|
+
[k: string]: unknown;
|
|
554
|
+
}
|
|
555
|
+
| {
|
|
556
|
+
/**
|
|
557
|
+
* What it shows, in words.
|
|
558
|
+
*/
|
|
559
|
+
alt: string;
|
|
560
|
+
/**
|
|
561
|
+
* `w * h` colours, row by row, `0xRRGGBB`.
|
|
562
|
+
*/
|
|
563
|
+
cells: number[];
|
|
564
|
+
/**
|
|
565
|
+
* Height, in cells.
|
|
566
|
+
*/
|
|
567
|
+
h: number;
|
|
568
|
+
/**
|
|
569
|
+
* Row and column names.
|
|
570
|
+
*/
|
|
571
|
+
labels?: RasterLabels | null;
|
|
572
|
+
/**
|
|
573
|
+
* What the colours mean.
|
|
574
|
+
*/
|
|
575
|
+
legend?: LegendItem[] | null;
|
|
576
|
+
type: "raster";
|
|
577
|
+
/**
|
|
578
|
+
* Width, in cells.
|
|
579
|
+
*/
|
|
580
|
+
w: number;
|
|
581
|
+
[k: string]: unknown;
|
|
582
|
+
}
|
|
583
|
+
| {
|
|
584
|
+
/**
|
|
585
|
+
* What choosing sends.
|
|
586
|
+
*/
|
|
587
|
+
action?: string | null;
|
|
588
|
+
/**
|
|
589
|
+
* Shown when there are none.
|
|
590
|
+
*/
|
|
591
|
+
empty?: string | null;
|
|
592
|
+
/**
|
|
593
|
+
* The files.
|
|
594
|
+
*/
|
|
595
|
+
files: FileEntry[];
|
|
596
|
+
/**
|
|
597
|
+
* Still arriving.
|
|
598
|
+
*/
|
|
599
|
+
loading?: boolean;
|
|
600
|
+
type: "files";
|
|
601
|
+
[k: string]: unknown;
|
|
602
|
+
}
|
|
603
|
+
| {
|
|
604
|
+
/**
|
|
605
|
+
* The changed regions.
|
|
606
|
+
*/
|
|
607
|
+
hunks?: Hunk[];
|
|
608
|
+
/**
|
|
609
|
+
* The file.
|
|
610
|
+
*/
|
|
611
|
+
path: string;
|
|
612
|
+
type: "diff";
|
|
613
|
+
[k: string]: unknown;
|
|
614
|
+
}
|
|
615
|
+
| {
|
|
616
|
+
/**
|
|
617
|
+
* Its exit code.
|
|
618
|
+
*/
|
|
619
|
+
exit?: number | null;
|
|
620
|
+
/**
|
|
621
|
+
* What was run.
|
|
622
|
+
*/
|
|
623
|
+
line: string;
|
|
624
|
+
/**
|
|
625
|
+
* What it printed.
|
|
626
|
+
*/
|
|
627
|
+
output?: string;
|
|
628
|
+
/**
|
|
629
|
+
* How far along.
|
|
630
|
+
*/
|
|
631
|
+
status?: Status | null;
|
|
632
|
+
type: "command";
|
|
633
|
+
[k: string]: unknown;
|
|
634
|
+
}
|
|
635
|
+
| {
|
|
636
|
+
/**
|
|
637
|
+
* What to show instead: a catalog node.
|
|
638
|
+
*/
|
|
639
|
+
fallback?: CatalogNode | null;
|
|
640
|
+
/**
|
|
641
|
+
* `<ext>.<name>`.
|
|
642
|
+
*/
|
|
643
|
+
kind: string;
|
|
644
|
+
/**
|
|
645
|
+
* Whatever that renderer needs.
|
|
646
|
+
*/
|
|
647
|
+
props?: {
|
|
648
|
+
[k: string]: unknown;
|
|
649
|
+
};
|
|
650
|
+
type: "custom";
|
|
651
|
+
[k: string]: unknown;
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* Which way a [`SurfaceKind::Stack`] lays its children out.
|
|
655
|
+
*/
|
|
656
|
+
export type StackDir = "row" | "column";
|
|
657
|
+
/**
|
|
658
|
+
* How a run inside a `text`'s `spans` is meant.
|
|
659
|
+
*/
|
|
660
|
+
export type SpanStyle = "bold" | "dim" | "code" | "kbd" | "file" | "elapsed";
|
|
661
|
+
/**
|
|
662
|
+
* A hint about how a run of text is meant, never a colour.
|
|
663
|
+
*/
|
|
664
|
+
export type TextStyle = "plain" | "muted" | "emphasis" | "code" | "error" | "success" | "warning";
|
|
665
|
+
/**
|
|
666
|
+
* A tone: how a badge, a stat or a callout is meant, never a colour.
|
|
667
|
+
*/
|
|
668
|
+
export type Tone = "neutral" | "info" | "success" | "warning" | "error";
|
|
669
|
+
/**
|
|
670
|
+
* A `table` column: a title, or a title with its alignment and priority.
|
|
671
|
+
*/
|
|
672
|
+
export type Column =
|
|
673
|
+
| string
|
|
674
|
+
| {
|
|
675
|
+
/**
|
|
676
|
+
* How its cells align.
|
|
677
|
+
*/
|
|
678
|
+
align?: Align | null;
|
|
679
|
+
/**
|
|
680
|
+
* Lower priority is dropped first when narrow.
|
|
681
|
+
*/
|
|
682
|
+
priority?: number | null;
|
|
683
|
+
/**
|
|
684
|
+
* Its title.
|
|
685
|
+
*/
|
|
686
|
+
title: string;
|
|
687
|
+
[k: string]: unknown;
|
|
688
|
+
};
|
|
689
|
+
/**
|
|
690
|
+
* A column's alignment.
|
|
691
|
+
*/
|
|
692
|
+
export type Align = "left" | "right" | "center";
|
|
693
|
+
/**
|
|
694
|
+
* A `table` row: its cells, or its cells with a key that names it.
|
|
695
|
+
*/
|
|
696
|
+
export type TableRow =
|
|
697
|
+
| TableCell[]
|
|
698
|
+
| {
|
|
699
|
+
/**
|
|
700
|
+
* Its cells.
|
|
701
|
+
*/
|
|
702
|
+
cells: TableCell[];
|
|
703
|
+
/**
|
|
704
|
+
* What names the row: sent as `value` when it is chosen.
|
|
705
|
+
*/
|
|
706
|
+
key: string;
|
|
707
|
+
[k: string]: unknown;
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* A `table` cell: a string, or a [`Cell`] with its style.
|
|
711
|
+
*/
|
|
712
|
+
export type TableCell = string | Cell;
|
|
713
|
+
/**
|
|
714
|
+
* How a `list` draws its items.
|
|
715
|
+
*/
|
|
716
|
+
export type ListStyle = "bullet" | "number" | "select";
|
|
717
|
+
/**
|
|
718
|
+
* A log line's level.
|
|
719
|
+
*/
|
|
720
|
+
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
721
|
+
/**
|
|
722
|
+
* Which chart a [`SurfaceKind::Chart`] is (decision 0090).
|
|
723
|
+
*/
|
|
724
|
+
export type ChartKind = "bars" | "columns" | "stacked" | "line" | "area" | "scatter" | "sparkline" | "donut" | "gauge";
|
|
725
|
+
/**
|
|
726
|
+
* How far along whatever produced this surface is.
|
|
727
|
+
*/
|
|
728
|
+
export type Status = "pending" | "running" | "done" | "failed" | "cancelled";
|
|
729
|
+
/**
|
|
730
|
+
* How a `task` is drawn.
|
|
731
|
+
*/
|
|
732
|
+
export type TaskStyle = "list" | "pipeline";
|
|
733
|
+
/**
|
|
734
|
+
* A button's tone.
|
|
735
|
+
*/
|
|
736
|
+
export type ButtonTone = "default" | "primary" | "danger";
|
|
737
|
+
/**
|
|
738
|
+
* What a [`Field`] collects.
|
|
739
|
+
*/
|
|
740
|
+
export type FieldKind =
|
|
741
|
+
| {
|
|
742
|
+
t: "text";
|
|
743
|
+
[k: string]: unknown;
|
|
744
|
+
}
|
|
745
|
+
| {
|
|
746
|
+
t: "secret";
|
|
747
|
+
[k: string]: unknown;
|
|
748
|
+
}
|
|
749
|
+
| {
|
|
750
|
+
t: "number";
|
|
751
|
+
[k: string]: unknown;
|
|
752
|
+
}
|
|
753
|
+
| {
|
|
754
|
+
t: "bool";
|
|
755
|
+
[k: string]: unknown;
|
|
756
|
+
}
|
|
757
|
+
| {
|
|
758
|
+
/**
|
|
759
|
+
* The options.
|
|
760
|
+
*/
|
|
761
|
+
choices: Choice[];
|
|
762
|
+
t: "choice";
|
|
763
|
+
[k: string]: unknown;
|
|
764
|
+
};
|
|
765
|
+
/**
|
|
766
|
+
* How a form field is drawn: `select`/`radio` for a choice, `check`/`toggle` for a bool.
|
|
767
|
+
*/
|
|
768
|
+
export type FieldStyle = "select" | "radio" | "check" | "toggle";
|
|
769
|
+
/**
|
|
770
|
+
* A changed file's status in a `files`.
|
|
771
|
+
*/
|
|
772
|
+
export type FileStatus = "added" | "modified" | "deleted" | "renamed";
|
|
773
|
+
/**
|
|
774
|
+
* What a line of a diff is.
|
|
775
|
+
*/
|
|
776
|
+
export type DiffLineKind = "context" | "add" | "remove";
|
|
777
|
+
/**
|
|
778
|
+
* Kernel to client.
|
|
779
|
+
*
|
|
780
|
+
* Every variant carries a `seq`: a client detects a gap by arithmetic and re-attaches with `since`, which is only possible if the ordering is on the frame rather than implied by the transport.
|
|
781
|
+
*/
|
|
782
|
+
export type Event =
|
|
783
|
+
| {
|
|
784
|
+
/**
|
|
785
|
+
* Where this sits in the session's order.
|
|
786
|
+
*/
|
|
787
|
+
seq: Seq;
|
|
788
|
+
t: "turn.started";
|
|
789
|
+
/**
|
|
790
|
+
* Which turn.
|
|
791
|
+
*/
|
|
792
|
+
turn: TurnId;
|
|
793
|
+
[k: string]: unknown;
|
|
794
|
+
}
|
|
795
|
+
| {
|
|
796
|
+
/**
|
|
797
|
+
* How it changed.
|
|
798
|
+
*/
|
|
799
|
+
patch: SurfacePatch;
|
|
800
|
+
/**
|
|
801
|
+
* Where this sits in the session's order.
|
|
802
|
+
*/
|
|
803
|
+
seq: Seq;
|
|
804
|
+
/**
|
|
805
|
+
* Which surface.
|
|
806
|
+
*/
|
|
807
|
+
surface: SurfaceId;
|
|
808
|
+
t: "delta";
|
|
809
|
+
[k: string]: unknown;
|
|
810
|
+
}
|
|
811
|
+
| {
|
|
812
|
+
/**
|
|
813
|
+
* Which call.
|
|
814
|
+
*/
|
|
815
|
+
call: CallId;
|
|
816
|
+
/**
|
|
817
|
+
* Which tool.
|
|
818
|
+
*/
|
|
819
|
+
ref: ToolRef;
|
|
820
|
+
/**
|
|
821
|
+
* Where this sits in the session's order.
|
|
822
|
+
*/
|
|
823
|
+
seq: Seq;
|
|
824
|
+
t: "tool.started";
|
|
825
|
+
[k: string]: unknown;
|
|
826
|
+
}
|
|
827
|
+
| {
|
|
828
|
+
/**
|
|
829
|
+
* Which call.
|
|
830
|
+
*/
|
|
831
|
+
call: CallId;
|
|
832
|
+
/**
|
|
833
|
+
* How it went.
|
|
834
|
+
*/
|
|
835
|
+
outcome: Outcome;
|
|
836
|
+
/**
|
|
837
|
+
* Where this sits in the session's order.
|
|
838
|
+
*/
|
|
839
|
+
seq: Seq;
|
|
840
|
+
t: "tool.settled";
|
|
841
|
+
[k: string]: unknown;
|
|
842
|
+
}
|
|
843
|
+
| {
|
|
844
|
+
/**
|
|
845
|
+
* How long there is to answer before the default applies.
|
|
846
|
+
*/
|
|
847
|
+
deadline_ms: number;
|
|
848
|
+
/**
|
|
849
|
+
* The question.
|
|
850
|
+
*/
|
|
851
|
+
prompt: ConsentPrompt;
|
|
852
|
+
/**
|
|
853
|
+
* Where this sits in the session's order.
|
|
854
|
+
*/
|
|
855
|
+
seq: Seq;
|
|
856
|
+
t: "consent.request";
|
|
857
|
+
[k: string]: unknown;
|
|
858
|
+
}
|
|
859
|
+
| {
|
|
860
|
+
/**
|
|
861
|
+
* Where this sits in the session's order.
|
|
862
|
+
*/
|
|
863
|
+
seq: Seq;
|
|
864
|
+
t: "turn.settled";
|
|
865
|
+
/**
|
|
866
|
+
* Which turn.
|
|
867
|
+
*/
|
|
868
|
+
turn: TurnId;
|
|
869
|
+
/**
|
|
870
|
+
* What it cost.
|
|
871
|
+
*/
|
|
872
|
+
usage: Usage;
|
|
873
|
+
[k: string]: unknown;
|
|
874
|
+
}
|
|
875
|
+
| {
|
|
876
|
+
/**
|
|
877
|
+
* What went wrong.
|
|
878
|
+
*/
|
|
879
|
+
detail: ErrorDetail;
|
|
880
|
+
/**
|
|
881
|
+
* How far it reaches.
|
|
882
|
+
*/
|
|
883
|
+
scope: ErrorScope;
|
|
884
|
+
/**
|
|
885
|
+
* Where this sits in the session's order.
|
|
886
|
+
*/
|
|
887
|
+
seq: Seq;
|
|
888
|
+
t: "error";
|
|
889
|
+
[k: string]: unknown;
|
|
890
|
+
}
|
|
891
|
+
| {
|
|
892
|
+
/**
|
|
893
|
+
* When it was produced, on the host's clock.
|
|
894
|
+
*/
|
|
895
|
+
at_ms: number;
|
|
896
|
+
/**
|
|
897
|
+
* Where this sits in the session's order.
|
|
898
|
+
*/
|
|
899
|
+
seq: Seq;
|
|
900
|
+
t: "reasoning";
|
|
901
|
+
/**
|
|
902
|
+
* The text.
|
|
903
|
+
*/
|
|
904
|
+
text: string;
|
|
905
|
+
/**
|
|
906
|
+
* Which turn is thinking.
|
|
907
|
+
*/
|
|
908
|
+
turn: TurnId;
|
|
909
|
+
[k: string]: unknown;
|
|
910
|
+
}
|
|
911
|
+
| {
|
|
912
|
+
/**
|
|
913
|
+
* When it ended, on the host's clock.
|
|
914
|
+
*/
|
|
915
|
+
at_ms: number;
|
|
916
|
+
/**
|
|
917
|
+
* Where this sits in the session's order.
|
|
918
|
+
*/
|
|
919
|
+
seq: Seq;
|
|
920
|
+
t: "reasoning.end";
|
|
921
|
+
/**
|
|
922
|
+
* Which turn.
|
|
923
|
+
*/
|
|
924
|
+
turn: TurnId;
|
|
925
|
+
[k: string]: unknown;
|
|
926
|
+
}
|
|
927
|
+
| {
|
|
928
|
+
/**
|
|
929
|
+
* Why.
|
|
930
|
+
*/
|
|
931
|
+
reason: CancelReason;
|
|
932
|
+
/**
|
|
933
|
+
* Where this sits in the session's order.
|
|
934
|
+
*/
|
|
935
|
+
seq: Seq;
|
|
936
|
+
t: "turn.cancelled";
|
|
937
|
+
/**
|
|
938
|
+
* Which turn.
|
|
939
|
+
*/
|
|
940
|
+
turn: TurnId;
|
|
941
|
+
[k: string]: unknown;
|
|
942
|
+
}
|
|
943
|
+
| {
|
|
944
|
+
/**
|
|
945
|
+
* Each component instance's data (decision 0092 §4), by owner then id: AG-UI's `/data`, a sibling of `/ui`. Absent when empty, so a stream from before components parses.
|
|
946
|
+
*/
|
|
947
|
+
data?: {
|
|
948
|
+
[k: string]: unknown;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* The document.
|
|
952
|
+
*/
|
|
953
|
+
doc: UiDoc;
|
|
954
|
+
/**
|
|
955
|
+
* Where this sits in the session's order.
|
|
956
|
+
*/
|
|
957
|
+
seq: Seq;
|
|
958
|
+
t: "ui.snapshot";
|
|
959
|
+
[k: string]: unknown;
|
|
960
|
+
}
|
|
961
|
+
| {
|
|
962
|
+
/**
|
|
963
|
+
* The ops.
|
|
964
|
+
*/
|
|
965
|
+
ops: UiOp[];
|
|
966
|
+
/**
|
|
967
|
+
* Where this sits in the session's order.
|
|
968
|
+
*/
|
|
969
|
+
seq: Seq;
|
|
970
|
+
t: "ui";
|
|
971
|
+
[k: string]: unknown;
|
|
972
|
+
}
|
|
973
|
+
| {
|
|
974
|
+
/**
|
|
975
|
+
* The ops.
|
|
976
|
+
*/
|
|
977
|
+
ops: UiOp[];
|
|
978
|
+
/**
|
|
979
|
+
* Where this sits in the session's order.
|
|
980
|
+
*/
|
|
981
|
+
seq: Seq;
|
|
982
|
+
t: "data";
|
|
983
|
+
[k: string]: unknown;
|
|
984
|
+
}
|
|
985
|
+
| {
|
|
986
|
+
/**
|
|
987
|
+
* The extension.
|
|
988
|
+
*/
|
|
989
|
+
ext: string;
|
|
990
|
+
/**
|
|
991
|
+
* The key.
|
|
992
|
+
*/
|
|
993
|
+
key: string;
|
|
994
|
+
/**
|
|
995
|
+
* Where this sits in the session's order.
|
|
996
|
+
*/
|
|
997
|
+
seq: Seq;
|
|
998
|
+
t: "state.changed";
|
|
999
|
+
/**
|
|
1000
|
+
* Its new value.
|
|
1001
|
+
*/
|
|
1002
|
+
value: {
|
|
1003
|
+
[k: string]: unknown;
|
|
1004
|
+
};
|
|
1005
|
+
/**
|
|
1006
|
+
* The watch, as `state.watch` answered.
|
|
1007
|
+
*/
|
|
1008
|
+
watch: number;
|
|
1009
|
+
[k: string]: unknown;
|
|
1010
|
+
}
|
|
1011
|
+
| {
|
|
1012
|
+
/**
|
|
1013
|
+
* Who asked: the extension's id (`[extension] id` in its `orrery.toml`).
|
|
1014
|
+
*/
|
|
1015
|
+
ext: string;
|
|
1016
|
+
/**
|
|
1017
|
+
* How loud.
|
|
1018
|
+
*/
|
|
1019
|
+
level: NoticeLevel;
|
|
1020
|
+
/**
|
|
1021
|
+
* Where this sits in the session's order.
|
|
1022
|
+
*/
|
|
1023
|
+
seq: Seq;
|
|
1024
|
+
t: "notice";
|
|
1025
|
+
/**
|
|
1026
|
+
* What it says.
|
|
1027
|
+
*/
|
|
1028
|
+
text: string;
|
|
1029
|
+
[k: string]: unknown;
|
|
1030
|
+
}
|
|
1031
|
+
| {
|
|
1032
|
+
/**
|
|
1033
|
+
* Where it is, who placed it, its fallback.
|
|
1034
|
+
*/
|
|
1035
|
+
placed: Placed;
|
|
1036
|
+
/**
|
|
1037
|
+
* Where this sits in the session's order.
|
|
1038
|
+
*/
|
|
1039
|
+
seq: Seq;
|
|
1040
|
+
/**
|
|
1041
|
+
* What it shows.
|
|
1042
|
+
*/
|
|
1043
|
+
surface: Surface;
|
|
1044
|
+
t: "ui.placed";
|
|
1045
|
+
[k: string]: unknown;
|
|
1046
|
+
}
|
|
1047
|
+
| {
|
|
1048
|
+
/**
|
|
1049
|
+
* The id its owner gave it.
|
|
1050
|
+
*/
|
|
1051
|
+
id: string;
|
|
1052
|
+
/**
|
|
1053
|
+
* Who placed it: `ext:<id>`, `agent` or `config`.
|
|
1054
|
+
*/
|
|
1055
|
+
owner: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* Where this sits in the session's order.
|
|
1058
|
+
*/
|
|
1059
|
+
seq: Seq;
|
|
1060
|
+
t: "ui.unplaced";
|
|
1061
|
+
[k: string]: unknown;
|
|
1062
|
+
}
|
|
1063
|
+
| {
|
|
1064
|
+
/**
|
|
1065
|
+
* Where this sits in the session's order.
|
|
1066
|
+
*/
|
|
1067
|
+
seq: Seq;
|
|
1068
|
+
t: "task.changed";
|
|
1069
|
+
/**
|
|
1070
|
+
* The task, now.
|
|
1071
|
+
*/
|
|
1072
|
+
task: TaskInfo;
|
|
1073
|
+
[k: string]: unknown;
|
|
1074
|
+
}
|
|
1075
|
+
| {
|
|
1076
|
+
/**
|
|
1077
|
+
* Which extension (`[extension] id` in its `orrery.toml`).
|
|
1078
|
+
*/
|
|
1079
|
+
ext: ExtId;
|
|
1080
|
+
/**
|
|
1081
|
+
* The segment's handle: AG-UI's `subagentRunId`.
|
|
1082
|
+
*/
|
|
1083
|
+
id: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* The tool call that caused it, when one did.
|
|
1086
|
+
*/
|
|
1087
|
+
parent_call?: CallId | null;
|
|
1088
|
+
/**
|
|
1089
|
+
* The turn that caused it, when no call did.
|
|
1090
|
+
*/
|
|
1091
|
+
parent_turn?: TurnId | null;
|
|
1092
|
+
/**
|
|
1093
|
+
* What it was asked, shortened for display.
|
|
1094
|
+
*/
|
|
1095
|
+
prompt?: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* Where this sits in the session's order.
|
|
1098
|
+
*/
|
|
1099
|
+
seq: Seq;
|
|
1100
|
+
t: "ext.segment.started";
|
|
1101
|
+
/**
|
|
1102
|
+
* A model it called or an agent it ran.
|
|
1103
|
+
*/
|
|
1104
|
+
via: Via;
|
|
1105
|
+
[k: string]: unknown;
|
|
1106
|
+
}
|
|
1107
|
+
| {
|
|
1108
|
+
/**
|
|
1109
|
+
* Which segment.
|
|
1110
|
+
*/
|
|
1111
|
+
id: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* How it went.
|
|
1114
|
+
*/
|
|
1115
|
+
outcome: Outcome;
|
|
1116
|
+
/**
|
|
1117
|
+
* Where this sits in the session's order.
|
|
1118
|
+
*/
|
|
1119
|
+
seq: Seq;
|
|
1120
|
+
t: "ext.segment.settled";
|
|
1121
|
+
/**
|
|
1122
|
+
* What it cost.
|
|
1123
|
+
*/
|
|
1124
|
+
usage?: Usage;
|
|
1125
|
+
[k: string]: unknown;
|
|
1126
|
+
};
|
|
1127
|
+
export type Seq = number;
|
|
1128
|
+
export type TurnId = string;
|
|
1129
|
+
/**
|
|
1130
|
+
* A change to a surface already on screen.
|
|
1131
|
+
*
|
|
1132
|
+
* The whole point of the surface protocol: a streaming tool sends one [`SurfacePatch::Append`] per chunk rather than a whole new surface, so the hot path is a string and not a tree.
|
|
1133
|
+
*/
|
|
1134
|
+
export type SurfacePatch =
|
|
1135
|
+
| {
|
|
1136
|
+
/**
|
|
1137
|
+
* Which surface.
|
|
1138
|
+
*/
|
|
1139
|
+
id: SurfaceId;
|
|
1140
|
+
op: "replace";
|
|
1141
|
+
/**
|
|
1142
|
+
* What it becomes.
|
|
1143
|
+
*/
|
|
1144
|
+
value: Surface;
|
|
1145
|
+
[k: string]: unknown;
|
|
1146
|
+
}
|
|
1147
|
+
| {
|
|
1148
|
+
/**
|
|
1149
|
+
* Which surface.
|
|
1150
|
+
*/
|
|
1151
|
+
id: SurfaceId;
|
|
1152
|
+
op: "append";
|
|
1153
|
+
/**
|
|
1154
|
+
* What to add.
|
|
1155
|
+
*/
|
|
1156
|
+
text: string;
|
|
1157
|
+
[k: string]: unknown;
|
|
1158
|
+
}
|
|
1159
|
+
| {
|
|
1160
|
+
/**
|
|
1161
|
+
* Which surface.
|
|
1162
|
+
*/
|
|
1163
|
+
id: SurfaceId;
|
|
1164
|
+
op: "set";
|
|
1165
|
+
/**
|
|
1166
|
+
* The path from the surface's root to the field.
|
|
1167
|
+
*/
|
|
1168
|
+
path: string[];
|
|
1169
|
+
/**
|
|
1170
|
+
* The new value.
|
|
1171
|
+
*/
|
|
1172
|
+
value: {
|
|
1173
|
+
[k: string]: unknown;
|
|
1174
|
+
};
|
|
1175
|
+
[k: string]: unknown;
|
|
1176
|
+
}
|
|
1177
|
+
| {
|
|
1178
|
+
/**
|
|
1179
|
+
* Which surface.
|
|
1180
|
+
*/
|
|
1181
|
+
id: SurfaceId;
|
|
1182
|
+
op: "remove";
|
|
1183
|
+
[k: string]: unknown;
|
|
1184
|
+
};
|
|
1185
|
+
export type SurfaceId = string;
|
|
1186
|
+
/**
|
|
1187
|
+
* What a surface *is*.
|
|
1188
|
+
*/
|
|
1189
|
+
export type SurfaceKind =
|
|
1190
|
+
| {
|
|
1191
|
+
/**
|
|
1192
|
+
* How it is meant.
|
|
1193
|
+
*/
|
|
1194
|
+
style?: TextStyle | null;
|
|
1195
|
+
t: "text";
|
|
1196
|
+
/**
|
|
1197
|
+
* The text.
|
|
1198
|
+
*/
|
|
1199
|
+
value: string;
|
|
1200
|
+
[k: string]: unknown;
|
|
1201
|
+
}
|
|
1202
|
+
| {
|
|
1203
|
+
/**
|
|
1204
|
+
* The header row.
|
|
1205
|
+
*/
|
|
1206
|
+
columns: string[];
|
|
1207
|
+
/**
|
|
1208
|
+
* The body. Every row is expected to be `columns.len()` long.
|
|
1209
|
+
*/
|
|
1210
|
+
rows?: Cell[][];
|
|
1211
|
+
t: "table";
|
|
1212
|
+
[k: string]: unknown;
|
|
1213
|
+
}
|
|
1214
|
+
| {
|
|
1215
|
+
/**
|
|
1216
|
+
* The roots.
|
|
1217
|
+
*/
|
|
1218
|
+
nodes?: TreeNode[];
|
|
1219
|
+
t: "tree";
|
|
1220
|
+
[k: string]: unknown;
|
|
1221
|
+
}
|
|
1222
|
+
| {
|
|
1223
|
+
/**
|
|
1224
|
+
* The changed regions.
|
|
1225
|
+
*/
|
|
1226
|
+
hunks?: Hunk[];
|
|
1227
|
+
/**
|
|
1228
|
+
* The file.
|
|
1229
|
+
*/
|
|
1230
|
+
path: string;
|
|
1231
|
+
t: "diff";
|
|
1232
|
+
[k: string]: unknown;
|
|
1233
|
+
}
|
|
1234
|
+
| {
|
|
1235
|
+
/**
|
|
1236
|
+
* How much is done.
|
|
1237
|
+
*/
|
|
1238
|
+
done?: number | null;
|
|
1239
|
+
/**
|
|
1240
|
+
* What is happening.
|
|
1241
|
+
*/
|
|
1242
|
+
label: string;
|
|
1243
|
+
t: "progress";
|
|
1244
|
+
/**
|
|
1245
|
+
* How much there is.
|
|
1246
|
+
*/
|
|
1247
|
+
total?: number | null;
|
|
1248
|
+
[k: string]: unknown;
|
|
1249
|
+
}
|
|
1250
|
+
| {
|
|
1251
|
+
/**
|
|
1252
|
+
* Which channel: `stdout`, `stderr`, a log name.
|
|
1253
|
+
*/
|
|
1254
|
+
id: string;
|
|
1255
|
+
t: "stream";
|
|
1256
|
+
[k: string]: unknown;
|
|
1257
|
+
}
|
|
1258
|
+
| {
|
|
1259
|
+
/**
|
|
1260
|
+
* The entries.
|
|
1261
|
+
*/
|
|
1262
|
+
items?: TaskItem[];
|
|
1263
|
+
t: "task";
|
|
1264
|
+
[k: string]: unknown;
|
|
1265
|
+
}
|
|
1266
|
+
| {
|
|
1267
|
+
/**
|
|
1268
|
+
* The offered answers.
|
|
1269
|
+
*/
|
|
1270
|
+
choices?: Choice[];
|
|
1271
|
+
/**
|
|
1272
|
+
* How long there is to answer.
|
|
1273
|
+
*/
|
|
1274
|
+
deadline_ms?: number | null;
|
|
1275
|
+
/**
|
|
1276
|
+
* What is used if the deadline passes.
|
|
1277
|
+
*/
|
|
1278
|
+
default?: string | null;
|
|
1279
|
+
/**
|
|
1280
|
+
* Whether an answer outside `choices` is accepted.
|
|
1281
|
+
*/
|
|
1282
|
+
free: boolean;
|
|
1283
|
+
/**
|
|
1284
|
+
* Whether more than one may be picked.
|
|
1285
|
+
*/
|
|
1286
|
+
multi: boolean;
|
|
1287
|
+
/**
|
|
1288
|
+
* What is being asked.
|
|
1289
|
+
*/
|
|
1290
|
+
prompt: string;
|
|
1291
|
+
t: "question";
|
|
1292
|
+
[k: string]: unknown;
|
|
1293
|
+
}
|
|
1294
|
+
| {
|
|
1295
|
+
/**
|
|
1296
|
+
* The inputs.
|
|
1297
|
+
*/
|
|
1298
|
+
fields?: Field[];
|
|
1299
|
+
/**
|
|
1300
|
+
* The submit button's label.
|
|
1301
|
+
*/
|
|
1302
|
+
submit: string;
|
|
1303
|
+
t: "form";
|
|
1304
|
+
[k: string]: unknown;
|
|
1305
|
+
}
|
|
1306
|
+
| {
|
|
1307
|
+
/**
|
|
1308
|
+
* The contents.
|
|
1309
|
+
*/
|
|
1310
|
+
children?: Surface[];
|
|
1311
|
+
/**
|
|
1312
|
+
* Whether it starts folded.
|
|
1313
|
+
*/
|
|
1314
|
+
collapsed: boolean;
|
|
1315
|
+
/**
|
|
1316
|
+
* Which way.
|
|
1317
|
+
*/
|
|
1318
|
+
dir: StackDir;
|
|
1319
|
+
t: "stack";
|
|
1320
|
+
/**
|
|
1321
|
+
* An optional heading.
|
|
1322
|
+
*/
|
|
1323
|
+
title?: string | null;
|
|
1324
|
+
[k: string]: unknown;
|
|
1325
|
+
}
|
|
1326
|
+
| {
|
|
1327
|
+
/**
|
|
1328
|
+
* Whether the last patch has arrived.
|
|
1329
|
+
*/
|
|
1330
|
+
complete: boolean;
|
|
1331
|
+
t: "markdown";
|
|
1332
|
+
/**
|
|
1333
|
+
* The source.
|
|
1334
|
+
*/
|
|
1335
|
+
value: string;
|
|
1336
|
+
[k: string]: unknown;
|
|
1337
|
+
}
|
|
1338
|
+
| {
|
|
1339
|
+
/**
|
|
1340
|
+
* What to show instead, for a client that has no such renderer: core kinds only. Without one, a client draws the payload as text, one `key value` line each (decision 0086).
|
|
1341
|
+
*/
|
|
1342
|
+
fallback?: Surface | null;
|
|
1343
|
+
/**
|
|
1344
|
+
* `<ext>.<name>`, so two extensions cannot claim one renderer.
|
|
1345
|
+
*/
|
|
1346
|
+
kind: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* Whatever that renderer needs.
|
|
1349
|
+
*/
|
|
1350
|
+
payload: {
|
|
1351
|
+
[k: string]: unknown;
|
|
1352
|
+
};
|
|
1353
|
+
t: "custom";
|
|
1354
|
+
[k: string]: unknown;
|
|
1355
|
+
}
|
|
1356
|
+
| {
|
|
1357
|
+
/**
|
|
1358
|
+
* Which chart.
|
|
1359
|
+
*/
|
|
1360
|
+
kind: ChartKind;
|
|
1361
|
+
/**
|
|
1362
|
+
* What each value is, in order.
|
|
1363
|
+
*/
|
|
1364
|
+
labels?: string[];
|
|
1365
|
+
/**
|
|
1366
|
+
* The series.
|
|
1367
|
+
*/
|
|
1368
|
+
series: Series[];
|
|
1369
|
+
t: "chart";
|
|
1370
|
+
/**
|
|
1371
|
+
* A heading.
|
|
1372
|
+
*/
|
|
1373
|
+
title?: string | null;
|
|
1374
|
+
/**
|
|
1375
|
+
* The values' unit: `ms`, `%`.
|
|
1376
|
+
*/
|
|
1377
|
+
unit?: string | null;
|
|
1378
|
+
[k: string]: unknown;
|
|
1379
|
+
}
|
|
1380
|
+
| {
|
|
1381
|
+
/**
|
|
1382
|
+
* What it shows, in words: drawn where it cannot be.
|
|
1383
|
+
*/
|
|
1384
|
+
alt: string;
|
|
1385
|
+
/**
|
|
1386
|
+
* `w * h` colours, row by row, each packed `0xRRGGBB`.
|
|
1387
|
+
*/
|
|
1388
|
+
cells: number[];
|
|
1389
|
+
/**
|
|
1390
|
+
* Its height, in cells.
|
|
1391
|
+
*/
|
|
1392
|
+
h: number;
|
|
1393
|
+
/**
|
|
1394
|
+
* The names of its rows and columns.
|
|
1395
|
+
*/
|
|
1396
|
+
labels?: RasterLabels | null;
|
|
1397
|
+
/**
|
|
1398
|
+
* What its colours mean, in order.
|
|
1399
|
+
*/
|
|
1400
|
+
legend?: LegendItem[] | null;
|
|
1401
|
+
t: "raster";
|
|
1402
|
+
/**
|
|
1403
|
+
* Its width, in cells.
|
|
1404
|
+
*/
|
|
1405
|
+
w: number;
|
|
1406
|
+
[k: string]: unknown;
|
|
1407
|
+
}
|
|
1408
|
+
| {
|
|
1409
|
+
/**
|
|
1410
|
+
* What it shows, in words: drawn where it cannot be.
|
|
1411
|
+
*/
|
|
1412
|
+
alt: string;
|
|
1413
|
+
/**
|
|
1414
|
+
* The file's bytes, base64.
|
|
1415
|
+
*/
|
|
1416
|
+
data: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* Its height in pixels, when known.
|
|
1419
|
+
*/
|
|
1420
|
+
h?: number | null;
|
|
1421
|
+
/**
|
|
1422
|
+
* `image/png`, `image/jpeg`, …
|
|
1423
|
+
*/
|
|
1424
|
+
mime: string;
|
|
1425
|
+
t: "image";
|
|
1426
|
+
/**
|
|
1427
|
+
* A caption.
|
|
1428
|
+
*/
|
|
1429
|
+
title?: string | null;
|
|
1430
|
+
/**
|
|
1431
|
+
* Its width in pixels, when known.
|
|
1432
|
+
*/
|
|
1433
|
+
w?: number | null;
|
|
1434
|
+
[k: string]: unknown;
|
|
1435
|
+
};
|
|
1436
|
+
export type CallId = string;
|
|
1437
|
+
export type ToolRef = string;
|
|
1438
|
+
/**
|
|
1439
|
+
* How something turned out.
|
|
1440
|
+
*
|
|
1441
|
+
* The type that makes "a denial is a value" real at every layer: the tool registry returns it, the transcript stores it, the wire carries it, the renderer draws it. Nothing anywhere raises a denial as an error, because an error would have to be rendered by whoever caught it, and then two layers would be describing the same refusal in two different ways.
|
|
1442
|
+
*/
|
|
1443
|
+
export type Outcome =
|
|
1444
|
+
| {
|
|
1445
|
+
/**
|
|
1446
|
+
* What to show, when there is something to show.
|
|
1447
|
+
*/
|
|
1448
|
+
surface?: Surface | null;
|
|
1449
|
+
t: "ok";
|
|
1450
|
+
/**
|
|
1451
|
+
* What to feed back to the model, when that differs from what is shown.
|
|
1452
|
+
*/
|
|
1453
|
+
value?: {
|
|
1454
|
+
[k: string]: unknown;
|
|
1455
|
+
};
|
|
1456
|
+
[k: string]: unknown;
|
|
1457
|
+
}
|
|
1458
|
+
| {
|
|
1459
|
+
/**
|
|
1460
|
+
* Why, in words a person can act on.
|
|
1461
|
+
*/
|
|
1462
|
+
reason: string;
|
|
1463
|
+
/**
|
|
1464
|
+
* Which rule.
|
|
1465
|
+
*/
|
|
1466
|
+
rule: RuleId;
|
|
1467
|
+
t: "denied";
|
|
1468
|
+
[k: string]: unknown;
|
|
1469
|
+
}
|
|
1470
|
+
| {
|
|
1471
|
+
/**
|
|
1472
|
+
* How much was produced.
|
|
1473
|
+
*/
|
|
1474
|
+
bytes_emitted: number;
|
|
1475
|
+
/**
|
|
1476
|
+
* How much was allowed.
|
|
1477
|
+
*/
|
|
1478
|
+
limit: number;
|
|
1479
|
+
/**
|
|
1480
|
+
* What there is of it.
|
|
1481
|
+
*/
|
|
1482
|
+
surface?: Surface | null;
|
|
1483
|
+
t: "truncated";
|
|
1484
|
+
[k: string]: unknown;
|
|
1485
|
+
}
|
|
1486
|
+
| {
|
|
1487
|
+
/**
|
|
1488
|
+
* Why.
|
|
1489
|
+
*/
|
|
1490
|
+
reason: CancelReason;
|
|
1491
|
+
t: "cancelled";
|
|
1492
|
+
[k: string]: unknown;
|
|
1493
|
+
}
|
|
1494
|
+
| {
|
|
1495
|
+
/**
|
|
1496
|
+
* Which extension.
|
|
1497
|
+
*/
|
|
1498
|
+
ext: ExtId;
|
|
1499
|
+
t: "unloaded";
|
|
1500
|
+
[k: string]: unknown;
|
|
1501
|
+
}
|
|
1502
|
+
| {
|
|
1503
|
+
/**
|
|
1504
|
+
* A stable, machine-readable code.
|
|
1505
|
+
*/
|
|
1506
|
+
code: string;
|
|
1507
|
+
/**
|
|
1508
|
+
* What went wrong, in words.
|
|
1509
|
+
*/
|
|
1510
|
+
message: string;
|
|
1511
|
+
t: "failed";
|
|
1512
|
+
[k: string]: unknown;
|
|
1513
|
+
};
|
|
1514
|
+
export type RuleId = string;
|
|
1515
|
+
/**
|
|
1516
|
+
* Why something stopped early.
|
|
1517
|
+
*/
|
|
1518
|
+
export type CancelReason = "user" | "budget" | "timeout" | "shutdown" | "parent";
|
|
1519
|
+
export type ExtId = string;
|
|
1520
|
+
/**
|
|
1521
|
+
* What a capability is *about*.
|
|
1522
|
+
*
|
|
1523
|
+
* The wire names are pinned per variant rather than derived where they are dotted (`mem.read`, `run.send`, `session.read`, ...), because no `rename_all` rule produces a dot.
|
|
1524
|
+
*/
|
|
1525
|
+
export type Aspect =
|
|
1526
|
+
| "tool"
|
|
1527
|
+
| "mcp"
|
|
1528
|
+
| "skill"
|
|
1529
|
+
| "ext"
|
|
1530
|
+
| "mode"
|
|
1531
|
+
| "read"
|
|
1532
|
+
| "write"
|
|
1533
|
+
| "spawn"
|
|
1534
|
+
| "net"
|
|
1535
|
+
| "creds"
|
|
1536
|
+
| "ui"
|
|
1537
|
+
| "render"
|
|
1538
|
+
| "mem.read"
|
|
1539
|
+
| "mem.write"
|
|
1540
|
+
| "model"
|
|
1541
|
+
| "run.send"
|
|
1542
|
+
| "session.read"
|
|
1543
|
+
| "session.write"
|
|
1544
|
+
| "intercept";
|
|
1545
|
+
export type PromptId = string;
|
|
1546
|
+
export type Subject = string;
|
|
1547
|
+
/**
|
|
1548
|
+
* How far an error reaches.
|
|
1549
|
+
*/
|
|
1550
|
+
export type ErrorScope = "transport" | "session" | "turn" | "tool" | "ext";
|
|
1551
|
+
/**
|
|
1552
|
+
* A node: what it is, and its children by id.
|
|
1553
|
+
*/
|
|
1554
|
+
export type Node = {
|
|
1555
|
+
/**
|
|
1556
|
+
* Its children, in order.
|
|
1557
|
+
*/
|
|
1558
|
+
children?: string[];
|
|
1559
|
+
[k: string]: unknown;
|
|
1560
|
+
} & Node1;
|
|
1561
|
+
export type Node1 =
|
|
1562
|
+
| {
|
|
1563
|
+
/**
|
|
1564
|
+
* The left pane's placed surfaces, stacked in arrival order: a full-height column beside the thread (decision 0087).
|
|
1565
|
+
*/
|
|
1566
|
+
left?: string[];
|
|
1567
|
+
/**
|
|
1568
|
+
* Which arrangement.
|
|
1569
|
+
*/
|
|
1570
|
+
mode: LayoutMode;
|
|
1571
|
+
/**
|
|
1572
|
+
* The right pane's, likewise.
|
|
1573
|
+
*/
|
|
1574
|
+
right?: string[];
|
|
1575
|
+
type: "layout";
|
|
1576
|
+
[k: string]: unknown;
|
|
1577
|
+
}
|
|
1578
|
+
| {
|
|
1579
|
+
/**
|
|
1580
|
+
* The workspace's git branch.
|
|
1581
|
+
*/
|
|
1582
|
+
branch?: string | null;
|
|
1583
|
+
/**
|
|
1584
|
+
* What failed, ending with what fixes it.
|
|
1585
|
+
*/
|
|
1586
|
+
error?: string | null;
|
|
1587
|
+
/**
|
|
1588
|
+
* The harness running, by name (decision 0007).
|
|
1589
|
+
*/
|
|
1590
|
+
harness?: string | null;
|
|
1591
|
+
/**
|
|
1592
|
+
* A logo, by URL or a client-known name (`orrery`).
|
|
1593
|
+
*/
|
|
1594
|
+
logo?: string | null;
|
|
1595
|
+
/**
|
|
1596
|
+
* The model in use, when there is one.
|
|
1597
|
+
*/
|
|
1598
|
+
model?: string | null;
|
|
1599
|
+
/**
|
|
1600
|
+
* The product's name.
|
|
1601
|
+
*/
|
|
1602
|
+
name: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* The model's provider.
|
|
1605
|
+
*/
|
|
1606
|
+
provider?: string | null;
|
|
1607
|
+
/**
|
|
1608
|
+
* The session's id: what `orrery --resume <id>` takes, which the exit summary prints (decision 0019).
|
|
1609
|
+
*/
|
|
1610
|
+
session?: string | null;
|
|
1611
|
+
/**
|
|
1612
|
+
* `loading` while the model resolves, `error` when the harness failed to load; idle otherwise.
|
|
1613
|
+
*/
|
|
1614
|
+
state?: AgentState | null;
|
|
1615
|
+
/**
|
|
1616
|
+
* Whether that workspace's own configuration is in force.
|
|
1617
|
+
*/
|
|
1618
|
+
trusted: boolean;
|
|
1619
|
+
type: "banner";
|
|
1620
|
+
/**
|
|
1621
|
+
* Its version.
|
|
1622
|
+
*/
|
|
1623
|
+
version: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* The workspace the session runs in.
|
|
1626
|
+
*/
|
|
1627
|
+
workspace: string;
|
|
1628
|
+
[k: string]: unknown;
|
|
1629
|
+
}
|
|
1630
|
+
| {
|
|
1631
|
+
type: "thread";
|
|
1632
|
+
[k: string]: unknown;
|
|
1633
|
+
}
|
|
1634
|
+
| {
|
|
1635
|
+
/**
|
|
1636
|
+
* The band: placed surfaces drawn as rows above the input, in arrival order (decision 0087).
|
|
1637
|
+
*/
|
|
1638
|
+
band?: string[];
|
|
1639
|
+
type: "dock";
|
|
1640
|
+
[k: string]: unknown;
|
|
1641
|
+
}
|
|
1642
|
+
| {
|
|
1643
|
+
/**
|
|
1644
|
+
* What `/` completes.
|
|
1645
|
+
*/
|
|
1646
|
+
commands?: CommandSpec[];
|
|
1647
|
+
/**
|
|
1648
|
+
* A line under the box: what to type or paste, and what the keys do.
|
|
1649
|
+
*/
|
|
1650
|
+
hint?: string | null;
|
|
1651
|
+
/**
|
|
1652
|
+
* Keys bound to commands (decision 0083 §4): a client sends the `command` when the key is pressed at the prompt. Never one of [`RESERVED_KEYS`].
|
|
1653
|
+
*/
|
|
1654
|
+
keys?: KeyBinding[];
|
|
1655
|
+
/**
|
|
1656
|
+
* What is being typed, drawn in the box before the value: `API key ›` (decision 0004). `None` is a plain prompt.
|
|
1657
|
+
*/
|
|
1658
|
+
label?: string | null;
|
|
1659
|
+
/**
|
|
1660
|
+
* What it is for.
|
|
1661
|
+
*/
|
|
1662
|
+
mode: InputMode;
|
|
1663
|
+
/**
|
|
1664
|
+
* The answer may span lines (an extension's `text` ask with `multiline`, decision 0083): Enter adds a line, and the client's own submit chord sends it.
|
|
1665
|
+
*/
|
|
1666
|
+
multiline?: boolean;
|
|
1667
|
+
/**
|
|
1668
|
+
* What the empty box says: what the keys do right now.
|
|
1669
|
+
*/
|
|
1670
|
+
placeholder: string;
|
|
1671
|
+
type: "input";
|
|
1672
|
+
[k: string]: unknown;
|
|
1673
|
+
}
|
|
1674
|
+
| {
|
|
1675
|
+
/**
|
|
1676
|
+
* Agents running, attached ones included (decision 0031): the indicator's `2 agents`. Absent at none.
|
|
1677
|
+
*/
|
|
1678
|
+
agents?: number | null;
|
|
1679
|
+
/**
|
|
1680
|
+
* How full the context window is, when the limit is known.
|
|
1681
|
+
*/
|
|
1682
|
+
context?: ContextUse | null;
|
|
1683
|
+
/**
|
|
1684
|
+
* Segments extensions set on the status line (`ui.status`, decision 0083 §3), in the order they were first set: latest text only, one per `(ext, key)`, gone once cleared.
|
|
1685
|
+
*/
|
|
1686
|
+
ext_status?: ExtStatus[];
|
|
1687
|
+
/**
|
|
1688
|
+
* What this session cost, in micro-USD, when the provider says.
|
|
1689
|
+
*/
|
|
1690
|
+
micro_usd?: number | null;
|
|
1691
|
+
/**
|
|
1692
|
+
* The permission mode: `default`, `accept`, `plan`, `bypass`.
|
|
1693
|
+
*/
|
|
1694
|
+
mode?: string | null;
|
|
1695
|
+
/**
|
|
1696
|
+
* The model.
|
|
1697
|
+
*/
|
|
1698
|
+
model?: string | null;
|
|
1699
|
+
/**
|
|
1700
|
+
* The model cannot be reached.
|
|
1701
|
+
*/
|
|
1702
|
+
model_error?: boolean;
|
|
1703
|
+
/**
|
|
1704
|
+
* The status line the user declared (`ui.statusline`), in order.
|
|
1705
|
+
*/
|
|
1706
|
+
slots?: string[];
|
|
1707
|
+
/**
|
|
1708
|
+
* Background tasks running (decision 0027): processes, by kind since decision 0031. Absent at none, so the count is hidden.
|
|
1709
|
+
*/
|
|
1710
|
+
tasks?: number | null;
|
|
1711
|
+
/**
|
|
1712
|
+
* Tokens used this session.
|
|
1713
|
+
*/
|
|
1714
|
+
tokens?: number | null;
|
|
1715
|
+
type: "footer";
|
|
1716
|
+
/**
|
|
1717
|
+
* The view on screen, one of `views`; absent on main's.
|
|
1718
|
+
*/
|
|
1719
|
+
view?: string | null;
|
|
1720
|
+
/**
|
|
1721
|
+
* How each view but main's is doing (decision 0033 §2), by name: the switcher draws `running` plain, `done` green, `failed` red, `stopped` dim. A view missing here is running.
|
|
1722
|
+
*/
|
|
1723
|
+
view_states?: {
|
|
1724
|
+
[k: string]: ViewState;
|
|
1725
|
+
};
|
|
1726
|
+
/**
|
|
1727
|
+
* The views a person can switch between (decisions 0031 §4, 0033 §1): `main`, then each agent that runs, and the view on screen — a finished agent, a process's log — while it is open. Absent while there is only main's, so the switcher is hidden.
|
|
1728
|
+
*/
|
|
1729
|
+
views?: string[];
|
|
1730
|
+
[k: string]: unknown;
|
|
1731
|
+
}
|
|
1732
|
+
| {
|
|
1733
|
+
/**
|
|
1734
|
+
* A dimmer line under it.
|
|
1735
|
+
*/
|
|
1736
|
+
detail?: string | null;
|
|
1737
|
+
/**
|
|
1738
|
+
* When the state began, in milliseconds on the host's session clock, so a client can count the seconds without a patch per second.
|
|
1739
|
+
*/
|
|
1740
|
+
since_ms?: number;
|
|
1741
|
+
/**
|
|
1742
|
+
* Which state.
|
|
1743
|
+
*/
|
|
1744
|
+
state: AgentState;
|
|
1745
|
+
/**
|
|
1746
|
+
* What it is doing: `thinking · 3s` is drawn from this and `since_ms`.
|
|
1747
|
+
*/
|
|
1748
|
+
title: string;
|
|
1749
|
+
/**
|
|
1750
|
+
* Tokens sent so far in this turn.
|
|
1751
|
+
*/
|
|
1752
|
+
tokens_in?: number | null;
|
|
1753
|
+
/**
|
|
1754
|
+
* Tokens received so far in this turn.
|
|
1755
|
+
*/
|
|
1756
|
+
tokens_out?: number | null;
|
|
1757
|
+
type: "status";
|
|
1758
|
+
[k: string]: unknown;
|
|
1759
|
+
}
|
|
1760
|
+
| {
|
|
1761
|
+
type: "overlay";
|
|
1762
|
+
[k: string]: unknown;
|
|
1763
|
+
}
|
|
1764
|
+
| {
|
|
1765
|
+
/**
|
|
1766
|
+
* The surface.
|
|
1767
|
+
*/
|
|
1768
|
+
surface: Surface;
|
|
1769
|
+
type: "surface";
|
|
1770
|
+
[k: string]: unknown;
|
|
1771
|
+
}
|
|
1772
|
+
| {
|
|
1773
|
+
/**
|
|
1774
|
+
* What choosing sends. `None` is a list to read, not to choose from.
|
|
1775
|
+
*/
|
|
1776
|
+
action?: string | null;
|
|
1777
|
+
/**
|
|
1778
|
+
* The entries.
|
|
1779
|
+
*/
|
|
1780
|
+
items: ListItem[];
|
|
1781
|
+
/**
|
|
1782
|
+
* The value the cursor starts on.
|
|
1783
|
+
*/
|
|
1784
|
+
selected?: string | null;
|
|
1785
|
+
type: "list";
|
|
1786
|
+
[k: string]: unknown;
|
|
1787
|
+
}
|
|
1788
|
+
| {
|
|
1789
|
+
/**
|
|
1790
|
+
* What pressing it sends.
|
|
1791
|
+
*/
|
|
1792
|
+
action: string;
|
|
1793
|
+
/**
|
|
1794
|
+
* What it says.
|
|
1795
|
+
*/
|
|
1796
|
+
label: string;
|
|
1797
|
+
type: "button";
|
|
1798
|
+
[k: string]: unknown;
|
|
1799
|
+
}
|
|
1800
|
+
| {
|
|
1801
|
+
/**
|
|
1802
|
+
* Its exit code, once it has one.
|
|
1803
|
+
*/
|
|
1804
|
+
exit?: number | null;
|
|
1805
|
+
/**
|
|
1806
|
+
* What was run.
|
|
1807
|
+
*/
|
|
1808
|
+
line: string;
|
|
1809
|
+
/**
|
|
1810
|
+
* What it printed so far.
|
|
1811
|
+
*/
|
|
1812
|
+
output?: string;
|
|
1813
|
+
/**
|
|
1814
|
+
* How far along it is.
|
|
1815
|
+
*/
|
|
1816
|
+
status: Status;
|
|
1817
|
+
type: "command";
|
|
1818
|
+
[k: string]: unknown;
|
|
1819
|
+
}
|
|
1820
|
+
| {
|
|
1821
|
+
/**
|
|
1822
|
+
* Whether its children are shown.
|
|
1823
|
+
*/
|
|
1824
|
+
open: boolean;
|
|
1825
|
+
/**
|
|
1826
|
+
* Its title.
|
|
1827
|
+
*/
|
|
1828
|
+
title: string;
|
|
1829
|
+
type: "collapsible";
|
|
1830
|
+
[k: string]: unknown;
|
|
1831
|
+
}
|
|
1832
|
+
| {
|
|
1833
|
+
/**
|
|
1834
|
+
* The element's id.
|
|
1835
|
+
*/
|
|
1836
|
+
el: string;
|
|
1837
|
+
/**
|
|
1838
|
+
* Its view model.
|
|
1839
|
+
*/
|
|
1840
|
+
props?: {
|
|
1841
|
+
[k: string]: unknown;
|
|
1842
|
+
};
|
|
1843
|
+
type: "element";
|
|
1844
|
+
[k: string]: unknown;
|
|
1845
|
+
}
|
|
1846
|
+
| {
|
|
1847
|
+
/**
|
|
1848
|
+
* The structure's name: `<ext>.<name>`, or `<owner>#<id>` for one shown inline. A key of [`UiDoc::components`].
|
|
1849
|
+
*/
|
|
1850
|
+
component: string;
|
|
1851
|
+
/**
|
|
1852
|
+
* A JSON Pointer from the AG-UI state root to the instance's data: `/data/<owner>/<id>` (under [`DATA_ROOT`]).
|
|
1853
|
+
*/
|
|
1854
|
+
data: string;
|
|
1855
|
+
type: "component";
|
|
1856
|
+
[k: string]: unknown;
|
|
1857
|
+
};
|
|
1858
|
+
/**
|
|
1859
|
+
* How the screen is laid out. Declared by the host; every client implements every mode.
|
|
1860
|
+
*/
|
|
1861
|
+
export type LayoutMode = "fullscreen";
|
|
1862
|
+
/**
|
|
1863
|
+
* What the agent is doing, as the design's states name it.
|
|
1864
|
+
*/
|
|
1865
|
+
export type AgentState = "idle" | "loading" | "thinking" | "executing" | "waiting" | "done" | "error";
|
|
1866
|
+
/**
|
|
1867
|
+
* What the input box is for right now.
|
|
1868
|
+
*/
|
|
1869
|
+
export type InputMode = "prompt" | "secret" | "answer" | "disabled";
|
|
1870
|
+
/**
|
|
1871
|
+
* How a view in the footer's switcher is doing (decision 0033 §2): running is drawn plain, done green (`name ✓`), failed red (`name ✗`), stopped dim (`name ■`).
|
|
1872
|
+
*/
|
|
1873
|
+
export type ViewState = "running" | "done" | "failed" | "stopped";
|
|
1874
|
+
/**
|
|
1875
|
+
* Where a surface goes.
|
|
1876
|
+
*/
|
|
1877
|
+
export type Placement = "inline" | "footer" | "band" | "pane.left" | "pane.right" | "hidden";
|
|
1878
|
+
/**
|
|
1879
|
+
* How a placed surface is doing.
|
|
1880
|
+
*/
|
|
1881
|
+
export type PlacedState = "live" | "loading" | "stopped";
|
|
1882
|
+
/**
|
|
1883
|
+
* One change to the UI document: RFC 6902, with paths relative to `/ui`.
|
|
1884
|
+
*
|
|
1885
|
+
* `/nodes/<id>` adds, swaps or removes a node; `/nodes/<id>/<field>` changes one prop; `/nodes/<id>/children` swaps the child list, and `/nodes/<id>/children/-` appends one child.
|
|
1886
|
+
*/
|
|
1887
|
+
export type UiOp =
|
|
1888
|
+
| {
|
|
1889
|
+
op: "add";
|
|
1890
|
+
/**
|
|
1891
|
+
* A JSON Pointer, relative to `/ui`.
|
|
1892
|
+
*/
|
|
1893
|
+
path: string;
|
|
1894
|
+
/**
|
|
1895
|
+
* What to add.
|
|
1896
|
+
*/
|
|
1897
|
+
value: {
|
|
1898
|
+
[k: string]: unknown;
|
|
1899
|
+
};
|
|
1900
|
+
[k: string]: unknown;
|
|
1901
|
+
}
|
|
1902
|
+
| {
|
|
1903
|
+
op: "replace";
|
|
1904
|
+
/**
|
|
1905
|
+
* A JSON Pointer, relative to `/ui`.
|
|
1906
|
+
*/
|
|
1907
|
+
path: string;
|
|
1908
|
+
/**
|
|
1909
|
+
* What it becomes.
|
|
1910
|
+
*/
|
|
1911
|
+
value: {
|
|
1912
|
+
[k: string]: unknown;
|
|
1913
|
+
};
|
|
1914
|
+
[k: string]: unknown;
|
|
1915
|
+
}
|
|
1916
|
+
| {
|
|
1917
|
+
op: "remove";
|
|
1918
|
+
/**
|
|
1919
|
+
* A JSON Pointer, relative to `/ui`.
|
|
1920
|
+
*/
|
|
1921
|
+
path: string;
|
|
1922
|
+
[k: string]: unknown;
|
|
1923
|
+
};
|
|
1924
|
+
/**
|
|
1925
|
+
* How loud a notice is.
|
|
1926
|
+
*/
|
|
1927
|
+
export type NoticeLevel = "info" | "warn" | "error";
|
|
1928
|
+
/**
|
|
1929
|
+
* What a task is.
|
|
1930
|
+
*/
|
|
1931
|
+
export type TaskKind = "agent" | "process";
|
|
1932
|
+
/**
|
|
1933
|
+
* Where a task stands.
|
|
1934
|
+
*/
|
|
1935
|
+
export type TaskState = "running" | "done" | "stopped" | "killed" | "failed" | "exited" | "lost";
|
|
1936
|
+
/**
|
|
1937
|
+
* How an extension produced a message (decision 0076).
|
|
1938
|
+
*/
|
|
1939
|
+
export type Via = "input" | "model" | "agent";
|
|
1940
|
+
/**
|
|
1941
|
+
* How often the user has to be asked.
|
|
1942
|
+
*
|
|
1943
|
+
* Ordered `Never < Once < Always`, and narrowing takes the minimum: a child that asks every time cannot be promoted to a child that never asks.
|
|
1944
|
+
*/
|
|
1945
|
+
export type Consent = "always" | "once" | "never";
|
|
1946
|
+
/**
|
|
1947
|
+
* The result of trying to load one extension.
|
|
1948
|
+
*/
|
|
1949
|
+
export type LoadOutcome =
|
|
1950
|
+
| {
|
|
1951
|
+
/**
|
|
1952
|
+
* What it added.
|
|
1953
|
+
*/
|
|
1954
|
+
contributions?: Contribution[];
|
|
1955
|
+
/**
|
|
1956
|
+
* Which extension.
|
|
1957
|
+
*/
|
|
1958
|
+
ext: ExtId;
|
|
1959
|
+
/**
|
|
1960
|
+
* How long it took.
|
|
1961
|
+
*/
|
|
1962
|
+
ms: number;
|
|
1963
|
+
status: "ok";
|
|
1964
|
+
[k: string]: unknown;
|
|
1965
|
+
}
|
|
1966
|
+
| {
|
|
1967
|
+
/**
|
|
1968
|
+
* What it did add.
|
|
1969
|
+
*/
|
|
1970
|
+
contributions?: Contribution[];
|
|
1971
|
+
/**
|
|
1972
|
+
* Which extension.
|
|
1973
|
+
*/
|
|
1974
|
+
ext: ExtId;
|
|
1975
|
+
/**
|
|
1976
|
+
* How long it took.
|
|
1977
|
+
*/
|
|
1978
|
+
ms: number;
|
|
1979
|
+
/**
|
|
1980
|
+
* What is missing, in words a person can act on.
|
|
1981
|
+
*/
|
|
1982
|
+
problems?: string[];
|
|
1983
|
+
status: "degraded";
|
|
1984
|
+
[k: string]: unknown;
|
|
1985
|
+
}
|
|
1986
|
+
| {
|
|
1987
|
+
/**
|
|
1988
|
+
* Which extension.
|
|
1989
|
+
*/
|
|
1990
|
+
ext: ExtId;
|
|
1991
|
+
/**
|
|
1992
|
+
* Why not.
|
|
1993
|
+
*/
|
|
1994
|
+
reason: SkipReason;
|
|
1995
|
+
status: "skipped";
|
|
1996
|
+
[k: string]: unknown;
|
|
1997
|
+
}
|
|
1998
|
+
| {
|
|
1999
|
+
/**
|
|
2000
|
+
* Which extension.
|
|
2001
|
+
*/
|
|
2002
|
+
ext: ExtId;
|
|
2003
|
+
/**
|
|
2004
|
+
* What went wrong.
|
|
2005
|
+
*/
|
|
2006
|
+
message: string;
|
|
2007
|
+
/**
|
|
2008
|
+
* How far it got.
|
|
2009
|
+
*/
|
|
2010
|
+
stage: LoadStage;
|
|
2011
|
+
status: "failed";
|
|
2012
|
+
[k: string]: unknown;
|
|
2013
|
+
};
|
|
2014
|
+
/**
|
|
2015
|
+
* The kinds of thing an extension can contribute.
|
|
2016
|
+
*/
|
|
2017
|
+
export type ContributionKind =
|
|
2018
|
+
| "tool"
|
|
2019
|
+
| "provider"
|
|
2020
|
+
| "renderer"
|
|
2021
|
+
| "command"
|
|
2022
|
+
| "skill"
|
|
2023
|
+
| "memory"
|
|
2024
|
+
| "grader"
|
|
2025
|
+
| "router"
|
|
2026
|
+
| "session-store"
|
|
2027
|
+
| "mode"
|
|
2028
|
+
| "view"
|
|
2029
|
+
| "agent"
|
|
2030
|
+
| "workflow"
|
|
2031
|
+
| "interceptor"
|
|
2032
|
+
| "lifecycle"
|
|
2033
|
+
| "permissions"
|
|
2034
|
+
| "mcp";
|
|
2035
|
+
/**
|
|
2036
|
+
* Why an extension was not loaded at all.
|
|
2037
|
+
*
|
|
2038
|
+
* A **closed** set. "It did not load" is a thing a user has to be able to act on, and free text cannot be grouped, counted or matched against a rule.
|
|
2039
|
+
*/
|
|
2040
|
+
export type SkipReason = "disabled" | "unsupported" | "dependency-missing" | "policy-denied" | "already-loaded";
|
|
2041
|
+
/**
|
|
2042
|
+
* How far loading got before it stopped.
|
|
2043
|
+
*/
|
|
2044
|
+
export type LoadStage = "manifest" | "resolve" | "link" | "activate" | "contribute";
|
|
2045
|
+
/**
|
|
2046
|
+
* One piece of a message.
|
|
2047
|
+
*/
|
|
2048
|
+
export type ContentBlock =
|
|
2049
|
+
| {
|
|
2050
|
+
t: "text";
|
|
2051
|
+
/**
|
|
2052
|
+
* The text.
|
|
2053
|
+
*/
|
|
2054
|
+
text: string;
|
|
2055
|
+
[k: string]: unknown;
|
|
2056
|
+
}
|
|
2057
|
+
| {
|
|
2058
|
+
/**
|
|
2059
|
+
* Base64, without a data-URL prefix.
|
|
2060
|
+
*/
|
|
2061
|
+
data: string;
|
|
2062
|
+
/**
|
|
2063
|
+
* The IANA media type, e.g. `image/png`.
|
|
2064
|
+
*/
|
|
2065
|
+
media_type: string;
|
|
2066
|
+
t: "image";
|
|
2067
|
+
[k: string]: unknown;
|
|
2068
|
+
}
|
|
2069
|
+
| {
|
|
2070
|
+
/**
|
|
2071
|
+
* The call this block opens.
|
|
2072
|
+
*/
|
|
2073
|
+
call: CallId;
|
|
2074
|
+
/**
|
|
2075
|
+
* The arguments, already validated against the tool's schema.
|
|
2076
|
+
*/
|
|
2077
|
+
input: {
|
|
2078
|
+
[k: string]: unknown;
|
|
2079
|
+
};
|
|
2080
|
+
/**
|
|
2081
|
+
* The fully-qualified tool name, `<ext>.<name>`.
|
|
2082
|
+
*/
|
|
2083
|
+
name: string;
|
|
2084
|
+
t: "tool-use";
|
|
2085
|
+
[k: string]: unknown;
|
|
2086
|
+
}
|
|
2087
|
+
| {
|
|
2088
|
+
/**
|
|
2089
|
+
* The call this block closes.
|
|
2090
|
+
*/
|
|
2091
|
+
call: CallId;
|
|
2092
|
+
/**
|
|
2093
|
+
* How it went.
|
|
2094
|
+
*/
|
|
2095
|
+
outcome: Outcome;
|
|
2096
|
+
t: "tool-result";
|
|
2097
|
+
[k: string]: unknown;
|
|
2098
|
+
}
|
|
2099
|
+
| {
|
|
2100
|
+
t: "thinking";
|
|
2101
|
+
/**
|
|
2102
|
+
* The reasoning text.
|
|
2103
|
+
*/
|
|
2104
|
+
text: string;
|
|
2105
|
+
[k: string]: unknown;
|
|
2106
|
+
};
|
|
2107
|
+
/**
|
|
2108
|
+
* Who said it.
|
|
2109
|
+
*/
|
|
2110
|
+
export type MessageRole = "system" | "user" | "assistant";
|
|
2111
|
+
/**
|
|
2112
|
+
* Client to kernel.
|
|
2113
|
+
*
|
|
2114
|
+
* Every variant carries an `id`, because every response has to name what it is answering. It is repeated per variant rather than lifted to a struct field because serde cannot express a struct-level field alongside an internally tagged enum — a test asserts that no variant lost it.
|
|
2115
|
+
*
|
|
2116
|
+
* The tags are **dotted** and spelled out one by one. No `rename_all` rule produces a dot, so an added variant without an explicit `rename` would show up as `turn-submit` instead of `turn.submit`; the tag test catches exactly that.
|
|
2117
|
+
*/
|
|
2118
|
+
export type Request =
|
|
2119
|
+
| {
|
|
2120
|
+
/**
|
|
2121
|
+
* The request id.
|
|
2122
|
+
*/
|
|
2123
|
+
id: ReqId;
|
|
2124
|
+
/**
|
|
2125
|
+
* Which profile to build it from.
|
|
2126
|
+
*/
|
|
2127
|
+
profile: string;
|
|
2128
|
+
t: "session.create";
|
|
2129
|
+
/**
|
|
2130
|
+
* The workspace root.
|
|
2131
|
+
*/
|
|
2132
|
+
workspace: string;
|
|
2133
|
+
[k: string]: unknown;
|
|
2134
|
+
}
|
|
2135
|
+
| {
|
|
2136
|
+
/**
|
|
2137
|
+
* The request id.
|
|
2138
|
+
*/
|
|
2139
|
+
id: ReqId;
|
|
2140
|
+
/**
|
|
2141
|
+
* Which session.
|
|
2142
|
+
*/
|
|
2143
|
+
session: SessionId;
|
|
2144
|
+
/**
|
|
2145
|
+
* Replay from just after this. Absent means from the start.
|
|
2146
|
+
*/
|
|
2147
|
+
since?: Seq | null;
|
|
2148
|
+
t: "session.attach";
|
|
2149
|
+
[k: string]: unknown;
|
|
2150
|
+
}
|
|
2151
|
+
| {
|
|
2152
|
+
/**
|
|
2153
|
+
* The request id.
|
|
2154
|
+
*/
|
|
2155
|
+
id: ReqId;
|
|
2156
|
+
/**
|
|
2157
|
+
* What was submitted.
|
|
2158
|
+
*/
|
|
2159
|
+
input: UserInput;
|
|
2160
|
+
/**
|
|
2161
|
+
* Which session.
|
|
2162
|
+
*/
|
|
2163
|
+
session: SessionId;
|
|
2164
|
+
t: "turn.submit";
|
|
2165
|
+
[k: string]: unknown;
|
|
2166
|
+
}
|
|
2167
|
+
| {
|
|
2168
|
+
/**
|
|
2169
|
+
* The request id.
|
|
2170
|
+
*/
|
|
2171
|
+
id: ReqId;
|
|
2172
|
+
/**
|
|
2173
|
+
* What was sent.
|
|
2174
|
+
*/
|
|
2175
|
+
input: UserInput;
|
|
2176
|
+
/**
|
|
2177
|
+
* Which session.
|
|
2178
|
+
*/
|
|
2179
|
+
session: SessionId;
|
|
2180
|
+
t: "run.send";
|
|
2181
|
+
/**
|
|
2182
|
+
* Where it lands in a busy run. Absent means `steer`.
|
|
2183
|
+
*/
|
|
2184
|
+
target?: SendTarget & string;
|
|
2185
|
+
[k: string]: unknown;
|
|
2186
|
+
}
|
|
2187
|
+
| {
|
|
2188
|
+
/**
|
|
2189
|
+
* The extension.
|
|
2190
|
+
*/
|
|
2191
|
+
ext: string;
|
|
2192
|
+
/**
|
|
2193
|
+
* The request id.
|
|
2194
|
+
*/
|
|
2195
|
+
id: ReqId;
|
|
2196
|
+
/**
|
|
2197
|
+
* The key.
|
|
2198
|
+
*/
|
|
2199
|
+
key: string;
|
|
2200
|
+
/**
|
|
2201
|
+
* Which session.
|
|
2202
|
+
*/
|
|
2203
|
+
session: SessionId;
|
|
2204
|
+
t: "state.watch";
|
|
2205
|
+
[k: string]: unknown;
|
|
2206
|
+
}
|
|
2207
|
+
| {
|
|
2208
|
+
/**
|
|
2209
|
+
* The request id.
|
|
2210
|
+
*/
|
|
2211
|
+
id: ReqId;
|
|
2212
|
+
/**
|
|
2213
|
+
* Which session.
|
|
2214
|
+
*/
|
|
2215
|
+
session: SessionId;
|
|
2216
|
+
t: "state.unwatch";
|
|
2217
|
+
/**
|
|
2218
|
+
* The watch.
|
|
2219
|
+
*/
|
|
2220
|
+
watch: number;
|
|
2221
|
+
[k: string]: unknown;
|
|
2222
|
+
}
|
|
2223
|
+
| {
|
|
2224
|
+
/**
|
|
2225
|
+
* The request id.
|
|
2226
|
+
*/
|
|
2227
|
+
id: ReqId;
|
|
2228
|
+
/**
|
|
2229
|
+
* Which session.
|
|
2230
|
+
*/
|
|
2231
|
+
session: SessionId;
|
|
2232
|
+
t: "turn.cancel";
|
|
2233
|
+
/**
|
|
2234
|
+
* Which turn.
|
|
2235
|
+
*/
|
|
2236
|
+
turn: TurnId;
|
|
2237
|
+
[k: string]: unknown;
|
|
2238
|
+
}
|
|
2239
|
+
| {
|
|
2240
|
+
/**
|
|
2241
|
+
* The request id.
|
|
2242
|
+
*/
|
|
2243
|
+
id: ReqId;
|
|
2244
|
+
/**
|
|
2245
|
+
* Which session.
|
|
2246
|
+
*/
|
|
2247
|
+
session: SessionId;
|
|
2248
|
+
/**
|
|
2249
|
+
* Which surface.
|
|
2250
|
+
*/
|
|
2251
|
+
surface: SurfaceId;
|
|
2252
|
+
t: "intent";
|
|
2253
|
+
/**
|
|
2254
|
+
* What the surface produced.
|
|
2255
|
+
*/
|
|
2256
|
+
value: {
|
|
2257
|
+
[k: string]: unknown;
|
|
2258
|
+
};
|
|
2259
|
+
[k: string]: unknown;
|
|
2260
|
+
}
|
|
2261
|
+
| {
|
|
2262
|
+
/**
|
|
2263
|
+
* Which of its actions.
|
|
2264
|
+
*/
|
|
2265
|
+
action: string;
|
|
2266
|
+
/**
|
|
2267
|
+
* The request id.
|
|
2268
|
+
*/
|
|
2269
|
+
id: ReqId;
|
|
2270
|
+
/**
|
|
2271
|
+
* Which node.
|
|
2272
|
+
*/
|
|
2273
|
+
node: string;
|
|
2274
|
+
/**
|
|
2275
|
+
* Which session.
|
|
2276
|
+
*/
|
|
2277
|
+
session: SessionId;
|
|
2278
|
+
t: "ui.intent";
|
|
2279
|
+
/**
|
|
2280
|
+
* What it carries: the chosen item's value, or null.
|
|
2281
|
+
*/
|
|
2282
|
+
value?: {
|
|
2283
|
+
[k: string]: unknown;
|
|
2284
|
+
};
|
|
2285
|
+
[k: string]: unknown;
|
|
2286
|
+
}
|
|
2287
|
+
| {
|
|
2288
|
+
/**
|
|
2289
|
+
* The answer.
|
|
2290
|
+
*/
|
|
2291
|
+
answer: ConsentAnswerKind;
|
|
2292
|
+
/**
|
|
2293
|
+
* The request id.
|
|
2294
|
+
*/
|
|
2295
|
+
id: ReqId;
|
|
2296
|
+
/**
|
|
2297
|
+
* Which prompt.
|
|
2298
|
+
*/
|
|
2299
|
+
prompt: PromptId;
|
|
2300
|
+
t: "consent.answer";
|
|
2301
|
+
[k: string]: unknown;
|
|
2302
|
+
}
|
|
2303
|
+
| {
|
|
2304
|
+
/**
|
|
2305
|
+
* Its arguments.
|
|
2306
|
+
*/
|
|
2307
|
+
args?: {
|
|
2308
|
+
[k: string]: unknown;
|
|
2309
|
+
};
|
|
2310
|
+
/**
|
|
2311
|
+
* The request id.
|
|
2312
|
+
*/
|
|
2313
|
+
id: ReqId;
|
|
2314
|
+
/**
|
|
2315
|
+
* The command's name.
|
|
2316
|
+
*/
|
|
2317
|
+
name: string;
|
|
2318
|
+
/**
|
|
2319
|
+
* Which session.
|
|
2320
|
+
*/
|
|
2321
|
+
session: SessionId;
|
|
2322
|
+
t: "command";
|
|
2323
|
+
[k: string]: unknown;
|
|
2324
|
+
}
|
|
2325
|
+
| {
|
|
2326
|
+
/**
|
|
2327
|
+
* The request id.
|
|
2328
|
+
*/
|
|
2329
|
+
id: ReqId;
|
|
2330
|
+
/**
|
|
2331
|
+
* Which session.
|
|
2332
|
+
*/
|
|
2333
|
+
session: SessionId;
|
|
2334
|
+
t: "session.handoff";
|
|
2335
|
+
/**
|
|
2336
|
+
* The machine to move to: its id or its name on the account.
|
|
2337
|
+
*/
|
|
2338
|
+
to: string;
|
|
2339
|
+
/**
|
|
2340
|
+
* A turn is running: `wait` for it, or `cancel` it. Absent: refused with `turn_running`.
|
|
2341
|
+
*/
|
|
2342
|
+
turn?: string | null;
|
|
2343
|
+
/**
|
|
2344
|
+
* The untracked files: `include` or `skip`. Absent: `[handoff] untracked` decides (`ask` asks the requester).
|
|
2345
|
+
*/
|
|
2346
|
+
untracked?: string | null;
|
|
2347
|
+
[k: string]: unknown;
|
|
2348
|
+
}
|
|
2349
|
+
| {
|
|
2350
|
+
/**
|
|
2351
|
+
* The request id.
|
|
2352
|
+
*/
|
|
2353
|
+
id: ReqId;
|
|
2354
|
+
/**
|
|
2355
|
+
* What is being asked about.
|
|
2356
|
+
*/
|
|
2357
|
+
of: QueryOf;
|
|
2358
|
+
t: "query";
|
|
2359
|
+
[k: string]: unknown;
|
|
2360
|
+
};
|
|
2361
|
+
export type ReqId = string;
|
|
2362
|
+
export type SessionId = string;
|
|
2363
|
+
export type BranchId = string;
|
|
2364
|
+
/**
|
|
2365
|
+
* One part of what a person attached to a message: AG-UI 1.0's `ContentPart`, verbatim (decision 0050).
|
|
2366
|
+
*
|
|
2367
|
+
* What a client **sends**, not what a model is shown: the kernel resolves each part into [`ContentBlock`]s before the turn runs (text inline, an image as an image block where the provider reads images) and refuses the rest by name. A file's name rides in `metadata.filename`.
|
|
2368
|
+
*/
|
|
2369
|
+
export type ContentPart =
|
|
2370
|
+
| {
|
|
2371
|
+
/**
|
|
2372
|
+
* Identifies this part within its message.
|
|
2373
|
+
*/
|
|
2374
|
+
id?: string | null;
|
|
2375
|
+
/**
|
|
2376
|
+
* Anything else about it.
|
|
2377
|
+
*/
|
|
2378
|
+
metadata?: {
|
|
2379
|
+
[k: string]: unknown;
|
|
2380
|
+
};
|
|
2381
|
+
/**
|
|
2382
|
+
* The text.
|
|
2383
|
+
*/
|
|
2384
|
+
text: string;
|
|
2385
|
+
type: "text";
|
|
2386
|
+
[k: string]: unknown;
|
|
2387
|
+
}
|
|
2388
|
+
| {
|
|
2389
|
+
/**
|
|
2390
|
+
* Identifies this part within its message.
|
|
2391
|
+
*/
|
|
2392
|
+
id?: string | null;
|
|
2393
|
+
/**
|
|
2394
|
+
* Anything else about it: `filename`.
|
|
2395
|
+
*/
|
|
2396
|
+
metadata?: {
|
|
2397
|
+
[k: string]: unknown;
|
|
2398
|
+
};
|
|
2399
|
+
/**
|
|
2400
|
+
* Where its bytes are.
|
|
2401
|
+
*/
|
|
2402
|
+
source: PartSource;
|
|
2403
|
+
type: "image";
|
|
2404
|
+
[k: string]: unknown;
|
|
2405
|
+
}
|
|
2406
|
+
| {
|
|
2407
|
+
/**
|
|
2408
|
+
* Identifies this part within its message.
|
|
2409
|
+
*/
|
|
2410
|
+
id?: string | null;
|
|
2411
|
+
/**
|
|
2412
|
+
* Anything else about it: `filename`.
|
|
2413
|
+
*/
|
|
2414
|
+
metadata?: {
|
|
2415
|
+
[k: string]: unknown;
|
|
2416
|
+
};
|
|
2417
|
+
/**
|
|
2418
|
+
* Where its bytes are.
|
|
2419
|
+
*/
|
|
2420
|
+
source: PartSource;
|
|
2421
|
+
type: "audio";
|
|
2422
|
+
[k: string]: unknown;
|
|
2423
|
+
}
|
|
2424
|
+
| {
|
|
2425
|
+
/**
|
|
2426
|
+
* Identifies this part within its message.
|
|
2427
|
+
*/
|
|
2428
|
+
id?: string | null;
|
|
2429
|
+
/**
|
|
2430
|
+
* Anything else about it: `filename`.
|
|
2431
|
+
*/
|
|
2432
|
+
metadata?: {
|
|
2433
|
+
[k: string]: unknown;
|
|
2434
|
+
};
|
|
2435
|
+
/**
|
|
2436
|
+
* Where its bytes are.
|
|
2437
|
+
*/
|
|
2438
|
+
source: PartSource;
|
|
2439
|
+
type: "video";
|
|
2440
|
+
[k: string]: unknown;
|
|
2441
|
+
}
|
|
2442
|
+
| {
|
|
2443
|
+
/**
|
|
2444
|
+
* Identifies this part within its message.
|
|
2445
|
+
*/
|
|
2446
|
+
id?: string | null;
|
|
2447
|
+
/**
|
|
2448
|
+
* Anything else about it: `filename`.
|
|
2449
|
+
*/
|
|
2450
|
+
metadata?: {
|
|
2451
|
+
[k: string]: unknown;
|
|
2452
|
+
};
|
|
2453
|
+
/**
|
|
2454
|
+
* Where its bytes are.
|
|
2455
|
+
*/
|
|
2456
|
+
source: PartSource;
|
|
2457
|
+
type: "document";
|
|
2458
|
+
[k: string]: unknown;
|
|
2459
|
+
};
|
|
2460
|
+
/**
|
|
2461
|
+
* Where a media part's bytes are: AG-UI 1.0's `PartSource`.
|
|
2462
|
+
*/
|
|
2463
|
+
export type PartSource =
|
|
2464
|
+
| {
|
|
2465
|
+
/**
|
|
2466
|
+
* What they are.
|
|
2467
|
+
*/
|
|
2468
|
+
mimeType: string;
|
|
2469
|
+
type: "data";
|
|
2470
|
+
/**
|
|
2471
|
+
* The bytes, base64.
|
|
2472
|
+
*/
|
|
2473
|
+
value: string;
|
|
2474
|
+
[k: string]: unknown;
|
|
2475
|
+
}
|
|
2476
|
+
| {
|
|
2477
|
+
/**
|
|
2478
|
+
* What it is, when known.
|
|
2479
|
+
*/
|
|
2480
|
+
mimeType?: string | null;
|
|
2481
|
+
type: "url";
|
|
2482
|
+
/**
|
|
2483
|
+
* The URL.
|
|
2484
|
+
*/
|
|
2485
|
+
value: string;
|
|
2486
|
+
[k: string]: unknown;
|
|
2487
|
+
}
|
|
2488
|
+
| {
|
|
2489
|
+
/**
|
|
2490
|
+
* What it is, when known.
|
|
2491
|
+
*/
|
|
2492
|
+
mimeType?: string | null;
|
|
2493
|
+
/**
|
|
2494
|
+
* Who issued it.
|
|
2495
|
+
*/
|
|
2496
|
+
provider?: string | null;
|
|
2497
|
+
type: "file";
|
|
2498
|
+
/**
|
|
2499
|
+
* The handle, opaque.
|
|
2500
|
+
*/
|
|
2501
|
+
value: string;
|
|
2502
|
+
[k: string]: unknown;
|
|
2503
|
+
};
|
|
2504
|
+
/**
|
|
2505
|
+
* Where input sent to a busy run lands.
|
|
2506
|
+
*
|
|
2507
|
+
* `steer`, `queue` and `inject` are one `send` with three targets, not three paths (the DeepSeek harness's `followup` / `steer` / `inject`).
|
|
2508
|
+
*/
|
|
2509
|
+
export type SendTarget = "steer" | "queue" | "inject";
|
|
2510
|
+
/**
|
|
2511
|
+
* The answer to a [`ConsentPrompt`].
|
|
2512
|
+
*
|
|
2513
|
+
* Four answers, not two: "yes" and "yes, and stop asking" are different decisions, and so are "no" and "no, ever".
|
|
2514
|
+
*/
|
|
2515
|
+
export type ConsentAnswerKind = "allow-once" | "allow-always" | "deny" | "deny-always";
|
|
2516
|
+
/**
|
|
2517
|
+
* What a [`Request::Query`] is asking about.
|
|
2518
|
+
*/
|
|
2519
|
+
export type QueryOf =
|
|
2520
|
+
| {
|
|
2521
|
+
t: "sessions";
|
|
2522
|
+
[k: string]: unknown;
|
|
2523
|
+
}
|
|
2524
|
+
| {
|
|
2525
|
+
/**
|
|
2526
|
+
* Which one.
|
|
2527
|
+
*/
|
|
2528
|
+
session: SessionId;
|
|
2529
|
+
t: "session";
|
|
2530
|
+
[k: string]: unknown;
|
|
2531
|
+
}
|
|
2532
|
+
| {
|
|
2533
|
+
/**
|
|
2534
|
+
* Which session.
|
|
2535
|
+
*/
|
|
2536
|
+
session: SessionId;
|
|
2537
|
+
t: "tools";
|
|
2538
|
+
[k: string]: unknown;
|
|
2539
|
+
}
|
|
2540
|
+
| {
|
|
2541
|
+
t: "extensions";
|
|
2542
|
+
[k: string]: unknown;
|
|
2543
|
+
}
|
|
2544
|
+
| {
|
|
2545
|
+
t: "profiles";
|
|
2546
|
+
[k: string]: unknown;
|
|
2547
|
+
};
|
|
2548
|
+
/**
|
|
2549
|
+
* How a file differs from the index.
|
|
2550
|
+
*/
|
|
2551
|
+
export type ChangeKind = "added" | "modified" | "deleted" | "clean";
|
|
2552
|
+
/**
|
|
2553
|
+
* Why a workspace request was refused: stable, for a client to branch on.
|
|
2554
|
+
*/
|
|
2555
|
+
export type WorkspaceErrorCode =
|
|
2556
|
+
| "bad_request"
|
|
2557
|
+
| "no_session"
|
|
2558
|
+
| "no_workspace"
|
|
2559
|
+
| "unavailable"
|
|
2560
|
+
| "outside_workspace"
|
|
2561
|
+
| "not_found"
|
|
2562
|
+
| "not_a_file"
|
|
2563
|
+
| "too_large"
|
|
2564
|
+
| "binary"
|
|
2565
|
+
| "not_a_repository"
|
|
2566
|
+
| "nothing_to_commit"
|
|
2567
|
+
| "no_identity"
|
|
2568
|
+
| "no_remote"
|
|
2569
|
+
| "git_missing"
|
|
2570
|
+
| "git"
|
|
2571
|
+
| "io";
|
|
2572
|
+
/**
|
|
2573
|
+
* A request on a session's workspace (module docs).
|
|
2574
|
+
*/
|
|
2575
|
+
export type WorkspaceRequest =
|
|
2576
|
+
| {
|
|
2577
|
+
/**
|
|
2578
|
+
* Read the file as git's index holds it — what the live changes (`orrery.session.changes`) are measured against — instead of the disk (harness decision 0056). Not in the index: `not_found`.
|
|
2579
|
+
*/
|
|
2580
|
+
base?: boolean;
|
|
2581
|
+
/**
|
|
2582
|
+
* The request's id, echoed as the reply's `reqId`.
|
|
2583
|
+
*/
|
|
2584
|
+
id?: string;
|
|
2585
|
+
/**
|
|
2586
|
+
* The file, relative to the workspace (an absolute path inside it is taken too). Never outside it.
|
|
2587
|
+
*/
|
|
2588
|
+
path: string;
|
|
2589
|
+
/**
|
|
2590
|
+
* The session whose workspace it reads.
|
|
2591
|
+
*/
|
|
2592
|
+
session: string;
|
|
2593
|
+
t: "workspace.read";
|
|
2594
|
+
[k: string]: unknown;
|
|
2595
|
+
}
|
|
2596
|
+
| {
|
|
2597
|
+
/**
|
|
2598
|
+
* The request's id.
|
|
2599
|
+
*/
|
|
2600
|
+
id?: string;
|
|
2601
|
+
/**
|
|
2602
|
+
* The commit message.
|
|
2603
|
+
*/
|
|
2604
|
+
message: string;
|
|
2605
|
+
/**
|
|
2606
|
+
* Only these paths, relative to the workspace. Absent: every change (new, modified and deleted files).
|
|
2607
|
+
*/
|
|
2608
|
+
paths?: string[] | null;
|
|
2609
|
+
/**
|
|
2610
|
+
* The session whose workspace it commits.
|
|
2611
|
+
*/
|
|
2612
|
+
session: string;
|
|
2613
|
+
t: "workspace.commit";
|
|
2614
|
+
[k: string]: unknown;
|
|
2615
|
+
}
|
|
2616
|
+
| {
|
|
2617
|
+
/**
|
|
2618
|
+
* The request's id.
|
|
2619
|
+
*/
|
|
2620
|
+
id?: string;
|
|
2621
|
+
/**
|
|
2622
|
+
* The session whose workspace it pushes.
|
|
2623
|
+
*/
|
|
2624
|
+
session: string;
|
|
2625
|
+
t: "workspace.push";
|
|
2626
|
+
[k: string]: unknown;
|
|
2627
|
+
};
|
|
2628
|
+
|
|
2629
|
+
/**
|
|
2630
|
+
* The root the schema is generated from.
|
|
2631
|
+
*
|
|
2632
|
+
* Every type a client has to name, reachable from one place. schemars walks it and emits each reachable type once, under `definitions`, so the field names here are an index and nothing ever serialises as a `Protocol`.
|
|
2633
|
+
*/
|
|
2634
|
+
export interface Protocol {
|
|
2635
|
+
anim: AnimDef;
|
|
2636
|
+
budget: Budget;
|
|
2637
|
+
/**
|
|
2638
|
+
* A bound catalog node (decision 0094): what a client draws for a `component` node once its structure is bound to its data.
|
|
2639
|
+
*/
|
|
2640
|
+
catalog: CatalogNode;
|
|
2641
|
+
event: Event;
|
|
2642
|
+
grant: Grant;
|
|
2643
|
+
load_outcome: LoadOutcome;
|
|
2644
|
+
message: Message;
|
|
2645
|
+
request: Request;
|
|
2646
|
+
session_changes: SessionChanges;
|
|
2647
|
+
surface: Surface;
|
|
2648
|
+
surface_patch: SurfacePatch;
|
|
2649
|
+
tool_descriptor: ToolDescriptor;
|
|
2650
|
+
ui: UiDoc;
|
|
2651
|
+
usage: Usage;
|
|
2652
|
+
workspace_committed: WorkspaceCommitted;
|
|
2653
|
+
workspace_failure: WorkspaceFailure;
|
|
2654
|
+
workspace_file: WorkspaceFile;
|
|
2655
|
+
workspace_pushed: WorkspacePushed;
|
|
2656
|
+
workspace_request: WorkspaceRequest;
|
|
2657
|
+
[k: string]: unknown;
|
|
2658
|
+
}
|
|
2659
|
+
/**
|
|
2660
|
+
* An animation the host sends once, at attach, as the AG-UI `CUSTOM` event `orrery.ui.anim` (decision 0043): an SVG as a template plus the values that change per frame, and the fallbacks a terminal that cannot show an image draws instead. Nothing in it is specific to the Orrery mark.
|
|
2661
|
+
*
|
|
2662
|
+
* Every optional field is additive: a client ignores what it does not know. Nodes refer to a definition by `id` and a state name (`orrery`, `thinking`).
|
|
2663
|
+
*/
|
|
2664
|
+
export interface AnimDef {
|
|
2665
|
+
/**
|
|
2666
|
+
* What a terminal without truecolor draws, per state.
|
|
2667
|
+
*/
|
|
2668
|
+
glyphs?: {
|
|
2669
|
+
[k: string]: AnimGlyphs;
|
|
2670
|
+
};
|
|
2671
|
+
/**
|
|
2672
|
+
* What nodes call it: `orrery`.
|
|
2673
|
+
*/
|
|
2674
|
+
id: string;
|
|
2675
|
+
/**
|
|
2676
|
+
* What a truecolor terminal without images draws.
|
|
2677
|
+
*/
|
|
2678
|
+
pixel?: AnimPixel | null;
|
|
2679
|
+
/**
|
|
2680
|
+
* Values that depend on the size it is drawn at (thicker strokes, no glow when small). The first entry whose `below` exceeds the size in CSS px applies; the last has no `below`.
|
|
2681
|
+
*/
|
|
2682
|
+
sizes?: AnimSize[];
|
|
2683
|
+
/**
|
|
2684
|
+
* The per-frame slot names, in the order a frame lists its values.
|
|
2685
|
+
*/
|
|
2686
|
+
slots: string[];
|
|
2687
|
+
/**
|
|
2688
|
+
* Per state (`idle`, `loading`, `thinking`, `executing`, `waiting`, `done`, `error` for the mark): how its frames play.
|
|
2689
|
+
*/
|
|
2690
|
+
states: {
|
|
2691
|
+
[k: string]: AnimState;
|
|
2692
|
+
};
|
|
2693
|
+
/**
|
|
2694
|
+
* The SVG, with `{{name}}` where a value comes in. It has no width or height: the drawer scales it to its box.
|
|
2695
|
+
*/
|
|
2696
|
+
template: string;
|
|
2697
|
+
/**
|
|
2698
|
+
* Per theme (`graphite`, `paper`): its colours, resolved, and every frame.
|
|
2699
|
+
*/
|
|
2700
|
+
themes: {
|
|
2701
|
+
[k: string]: AnimTheme;
|
|
2702
|
+
};
|
|
2703
|
+
/**
|
|
2704
|
+
* The SVG's view box: `[x, y, width, height]`.
|
|
2705
|
+
*
|
|
2706
|
+
* @minItems 4
|
|
2707
|
+
* @maxItems 4
|
|
2708
|
+
*/
|
|
2709
|
+
viewBox: [number, number, number, number];
|
|
2710
|
+
[k: string]: unknown;
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* The glyph fallback for one state.
|
|
2714
|
+
*/
|
|
2715
|
+
export interface AnimGlyphs {
|
|
2716
|
+
/**
|
|
2717
|
+
* The glyphs, repeating.
|
|
2718
|
+
*/
|
|
2719
|
+
frames: string[];
|
|
2720
|
+
/**
|
|
2721
|
+
* Milliseconds each glyph shows.
|
|
2722
|
+
*/
|
|
2723
|
+
ms: number;
|
|
2724
|
+
[k: string]: unknown;
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* The pixel fallback: a sprite per state, per theme.
|
|
2728
|
+
*/
|
|
2729
|
+
export interface AnimPixel {
|
|
2730
|
+
/**
|
|
2731
|
+
* The sprite's width and height in pixels.
|
|
2732
|
+
*/
|
|
2733
|
+
size: number;
|
|
2734
|
+
/**
|
|
2735
|
+
* Theme, then state, to its frames.
|
|
2736
|
+
*/
|
|
2737
|
+
themes: {
|
|
2738
|
+
[k: string]: {
|
|
2739
|
+
[k: string]: AnimPixelState;
|
|
2740
|
+
};
|
|
2741
|
+
};
|
|
2742
|
+
[k: string]: unknown;
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* One state's pixel frames.
|
|
2746
|
+
*/
|
|
2747
|
+
export interface AnimPixelState {
|
|
2748
|
+
/**
|
|
2749
|
+
* Frames per second. They always repeat.
|
|
2750
|
+
*/
|
|
2751
|
+
fps: number;
|
|
2752
|
+
/**
|
|
2753
|
+
* Each frame is rows of palette keys; `.` is transparent.
|
|
2754
|
+
*/
|
|
2755
|
+
frames: string[][];
|
|
2756
|
+
/**
|
|
2757
|
+
* `#rrggbb` per palette key, `a` first.
|
|
2758
|
+
*/
|
|
2759
|
+
palette: string[];
|
|
2760
|
+
[k: string]: unknown;
|
|
2761
|
+
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Slot values for a range of drawn sizes.
|
|
2764
|
+
*/
|
|
2765
|
+
export interface AnimSize {
|
|
2766
|
+
/**
|
|
2767
|
+
* This entry applies below this many CSS px. Absent on the last.
|
|
2768
|
+
*/
|
|
2769
|
+
below?: number | null;
|
|
2770
|
+
/**
|
|
2771
|
+
* Slot name to value.
|
|
2772
|
+
*/
|
|
2773
|
+
statics: {
|
|
2774
|
+
[k: string]: string;
|
|
2775
|
+
};
|
|
2776
|
+
[k: string]: unknown;
|
|
2777
|
+
}
|
|
2778
|
+
/**
|
|
2779
|
+
* How a state plays.
|
|
2780
|
+
*/
|
|
2781
|
+
export interface AnimState {
|
|
2782
|
+
/**
|
|
2783
|
+
* Frames per second.
|
|
2784
|
+
*/
|
|
2785
|
+
fps: number;
|
|
2786
|
+
/**
|
|
2787
|
+
* How many frames it has.
|
|
2788
|
+
*/
|
|
2789
|
+
frames: number;
|
|
2790
|
+
/**
|
|
2791
|
+
* Whether it repeats; when not, it holds its last frame.
|
|
2792
|
+
*/
|
|
2793
|
+
loop: boolean;
|
|
2794
|
+
/**
|
|
2795
|
+
* The frame a repeat starts at, when not the first (an intro plays once).
|
|
2796
|
+
*/
|
|
2797
|
+
loopFrom?: number | null;
|
|
2798
|
+
[k: string]: unknown;
|
|
2799
|
+
}
|
|
2800
|
+
/**
|
|
2801
|
+
* One theme's slot values.
|
|
2802
|
+
*/
|
|
2803
|
+
export interface AnimTheme {
|
|
2804
|
+
/**
|
|
2805
|
+
* Per state: one row of values per frame, in [`AnimDef::slots`] order.
|
|
2806
|
+
*/
|
|
2807
|
+
frames: {
|
|
2808
|
+
[k: string]: string[][];
|
|
2809
|
+
};
|
|
2810
|
+
/**
|
|
2811
|
+
* Slot name to value, for slots that do not change per frame.
|
|
2812
|
+
*/
|
|
2813
|
+
statics: {
|
|
2814
|
+
[k: string]: string;
|
|
2815
|
+
};
|
|
2816
|
+
[k: string]: unknown;
|
|
2817
|
+
}
|
|
2818
|
+
/**
|
|
2819
|
+
* What a turn is allowed to spend.
|
|
2820
|
+
*/
|
|
2821
|
+
export interface Budget {
|
|
2822
|
+
/**
|
|
2823
|
+
* How much money, in micro-USD. `None` means unmetered.
|
|
2824
|
+
*/
|
|
2825
|
+
max_micro_usd?: number | null;
|
|
2826
|
+
/**
|
|
2827
|
+
* How many tokens, input and output together.
|
|
2828
|
+
*/
|
|
2829
|
+
max_tokens: number;
|
|
2830
|
+
/**
|
|
2831
|
+
* How many kernel turns.
|
|
2832
|
+
*/
|
|
2833
|
+
max_turns: number;
|
|
2834
|
+
/**
|
|
2835
|
+
* How long, in milliseconds of wall clock.
|
|
2836
|
+
*/
|
|
2837
|
+
wall_clock_ms: number;
|
|
2838
|
+
[k: string]: unknown;
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* One tab of a `tabs`.
|
|
2842
|
+
*/
|
|
2843
|
+
export interface Tab {
|
|
2844
|
+
/**
|
|
2845
|
+
* What it shows.
|
|
2846
|
+
*/
|
|
2847
|
+
children?: CatalogNode[];
|
|
2848
|
+
/**
|
|
2849
|
+
* Its handle, unique among its siblings.
|
|
2850
|
+
*/
|
|
2851
|
+
key: string;
|
|
2852
|
+
/**
|
|
2853
|
+
* What the tab says.
|
|
2854
|
+
*/
|
|
2855
|
+
label: string;
|
|
2856
|
+
[k: string]: unknown;
|
|
2857
|
+
}
|
|
2858
|
+
/**
|
|
2859
|
+
* One run of a `text`.
|
|
2860
|
+
*/
|
|
2861
|
+
export interface Span {
|
|
2862
|
+
/**
|
|
2863
|
+
* How it is meant.
|
|
2864
|
+
*/
|
|
2865
|
+
style?: SpanStyle | null;
|
|
2866
|
+
/**
|
|
2867
|
+
* The run.
|
|
2868
|
+
*/
|
|
2869
|
+
text: string;
|
|
2870
|
+
[k: string]: unknown;
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* One pair of a `kv`.
|
|
2874
|
+
*/
|
|
2875
|
+
export interface KvItem {
|
|
2876
|
+
/**
|
|
2877
|
+
* The key.
|
|
2878
|
+
*/
|
|
2879
|
+
label: string;
|
|
2880
|
+
/**
|
|
2881
|
+
* The value, already formatted.
|
|
2882
|
+
*/
|
|
2883
|
+
value: string;
|
|
2884
|
+
[k: string]: unknown;
|
|
2885
|
+
}
|
|
2886
|
+
/**
|
|
2887
|
+
* One cell of a [`SurfaceKind::Table`].
|
|
2888
|
+
*/
|
|
2889
|
+
export interface Cell {
|
|
2890
|
+
/**
|
|
2891
|
+
* How it is meant.
|
|
2892
|
+
*/
|
|
2893
|
+
style?: TextStyle | null;
|
|
2894
|
+
/**
|
|
2895
|
+
* The cell's text, already formatted by whoever knows the units.
|
|
2896
|
+
*/
|
|
2897
|
+
text: string;
|
|
2898
|
+
[k: string]: unknown;
|
|
2899
|
+
}
|
|
2900
|
+
/**
|
|
2901
|
+
* One entry of a [`NodeKind::List`].
|
|
2902
|
+
*/
|
|
2903
|
+
export interface ListItem {
|
|
2904
|
+
/**
|
|
2905
|
+
* A second, dimmer line.
|
|
2906
|
+
*/
|
|
2907
|
+
detail?: string | null;
|
|
2908
|
+
/**
|
|
2909
|
+
* Shown, but cannot be chosen.
|
|
2910
|
+
*/
|
|
2911
|
+
disabled?: boolean;
|
|
2912
|
+
/**
|
|
2913
|
+
* What is shown.
|
|
2914
|
+
*/
|
|
2915
|
+
label: string;
|
|
2916
|
+
/**
|
|
2917
|
+
* What comes back when it is chosen.
|
|
2918
|
+
*/
|
|
2919
|
+
value: string;
|
|
2920
|
+
[k: string]: unknown;
|
|
2921
|
+
}
|
|
2922
|
+
/**
|
|
2923
|
+
* One node of a [`SurfaceKind::Tree`].
|
|
2924
|
+
*/
|
|
2925
|
+
export interface TreeNode {
|
|
2926
|
+
/**
|
|
2927
|
+
* Its children. A leaf has none.
|
|
2928
|
+
*/
|
|
2929
|
+
children?: TreeNode[];
|
|
2930
|
+
/**
|
|
2931
|
+
* Whether the node starts open. Absent reads as closed (decision 0094).
|
|
2932
|
+
*/
|
|
2933
|
+
expanded?: boolean;
|
|
2934
|
+
/**
|
|
2935
|
+
* A stable handle, when the client needs to address this node: what a catalog `tree`'s action sends. Also read as `value` (decision 0094), always written as `id`.
|
|
2936
|
+
*/
|
|
2937
|
+
id?: string | null;
|
|
2938
|
+
/**
|
|
2939
|
+
* What to show.
|
|
2940
|
+
*/
|
|
2941
|
+
label: string;
|
|
2942
|
+
[k: string]: unknown;
|
|
2943
|
+
}
|
|
2944
|
+
/**
|
|
2945
|
+
* One line of a `stream`.
|
|
2946
|
+
*/
|
|
2947
|
+
export interface StreamLine {
|
|
2948
|
+
/**
|
|
2949
|
+
* Its level.
|
|
2950
|
+
*/
|
|
2951
|
+
level?: LogLevel | null;
|
|
2952
|
+
/**
|
|
2953
|
+
* The line.
|
|
2954
|
+
*/
|
|
2955
|
+
text: string;
|
|
2956
|
+
/**
|
|
2957
|
+
* When, in epoch ms.
|
|
2958
|
+
*/
|
|
2959
|
+
ts?: number | null;
|
|
2960
|
+
[k: string]: unknown;
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* One series of a [`SurfaceKind::Chart`].
|
|
2964
|
+
*/
|
|
2965
|
+
export interface Series {
|
|
2966
|
+
/**
|
|
2967
|
+
* What it is, in the legend.
|
|
2968
|
+
*/
|
|
2969
|
+
label: string;
|
|
2970
|
+
/**
|
|
2971
|
+
* Its values, one per label (x, y pairs for `scatter`).
|
|
2972
|
+
*/
|
|
2973
|
+
values?: number[];
|
|
2974
|
+
[k: string]: unknown;
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* One entry of a [`SurfaceKind::Task`] list.
|
|
2978
|
+
*/
|
|
2979
|
+
export interface TaskItem {
|
|
2980
|
+
/**
|
|
2981
|
+
* A stable handle, so a patch can update one item. Absent reads as empty (a catalog `task` names none, decision 0094).
|
|
2982
|
+
*/
|
|
2983
|
+
id?: string;
|
|
2984
|
+
/**
|
|
2985
|
+
* What to show.
|
|
2986
|
+
*/
|
|
2987
|
+
label: string;
|
|
2988
|
+
/**
|
|
2989
|
+
* How far along it is.
|
|
2990
|
+
*/
|
|
2991
|
+
status: Status;
|
|
2992
|
+
[k: string]: unknown;
|
|
2993
|
+
}
|
|
2994
|
+
/**
|
|
2995
|
+
* One field of a catalog `form`: the surface library's [`Field`] plus decision 0094's options, all optional.
|
|
2996
|
+
*/
|
|
2997
|
+
export interface FormField {
|
|
2998
|
+
/**
|
|
2999
|
+
* What it starts as.
|
|
3000
|
+
*/
|
|
3001
|
+
default?: string | null;
|
|
3002
|
+
/**
|
|
3003
|
+
* What is wrong with the value, shown under it.
|
|
3004
|
+
*/
|
|
3005
|
+
error?: string | null;
|
|
3006
|
+
/**
|
|
3007
|
+
* What it collects.
|
|
3008
|
+
*/
|
|
3009
|
+
kind: FieldKind;
|
|
3010
|
+
/**
|
|
3011
|
+
* What is shown next to it.
|
|
3012
|
+
*/
|
|
3013
|
+
label: string;
|
|
3014
|
+
/**
|
|
3015
|
+
* A number's greatest value.
|
|
3016
|
+
*/
|
|
3017
|
+
max?: number | null;
|
|
3018
|
+
/**
|
|
3019
|
+
* A number's least value.
|
|
3020
|
+
*/
|
|
3021
|
+
min?: number | null;
|
|
3022
|
+
/**
|
|
3023
|
+
* A choice that takes more than one.
|
|
3024
|
+
*/
|
|
3025
|
+
multi?: boolean;
|
|
3026
|
+
/**
|
|
3027
|
+
* The key this field's value is submitted under.
|
|
3028
|
+
*/
|
|
3029
|
+
name: string;
|
|
3030
|
+
/**
|
|
3031
|
+
* A regex the value must match.
|
|
3032
|
+
*/
|
|
3033
|
+
pattern?: string | null;
|
|
3034
|
+
/**
|
|
3035
|
+
* What the empty field says.
|
|
3036
|
+
*/
|
|
3037
|
+
placeholder?: string | null;
|
|
3038
|
+
/**
|
|
3039
|
+
* Whether the form can be submitted without it.
|
|
3040
|
+
*/
|
|
3041
|
+
required: boolean;
|
|
3042
|
+
/**
|
|
3043
|
+
* A number's step.
|
|
3044
|
+
*/
|
|
3045
|
+
step?: number | null;
|
|
3046
|
+
/**
|
|
3047
|
+
* How it is drawn.
|
|
3048
|
+
*/
|
|
3049
|
+
style?: FieldStyle | null;
|
|
3050
|
+
[k: string]: unknown;
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* One option of a [`SurfaceKind::Question`] or of a choice [`Field`].
|
|
3054
|
+
*/
|
|
3055
|
+
export interface Choice {
|
|
3056
|
+
/**
|
|
3057
|
+
* What is shown.
|
|
3058
|
+
*/
|
|
3059
|
+
label: string;
|
|
3060
|
+
/**
|
|
3061
|
+
* What is sent back on selection.
|
|
3062
|
+
*/
|
|
3063
|
+
value: string;
|
|
3064
|
+
[k: string]: unknown;
|
|
3065
|
+
}
|
|
3066
|
+
/**
|
|
3067
|
+
* The names of a [`SurfaceKind::Raster`]'s rows and columns.
|
|
3068
|
+
*/
|
|
3069
|
+
export interface RasterLabels {
|
|
3070
|
+
/**
|
|
3071
|
+
* Column names, left first; may be fewer than the columns (ends only).
|
|
3072
|
+
*/
|
|
3073
|
+
cols?: string[];
|
|
3074
|
+
/**
|
|
3075
|
+
* One per row, top first.
|
|
3076
|
+
*/
|
|
3077
|
+
rows?: string[];
|
|
3078
|
+
[k: string]: unknown;
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* One step of a [`SurfaceKind::Raster`]'s legend.
|
|
3082
|
+
*/
|
|
3083
|
+
export interface LegendItem {
|
|
3084
|
+
/**
|
|
3085
|
+
* The colour, packed `0xRRGGBB`.
|
|
3086
|
+
*/
|
|
3087
|
+
colour: number;
|
|
3088
|
+
/**
|
|
3089
|
+
* What it means.
|
|
3090
|
+
*/
|
|
3091
|
+
label: string;
|
|
3092
|
+
[k: string]: unknown;
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* One entry of a `files`.
|
|
3096
|
+
*/
|
|
3097
|
+
export interface FileEntry {
|
|
3098
|
+
/**
|
|
3099
|
+
* Lines added.
|
|
3100
|
+
*/
|
|
3101
|
+
add?: number | null;
|
|
3102
|
+
/**
|
|
3103
|
+
* Lines removed.
|
|
3104
|
+
*/
|
|
3105
|
+
del?: number | null;
|
|
3106
|
+
/**
|
|
3107
|
+
* The path, `/`-separated.
|
|
3108
|
+
*/
|
|
3109
|
+
path: string;
|
|
3110
|
+
/**
|
|
3111
|
+
* How it changed.
|
|
3112
|
+
*/
|
|
3113
|
+
status: FileStatus;
|
|
3114
|
+
[k: string]: unknown;
|
|
3115
|
+
}
|
|
3116
|
+
/**
|
|
3117
|
+
* One changed region of a file.
|
|
3118
|
+
*/
|
|
3119
|
+
export interface Hunk {
|
|
3120
|
+
/**
|
|
3121
|
+
* The lines.
|
|
3122
|
+
*/
|
|
3123
|
+
lines?: DiffLine[];
|
|
3124
|
+
/**
|
|
3125
|
+
* How many lines it covers.
|
|
3126
|
+
*/
|
|
3127
|
+
new_lines: number;
|
|
3128
|
+
/**
|
|
3129
|
+
* First line of the region in the new file, 1-based.
|
|
3130
|
+
*/
|
|
3131
|
+
new_start: number;
|
|
3132
|
+
/**
|
|
3133
|
+
* How many lines it covered.
|
|
3134
|
+
*/
|
|
3135
|
+
old_lines: number;
|
|
3136
|
+
/**
|
|
3137
|
+
* First line of the region in the old file, 1-based.
|
|
3138
|
+
*/
|
|
3139
|
+
old_start: number;
|
|
3140
|
+
[k: string]: unknown;
|
|
3141
|
+
}
|
|
3142
|
+
/**
|
|
3143
|
+
* One line inside a [`Hunk`].
|
|
3144
|
+
*/
|
|
3145
|
+
export interface DiffLine {
|
|
3146
|
+
/**
|
|
3147
|
+
* Added, removed or unchanged.
|
|
3148
|
+
*/
|
|
3149
|
+
kind: DiffLineKind;
|
|
3150
|
+
/**
|
|
3151
|
+
* The line itself, without its leading marker.
|
|
3152
|
+
*/
|
|
3153
|
+
text: string;
|
|
3154
|
+
[k: string]: unknown;
|
|
3155
|
+
}
|
|
3156
|
+
/**
|
|
3157
|
+
* A surface, with the handle a patch addresses it by and how far along it is.
|
|
3158
|
+
*/
|
|
3159
|
+
export interface Surface {
|
|
3160
|
+
/**
|
|
3161
|
+
* The handle. Absent for a surface nothing will ever patch.
|
|
3162
|
+
*/
|
|
3163
|
+
id?: SurfaceId | null;
|
|
3164
|
+
/**
|
|
3165
|
+
* What it is.
|
|
3166
|
+
*/
|
|
3167
|
+
kind: SurfaceKind;
|
|
3168
|
+
/**
|
|
3169
|
+
* Who a flow's question belongs to (decision 0058 §5): a client on another connection draws it read-only. Absent: anyone answers.
|
|
3170
|
+
*/
|
|
3171
|
+
requester?: Requester | null;
|
|
3172
|
+
/**
|
|
3173
|
+
* How far along it is.
|
|
3174
|
+
*/
|
|
3175
|
+
status?: Status | null;
|
|
3176
|
+
[k: string]: unknown;
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* One input of a [`SurfaceKind::Form`].
|
|
3180
|
+
*/
|
|
3181
|
+
export interface Field {
|
|
3182
|
+
/**
|
|
3183
|
+
* What it starts as.
|
|
3184
|
+
*/
|
|
3185
|
+
default?: string | null;
|
|
3186
|
+
/**
|
|
3187
|
+
* What it collects.
|
|
3188
|
+
*/
|
|
3189
|
+
kind: FieldKind;
|
|
3190
|
+
/**
|
|
3191
|
+
* What is shown next to it.
|
|
3192
|
+
*/
|
|
3193
|
+
label: string;
|
|
3194
|
+
/**
|
|
3195
|
+
* The key this field's value is submitted under.
|
|
3196
|
+
*/
|
|
3197
|
+
name: string;
|
|
3198
|
+
/**
|
|
3199
|
+
* Whether the form can be submitted without it.
|
|
3200
|
+
*/
|
|
3201
|
+
required: boolean;
|
|
3202
|
+
[k: string]: unknown;
|
|
3203
|
+
}
|
|
3204
|
+
/**
|
|
3205
|
+
* Who a flow's question belongs to: the connection that sent the `command` (decision 0058 §5). A client whose own connection is another draws the question read-only, as "<client> is choosing…".
|
|
3206
|
+
*/
|
|
3207
|
+
export interface Requester {
|
|
3208
|
+
/**
|
|
3209
|
+
* What that client calls itself, for the read-only line.
|
|
3210
|
+
*/
|
|
3211
|
+
client?: string | null;
|
|
3212
|
+
/**
|
|
3213
|
+
* The connection that asked.
|
|
3214
|
+
*/
|
|
3215
|
+
conn: number;
|
|
3216
|
+
[k: string]: unknown;
|
|
3217
|
+
}
|
|
3218
|
+
/**
|
|
3219
|
+
* What is being asked for, and why.
|
|
3220
|
+
*/
|
|
3221
|
+
export interface ConsentPrompt {
|
|
3222
|
+
/**
|
|
3223
|
+
* What they want.
|
|
3224
|
+
*/
|
|
3225
|
+
capabilities?: Capability[];
|
|
3226
|
+
/**
|
|
3227
|
+
* The handle an answer is matched to.
|
|
3228
|
+
*/
|
|
3229
|
+
id: PromptId;
|
|
3230
|
+
/**
|
|
3231
|
+
* Why, in words a person can act on.
|
|
3232
|
+
*/
|
|
3233
|
+
reason: string;
|
|
3234
|
+
/**
|
|
3235
|
+
* The rule that requires the ask, when one does.
|
|
3236
|
+
*/
|
|
3237
|
+
rule?: RuleId | null;
|
|
3238
|
+
/**
|
|
3239
|
+
* Who is asking.
|
|
3240
|
+
*/
|
|
3241
|
+
subject: Subject;
|
|
3242
|
+
/**
|
|
3243
|
+
* Something to show alongside the question — the diff that is about to be written, the command that is about to run.
|
|
3244
|
+
*/
|
|
3245
|
+
surface?: Surface | null;
|
|
3246
|
+
[k: string]: unknown;
|
|
3247
|
+
}
|
|
3248
|
+
/**
|
|
3249
|
+
* One aspect and the scope it is granted over.
|
|
3250
|
+
*
|
|
3251
|
+
* An **empty** `scope` means unqualified: the whole aspect, not nothing. That is what makes an unscoped parent wider than a scoped child, which is the direction narrowing needs.
|
|
3252
|
+
*/
|
|
3253
|
+
export interface Capability {
|
|
3254
|
+
/**
|
|
3255
|
+
* What the capability is about.
|
|
3256
|
+
*/
|
|
3257
|
+
aspect: Aspect;
|
|
3258
|
+
/**
|
|
3259
|
+
* The names or patterns it covers. Empty means unqualified.
|
|
3260
|
+
*/
|
|
3261
|
+
scope?: string[];
|
|
3262
|
+
[k: string]: unknown;
|
|
3263
|
+
}
|
|
3264
|
+
/**
|
|
3265
|
+
* What was actually spent.
|
|
3266
|
+
*/
|
|
3267
|
+
export interface Usage {
|
|
3268
|
+
/**
|
|
3269
|
+
* Tokens served from a provider-side prompt cache.
|
|
3270
|
+
*/
|
|
3271
|
+
cache_hits: number;
|
|
3272
|
+
/**
|
|
3273
|
+
* Tokens sent.
|
|
3274
|
+
*/
|
|
3275
|
+
input_tokens: number;
|
|
3276
|
+
/**
|
|
3277
|
+
* Cost in micro-USD, when the provider reports one.
|
|
3278
|
+
*/
|
|
3279
|
+
micro_usd?: number | null;
|
|
3280
|
+
/**
|
|
3281
|
+
* Tokens received.
|
|
3282
|
+
*/
|
|
3283
|
+
output_tokens: number;
|
|
3284
|
+
[k: string]: unknown;
|
|
3285
|
+
}
|
|
3286
|
+
/**
|
|
3287
|
+
* What went wrong.
|
|
3288
|
+
*/
|
|
3289
|
+
export interface ErrorDetail {
|
|
3290
|
+
/**
|
|
3291
|
+
* A stable, machine-readable code: `provider.unavailable`, `ext.crashed`.
|
|
3292
|
+
*/
|
|
3293
|
+
code: string;
|
|
3294
|
+
/**
|
|
3295
|
+
* Anything structured a client could use.
|
|
3296
|
+
*/
|
|
3297
|
+
data?: {
|
|
3298
|
+
[k: string]: unknown;
|
|
3299
|
+
};
|
|
3300
|
+
/**
|
|
3301
|
+
* What went wrong, in words.
|
|
3302
|
+
*/
|
|
3303
|
+
message: string;
|
|
3304
|
+
/**
|
|
3305
|
+
* Whether the same thing, tried again, might work.
|
|
3306
|
+
*/
|
|
3307
|
+
retryable: boolean;
|
|
3308
|
+
[k: string]: unknown;
|
|
3309
|
+
}
|
|
3310
|
+
/**
|
|
3311
|
+
* The whole screen.
|
|
3312
|
+
*/
|
|
3313
|
+
export interface UiDoc {
|
|
3314
|
+
/**
|
|
3315
|
+
* The structures [`NodeKind::Component`] nodes name, by name (`/ui/components`, decision 0092). Kept as JSON: a structure's values may be bindings, which only the binder resolves. Absent when empty.
|
|
3316
|
+
*/
|
|
3317
|
+
components?: {
|
|
3318
|
+
[k: string]: unknown;
|
|
3319
|
+
};
|
|
3320
|
+
/**
|
|
3321
|
+
* Every node, by id.
|
|
3322
|
+
*/
|
|
3323
|
+
nodes: {
|
|
3324
|
+
[k: string]: Node;
|
|
3325
|
+
};
|
|
3326
|
+
/**
|
|
3327
|
+
* The placed surfaces, by node id: who placed each and how it is doing (decisions 0087 and 0088). Every node in a pane or the band is here.
|
|
3328
|
+
*/
|
|
3329
|
+
placed?: {
|
|
3330
|
+
[k: string]: Placed;
|
|
3331
|
+
};
|
|
3332
|
+
/**
|
|
3333
|
+
* The root node, a [`NodeKind::Layout`].
|
|
3334
|
+
*/
|
|
3335
|
+
root: string;
|
|
3336
|
+
/**
|
|
3337
|
+
* What the host adds to each turn, by run id.
|
|
3338
|
+
*/
|
|
3339
|
+
turns?: {
|
|
3340
|
+
[k: string]: TurnMeta;
|
|
3341
|
+
};
|
|
3342
|
+
[k: string]: unknown;
|
|
3343
|
+
}
|
|
3344
|
+
/**
|
|
3345
|
+
* A command the input box can complete and hint.
|
|
3346
|
+
*/
|
|
3347
|
+
export interface CommandSpec {
|
|
3348
|
+
/**
|
|
3349
|
+
* A usage hint: `[provider]`, `<command>`.
|
|
3350
|
+
*/
|
|
3351
|
+
args?: string;
|
|
3352
|
+
/**
|
|
3353
|
+
* `/model`, or `!` for the shell.
|
|
3354
|
+
*/
|
|
3355
|
+
name: string;
|
|
3356
|
+
/**
|
|
3357
|
+
* One line.
|
|
3358
|
+
*/
|
|
3359
|
+
summary?: string;
|
|
3360
|
+
[k: string]: unknown;
|
|
3361
|
+
}
|
|
3362
|
+
/**
|
|
3363
|
+
* A key bound to a command (decision 0083 §4).
|
|
3364
|
+
*/
|
|
3365
|
+
export interface KeyBinding {
|
|
3366
|
+
/**
|
|
3367
|
+
* The command it runs, without the slash: `git.status`.
|
|
3368
|
+
*/
|
|
3369
|
+
command: string;
|
|
3370
|
+
/**
|
|
3371
|
+
* The key as written: `ctrl+g`, `f5`, `alt+r`.
|
|
3372
|
+
*/
|
|
3373
|
+
key: string;
|
|
3374
|
+
[k: string]: unknown;
|
|
3375
|
+
}
|
|
3376
|
+
/**
|
|
3377
|
+
* How full the context window is.
|
|
3378
|
+
*/
|
|
3379
|
+
export interface ContextUse {
|
|
3380
|
+
/**
|
|
3381
|
+
* Tokens it holds.
|
|
3382
|
+
*/
|
|
3383
|
+
limit: number;
|
|
3384
|
+
/**
|
|
3385
|
+
* Tokens in it.
|
|
3386
|
+
*/
|
|
3387
|
+
used: number;
|
|
3388
|
+
[k: string]: unknown;
|
|
3389
|
+
}
|
|
3390
|
+
/**
|
|
3391
|
+
* One extension's segment of the status line.
|
|
3392
|
+
*/
|
|
3393
|
+
export interface ExtStatus {
|
|
3394
|
+
/**
|
|
3395
|
+
* The extension.
|
|
3396
|
+
*/
|
|
3397
|
+
ext: string;
|
|
3398
|
+
/**
|
|
3399
|
+
* Which of its segments.
|
|
3400
|
+
*/
|
|
3401
|
+
key: string;
|
|
3402
|
+
/**
|
|
3403
|
+
* What it says now.
|
|
3404
|
+
*/
|
|
3405
|
+
text: string;
|
|
3406
|
+
[k: string]: unknown;
|
|
3407
|
+
}
|
|
3408
|
+
/**
|
|
3409
|
+
* What the host knows about a placed node beyond the node itself.
|
|
3410
|
+
*/
|
|
3411
|
+
export interface Placed {
|
|
3412
|
+
/**
|
|
3413
|
+
* What a client that cannot draw the node draws instead (decision 0086): core kinds only, checked when it was sent.
|
|
3414
|
+
*/
|
|
3415
|
+
fallback?: Surface | null;
|
|
3416
|
+
/**
|
|
3417
|
+
* The id its owner gave it (`ui.show {id}`); one per owner.
|
|
3418
|
+
*/
|
|
3419
|
+
id: string;
|
|
3420
|
+
/**
|
|
3421
|
+
* Who placed it, drawn with it: `ext:<id>`, `agent` or `config`.
|
|
3422
|
+
*/
|
|
3423
|
+
owner: string;
|
|
3424
|
+
/**
|
|
3425
|
+
* Where it is.
|
|
3426
|
+
*/
|
|
3427
|
+
placement: Placement;
|
|
3428
|
+
/**
|
|
3429
|
+
* How it is doing; absent is live.
|
|
3430
|
+
*/
|
|
3431
|
+
state?: PlacedState;
|
|
3432
|
+
/**
|
|
3433
|
+
* A title for its pane or band row, when the owner gave one.
|
|
3434
|
+
*/
|
|
3435
|
+
title?: string | null;
|
|
3436
|
+
[k: string]: unknown;
|
|
3437
|
+
}
|
|
3438
|
+
/**
|
|
3439
|
+
* What the host knows about one turn that its events do not say.
|
|
3440
|
+
*/
|
|
3441
|
+
export interface TurnMeta {
|
|
3442
|
+
/**
|
|
3443
|
+
* The line that started it, echoed above it.
|
|
3444
|
+
*/
|
|
3445
|
+
echo?: string | null;
|
|
3446
|
+
/**
|
|
3447
|
+
* What it cost, in micro-USD, when the provider says.
|
|
3448
|
+
*/
|
|
3449
|
+
micro_usd?: number | null;
|
|
3450
|
+
/**
|
|
3451
|
+
* How long it took, once settled.
|
|
3452
|
+
*/
|
|
3453
|
+
ms?: number | null;
|
|
3454
|
+
/**
|
|
3455
|
+
* Whether input typed while it runs joins it (decision 0008): a kernel run, as opposed to a flow such as a picker. A client sends a prompt at once to a steerable run, and holds it until any other run ends.
|
|
3456
|
+
*/
|
|
3457
|
+
steerable?: boolean;
|
|
3458
|
+
/**
|
|
3459
|
+
* Tokens it used.
|
|
3460
|
+
*/
|
|
3461
|
+
tokens?: number | null;
|
|
3462
|
+
/**
|
|
3463
|
+
* How many tools it called.
|
|
3464
|
+
*/
|
|
3465
|
+
tools?: number | null;
|
|
3466
|
+
[k: string]: unknown;
|
|
3467
|
+
}
|
|
3468
|
+
/**
|
|
3469
|
+
* One task, as the registry holds it and the wire carries it.
|
|
3470
|
+
*/
|
|
3471
|
+
export interface TaskInfo {
|
|
3472
|
+
/**
|
|
3473
|
+
* The agent it is, for an agent task.
|
|
3474
|
+
*/
|
|
3475
|
+
agent?: string | null;
|
|
3476
|
+
/**
|
|
3477
|
+
* Whether the main thread waits on it (an attached task) rather than working beside it (a background task).
|
|
3478
|
+
*/
|
|
3479
|
+
attached?: boolean;
|
|
3480
|
+
/**
|
|
3481
|
+
* How a process ended, when it did by itself.
|
|
3482
|
+
*/
|
|
3483
|
+
exit?: number | null;
|
|
3484
|
+
/**
|
|
3485
|
+
* Its id in the session: `t1`, `t2`, …
|
|
3486
|
+
*/
|
|
3487
|
+
id: string;
|
|
3488
|
+
/**
|
|
3489
|
+
* What it is.
|
|
3490
|
+
*/
|
|
3491
|
+
kind: TaskKind;
|
|
3492
|
+
/**
|
|
3493
|
+
* What a person reads: the agent's id, or the command.
|
|
3494
|
+
*/
|
|
3495
|
+
label: string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Where its output goes, for a process task.
|
|
3498
|
+
*/
|
|
3499
|
+
log?: string | null;
|
|
3500
|
+
/**
|
|
3501
|
+
* Its process id, for a process task.
|
|
3502
|
+
*/
|
|
3503
|
+
pid?: number | null;
|
|
3504
|
+
/**
|
|
3505
|
+
* The port it serves on, when it was started with one.
|
|
3506
|
+
*/
|
|
3507
|
+
port?: number | null;
|
|
3508
|
+
/**
|
|
3509
|
+
* When it started, in unix milliseconds.
|
|
3510
|
+
*/
|
|
3511
|
+
started_ms: number;
|
|
3512
|
+
/**
|
|
3513
|
+
* Where it stands.
|
|
3514
|
+
*/
|
|
3515
|
+
state: TaskState;
|
|
3516
|
+
[k: string]: unknown;
|
|
3517
|
+
}
|
|
3518
|
+
/**
|
|
3519
|
+
* What a subject is allowed to do.
|
|
3520
|
+
*/
|
|
3521
|
+
export interface Grant {
|
|
3522
|
+
/**
|
|
3523
|
+
* The capabilities, one entry per aspect-and-scope.
|
|
3524
|
+
*/
|
|
3525
|
+
capabilities?: Capability[];
|
|
3526
|
+
/**
|
|
3527
|
+
* How often to ask.
|
|
3528
|
+
*/
|
|
3529
|
+
consent: Consent;
|
|
3530
|
+
[k: string]: unknown;
|
|
3531
|
+
}
|
|
3532
|
+
/**
|
|
3533
|
+
* What an extension added to the session.
|
|
3534
|
+
*
|
|
3535
|
+
* `kind` is a plain enum here. The derive macro that keeps it in step with the extension's manifest — so that a manifest promising a tool and a crate contributing a renderer is a build error rather than a surprise — is the extension host's (plan 06).
|
|
3536
|
+
*/
|
|
3537
|
+
export interface Contribution {
|
|
3538
|
+
/**
|
|
3539
|
+
* What kind of thing it is.
|
|
3540
|
+
*/
|
|
3541
|
+
kind: ContributionKind;
|
|
3542
|
+
/**
|
|
3543
|
+
* Its name, unqualified: the extension is already known.
|
|
3544
|
+
*/
|
|
3545
|
+
name: string;
|
|
3546
|
+
[k: string]: unknown;
|
|
3547
|
+
}
|
|
3548
|
+
/**
|
|
3549
|
+
* One turn of the conversation.
|
|
3550
|
+
*/
|
|
3551
|
+
export interface Message {
|
|
3552
|
+
/**
|
|
3553
|
+
* What they said.
|
|
3554
|
+
*/
|
|
3555
|
+
content?: ContentBlock[];
|
|
3556
|
+
/**
|
|
3557
|
+
* Who said it.
|
|
3558
|
+
*/
|
|
3559
|
+
role: MessageRole;
|
|
3560
|
+
[k: string]: unknown;
|
|
3561
|
+
}
|
|
3562
|
+
/**
|
|
3563
|
+
* What a person submitted.
|
|
3564
|
+
*/
|
|
3565
|
+
export interface UserInput {
|
|
3566
|
+
/**
|
|
3567
|
+
* Anything else they attached, resolved: what the model is shown (text inline, image blocks). Filled by the kernel from [`Self::parts`]; what a stored turn records.
|
|
3568
|
+
*/
|
|
3569
|
+
attachments?: ContentBlock[];
|
|
3570
|
+
/**
|
|
3571
|
+
* Which branch of the turn tree to submit on. Absent means the current one; present means "re-run from here", which is how an edited turn forks rather than overwrites.
|
|
3572
|
+
*/
|
|
3573
|
+
branch?: BranchId | null;
|
|
3574
|
+
/**
|
|
3575
|
+
* Files as a client sends them: AG-UI 1.0 content parts (decision 0050). The kernel resolves them into [`Self::attachments`] before the turn runs, refusing what it cannot show the model.
|
|
3576
|
+
*/
|
|
3577
|
+
parts?: ContentPart[];
|
|
3578
|
+
/**
|
|
3579
|
+
* What they typed.
|
|
3580
|
+
*/
|
|
3581
|
+
text: string;
|
|
3582
|
+
[k: string]: unknown;
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* The body of `orrery.session.changes`.
|
|
3586
|
+
*/
|
|
3587
|
+
export interface SessionChanges {
|
|
3588
|
+
/**
|
|
3589
|
+
* The files that changed in this flush.
|
|
3590
|
+
*/
|
|
3591
|
+
changed: FileChange[];
|
|
3592
|
+
/**
|
|
3593
|
+
* The whole set after it.
|
|
3594
|
+
*/
|
|
3595
|
+
files: FileChange[];
|
|
3596
|
+
/**
|
|
3597
|
+
* The branch pushed (and its pull request), once a push succeeded. Absent before; additive: a client that does not know it ignores it.
|
|
3598
|
+
*/
|
|
3599
|
+
pushed?: Pushed | null;
|
|
3600
|
+
/**
|
|
3601
|
+
* Totals of the whole set.
|
|
3602
|
+
*/
|
|
3603
|
+
totals: ChangeTotals;
|
|
3604
|
+
[k: string]: unknown;
|
|
3605
|
+
}
|
|
3606
|
+
/**
|
|
3607
|
+
* One file's change, relative to the git index.
|
|
3608
|
+
*/
|
|
3609
|
+
export interface FileChange {
|
|
3610
|
+
/**
|
|
3611
|
+
* Lines added.
|
|
3612
|
+
*/
|
|
3613
|
+
add: number;
|
|
3614
|
+
/**
|
|
3615
|
+
* Binary content: no line counts.
|
|
3616
|
+
*/
|
|
3617
|
+
binary?: boolean;
|
|
3618
|
+
/**
|
|
3619
|
+
* Lines removed.
|
|
3620
|
+
*/
|
|
3621
|
+
del: number;
|
|
3622
|
+
/**
|
|
3623
|
+
* How it differs.
|
|
3624
|
+
*/
|
|
3625
|
+
kind: ChangeKind;
|
|
3626
|
+
/**
|
|
3627
|
+
* Path relative to the workspace root, `/`-separated.
|
|
3628
|
+
*/
|
|
3629
|
+
path: string;
|
|
3630
|
+
[k: string]: unknown;
|
|
3631
|
+
}
|
|
3632
|
+
/**
|
|
3633
|
+
* What the session pushed: set once a `git.push` (or `git.pr`) succeeded, and carried by every later `orrery.session.changes`.
|
|
3634
|
+
*/
|
|
3635
|
+
export interface Pushed {
|
|
3636
|
+
/**
|
|
3637
|
+
* The branch that was pushed (`agent/<session>`).
|
|
3638
|
+
*/
|
|
3639
|
+
branch: string;
|
|
3640
|
+
/**
|
|
3641
|
+
* The pull request `git.pr` opened, when it did.
|
|
3642
|
+
*/
|
|
3643
|
+
pr_url?: string | null;
|
|
3644
|
+
[k: string]: unknown;
|
|
3645
|
+
}
|
|
3646
|
+
/**
|
|
3647
|
+
* Totals of a change set.
|
|
3648
|
+
*/
|
|
3649
|
+
export interface ChangeTotals {
|
|
3650
|
+
/**
|
|
3651
|
+
* Lines added.
|
|
3652
|
+
*/
|
|
3653
|
+
add: number;
|
|
3654
|
+
/**
|
|
3655
|
+
* Lines removed.
|
|
3656
|
+
*/
|
|
3657
|
+
del: number;
|
|
3658
|
+
/**
|
|
3659
|
+
* Files.
|
|
3660
|
+
*/
|
|
3661
|
+
files: number;
|
|
3662
|
+
[k: string]: unknown;
|
|
3663
|
+
}
|
|
3664
|
+
/**
|
|
3665
|
+
* One tool, as it appears in a model request.
|
|
3666
|
+
*
|
|
3667
|
+
* A wire type, and therefore this crate's: the registry produces it from [`AgentScope`](crate::AgentScope), a provider serialises it into the prompt, and the model is shown it. Both sides naming the same struct is what stops the two halves drifting — there used to be a copy in `orrery-provider` and a second in `orrery-tools`, with no conversion between them.
|
|
3668
|
+
*
|
|
3669
|
+
* It is produced only by `Registry::visible`, so the list the model sees is a real subset of what exists rather than a promise in a prompt.
|
|
3670
|
+
*/
|
|
3671
|
+
export interface ToolDescriptor {
|
|
3672
|
+
/**
|
|
3673
|
+
* Whether the tool's effect is all-or-nothing.
|
|
3674
|
+
*/
|
|
3675
|
+
atomic: boolean;
|
|
3676
|
+
/**
|
|
3677
|
+
* What it does, in the model's context window.
|
|
3678
|
+
*/
|
|
3679
|
+
description: string;
|
|
3680
|
+
/**
|
|
3681
|
+
* JSON Schema for the input. Validated at the dispatch boundary, never by the provider.
|
|
3682
|
+
*/
|
|
3683
|
+
input_schema: {
|
|
3684
|
+
[k: string]: unknown;
|
|
3685
|
+
};
|
|
3686
|
+
/**
|
|
3687
|
+
* The form the model should emit: the short name where it is unambiguous within this scope, the full `ext.name` where it is not.
|
|
3688
|
+
*/
|
|
3689
|
+
name: string;
|
|
3690
|
+
[k: string]: unknown;
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* The answer to `workspace.commit`.
|
|
3694
|
+
*/
|
|
3695
|
+
export interface WorkspaceCommitted {
|
|
3696
|
+
/**
|
|
3697
|
+
* The new commit, in full.
|
|
3698
|
+
*/
|
|
3699
|
+
sha: string;
|
|
3700
|
+
[k: string]: unknown;
|
|
3701
|
+
}
|
|
3702
|
+
/**
|
|
3703
|
+
* A refused workspace request: its code and what to do.
|
|
3704
|
+
*/
|
|
3705
|
+
export interface WorkspaceFailure {
|
|
3706
|
+
/**
|
|
3707
|
+
* Why, for a program.
|
|
3708
|
+
*/
|
|
3709
|
+
code: WorkspaceErrorCode;
|
|
3710
|
+
/**
|
|
3711
|
+
* Why, for a person, with the fix.
|
|
3712
|
+
*/
|
|
3713
|
+
message: string;
|
|
3714
|
+
[k: string]: unknown;
|
|
3715
|
+
}
|
|
3716
|
+
/**
|
|
3717
|
+
* The answer to `workspace.read`.
|
|
3718
|
+
*/
|
|
3719
|
+
export interface WorkspaceFile {
|
|
3720
|
+
/**
|
|
3721
|
+
* The index side (asked with `base`, decision 0057). A node older than decision 0056 never sets it: it ignores `base` and answers with the working file.
|
|
3722
|
+
*/
|
|
3723
|
+
base?: boolean;
|
|
3724
|
+
/**
|
|
3725
|
+
* Its size on disk, in bytes.
|
|
3726
|
+
*/
|
|
3727
|
+
bytes: number;
|
|
3728
|
+
/**
|
|
3729
|
+
* The path as asked.
|
|
3730
|
+
*/
|
|
3731
|
+
path: string;
|
|
3732
|
+
/**
|
|
3733
|
+
* The file's text (UTF-8).
|
|
3734
|
+
*/
|
|
3735
|
+
text: string;
|
|
3736
|
+
[k: string]: unknown;
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* The answer to `workspace.push`: git ran, and this is what it said.
|
|
3740
|
+
*/
|
|
3741
|
+
export interface WorkspacePushed {
|
|
3742
|
+
/**
|
|
3743
|
+
* Whether the push went through. `false` when the remote refused it (rejected, no access, timed out): `output` says why.
|
|
3744
|
+
*/
|
|
3745
|
+
ok: boolean;
|
|
3746
|
+
/**
|
|
3747
|
+
* What `git push` printed.
|
|
3748
|
+
*/
|
|
3749
|
+
output: string;
|
|
3750
|
+
[k: string]: unknown;
|
|
3751
|
+
}
|