@oneharness/sdk 0.6.5 → 0.6.7

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.
@@ -3,8 +3,35 @@
3
3
  * JSONL line per harness run, appended as the run finalizes. Carries only the
4
4
  * normalized cross-harness signals — no raw stdout/stderr.
5
5
  */
6
- export type HistoryRecord = {
6
+ export type HistoryRecord = ({
7
+ error?: null | undefined;
8
+ [k: string]: unknown;
9
+ } | ({
10
+ error: string;
11
+ schema_version?: "1.3" | undefined;
12
+ [k: string]: unknown;
13
+ } & ({
14
+ status?: "nonzero" | "timeout" | "spawn-error" | "skipped" | undefined;
15
+ [k: string]: unknown;
16
+ } | {
17
+ failure_kind: "tool_deferred";
18
+ [k: string]: unknown;
19
+ }))) & ({
7
20
  duration_ms: number;
21
+ /**
22
+ * Best-effort normalized failure text for a run that did not succeed: the
23
+ * harness's own diagnostic as oneharness captured it on stderr, or
24
+ * oneharness's own message when it generated one (a spawn failure, a
25
+ * timeout, a binary that is not installed). This is the *only* place a
26
+ * record quotes the process's own bytes, and it is deliberately narrow —
27
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
28
+ * that failed. `failure_kind` says what class of failure it was; this says
29
+ * what the harness actually reported, which is what an operator reads when
30
+ * the class is unclassified. Never derived from stdout, so it can never
31
+ * stand in for provider output the run did not produce. Omitted on the wire
32
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
33
+ */
34
+ error?: string | null | undefined;
8
35
  /**
9
36
  * Best-effort normalized tool-call events; `null` when the harness exposes
10
37
  * no machine-readable trace.
@@ -84,7 +111,7 @@ export type HistoryRecord = {
84
111
  * run's single prompt).
85
112
  */
86
113
  prompt: string;
87
- schema_version: "1.2";
114
+ schema_version: "1.2" | "1.3";
88
115
  /**
89
116
  * The oneharness session id this run belongs to (the history file's stem).
90
117
  */
@@ -114,6 +141,20 @@ export type HistoryRecord = {
114
141
  [k: string]: unknown;
115
142
  } | {
116
143
  duration_ms: number;
144
+ /**
145
+ * Best-effort normalized failure text for a run that did not succeed: the
146
+ * harness's own diagnostic as oneharness captured it on stderr, or
147
+ * oneharness's own message when it generated one (a spawn failure, a
148
+ * timeout, a binary that is not installed). This is the *only* place a
149
+ * record quotes the process's own bytes, and it is deliberately narrow —
150
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
151
+ * that failed. `failure_kind` says what class of failure it was; this says
152
+ * what the harness actually reported, which is what an operator reads when
153
+ * the class is unclassified. Never derived from stdout, so it can never
154
+ * stand in for provider output the run did not produce. Omitted on the wire
155
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
156
+ */
157
+ error?: string | null | undefined;
117
158
  /**
118
159
  * Best-effort normalized tool-call events; `null` when the harness exposes
119
160
  * no machine-readable trace.
@@ -196,7 +237,7 @@ export type HistoryRecord = {
196
237
  * run's single prompt).
197
238
  */
198
239
  prompt: string;
199
- schema_version: "1.1";
240
+ schema_version: "1.0" | "1.1";
200
241
  /**
201
242
  * The oneharness session id this run belongs to (the history file's stem).
202
243
  */
@@ -225,58 +266,50 @@ export type HistoryRecord = {
225
266
  variant?: string | null | undefined;
226
267
  [k: string]: unknown;
227
268
  } | {
228
- duration_ms: number;
269
+ duration_ms: number | null;
270
+ /**
271
+ * Best-effort normalized failure text for a run that did not succeed: the
272
+ * harness's own diagnostic as oneharness captured it on stderr, or
273
+ * oneharness's own message when it generated one (a spawn failure, a
274
+ * timeout, a binary that is not installed). This is the *only* place a
275
+ * record quotes the process's own bytes, and it is deliberately narrow —
276
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
277
+ * that failed. `failure_kind` says what class of failure it was; this says
278
+ * what the harness actually reported, which is what an operator reads when
279
+ * the class is unclassified. Never derived from stdout, so it can never
280
+ * stand in for provider output the run did not produce. Omitted on the wire
281
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
282
+ */
283
+ error?: string | null | undefined;
229
284
  /**
230
285
  * Best-effort normalized tool-call events; `null` when the harness exposes
231
286
  * no machine-readable trace.
232
287
  */
233
- events: (((ActionEvent & {
234
- duration_ms: number;
235
- finished_at: string;
236
- kind: "tool_call";
237
- started_at: string;
238
- status: "completed";
239
- tool_call_id: string;
240
- [k: string]: unknown;
241
- }) | (ActionEvent & {
242
- duration_ms: number;
243
- finished_at: string;
244
- kind: "tool_call";
245
- started_at: string;
246
- status: "failed";
247
- tool_call_id: string;
248
- [k: string]: unknown;
249
- }) | (ActionEvent & {
250
- kind: "tool_call";
251
- started_at: string;
252
- status: "timeout";
253
- tool_call_id: string;
254
- [k: string]: unknown;
255
- }) | (ActionEvent & {
256
- kind: "tool_call";
257
- started_at: string;
258
- status: "interrupted";
259
- tool_call_id: string;
260
- [k: string]: unknown;
261
- }) | (ActionEvent & {
262
- kind?: "tool_result" | undefined;
263
- [k: string]: unknown;
264
- })) & {
265
- timing_source?: never | undefined;
288
+ events: {
289
+ duration_ms?: null | undefined;
290
+ finished_at?: null | undefined;
291
+ index: number;
292
+ input: unknown;
293
+ kind: string;
294
+ name: string | null;
295
+ output: string | null;
296
+ started_at?: null | undefined;
297
+ status?: null | undefined;
298
+ tool_call_id?: string | null | undefined;
266
299
  [k: string]: unknown;
267
- })[] | null;
300
+ }[] | null;
268
301
  exit_code: number | null;
269
302
  /**
270
303
  * Best-effort classified failure reason (see [`FailureKind`]); `null` when
271
304
  * unclassified.
272
305
  */
273
306
  failure_kind: FailureKind | null;
274
- finished_at: string | null;
307
+ finished_at: null;
275
308
  /**
276
309
  * Canonical harness id (e.g. `claude-code`).
277
310
  */
278
311
  harness: string;
279
- harness_id?: string | undefined;
312
+ harness_id: string;
280
313
  /**
281
314
  * Globally unique, time-ordered record id. This is also the cursor accepted
282
315
  * by `history watch --after` and the exact id accepted by history lookup.
@@ -287,7 +320,7 @@ export type HistoryRecord = {
287
320
  * The effective top-level model for the run, if any.
288
321
  */
289
322
  model: string | null;
290
- model_ms: number;
323
+ model_ms?: never | undefined;
291
324
  /**
292
325
  * The human-meaningful session name (see [`session_name`]); repeated on
293
326
  * every record so a reader can resolve a session by name from any line.
@@ -308,7 +341,7 @@ export type HistoryRecord = {
308
341
  * run's single prompt).
309
342
  */
310
343
  prompt: string;
311
- schema_version: "1.0";
344
+ schema_version: "1.2" | "1.3";
312
345
  /**
313
346
  * The oneharness session id this run belongs to (the history file's stem).
314
347
  */
@@ -317,8 +350,8 @@ export type HistoryRecord = {
317
350
  * The harness's own continuation id, when it exposed one; `null` otherwise.
318
351
  */
319
352
  session_id: string | null;
320
- started_at: string;
321
- status: Status;
353
+ started_at?: never | undefined;
354
+ status: "ok" | "planned";
322
355
  /**
323
356
  * Best-effort final assistant text; `null` when extraction was impossible.
324
357
  */
@@ -327,34 +360,36 @@ export type HistoryRecord = {
327
360
  * How `text` was extracted; `null` when absent.
328
361
  */
329
362
  text_source: string | null;
330
- time_to_first_token_ms?: number | null | undefined;
363
+ time_to_first_token_ms?: never | undefined;
331
364
  /**
332
365
  * RFC3339 UTC instant the record was written (append time).
333
366
  */
334
367
  timestamp: string;
335
- tool_ms: number;
368
+ tool_ms?: never | undefined;
336
369
  usage: Usage2;
337
370
  variant?: string | null | undefined;
338
371
  [k: string]: unknown;
339
372
  } | {
340
- duration_ms: number | null;
373
+ duration_ms: number;
374
+ /**
375
+ * Best-effort normalized failure text for a run that did not succeed: the
376
+ * harness's own diagnostic as oneharness captured it on stderr, or
377
+ * oneharness's own message when it generated one (a spawn failure, a
378
+ * timeout, a binary that is not installed). This is the *only* place a
379
+ * record quotes the process's own bytes, and it is deliberately narrow —
380
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
381
+ * that failed. `failure_kind` says what class of failure it was; this says
382
+ * what the harness actually reported, which is what an operator reads when
383
+ * the class is unclassified. Never derived from stdout, so it can never
384
+ * stand in for provider output the run did not produce. Omitted on the wire
385
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
386
+ */
387
+ error?: string | null | undefined;
341
388
  /**
342
389
  * Best-effort normalized tool-call events; `null` when the harness exposes
343
390
  * no machine-readable trace.
344
391
  */
345
- events: {
346
- duration_ms?: null | undefined;
347
- finished_at?: null | undefined;
348
- index: number;
349
- input: unknown;
350
- kind: string;
351
- name: string | null;
352
- output: string | null;
353
- started_at?: null | undefined;
354
- status?: null | undefined;
355
- tool_call_id?: string | null | undefined;
356
- [k: string]: unknown;
357
- }[] | null;
392
+ events: ActionEvent[] | null;
358
393
  exit_code: number | null;
359
394
  /**
360
395
  * Best-effort classified failure reason (see [`FailureKind`]); `null` when
@@ -383,7 +418,7 @@ export type HistoryRecord = {
383
418
  * every record so a reader can resolve a session by name from any line.
384
419
  */
385
420
  name: string;
386
- observed_tool_ms?: never | undefined;
421
+ observed_tool_ms: number;
387
422
  /**
388
423
  * The normalized approval mode requested for the run.
389
424
  */
@@ -398,7 +433,7 @@ export type HistoryRecord = {
398
433
  * run's single prompt).
399
434
  */
400
435
  prompt: string;
401
- schema_version: "1.2";
436
+ schema_version: "1.2" | "1.3";
402
437
  /**
403
438
  * The oneharness session id this run belongs to (the history file's stem).
404
439
  */
@@ -427,7 +462,21 @@ export type HistoryRecord = {
427
462
  variant?: string | null | undefined;
428
463
  [k: string]: unknown;
429
464
  } | {
430
- duration_ms: number;
465
+ duration_ms: number | null;
466
+ /**
467
+ * Best-effort normalized failure text for a run that did not succeed: the
468
+ * harness's own diagnostic as oneharness captured it on stderr, or
469
+ * oneharness's own message when it generated one (a spawn failure, a
470
+ * timeout, a binary that is not installed). This is the *only* place a
471
+ * record quotes the process's own bytes, and it is deliberately narrow —
472
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
473
+ * that failed. `failure_kind` says what class of failure it was; this says
474
+ * what the harness actually reported, which is what an operator reads when
475
+ * the class is unclassified. Never derived from stdout, so it can never
476
+ * stand in for provider output the run did not produce. Omitted on the wire
477
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
478
+ */
479
+ error?: string | null | undefined;
431
480
  /**
432
481
  * Best-effort normalized tool-call events; `null` when the harness exposes
433
482
  * no machine-readable trace.
@@ -461,7 +510,7 @@ export type HistoryRecord = {
461
510
  * every record so a reader can resolve a session by name from any line.
462
511
  */
463
512
  name: string;
464
- observed_tool_ms: number;
513
+ observed_tool_ms?: never | undefined;
465
514
  /**
466
515
  * The normalized approval mode requested for the run.
467
516
  */
@@ -476,7 +525,7 @@ export type HistoryRecord = {
476
525
  * run's single prompt).
477
526
  */
478
527
  prompt: string;
479
- schema_version: "1.2";
528
+ schema_version: "1.2" | "1.3";
480
529
  /**
481
530
  * The oneharness session id this run belongs to (the history file's stem).
482
531
  */
@@ -486,7 +535,7 @@ export type HistoryRecord = {
486
535
  */
487
536
  session_id: string | null;
488
537
  started_at?: never | undefined;
489
- status: Status;
538
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
490
539
  /**
491
540
  * Best-effort final assistant text; `null` when extraction was impossible.
492
541
  */
@@ -504,25 +553,119 @@ export type HistoryRecord = {
504
553
  usage: Usage4;
505
554
  variant?: string | null | undefined;
506
555
  [k: string]: unknown;
556
+ } | {
557
+ duration_ms: number;
558
+ /**
559
+ * Best-effort normalized failure text for a run that did not succeed: the
560
+ * harness's own diagnostic as oneharness captured it on stderr, or
561
+ * oneharness's own message when it generated one (a spawn failure, a
562
+ * timeout, a binary that is not installed). This is the *only* place a
563
+ * record quotes the process's own bytes, and it is deliberately narrow —
564
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
565
+ * that failed. `failure_kind` says what class of failure it was; this says
566
+ * what the harness actually reported, which is what an operator reads when
567
+ * the class is unclassified. Never derived from stdout, so it can never
568
+ * stand in for provider output the run did not produce. Omitted on the wire
569
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
570
+ */
571
+ error?: string | null | undefined;
572
+ /**
573
+ * Best-effort normalized tool-call events; `null` when the harness exposes
574
+ * no machine-readable trace.
575
+ */
576
+ events: ActionEvent[] | null;
577
+ exit_code: number | null;
578
+ /**
579
+ * Best-effort classified failure reason (see [`FailureKind`]); `null` when
580
+ * unclassified.
581
+ */
582
+ failure_kind: FailureKind | null;
583
+ finished_at: null;
584
+ /**
585
+ * Canonical harness id (e.g. `claude-code`).
586
+ */
587
+ harness: string;
588
+ harness_id: string;
589
+ /**
590
+ * Globally unique, time-ordered record id. This is also the cursor accepted
591
+ * by `history watch --after` and the exact id accepted by history lookup.
592
+ */
593
+ history_id: string;
594
+ labels?: HistoryLabels5 | undefined;
595
+ /**
596
+ * The effective top-level model for the run, if any.
597
+ */
598
+ model: string | null;
599
+ model_ms?: never | undefined;
600
+ /**
601
+ * The human-meaningful session name (see [`session_name`]); repeated on
602
+ * every record so a reader can resolve a session by name from any line.
603
+ */
604
+ name: string;
605
+ observed_tool_ms?: never | undefined;
606
+ /**
607
+ * The normalized approval mode requested for the run.
608
+ */
609
+ permission_mode: "read-only" | "plan" | "default" | "edit" | "auto" | "bypass";
610
+ /**
611
+ * The project directory the run operated in (the real path, not the
612
+ * on-disk slug), so the list view can show where a session ran.
613
+ */
614
+ project: string;
615
+ /**
616
+ * The prompt this harness run received (its own, on a batch run; else the
617
+ * run's single prompt).
618
+ */
619
+ prompt: string;
620
+ schema_version: "1.3";
621
+ /**
622
+ * The oneharness session id this run belongs to (the history file's stem).
623
+ */
624
+ session: string;
625
+ /**
626
+ * The harness's own continuation id, when it exposed one; `null` otherwise.
627
+ */
628
+ session_id: string | null;
629
+ started_at: string;
630
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
631
+ /**
632
+ * Best-effort final assistant text; `null` when extraction was impossible.
633
+ */
634
+ text: string | null;
635
+ /**
636
+ * How `text` was extracted; `null` when absent.
637
+ */
638
+ text_source: string | null;
639
+ time_to_first_token_ms?: number | null | undefined;
640
+ /**
641
+ * RFC3339 UTC instant the record was written (append time).
642
+ */
643
+ timestamp: string;
644
+ tool_ms?: never | undefined;
645
+ usage: Usage5;
646
+ variant?: string | null | undefined;
647
+ [k: string]: unknown;
507
648
  } | {
508
649
  duration_ms: number | null;
650
+ /**
651
+ * Best-effort normalized failure text for a run that did not succeed: the
652
+ * harness's own diagnostic as oneharness captured it on stderr, or
653
+ * oneharness's own message when it generated one (a spawn failure, a
654
+ * timeout, a binary that is not installed). This is the *only* place a
655
+ * record quotes the process's own bytes, and it is deliberately narrow —
656
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
657
+ * that failed. `failure_kind` says what class of failure it was; this says
658
+ * what the harness actually reported, which is what an operator reads when
659
+ * the class is unclassified. Never derived from stdout, so it can never
660
+ * stand in for provider output the run did not produce. Omitted on the wire
661
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
662
+ */
663
+ error?: string | null | undefined;
509
664
  /**
510
665
  * Best-effort normalized tool-call events; `null` when the harness exposes
511
666
  * no machine-readable trace.
512
667
  */
513
- events: ({
514
- duration_ms?: null | undefined;
515
- finished_at?: null | undefined;
516
- index: number;
517
- input: unknown;
518
- kind: string;
519
- name: string | null;
520
- output: string | null;
521
- started_at?: null | undefined;
522
- status?: null | undefined;
523
- tool_call_id?: string | null | undefined;
524
- [k: string]: unknown;
525
- } & {
668
+ events: (ActionEvent & {
526
669
  timing_source?: never | undefined;
527
670
  [k: string]: unknown;
528
671
  })[] | null;
@@ -543,7 +686,7 @@ export type HistoryRecord = {
543
686
  * by `history watch --after` and the exact id accepted by history lookup.
544
687
  */
545
688
  history_id: string;
546
- labels?: HistoryLabels5 | undefined;
689
+ labels?: HistoryLabels6 | undefined;
547
690
  /**
548
691
  * The effective top-level model for the run, if any.
549
692
  */
@@ -569,7 +712,7 @@ export type HistoryRecord = {
569
712
  * run's single prompt).
570
713
  */
571
714
  prompt: string;
572
- schema_version: "1.1";
715
+ schema_version: "1.0" | "1.1";
573
716
  /**
574
717
  * The oneharness session id this run belongs to (the history file's stem).
575
718
  */
@@ -579,7 +722,7 @@ export type HistoryRecord = {
579
722
  */
580
723
  session_id: string | null;
581
724
  started_at?: never | undefined;
582
- status: Status;
725
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
583
726
  /**
584
727
  * Best-effort final assistant text; `null` when extraction was impossible.
585
728
  */
@@ -594,11 +737,25 @@ export type HistoryRecord = {
594
737
  */
595
738
  timestamp: string;
596
739
  tool_ms?: never | undefined;
597
- usage: Usage5;
740
+ usage: Usage6;
598
741
  variant?: string | null | undefined;
599
742
  [k: string]: unknown;
600
743
  } | {
601
744
  duration_ms: number | null;
745
+ /**
746
+ * Best-effort normalized failure text for a run that did not succeed: the
747
+ * harness's own diagnostic as oneharness captured it on stderr, or
748
+ * oneharness's own message when it generated one (a spawn failure, a
749
+ * timeout, a binary that is not installed). This is the *only* place a
750
+ * record quotes the process's own bytes, and it is deliberately narrow —
751
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
752
+ * that failed. `failure_kind` says what class of failure it was; this says
753
+ * what the harness actually reported, which is what an operator reads when
754
+ * the class is unclassified. Never derived from stdout, so it can never
755
+ * stand in for provider output the run did not produce. Omitted on the wire
756
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
757
+ */
758
+ error?: string | null | undefined;
602
759
  /**
603
760
  * Best-effort normalized tool-call events; `null` when the harness exposes
604
761
  * no machine-readable trace.
@@ -636,7 +793,7 @@ export type HistoryRecord = {
636
793
  * by `history watch --after` and the exact id accepted by history lookup.
637
794
  */
638
795
  history_id: string;
639
- labels?: HistoryLabels6 | undefined;
796
+ labels?: HistoryLabels7 | undefined;
640
797
  /**
641
798
  * The effective top-level model for the run, if any.
642
799
  */
@@ -662,7 +819,7 @@ export type HistoryRecord = {
662
819
  * run's single prompt).
663
820
  */
664
821
  prompt: string;
665
- schema_version: "1.0";
822
+ schema_version: "1.0" | "1.1";
666
823
  /**
667
824
  * The oneharness session id this run belongs to (the history file's stem).
668
825
  */
@@ -672,7 +829,7 @@ export type HistoryRecord = {
672
829
  */
673
830
  session_id: string | null;
674
831
  started_at?: never | undefined;
675
- status: Status;
832
+ status: "ok" | "planned";
676
833
  /**
677
834
  * Best-effort final assistant text; `null` when extraction was impossible.
678
835
  */
@@ -687,11 +844,25 @@ export type HistoryRecord = {
687
844
  */
688
845
  timestamp: string;
689
846
  tool_ms?: never | undefined;
690
- usage: Usage6;
847
+ usage: Usage7;
691
848
  variant?: string | null | undefined;
692
849
  [k: string]: unknown;
693
850
  } | {
694
851
  duration_ms: number | null;
852
+ /**
853
+ * Best-effort normalized failure text for a run that did not succeed: the
854
+ * harness's own diagnostic as oneharness captured it on stderr, or
855
+ * oneharness's own message when it generated one (a spawn failure, a
856
+ * timeout, a binary that is not installed). This is the *only* place a
857
+ * record quotes the process's own bytes, and it is deliberately narrow —
858
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
859
+ * that failed. `failure_kind` says what class of failure it was; this says
860
+ * what the harness actually reported, which is what an operator reads when
861
+ * the class is unclassified. Never derived from stdout, so it can never
862
+ * stand in for provider output the run did not produce. Omitted on the wire
863
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
864
+ */
865
+ error?: string | null | undefined;
695
866
  events: {
696
867
  index: number;
697
868
  input: unknown;
@@ -717,7 +888,7 @@ export type HistoryRecord = {
717
888
  * by `history watch --after` and the exact id accepted by history lookup.
718
889
  */
719
890
  history_id: string;
720
- labels?: HistoryLabels7 | undefined;
891
+ labels?: HistoryLabels8 | undefined;
721
892
  /**
722
893
  * The effective top-level model for the run, if any.
723
894
  */
@@ -778,10 +949,10 @@ export type HistoryRecord = {
778
949
  */
779
950
  timestamp: string;
780
951
  tool_ms?: number | null | undefined;
781
- usage: Usage7;
952
+ usage: Usage8;
782
953
  variant?: string | null | undefined;
783
954
  [k: string]: unknown;
784
- };
955
+ });
785
956
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
786
957
  /**
787
958
  * How a normalized tool interval was obtained.
@@ -1155,3 +1326,40 @@ export interface Usage7 {
1155
1326
  output_tokens: number | null;
1156
1327
  [k: string]: unknown;
1157
1328
  }
1329
+ /**
1330
+ * Caller-supplied metadata used to select related task-graph records.
1331
+ * Omitted on the wire when empty for additive compatibility.
1332
+ */
1333
+ export interface HistoryLabels8 {
1334
+ [k: string]: string;
1335
+ }
1336
+ /**
1337
+ * Best-effort token/cost accounting (every field `null` when unreported).
1338
+ */
1339
+ export interface Usage8 {
1340
+ /**
1341
+ * Prompt tokens served from the provider's prompt cache (a cheap read of a
1342
+ * previously-written prefix), when the harness reports them. `None` when the
1343
+ * harness does not surface cache counts — never `0` as a guess.
1344
+ */
1345
+ cache_read_tokens: number | null;
1346
+ /**
1347
+ * Prompt tokens written to the provider's prompt cache (a.k.a. cache
1348
+ * creation), when the harness reports them. `None` when not surfaced.
1349
+ */
1350
+ cache_write_tokens: number | null;
1351
+ /**
1352
+ * Total cost in USD, when the harness reports it (often absent on
1353
+ * subscription auth, where there is no per-call dollar figure).
1354
+ */
1355
+ cost_usd: number | null;
1356
+ /**
1357
+ * Prompt/input tokens billed, when the harness reports them.
1358
+ */
1359
+ input_tokens: number | null;
1360
+ /**
1361
+ * Completion/output tokens billed, when the harness reports them.
1362
+ */
1363
+ output_tokens: number | null;
1364
+ [k: string]: unknown;
1365
+ }