@oneharness/sdk 0.6.6 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,19 @@
1
- /**
2
- * One harness run, normalized and frozen for the history log. Serialized as one
3
- * JSONL line per harness run, appended as the run finalizes. Carries only the
4
- * normalized cross-harness signals — no raw stdout/stderr.
5
- */
6
1
  export type HistoryRecord = {
7
2
  duration_ms: number;
3
+ /**
4
+ * Best-effort normalized failure text for a run that did not succeed: the
5
+ * harness's own diagnostic as oneharness captured it on stderr, or
6
+ * oneharness's own message when it generated one (a spawn failure, a
7
+ * timeout, a binary that is not installed). This is the *only* place a
8
+ * record quotes the process's own bytes, and it is deliberately narrow —
9
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
10
+ * that failed. `failure_kind` says what class of failure it was; this says
11
+ * what the harness actually reported, which is what an operator reads when
12
+ * the class is unclassified. Never derived from stdout, so it can never
13
+ * stand in for provider output the run did not produce. Omitted on the wire
14
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
15
+ */
16
+ error?: string | null | undefined;
8
17
  /**
9
18
  * Best-effort normalized tool-call events; `null` when the harness exposes
10
19
  * no machine-readable trace.
@@ -84,7 +93,7 @@ export type HistoryRecord = {
84
93
  * run's single prompt).
85
94
  */
86
95
  prompt: string;
87
- schema_version: "1.2";
96
+ schema_version: "1.2" | "1.3";
88
97
  /**
89
98
  * The oneharness session id this run belongs to (the history file's stem).
90
99
  */
@@ -114,6 +123,20 @@ export type HistoryRecord = {
114
123
  [k: string]: unknown;
115
124
  } | {
116
125
  duration_ms: number;
126
+ /**
127
+ * Best-effort normalized failure text for a run that did not succeed: the
128
+ * harness's own diagnostic as oneharness captured it on stderr, or
129
+ * oneharness's own message when it generated one (a spawn failure, a
130
+ * timeout, a binary that is not installed). This is the *only* place a
131
+ * record quotes the process's own bytes, and it is deliberately narrow —
132
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
133
+ * that failed. `failure_kind` says what class of failure it was; this says
134
+ * what the harness actually reported, which is what an operator reads when
135
+ * the class is unclassified. Never derived from stdout, so it can never
136
+ * stand in for provider output the run did not produce. Omitted on the wire
137
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
138
+ */
139
+ error?: string | null | undefined;
117
140
  /**
118
141
  * Best-effort normalized tool-call events; `null` when the harness exposes
119
142
  * no machine-readable trace.
@@ -196,7 +219,7 @@ export type HistoryRecord = {
196
219
  * run's single prompt).
197
220
  */
198
221
  prompt: string;
199
- schema_version: "1.1";
222
+ schema_version: "1.0" | "1.1";
200
223
  /**
201
224
  * The oneharness session id this run belongs to (the history file's stem).
202
225
  */
@@ -225,58 +248,50 @@ export type HistoryRecord = {
225
248
  variant?: string | null | undefined;
226
249
  [k: string]: unknown;
227
250
  } | {
228
- duration_ms: number;
251
+ duration_ms: number | null;
252
+ /**
253
+ * Best-effort normalized failure text for a run that did not succeed: the
254
+ * harness's own diagnostic as oneharness captured it on stderr, or
255
+ * oneharness's own message when it generated one (a spawn failure, a
256
+ * timeout, a binary that is not installed). This is the *only* place a
257
+ * record quotes the process's own bytes, and it is deliberately narrow —
258
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
259
+ * that failed. `failure_kind` says what class of failure it was; this says
260
+ * what the harness actually reported, which is what an operator reads when
261
+ * the class is unclassified. Never derived from stdout, so it can never
262
+ * stand in for provider output the run did not produce. Omitted on the wire
263
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
264
+ */
265
+ error?: string | null | undefined;
229
266
  /**
230
267
  * Best-effort normalized tool-call events; `null` when the harness exposes
231
268
  * no machine-readable trace.
232
269
  */
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;
270
+ events: {
271
+ duration_ms?: null | undefined;
272
+ finished_at?: null | undefined;
273
+ index: number;
274
+ input: unknown;
275
+ kind: string;
276
+ name: string | null;
277
+ output: string | null;
278
+ started_at?: null | undefined;
279
+ status?: null | undefined;
280
+ tool_call_id?: string | null | undefined;
266
281
  [k: string]: unknown;
267
- })[] | null;
282
+ }[] | null;
268
283
  exit_code: number | null;
269
284
  /**
270
285
  * Best-effort classified failure reason (see [`FailureKind`]); `null` when
271
286
  * unclassified.
272
287
  */
273
288
  failure_kind: FailureKind | null;
274
- finished_at: string | null;
289
+ finished_at: null;
275
290
  /**
276
291
  * Canonical harness id (e.g. `claude-code`).
277
292
  */
278
293
  harness: string;
279
- harness_id?: string | undefined;
294
+ harness_id: string;
280
295
  /**
281
296
  * Globally unique, time-ordered record id. This is also the cursor accepted
282
297
  * by `history watch --after` and the exact id accepted by history lookup.
@@ -287,7 +302,7 @@ export type HistoryRecord = {
287
302
  * The effective top-level model for the run, if any.
288
303
  */
289
304
  model: string | null;
290
- model_ms: number;
305
+ model_ms?: never | undefined;
291
306
  /**
292
307
  * The human-meaningful session name (see [`session_name`]); repeated on
293
308
  * every record so a reader can resolve a session by name from any line.
@@ -308,7 +323,7 @@ export type HistoryRecord = {
308
323
  * run's single prompt).
309
324
  */
310
325
  prompt: string;
311
- schema_version: "1.0";
326
+ schema_version: "1.2" | "1.3";
312
327
  /**
313
328
  * The oneharness session id this run belongs to (the history file's stem).
314
329
  */
@@ -317,8 +332,8 @@ export type HistoryRecord = {
317
332
  * The harness's own continuation id, when it exposed one; `null` otherwise.
318
333
  */
319
334
  session_id: string | null;
320
- started_at: string;
321
- status: Status;
335
+ started_at?: never | undefined;
336
+ status: "ok" | "planned";
322
337
  /**
323
338
  * Best-effort final assistant text; `null` when extraction was impossible.
324
339
  */
@@ -327,34 +342,36 @@ export type HistoryRecord = {
327
342
  * How `text` was extracted; `null` when absent.
328
343
  */
329
344
  text_source: string | null;
330
- time_to_first_token_ms?: number | null | undefined;
345
+ time_to_first_token_ms?: never | undefined;
331
346
  /**
332
347
  * RFC3339 UTC instant the record was written (append time).
333
348
  */
334
349
  timestamp: string;
335
- tool_ms: number;
350
+ tool_ms?: never | undefined;
336
351
  usage: Usage2;
337
352
  variant?: string | null | undefined;
338
353
  [k: string]: unknown;
339
354
  } | {
340
- duration_ms: number | null;
355
+ duration_ms: number;
356
+ /**
357
+ * Best-effort normalized failure text for a run that did not succeed: the
358
+ * harness's own diagnostic as oneharness captured it on stderr, or
359
+ * oneharness's own message when it generated one (a spawn failure, a
360
+ * timeout, a binary that is not installed). This is the *only* place a
361
+ * record quotes the process's own bytes, and it is deliberately narrow —
362
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
363
+ * that failed. `failure_kind` says what class of failure it was; this says
364
+ * what the harness actually reported, which is what an operator reads when
365
+ * the class is unclassified. Never derived from stdout, so it can never
366
+ * stand in for provider output the run did not produce. Omitted on the wire
367
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
368
+ */
369
+ error?: string | null | undefined;
341
370
  /**
342
371
  * Best-effort normalized tool-call events; `null` when the harness exposes
343
372
  * no machine-readable trace.
344
373
  */
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;
374
+ events: ActionEvent[] | null;
358
375
  exit_code: number | null;
359
376
  /**
360
377
  * Best-effort classified failure reason (see [`FailureKind`]); `null` when
@@ -383,7 +400,7 @@ export type HistoryRecord = {
383
400
  * every record so a reader can resolve a session by name from any line.
384
401
  */
385
402
  name: string;
386
- observed_tool_ms?: never | undefined;
403
+ observed_tool_ms: number;
387
404
  /**
388
405
  * The normalized approval mode requested for the run.
389
406
  */
@@ -398,7 +415,7 @@ export type HistoryRecord = {
398
415
  * run's single prompt).
399
416
  */
400
417
  prompt: string;
401
- schema_version: "1.2";
418
+ schema_version: "1.2" | "1.3";
402
419
  /**
403
420
  * The oneharness session id this run belongs to (the history file's stem).
404
421
  */
@@ -427,7 +444,21 @@ export type HistoryRecord = {
427
444
  variant?: string | null | undefined;
428
445
  [k: string]: unknown;
429
446
  } | {
430
- duration_ms: number;
447
+ duration_ms: number | null;
448
+ /**
449
+ * Best-effort normalized failure text for a run that did not succeed: the
450
+ * harness's own diagnostic as oneharness captured it on stderr, or
451
+ * oneharness's own message when it generated one (a spawn failure, a
452
+ * timeout, a binary that is not installed). This is the *only* place a
453
+ * record quotes the process's own bytes, and it is deliberately narrow —
454
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
455
+ * that failed. `failure_kind` says what class of failure it was; this says
456
+ * what the harness actually reported, which is what an operator reads when
457
+ * the class is unclassified. Never derived from stdout, so it can never
458
+ * stand in for provider output the run did not produce. Omitted on the wire
459
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
460
+ */
461
+ error?: string | null | undefined;
431
462
  /**
432
463
  * Best-effort normalized tool-call events; `null` when the harness exposes
433
464
  * no machine-readable trace.
@@ -461,7 +492,7 @@ export type HistoryRecord = {
461
492
  * every record so a reader can resolve a session by name from any line.
462
493
  */
463
494
  name: string;
464
- observed_tool_ms: number;
495
+ observed_tool_ms?: never | undefined;
465
496
  /**
466
497
  * The normalized approval mode requested for the run.
467
498
  */
@@ -476,7 +507,7 @@ export type HistoryRecord = {
476
507
  * run's single prompt).
477
508
  */
478
509
  prompt: string;
479
- schema_version: "1.2";
510
+ schema_version: "1.2" | "1.3";
480
511
  /**
481
512
  * The oneharness session id this run belongs to (the history file's stem).
482
513
  */
@@ -486,7 +517,7 @@ export type HistoryRecord = {
486
517
  */
487
518
  session_id: string | null;
488
519
  started_at?: never | undefined;
489
- status: Status;
520
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
490
521
  /**
491
522
  * Best-effort final assistant text; `null` when extraction was impossible.
492
523
  */
@@ -504,25 +535,119 @@ export type HistoryRecord = {
504
535
  usage: Usage4;
505
536
  variant?: string | null | undefined;
506
537
  [k: string]: unknown;
538
+ } | {
539
+ duration_ms: number;
540
+ /**
541
+ * Best-effort normalized failure text for a run that did not succeed: the
542
+ * harness's own diagnostic as oneharness captured it on stderr, or
543
+ * oneharness's own message when it generated one (a spawn failure, a
544
+ * timeout, a binary that is not installed). This is the *only* place a
545
+ * record quotes the process's own bytes, and it is deliberately narrow —
546
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
547
+ * that failed. `failure_kind` says what class of failure it was; this says
548
+ * what the harness actually reported, which is what an operator reads when
549
+ * the class is unclassified. Never derived from stdout, so it can never
550
+ * stand in for provider output the run did not produce. Omitted on the wire
551
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
552
+ */
553
+ error?: string | null | undefined;
554
+ /**
555
+ * Best-effort normalized tool-call events; `null` when the harness exposes
556
+ * no machine-readable trace.
557
+ */
558
+ events: ActionEvent[] | null;
559
+ exit_code: number | null;
560
+ /**
561
+ * Best-effort classified failure reason (see [`FailureKind`]); `null` when
562
+ * unclassified.
563
+ */
564
+ failure_kind: FailureKind | null;
565
+ finished_at: null;
566
+ /**
567
+ * Canonical harness id (e.g. `claude-code`).
568
+ */
569
+ harness: string;
570
+ harness_id: string;
571
+ /**
572
+ * Globally unique, time-ordered record id. This is also the cursor accepted
573
+ * by `history watch --after` and the exact id accepted by history lookup.
574
+ */
575
+ history_id: string;
576
+ labels?: HistoryLabels5 | undefined;
577
+ /**
578
+ * The effective top-level model for the run, if any.
579
+ */
580
+ model: string | null;
581
+ model_ms?: never | undefined;
582
+ /**
583
+ * The human-meaningful session name (see [`session_name`]); repeated on
584
+ * every record so a reader can resolve a session by name from any line.
585
+ */
586
+ name: string;
587
+ observed_tool_ms?: never | undefined;
588
+ /**
589
+ * The normalized approval mode requested for the run.
590
+ */
591
+ permission_mode: "read-only" | "plan" | "default" | "edit" | "auto" | "bypass";
592
+ /**
593
+ * The project directory the run operated in (the real path, not the
594
+ * on-disk slug), so the list view can show where a session ran.
595
+ */
596
+ project: string;
597
+ /**
598
+ * The prompt this harness run received (its own, on a batch run; else the
599
+ * run's single prompt).
600
+ */
601
+ prompt: string;
602
+ schema_version: "1.3";
603
+ /**
604
+ * The oneharness session id this run belongs to (the history file's stem).
605
+ */
606
+ session: string;
607
+ /**
608
+ * The harness's own continuation id, when it exposed one; `null` otherwise.
609
+ */
610
+ session_id: string | null;
611
+ started_at: string;
612
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
613
+ /**
614
+ * Best-effort final assistant text; `null` when extraction was impossible.
615
+ */
616
+ text: string | null;
617
+ /**
618
+ * How `text` was extracted; `null` when absent.
619
+ */
620
+ text_source: string | null;
621
+ time_to_first_token_ms?: number | null | undefined;
622
+ /**
623
+ * RFC3339 UTC instant the record was written (append time).
624
+ */
625
+ timestamp: string;
626
+ tool_ms?: never | undefined;
627
+ usage: Usage5;
628
+ variant?: string | null | undefined;
629
+ [k: string]: unknown;
507
630
  } | {
508
631
  duration_ms: number | null;
632
+ /**
633
+ * Best-effort normalized failure text for a run that did not succeed: the
634
+ * harness's own diagnostic as oneharness captured it on stderr, or
635
+ * oneharness's own message when it generated one (a spawn failure, a
636
+ * timeout, a binary that is not installed). This is the *only* place a
637
+ * record quotes the process's own bytes, and it is deliberately narrow —
638
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
639
+ * that failed. `failure_kind` says what class of failure it was; this says
640
+ * what the harness actually reported, which is what an operator reads when
641
+ * the class is unclassified. Never derived from stdout, so it can never
642
+ * stand in for provider output the run did not produce. Omitted on the wire
643
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
644
+ */
645
+ error?: string | null | undefined;
509
646
  /**
510
647
  * Best-effort normalized tool-call events; `null` when the harness exposes
511
648
  * no machine-readable trace.
512
649
  */
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
- } & {
650
+ events: (ActionEvent & {
526
651
  timing_source?: never | undefined;
527
652
  [k: string]: unknown;
528
653
  })[] | null;
@@ -543,7 +668,7 @@ export type HistoryRecord = {
543
668
  * by `history watch --after` and the exact id accepted by history lookup.
544
669
  */
545
670
  history_id: string;
546
- labels?: HistoryLabels5 | undefined;
671
+ labels?: HistoryLabels6 | undefined;
547
672
  /**
548
673
  * The effective top-level model for the run, if any.
549
674
  */
@@ -569,7 +694,7 @@ export type HistoryRecord = {
569
694
  * run's single prompt).
570
695
  */
571
696
  prompt: string;
572
- schema_version: "1.1";
697
+ schema_version: "1.0" | "1.1";
573
698
  /**
574
699
  * The oneharness session id this run belongs to (the history file's stem).
575
700
  */
@@ -579,7 +704,7 @@ export type HistoryRecord = {
579
704
  */
580
705
  session_id: string | null;
581
706
  started_at?: never | undefined;
582
- status: Status;
707
+ status: "nonzero" | "timeout" | "spawn-error" | "skipped";
583
708
  /**
584
709
  * Best-effort final assistant text; `null` when extraction was impossible.
585
710
  */
@@ -594,11 +719,25 @@ export type HistoryRecord = {
594
719
  */
595
720
  timestamp: string;
596
721
  tool_ms?: never | undefined;
597
- usage: Usage5;
722
+ usage: Usage6;
598
723
  variant?: string | null | undefined;
599
724
  [k: string]: unknown;
600
725
  } | {
601
726
  duration_ms: number | null;
727
+ /**
728
+ * Best-effort normalized failure text for a run that did not succeed: the
729
+ * harness's own diagnostic as oneharness captured it on stderr, or
730
+ * oneharness's own message when it generated one (a spawn failure, a
731
+ * timeout, a binary that is not installed). This is the *only* place a
732
+ * record quotes the process's own bytes, and it is deliberately narrow —
733
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
734
+ * that failed. `failure_kind` says what class of failure it was; this says
735
+ * what the harness actually reported, which is what an operator reads when
736
+ * the class is unclassified. Never derived from stdout, so it can never
737
+ * stand in for provider output the run did not produce. Omitted on the wire
738
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
739
+ */
740
+ error?: string | null | undefined;
602
741
  /**
603
742
  * Best-effort normalized tool-call events; `null` when the harness exposes
604
743
  * no machine-readable trace.
@@ -636,7 +775,7 @@ export type HistoryRecord = {
636
775
  * by `history watch --after` and the exact id accepted by history lookup.
637
776
  */
638
777
  history_id: string;
639
- labels?: HistoryLabels6 | undefined;
778
+ labels?: HistoryLabels7 | undefined;
640
779
  /**
641
780
  * The effective top-level model for the run, if any.
642
781
  */
@@ -662,7 +801,7 @@ export type HistoryRecord = {
662
801
  * run's single prompt).
663
802
  */
664
803
  prompt: string;
665
- schema_version: "1.0";
804
+ schema_version: "1.0" | "1.1";
666
805
  /**
667
806
  * The oneharness session id this run belongs to (the history file's stem).
668
807
  */
@@ -672,7 +811,7 @@ export type HistoryRecord = {
672
811
  */
673
812
  session_id: string | null;
674
813
  started_at?: never | undefined;
675
- status: Status;
814
+ status: "ok" | "planned";
676
815
  /**
677
816
  * Best-effort final assistant text; `null` when extraction was impossible.
678
817
  */
@@ -687,11 +826,25 @@ export type HistoryRecord = {
687
826
  */
688
827
  timestamp: string;
689
828
  tool_ms?: never | undefined;
690
- usage: Usage6;
829
+ usage: Usage7;
691
830
  variant?: string | null | undefined;
692
831
  [k: string]: unknown;
693
832
  } | {
694
833
  duration_ms: number | null;
834
+ /**
835
+ * Best-effort normalized failure text for a run that did not succeed: the
836
+ * harness's own diagnostic as oneharness captured it on stderr, or
837
+ * oneharness's own message when it generated one (a spawn failure, a
838
+ * timeout, a binary that is not installed). This is the *only* place a
839
+ * record quotes the process's own bytes, and it is deliberately narrow —
840
+ * trimmed, bounded to [`ERROR_MAX`] characters, and written only for a run
841
+ * that failed. `failure_kind` says what class of failure it was; this says
842
+ * what the harness actually reported, which is what an operator reads when
843
+ * the class is unclassified. Never derived from stdout, so it can never
844
+ * stand in for provider output the run did not produce. Omitted on the wire
845
+ * when absent, and gated to [`FIRST_ERROR_SCHEMA_VERSION`].
846
+ */
847
+ error?: string | null | undefined;
695
848
  events: {
696
849
  index: number;
697
850
  input: unknown;
@@ -717,7 +870,7 @@ export type HistoryRecord = {
717
870
  * by `history watch --after` and the exact id accepted by history lookup.
718
871
  */
719
872
  history_id: string;
720
- labels?: HistoryLabels7 | undefined;
873
+ labels?: HistoryLabels8 | undefined;
721
874
  /**
722
875
  * The effective top-level model for the run, if any.
723
876
  */
@@ -778,7 +931,7 @@ export type HistoryRecord = {
778
931
  */
779
932
  timestamp: string;
780
933
  tool_ms?: number | null | undefined;
781
- usage: Usage7;
934
+ usage: Usage8;
782
935
  variant?: string | null | undefined;
783
936
  [k: string]: unknown;
784
937
  };
@@ -802,7 +955,20 @@ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" |
802
955
  * The outcome of attempting to run one harness.
803
956
  */
804
957
  export type Status = "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned";
805
- export type HistoryRecords = HistoryRecord[];
958
+ export type HistoryRecords = (({
959
+ error?: null | undefined;
960
+ [k: string]: unknown;
961
+ } | ({
962
+ error: string;
963
+ schema_version?: "1.3" | undefined;
964
+ [k: string]: unknown;
965
+ } & ({
966
+ status?: "nonzero" | "timeout" | "spawn-error" | "skipped" | undefined;
967
+ [k: string]: unknown;
968
+ } | {
969
+ failure_kind: "tool_deferred";
970
+ [k: string]: unknown;
971
+ }))) & HistoryRecord)[];
806
972
  /**
807
973
  * One normalized action a harness took, harness-agnostic so a single consumer
808
974
  * assertion works across harnesses. Every field is always serialized (null when
@@ -1156,3 +1322,40 @@ export interface Usage7 {
1156
1322
  output_tokens: number | null;
1157
1323
  [k: string]: unknown;
1158
1324
  }
1325
+ /**
1326
+ * Caller-supplied metadata used to select related task-graph records.
1327
+ * Omitted on the wire when empty for additive compatibility.
1328
+ */
1329
+ export interface HistoryLabels8 {
1330
+ [k: string]: string;
1331
+ }
1332
+ /**
1333
+ * Best-effort token/cost accounting (every field `null` when unreported).
1334
+ */
1335
+ export interface Usage8 {
1336
+ /**
1337
+ * Prompt tokens served from the provider's prompt cache (a cheap read of a
1338
+ * previously-written prefix), when the harness reports them. `None` when the
1339
+ * harness does not surface cache counts — never `0` as a guess.
1340
+ */
1341
+ cache_read_tokens: number | null;
1342
+ /**
1343
+ * Prompt tokens written to the provider's prompt cache (a.k.a. cache
1344
+ * creation), when the harness reports them. `None` when not surfaced.
1345
+ */
1346
+ cache_write_tokens: number | null;
1347
+ /**
1348
+ * Total cost in USD, when the harness reports it (often absent on
1349
+ * subscription auth, where there is no per-call dollar figure).
1350
+ */
1351
+ cost_usd: number | null;
1352
+ /**
1353
+ * Prompt/input tokens billed, when the harness reports them.
1354
+ */
1355
+ input_tokens: number | null;
1356
+ /**
1357
+ * Completion/output tokens billed, when the harness reports them.
1358
+ */
1359
+ output_tokens: number | null;
1360
+ [k: string]: unknown;
1361
+ }