@oneharness/sdk 0.6.14 → 0.6.16

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/generated/capabilities.d.ts +1010 -0
  3. package/dist/generated/capabilities.js +1162 -0
  4. package/dist/generated/config-options.d.ts +8 -0
  5. package/dist/generated/config-options.js +2 -0
  6. package/dist/generated/config-report.d.ts +283 -0
  7. package/dist/generated/config-report.js +2 -0
  8. package/dist/generated/detect-options.d.ts +19 -0
  9. package/dist/generated/detect-options.js +2 -0
  10. package/dist/generated/detection.d.ts +6 -0
  11. package/dist/generated/gate-options.d.ts +17 -0
  12. package/dist/generated/gate-options.js +2 -0
  13. package/dist/generated/history-clear-options.d.ts +15 -0
  14. package/dist/generated/history-clear-options.js +2 -0
  15. package/dist/generated/history-clear-report.d.ts +39 -0
  16. package/dist/generated/history-clear-report.js +2 -0
  17. package/dist/generated/history-list-options.d.ts +13 -0
  18. package/dist/generated/history-lookup.d.ts +26 -0
  19. package/dist/generated/history-migrate-options.d.ts +8 -0
  20. package/dist/generated/history-migrate-options.js +2 -0
  21. package/dist/generated/history-migrate-report.d.ts +31 -0
  22. package/dist/generated/history-migrate-report.js +2 -0
  23. package/dist/generated/history-watch-options.d.ts +13 -0
  24. package/dist/generated/init-options.d.ts +11 -0
  25. package/dist/generated/init-options.js +2 -0
  26. package/dist/generated/interrupt-options.d.ts +12 -0
  27. package/dist/generated/interrupt-options.js +2 -0
  28. package/dist/generated/interrupt-response.d.ts +40 -0
  29. package/dist/generated/interrupt-response.js +2 -0
  30. package/dist/generated/mock-options.d.ts +12 -0
  31. package/dist/generated/mock-options.js +2 -0
  32. package/dist/generated/options.d.ts +108 -0
  33. package/dist/generated/registry.d.ts +14 -4
  34. package/dist/generated/schemas.json +3245 -15
  35. package/dist/generated/sync-options.d.ts +14 -0
  36. package/dist/generated/sync-options.js +2 -0
  37. package/dist/generated/sync-report.d.ts +64 -0
  38. package/dist/generated/sync-report.js +2 -0
  39. package/dist/generated/usage-options.d.ts +15 -0
  40. package/dist/generated/usage-options.js +2 -0
  41. package/dist/generated/usage-report.d.ts +241 -0
  42. package/dist/generated/usage-report.js +2 -0
  43. package/dist/generated/zod.d.ts +70 -2
  44. package/dist/generated/zod.js +444 -0
  45. package/dist/index.d.ts +91 -1
  46. package/dist/index.js +271 -102
  47. package/package.json +2 -2
@@ -1,3 +1,9 @@
1
+ /**
2
+ * How a batch of same-prefix prompts is scheduled across the parallel runner.
3
+ * Also accepted as a CLI value (`--batch-strategy`, parsed in the `oneharness`
4
+ * binary) — the parsing lives there so this core crate stays free of `clap`.
5
+ */
6
+ export type BatchStrategy = "speed" | "min-tokens";
1
7
  /**
2
8
  * The unified approval mode, from least to most autonomy. A harness may not
3
9
  * support every value (see [`crate::domain::harness::HarnessSpec::mode`]); the
@@ -5,6 +11,21 @@
5
11
  * downgrading it.
6
12
  */
7
13
  export type PermissionMode = "read-only" | "plan" | "default" | "edit" | "auto" | "bypass";
14
+ /**
15
+ * How a harness emits its result, which decides how `text` is extracted.
16
+ *
17
+ * Also accepted as a CLI value (`--output-format`, parsed in the `oneharness`
18
+ * binary) and a config-file value (`output_format`, via `Deserialize`). The
19
+ * CLI parsing lives in the binary so this core crate stays free of `clap`.
20
+ */
21
+ export type OutputFormat = "text" | "json" | "stream-json";
22
+ /**
23
+ * How the selected harnesses are run. Accepted as a CLI value (`--run-mode`,
24
+ * parsed in the `oneharness` binary) and a config-file value (`run_mode`, via
25
+ * `Deserialize`); the CLI parsing lives in the binary so this core crate stays
26
+ * free of `clap`.
27
+ */
28
+ export type RunMode = "parallel" | "fallback";
8
29
  /**
9
30
  * Options accepted by `OneHarness.run()` in the published Node SDK.
10
31
  *
@@ -13,30 +34,117 @@ export type PermissionMode = "read-only" | "plan" | "default" | "edit" | "auto"
13
34
  * schemas preserve unknown fields for forward compatibility.
14
35
  */
15
36
  export interface RunOptions {
37
+ /**
38
+ * Run against every supported harness.
39
+ */
40
+ all?: boolean | undefined;
41
+ /**
42
+ * Further prompts, making this a **batch**: one harness fanned over each
43
+ * prompt, sharing the cacheable `system`/model prefix. Combined order is
44
+ * `prompt`, then these, then `promptFiles` — the CLI's own order.
45
+ */
46
+ batchPrompts?: readonly string[] | undefined;
47
+ batchStrategy?: BatchStrategy | undefined;
16
48
  bins?: {
17
49
  [k: string]: string;
18
50
  } | undefined;
51
+ config?: string | undefined;
52
+ /**
53
+ * Open the out-of-band turn-control socket, so a separate `interrupt()`
54
+ * can abort the in-flight turn without killing this run.
55
+ */
56
+ control?: boolean | undefined;
19
57
  cwd?: string | undefined;
20
58
  env?: {
21
59
  [k: string]: string;
22
60
  } | undefined;
23
61
  events?: boolean | undefined;
62
+ /**
63
+ * Harness id(s) to drop from an all-harness run.
64
+ */
65
+ exclude?: readonly string[] | undefined;
24
66
  fork?: boolean | undefined;
25
67
  harnesses?: readonly string[] | undefined;
26
68
  history?: boolean | undefined;
27
69
  historyDir?: string | undefined;
28
70
  historyLabels?: HistoryLabels | undefined;
29
71
  historyName?: string | undefined;
72
+ /**
73
+ * Maximum harnesses (or, in a batch, prompts) to run concurrently.
74
+ */
75
+ maxParallel?: number | undefined;
76
+ /**
77
+ * Replace these selected harnesses' provider processes with oneharness's
78
+ * deterministic `MOCK_*`-scripted responder.
79
+ */
80
+ mockHarnesses?: readonly string[] | undefined;
81
+ /**
82
+ * Mock/spy the selected harnesses' tool calls for this run only.
83
+ */
84
+ mockRules?: string | undefined;
30
85
  mode?: PermissionMode | undefined;
31
86
  models?: readonly string[] | undefined;
87
+ noConfig?: boolean | undefined;
88
+ /**
89
+ * Do NOT record history for this run, overriding config or the
90
+ * `ONEHARNESS_HISTORY` environment override.
91
+ */
92
+ noHistory?: boolean | undefined;
93
+ /**
94
+ * Write each harness's raw stdout/stderr under this directory.
95
+ */
96
+ outputDir?: string | undefined;
97
+ outputFormat?: OutputFormat | undefined;
98
+ /**
99
+ * Extra arguments appended verbatim to each harness command, after `--`.
100
+ */
101
+ passthrough?: readonly string[] | undefined;
102
+ /**
103
+ * Silence the warning that the chosen mode may block on an approval prompt.
104
+ */
105
+ permitPrompts?: boolean | undefined;
106
+ /**
107
+ * Build and report each command without executing it.
108
+ */
109
+ printCommand?: boolean | undefined;
32
110
  /**
33
111
  * The user message sent to the selected harnesses.
34
112
  */
35
113
  prompt: string;
114
+ /**
115
+ * Files each holding one whole prompt, or `-` for stdin.
116
+ */
117
+ promptFiles?: readonly string[] | undefined;
36
118
  reasoning?: string | undefined;
119
+ /**
120
+ * Treat a not-installed harness as a failure.
121
+ */
122
+ requireAvailable?: boolean | undefined;
37
123
  resume?: string | undefined;
124
+ runMode?: RunMode | undefined;
125
+ /**
126
+ * Constrain each harness's final answer to this JSON Schema file.
127
+ */
128
+ schema?: string | undefined;
129
+ /**
130
+ * Max retries when a response fails schema validation.
131
+ */
132
+ schemaMaxRetries?: number | undefined;
38
133
  session?: string | undefined;
134
+ /**
135
+ * Directory the `session` store lives in.
136
+ */
137
+ sessionDir?: string | undefined;
138
+ /**
139
+ * Append one JSONL record per observed tool call to this file.
140
+ */
141
+ spyFile?: string | undefined;
39
142
  system?: string | undefined;
143
+ /**
144
+ * Read the system prompt from a file — the counterpart to `system` for a
145
+ * value too large to pass on the argv.
146
+ */
147
+ systemFile?: string | undefined;
40
148
  timeoutSeconds?: number | undefined;
41
149
  }
42
150
  export interface HistoryLabels {
@@ -23,11 +23,17 @@ export type PermissionMode = "read-only" | "plan" | "default" | "edit" | "auto"
23
23
  * CLI parsing lives in the binary so this core crate stays free of `clap`.
24
24
  */
25
25
  export type OutputFormat = "text" | "json" | "stream-json";
26
+ /**
27
+ * The `oneharness list` output contract.
28
+ */
26
29
  export interface ListReport {
27
30
  harnesses: HarnessInfo[];
28
31
  schema_version: string;
29
32
  [k: string]: unknown;
30
33
  }
34
+ /**
35
+ * Everything the registry declares about one harness.
36
+ */
31
37
  export interface HarnessInfo {
32
38
  /**
33
39
  * How `run --control` + `oneharness interrupt` abort an in-flight turn on
@@ -128,19 +134,23 @@ export interface HarnessInfo {
128
134
  [k: string]: unknown;
129
135
  }
130
136
  /**
131
- * One supported approval mode for a harness, with its headless behavior, in
132
- * `oneharness list`. A [`PermissionMode`] absent from a harness's array is
133
- * unsupported for it (a `--mode` request would be refused).
137
+ * One supported approval mode for a harness, with its headless behavior. A
138
+ * [`PermissionMode`] absent from a harness's array is unsupported for it (a
139
+ * `--mode` request would be refused).
134
140
  */
135
141
  export interface ModeInfo {
136
142
  /**
137
143
  * `"clean"` (never blocks headless) or `"hangs"` (would block on an
138
- * approval prompt; refused without --permit-prompts).
144
+ * approval prompt; refused without `--permit-prompts`).
139
145
  */
140
146
  headless: "clean" | "hangs";
141
147
  mode: PermissionMode;
142
148
  [k: string]: unknown;
143
149
  }
150
+ /**
151
+ * One configured identity of a harness — a `[harness.<id>.variant.<name>]`
152
+ * table, resolved the way a run would resolve it.
153
+ */
144
154
  export interface VariantInfo {
145
155
  args: string[];
146
156
  bin: string | null;