@oneharness/sdk 0.26.0 → 0.27.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.
- package/README.md +1 -1
- package/dist/generated/capabilities.d.ts +113 -0
- package/dist/generated/capabilities.js +134 -0
- package/dist/generated/compact-options.d.ts +26 -0
- package/dist/generated/compact-options.js +2 -0
- package/dist/generated/compact-outcome.d.ts +72 -0
- package/dist/generated/compact-outcome.js +2 -0
- package/dist/generated/config-report.d.ts +42 -24
- package/dist/generated/contracts.d.ts +74 -6
- package/dist/generated/history-line.d.ts +29 -23
- package/dist/generated/history-show-entries.d.ts +26 -20
- package/dist/generated/history-stream-envelope.d.ts +27 -21
- package/dist/generated/history.d.ts +26 -20
- package/dist/generated/options.d.ts +30 -0
- package/dist/generated/registry.d.ts +32 -0
- package/dist/generated/run-stream-envelope.d.ts +73 -5
- package/dist/generated/schemas.json +1004 -100
- package/dist/generated/zod.d.ts +12 -3
- package/dist/generated/zod.js +202 -27
- package/dist/index.d.ts +13 -0
- package/dist/index.js +12 -1
- package/package.json +2 -2
|
@@ -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" | "1.9" | "1.10" | "1.11" | undefined;
|
|
11
|
+
schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | 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" | "1.9" | "1.10" | "1.11" | undefined;
|
|
23
|
+
schema_version?: "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | undefined;
|
|
24
24
|
status?: "nonzero" | "timeout" | "cancelled" | undefined;
|
|
25
25
|
work: "done" | "none";
|
|
26
26
|
[k: string]: unknown;
|
|
@@ -29,43 +29,49 @@ export type HistoryRecord = ({
|
|
|
29
29
|
[k: string]: unknown;
|
|
30
30
|
} | {
|
|
31
31
|
observed_model: string;
|
|
32
|
-
schema_version?: "1.8" | "1.9" | "1.10" | "1.11" | undefined;
|
|
32
|
+
schema_version?: "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | 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" | "1.9" | "1.10" | "1.11" | undefined;
|
|
38
|
+
schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | 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" | "server_overloaded" | "app_server_lost" | null;
|
|
41
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost" | "unsupported_input" | null;
|
|
42
42
|
[k: string]: unknown;
|
|
43
43
|
} | {
|
|
44
|
-
schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | undefined;
|
|
44
|
+
schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | 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" | "server_overloaded" | "app_server_lost" | null;
|
|
47
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | "app_server_lost" | "unsupported_input" | null;
|
|
48
48
|
[k: string]: unknown;
|
|
49
49
|
} | {
|
|
50
|
-
schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | undefined;
|
|
50
|
+
schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | 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" | "server_overloaded" | "app_server_lost" | null;
|
|
53
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | "app_server_lost" | "unsupported_input" | null;
|
|
54
54
|
[k: string]: unknown;
|
|
55
55
|
} | {
|
|
56
|
-
schema_version?: "1.8" | "1.9" | "1.10" | "1.11" | undefined;
|
|
56
|
+
schema_version?: "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | undefined;
|
|
57
57
|
[k: string]: unknown;
|
|
58
58
|
}) & ({
|
|
59
|
-
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "app_server_lost" | null;
|
|
59
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "app_server_lost" | "unsupported_input" | null;
|
|
60
60
|
[k: string]: unknown;
|
|
61
61
|
} | {
|
|
62
|
-
schema_version?: "1.9" | "1.10" | "1.11" | undefined;
|
|
62
|
+
schema_version?: "1.9" | "1.10" | "1.11" | "1.12" | undefined;
|
|
63
63
|
[k: string]: unknown;
|
|
64
64
|
}) & ({
|
|
65
|
-
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
|
|
65
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "unsupported_input" | null;
|
|
66
66
|
[k: string]: unknown;
|
|
67
67
|
} | {
|
|
68
|
-
schema_version?: "1.10" | "1.11" | undefined;
|
|
68
|
+
schema_version?: "1.10" | "1.11" | "1.12" | undefined;
|
|
69
|
+
[k: string]: unknown;
|
|
70
|
+
}) & ({
|
|
71
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost" | null;
|
|
72
|
+
[k: string]: unknown;
|
|
73
|
+
} | {
|
|
74
|
+
schema_version?: "1.12" | undefined;
|
|
69
75
|
[k: string]: unknown;
|
|
70
76
|
})) & ({
|
|
71
77
|
duration_ms: number;
|
|
@@ -184,7 +190,7 @@ export type HistoryRecord = ({
|
|
|
184
190
|
* run's single prompt).
|
|
185
191
|
*/
|
|
186
192
|
prompt: string;
|
|
187
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11";
|
|
193
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12";
|
|
188
194
|
/**
|
|
189
195
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
190
196
|
*/
|
|
@@ -487,7 +493,7 @@ export type HistoryRecord = ({
|
|
|
487
493
|
* run's single prompt).
|
|
488
494
|
*/
|
|
489
495
|
prompt: string;
|
|
490
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11";
|
|
496
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12";
|
|
491
497
|
/**
|
|
492
498
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
493
499
|
*/
|
|
@@ -614,7 +620,7 @@ export type HistoryRecord = ({
|
|
|
614
620
|
* run's single prompt).
|
|
615
621
|
*/
|
|
616
622
|
prompt: string;
|
|
617
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11";
|
|
623
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12";
|
|
618
624
|
/**
|
|
619
625
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
620
626
|
*/
|
|
@@ -741,7 +747,7 @@ export type HistoryRecord = ({
|
|
|
741
747
|
* run's single prompt).
|
|
742
748
|
*/
|
|
743
749
|
prompt: string;
|
|
744
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11";
|
|
750
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12";
|
|
745
751
|
/**
|
|
746
752
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
747
753
|
*/
|
|
@@ -868,7 +874,7 @@ export type HistoryRecord = ({
|
|
|
868
874
|
* run's single prompt).
|
|
869
875
|
*/
|
|
870
876
|
prompt: string;
|
|
871
|
-
schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11";
|
|
877
|
+
schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12";
|
|
872
878
|
/**
|
|
873
879
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
874
880
|
*/
|
|
@@ -1341,7 +1347,7 @@ export type TimingSource = "provider_measured" | "stdout_observed";
|
|
|
1341
1347
|
* the report, history) one definition to share instead of scattered string
|
|
1342
1348
|
* literals.
|
|
1343
1349
|
*/
|
|
1344
|
-
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost";
|
|
1350
|
+
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost" | "unsupported_input";
|
|
1345
1351
|
/**
|
|
1346
1352
|
* The outcome of attempting to run one harness.
|
|
1347
1353
|
*/
|
|
@@ -26,6 +26,10 @@ export type OutputFormat = "text" | "json" | "stream-json";
|
|
|
26
26
|
* free of `clap`.
|
|
27
27
|
*/
|
|
28
28
|
export type RunMode = "parallel" | "fallback";
|
|
29
|
+
/**
|
|
30
|
+
* A harness-agnostic class of built-in tool a turn may load (`tool_set`).
|
|
31
|
+
*/
|
|
32
|
+
export type ToolClass = "shell" | "read";
|
|
29
33
|
/**
|
|
30
34
|
* Options accepted by `OneHarness.run()` in the published Node SDK.
|
|
31
35
|
*
|
|
@@ -38,6 +42,11 @@ export interface RunOptions {
|
|
|
38
42
|
* Run against every supported harness.
|
|
39
43
|
*/
|
|
40
44
|
all?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Compact a session's context once it reaches this many tokens (a
|
|
47
|
+
* positive integer), through each harness's own knob.
|
|
48
|
+
*/
|
|
49
|
+
autoCompactTokens?: number | undefined;
|
|
41
50
|
/**
|
|
42
51
|
* Further prompts, making this a **batch**: one harness fanned over each
|
|
43
52
|
* prompt, sharing the cacheable `system`/model prefix. Combined order is
|
|
@@ -81,6 +90,10 @@ export interface RunOptions {
|
|
|
81
90
|
* unset — leave the option out to name no file.
|
|
82
91
|
*/
|
|
83
92
|
historyPointerFile?: string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Image files attached to the prompt as images the model sees.
|
|
95
|
+
*/
|
|
96
|
+
images?: readonly string[] | undefined;
|
|
84
97
|
/**
|
|
85
98
|
* Maximum harnesses (or, in a batch, prompts) to run concurrently.
|
|
86
99
|
*/
|
|
@@ -106,6 +119,14 @@ export interface RunOptions {
|
|
|
106
119
|
* `ONEHARNESS_HISTORY` environment override.
|
|
107
120
|
*/
|
|
108
121
|
noHistory?: boolean | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Load no MCP server or MCP tool.
|
|
124
|
+
*/
|
|
125
|
+
noMcp?: boolean | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Load no skills list.
|
|
128
|
+
*/
|
|
129
|
+
noSkills?: boolean | undefined;
|
|
109
130
|
/**
|
|
110
131
|
* Write each harness's raw stdout/stderr under this directory.
|
|
111
132
|
*/
|
|
@@ -166,6 +187,15 @@ export interface RunOptions {
|
|
|
166
187
|
*/
|
|
167
188
|
systemFile?: string | undefined;
|
|
168
189
|
timeoutSeconds?: number | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Load only these built-in tool classes; every other built-in tool is
|
|
192
|
+
* not loaded. At least one: each class is sent as its own `--tool-set`,
|
|
193
|
+
* so an empty array would send nothing at all and is refused rather than
|
|
194
|
+
* silently loading the harness's own tools.
|
|
195
|
+
*
|
|
196
|
+
* @minItems 1
|
|
197
|
+
*/
|
|
198
|
+
toolSet?: readonly ToolClass[] | undefined;
|
|
169
199
|
}
|
|
170
200
|
export interface HistoryLabels {
|
|
171
201
|
[k: string]: string;
|
|
@@ -83,6 +83,21 @@ export interface HarnessInfo {
|
|
|
83
83
|
* into that file (see the README support matrix).
|
|
84
84
|
*/
|
|
85
85
|
supports_allowed_tools: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether `auto_compact_tokens` reaches this harness's own compaction
|
|
88
|
+
* knob. Every `supports_*` flag below is read from the translation table
|
|
89
|
+
* ([`crate::domain::lean::TRANSLATIONS`]): `false` means a run asking for
|
|
90
|
+
* the setting carries a diagnostic (or, for images, refuses the harness).
|
|
91
|
+
*/
|
|
92
|
+
supports_auto_compact: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether a result's `calls` can carry per-call usage.
|
|
95
|
+
*/
|
|
96
|
+
supports_call_usage: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether `oneharness compact` can compact this harness's sessions.
|
|
99
|
+
*/
|
|
100
|
+
supports_compact_now: boolean;
|
|
86
101
|
supports_denied_tools: boolean;
|
|
87
102
|
/**
|
|
88
103
|
* Whether `run --resume <session> --fork` is supported — branching a new
|
|
@@ -90,6 +105,14 @@ export interface HarnessInfo {
|
|
|
90
105
|
*/
|
|
91
106
|
supports_fork: boolean;
|
|
92
107
|
supports_hooks: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Whether `images` reach the model as images.
|
|
110
|
+
*/
|
|
111
|
+
supports_images: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether `load_mcp = false` loads no MCP server.
|
|
114
|
+
*/
|
|
115
|
+
supports_mcp_off: boolean;
|
|
93
116
|
/**
|
|
94
117
|
* Whether `oneharness mock <id>` can express a pre-tool *deny* for this
|
|
95
118
|
* harness (the same protocol `oneharness gate` speaks).
|
|
@@ -118,6 +141,10 @@ export interface HarnessInfo {
|
|
|
118
141
|
* Whether `run --resume <session>` is supported for this harness.
|
|
119
142
|
*/
|
|
120
143
|
supports_resume: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Whether `load_skills = false` loads no skills list.
|
|
146
|
+
*/
|
|
147
|
+
supports_skills_off: boolean;
|
|
121
148
|
/**
|
|
122
149
|
* Whether a large system prompt can be delivered off the argv via a file
|
|
123
150
|
* flag (Claude Code's `--append-system-prompt-file`). `false` does not mean a
|
|
@@ -125,6 +152,11 @@ export interface HarnessInfo {
|
|
|
125
152
|
* travels on stdin with the prompt; see the README large-prompt matrix.
|
|
126
153
|
*/
|
|
127
154
|
supports_system_file: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Whether `tool_set` loads exactly the named classes (`false` for codex,
|
|
157
|
+
* which applies it in part and says so).
|
|
158
|
+
*/
|
|
159
|
+
supports_tool_set: boolean;
|
|
128
160
|
/**
|
|
129
161
|
* The project-scoped config file `oneharness sync` writes for this
|
|
130
162
|
* harness; `null` when it has none (sync settings are then rejected).
|
|
@@ -90,7 +90,11 @@ export type ControlVerb = "interrupt";
|
|
|
90
90
|
* new variant is a report `schema_version` bump like any other enum value, since
|
|
91
91
|
* a consumer matching exhaustively learns of it only from the version.
|
|
92
92
|
*/
|
|
93
|
-
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" | "app-server-lost";
|
|
93
|
+
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" | "app-server-lost" | "unsupported-input";
|
|
94
|
+
/**
|
|
95
|
+
* One of the settings this module translates.
|
|
96
|
+
*/
|
|
97
|
+
export type Setting = "auto_compact_tokens" | "compact_now" | "tool_set" | "load_skills" | "load_mcp" | "images" | "calls";
|
|
94
98
|
/**
|
|
95
99
|
* The normalized, closed set of failure reasons oneharness can classify from a
|
|
96
100
|
* harness's output. It is the single source for the `failure_kind` contract
|
|
@@ -102,7 +106,7 @@ export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quot
|
|
|
102
106
|
* the report, history) one definition to share instead of scattered string
|
|
103
107
|
* literals.
|
|
104
108
|
*/
|
|
105
|
-
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost";
|
|
109
|
+
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | "app_server_lost" | "unsupported_input";
|
|
106
110
|
/**
|
|
107
111
|
* How a harness emits its result, which decides how `text` is extracted.
|
|
108
112
|
*
|
|
@@ -504,10 +508,26 @@ export interface RunResult {
|
|
|
504
508
|
* The binary name or path oneharness resolved and would invoke.
|
|
505
509
|
*/
|
|
506
510
|
bin: string;
|
|
511
|
+
/**
|
|
512
|
+
* One usage per model call the turn made, in order, read from the
|
|
513
|
+
* harness's own stream or session record (see
|
|
514
|
+
* [`crate::domain::lean::Setting::Calls`]). Like `usage`, it covers the
|
|
515
|
+
* run's final attempt when a retry ran it again. Absent where the harness
|
|
516
|
+
* exposes no per-call figures, and then `diagnostics` says why. The
|
|
517
|
+
* run's `usage` total is unchanged by it. Added in report schema `0.13`.
|
|
518
|
+
*/
|
|
519
|
+
calls?: Usage[] | null | undefined;
|
|
507
520
|
/**
|
|
508
521
|
* The exact argv oneharness built; its first element is the binary.
|
|
509
522
|
*/
|
|
510
523
|
command: string[];
|
|
524
|
+
/**
|
|
525
|
+
* Each setting this run's harness could not apply, or applied in part
|
|
526
|
+
* (`auto_compact_tokens`, `tool_set`, `load_skills`, `load_mcp`, `calls`):
|
|
527
|
+
* the run proceeded, and this says what it did instead. Absent when
|
|
528
|
+
* empty. Added in report schema `0.13`.
|
|
529
|
+
*/
|
|
530
|
+
diagnostics?: Diagnostic[] | undefined;
|
|
511
531
|
/**
|
|
512
532
|
* Wall-clock duration of the run; `null` when not executed.
|
|
513
533
|
*/
|
|
@@ -648,7 +668,7 @@ export interface RunResult {
|
|
|
648
668
|
* How `text` was extracted (e.g. `json:result`, `raw`); `null` when absent.
|
|
649
669
|
*/
|
|
650
670
|
text_source: string | null;
|
|
651
|
-
usage:
|
|
671
|
+
usage: Usage1;
|
|
652
672
|
/**
|
|
653
673
|
* How `usage` was read (e.g. `json`); `null` when nothing was found.
|
|
654
674
|
*/
|
|
@@ -676,8 +696,9 @@ export interface RunResult {
|
|
|
676
696
|
[k: string]: unknown;
|
|
677
697
|
}
|
|
678
698
|
/**
|
|
679
|
-
*
|
|
680
|
-
*
|
|
699
|
+
* Normalized token/cost accounting. Every field is best-effort and independently
|
|
700
|
+
* nullable: a harness may report tokens but not dollar cost (cost is commonly
|
|
701
|
+
* absent on subscription auth), or report nothing at all (plain-text harnesses).
|
|
681
702
|
*/
|
|
682
703
|
export interface Usage {
|
|
683
704
|
/**
|
|
@@ -706,6 +727,53 @@ export interface Usage {
|
|
|
706
727
|
output_tokens: number | null;
|
|
707
728
|
[k: string]: unknown;
|
|
708
729
|
}
|
|
730
|
+
/**
|
|
731
|
+
* A setting a harness could not apply, named in the run's report.
|
|
732
|
+
*/
|
|
733
|
+
export interface Diagnostic {
|
|
734
|
+
/**
|
|
735
|
+
* The harness id the run used.
|
|
736
|
+
*/
|
|
737
|
+
harness: string;
|
|
738
|
+
/**
|
|
739
|
+
* What happened instead.
|
|
740
|
+
*/
|
|
741
|
+
message: string;
|
|
742
|
+
setting: Setting;
|
|
743
|
+
[k: string]: unknown;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Normalized token/cost accounting. Every field is best-effort and independently
|
|
747
|
+
* nullable: a harness may report tokens but not dollar cost (cost is commonly
|
|
748
|
+
* absent on subscription auth), or report nothing at all (plain-text harnesses).
|
|
749
|
+
*/
|
|
750
|
+
export interface Usage1 {
|
|
751
|
+
/**
|
|
752
|
+
* Prompt tokens served from the provider's prompt cache (a cheap read of a
|
|
753
|
+
* previously-written prefix), when the harness reports them. `None` when the
|
|
754
|
+
* harness does not surface cache counts — never `0` as a guess.
|
|
755
|
+
*/
|
|
756
|
+
cache_read_tokens: number | null;
|
|
757
|
+
/**
|
|
758
|
+
* Prompt tokens written to the provider's prompt cache (a.k.a. cache
|
|
759
|
+
* creation), when the harness reports them. `None` when not surfaced.
|
|
760
|
+
*/
|
|
761
|
+
cache_write_tokens: number | null;
|
|
762
|
+
/**
|
|
763
|
+
* Total cost in USD, when the harness reports it (often absent on
|
|
764
|
+
* subscription auth, where there is no per-call dollar figure).
|
|
765
|
+
*/
|
|
766
|
+
cost_usd: number | null;
|
|
767
|
+
/**
|
|
768
|
+
* Prompt/input tokens billed, when the harness reports them.
|
|
769
|
+
*/
|
|
770
|
+
input_tokens: number | null;
|
|
771
|
+
/**
|
|
772
|
+
* Completion/output tokens billed, when the harness reports them.
|
|
773
|
+
*/
|
|
774
|
+
output_tokens: number | null;
|
|
775
|
+
[k: string]: unknown;
|
|
776
|
+
}
|
|
709
777
|
/**
|
|
710
778
|
* The uniform session handle for a run (`--session`). Present on
|
|
711
779
|
* [`RunReport::session`] only when `--session <name>` was requested.
|