@oneharness/sdk 0.8.0 → 0.10.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/dist/generated/capabilities.d.ts +34 -0
- package/dist/generated/capabilities.js +24 -0
- package/dist/generated/contracts.d.ts +33 -7
- package/dist/generated/history-line.d.ts +19 -13
- package/dist/generated/history-records.d.ts +17 -11
- package/dist/generated/history-stream-envelope.d.ts +18 -12
- package/dist/generated/history.d.ts +17 -11
- package/dist/generated/run-stream-envelope.d.ts +33 -7
- package/dist/generated/schemas.json +530 -147
- package/dist/generated/zod.d.ts +2 -1
- package/dist/generated/zod.js +80 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -1
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ export type HistoryStreamEnvelope = {
|
|
|
14
14
|
[k: string]: unknown;
|
|
15
15
|
} | ({
|
|
16
16
|
error: string;
|
|
17
|
-
schema_version?: "1.3" | "1.4" | "1.5" | undefined;
|
|
17
|
+
schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | undefined;
|
|
18
18
|
[k: string]: unknown;
|
|
19
19
|
} & ({
|
|
20
20
|
status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
|
|
@@ -26,15 +26,21 @@ export type HistoryStreamEnvelope = {
|
|
|
26
26
|
status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
|
|
27
27
|
[k: string]: unknown;
|
|
28
28
|
} | {
|
|
29
|
-
schema_version?: "1.4" | "1.5" | undefined;
|
|
29
|
+
schema_version?: "1.4" | "1.5" | "1.6" | undefined;
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
}) & (({
|
|
32
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
|
|
33
|
+
[k: string]: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
schema_version?: "1.5" | "1.6" | undefined;
|
|
30
36
|
[k: string]: unknown;
|
|
31
37
|
}) & ({
|
|
32
|
-
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "
|
|
38
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | null;
|
|
33
39
|
[k: string]: unknown;
|
|
34
40
|
} | {
|
|
35
|
-
schema_version?: "1.
|
|
41
|
+
schema_version?: "1.6" | undefined;
|
|
36
42
|
[k: string]: unknown;
|
|
37
|
-
}) & HistoryRecord;
|
|
43
|
+
})) & HistoryRecord;
|
|
38
44
|
type: "record";
|
|
39
45
|
[k: string]: unknown;
|
|
40
46
|
} | {
|
|
@@ -137,7 +143,7 @@ export type HistoryRecord = {
|
|
|
137
143
|
* run's single prompt).
|
|
138
144
|
*/
|
|
139
145
|
prompt: string;
|
|
140
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
146
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
141
147
|
/**
|
|
142
148
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
143
149
|
*/
|
|
@@ -367,7 +373,7 @@ export type HistoryRecord = {
|
|
|
367
373
|
* run's single prompt).
|
|
368
374
|
*/
|
|
369
375
|
prompt: string;
|
|
370
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
376
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
371
377
|
/**
|
|
372
378
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
373
379
|
*/
|
|
@@ -459,7 +465,7 @@ export type HistoryRecord = {
|
|
|
459
465
|
* run's single prompt).
|
|
460
466
|
*/
|
|
461
467
|
prompt: string;
|
|
462
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
468
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
463
469
|
/**
|
|
464
470
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
465
471
|
*/
|
|
@@ -551,7 +557,7 @@ export type HistoryRecord = {
|
|
|
551
557
|
* run's single prompt).
|
|
552
558
|
*/
|
|
553
559
|
prompt: string;
|
|
554
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
560
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
555
561
|
/**
|
|
556
562
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
557
563
|
*/
|
|
@@ -643,7 +649,7 @@ export type HistoryRecord = {
|
|
|
643
649
|
* run's single prompt).
|
|
644
650
|
*/
|
|
645
651
|
prompt: string;
|
|
646
|
-
schema_version: "1.3" | "1.4" | "1.5";
|
|
652
|
+
schema_version: "1.3" | "1.4" | "1.5" | "1.6";
|
|
647
653
|
/**
|
|
648
654
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
649
655
|
*/
|
|
@@ -995,7 +1001,7 @@ export type TimingSource = "provider_measured" | "stdout_observed";
|
|
|
995
1001
|
* the report, history) one definition to share instead of scattered string
|
|
996
1002
|
* literals.
|
|
997
1003
|
*/
|
|
998
|
-
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred";
|
|
1004
|
+
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large";
|
|
999
1005
|
/**
|
|
1000
1006
|
* The outcome of attempting to run one harness.
|
|
1001
1007
|
*/
|
|
@@ -1005,7 +1011,7 @@ export type HistoryEventLine = {
|
|
|
1005
1011
|
harness: string;
|
|
1006
1012
|
harness_id?: string | null | undefined;
|
|
1007
1013
|
run_id: string;
|
|
1008
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
1014
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
1009
1015
|
variant?: string | null | undefined;
|
|
1010
1016
|
[k: string]: unknown;
|
|
1011
1017
|
} | {
|
|
@@ -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" | undefined;
|
|
11
|
+
schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | undefined;
|
|
12
12
|
[k: string]: unknown;
|
|
13
13
|
} & ({
|
|
14
14
|
status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
|
|
@@ -20,15 +20,21 @@ export type HistoryRecord = ({
|
|
|
20
20
|
status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
|
|
21
21
|
[k: string]: unknown;
|
|
22
22
|
} | {
|
|
23
|
-
schema_version?: "1.4" | "1.5" | undefined;
|
|
23
|
+
schema_version?: "1.4" | "1.5" | "1.6" | undefined;
|
|
24
24
|
[k: string]: unknown;
|
|
25
|
-
}) & ({
|
|
26
|
-
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" |
|
|
25
|
+
}) & (({
|
|
26
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
|
|
27
27
|
[k: string]: unknown;
|
|
28
28
|
} | {
|
|
29
|
-
schema_version?: "1.5" | undefined;
|
|
29
|
+
schema_version?: "1.5" | "1.6" | undefined;
|
|
30
30
|
[k: string]: unknown;
|
|
31
31
|
}) & ({
|
|
32
|
+
failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | null;
|
|
33
|
+
[k: string]: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
schema_version?: "1.6" | undefined;
|
|
36
|
+
[k: string]: unknown;
|
|
37
|
+
})) & ({
|
|
32
38
|
duration_ms: number;
|
|
33
39
|
/**
|
|
34
40
|
* Best-effort normalized failure text for a run that did not succeed: the
|
|
@@ -123,7 +129,7 @@ export type HistoryRecord = ({
|
|
|
123
129
|
* run's single prompt).
|
|
124
130
|
*/
|
|
125
131
|
prompt: string;
|
|
126
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
132
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
127
133
|
/**
|
|
128
134
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
129
135
|
*/
|
|
@@ -353,7 +359,7 @@ export type HistoryRecord = ({
|
|
|
353
359
|
* run's single prompt).
|
|
354
360
|
*/
|
|
355
361
|
prompt: string;
|
|
356
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
362
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
357
363
|
/**
|
|
358
364
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
359
365
|
*/
|
|
@@ -445,7 +451,7 @@ export type HistoryRecord = ({
|
|
|
445
451
|
* run's single prompt).
|
|
446
452
|
*/
|
|
447
453
|
prompt: string;
|
|
448
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
454
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
449
455
|
/**
|
|
450
456
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
451
457
|
*/
|
|
@@ -537,7 +543,7 @@ export type HistoryRecord = ({
|
|
|
537
543
|
* run's single prompt).
|
|
538
544
|
*/
|
|
539
545
|
prompt: string;
|
|
540
|
-
schema_version: "1.2" | "1.3" | "1.4" | "1.5";
|
|
546
|
+
schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
|
|
541
547
|
/**
|
|
542
548
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
543
549
|
*/
|
|
@@ -629,7 +635,7 @@ export type HistoryRecord = ({
|
|
|
629
635
|
* run's single prompt).
|
|
630
636
|
*/
|
|
631
637
|
prompt: string;
|
|
632
|
-
schema_version: "1.3" | "1.4" | "1.5";
|
|
638
|
+
schema_version: "1.3" | "1.4" | "1.5" | "1.6";
|
|
633
639
|
/**
|
|
634
640
|
* The oneharness session id this run belongs to (the history file's stem).
|
|
635
641
|
*/
|
|
@@ -981,7 +987,7 @@ export type TimingSource = "provider_measured" | "stdout_observed";
|
|
|
981
987
|
* the report, history) one definition to share instead of scattered string
|
|
982
988
|
* literals.
|
|
983
989
|
*/
|
|
984
|
-
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred";
|
|
990
|
+
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large";
|
|
985
991
|
/**
|
|
986
992
|
* The outcome of attempting to run one harness.
|
|
987
993
|
*/
|
|
@@ -69,6 +69,17 @@ export type ControlReason = "unsupported" | "no_active_turn" | "not_running";
|
|
|
69
69
|
* frame's `v` is what leaves room for `steer` later.
|
|
70
70
|
*/
|
|
71
71
|
export type ControlVerb = "interrupt";
|
|
72
|
+
/**
|
|
73
|
+
* Why a candidate fell through — the closed set [`startup_failure_reason`]
|
|
74
|
+
* decides and [`crate::domain::report::FallThrough`] reports.
|
|
75
|
+
*
|
|
76
|
+
* A type rather than a token, because the set is closed and every reader
|
|
77
|
+
* downstream branches on it: a value no classifier produced cannot be built,
|
|
78
|
+
* and the JSON spelling below is the schema's rather than each call site's. A
|
|
79
|
+
* new variant is a report `schema_version` bump like any other enum value, since
|
|
80
|
+
* a consumer matching exhaustively learns of it only from the version.
|
|
81
|
+
*/
|
|
82
|
+
export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-not-found" | "rate-limit";
|
|
72
83
|
/**
|
|
73
84
|
* The normalized, closed set of failure reasons oneharness can classify from a
|
|
74
85
|
* harness's output. It is the single source for the `failure_kind` contract
|
|
@@ -80,7 +91,7 @@ export type ControlVerb = "interrupt";
|
|
|
80
91
|
* the report, history) one definition to share instead of scattered string
|
|
81
92
|
* literals.
|
|
82
93
|
*/
|
|
83
|
-
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred";
|
|
94
|
+
export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large";
|
|
84
95
|
/**
|
|
85
96
|
* How a harness emits its result, which decides how `text` is extracted.
|
|
86
97
|
*
|
|
@@ -350,7 +361,8 @@ export interface FallbackReport {
|
|
|
350
361
|
/**
|
|
351
362
|
* The candidates fallen through because they could not run the task at all,
|
|
352
363
|
* in priority order, each with why (`not-installed`, `spawn-error`, `auth`,
|
|
353
|
-
* `quota`,
|
|
364
|
+
* `quota`, `session-not-found`, `untrusted-directory`, `input-too-large`,
|
|
365
|
+
* and — on a model fan-out — `model-not-found` / `rate-limit`; see
|
|
354
366
|
* [`crate::domain::fallback::startup_failure_reason`]).
|
|
355
367
|
*/
|
|
356
368
|
fell_through: FallThrough[];
|
|
@@ -365,15 +377,29 @@ export interface FallbackReport {
|
|
|
365
377
|
* One candidate a fallback run fell through, with the reason it could not run.
|
|
366
378
|
*/
|
|
367
379
|
export interface FallThrough {
|
|
380
|
+
/**
|
|
381
|
+
* This candidate's own account of why it could not run: its
|
|
382
|
+
* [`RunResult::error`], copied — one value with one source, not a second
|
|
383
|
+
* rendering of it. `null` when the candidate said nothing beyond its status.
|
|
384
|
+
*
|
|
385
|
+
* So when the provider named the cause in machine-readable terms, what
|
|
386
|
+
* arrives here is the sentence naming the harness with that object **quoted
|
|
387
|
+
* inside it** (`… refused the request before running it:
|
|
388
|
+
* {"input_error_code":"input_too_large",…}`) — the object verbatim, not the
|
|
389
|
+
* object alone. A reader extracts it; nothing paraphrases it on the way.
|
|
390
|
+
*
|
|
391
|
+
* The `reason` above is oneharness's classification and stays a short,
|
|
392
|
+
* closed token; this is the cause underneath it, carried up so a supervisor
|
|
393
|
+
* reading only the fallback block never has to re-parse a fallen-through
|
|
394
|
+
* candidate's raw stdout to learn what the provider already said. Added in
|
|
395
|
+
* report schema `0.8`.
|
|
396
|
+
*/
|
|
397
|
+
detail: string | null;
|
|
368
398
|
/**
|
|
369
399
|
* Canonical harness id.
|
|
370
400
|
*/
|
|
371
401
|
harness: string;
|
|
372
|
-
|
|
373
|
-
* Short reason token (`not-installed` / `spawn-error` / `auth` / `quota` /
|
|
374
|
-
* `model-not-found` / `rate-limit`).
|
|
375
|
-
*/
|
|
376
|
-
reason: string;
|
|
402
|
+
reason: FallThroughReason;
|
|
377
403
|
[k: string]: unknown;
|
|
378
404
|
}
|
|
379
405
|
/**
|