@oneharness/sdk 0.6.9 → 0.6.11

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,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { ActionEvent, BatchReport, ExecutionTelemetry, FailureKind, FallThrough, FallbackReport, OutputFormat, RunReport, RunResult, SessionReport, Status, TimingSource, ToolCallStatus, Usage } from "./contracts.js";
2
+ import type { ActionEvent, BatchReport, ControlEvent, ControlReason, ControlReport, ControlVerb, ExecutionTelemetry, FailureKind, FallThrough, FallbackReport, OutputFormat, RunReport, RunResult, SessionReport, Status, TimingSource, ToolCallStatus, Usage, UtcInstant } from "./contracts.js";
3
3
  import type { DetectInfo, DetectReport } from "./detection.js";
4
4
  import type { HistoryRecord } from "./history.js";
5
5
  import type { HistoryLine } from "./history-line.js";
@@ -12,12 +12,20 @@ import type { HistoryWatchOptions } from "./history-watch-options.js";
12
12
  import type { HistoryLabels, PermissionMode, RunOptions } from "./options.js";
13
13
  import type { HarnessInfo, ListReport, ModeInfo, VariantInfo } from "./registry.js";
14
14
  import type { RunStreamEnvelope } from "./run-stream-envelope.js";
15
+ export type AbsolutePath = ControlReport["socket"];
15
16
  export type BatchStrategy = BatchReport["strategy"];
17
+ export type ControlShape = ControlReport["mechanism"];
16
18
  export type ModeHeadless = ModeInfo["headless"];
17
19
  export type SessionPhase = SessionReport["phase"];
20
+ export declare const AbsolutePathSchema: z.ZodType<AbsolutePath>;
18
21
  export declare const ActionEventSchema: z.ZodType<ActionEvent>;
19
22
  export declare const BatchReportSchema: z.ZodType<BatchReport>;
20
23
  export declare const BatchStrategySchema: z.ZodType<BatchStrategy>;
24
+ export declare const ControlEventSchema: z.ZodType<ControlEvent>;
25
+ export declare const ControlReasonSchema: z.ZodType<ControlReason>;
26
+ export declare const ControlReportSchema: z.ZodType<ControlReport>;
27
+ export declare const ControlShapeSchema: z.ZodType<ControlShape>;
28
+ export declare const ControlVerbSchema: z.ZodType<ControlVerb>;
21
29
  export declare const DetectInfoSchema: z.ZodType<DetectInfo>;
22
30
  export declare const DetectReportSchema: z.ZodType<DetectReport>;
23
31
  export declare const ExecutionTelemetrySchema: z.ZodType<ExecutionTelemetry>;
@@ -53,4 +61,5 @@ export declare const StatusSchema: z.ZodType<Status>;
53
61
  export declare const TimingSourceSchema: z.ZodType<TimingSource>;
54
62
  export declare const ToolCallStatusSchema: z.ZodType<ToolCallStatus>;
55
63
  export declare const UsageSchema: z.ZodType<Usage>;
64
+ export declare const UtcInstantSchema: z.ZodType<UtcInstant>;
56
65
  export declare const VariantInfoSchema: z.ZodType<VariantInfo>;
@@ -1,5 +1,6 @@
1
1
  /* Generated from oneharness Rust JSON Schemas. Do not edit. */
2
2
  import { z } from "zod";
3
+ export const AbsolutePathSchema = z.string();
3
4
  export const ActionEventSchema = z.looseObject({
4
5
  duration_ms: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
5
6
  finished_at: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -27,6 +28,38 @@ export const BatchReportSchema = z.looseObject({
27
28
  strategy: z.lazy(() => BatchStrategySchema).refine((value) => value !== undefined, { message: "Required" }),
28
29
  });
29
30
  export const BatchStrategySchema = z.union([z.literal("speed"), z.literal("min-tokens")]);
31
+ export const ControlEventSchema = z.union([
32
+ z.looseObject({
33
+ at: z.lazy(() => UtcInstantSchema).refine((value) => value !== undefined, { message: "Required" }),
34
+ outcome: z.literal("served").refine((value) => value !== undefined, { message: "Required" }),
35
+ redirected: z.boolean().optional(),
36
+ verb: z.lazy(() => ControlVerbSchema).refine((value) => value !== undefined, { message: "Required" }),
37
+ }),
38
+ z.looseObject({
39
+ at: z.lazy(() => UtcInstantSchema).refine((value) => value !== undefined, { message: "Required" }),
40
+ outcome: z.literal("refused").refine((value) => value !== undefined, { message: "Required" }),
41
+ reason: z.lazy(() => ControlReasonSchema).refine((value) => value !== undefined, { message: "Required" }),
42
+ verb: z.lazy(() => ControlVerbSchema).refine((value) => value !== undefined, { message: "Required" }),
43
+ }),
44
+ ]);
45
+ export const ControlReasonSchema = z.union([
46
+ z.literal("unsupported"),
47
+ z.literal("no_active_turn"),
48
+ z.literal("not_running"),
49
+ ]);
50
+ export const ControlReportSchema = z.looseObject({
51
+ interrupts: z.array(z.lazy(() => ControlEventSchema)).refine((value) => value !== undefined, { message: "Required" }),
52
+ mechanism: z.lazy(() => ControlShapeSchema).refine((value) => value !== undefined, { message: "Required" }),
53
+ socket: z.lazy(() => AbsolutePathSchema).refine((value) => value !== undefined, { message: "Required" }),
54
+ });
55
+ export const ControlShapeSchema = z.union([
56
+ z.literal("claude-control-request"),
57
+ z.literal("codex-app-server"),
58
+ z.literal("opencode-http"),
59
+ z.literal("acp-cancel"),
60
+ z.literal("crush-http"),
61
+ ]);
62
+ export const ControlVerbSchema = z.literal("interrupt");
30
63
  export const DetectInfoSchema = z.looseObject({
31
64
  available: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
32
65
  bin: z.string().refine((value) => value !== undefined, { message: "Required" }),
@@ -80,6 +113,7 @@ export const FailureKindSchema = z.union([
80
113
  z.literal("rate_limit"),
81
114
  z.literal("model_not_found"),
82
115
  z.literal("quota"),
116
+ z.literal("session_not_found"),
83
117
  z.literal("tool_deferred"),
84
118
  ]);
85
119
  export const FallThroughSchema = z.looseObject({
@@ -93,6 +127,9 @@ export const FallbackReportSchema = z.looseObject({
93
127
  ran: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
94
128
  });
95
129
  export const HarnessInfoSchema = z.looseObject({
130
+ control: z
131
+ .union([z.lazy(() => ControlShapeSchema), z.null()])
132
+ .refine((value) => value !== undefined, { message: "Required" }),
96
133
  default_bin: z.string().refine((value) => value !== undefined, { message: "Required" }),
97
134
  display: z.string().refine((value) => value !== undefined, { message: "Required" }),
98
135
  example_command: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
@@ -128,7 +165,7 @@ export const HistoryEventLineSchema = z.union([
128
165
  .refine((value) => [...value].length <= 36, { message: "Too long: expected at most 36 characters" })
129
166
  .refine((value) => value !== undefined, { message: "Required" }),
130
167
  schema_version: z
131
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
168
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
132
169
  .refine((value) => value !== undefined, { message: "Required" }),
133
170
  variant: z.union([z.string(), z.null()]).optional(),
134
171
  }),
@@ -178,7 +215,7 @@ export const HistoryLineSchema = z.union([
178
215
  .refine((value) => [...value].length <= 36, { message: "Too long: expected at most 36 characters" })
179
216
  .refine((value) => value !== undefined, { message: "Required" }),
180
217
  schema_version: z
181
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
218
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
182
219
  .refine((value) => value !== undefined, { message: "Required" }),
183
220
  type: z.literal("event").refine((value) => value !== undefined, { message: "Required" }),
184
221
  variant: z.union([z.string(), z.null()]).optional(),
@@ -204,7 +241,7 @@ export const HistoryLineSchema = z.union([
204
241
  variant: z.union([z.string(), z.null()]).optional(),
205
242
  }),
206
243
  ]),
207
- z.intersection(z.intersection(z.union([
244
+ z.intersection(z.intersection(z.intersection(z.union([
208
245
  z.looseObject({
209
246
  duration_ms: z
210
247
  .int()
@@ -248,7 +285,14 @@ export const HistoryLineSchema = z.union([
248
285
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
249
286
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
250
287
  schema_version: z
251
- .union([z.literal("1.0"), z.literal("1.1"), z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
288
+ .union([
289
+ z.literal("1.0"),
290
+ z.literal("1.1"),
291
+ z.literal("1.2"),
292
+ z.literal("1.3"),
293
+ z.literal("1.4"),
294
+ z.literal("1.5"),
295
+ ])
252
296
  .refine((value) => value !== undefined, { message: "Required" }),
253
297
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
254
298
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -260,7 +304,9 @@ export const HistoryLineSchema = z.union([
260
304
  .union([z.literal("ok"), z.literal("nonzero")])
261
305
  .refine((value) => value !== undefined, { message: "Required" }),
262
306
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
263
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
307
+ text_source: z
308
+ .union([z.string(), z.null()])
309
+ .refine((value) => value !== undefined, { message: "Required" }),
264
310
  time_to_first_token_ms: z.union([z.int().gte(0), z.null()]).optional(),
265
311
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
266
312
  tool_ms: z
@@ -291,7 +337,9 @@ export const HistoryLineSchema = z.union([
291
337
  failure_kind: z
292
338
  .union([z.lazy(() => FailureKindSchema), z.null()])
293
339
  .refine((value) => value !== undefined, { message: "Required" }),
294
- finished_at: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
340
+ finished_at: z
341
+ .union([z.string(), z.null()])
342
+ .refine((value) => value !== undefined, { message: "Required" }),
295
343
  harness: z.string().refine((value) => value !== undefined, { message: "Required" }),
296
344
  harness_id: z.union([z.string(), z.null()]).optional(),
297
345
  history_id: z
@@ -314,7 +362,14 @@ export const HistoryLineSchema = z.union([
314
362
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
315
363
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
316
364
  schema_version: z
317
- .union([z.literal("1.0"), z.literal("1.1"), z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
365
+ .union([
366
+ z.literal("1.0"),
367
+ z.literal("1.1"),
368
+ z.literal("1.2"),
369
+ z.literal("1.3"),
370
+ z.literal("1.4"),
371
+ z.literal("1.5"),
372
+ ])
318
373
  .refine((value) => value !== undefined, { message: "Required" }),
319
374
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
320
375
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -332,7 +387,9 @@ export const HistoryLineSchema = z.union([
332
387
  ])
333
388
  .refine((value) => value !== undefined, { message: "Required" }),
334
389
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
335
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
390
+ text_source: z
391
+ .union([z.string(), z.null()])
392
+ .refine((value) => value !== undefined, { message: "Required" }),
336
393
  time_to_first_token_ms: z.union([z.int().gte(0), z.null()]).optional(),
337
394
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
338
395
  tool_ms: z
@@ -386,14 +443,16 @@ export const HistoryLineSchema = z.union([
386
443
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
387
444
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
388
445
  schema_version: z
389
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
446
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
390
447
  .refine((value) => value !== undefined, { message: "Required" }),
391
448
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
392
449
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
393
450
  started_at: z.never().optional(),
394
451
  status: z.lazy(() => StatusSchema).refine((value) => value !== undefined, { message: "Required" }),
395
452
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
396
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
453
+ text_source: z
454
+ .union([z.string(), z.null()])
455
+ .refine((value) => value !== undefined, { message: "Required" }),
397
456
  time_to_first_token_ms: z.never().optional(),
398
457
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
399
458
  tool_ms: z.never().optional(),
@@ -440,7 +499,14 @@ export const HistoryLineSchema = z.union([
440
499
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
441
500
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
442
501
  schema_version: z
443
- .union([z.literal("1.0"), z.literal("1.1"), z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
502
+ .union([
503
+ z.literal("1.0"),
504
+ z.literal("1.1"),
505
+ z.literal("1.2"),
506
+ z.literal("1.3"),
507
+ z.literal("1.4"),
508
+ z.literal("1.5"),
509
+ ])
444
510
  .refine((value) => value !== undefined, { message: "Required" }),
445
511
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
446
512
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -455,7 +521,9 @@ export const HistoryLineSchema = z.union([
455
521
  ])
456
522
  .refine((value) => value !== undefined, { message: "Required" }),
457
523
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
458
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
524
+ text_source: z
525
+ .union([z.string(), z.null()])
526
+ .refine((value) => value !== undefined, { message: "Required" }),
459
527
  time_to_first_token_ms: z.never().optional(),
460
528
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
461
529
  tool_ms: z.never().optional(),
@@ -503,7 +571,7 @@ export const HistoryLineSchema = z.union([
503
571
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
504
572
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
505
573
  schema_version: z
506
- .union([z.literal("1.3"), z.literal("1.4")])
574
+ .union([z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
507
575
  .refine((value) => value !== undefined, { message: "Required" }),
508
576
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
509
577
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -521,7 +589,9 @@ export const HistoryLineSchema = z.union([
521
589
  ])
522
590
  .refine((value) => value !== undefined, { message: "Required" }),
523
591
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
524
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
592
+ text_source: z
593
+ .union([z.string(), z.null()])
594
+ .refine((value) => value !== undefined, { message: "Required" }),
525
595
  time_to_first_token_ms: z.union([z.int().gte(0), z.null()]).optional(),
526
596
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
527
597
  tool_ms: z.never().optional(),
@@ -568,7 +638,14 @@ export const HistoryLineSchema = z.union([
568
638
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
569
639
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
570
640
  schema_version: z
571
- .union([z.literal("1.0"), z.literal("1.1"), z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
641
+ .union([
642
+ z.literal("1.0"),
643
+ z.literal("1.1"),
644
+ z.literal("1.2"),
645
+ z.literal("1.3"),
646
+ z.literal("1.4"),
647
+ z.literal("1.5"),
648
+ ])
572
649
  .refine((value) => value !== undefined, { message: "Required" }),
573
650
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
574
651
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -577,7 +654,9 @@ export const HistoryLineSchema = z.union([
577
654
  .union([z.literal("ok"), z.literal("planned")])
578
655
  .refine((value) => value !== undefined, { message: "Required" }),
579
656
  text: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
580
- text_source: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
657
+ text_source: z
658
+ .union([z.string(), z.null()])
659
+ .refine((value) => value !== undefined, { message: "Required" }),
581
660
  time_to_first_token_ms: z.never().optional(),
582
661
  timestamp: z.string().refine((value) => value !== undefined, { message: "Required" }),
583
662
  tool_ms: z.never().optional(),
@@ -591,7 +670,7 @@ export const HistoryLineSchema = z.union([
591
670
  }),
592
671
  z.intersection(z.looseObject({
593
672
  error: z.string().refine((value) => value !== undefined, { message: "Required" }),
594
- schema_version: z.union([z.literal("1.3"), z.literal("1.4")]).optional(),
673
+ schema_version: z.union([z.literal("1.3"), z.literal("1.4"), z.literal("1.5")]).optional(),
595
674
  }), z.union([
596
675
  z.looseObject({
597
676
  status: z
@@ -605,7 +684,9 @@ export const HistoryLineSchema = z.union([
605
684
  .optional(),
606
685
  }),
607
686
  z.looseObject({
608
- failure_kind: z.literal("tool_deferred").refine((value) => value !== undefined, { message: "Required" }),
687
+ failure_kind: z
688
+ .literal("tool_deferred")
689
+ .refine((value) => value !== undefined, { message: "Required" }),
609
690
  }),
610
691
  ])),
611
692
  ])), z.union([
@@ -622,7 +703,23 @@ export const HistoryLineSchema = z.union([
622
703
  .optional(),
623
704
  }),
624
705
  z.looseObject({
625
- schema_version: z.literal("1.4").optional(),
706
+ schema_version: z.union([z.literal("1.4"), z.literal("1.5")]).optional(),
707
+ }),
708
+ ])), z.union([
709
+ z.looseObject({
710
+ failure_kind: z
711
+ .union([
712
+ z.literal("auth"),
713
+ z.literal("rate_limit"),
714
+ z.literal("model_not_found"),
715
+ z.literal("quota"),
716
+ z.literal("tool_deferred"),
717
+ z.literal(null),
718
+ ])
719
+ .optional(),
720
+ }),
721
+ z.looseObject({
722
+ schema_version: z.literal("1.5").optional(),
626
723
  }),
627
724
  ])),
628
725
  ]);
@@ -653,7 +750,7 @@ export const HistoryLookupBySessionSchema = z.strictObject({
653
750
  .min(1)
654
751
  .refine((value) => value !== undefined, { message: "Required" }),
655
752
  });
656
- export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
753
+ export const HistoryRecordSchema = z.intersection(z.intersection(z.intersection(z.union([
657
754
  z.looseObject({
658
755
  duration_ms: z
659
756
  .int()
@@ -664,7 +761,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
664
761
  z
665
762
  .string()
666
763
  .min(1)
667
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
764
+ .refine((value) => [...value].length <= 2048, {
765
+ message: "Too long: expected at most 2048 characters",
766
+ }),
668
767
  z.null(),
669
768
  ])
670
769
  .optional(),
@@ -751,7 +850,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
751
850
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
752
851
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
753
852
  schema_version: z
754
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
853
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
755
854
  .refine((value) => value !== undefined, { message: "Required" }),
756
855
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
757
856
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -781,7 +880,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
781
880
  z
782
881
  .string()
783
882
  .min(1)
784
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
883
+ .refine((value) => [...value].length <= 2048, {
884
+ message: "Too long: expected at most 2048 characters",
885
+ }),
785
886
  z.null(),
786
887
  ])
787
888
  .optional(),
@@ -828,7 +929,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
828
929
  z.intersection(z.lazy(() => ActionEventSchema), z.looseObject({
829
930
  kind: z.literal("tool_call").refine((value) => value !== undefined, { message: "Required" }),
830
931
  started_at: z.string().refine((value) => value !== undefined, { message: "Required" }),
831
- status: z.literal("interrupted").refine((value) => value !== undefined, { message: "Required" }),
932
+ status: z
933
+ .literal("interrupted")
934
+ .refine((value) => value !== undefined, { message: "Required" }),
832
935
  tool_call_id: z
833
936
  .string()
834
937
  .min(1)
@@ -899,7 +1002,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
899
1002
  z
900
1003
  .string()
901
1004
  .min(1)
902
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1005
+ .refine((value) => [...value].length <= 2048, {
1006
+ message: "Too long: expected at most 2048 characters",
1007
+ }),
903
1008
  z.null(),
904
1009
  ])
905
1010
  .optional(),
@@ -915,7 +1020,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
915
1020
  input: z.unknown().refine((value) => value !== undefined, { message: "Required" }),
916
1021
  kind: z.string().refine((value) => value !== undefined, { message: "Required" }),
917
1022
  name: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
918
- output: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1023
+ output: z
1024
+ .union([z.string(), z.null()])
1025
+ .refine((value) => value !== undefined, { message: "Required" }),
919
1026
  started_at: z.null().optional(),
920
1027
  status: z.null().optional(),
921
1028
  tool_call_id: z.union([z.string(), z.null()]).optional(),
@@ -947,7 +1054,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
947
1054
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
948
1055
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
949
1056
  schema_version: z
950
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
1057
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
951
1058
  .refine((value) => value !== undefined, { message: "Required" }),
952
1059
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
953
1060
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -973,7 +1080,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
973
1080
  z
974
1081
  .string()
975
1082
  .min(1)
976
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1083
+ .refine((value) => [...value].length <= 2048, {
1084
+ message: "Too long: expected at most 2048 characters",
1085
+ }),
977
1086
  z.null(),
978
1087
  ])
979
1088
  .optional(),
@@ -1007,7 +1116,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1007
1116
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
1008
1117
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
1009
1118
  schema_version: z
1010
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
1119
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
1011
1120
  .refine((value) => value !== undefined, { message: "Required" }),
1012
1121
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
1013
1122
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -1030,7 +1139,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1030
1139
  z
1031
1140
  .string()
1032
1141
  .min(1)
1033
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1142
+ .refine((value) => [...value].length <= 2048, {
1143
+ message: "Too long: expected at most 2048 characters",
1144
+ }),
1034
1145
  z.null(),
1035
1146
  ])
1036
1147
  .optional(),
@@ -1061,7 +1172,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1061
1172
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
1062
1173
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
1063
1174
  schema_version: z
1064
- .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4")])
1175
+ .union([z.literal("1.2"), z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
1065
1176
  .refine((value) => value !== undefined, { message: "Required" }),
1066
1177
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
1067
1178
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -1093,7 +1204,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1093
1204
  z
1094
1205
  .string()
1095
1206
  .min(1)
1096
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1207
+ .refine((value) => [...value].length <= 2048, {
1208
+ message: "Too long: expected at most 2048 characters",
1209
+ }),
1097
1210
  z.null(),
1098
1211
  ])
1099
1212
  .optional(),
@@ -1124,7 +1237,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1124
1237
  project: z.string().refine((value) => value !== undefined, { message: "Required" }),
1125
1238
  prompt: z.string().refine((value) => value !== undefined, { message: "Required" }),
1126
1239
  schema_version: z
1127
- .union([z.literal("1.3"), z.literal("1.4")])
1240
+ .union([z.literal("1.3"), z.literal("1.4"), z.literal("1.5")])
1128
1241
  .refine((value) => value !== undefined, { message: "Required" }),
1129
1242
  session: z.string().refine((value) => value !== undefined, { message: "Required" }),
1130
1243
  session_id: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
@@ -1158,7 +1271,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1158
1271
  z
1159
1272
  .string()
1160
1273
  .min(1)
1161
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1274
+ .refine((value) => [...value].length <= 2048, {
1275
+ message: "Too long: expected at most 2048 characters",
1276
+ }),
1162
1277
  z.null(),
1163
1278
  ])
1164
1279
  .optional(),
@@ -1225,7 +1340,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1225
1340
  z
1226
1341
  .string()
1227
1342
  .min(1)
1228
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1343
+ .refine((value) => [...value].length <= 2048, {
1344
+ message: "Too long: expected at most 2048 characters",
1345
+ }),
1229
1346
  z.null(),
1230
1347
  ])
1231
1348
  .optional(),
@@ -1240,7 +1357,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1240
1357
  .refine((value) => value !== undefined, { message: "Required" }),
1241
1358
  input: z.unknown().refine((value) => value !== undefined, { message: "Required" }),
1242
1359
  kind: z.string().refine((value) => value !== undefined, { message: "Required" }),
1243
- name: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1360
+ name: z
1361
+ .union([z.string(), z.null()])
1362
+ .refine((value) => value !== undefined, { message: "Required" }),
1244
1363
  output: z
1245
1364
  .union([z.string(), z.null()])
1246
1365
  .refine((value) => value !== undefined, { message: "Required" }),
@@ -1302,7 +1421,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1302
1421
  z
1303
1422
  .string()
1304
1423
  .min(1)
1305
- .refine((value) => [...value].length <= 2048, { message: "Too long: expected at most 2048 characters" }),
1424
+ .refine((value) => [...value].length <= 2048, {
1425
+ message: "Too long: expected at most 2048 characters",
1426
+ }),
1306
1427
  z.null(),
1307
1428
  ])
1308
1429
  .optional(),
@@ -1316,7 +1437,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1316
1437
  input: z.unknown().refine((value) => value !== undefined, { message: "Required" }),
1317
1438
  kind: z.string().refine((value) => value !== undefined, { message: "Required" }),
1318
1439
  name: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1319
- output: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1440
+ output: z
1441
+ .union([z.string(), z.null()])
1442
+ .refine((value) => value !== undefined, { message: "Required" }),
1320
1443
  })),
1321
1444
  z.null(),
1322
1445
  ])
@@ -1365,7 +1488,7 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1365
1488
  }),
1366
1489
  z.intersection(z.looseObject({
1367
1490
  error: z.string().refine((value) => value !== undefined, { message: "Required" }),
1368
- schema_version: z.union([z.literal("1.3"), z.literal("1.4")]).optional(),
1491
+ schema_version: z.union([z.literal("1.3"), z.literal("1.4"), z.literal("1.5")]).optional(),
1369
1492
  }), z.union([
1370
1493
  z.looseObject({
1371
1494
  status: z
@@ -1396,7 +1519,23 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.union([
1396
1519
  .optional(),
1397
1520
  }),
1398
1521
  z.looseObject({
1399
- schema_version: z.literal("1.4").optional(),
1522
+ schema_version: z.union([z.literal("1.4"), z.literal("1.5")]).optional(),
1523
+ }),
1524
+ ])), z.union([
1525
+ z.looseObject({
1526
+ failure_kind: z
1527
+ .union([
1528
+ z.literal("auth"),
1529
+ z.literal("rate_limit"),
1530
+ z.literal("model_not_found"),
1531
+ z.literal("quota"),
1532
+ z.literal("tool_deferred"),
1533
+ z.literal(null),
1534
+ ])
1535
+ .optional(),
1536
+ }),
1537
+ z.looseObject({
1538
+ schema_version: z.literal("1.5").optional(),
1400
1539
  }),
1401
1540
  ]));
1402
1541
  export const HistoryRecordsSchema = z.array(z.lazy(() => HistoryRecordSchema));
@@ -1487,6 +1626,9 @@ export const RunReportSchema = z.looseObject({
1487
1626
  .refine((value) => value !== undefined, { message: "Required" }),
1488
1627
  bypass_permissions: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
1489
1628
  config_files: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
1629
+ control: z
1630
+ .union([z.lazy(() => ControlReportSchema), z.null()])
1631
+ .refine((value) => value !== undefined, { message: "Required" }),
1490
1632
  dry_run: z.boolean().refine((value) => value !== undefined, { message: "Required" }),
1491
1633
  fallback: z
1492
1634
  .union([z.lazy(() => FallbackReportSchema), z.null()])
@@ -1595,6 +1737,7 @@ export const UsageSchema = z.looseObject({
1595
1737
  input_tokens: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1596
1738
  output_tokens: z.union([z.int().gte(0), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
1597
1739
  });
1740
+ export const UtcInstantSchema = z.string();
1598
1741
  export const VariantInfoSchema = z.looseObject({
1599
1742
  args: z.array(z.string()).refine((value) => value !== undefined, { message: "Required" }),
1600
1743
  bin: z.union([z.string(), z.null()]).refine((value) => value !== undefined, { message: "Required" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneharness/sdk",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
4
4
  "description": "Typed Node.js SDK for oneharness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "node": ">=20"
20
20
  },
21
21
  "dependencies": {
22
- "oneharness-cli": "0.6.9",
22
+ "oneharness-cli": "0.6.11",
23
23
  "zod": "^4.4.3"
24
24
  }
25
25
  }