@contraagent/api 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +102 -2
  2. package/dist/client.d.ts +54 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +68 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/derive.d.ts +81 -0
  7. package/dist/derive.d.ts.map +1 -0
  8. package/dist/derive.js +89 -0
  9. package/dist/derive.js.map +1 -0
  10. package/dist/export.d.ts +36 -0
  11. package/dist/export.d.ts.map +1 -0
  12. package/dist/export.js +130 -0
  13. package/dist/export.js.map +1 -0
  14. package/dist/feed.d.ts +27 -0
  15. package/dist/feed.d.ts.map +1 -0
  16. package/dist/feed.js +39 -0
  17. package/dist/feed.js.map +1 -0
  18. package/dist/index.d.ts +13 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +13 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/outcomes.d.ts +117 -0
  23. package/dist/outcomes.d.ts.map +1 -0
  24. package/dist/outcomes.js +201 -0
  25. package/dist/outcomes.js.map +1 -0
  26. package/dist/panels.d.ts +31 -0
  27. package/dist/panels.d.ts.map +1 -0
  28. package/dist/panels.js +12 -0
  29. package/dist/panels.js.map +1 -0
  30. package/dist/quota.d.ts +32 -0
  31. package/dist/quota.d.ts.map +1 -0
  32. package/dist/quota.js +46 -0
  33. package/dist/quota.js.map +1 -0
  34. package/dist/reasons.d.ts +25 -0
  35. package/dist/reasons.d.ts.map +1 -0
  36. package/dist/reasons.js +46 -0
  37. package/dist/reasons.js.map +1 -0
  38. package/dist/run-state.d.ts +62 -0
  39. package/dist/run-state.d.ts.map +1 -0
  40. package/dist/run-state.js +109 -0
  41. package/dist/run-state.js.map +1 -0
  42. package/dist/schema.d.ts +3718 -0
  43. package/dist/schema.d.ts.map +1 -0
  44. package/dist/schema.js +3 -0
  45. package/dist/schema.js.map +1 -0
  46. package/dist/spend.d.ts +46 -0
  47. package/dist/spend.d.ts.map +1 -0
  48. package/dist/spend.js +68 -0
  49. package/dist/spend.js.map +1 -0
  50. package/dist/store.d.ts +121 -0
  51. package/dist/store.d.ts.map +1 -0
  52. package/dist/store.js +286 -0
  53. package/dist/store.js.map +1 -0
  54. package/dist/types.d.ts +112 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +19 -0
  57. package/dist/types.js.map +1 -0
  58. package/package.json +43 -4
  59. package/src/client.ts +119 -0
  60. package/src/derive.ts +155 -0
  61. package/src/export.ts +158 -0
  62. package/src/feed.ts +81 -0
  63. package/src/index.ts +12 -0
  64. package/src/outcomes.ts +267 -0
  65. package/src/panels.ts +51 -0
  66. package/src/quota.ts +78 -0
  67. package/src/reasons.ts +57 -0
  68. package/src/run-state.ts +166 -0
  69. package/src/schema.ts +3719 -0
  70. package/src/spend.ts +108 -0
  71. package/src/store.ts +338 -0
  72. package/src/types.ts +165 -0
package/src/schema.ts ADDED
@@ -0,0 +1,3719 @@
1
+ // Generated by `pnpm gen` from src/contraagent/_internal/monitor/openapi.json. Do not edit.
2
+
3
+ export type paths = {
4
+ "/api/info": {
5
+ parameters: {
6
+ query?: never;
7
+ header?: never;
8
+ path?: never;
9
+ cookie?: never;
10
+ };
11
+ /**
12
+ * Api Info
13
+ * @description The title, the panel tabs to offer, and the version of this contract.
14
+ */
15
+ get: operations["api_info_api_info_get"];
16
+ put?: never;
17
+ post?: never;
18
+ delete?: never;
19
+ options?: never;
20
+ head?: never;
21
+ patch?: never;
22
+ trace?: never;
23
+ };
24
+ "/api/runs": {
25
+ parameters: {
26
+ query?: never;
27
+ header?: never;
28
+ path?: never;
29
+ cookie?: never;
30
+ };
31
+ /**
32
+ * Api Runs
33
+ * @description Every run directory, newest activity first.
34
+ */
35
+ get: operations["api_runs_api_runs_get"];
36
+ put?: never;
37
+ post?: never;
38
+ delete?: never;
39
+ options?: never;
40
+ head?: never;
41
+ patch?: never;
42
+ trace?: never;
43
+ };
44
+ "/api/hosts": {
45
+ parameters: {
46
+ query?: never;
47
+ header?: never;
48
+ path?: never;
49
+ cookie?: never;
50
+ };
51
+ /**
52
+ * Api Hosts
53
+ * @description The hosts that drive the runs, and each account's utilization over every run.
54
+ */
55
+ get: operations["api_hosts_api_hosts_get"];
56
+ put?: never;
57
+ post?: never;
58
+ delete?: never;
59
+ options?: never;
60
+ head?: never;
61
+ patch?: never;
62
+ trace?: never;
63
+ };
64
+ "/api/trends": {
65
+ parameters: {
66
+ query?: never;
67
+ header?: never;
68
+ path?: never;
69
+ cookie?: never;
70
+ };
71
+ /**
72
+ * Api Trends
73
+ * @description What the runs of a period add up to, day by day.
74
+ */
75
+ get: operations["api_trends_api_trends_get"];
76
+ put?: never;
77
+ post?: never;
78
+ delete?: never;
79
+ options?: never;
80
+ head?: never;
81
+ patch?: never;
82
+ trace?: never;
83
+ };
84
+ "/api/trends/panels/{name}": {
85
+ parameters: {
86
+ query?: never;
87
+ header?: never;
88
+ path?: never;
89
+ cookie?: never;
90
+ };
91
+ /**
92
+ * Api Trend Panel
93
+ * @description One trend panel's body: its `fn(runs, period)` over the runs of the period, made on a
94
+ * panel thread, and kept for the same period over the same runs (`Monitor.trends_panel`).
95
+ */
96
+ get: operations["api_trend_panel_api_trends_panels__name__get"];
97
+ put?: never;
98
+ post?: never;
99
+ delete?: never;
100
+ options?: never;
101
+ head?: never;
102
+ patch?: never;
103
+ trace?: never;
104
+ };
105
+ "/api/runs/{run}/journal": {
106
+ parameters: {
107
+ query?: never;
108
+ header?: never;
109
+ path?: never;
110
+ cookie?: never;
111
+ };
112
+ /**
113
+ * Api Journal
114
+ * @description Journal rows after line offset `since`; `total` is the next offset.
115
+ */
116
+ get: operations["api_journal_api_runs__run__journal_get"];
117
+ put?: never;
118
+ post?: never;
119
+ delete?: never;
120
+ options?: never;
121
+ head?: never;
122
+ patch?: never;
123
+ trace?: never;
124
+ };
125
+ "/api/runs/{run}/plan": {
126
+ parameters: {
127
+ query?: never;
128
+ header?: never;
129
+ path?: never;
130
+ cookie?: never;
131
+ };
132
+ /**
133
+ * Api Plan
134
+ * @description Every queued task with its dependencies and state, and the groups the UI draws as columns.
135
+ */
136
+ get: operations["api_plan_api_runs__run__plan_get"];
137
+ put?: never;
138
+ post?: never;
139
+ delete?: never;
140
+ options?: never;
141
+ head?: never;
142
+ patch?: never;
143
+ trace?: never;
144
+ };
145
+ "/api/runs/{run}/outputs": {
146
+ parameters: {
147
+ query?: never;
148
+ header?: never;
149
+ path?: never;
150
+ cookie?: never;
151
+ };
152
+ /**
153
+ * Api Outputs
154
+ * @description Every declared output/input contract: its file, the model it must satisfy, its status.
155
+ */
156
+ get: operations["api_outputs_api_runs__run__outputs_get"];
157
+ put?: never;
158
+ post?: never;
159
+ delete?: never;
160
+ options?: never;
161
+ head?: never;
162
+ patch?: never;
163
+ trace?: never;
164
+ };
165
+ "/api/runs/{run}/definitions": {
166
+ parameters: {
167
+ query?: never;
168
+ header?: never;
169
+ path?: never;
170
+ cookie?: never;
171
+ };
172
+ /**
173
+ * Api Definitions
174
+ * @description What defined each kind of task in this run.
175
+ */
176
+ get: operations["api_definitions_api_runs__run__definitions_get"];
177
+ put?: never;
178
+ post?: never;
179
+ delete?: never;
180
+ options?: never;
181
+ head?: never;
182
+ patch?: never;
183
+ trace?: never;
184
+ };
185
+ "/api/runs/{run}/cursor": {
186
+ parameters: {
187
+ query?: never;
188
+ header?: never;
189
+ path?: never;
190
+ cookie?: never;
191
+ };
192
+ /**
193
+ * Api Cursor
194
+ * @description The resume cursor; `{}` when the run keeps none.
195
+ */
196
+ get: operations["api_cursor_api_runs__run__cursor_get"];
197
+ put?: never;
198
+ post?: never;
199
+ delete?: never;
200
+ options?: never;
201
+ head?: never;
202
+ patch?: never;
203
+ trace?: never;
204
+ };
205
+ "/api/runs/{run}/procs": {
206
+ parameters: {
207
+ query?: never;
208
+ header?: never;
209
+ path?: never;
210
+ cookie?: never;
211
+ };
212
+ /**
213
+ * Api Procs
214
+ * @description The run's live agent launches, process tree and Python tasks.
215
+ */
216
+ get: operations["api_procs_api_runs__run__procs_get"];
217
+ put?: never;
218
+ post?: never;
219
+ delete?: never;
220
+ options?: never;
221
+ head?: never;
222
+ patch?: never;
223
+ trace?: never;
224
+ };
225
+ "/api/runs/{run}/task/{key}": {
226
+ parameters: {
227
+ query?: never;
228
+ header?: never;
229
+ path?: never;
230
+ cookie?: never;
231
+ };
232
+ /**
233
+ * Api Task
234
+ * @description One task, by its key: journal rows, live launches, definition, input/output, transcript name.
235
+ */
236
+ get: operations["api_task_api_runs__run__task__key__get"];
237
+ put?: never;
238
+ post?: never;
239
+ delete?: never;
240
+ options?: never;
241
+ head?: never;
242
+ patch?: never;
243
+ trace?: never;
244
+ };
245
+ "/api/runs/{run}/stream/{key}": {
246
+ parameters: {
247
+ query?: never;
248
+ header?: never;
249
+ path?: never;
250
+ cookie?: never;
251
+ };
252
+ /**
253
+ * Api Stream
254
+ * @description A page of task `key`'s normalized transcript from line `since`; `since=0` is the tail page.
255
+ */
256
+ get: operations["api_stream_api_runs__run__stream__key__get"];
257
+ put?: never;
258
+ post?: never;
259
+ delete?: never;
260
+ options?: never;
261
+ head?: never;
262
+ patch?: never;
263
+ trace?: never;
264
+ };
265
+ "/api/runs/{run}/panels/{name}": {
266
+ parameters: {
267
+ query?: never;
268
+ header?: never;
269
+ path?: never;
270
+ cookie?: never;
271
+ };
272
+ /**
273
+ * Api Panel
274
+ * @description One run panel's body: a typed body (tiles, a table, charts), or any JSON object;
275
+ * made on a panel thread.
276
+ */
277
+ get: operations["api_panel_api_runs__run__panels__name__get"];
278
+ put?: never;
279
+ post?: never;
280
+ delete?: never;
281
+ options?: never;
282
+ head?: never;
283
+ patch?: never;
284
+ trace?: never;
285
+ };
286
+ "/events": {
287
+ parameters: {
288
+ query?: never;
289
+ header?: never;
290
+ path?: never;
291
+ cookie?: never;
292
+ };
293
+ /**
294
+ * Events
295
+ * @description The run, live: journal rows as they land, then each other view when it changes.
296
+ */
297
+ get: operations["events_events_get"];
298
+ put?: never;
299
+ post?: never;
300
+ delete?: never;
301
+ options?: never;
302
+ head?: never;
303
+ patch?: never;
304
+ trace?: never;
305
+ };
306
+ "/events/stream": {
307
+ parameters: {
308
+ query?: never;
309
+ header?: never;
310
+ path?: never;
311
+ cookie?: never;
312
+ };
313
+ /**
314
+ * Events Stream
315
+ * @description Task `key`'s transcript, live: the tail page, then the events after it as they are written.
316
+ */
317
+ get: operations["events_stream_events_stream_get"];
318
+ put?: never;
319
+ post?: never;
320
+ delete?: never;
321
+ options?: never;
322
+ head?: never;
323
+ patch?: never;
324
+ trace?: never;
325
+ };
326
+ };
327
+ export type webhooks = Record<string, never>;
328
+ export type components = {
329
+ schemas: {
330
+ /**
331
+ * AccountQuota
332
+ * @description One account's subscription utilization over a run. `last` was taken when the
333
+ * account's last session started, so it leaves out that session's own use.
334
+ */
335
+ AccountQuota: {
336
+ /** Credential */
337
+ credential: string;
338
+ /**
339
+ * Account
340
+ * @description the account the readings are of (`QuotaReading.account`); empty when not known
341
+ * @default
342
+ */
343
+ account?: string;
344
+ first: components["schemas"]["QuotaReading"];
345
+ last: components["schemas"]["QuotaReading"];
346
+ /**
347
+ * Rests
348
+ * @description its rests now (`/api/hosts`): those a live run began and that have not ended, nor passed their `until`
349
+ */
350
+ rests?: components["schemas"]["CredentialRest"][];
351
+ };
352
+ /**
353
+ * AgentProcess
354
+ * @description One live agent launch: the topmost process of a coding-agent CLI, found by its
355
+ * `CONTRAAGENT_*` environment; or, for an agent behind a library-call backend (no
356
+ * child process), the run's own process, from its in-flight marker, with empty
357
+ * `cmd`, `full_cmd`, `role`, `model` and `plugin`.
358
+ */
359
+ AgentProcess: {
360
+ /** Pid */
361
+ pid: number;
362
+ /** Age S */
363
+ age_s: number;
364
+ /**
365
+ * Cmd
366
+ * @description the first three words of the command line
367
+ */
368
+ cmd: string;
369
+ /** Full Cmd */
370
+ full_cmd: string;
371
+ /** Children */
372
+ children?: components["schemas"]["ProcNode"][];
373
+ /** Key */
374
+ key: string;
375
+ /** Kind */
376
+ kind: string;
377
+ /** Unit */
378
+ unit: string;
379
+ /**
380
+ * Role
381
+ * @description the role it runs as, from the prompt's TELEMETRY line; empty when none
382
+ */
383
+ role: string;
384
+ /** Model */
385
+ model: string;
386
+ /** Plugin */
387
+ plugin: string;
388
+ };
389
+ /**
390
+ * BlocksBody
391
+ * @description Bodies one under another: a panel of several parts.
392
+ */
393
+ BlocksBody: {
394
+ /**
395
+ * Title
396
+ * @description a heading over the body
397
+ */
398
+ title?: string | null;
399
+ /**
400
+ * Collapsed
401
+ * @description shown folded, under its title
402
+ * @default false
403
+ */
404
+ collapsed?: boolean;
405
+ /**
406
+ * Type
407
+ * @default blocks
408
+ * @constant
409
+ */
410
+ type?: "blocks";
411
+ /** Blocks */
412
+ blocks: (components["schemas"]["TilesBody"] | components["schemas"]["TableBody"] | components["schemas"]["ColumnsBody"] | components["schemas"]["LinesBody"] | components["schemas"]["HeatmapBody"] | components["schemas"]["HBarsBody"] | components["schemas"]["StatusGridBody"] | components["schemas"]["NoteBody"] | components["schemas"]["BlocksBody"] | {
413
+ [key: string]: unknown;
414
+ })[];
415
+ };
416
+ /**
417
+ * Changes
418
+ * @description The files one attempt changed under its task's `changes` patterns, as paths relative
419
+ * to the working directory: those it `created`, `modified` and `deleted`.
420
+ */
421
+ Changes: {
422
+ /**
423
+ * Created
424
+ * @default []
425
+ */
426
+ created?: string[];
427
+ /**
428
+ * Modified
429
+ * @default []
430
+ */
431
+ modified?: string[];
432
+ /**
433
+ * Deleted
434
+ * @default []
435
+ */
436
+ deleted?: string[];
437
+ /**
438
+ * Removed
439
+ * @default []
440
+ */
441
+ removed?: string[];
442
+ } & {
443
+ [key: string]: unknown;
444
+ };
445
+ /**
446
+ * ChartSeries
447
+ * @description One series: a value per label of the chart's `x`; null where it has none.
448
+ */
449
+ ChartSeries: {
450
+ /** Name */
451
+ name: string;
452
+ /** Values */
453
+ values: (number | null)[];
454
+ };
455
+ /**
456
+ * ColumnsBody
457
+ * @description Vertical bars, one group per label of `x`; `stacked` puts the series of a label on one bar.
458
+ */
459
+ ColumnsBody: {
460
+ /**
461
+ * Title
462
+ * @description a heading over the body
463
+ */
464
+ title?: string | null;
465
+ /**
466
+ * Collapsed
467
+ * @description shown folded, under its title
468
+ * @default false
469
+ */
470
+ collapsed?: boolean;
471
+ /**
472
+ * Type
473
+ * @default columns
474
+ * @constant
475
+ */
476
+ type?: "columns";
477
+ /** X */
478
+ x: string[];
479
+ /** Series */
480
+ series: components["schemas"]["ChartSeries"][];
481
+ /** Unit */
482
+ unit?: ("usd" | "pct" | "duration" | "tokens" | "datetime" | "number") | null;
483
+ /**
484
+ * Stacked
485
+ * @default false
486
+ */
487
+ stacked?: boolean;
488
+ };
489
+ /**
490
+ * ContractField
491
+ * @description One top-level field of the model a contract file must satisfy.
492
+ */
493
+ ContractField: {
494
+ /** Name */
495
+ name: string;
496
+ /**
497
+ * Type
498
+ * @description JSON-schema type, `list[...]`, a `$ref` name, or `a|b` for a union
499
+ */
500
+ type: string;
501
+ /** Required */
502
+ required: boolean;
503
+ };
504
+ /**
505
+ * ContractRecord
506
+ * @description What one task declared it reads and leaves behind (`contracts/<key>.json`).
507
+ */
508
+ ContractRecord: {
509
+ /** Key */
510
+ key: string;
511
+ /**
512
+ * Kind
513
+ * @default
514
+ */
515
+ kind?: string;
516
+ /**
517
+ * Unit
518
+ * @default
519
+ */
520
+ unit?: string;
521
+ /**
522
+ * Executor
523
+ * @default agent
524
+ * @enum {string}
525
+ */
526
+ executor?: "agent" | "python";
527
+ /**
528
+ * Params
529
+ * @description the task's params that are strings, numbers or booleans; an earlier task's output is one of `inputs`
530
+ */
531
+ params?: {
532
+ [key: string]: string | number | boolean;
533
+ };
534
+ /** Outputs */
535
+ outputs?: components["schemas"]["ContractSpec"][];
536
+ /** Inputs */
537
+ inputs?: components["schemas"]["ContractSpec"][];
538
+ } & {
539
+ [key: string]: unknown;
540
+ };
541
+ /**
542
+ * ContractSpec
543
+ * @description One declared `OutputContract` / `InputContract` (its record, passed through,
544
+ * minus the raw JSON schema, which `fields` summarizes). `status`, `rounds`
545
+ * and `errors` are on outputs only.
546
+ */
547
+ ContractSpec: {
548
+ /**
549
+ * Io
550
+ * @enum {string}
551
+ */
552
+ io: "output" | "input";
553
+ /** Path */
554
+ path: string;
555
+ /**
556
+ * Producer
557
+ * @description input: the key of the task whose output it is
558
+ */
559
+ producer?: string | null;
560
+ /** Schema Name */
561
+ schema_name: string;
562
+ /**
563
+ * Schema Ref
564
+ * @default
565
+ */
566
+ schema_ref?: string;
567
+ /** Fresh */
568
+ fresh?: boolean | null;
569
+ /** Required */
570
+ required?: boolean | null;
571
+ /** Validators */
572
+ validators?: string[];
573
+ /**
574
+ * Preserve
575
+ * @description output: JSON pointers to the parts of the file the task keeps as they were (`*`: every member)
576
+ */
577
+ preserve?: string[];
578
+ file: components["schemas"]["FileView"];
579
+ /** Fields */
580
+ fields: components["schemas"]["ContractField"][];
581
+ /** Status */
582
+ status?: ("valid" | "invalid" | "refused" | "pending" | "failed" | "running") | null;
583
+ /**
584
+ * Rounds
585
+ * @description rounds it took to pass, when the journal recorded it
586
+ */
587
+ rounds?: number | null;
588
+ /** Errors */
589
+ errors?: string[];
590
+ } & {
591
+ [key: string]: unknown;
592
+ };
593
+ /**
594
+ * CredentialRest
595
+ * @description A rest of one credential (`rests.jsonl`): why it began, when, and when it ended.
596
+ */
597
+ CredentialRest: {
598
+ /** Credential */
599
+ credential: string;
600
+ /**
601
+ * Window
602
+ * @default
603
+ * @enum {string}
604
+ */
605
+ window?: "" | "five_hour" | "seven_day";
606
+ /** Pct */
607
+ pct?: number | null;
608
+ /** Cap */
609
+ cap?: number | null;
610
+ /**
611
+ * Rule
612
+ * @default
613
+ */
614
+ rule?: string;
615
+ /**
616
+ * Until
617
+ * @default
618
+ */
619
+ until?: string;
620
+ /**
621
+ * Account
622
+ * @default
623
+ */
624
+ account?: string;
625
+ /** Reading */
626
+ reading?: {
627
+ [key: string]: unknown;
628
+ } | null;
629
+ /**
630
+ * Since
631
+ * @description when it began resting, ISO 8601
632
+ */
633
+ since: string;
634
+ /**
635
+ * Ended
636
+ * @description when it was found not resting again, ISO 8601; empty while it rests (or the run ended first)
637
+ * @default
638
+ */
639
+ ended?: string;
640
+ } & {
641
+ [key: string]: unknown;
642
+ };
643
+ /**
644
+ * CursorMessage
645
+ * @description The resume cursor, or null for a run that keeps none.
646
+ */
647
+ CursorMessage: {
648
+ /**
649
+ * Event
650
+ * @constant
651
+ */
652
+ event: "cursor";
653
+ data: components["schemas"]["CursorView"] | null;
654
+ };
655
+ /**
656
+ * CursorView
657
+ * @description The run's resume cursor. The REST endpoint answers `{}` (every field
658
+ * absent) for a run that keeps none; the live feed sends `null`.
659
+ */
660
+ CursorView: {
661
+ /** Stage */
662
+ stage?: string | null;
663
+ /** Completed Stages */
664
+ completed_stages?: string[];
665
+ /** History */
666
+ history?: components["schemas"]["StageEntry"][];
667
+ /**
668
+ * Updated At
669
+ * @default
670
+ */
671
+ updated_at?: string;
672
+ /** Units */
673
+ units?: {
674
+ [key: string]: components["schemas"]["UnitPosition"];
675
+ };
676
+ /**
677
+ * Markers
678
+ * @description free-form event lists by name
679
+ */
680
+ markers?: {
681
+ [key: string]: {
682
+ [key: string]: unknown;
683
+ }[];
684
+ };
685
+ };
686
+ /**
687
+ * DeferralCause
688
+ * @description Why a task was deferred, as data (`Deferral.cause`). `cause`: `deadline`,
689
+ * `grace_window` (past the deadline's grace window), `cannot_finish` (`need_s`, `left_s`),
690
+ * `dependency_not_queued`, `dependency_deferred` (a task whose output it reads was
691
+ * deferred: `dependency`), `rest` (the credential of every hop it could take rests:
692
+ * `rests`), or a runner's own name. A field a cause does not have is left unset, and
693
+ * `deferred.jsonl` records only the fields set.
694
+ */
695
+ DeferralCause: {
696
+ /** Cause */
697
+ cause: string;
698
+ /**
699
+ * Need S
700
+ * @description `cannot_finish`: the work it needed, in seconds
701
+ */
702
+ need_s?: number | null;
703
+ /**
704
+ * Left S
705
+ * @description `cannot_finish`: the time left before the deadline, in seconds
706
+ */
707
+ left_s?: number | null;
708
+ /**
709
+ * Flow Call
710
+ * @description `deadline`, `grace_window`, `cannot_finish`: the flow call whose time box it is; null for the run's deadline
711
+ */
712
+ flow_call?: string | null;
713
+ /**
714
+ * Rests
715
+ * @description `rest`: each hop passed over and why its credential rests
716
+ * @default []
717
+ */
718
+ rests?: components["schemas"]["SkippedHop"][];
719
+ /**
720
+ * Dependency
721
+ * @description `dependency_deferred`: the key of the deferred task whose output it reads
722
+ */
723
+ dependency?: string | null;
724
+ };
725
+ /**
726
+ * DefinitionFile
727
+ * @description One file that defines a task: its instructions (a task without a plugin), the role's agent file, a skill, the schema ...
728
+ */
729
+ DefinitionFile: {
730
+ /** Path */
731
+ path: string;
732
+ /** Part */
733
+ part: string;
734
+ /** Text */
735
+ text: string;
736
+ } & {
737
+ [key: string]: unknown;
738
+ };
739
+ /** DownstreamTask */
740
+ DownstreamTask: {
741
+ /** Key */
742
+ key: string;
743
+ /** Kind */
744
+ kind: string;
745
+ /** Unit */
746
+ unit: string;
747
+ /**
748
+ * Executor
749
+ * @enum {string}
750
+ */
751
+ executor: "agent" | "python";
752
+ };
753
+ /**
754
+ * DroppedRoute
755
+ * @description A route the preflight dropped: not in its agent's model list, or its probe did not
756
+ * complete. `kinds`: the kinds whose chain held it.
757
+ */
758
+ DroppedRoute: {
759
+ /** Agent */
760
+ agent: string;
761
+ /**
762
+ * Model
763
+ * @description empty: the coding agent's default model
764
+ */
765
+ model: string;
766
+ /** Credential */
767
+ credential: string;
768
+ /**
769
+ * Reason
770
+ * @description not in its coding agent's model list, or how its probe ended (`rate limited`, ...)
771
+ */
772
+ reason: string;
773
+ /**
774
+ * Kinds
775
+ * @description the kinds whose chain held it
776
+ */
777
+ kinds: string[];
778
+ };
779
+ /**
780
+ * ExportInfo
781
+ * @description What an export holds (`contraagent monitor export`): the monitor's views of some
782
+ * runs, written as files and read without a server.
783
+ */
784
+ ExportInfo: {
785
+ /**
786
+ * Exported At
787
+ * @description when it was written, ISO 8601
788
+ */
789
+ exported_at: string;
790
+ /**
791
+ * Runs
792
+ * @description the runs it holds, newest activity first
793
+ */
794
+ runs: string[];
795
+ /**
796
+ * Left Out
797
+ * @description the views it does not hold: `transcripts`, `processes`
798
+ */
799
+ left_out: string[];
800
+ /**
801
+ * Redacted
802
+ * @description what was taken out of the views: `paths` (made relative, else `<path>`), `host`, and each key named with --exclude
803
+ */
804
+ redacted: string[];
805
+ };
806
+ /** FeedReady */
807
+ FeedReady: {
808
+ /**
809
+ * Journal
810
+ * @description journal rows sent before this message
811
+ */
812
+ journal: number;
813
+ };
814
+ /**
815
+ * FileView
816
+ * @description A contract's file as it is now. `content` is the parsed JSON, else the
817
+ * text (cut at 20 000 characters, `truncated`), else null when unreadable.
818
+ */
819
+ FileView: {
820
+ /** Exists */
821
+ exists: boolean;
822
+ /**
823
+ * Size
824
+ * @default 0
825
+ */
826
+ size?: number;
827
+ /**
828
+ * Mtime
829
+ * @default
830
+ */
831
+ mtime?: string;
832
+ /**
833
+ * Truncated
834
+ * @default false
835
+ */
836
+ truncated?: boolean;
837
+ /** Content */
838
+ content?: unknown;
839
+ };
840
+ /**
841
+ * FlowCallNode
842
+ * @description One flow call (`flow_calls.jsonl`): a generator the run drove, or the flow itself.
843
+ */
844
+ FlowCallNode: {
845
+ /**
846
+ * Id
847
+ * @description `0` for the top flow, `<parent>.<n>` for a child
848
+ */
849
+ id: string;
850
+ /**
851
+ * Parent
852
+ * @description the parent flow call's id; null for a top flow
853
+ */
854
+ parent: string | null;
855
+ /**
856
+ * Function
857
+ * @description `module.qualname` of the generator function (or of a flow that does not yield)
858
+ */
859
+ function: string;
860
+ /**
861
+ * Flow
862
+ * @description the flow path where the parent yielded it, with its loops' passes; empty for a top flow
863
+ */
864
+ flow?: components["schemas"]["Frame"][];
865
+ /**
866
+ * State
867
+ * @enum {string}
868
+ */
869
+ state: "running" | "returned" | "raised" | "closed";
870
+ /**
871
+ * Error
872
+ * @description `<type>: <message>` of what it raised (or what closing it raised); else null
873
+ */
874
+ error?: string | null;
875
+ /** @description its own deadline, for a flow call yielded through `time_box`; else null */
876
+ time_box?: components["schemas"]["TimeBoxRecord"] | null;
877
+ };
878
+ /**
879
+ * Frame
880
+ * @description One frame of a flow path (outermost first): a call site in flow code where a task
881
+ * was created. A comprehension is not a loop.
882
+ */
883
+ Frame: {
884
+ /**
885
+ * Function
886
+ * @description `module.qualname`
887
+ */
888
+ function: string;
889
+ /**
890
+ * File
891
+ * @description relative to the run's working directory when under it, else as recorded
892
+ */
893
+ file: string;
894
+ /** Line */
895
+ line: number;
896
+ /**
897
+ * Loops
898
+ * @description the loops of a generator whose pass `line` was in, outermost first; empty outside a loop and for any other frame
899
+ * @default []
900
+ */
901
+ loops?: components["schemas"]["Loop"][];
902
+ };
903
+ /**
904
+ * GridCell
905
+ * @description One cell of a status grid: the state it is in, in words, and that state's tone.
906
+ * `tip` adds a fact about this cell to its tooltip (a run's id, a count).
907
+ */
908
+ GridCell: {
909
+ /** Label */
910
+ label: string;
911
+ /**
912
+ * Tone
913
+ * @enum {string}
914
+ */
915
+ tone: "failed" | "attention" | "done" | "running" | "muted" | "neutral";
916
+ /** Tip */
917
+ tip?: string | null;
918
+ };
919
+ /** HBar */
920
+ HBar: {
921
+ /** Label */
922
+ label: string;
923
+ /** Value */
924
+ value: number;
925
+ /** Tone */
926
+ tone?: ("failed" | "attention" | "done" | "running" | "muted" | "neutral") | null;
927
+ };
928
+ /**
929
+ * HBarsBody
930
+ * @description Horizontal bars, one per label, in the order given.
931
+ */
932
+ HBarsBody: {
933
+ /**
934
+ * Title
935
+ * @description a heading over the body
936
+ */
937
+ title?: string | null;
938
+ /**
939
+ * Collapsed
940
+ * @description shown folded, under its title
941
+ * @default false
942
+ */
943
+ collapsed?: boolean;
944
+ /**
945
+ * Type
946
+ * @default hbars
947
+ * @constant
948
+ */
949
+ type?: "hbars";
950
+ /** Bars */
951
+ bars: components["schemas"]["HBar"][];
952
+ /** Unit */
953
+ unit?: ("usd" | "pct" | "duration" | "tokens" | "datetime" | "number") | null;
954
+ };
955
+ /** HTTPValidationError */
956
+ HTTPValidationError: {
957
+ /** Detail */
958
+ detail?: components["schemas"]["ValidationError"][];
959
+ };
960
+ /**
961
+ * HeatmapBody
962
+ * @description A value per row (`y`) and column (`x`): `values[row][column]`, null where there is none.
963
+ */
964
+ HeatmapBody: {
965
+ /**
966
+ * Title
967
+ * @description a heading over the body
968
+ */
969
+ title?: string | null;
970
+ /**
971
+ * Collapsed
972
+ * @description shown folded, under its title
973
+ * @default false
974
+ */
975
+ collapsed?: boolean;
976
+ /**
977
+ * Type
978
+ * @default heatmap
979
+ * @constant
980
+ */
981
+ type?: "heatmap";
982
+ /** X */
983
+ x: string[];
984
+ /** Y */
985
+ y: string[];
986
+ /** Values */
987
+ values: (number | null)[][];
988
+ /** Unit */
989
+ unit?: ("usd" | "pct" | "duration" | "tokens" | "datetime" | "number") | null;
990
+ };
991
+ /**
992
+ * Hop
993
+ * @description One launch of an attempt on one route of its failover chain: where it ran and how
994
+ * it ended.
995
+ */
996
+ Hop: {
997
+ /**
998
+ * Route
999
+ * @default
1000
+ */
1001
+ route?: string;
1002
+ /**
1003
+ * Agent
1004
+ * @default
1005
+ */
1006
+ agent?: string;
1007
+ /**
1008
+ * Model
1009
+ * @default
1010
+ */
1011
+ model?: string;
1012
+ /**
1013
+ * Credential
1014
+ * @default
1015
+ */
1016
+ credential?: string;
1017
+ /**
1018
+ * Stop
1019
+ * @default
1020
+ */
1021
+ stop?: string;
1022
+ /**
1023
+ * Wall S
1024
+ * @default 0
1025
+ */
1026
+ wall_s?: number;
1027
+ /** Cost Usd */
1028
+ cost_usd?: number | null;
1029
+ usage?: components["schemas"]["TokenUsage"] | null;
1030
+ /** Other Models */
1031
+ other_models?: {
1032
+ [key: string]: components["schemas"]["OtherModel"];
1033
+ };
1034
+ } & {
1035
+ [key: string]: unknown;
1036
+ };
1037
+ /**
1038
+ * HostSummary
1039
+ * @description One host that drives runs.
1040
+ */
1041
+ HostSummary: {
1042
+ /** Host Id */
1043
+ host_id: string;
1044
+ /**
1045
+ * Up
1046
+ * @description its reports keep arriving (a hub: a heartbeat within the TTL; one host: always)
1047
+ */
1048
+ up: boolean;
1049
+ /**
1050
+ * Last Seen
1051
+ * @description when it last reported, ISO 8601; empty when it does not report (one host)
1052
+ */
1053
+ last_seen: string;
1054
+ /**
1055
+ * Interval S
1056
+ * @description seconds between its reports; null when it does not report
1057
+ */
1058
+ interval_s: number | null;
1059
+ /**
1060
+ * Runs
1061
+ * @description its runs
1062
+ */
1063
+ runs: number;
1064
+ /**
1065
+ * Running
1066
+ * @description its runs whose process is alive
1067
+ */
1068
+ running: number;
1069
+ /**
1070
+ * Unresponsive
1071
+ * @description its runs last reported alive since it stopped reporting
1072
+ */
1073
+ unresponsive: number;
1074
+ };
1075
+ /**
1076
+ * Hosts
1077
+ * @description The hosts, and each account's utilization over every run of every host.
1078
+ */
1079
+ Hosts: {
1080
+ /** Hosts */
1081
+ hosts: components["schemas"]["HostSummary"][];
1082
+ /**
1083
+ * Quota
1084
+ * @description per credential (account): its first and last utilization reading over every run; highest weekly use first
1085
+ */
1086
+ quota?: components["schemas"]["AccountQuota"][];
1087
+ };
1088
+ /**
1089
+ * InflightPythonTask
1090
+ * @description A Python task running inside the run's own process.
1091
+ */
1092
+ InflightPythonTask: {
1093
+ /** Key */
1094
+ key: string;
1095
+ /** Kind */
1096
+ kind: string;
1097
+ /** Unit */
1098
+ unit: string;
1099
+ /** Pid */
1100
+ pid: number;
1101
+ /** Age S */
1102
+ age_s: number;
1103
+ };
1104
+ /**
1105
+ * Info
1106
+ * @description What the UI shows before a run is picked: the title, the panel tabs to offer,
1107
+ * and the version of this contract.
1108
+ */
1109
+ Info: {
1110
+ /** Title */
1111
+ title: string;
1112
+ /** Panels */
1113
+ panels: components["schemas"]["PanelInfo"][];
1114
+ /**
1115
+ * Api Version
1116
+ * @description Version of this API contract (semver)
1117
+ */
1118
+ api_version: string;
1119
+ /**
1120
+ * Hosts
1121
+ * @description the runs come from many hosts (a hub): `/api/hosts` lists them
1122
+ * @default false
1123
+ */
1124
+ hosts?: boolean;
1125
+ /** @description set only in an export: what it holds; a server never sends it */
1126
+ export?: components["schemas"]["ExportInfo"] | null;
1127
+ };
1128
+ /**
1129
+ * JournalMessage
1130
+ * @description One journal row, sent once per row: the whole journal on connect, then each new row.
1131
+ */
1132
+ JournalMessage: {
1133
+ /**
1134
+ * Event
1135
+ * @constant
1136
+ */
1137
+ event: "journal";
1138
+ data: components["schemas"]["JournalRow"];
1139
+ };
1140
+ /**
1141
+ * JournalPage
1142
+ * @description Journal rows after a line offset; pass `total` back as `since` to get only newer rows.
1143
+ */
1144
+ JournalPage: {
1145
+ /** Entries */
1146
+ entries: components["schemas"]["JournalRow"][];
1147
+ /** Total */
1148
+ total: number;
1149
+ };
1150
+ /**
1151
+ * JournalRow
1152
+ * @description One finished attempt. `key` is the stable `Task.key`, one task; `kind`
1153
+ * and `unit` are its kind and unit; `executor` says who ran it; `stop` is
1154
+ * `Stop.value` (or a Python task's completed/error).
1155
+ */
1156
+ JournalRow: {
1157
+ /** Ts */
1158
+ ts: string;
1159
+ /**
1160
+ * Run Id
1161
+ * @default
1162
+ */
1163
+ run_id?: string;
1164
+ /**
1165
+ * Run Group
1166
+ * @default
1167
+ */
1168
+ run_group?: string;
1169
+ /** Key */
1170
+ key: string;
1171
+ /**
1172
+ * Attempt
1173
+ * @default 0
1174
+ */
1175
+ attempt?: number;
1176
+ /** Kind */
1177
+ kind: string;
1178
+ /**
1179
+ * Executor
1180
+ * @default agent
1181
+ * @enum {string}
1182
+ */
1183
+ executor?: "agent" | "python";
1184
+ /**
1185
+ * Unit
1186
+ * @default
1187
+ */
1188
+ unit?: string;
1189
+ /**
1190
+ * Agent
1191
+ * @default
1192
+ */
1193
+ agent?: string;
1194
+ /**
1195
+ * Model
1196
+ * @default
1197
+ */
1198
+ model?: string;
1199
+ /**
1200
+ * Credential
1201
+ * @default
1202
+ */
1203
+ credential?: string;
1204
+ /**
1205
+ * Route
1206
+ * @default
1207
+ */
1208
+ route?: string;
1209
+ /** Hops */
1210
+ hops?: components["schemas"]["Hop"][];
1211
+ /** Skipped Hops */
1212
+ skipped_hops?: components["schemas"]["SkippedHop"][];
1213
+ /**
1214
+ * Stop
1215
+ * @enum {string}
1216
+ */
1217
+ stop: "completed" | "timeout" | "max_turns" | "budget" | "context_budget" | "stalled" | "auth_failed" | "api_error" | "rate_limited" | "refused" | "aborted" | "denied" | "error" | "no_output" | "launch_failed" | "invalid_output" | "invalid_input" | "credential_mismatch" | "skipped" | "partial";
1218
+ /** Ok */
1219
+ ok: boolean;
1220
+ /**
1221
+ * Wall S
1222
+ * @default 0
1223
+ */
1224
+ wall_s?: number;
1225
+ /** Exit Code */
1226
+ exit_code?: number | null;
1227
+ /** Signal */
1228
+ signal?: number | null;
1229
+ /**
1230
+ * Reason
1231
+ * @default
1232
+ */
1233
+ reason?: string;
1234
+ /** Rounds */
1235
+ rounds?: number | null;
1236
+ /** Round Errors */
1237
+ round_errors?: string[][];
1238
+ /** Hook Errors */
1239
+ hook_errors?: string[][];
1240
+ usage?: components["schemas"]["TokenUsage"] | null;
1241
+ /** Cost Usd */
1242
+ cost_usd?: number | null;
1243
+ /** Quota */
1244
+ quota?: components["schemas"]["QuotaReading"][];
1245
+ /** Web Queries */
1246
+ web_queries?: string[];
1247
+ /** Unread Events */
1248
+ unread_events?: {
1249
+ [key: string]: number;
1250
+ };
1251
+ changes?: components["schemas"]["Changes"] | null;
1252
+ /** Context Budget */
1253
+ context_budget?: number | null;
1254
+ /**
1255
+ * Context Warned
1256
+ * @default false
1257
+ */
1258
+ context_warned?: boolean;
1259
+ /**
1260
+ * Fingerprint
1261
+ * @default
1262
+ */
1263
+ fingerprint?: string;
1264
+ /** Flow Call */
1265
+ flow_call?: string | null;
1266
+ /**
1267
+ * Replayed
1268
+ * @default false
1269
+ */
1270
+ replayed?: boolean;
1271
+ } & {
1272
+ [key: string]: unknown;
1273
+ };
1274
+ /**
1275
+ * KeptKind
1276
+ * @description A kind with no route left, run as configured all the same (`substitute`), and why.
1277
+ */
1278
+ KeptKind: {
1279
+ /** Kind */
1280
+ kind: string;
1281
+ /** Agent */
1282
+ agent: string;
1283
+ /** Model */
1284
+ model: string;
1285
+ /** Reason */
1286
+ reason: string;
1287
+ };
1288
+ /**
1289
+ * LaunchEvent
1290
+ * @description Head of one invocation: the exact argv, cwd and the submitted prompt.
1291
+ */
1292
+ LaunchEvent: {
1293
+ /**
1294
+ * Type
1295
+ * @constant
1296
+ */
1297
+ type: "launch";
1298
+ /**
1299
+ * Ts
1300
+ * @description Unix time the launch started
1301
+ */
1302
+ ts?: number | null;
1303
+ /** Argv */
1304
+ argv: string[];
1305
+ /** Cwd */
1306
+ cwd: string;
1307
+ /**
1308
+ * Prompt
1309
+ * @description cut at 200 000 characters
1310
+ */
1311
+ prompt: string;
1312
+ /**
1313
+ * Prompt Truncated
1314
+ * @description characters of the prompt not shown
1315
+ * @default 0
1316
+ */
1317
+ prompt_truncated?: number;
1318
+ } & {
1319
+ [key: string]: unknown;
1320
+ };
1321
+ /** LinesBody */
1322
+ LinesBody: {
1323
+ /**
1324
+ * Title
1325
+ * @description a heading over the body
1326
+ */
1327
+ title?: string | null;
1328
+ /**
1329
+ * Collapsed
1330
+ * @description shown folded, under its title
1331
+ * @default false
1332
+ */
1333
+ collapsed?: boolean;
1334
+ /**
1335
+ * Type
1336
+ * @default lines
1337
+ * @constant
1338
+ */
1339
+ type?: "lines";
1340
+ /** X */
1341
+ x: string[];
1342
+ /** Series */
1343
+ series: components["schemas"]["ChartSeries"][];
1344
+ /** Unit */
1345
+ unit?: ("usd" | "pct" | "duration" | "tokens" | "datetime" | "number") | null;
1346
+ };
1347
+ /**
1348
+ * Loop
1349
+ * @description A `for` or `while` loop of a generator around a call site, and the pass the call
1350
+ * site was in.
1351
+ */
1352
+ Loop: {
1353
+ /**
1354
+ * Line
1355
+ * @description the loop's first line, which names it
1356
+ */
1357
+ line: number;
1358
+ /**
1359
+ * Pass
1360
+ * @description one iteration of this loop, numbered from 1 since the loop was last entered in that frame; null when not counted
1361
+ */
1362
+ pass: number | null;
1363
+ };
1364
+ /**
1365
+ * MessageEvent
1366
+ * @description omp: a whole message or a turn's closing thinking. Either `role` + `text`, or `thinking`.
1367
+ */
1368
+ MessageEvent: {
1369
+ /**
1370
+ * Type
1371
+ * @enum {string}
1372
+ */
1373
+ type: "message_start" | "message_end" | "turn_end";
1374
+ /** Role */
1375
+ role?: string | null;
1376
+ /** Text */
1377
+ text?: string | null;
1378
+ /** Thinking */
1379
+ thinking?: string | null;
1380
+ } & {
1381
+ [key: string]: unknown;
1382
+ };
1383
+ /**
1384
+ * MessageUpdateEvent
1385
+ * @description A piece of assistant prose: `ev` is `text_delta` or `thinking_delta` (omp may send its other delta kinds).
1386
+ */
1387
+ MessageUpdateEvent: {
1388
+ /**
1389
+ * Type
1390
+ * @constant
1391
+ */
1392
+ type: "message_update";
1393
+ /** Ev */
1394
+ ev: string;
1395
+ /** Delta */
1396
+ delta: string;
1397
+ } & {
1398
+ [key: string]: unknown;
1399
+ };
1400
+ /**
1401
+ * ModelUsage
1402
+ * @description What a run's agent sessions spent on one model of one coding agent, from each
1403
+ * journal row's hops (a failover's hops on two models count apart), a hop's spend on
1404
+ * other models (`Hop.other_models`) on each of them. Python tasks have no model and are
1405
+ * not counted.
1406
+ */
1407
+ ModelUsage: {
1408
+ /** Agent */
1409
+ agent: string;
1410
+ /** Model */
1411
+ model: string;
1412
+ /**
1413
+ * Sessions
1414
+ * @description hops: agent sessions launched on it (pool members tried on one hop count once); 0 for an other model only
1415
+ */
1416
+ sessions: number;
1417
+ /**
1418
+ * Calls
1419
+ * @description API calls
1420
+ * @default 0
1421
+ */
1422
+ calls?: number;
1423
+ /**
1424
+ * Input
1425
+ * @default 0
1426
+ */
1427
+ input?: number;
1428
+ /**
1429
+ * Output
1430
+ * @default 0
1431
+ */
1432
+ output?: number;
1433
+ /**
1434
+ * Cache Read
1435
+ * @default 0
1436
+ */
1437
+ cache_read?: number;
1438
+ /**
1439
+ * Cache Creation
1440
+ * @default 0
1441
+ */
1442
+ cache_creation?: number;
1443
+ /**
1444
+ * Cost Usd
1445
+ * @description what the coding agent reported; null when no session on it reported a cost
1446
+ */
1447
+ cost_usd?: number | null;
1448
+ /**
1449
+ * Wall S
1450
+ * @default 0
1451
+ */
1452
+ wall_s?: number;
1453
+ /**
1454
+ * Peak Context
1455
+ * @description peak context: the largest input of one API call of a session on it (tokens); null when none reported one
1456
+ */
1457
+ peak_context?: number | null;
1458
+ /**
1459
+ * Context Window
1460
+ * @description its context window (tokens of one API call's input) as the coding agent reported it; null when none did
1461
+ */
1462
+ context_window?: number | null;
1463
+ };
1464
+ /**
1465
+ * NoteBody
1466
+ * @description Text beside the figures: what a part shows, how to read a number. `text` is
1467
+ * markdown (paragraphs, lists, emphasis, code, http(s) links; any markup in it is shown
1468
+ * as text). `tone` marks a note that warns (`attention`) or reports a failure (`failed`).
1469
+ */
1470
+ NoteBody: {
1471
+ /**
1472
+ * Title
1473
+ * @description a heading over the body
1474
+ */
1475
+ title?: string | null;
1476
+ /**
1477
+ * Collapsed
1478
+ * @description shown folded, under its title
1479
+ * @default false
1480
+ */
1481
+ collapsed?: boolean;
1482
+ /**
1483
+ * Type
1484
+ * @default note
1485
+ * @constant
1486
+ */
1487
+ type?: "note";
1488
+ /** Text */
1489
+ text: string;
1490
+ /** Tone */
1491
+ tone?: ("failed" | "attention" | "done" | "running" | "muted" | "neutral") | null;
1492
+ };
1493
+ /**
1494
+ * NoticeEvent
1495
+ * @description A line of session bookkeeping: init, a retry, a rate-limit status, a custom message.
1496
+ */
1497
+ NoticeEvent: {
1498
+ /**
1499
+ * Type
1500
+ * @constant
1501
+ */
1502
+ type: "notice";
1503
+ /** Text */
1504
+ text: string;
1505
+ } & {
1506
+ [key: string]: unknown;
1507
+ };
1508
+ /**
1509
+ * OtherEvent
1510
+ * @description Any other event: omp's bare lifecycle markers (`agent_start`, `agent_end`,
1511
+ * `turn_start`, `auto_retry_end`) and whatever a custom backend's registered
1512
+ * normalizer emits, including a known `type` whose fields do not match above.
1513
+ */
1514
+ OtherEvent: {
1515
+ /** Type */
1516
+ type: string;
1517
+ } & {
1518
+ [key: string]: unknown;
1519
+ };
1520
+ /**
1521
+ * OtherModel
1522
+ * @description What a hop spent on a model other than its own (`Hop.other_models`).
1523
+ */
1524
+ OtherModel: {
1525
+ /** Cost Usd */
1526
+ cost_usd?: number | null;
1527
+ /**
1528
+ * Input
1529
+ * @default 0
1530
+ */
1531
+ input?: number;
1532
+ /**
1533
+ * Output
1534
+ * @default 0
1535
+ */
1536
+ output?: number;
1537
+ /**
1538
+ * Cache Read
1539
+ * @default 0
1540
+ */
1541
+ cache_read?: number;
1542
+ /**
1543
+ * Cache Creation
1544
+ * @default 0
1545
+ */
1546
+ cache_creation?: number;
1547
+ } & {
1548
+ [key: string]: unknown;
1549
+ };
1550
+ /** OutputTally */
1551
+ OutputTally: {
1552
+ /** Valid */
1553
+ valid: number;
1554
+ /** Invalid */
1555
+ invalid: number;
1556
+ /** Refused */
1557
+ refused: number;
1558
+ /** Pending */
1559
+ pending: number;
1560
+ /** Failed */
1561
+ failed: number;
1562
+ /** Running */
1563
+ running: number;
1564
+ };
1565
+ /** Outputs */
1566
+ Outputs: {
1567
+ /** Contracts */
1568
+ contracts: components["schemas"]["ContractRecord"][];
1569
+ /** @description output contracts per status */
1570
+ tally: components["schemas"]["OutputTally"];
1571
+ };
1572
+ /** OutputsMessage */
1573
+ OutputsMessage: {
1574
+ /**
1575
+ * Event
1576
+ * @constant
1577
+ */
1578
+ event: "outputs";
1579
+ data: components["schemas"]["Outputs"];
1580
+ };
1581
+ /**
1582
+ * PanelInfo
1583
+ * @description A panel a domain registered: its tab label, tooltip and glyph, and what it is
1584
+ * computed over (`run`: one run, a tab of the run; `trends`: the runs of a period).
1585
+ */
1586
+ PanelInfo: {
1587
+ /** Name */
1588
+ name: string;
1589
+ /** Title */
1590
+ title: string;
1591
+ /** Description */
1592
+ description: string;
1593
+ /** Icon */
1594
+ icon: string;
1595
+ /**
1596
+ * Scope
1597
+ * @default run
1598
+ * @enum {string}
1599
+ */
1600
+ scope?: "run" | "trends";
1601
+ /**
1602
+ * Tab
1603
+ * @description a trends panel's tab of the Trends page, with the panels of the same `tab`; '': on the first tab
1604
+ * @default
1605
+ */
1606
+ tab?: string;
1607
+ };
1608
+ /**
1609
+ * PanelMessage
1610
+ * @description A domain panel's body (`PanelBody`), sent when it changed. `{"error": ...}`
1611
+ * when the panel raised.
1612
+ */
1613
+ PanelMessage: {
1614
+ /**
1615
+ * Event
1616
+ * @description `panel:<name>`, one per run panel in /api/info `panels`
1617
+ */
1618
+ event: string;
1619
+ /** Data */
1620
+ data: components["schemas"]["TilesBody"] | components["schemas"]["TableBody"] | components["schemas"]["ColumnsBody"] | components["schemas"]["LinesBody"] | components["schemas"]["HeatmapBody"] | components["schemas"]["HBarsBody"] | components["schemas"]["StatusGridBody"] | components["schemas"]["NoteBody"] | components["schemas"]["BlocksBody"] | {
1621
+ [key: string]: unknown;
1622
+ };
1623
+ };
1624
+ /**
1625
+ * PanelTile
1626
+ * @description A figure as a tile (`cae-stat-tiles`). `sub`: lines under the value, each a row of facts.
1627
+ */
1628
+ PanelTile: {
1629
+ /** Id */
1630
+ id: string;
1631
+ /** Label */
1632
+ label: string;
1633
+ /**
1634
+ * Value
1635
+ * @description a number as given (an integer stays one), or text already formatted
1636
+ */
1637
+ value: number | string;
1638
+ /** Tone */
1639
+ tone?: ("failed" | "attention" | "done" | "running" | "muted" | "neutral") | null;
1640
+ /** Tip */
1641
+ tip?: string | null;
1642
+ /** Sub */
1643
+ sub?: string[][];
1644
+ };
1645
+ /**
1646
+ * Plan
1647
+ * @description The queued tasks, their groups, and the flow calls that created them. A run with
1648
+ * no `flow_calls.jsonl` (its tasks queued by hand, not by a flow) has no flow call.
1649
+ */
1650
+ Plan: {
1651
+ /** Nodes */
1652
+ nodes: components["schemas"]["PlanNode"][];
1653
+ /** Groups */
1654
+ groups: components["schemas"]["PlanGroup"][];
1655
+ /**
1656
+ * Flow Calls
1657
+ * @description in start order
1658
+ */
1659
+ flow_calls?: components["schemas"]["FlowCallNode"][];
1660
+ /**
1661
+ * Quota Caps
1662
+ * @description the run's credentials that have quota caps (`run.json`)
1663
+ */
1664
+ quota_caps?: components["schemas"]["QuotaCap"][];
1665
+ /**
1666
+ * Quota Rule
1667
+ * @description `module.qualname` of the run's quota rule (`Pipeline(quota_rule=)`); empty for none
1668
+ * @default
1669
+ */
1670
+ quota_rule?: string;
1671
+ /**
1672
+ * Rests
1673
+ * @description each rest of a credential in the run (`rests.jsonl`), in start order
1674
+ */
1675
+ rests?: components["schemas"]["CredentialRest"][];
1676
+ /**
1677
+ * Models
1678
+ * @description each model the run's agent sessions ran on, in order of first use
1679
+ */
1680
+ models?: components["schemas"]["ModelUsage"][];
1681
+ /** @description what the run's preflight did (`run.json`); null when its run.json records none */
1682
+ preflight?: components["schemas"]["PreflightRecord"] | null;
1683
+ };
1684
+ /**
1685
+ * PlanGroup
1686
+ * @description A group: a column of the pipeline view (a kind, the kinds `Monitor(groups=)` puts
1687
+ * together, or the implementation kinds of a base kind), its members counted by state.
1688
+ */
1689
+ PlanGroup: {
1690
+ /** Id */
1691
+ id: string;
1692
+ /** Label */
1693
+ label: string;
1694
+ /** Total */
1695
+ total: number;
1696
+ /** Done */
1697
+ done: number;
1698
+ /**
1699
+ * Partial
1700
+ * @default 0
1701
+ */
1702
+ partial?: number;
1703
+ /** Failed */
1704
+ failed: number;
1705
+ /** Running */
1706
+ running: number;
1707
+ /** Pending */
1708
+ pending: number;
1709
+ /** Skipped */
1710
+ skipped: number;
1711
+ /** Blocked */
1712
+ blocked: number;
1713
+ };
1714
+ /** PlanMessage */
1715
+ PlanMessage: {
1716
+ /**
1717
+ * Event
1718
+ * @constant
1719
+ */
1720
+ event: "plan";
1721
+ data: components["schemas"]["Plan"];
1722
+ };
1723
+ /**
1724
+ * PlanNode
1725
+ * @description A queued task (a `plan.jsonl` row, passed through) with its state and
1726
+ * layout. The journal fields (`wall_s` .. `attempts`) appear once it finished.
1727
+ * The origin fields (`flow` .. `flow_call`) say where the flow created it.
1728
+ */
1729
+ PlanNode: {
1730
+ /**
1731
+ * Ts
1732
+ * @description when it was queued (absent for a node rebuilt from the journal)
1733
+ * @default
1734
+ */
1735
+ ts?: string;
1736
+ /** Key */
1737
+ key: string;
1738
+ /** Kind */
1739
+ kind: string;
1740
+ /**
1741
+ * Unit
1742
+ * @default
1743
+ */
1744
+ unit?: string;
1745
+ /**
1746
+ * Claims
1747
+ * @description the names it holds while it runs, its kind's `claims` filled in
1748
+ */
1749
+ claims?: string[];
1750
+ /**
1751
+ * After
1752
+ * @description task keys it waits for
1753
+ */
1754
+ after?: string[];
1755
+ /**
1756
+ * Priority
1757
+ * @description its task call's `priority`: a tie-breaker in the queue, higher first
1758
+ * @default 0
1759
+ */
1760
+ priority?: number;
1761
+ /**
1762
+ * Executor
1763
+ * @default agent
1764
+ * @enum {string}
1765
+ */
1766
+ executor?: "agent" | "python";
1767
+ /**
1768
+ * Flow
1769
+ * @description the flow path: frames of flow code that created it, outermost first
1770
+ */
1771
+ flow?: components["schemas"]["Frame"][];
1772
+ /**
1773
+ * Created From
1774
+ * @description keys whose results its flow call had received when it created it
1775
+ */
1776
+ created_from?: string[];
1777
+ /**
1778
+ * Flow Call
1779
+ * @description the id of the flow call that created it; null for a task with no origin
1780
+ */
1781
+ flow_call?: string | null;
1782
+ /**
1783
+ * Base Kind
1784
+ * @description an implementation kind's base kind (`agent_task(implementations=)`), its group unless `groups` lists it; else empty
1785
+ * @default
1786
+ */
1787
+ base_kind?: string;
1788
+ /**
1789
+ * State
1790
+ * @enum {string}
1791
+ */
1792
+ state: "pending" | "running" | "done" | "partial" | "failed" | "skipped" | "blocked";
1793
+ /**
1794
+ * Level
1795
+ * @description depth in the dependency graph, 0 for a task that waits for nothing
1796
+ */
1797
+ level: number;
1798
+ /** Group */
1799
+ group: string;
1800
+ /**
1801
+ * Wall S
1802
+ * @default 0
1803
+ */
1804
+ wall_s?: number;
1805
+ /**
1806
+ * Stop
1807
+ * @default
1808
+ */
1809
+ stop?: string;
1810
+ /**
1811
+ * Route
1812
+ * @default
1813
+ */
1814
+ route?: string;
1815
+ /**
1816
+ * Attempts
1817
+ * @default 1
1818
+ */
1819
+ attempts?: number;
1820
+ /**
1821
+ * Deferred
1822
+ * @description why the queue deferred it, never launched (`deferred.jsonl`): a deadline, a resting credential; empty when it was not
1823
+ * @default
1824
+ */
1825
+ deferred?: string;
1826
+ /** @description the same as data; null when it was not deferred, or the run recorded no cause */
1827
+ deferred_cause?: components["schemas"]["DeferralCause"] | null;
1828
+ } & {
1829
+ [key: string]: unknown;
1830
+ };
1831
+ /**
1832
+ * PreflightRecord
1833
+ * @description What a preflight did, as `run.json` records it (`preflight`): its policy, the routes
1834
+ * it dropped, and, for each kind left with no route, its substitution, the kind kept
1835
+ * as configured, or the kind that stopped the run (`stopped`).
1836
+ */
1837
+ PreflightRecord: {
1838
+ /**
1839
+ * Policy
1840
+ * @description `Pipeline(preflight=)`; `off`: no route was probed
1841
+ * @enum {string}
1842
+ */
1843
+ policy: "substitute" | "stop" | "off";
1844
+ /** Dropped */
1845
+ dropped?: components["schemas"]["DroppedRoute"][];
1846
+ /** Substituted */
1847
+ substituted?: components["schemas"]["Substitution"][];
1848
+ /** Kept */
1849
+ kept?: components["schemas"]["KeptKind"][];
1850
+ /**
1851
+ * Stopped
1852
+ * @description the kinds with no route left that stopped the run (policy `stop`)
1853
+ */
1854
+ stopped?: string[];
1855
+ };
1856
+ /**
1857
+ * ProcNode
1858
+ * @description A process in the run's tree (three levels deep at most). The launch fields
1859
+ * are set on the topmost process of an agent launch.
1860
+ */
1861
+ ProcNode: {
1862
+ /** Pid */
1863
+ pid: number;
1864
+ /** Age S */
1865
+ age_s: number;
1866
+ /**
1867
+ * Cmd
1868
+ * @description the first three words of the command line
1869
+ */
1870
+ cmd: string;
1871
+ /** Full Cmd */
1872
+ full_cmd: string;
1873
+ /** Children */
1874
+ children?: components["schemas"]["ProcNode"][];
1875
+ /** Key */
1876
+ key?: string | null;
1877
+ /** Kind */
1878
+ kind?: string | null;
1879
+ /** Unit */
1880
+ unit?: string | null;
1881
+ /**
1882
+ * Role
1883
+ * @description the role it runs as, from the prompt's TELEMETRY line
1884
+ */
1885
+ role?: string | null;
1886
+ /** Model */
1887
+ model?: string | null;
1888
+ /** Plugin */
1889
+ plugin?: string | null;
1890
+ };
1891
+ /**
1892
+ * Procs
1893
+ * @description The run's live processes. Everything but the run's own fields is empty when it is not alive.
1894
+ */
1895
+ Procs: {
1896
+ /** Run */
1897
+ run: string;
1898
+ /** Alive */
1899
+ alive: boolean;
1900
+ /** Pid */
1901
+ pid: number | null;
1902
+ /** Argv */
1903
+ argv: string[];
1904
+ /** Started At */
1905
+ started_at: string;
1906
+ /** Max Workers */
1907
+ max_workers: number | null;
1908
+ /** Run Group */
1909
+ run_group: string;
1910
+ /** Launches */
1911
+ launches: components["schemas"]["AgentProcess"][];
1912
+ /** Tree */
1913
+ tree: components["schemas"]["ProcNode"][];
1914
+ /** Python Tasks */
1915
+ python_tasks: components["schemas"]["InflightPythonTask"][];
1916
+ };
1917
+ /**
1918
+ * ProcsMessage
1919
+ * @description The live processes, sent when a launch starts or ends (not on every age tick).
1920
+ */
1921
+ ProcsMessage: {
1922
+ /**
1923
+ * Event
1924
+ * @constant
1925
+ */
1926
+ event: "procs";
1927
+ data: components["schemas"]["Procs"];
1928
+ };
1929
+ /**
1930
+ * QuotaCap
1931
+ * @description One credential's quota caps (`[credentials.<name>] max_five_hour_pct`, `max_seven_day_pct`):
1932
+ * the utilization (%) of a window past which it rests; None for a window with no cap.
1933
+ */
1934
+ QuotaCap: {
1935
+ /** Credential */
1936
+ credential: string;
1937
+ /** Five Hour Pct */
1938
+ five_hour_pct?: number | null;
1939
+ /** Seven Day Pct */
1940
+ seven_day_pct?: number | null;
1941
+ };
1942
+ /**
1943
+ * QuotaReading
1944
+ * @description A subscription's utilization during a launch, from one of these sources:
1945
+ *
1946
+ * * Claude Code: in its stream, when a session starts or resumes;
1947
+ * * Codex: in its stream, with each API call of a ChatGPT login;
1948
+ * * omp (`omp`, `omp-rpc`): at each launch, what the account's latest request reported
1949
+ * (`omp usage --json`, read before the launch: `Backend.usage_reading`);
1950
+ * * opencode and pi: for an OpenCode Go model only, OpenCode's usage endpoint, read by
1951
+ * contraagent before each launch (`Backend.usage_reading`); the agents report none.
1952
+ *
1953
+ * Account-wide: it includes whatever else used the same account, parallel tasks too.
1954
+ * `LaunchResult.quota` holds a launch's, the journal's `quota` an attempt's that give a
1955
+ * 5-hour or weekly utilization.
1956
+ */
1957
+ QuotaReading: {
1958
+ /** Observed At */
1959
+ observed_at?: string | null;
1960
+ /**
1961
+ * Credential
1962
+ * @default
1963
+ */
1964
+ credential?: string;
1965
+ /** Five Hour Pct */
1966
+ five_hour_pct?: number | null;
1967
+ /** Five Hour Resets At */
1968
+ five_hour_resets_at?: string | null;
1969
+ /** Seven Day Pct */
1970
+ seven_day_pct?: number | null;
1971
+ /** Seven Day Resets At */
1972
+ seven_day_resets_at?: string | null;
1973
+ /**
1974
+ * Status
1975
+ * @default
1976
+ */
1977
+ status?: string;
1978
+ /**
1979
+ * Account
1980
+ * @default
1981
+ */
1982
+ account?: string;
1983
+ /**
1984
+ * Status Window
1985
+ * @default
1986
+ */
1987
+ status_window?: string;
1988
+ /** Threshold Pct */
1989
+ threshold_pct?: number | null;
1990
+ /**
1991
+ * Overage Status
1992
+ * @default
1993
+ */
1994
+ overage_status?: string;
1995
+ /**
1996
+ * Overage Disabled Reason
1997
+ * @default
1998
+ */
1999
+ overage_disabled_reason?: string;
2000
+ /** Using Overage */
2001
+ using_overage?: boolean | null;
2002
+ /** Windows */
2003
+ windows?: {
2004
+ [key: string]: components["schemas"]["QuotaWindow"];
2005
+ };
2006
+ /** Extra */
2007
+ extra?: {
2008
+ [key: string]: unknown;
2009
+ };
2010
+ } & {
2011
+ [key: string]: unknown;
2012
+ };
2013
+ /**
2014
+ * QuotaWindow
2015
+ * @description One window of a reading: its utilization (%) and when it resets (ISO 8601).
2016
+ */
2017
+ QuotaWindow: {
2018
+ /** Pct */
2019
+ pct?: number | null;
2020
+ /** Resets At */
2021
+ resets_at?: string | null;
2022
+ } & {
2023
+ [key: string]: unknown;
2024
+ };
2025
+ /**
2026
+ * ReadyMessage
2027
+ * @description Sent once per connection, after the first round of messages: the journal
2028
+ * replayed so far and the current value of every other view. A row that
2029
+ * arrives after it is new, not part of the replay.
2030
+ */
2031
+ ReadyMessage: {
2032
+ /**
2033
+ * Event
2034
+ * @constant
2035
+ */
2036
+ event: "ready";
2037
+ data: components["schemas"]["FeedReady"];
2038
+ };
2039
+ /**
2040
+ * RetryEvent
2041
+ * @description omp: the agent retrying after a provider error.
2042
+ */
2043
+ RetryEvent: {
2044
+ /**
2045
+ * Type
2046
+ * @constant
2047
+ */
2048
+ type: "auto_retry_start";
2049
+ /** Attempt */
2050
+ attempt?: number | null;
2051
+ /**
2052
+ * Err
2053
+ * @default
2054
+ */
2055
+ err?: string;
2056
+ } & {
2057
+ [key: string]: unknown;
2058
+ };
2059
+ /**
2060
+ * RunEvent
2061
+ * @description One message of /events?run=
2062
+ */
2063
+ RunEvent: components["schemas"]["JournalMessage"] | components["schemas"]["ProcsMessage"] | components["schemas"]["PlanMessage"] | components["schemas"]["OutputsMessage"] | components["schemas"]["CursorMessage"] | components["schemas"]["PanelMessage"] | components["schemas"]["ReadyMessage"];
2064
+ /**
2065
+ * RunSummary
2066
+ * @description One run directory, as the run picker lists it.
2067
+ */
2068
+ RunSummary: {
2069
+ /** Run */
2070
+ run: string;
2071
+ /**
2072
+ * Run Group
2073
+ * @description the label grouping runs (`Run(run_group=)`); the run id when none was given
2074
+ */
2075
+ run_group: string;
2076
+ /**
2077
+ * Attempts
2078
+ * @description journal rows: finished task attempts
2079
+ */
2080
+ attempts: number;
2081
+ /**
2082
+ * Ok
2083
+ * @description journal rows that passed, not counting `partial` ones
2084
+ */
2085
+ ok: number;
2086
+ /**
2087
+ * Partial
2088
+ * @description journal rows with stop `partial`
2089
+ * @default 0
2090
+ */
2091
+ partial?: number;
2092
+ /**
2093
+ * Not Run
2094
+ * @description journal rows of tasks that never ran: refused for an input (`invalid_input`) or skipped
2095
+ * @default 0
2096
+ */
2097
+ not_run?: number;
2098
+ tasks: components["schemas"]["TaskCounts"];
2099
+ /**
2100
+ * Cost Usd
2101
+ * @description what the coding agents reported the run cost, in USD; null when none reported
2102
+ */
2103
+ cost_usd?: number | null;
2104
+ /** @description tokens of every attempt, summed */
2105
+ tokens: components["schemas"]["TokenUsage"];
2106
+ /**
2107
+ * Quota
2108
+ * @description per credential (account): the run's first and last utilization reading; highest weekly use first
2109
+ */
2110
+ quota?: components["schemas"]["AccountQuota"][];
2111
+ /**
2112
+ * Wall S
2113
+ * @description sum of the rows' wall time, rounded to seconds
2114
+ */
2115
+ wall_s: number;
2116
+ /**
2117
+ * Last Ts
2118
+ * @description ISO time of the last journal row, else the directory's mtime
2119
+ */
2120
+ last_ts: string;
2121
+ /**
2122
+ * Kinds
2123
+ * @description journal rows per task kind
2124
+ */
2125
+ kinds: {
2126
+ [key: string]: number;
2127
+ };
2128
+ /**
2129
+ * Running
2130
+ * @description the process that runs it is alive
2131
+ */
2132
+ running: boolean;
2133
+ /**
2134
+ * Unresponsive
2135
+ * @description its host last reported it alive and has stopped reporting (a hub only)
2136
+ * @default false
2137
+ */
2138
+ unresponsive?: boolean;
2139
+ /**
2140
+ * Host Id
2141
+ * @description the host that drives it; empty when its run.json does not say
2142
+ * @default
2143
+ */
2144
+ host_id?: string;
2145
+ /**
2146
+ * Run Uid
2147
+ * @description the id no other run has, on any host; empty when its run.json does not say
2148
+ * @default
2149
+ */
2150
+ run_uid?: string;
2151
+ /** Started At */
2152
+ started_at: string;
2153
+ /**
2154
+ * Stub
2155
+ * @description a stub run: the stub agent, or a replay's recordings, played its tasks (`Pipeline(stub=)`, `contraagent run --stub`)
2156
+ * @default false
2157
+ */
2158
+ stub?: boolean;
2159
+ /**
2160
+ * Replay
2161
+ * @description a replay: the directory of the recordings it played (`Pipeline(replay=)`), and with `record_missing` recorded into (then `stub` is false, and each played attempt's journal row says `replayed`); empty otherwise
2162
+ * @default
2163
+ */
2164
+ replay?: string;
2165
+ /**
2166
+ * Row Extras
2167
+ * @description the journal columns that are the pipeline's own (`Run(row_extras=)`), in the order they first appear
2168
+ */
2169
+ row_extras?: string[];
2170
+ };
2171
+ /**
2172
+ * SkippedHop
2173
+ * @description A hop of the failover chain an attempt passed over without a launch, because its
2174
+ * credential rested: its route label and model, and the rest.
2175
+ */
2176
+ SkippedHop: {
2177
+ /** Credential */
2178
+ credential: string;
2179
+ /**
2180
+ * Window
2181
+ * @default
2182
+ * @enum {string}
2183
+ */
2184
+ window?: "" | "five_hour" | "seven_day";
2185
+ /** Pct */
2186
+ pct?: number | null;
2187
+ /** Cap */
2188
+ cap?: number | null;
2189
+ /**
2190
+ * Rule
2191
+ * @default
2192
+ */
2193
+ rule?: string;
2194
+ /**
2195
+ * Until
2196
+ * @default
2197
+ */
2198
+ until?: string;
2199
+ /**
2200
+ * Account
2201
+ * @default
2202
+ */
2203
+ account?: string;
2204
+ /** Reading */
2205
+ reading?: {
2206
+ [key: string]: unknown;
2207
+ } | null;
2208
+ /**
2209
+ * Route
2210
+ * @default
2211
+ */
2212
+ route?: string;
2213
+ /**
2214
+ * Model
2215
+ * @default
2216
+ */
2217
+ model?: string;
2218
+ } & {
2219
+ [key: string]: unknown;
2220
+ };
2221
+ /**
2222
+ * StageEntry
2223
+ * @description One transition of the cursor (`HistoryEntry`), its time as `datetime.isoformat` gives it.
2224
+ */
2225
+ StageEntry: {
2226
+ /** Name */
2227
+ name: string;
2228
+ /** At */
2229
+ at: string;
2230
+ };
2231
+ /**
2232
+ * StatusGridBody
2233
+ * @description A state per row (`y`) and column (`x`): `cells[row][column]`, null where there is
2234
+ * none. Each cell is coloured by its tone and named by its label (in the legend, the
2235
+ * tooltip and the table): the states of hourly cycles by day, say.
2236
+ */
2237
+ StatusGridBody: {
2238
+ /**
2239
+ * Title
2240
+ * @description a heading over the body
2241
+ */
2242
+ title?: string | null;
2243
+ /**
2244
+ * Collapsed
2245
+ * @description shown folded, under its title
2246
+ * @default false
2247
+ */
2248
+ collapsed?: boolean;
2249
+ /**
2250
+ * Type
2251
+ * @default status_grid
2252
+ * @constant
2253
+ */
2254
+ type?: "status_grid";
2255
+ /** X */
2256
+ x: string[];
2257
+ /** Y */
2258
+ y: string[];
2259
+ /** Cells */
2260
+ cells: (components["schemas"]["GridCell"] | null)[][];
2261
+ };
2262
+ /**
2263
+ * StreamMessage
2264
+ * @description `/events/stream`: the first message is the transcript's tail page, then each
2265
+ * message carries only the events after the previous one.
2266
+ */
2267
+ StreamMessage: {
2268
+ /**
2269
+ * Event
2270
+ * @constant
2271
+ */
2272
+ event: "stream";
2273
+ data: components["schemas"]["StreamPage"];
2274
+ };
2275
+ /**
2276
+ * StreamPage
2277
+ * @description A page of one transcript. `total` is the file's line count: pass it back as
2278
+ * `since` for the next page. The first page (`since=0`) is the tail; `behind`
2279
+ * lines precede it, fetched by asking again with a smaller `since`.
2280
+ */
2281
+ StreamPage: {
2282
+ /** Events */
2283
+ events: (components["schemas"]["LaunchEvent"] | components["schemas"]["MessageUpdateEvent"] | components["schemas"]["ToolStartEvent"] | components["schemas"]["ToolEndEvent"] | components["schemas"]["ToolCallEchoEvent"] | components["schemas"]["ToolResultEchoEvent"] | components["schemas"]["MessageEvent"] | components["schemas"]["NoticeEvent"] | components["schemas"]["RetryEvent"] | components["schemas"]["OtherEvent"])[];
2284
+ /** Total */
2285
+ total: number;
2286
+ /** Behind */
2287
+ behind: number;
2288
+ };
2289
+ /**
2290
+ * Substitution
2291
+ * @description A kind with no route left, run on the first route that answered (`substitute`).
2292
+ */
2293
+ Substitution: {
2294
+ /** Kind */
2295
+ kind: string;
2296
+ /** From Agent */
2297
+ from_agent: string;
2298
+ /** From Model */
2299
+ from_model: string;
2300
+ /** To Agent */
2301
+ to_agent: string;
2302
+ /** To Model */
2303
+ to_model: string;
2304
+ };
2305
+ /**
2306
+ * TableBody
2307
+ * @description Rows of values, one key per column; a row's `_tone` is its status (a `Tone`).
2308
+ */
2309
+ TableBody: {
2310
+ /**
2311
+ * Title
2312
+ * @description a heading over the body
2313
+ */
2314
+ title?: string | null;
2315
+ /**
2316
+ * Collapsed
2317
+ * @description shown folded, under its title
2318
+ * @default false
2319
+ */
2320
+ collapsed?: boolean;
2321
+ /**
2322
+ * Type
2323
+ * @default table
2324
+ * @constant
2325
+ */
2326
+ type?: "table";
2327
+ /** Columns */
2328
+ columns: components["schemas"]["TableColumn"][];
2329
+ /** Rows */
2330
+ rows: {
2331
+ [key: string]: unknown;
2332
+ }[];
2333
+ };
2334
+ /**
2335
+ * TableColumn
2336
+ * @description A column of a table body: `id` names the key of each row it shows. `bar`: a bar in
2337
+ * the cell, as long as the value against the column's largest. `link`: the key of each
2338
+ * row that holds the URL the cell leads to (http or https; any other is no link).
2339
+ */
2340
+ TableColumn: {
2341
+ /** Id */
2342
+ id: string;
2343
+ /** Label */
2344
+ label: string;
2345
+ /** Align */
2346
+ align?: ("start" | "end") | null;
2347
+ /** Format */
2348
+ format?: ("usd" | "pct" | "duration" | "tokens" | "datetime" | "number") | null;
2349
+ /**
2350
+ * Bar
2351
+ * @default false
2352
+ */
2353
+ bar?: boolean;
2354
+ /**
2355
+ * Link
2356
+ * @description the key of the row that holds the cell's URL
2357
+ */
2358
+ link?: string | null;
2359
+ /** Tip */
2360
+ tip?: string | null;
2361
+ };
2362
+ /**
2363
+ * TaskCounts
2364
+ * @description A run's tasks (not attempts) by how they ended. `not_started`: refused for
2365
+ * an input, or waiting behind a task that failed; `running`: running now (in a
2366
+ * live run); `waiting`: queued in a live run; `not_run`: deferred, or queued in a
2367
+ * run that is no longer live (it will not run).
2368
+ */
2369
+ TaskCounts: {
2370
+ /** Total */
2371
+ total: number;
2372
+ /** Done */
2373
+ done: number;
2374
+ /**
2375
+ * Partial
2376
+ * @description tasks whose last result was `partial`: ok, the output a placeholder; not in `done`
2377
+ * @default 0
2378
+ */
2379
+ partial?: number;
2380
+ /** Failed */
2381
+ failed: number;
2382
+ /** Not Started */
2383
+ not_started: number;
2384
+ /**
2385
+ * Running
2386
+ * @default 0
2387
+ */
2388
+ running?: number;
2389
+ /** Waiting */
2390
+ waiting: number;
2391
+ /**
2392
+ * Not Run
2393
+ * @default 0
2394
+ */
2395
+ not_run?: number;
2396
+ /** Skipped */
2397
+ skipped: number;
2398
+ };
2399
+ /**
2400
+ * TaskDefinition
2401
+ * @description What defined one kind of task in this run (`definitions/<kind>.json`).
2402
+ * Beyond `kind`, the keys are the task adapter's choice; these are the ones
2403
+ * the bundled adapters write.
2404
+ */
2405
+ TaskDefinition: {
2406
+ /** Kind */
2407
+ kind: string;
2408
+ /** Role */
2409
+ role?: string | null;
2410
+ /** Plugin Dirs */
2411
+ plugin_dirs?: string[];
2412
+ /** Files */
2413
+ files?: components["schemas"]["DefinitionFile"][];
2414
+ /** Plugin */
2415
+ plugin?: boolean | null;
2416
+ /** Name */
2417
+ name?: string | null;
2418
+ /** Root */
2419
+ root?: string | null;
2420
+ /** Params */
2421
+ params?: string | null;
2422
+ /** Requires */
2423
+ requires?: string[];
2424
+ /** Output */
2425
+ output?: string | null;
2426
+ /**
2427
+ * Output From
2428
+ * @description agent task: `file`, the agent writes its output; `message`, its final message is the output
2429
+ */
2430
+ output_from?: ("file" | "message") | null;
2431
+ /** Validators */
2432
+ validators?: string[];
2433
+ /**
2434
+ * Preserve
2435
+ * @description agent task: JSON pointers to the parts of its output file it keeps (`agent_task(preserve=)`)
2436
+ */
2437
+ preserve?: string[];
2438
+ /**
2439
+ * Output Of
2440
+ * @description agent task: the kind whose output file it writes (`agent_task(output_of=)`)
2441
+ */
2442
+ output_of?: string | null;
2443
+ /**
2444
+ * Base Kind
2445
+ * @description agent task: an implementation kind's base kind (`agent_task(implementations=)`)
2446
+ */
2447
+ base_kind?: string | null;
2448
+ /**
2449
+ * Tools
2450
+ * @description agent task: `[]`, a light launch with no tools (`agent_task(tools=())`); null, the tools its role allows
2451
+ */
2452
+ tools?: string[] | null;
2453
+ /** Executor */
2454
+ executor?: ("agent" | "python") | null;
2455
+ /**
2456
+ * Function
2457
+ * @description Python task: `module.qualname` of its function
2458
+ */
2459
+ function?: string | null;
2460
+ /**
2461
+ * Signature
2462
+ * @description Python task: the function's signature
2463
+ */
2464
+ signature?: string | null;
2465
+ /**
2466
+ * Doc
2467
+ * @description Python task: the function's docstring
2468
+ */
2469
+ doc?: string | null;
2470
+ /**
2471
+ * File
2472
+ * @description Python task: the source file, relative to the run's working directory when inside it
2473
+ */
2474
+ file?: string | null;
2475
+ /**
2476
+ * Line
2477
+ * @description Python task: the function's first line in `file`
2478
+ */
2479
+ line?: number | null;
2480
+ /**
2481
+ * Retries
2482
+ * @description Python task: the fresh attempts after the first, each after an exception of `retry_on` (`@python_task(retries=)`)
2483
+ */
2484
+ retries?: number | null;
2485
+ /**
2486
+ * Retry On
2487
+ * @description Python task: the exception classes that give an attempt a fresh one
2488
+ */
2489
+ retry_on?: string[] | null;
2490
+ } & {
2491
+ [key: string]: unknown;
2492
+ };
2493
+ /**
2494
+ * TaskDetail
2495
+ * @description One task, by its key. Open: the `task_detail` callback merges its own keys
2496
+ * in (a failing one leaves `task_detail_error` instead).
2497
+ */
2498
+ TaskDetail: {
2499
+ /**
2500
+ * Key
2501
+ * @description the task key asked for
2502
+ */
2503
+ key: string;
2504
+ /** Rows */
2505
+ rows: components["schemas"]["JournalRow"][];
2506
+ /**
2507
+ * Launches
2508
+ * @description its launches running now; empty once it has finished (finished attempts are `rows`)
2509
+ */
2510
+ launches: components["schemas"]["TaskLaunch"][];
2511
+ definition: components["schemas"]["TaskDefinition"] | null;
2512
+ io: components["schemas"]["TaskIO"];
2513
+ /**
2514
+ * Stream
2515
+ * @description the transcript's task key for /stream and /events/stream, null when it has none
2516
+ */
2517
+ stream: string | null;
2518
+ /**
2519
+ * Row Extras
2520
+ * @description the columns of `rows` that are the pipeline's own (`Run(row_extras=)`), in the order they first appear
2521
+ */
2522
+ row_extras?: string[];
2523
+ /** Task Detail Error */
2524
+ task_detail_error?: string | null;
2525
+ } & {
2526
+ [key: string]: unknown;
2527
+ };
2528
+ /**
2529
+ * TaskIO
2530
+ * @description The task's params, what it reads and leaves behind, and its neighbours in the plan.
2531
+ */
2532
+ TaskIO: {
2533
+ /** Params */
2534
+ params: {
2535
+ [key: string]: unknown;
2536
+ };
2537
+ /** Inputs */
2538
+ inputs: components["schemas"]["ContractSpec"][];
2539
+ /** Outputs */
2540
+ outputs: components["schemas"]["ContractSpec"][];
2541
+ /**
2542
+ * Executor
2543
+ * @enum {string}
2544
+ */
2545
+ executor: "agent" | "python";
2546
+ /** Upstream */
2547
+ upstream: components["schemas"]["UpstreamTask"][];
2548
+ /** Downstream */
2549
+ downstream: components["schemas"]["DownstreamTask"][];
2550
+ };
2551
+ /**
2552
+ * TaskLaunch
2553
+ * @description A live launch of the task (a child process, or an in-process marker with empty plugin/model/role/cmd).
2554
+ */
2555
+ TaskLaunch: {
2556
+ /** Key */
2557
+ key: string | null;
2558
+ /** Kind */
2559
+ kind: string | null;
2560
+ /** Unit */
2561
+ unit: string | null;
2562
+ /** Pid */
2563
+ pid: number | null;
2564
+ /** Age S */
2565
+ age_s: number | null;
2566
+ /** Plugin */
2567
+ plugin: string | null;
2568
+ /** Model */
2569
+ model: string | null;
2570
+ /** Role */
2571
+ role: string | null;
2572
+ /**
2573
+ * Cmd
2574
+ * @description the full command line, cut at 600 characters
2575
+ */
2576
+ cmd: string;
2577
+ };
2578
+ /** TilesBody */
2579
+ TilesBody: {
2580
+ /**
2581
+ * Title
2582
+ * @description a heading over the body
2583
+ */
2584
+ title?: string | null;
2585
+ /**
2586
+ * Collapsed
2587
+ * @description shown folded, under its title
2588
+ * @default false
2589
+ */
2590
+ collapsed?: boolean;
2591
+ /**
2592
+ * Type
2593
+ * @default tiles
2594
+ * @constant
2595
+ */
2596
+ type?: "tiles";
2597
+ /** Tiles */
2598
+ tiles: components["schemas"]["PanelTile"][];
2599
+ };
2600
+ /**
2601
+ * TimeBoxRecord
2602
+ * @description A flow call's own deadline (`time_box`, `TimeBox`), as `flow_calls.jsonl` records it.
2603
+ */
2604
+ TimeBoxRecord: {
2605
+ /**
2606
+ * Started At
2607
+ * @description when the flow call started, where its deadline counts from (UTC ISO 8601)
2608
+ */
2609
+ started_at: string;
2610
+ /**
2611
+ * Deadline S
2612
+ * @description seconds from `started_at` to the deadline
2613
+ */
2614
+ deadline_s: number;
2615
+ /**
2616
+ * Grace S
2617
+ * @description seconds past the deadline its `finishing_kinds` still launch
2618
+ */
2619
+ grace_s: number;
2620
+ /**
2621
+ * Slack S
2622
+ * @description seconds before the deadline from which its tasks are ordered for it
2623
+ */
2624
+ slack_s: number;
2625
+ /**
2626
+ * Finishing Kinds
2627
+ * @description the kinds that still launch past the deadline
2628
+ * @default []
2629
+ */
2630
+ finishing_kinds?: string[];
2631
+ };
2632
+ /**
2633
+ * TokenUsage
2634
+ * @description Tokens summed over API calls: an attempt's (its rounds and hops, in `JournalRow.usage`)
2635
+ * or one hop's (`Hop.usage`).
2636
+ */
2637
+ TokenUsage: {
2638
+ /**
2639
+ * Input
2640
+ * @default 0
2641
+ */
2642
+ input?: number;
2643
+ /**
2644
+ * Output
2645
+ * @default 0
2646
+ */
2647
+ output?: number;
2648
+ /**
2649
+ * Cache Read
2650
+ * @default 0
2651
+ */
2652
+ cache_read?: number;
2653
+ /**
2654
+ * Cache Creation
2655
+ * @default 0
2656
+ */
2657
+ cache_creation?: number;
2658
+ /**
2659
+ * Calls
2660
+ * @default 0
2661
+ */
2662
+ calls?: number;
2663
+ /** Resident */
2664
+ resident?: number | null;
2665
+ /** Peak Context */
2666
+ peak_context?: number | null;
2667
+ /** Context Window */
2668
+ context_window?: number | null;
2669
+ } & {
2670
+ [key: string]: unknown;
2671
+ };
2672
+ /**
2673
+ * ToolCallEchoEvent
2674
+ * @description omp: a tool call carried on a message or turn (`acall`).
2675
+ */
2676
+ ToolCallEchoEvent: {
2677
+ /**
2678
+ * Type
2679
+ * @constant
2680
+ */
2681
+ type: "acall";
2682
+ /** Tool */
2683
+ tool: string | null;
2684
+ /** Cmd */
2685
+ cmd: string;
2686
+ /** Call */
2687
+ call: string;
2688
+ /** Intent */
2689
+ intent: string;
2690
+ /**
2691
+ * Web Query
2692
+ * @description the query, when the call is a web search
2693
+ */
2694
+ web_query?: string | null;
2695
+ /**
2696
+ * Web Fetch
2697
+ * @description the URL, when the call reads a web page
2698
+ */
2699
+ web_fetch?: string | null;
2700
+ } & {
2701
+ [key: string]: unknown;
2702
+ };
2703
+ /**
2704
+ * ToolEndEvent
2705
+ * @description A tool call's result. `tool` is empty for claude, which names only the call id.
2706
+ */
2707
+ ToolEndEvent: {
2708
+ /**
2709
+ * Type
2710
+ * @constant
2711
+ */
2712
+ type: "tool_execution_end";
2713
+ /** Tool */
2714
+ tool: string | null;
2715
+ /** Out */
2716
+ out: string;
2717
+ /** Err */
2718
+ err: boolean;
2719
+ /** Call */
2720
+ call: string;
2721
+ } & {
2722
+ [key: string]: unknown;
2723
+ };
2724
+ /**
2725
+ * ToolResultEchoEvent
2726
+ * @description omp: a tool result carried as a `toolResult` message (`aresult`).
2727
+ */
2728
+ ToolResultEchoEvent: {
2729
+ /**
2730
+ * Type
2731
+ * @constant
2732
+ */
2733
+ type: "aresult";
2734
+ /** Tool */
2735
+ tool: string | null;
2736
+ /** Call */
2737
+ call: string;
2738
+ /** Out */
2739
+ out: string;
2740
+ /** Err */
2741
+ err: boolean;
2742
+ } & {
2743
+ [key: string]: unknown;
2744
+ };
2745
+ /**
2746
+ * ToolStartEvent
2747
+ * @description A tool call starting (or omp's progress update for it). `call` pairs it with its end event.
2748
+ */
2749
+ ToolStartEvent: {
2750
+ /**
2751
+ * Type
2752
+ * @enum {string}
2753
+ */
2754
+ type: "tool_execution_start" | "tool_execution_update";
2755
+ /** Tool */
2756
+ tool: string | null;
2757
+ /**
2758
+ * Cmd
2759
+ * @description a one-line preview: the command, pattern, path, URL or query
2760
+ */
2761
+ cmd: string;
2762
+ /** Intent */
2763
+ intent: string;
2764
+ /** Call */
2765
+ call: string;
2766
+ /**
2767
+ * Web Query
2768
+ * @description the query, when the call is a web search
2769
+ */
2770
+ web_query?: string | null;
2771
+ /**
2772
+ * Web Fetch
2773
+ * @description the URL, when the call reads a web page
2774
+ */
2775
+ web_fetch?: string | null;
2776
+ } & {
2777
+ [key: string]: unknown;
2778
+ };
2779
+ /**
2780
+ * TrendDay
2781
+ * @description One day: its attempts (by when they ended), and its cost per group (`Monitor(groups=)`; a kind in none is its own).
2782
+ */
2783
+ TrendDay: {
2784
+ /** Day */
2785
+ day: string;
2786
+ /**
2787
+ * Cost Usd
2788
+ * @description group -> cost, USD; a group with no cost reported is absent
2789
+ */
2790
+ cost_usd: {
2791
+ [key: string]: number;
2792
+ };
2793
+ /** Attempts */
2794
+ attempts: number;
2795
+ /**
2796
+ * Ok
2797
+ * @description attempts that passed, not counting `partial` ones
2798
+ */
2799
+ ok: number;
2800
+ /**
2801
+ * Partial
2802
+ * @description attempts with stop `partial`: ok, counted apart from `ok`
2803
+ * @default 0
2804
+ */
2805
+ partial?: number;
2806
+ };
2807
+ /**
2808
+ * TrendDeferral
2809
+ * @description A deferred task (`deferred.jsonl`), with its run; `cause` is `DeferralCause.cause`.
2810
+ */
2811
+ TrendDeferral: {
2812
+ /** Run */
2813
+ run: string;
2814
+ /** Ts */
2815
+ ts: string;
2816
+ /** Key */
2817
+ key: string;
2818
+ /** Kind */
2819
+ kind: string;
2820
+ /** Cause */
2821
+ cause: string;
2822
+ /** Reason */
2823
+ reason: string;
2824
+ };
2825
+ /**
2826
+ * TrendDenial
2827
+ * @description Tool calls the coding agent's permissions refused, of one tool (`launches.jsonl` `denied`).
2828
+ */
2829
+ TrendDenial: {
2830
+ /** Tool */
2831
+ tool: string;
2832
+ /** Count */
2833
+ count: number;
2834
+ /** Kinds */
2835
+ kinds: {
2836
+ [key: string]: number;
2837
+ };
2838
+ };
2839
+ /**
2840
+ * TrendKind
2841
+ * @description One kind over the period. A task is one key of one run; its last attempt in the period says how it ended.
2842
+ */
2843
+ TrendKind: {
2844
+ /** Kind */
2845
+ kind: string;
2846
+ /** Group */
2847
+ group: string;
2848
+ /**
2849
+ * Executor
2850
+ * @enum {string}
2851
+ */
2852
+ executor: "agent" | "python";
2853
+ /** Tasks */
2854
+ tasks: number;
2855
+ /**
2856
+ * Tasks Ok
2857
+ * @description tasks whose last attempt passed, not counting `partial` ones
2858
+ */
2859
+ tasks_ok: number;
2860
+ /**
2861
+ * Tasks Partial
2862
+ * @description tasks whose last attempt was `partial`
2863
+ * @default 0
2864
+ */
2865
+ tasks_partial?: number;
2866
+ /** Attempts */
2867
+ attempts: number;
2868
+ /**
2869
+ * Ok
2870
+ * @description attempts that passed, not counting `partial` ones
2871
+ */
2872
+ ok: number;
2873
+ /**
2874
+ * Partial
2875
+ * @description attempts with stop `partial`: ok, counted apart from `ok`
2876
+ * @default 0
2877
+ */
2878
+ partial?: number;
2879
+ /**
2880
+ * Wall S
2881
+ * @description every attempt's wall time, summed
2882
+ */
2883
+ wall_s: number;
2884
+ /**
2885
+ * Wall S Median
2886
+ * @description the median attempt's wall time
2887
+ */
2888
+ wall_s_median: number;
2889
+ /** Cost Usd */
2890
+ cost_usd: number | null;
2891
+ tokens: components["schemas"]["TokenUsage"];
2892
+ };
2893
+ /**
2894
+ * TrendPeriod
2895
+ * @description The period: days `from`..`to`, both included, in the time zone `tz` (an IANA name).
2896
+ */
2897
+ TrendPeriod: {
2898
+ /**
2899
+ * From
2900
+ * @description the first day, YYYY-MM-DD
2901
+ */
2902
+ from: string;
2903
+ /**
2904
+ * To
2905
+ * @description the last day, YYYY-MM-DD
2906
+ */
2907
+ to: string;
2908
+ /** Tz */
2909
+ tz: string;
2910
+ /**
2911
+ * Days
2912
+ * @description every day of the period, in order
2913
+ */
2914
+ days: string[];
2915
+ };
2916
+ /**
2917
+ * TrendQuota
2918
+ * @description One account's utilization of one window over the period: each day's and each hour's highest reading.
2919
+ * A credential whose token was replaced has one entry per account.
2920
+ */
2921
+ TrendQuota: {
2922
+ /** Credential */
2923
+ credential: string;
2924
+ /**
2925
+ * Account
2926
+ * @description the account the readings are of (`QuotaReading.account`); empty when not known
2927
+ * @default
2928
+ */
2929
+ account?: string;
2930
+ /**
2931
+ * Window
2932
+ * @description `five_hour`, `seven_day`, or another window a reading names (`seven_day_opus`)
2933
+ */
2934
+ window: string;
2935
+ /**
2936
+ * Daily Peak
2937
+ * @description per day of `period.days`; null when no reading arrived that day
2938
+ */
2939
+ daily_peak: (number | null)[];
2940
+ /**
2941
+ * Hourly Peak
2942
+ * @description per hour from the period's first instant (the first day's midnight in `tz`); null when no reading arrived in it
2943
+ */
2944
+ hourly_peak: (number | null)[];
2945
+ };
2946
+ /**
2947
+ * TrendRest
2948
+ * @description A start or end of a credential's rest (a `rests.jsonl` row), with its run.
2949
+ */
2950
+ TrendRest: {
2951
+ /** Credential */
2952
+ credential: string;
2953
+ /**
2954
+ * Window
2955
+ * @default
2956
+ * @enum {string}
2957
+ */
2958
+ window?: "" | "five_hour" | "seven_day";
2959
+ /** Pct */
2960
+ pct?: number | null;
2961
+ /** Cap */
2962
+ cap?: number | null;
2963
+ /**
2964
+ * Rule
2965
+ * @default
2966
+ */
2967
+ rule?: string;
2968
+ /**
2969
+ * Until
2970
+ * @default
2971
+ */
2972
+ until?: string;
2973
+ /**
2974
+ * Account
2975
+ * @default
2976
+ */
2977
+ account?: string;
2978
+ /** Reading */
2979
+ reading?: {
2980
+ [key: string]: unknown;
2981
+ } | null;
2982
+ /** Ts */
2983
+ ts: string;
2984
+ /**
2985
+ * Event
2986
+ * @enum {string}
2987
+ */
2988
+ event: "start" | "end";
2989
+ /** Run */
2990
+ run: string;
2991
+ } & {
2992
+ [key: string]: unknown;
2993
+ };
2994
+ /**
2995
+ * TrendRun
2996
+ * @description One run of the period: its attempts in the period.
2997
+ */
2998
+ TrendRun: {
2999
+ /** Run */
3000
+ run: string;
3001
+ /** Run Group */
3002
+ run_group: string;
3003
+ /** Host Id */
3004
+ host_id: string;
3005
+ /** Started At */
3006
+ started_at: string;
3007
+ /** Finished At */
3008
+ finished_at: string;
3009
+ /**
3010
+ * Last Ts
3011
+ * @description when its last attempt in the period ended; empty when it has none
3012
+ */
3013
+ last_ts: string;
3014
+ /** Attempts */
3015
+ attempts: number;
3016
+ /**
3017
+ * Ok
3018
+ * @description attempts that passed, not counting `partial` ones
3019
+ */
3020
+ ok: number;
3021
+ /**
3022
+ * Partial
3023
+ * @description attempts with stop `partial`: ok, counted apart from `ok`
3024
+ * @default 0
3025
+ */
3026
+ partial?: number;
3027
+ /** Cost Usd */
3028
+ cost_usd: number | null;
3029
+ /** Wall S */
3030
+ wall_s: number;
3031
+ /** Stub */
3032
+ stub: boolean;
3033
+ };
3034
+ /**
3035
+ * TrendStarts
3036
+ * @description Run starts by weekday (`weekdays`, Monday first) and hour (`hours`) in the period's time zone: `counts[weekday][hour]`.
3037
+ */
3038
+ TrendStarts: {
3039
+ /** Weekdays */
3040
+ weekdays: string[];
3041
+ /** Hours */
3042
+ hours: number[];
3043
+ /** Counts */
3044
+ counts: number[][];
3045
+ };
3046
+ /**
3047
+ * TrendStop
3048
+ * @description Attempts that ended on one `stop`, and by which kinds.
3049
+ */
3050
+ TrendStop: {
3051
+ /** Stop */
3052
+ stop: string;
3053
+ /** Attempts */
3054
+ attempts: number;
3055
+ /** Kinds */
3056
+ kinds: {
3057
+ [key: string]: number;
3058
+ };
3059
+ };
3060
+ /**
3061
+ * TrendTotals
3062
+ * @description The period's runs and attempts, summed.
3063
+ */
3064
+ TrendTotals: {
3065
+ /**
3066
+ * Runs
3067
+ * @description runs with an attempt in the period, or started in it
3068
+ */
3069
+ runs: number;
3070
+ /** Attempts */
3071
+ attempts: number;
3072
+ /**
3073
+ * Ok
3074
+ * @description attempts that passed, not counting `partial` ones
3075
+ */
3076
+ ok: number;
3077
+ /**
3078
+ * Partial
3079
+ * @description attempts with stop `partial`: ok, counted apart from `ok`
3080
+ * @default 0
3081
+ */
3082
+ partial?: number;
3083
+ /**
3084
+ * Cost Usd
3085
+ * @description what the coding agents reported; null when no attempt reported a cost
3086
+ */
3087
+ cost_usd: number | null;
3088
+ /** Wall S */
3089
+ wall_s: number;
3090
+ tokens: components["schemas"]["TokenUsage"];
3091
+ };
3092
+ /**
3093
+ * Trends
3094
+ * @description What the runs of a period add up to (`Monitor.trends`). `bodies`: the same numbers as
3095
+ * panel bodies (`{"type": "blocks", ...}`), in English, for a page with no words of its own;
3096
+ * `panels`: the trend panels a domain registered (`Panel(scope="trends")`).
3097
+ */
3098
+ Trends: {
3099
+ period: components["schemas"]["TrendPeriod"];
3100
+ totals: components["schemas"]["TrendTotals"];
3101
+ /** Daily */
3102
+ daily: components["schemas"]["TrendDay"][];
3103
+ /** Kinds */
3104
+ kinds: components["schemas"]["TrendKind"][];
3105
+ /** Models */
3106
+ models: components["schemas"]["ModelUsage"][];
3107
+ /** Stops */
3108
+ stops: components["schemas"]["TrendStop"][];
3109
+ /** Denials */
3110
+ denials: components["schemas"]["TrendDenial"][];
3111
+ /** Quota */
3112
+ quota: components["schemas"]["TrendQuota"][];
3113
+ /** Rests */
3114
+ rests: components["schemas"]["TrendRest"][];
3115
+ /** Deferred */
3116
+ deferred: components["schemas"]["TrendDeferral"][];
3117
+ /** Deferred Causes */
3118
+ deferred_causes: {
3119
+ [key: string]: number;
3120
+ };
3121
+ /** Runs */
3122
+ runs: components["schemas"]["TrendRun"][];
3123
+ starts: components["schemas"]["TrendStarts"];
3124
+ /** Bodies */
3125
+ bodies: {
3126
+ [key: string]: {
3127
+ [key: string]: unknown;
3128
+ };
3129
+ };
3130
+ /** Panels */
3131
+ panels: components["schemas"]["PanelInfo"][];
3132
+ };
3133
+ /**
3134
+ * UnitPosition
3135
+ * @description One unit's place in the per-unit step sequence; `inflight` are the work
3136
+ * items dispatched but not yet recorded.
3137
+ */
3138
+ UnitPosition: {
3139
+ /** Stage */
3140
+ stage: string | null;
3141
+ /** Step */
3142
+ step: string | null;
3143
+ /** Completed */
3144
+ completed: string[];
3145
+ /** Loop Pass */
3146
+ loop_pass: number;
3147
+ /** Inflight */
3148
+ inflight: string[];
3149
+ };
3150
+ /** UpstreamTask */
3151
+ UpstreamTask: {
3152
+ /** Key */
3153
+ key: string;
3154
+ /** Kind */
3155
+ kind: string;
3156
+ /** Unit */
3157
+ unit: string;
3158
+ /**
3159
+ * Executor
3160
+ * @enum {string}
3161
+ */
3162
+ executor: "agent" | "python";
3163
+ /** Outputs */
3164
+ outputs: components["schemas"]["ContractSpec"][];
3165
+ };
3166
+ /** ValidationError */
3167
+ ValidationError: {
3168
+ /** Location */
3169
+ loc: (string | number)[];
3170
+ /** Message */
3171
+ msg: string;
3172
+ /** Error Type */
3173
+ type: string;
3174
+ /** Input */
3175
+ input?: unknown;
3176
+ /** Context */
3177
+ ctx?: Record<string, never>;
3178
+ };
3179
+ };
3180
+ responses: never;
3181
+ parameters: never;
3182
+ requestBodies: never;
3183
+ headers: never;
3184
+ pathItems: never;
3185
+ };
3186
+ export type $defs = Record<string, never>;
3187
+ export interface operations {
3188
+ api_info_api_info_get: {
3189
+ parameters: {
3190
+ query?: never;
3191
+ header?: never;
3192
+ path?: never;
3193
+ cookie?: never;
3194
+ };
3195
+ requestBody?: never;
3196
+ responses: {
3197
+ /** @description Successful Response */
3198
+ 200: {
3199
+ headers: {
3200
+ [name: string]: unknown;
3201
+ };
3202
+ content: {
3203
+ "application/json": components["schemas"]["Info"];
3204
+ };
3205
+ };
3206
+ };
3207
+ };
3208
+ api_runs_api_runs_get: {
3209
+ parameters: {
3210
+ query?: never;
3211
+ header?: never;
3212
+ path?: never;
3213
+ cookie?: never;
3214
+ };
3215
+ requestBody?: never;
3216
+ responses: {
3217
+ /** @description Successful Response */
3218
+ 200: {
3219
+ headers: {
3220
+ [name: string]: unknown;
3221
+ };
3222
+ content: {
3223
+ "application/json": components["schemas"]["RunSummary"][];
3224
+ };
3225
+ };
3226
+ };
3227
+ };
3228
+ api_hosts_api_hosts_get: {
3229
+ parameters: {
3230
+ query?: never;
3231
+ header?: never;
3232
+ path?: never;
3233
+ cookie?: never;
3234
+ };
3235
+ requestBody?: never;
3236
+ responses: {
3237
+ /** @description Successful Response */
3238
+ 200: {
3239
+ headers: {
3240
+ [name: string]: unknown;
3241
+ };
3242
+ content: {
3243
+ "application/json": components["schemas"]["Hosts"];
3244
+ };
3245
+ };
3246
+ };
3247
+ };
3248
+ api_trends_api_trends_get: {
3249
+ parameters: {
3250
+ query?: {
3251
+ /** @description the first day, YYYY-MM-DD (default: 13 days before `to`) */
3252
+ from?: string;
3253
+ /** @description the last day, YYYY-MM-DD (default: today in `tz`) */
3254
+ to?: string;
3255
+ /** @description the time zone the days are in, an IANA name (default UTC) */
3256
+ tz?: string;
3257
+ /** @description only the runs of this run group */
3258
+ run_group?: string;
3259
+ /** @description count stub runs too */
3260
+ stub?: boolean;
3261
+ };
3262
+ header?: never;
3263
+ path?: never;
3264
+ cookie?: never;
3265
+ };
3266
+ requestBody?: never;
3267
+ responses: {
3268
+ /** @description Successful Response */
3269
+ 200: {
3270
+ headers: {
3271
+ [name: string]: unknown;
3272
+ };
3273
+ content: {
3274
+ "application/json": components["schemas"]["Trends"];
3275
+ };
3276
+ };
3277
+ /** @description a period it cannot read */
3278
+ 400: {
3279
+ headers: {
3280
+ [name: string]: unknown;
3281
+ };
3282
+ content?: never;
3283
+ };
3284
+ /** @description Validation Error */
3285
+ 422: {
3286
+ headers: {
3287
+ [name: string]: unknown;
3288
+ };
3289
+ content: {
3290
+ "application/json": components["schemas"]["HTTPValidationError"];
3291
+ };
3292
+ };
3293
+ };
3294
+ };
3295
+ api_trend_panel_api_trends_panels__name__get: {
3296
+ parameters: {
3297
+ query?: {
3298
+ from?: string;
3299
+ to?: string;
3300
+ tz?: string;
3301
+ run_group?: string;
3302
+ };
3303
+ header?: never;
3304
+ path: {
3305
+ name: string;
3306
+ };
3307
+ cookie?: never;
3308
+ };
3309
+ requestBody?: never;
3310
+ responses: {
3311
+ /** @description Successful Response */
3312
+ 200: {
3313
+ headers: {
3314
+ [name: string]: unknown;
3315
+ };
3316
+ content: {
3317
+ "application/json": components["schemas"]["TilesBody"] | components["schemas"]["TableBody"] | components["schemas"]["ColumnsBody"] | components["schemas"]["LinesBody"] | components["schemas"]["HeatmapBody"] | components["schemas"]["HBarsBody"] | components["schemas"]["StatusGridBody"] | components["schemas"]["NoteBody"] | components["schemas"]["BlocksBody"] | {
3318
+ [key: string]: unknown;
3319
+ };
3320
+ };
3321
+ };
3322
+ /** @description a period it cannot read */
3323
+ 400: {
3324
+ headers: {
3325
+ [name: string]: unknown;
3326
+ };
3327
+ content?: never;
3328
+ };
3329
+ /** @description no trend panel of that name */
3330
+ 404: {
3331
+ headers: {
3332
+ [name: string]: unknown;
3333
+ };
3334
+ content?: never;
3335
+ };
3336
+ /** @description Validation Error */
3337
+ 422: {
3338
+ headers: {
3339
+ [name: string]: unknown;
3340
+ };
3341
+ content: {
3342
+ "application/json": components["schemas"]["HTTPValidationError"];
3343
+ };
3344
+ };
3345
+ };
3346
+ };
3347
+ api_journal_api_runs__run__journal_get: {
3348
+ parameters: {
3349
+ query?: {
3350
+ since?: number;
3351
+ };
3352
+ header?: never;
3353
+ path: {
3354
+ run: string;
3355
+ };
3356
+ cookie?: never;
3357
+ };
3358
+ requestBody?: never;
3359
+ responses: {
3360
+ /** @description Successful Response */
3361
+ 200: {
3362
+ headers: {
3363
+ [name: string]: unknown;
3364
+ };
3365
+ content: {
3366
+ "application/json": components["schemas"]["JournalPage"];
3367
+ };
3368
+ };
3369
+ /** @description Validation Error */
3370
+ 422: {
3371
+ headers: {
3372
+ [name: string]: unknown;
3373
+ };
3374
+ content: {
3375
+ "application/json": components["schemas"]["HTTPValidationError"];
3376
+ };
3377
+ };
3378
+ };
3379
+ };
3380
+ api_plan_api_runs__run__plan_get: {
3381
+ parameters: {
3382
+ query?: never;
3383
+ header?: never;
3384
+ path: {
3385
+ run: string;
3386
+ };
3387
+ cookie?: never;
3388
+ };
3389
+ requestBody?: never;
3390
+ responses: {
3391
+ /** @description Successful Response */
3392
+ 200: {
3393
+ headers: {
3394
+ [name: string]: unknown;
3395
+ };
3396
+ content: {
3397
+ "application/json": components["schemas"]["Plan"];
3398
+ };
3399
+ };
3400
+ /** @description Validation Error */
3401
+ 422: {
3402
+ headers: {
3403
+ [name: string]: unknown;
3404
+ };
3405
+ content: {
3406
+ "application/json": components["schemas"]["HTTPValidationError"];
3407
+ };
3408
+ };
3409
+ };
3410
+ };
3411
+ api_outputs_api_runs__run__outputs_get: {
3412
+ parameters: {
3413
+ query?: never;
3414
+ header?: never;
3415
+ path: {
3416
+ run: string;
3417
+ };
3418
+ cookie?: never;
3419
+ };
3420
+ requestBody?: never;
3421
+ responses: {
3422
+ /** @description Successful Response */
3423
+ 200: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["Outputs"];
3429
+ };
3430
+ };
3431
+ /** @description Validation Error */
3432
+ 422: {
3433
+ headers: {
3434
+ [name: string]: unknown;
3435
+ };
3436
+ content: {
3437
+ "application/json": components["schemas"]["HTTPValidationError"];
3438
+ };
3439
+ };
3440
+ };
3441
+ };
3442
+ api_definitions_api_runs__run__definitions_get: {
3443
+ parameters: {
3444
+ query?: never;
3445
+ header?: never;
3446
+ path: {
3447
+ run: string;
3448
+ };
3449
+ cookie?: never;
3450
+ };
3451
+ requestBody?: never;
3452
+ responses: {
3453
+ /** @description Successful Response */
3454
+ 200: {
3455
+ headers: {
3456
+ [name: string]: unknown;
3457
+ };
3458
+ content: {
3459
+ "application/json": components["schemas"]["TaskDefinition"][];
3460
+ };
3461
+ };
3462
+ /** @description Validation Error */
3463
+ 422: {
3464
+ headers: {
3465
+ [name: string]: unknown;
3466
+ };
3467
+ content: {
3468
+ "application/json": components["schemas"]["HTTPValidationError"];
3469
+ };
3470
+ };
3471
+ };
3472
+ };
3473
+ api_cursor_api_runs__run__cursor_get: {
3474
+ parameters: {
3475
+ query?: never;
3476
+ header?: never;
3477
+ path: {
3478
+ run: string;
3479
+ };
3480
+ cookie?: never;
3481
+ };
3482
+ requestBody?: never;
3483
+ responses: {
3484
+ /** @description Successful Response */
3485
+ 200: {
3486
+ headers: {
3487
+ [name: string]: unknown;
3488
+ };
3489
+ content: {
3490
+ "application/json": components["schemas"]["CursorView"];
3491
+ };
3492
+ };
3493
+ /** @description Validation Error */
3494
+ 422: {
3495
+ headers: {
3496
+ [name: string]: unknown;
3497
+ };
3498
+ content: {
3499
+ "application/json": components["schemas"]["HTTPValidationError"];
3500
+ };
3501
+ };
3502
+ };
3503
+ };
3504
+ api_procs_api_runs__run__procs_get: {
3505
+ parameters: {
3506
+ query?: never;
3507
+ header?: never;
3508
+ path: {
3509
+ run: string;
3510
+ };
3511
+ cookie?: never;
3512
+ };
3513
+ requestBody?: never;
3514
+ responses: {
3515
+ /** @description Successful Response */
3516
+ 200: {
3517
+ headers: {
3518
+ [name: string]: unknown;
3519
+ };
3520
+ content: {
3521
+ "application/json": components["schemas"]["Procs"];
3522
+ };
3523
+ };
3524
+ /** @description Validation Error */
3525
+ 422: {
3526
+ headers: {
3527
+ [name: string]: unknown;
3528
+ };
3529
+ content: {
3530
+ "application/json": components["schemas"]["HTTPValidationError"];
3531
+ };
3532
+ };
3533
+ };
3534
+ };
3535
+ api_task_api_runs__run__task__key__get: {
3536
+ parameters: {
3537
+ query?: never;
3538
+ header?: never;
3539
+ path: {
3540
+ run: string;
3541
+ key: string;
3542
+ };
3543
+ cookie?: never;
3544
+ };
3545
+ requestBody?: never;
3546
+ responses: {
3547
+ /** @description Successful Response */
3548
+ 200: {
3549
+ headers: {
3550
+ [name: string]: unknown;
3551
+ };
3552
+ content: {
3553
+ "application/json": components["schemas"]["TaskDetail"];
3554
+ };
3555
+ };
3556
+ /** @description Validation Error */
3557
+ 422: {
3558
+ headers: {
3559
+ [name: string]: unknown;
3560
+ };
3561
+ content: {
3562
+ "application/json": components["schemas"]["HTTPValidationError"];
3563
+ };
3564
+ };
3565
+ };
3566
+ };
3567
+ api_stream_api_runs__run__stream__key__get: {
3568
+ parameters: {
3569
+ query?: {
3570
+ since?: number;
3571
+ };
3572
+ header?: never;
3573
+ path: {
3574
+ run: string;
3575
+ key: string;
3576
+ };
3577
+ cookie?: never;
3578
+ };
3579
+ requestBody?: never;
3580
+ responses: {
3581
+ /** @description Successful Response */
3582
+ 200: {
3583
+ headers: {
3584
+ [name: string]: unknown;
3585
+ };
3586
+ content: {
3587
+ "application/json": components["schemas"]["StreamPage"];
3588
+ };
3589
+ };
3590
+ /** @description Validation Error */
3591
+ 422: {
3592
+ headers: {
3593
+ [name: string]: unknown;
3594
+ };
3595
+ content: {
3596
+ "application/json": components["schemas"]["HTTPValidationError"];
3597
+ };
3598
+ };
3599
+ };
3600
+ };
3601
+ api_panel_api_runs__run__panels__name__get: {
3602
+ parameters: {
3603
+ query?: never;
3604
+ header?: never;
3605
+ path: {
3606
+ run: string;
3607
+ name: string;
3608
+ };
3609
+ cookie?: never;
3610
+ };
3611
+ requestBody?: never;
3612
+ responses: {
3613
+ /** @description Successful Response */
3614
+ 200: {
3615
+ headers: {
3616
+ [name: string]: unknown;
3617
+ };
3618
+ content: {
3619
+ "application/json": components["schemas"]["TilesBody"] | components["schemas"]["TableBody"] | components["schemas"]["ColumnsBody"] | components["schemas"]["LinesBody"] | components["schemas"]["HeatmapBody"] | components["schemas"]["HBarsBody"] | components["schemas"]["StatusGridBody"] | components["schemas"]["NoteBody"] | components["schemas"]["BlocksBody"] | {
3620
+ [key: string]: unknown;
3621
+ };
3622
+ };
3623
+ };
3624
+ /** @description no run panel of that name */
3625
+ 404: {
3626
+ headers: {
3627
+ [name: string]: unknown;
3628
+ };
3629
+ content?: never;
3630
+ };
3631
+ /** @description Validation Error */
3632
+ 422: {
3633
+ headers: {
3634
+ [name: string]: unknown;
3635
+ };
3636
+ content: {
3637
+ "application/json": components["schemas"]["HTTPValidationError"];
3638
+ };
3639
+ };
3640
+ };
3641
+ };
3642
+ events_events_get: {
3643
+ parameters: {
3644
+ query: {
3645
+ run: string;
3646
+ };
3647
+ header?: never;
3648
+ path?: never;
3649
+ cookie?: never;
3650
+ };
3651
+ requestBody?: never;
3652
+ responses: {
3653
+ /** @description Server-Sent Events; each message is one `RunEvent` */
3654
+ 200: {
3655
+ headers: {
3656
+ [name: string]: unknown;
3657
+ };
3658
+ content: {
3659
+ "text/event-stream": components["schemas"]["RunEvent"];
3660
+ };
3661
+ };
3662
+ /** @description not a plain run id */
3663
+ 404: {
3664
+ headers: {
3665
+ [name: string]: unknown;
3666
+ };
3667
+ content?: never;
3668
+ };
3669
+ /** @description Validation Error */
3670
+ 422: {
3671
+ headers: {
3672
+ [name: string]: unknown;
3673
+ };
3674
+ content: {
3675
+ "application/json": components["schemas"]["HTTPValidationError"];
3676
+ };
3677
+ };
3678
+ };
3679
+ };
3680
+ events_stream_events_stream_get: {
3681
+ parameters: {
3682
+ query: {
3683
+ run: string;
3684
+ key: string;
3685
+ };
3686
+ header?: never;
3687
+ path?: never;
3688
+ cookie?: never;
3689
+ };
3690
+ requestBody?: never;
3691
+ responses: {
3692
+ /** @description Server-Sent Events; each message is one `StreamMessage` */
3693
+ 200: {
3694
+ headers: {
3695
+ [name: string]: unknown;
3696
+ };
3697
+ content: {
3698
+ "text/event-stream": components["schemas"]["StreamMessage"];
3699
+ };
3700
+ };
3701
+ /** @description not a plain run id or task key */
3702
+ 404: {
3703
+ headers: {
3704
+ [name: string]: unknown;
3705
+ };
3706
+ content?: never;
3707
+ };
3708
+ /** @description Validation Error */
3709
+ 422: {
3710
+ headers: {
3711
+ [name: string]: unknown;
3712
+ };
3713
+ content: {
3714
+ "application/json": components["schemas"]["HTTPValidationError"];
3715
+ };
3716
+ };
3717
+ };
3718
+ };
3719
+ }