@oneharness/sdk 0.12.1 → 0.13.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.
@@ -8,7 +8,7 @@ export type HistoryRecord = ({
8
8
  [k: string]: unknown;
9
9
  } | ({
10
10
  error: string;
11
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
11
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
12
12
  [k: string]: unknown;
13
13
  } & ({
14
14
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -20,7 +20,7 @@ export type HistoryRecord = ({
20
20
  work?: null | undefined;
21
21
  [k: string]: unknown;
22
22
  } | {
23
- schema_version?: "1.7" | "1.8" | undefined;
23
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
24
24
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
25
25
  work: "done" | "none";
26
26
  [k: string]: unknown;
@@ -29,31 +29,37 @@ export type HistoryRecord = ({
29
29
  [k: string]: unknown;
30
30
  } | {
31
31
  observed_model: string;
32
- schema_version?: "1.8" | undefined;
32
+ schema_version?: "1.8" | "1.9" | undefined;
33
33
  [k: string]: unknown;
34
34
  }) & ({
35
35
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
36
36
  [k: string]: unknown;
37
37
  } | {
38
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
38
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
39
39
  [k: string]: unknown;
40
40
  }) & (({
41
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
41
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
42
42
  [k: string]: unknown;
43
43
  } | {
44
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
44
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
45
45
  [k: string]: unknown;
46
46
  }) & ({
47
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
47
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
48
48
  [k: string]: unknown;
49
49
  } | {
50
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
50
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
51
51
  [k: string]: unknown;
52
52
  }) & ({
53
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
53
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
54
54
  [k: string]: unknown;
55
55
  } | {
56
- schema_version?: "1.8" | undefined;
56
+ schema_version?: "1.8" | "1.9" | undefined;
57
+ [k: string]: unknown;
58
+ }) & ({
59
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
60
+ [k: string]: unknown;
61
+ } | {
62
+ schema_version?: "1.9" | undefined;
57
63
  [k: string]: unknown;
58
64
  })) & ({
59
65
  duration_ms: number;
@@ -169,7 +175,7 @@ export type HistoryRecord = ({
169
175
  * run's single prompt).
170
176
  */
171
177
  prompt: string;
172
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
178
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
173
179
  /**
174
180
  * The oneharness session id this run belongs to (the history file's stem).
175
181
  */
@@ -469,7 +475,7 @@ export type HistoryRecord = ({
469
475
  * run's single prompt).
470
476
  */
471
477
  prompt: string;
472
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
478
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
473
479
  /**
474
480
  * The oneharness session id this run belongs to (the history file's stem).
475
481
  */
@@ -596,7 +602,7 @@ export type HistoryRecord = ({
596
602
  * run's single prompt).
597
603
  */
598
604
  prompt: string;
599
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
605
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
600
606
  /**
601
607
  * The oneharness session id this run belongs to (the history file's stem).
602
608
  */
@@ -723,7 +729,7 @@ export type HistoryRecord = ({
723
729
  * run's single prompt).
724
730
  */
725
731
  prompt: string;
726
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
732
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
727
733
  /**
728
734
  * The oneharness session id this run belongs to (the history file's stem).
729
735
  */
@@ -850,7 +856,7 @@ export type HistoryRecord = ({
850
856
  * run's single prompt).
851
857
  */
852
858
  prompt: string;
853
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
859
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
854
860
  /**
855
861
  * The oneharness session id this run belongs to (the history file's stem).
856
862
  */
@@ -1317,13 +1323,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1317
1323
  * harness's output. It is the single source for the `failure_kind` contract
1318
1324
  * value: serialized as the snake_case token a consumer reads in the report
1319
1325
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1320
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1326
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1321
1327
  * keeps a misspelled or invalid kind unrepresentable and gives every
1322
1328
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1323
1329
  * the report, history) one definition to share instead of scattered string
1324
1330
  * literals.
1325
1331
  */
1326
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1332
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1327
1333
  /**
1328
1334
  * The outcome of attempting to run one harness.
1329
1335
  */
@@ -1336,8 +1342,9 @@ export type Status = "ok" | "nonzero" | "timeout" | "cancelled" | "spawn-error"
1336
1342
  *
1337
1343
  * - **Tool events.** A recorded tool call is the harness acting on the task.
1338
1344
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
1339
- * `signals::record_reports_work` classifies a raw harness record with, so the
1340
- * two readings of "billed" are one contract with one implementation.
1345
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
1346
+ * in this same type, so the two readings of "billed" are one contract with one
1347
+ * implementation.
1341
1348
  *
1342
1349
  * It is also a **published reading**, not only an internal one: a run that
1343
1350
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -130,6 +130,10 @@ export interface RunOptions {
130
130
  * Max retries when a response fails schema validation.
131
131
  */
132
132
  schemaMaxRetries?: number | undefined;
133
+ /**
134
+ * Max retries for a zero-work Codex server-overloaded refusal.
135
+ */
136
+ serverOverloadedMaxRetries?: number | undefined;
133
137
  session?: string | undefined;
134
138
  /**
135
139
  * Directory the `session` store lives in.
@@ -79,19 +79,19 @@ export type ControlVerb = "interrupt";
79
79
  * new variant is a report `schema_version` bump like any other enum value, since
80
80
  * a consumer matching exhaustively learns of it only from the version.
81
81
  */
82
- export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit";
82
+ export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit" | "server-overloaded";
83
83
  /**
84
84
  * The normalized, closed set of failure reasons oneharness can classify from a
85
85
  * harness's output. It is the single source for the `failure_kind` contract
86
86
  * value: serialized as the snake_case token a consumer reads in the report
87
87
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
88
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
88
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
89
89
  * keeps a misspelled or invalid kind unrepresentable and gives every
90
90
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
91
91
  * the report, history) one definition to share instead of scattered string
92
92
  * literals.
93
93
  */
94
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
94
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
95
95
  /**
96
96
  * How a harness emits its result, which decides how `text` is extracted.
97
97
  *
@@ -144,8 +144,9 @@ export type ExecutionTelemetry = {
144
144
  *
145
145
  * - **Tool events.** A recorded tool call is the harness acting on the task.
146
146
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
147
- * `signals::record_reports_work` classifies a raw harness record with, so the
148
- * two readings of "billed" are one contract with one implementation.
147
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
148
+ * in this same type, so the two readings of "billed" are one contract with one
149
+ * implementation.
149
150
  *
150
151
  * It is also a **published reading**, not only an internal one: a run that
151
152
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -494,11 +495,11 @@ export interface RunResult {
494
495
  * `status`, which records oneharness's relationship to the process. Two
495
496
  * families: coarse reasons for a non-zero run (`auth`, `rate_limit`,
496
497
  * `model_not_found`, `quota`, `session_not_found`, `untrusted_directory`,
497
- * `input_too_large`, `model_mismatch`), and `tool_deferred` — a run that exited
498
- * *cleanly* but only deferred a builtin tool call instead of executing it
499
- * (Claude Code bridge/managed deployments), so it did no useful work. The
500
- * deferred case is the only `failure_kind` that can appear on a `status: ok`
501
- * run, and it also marks the run as failed for exit-code purposes.
498
+ * `input_too_large`, `model_mismatch`, `server_overloaded`), and
499
+ * `tool_deferred` — a run that only deferred a builtin tool call instead of
500
+ * executing it (Claude Code bridge/managed deployments), so it did no useful
501
+ * work. Both `tool_deferred` and `server_overloaded` can accompany a clean
502
+ * transport exit; either still marks the run as failed for exit-code purposes.
502
503
  * Serialized as its snake_case token (see [`FailureKind`]).
503
504
  */
504
505
  failure_kind: FailureKind | null;