@oneharness/sdk 0.14.0 → 0.15.1

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 CHANGED
@@ -29,6 +29,8 @@ for await (const envelope of oneharness.historyWatch({
29
29
  }
30
30
  ```
31
31
 
32
+ Every JSON-returning method passes `--format json --compact` itself, so the CLI's own default (a human-readable text view) never reaches the SDK. A `run` over several harnesses is a **fallback chain** by default — the first candidate that can run does, and the report's `fallback` block says which; pass `runMode: "parallel"` to run them all at once.
33
+
32
34
  Breaking or returning from either iterator terminates its oneharness subprocess. Every line is validated before it is yielded; malformed or unknown envelope variants fail the iterator. Additive fields within known output envelopes are accepted and preserved.
33
35
 
34
36
  `null` usage fields mean the harness did not report the value; zero remains a real measured zero. String-valued harness/model/event identifiers should be treated as open sets for forward compatibility. `history` and `historyWatch` raise the exported `HistoryNotFoundError` when a session, record, or watch cursor cannot be resolved.
@@ -244,8 +244,9 @@ export interface Field31 {
244
244
  [k: string]: unknown;
245
245
  }
246
246
  /**
247
- * The configured run mode, if any. Unset falls back to `parallel` (the
248
- * built-in default) at run time.
247
+ * The effective run mode: a configured value, else `fallback` (the
248
+ * built-in default, attributed to [`DEFAULT_SOURCE`]) — the report says what
249
+ * a run would do, so an unset mode is never shown as `null`.
249
250
  */
250
251
  export interface Field9 {
251
252
  source: string | null;
@@ -384,7 +384,7 @@ export interface RunResult {
384
384
  */
385
385
  bin: string;
386
386
  /**
387
- * The exact argv oneharness built (argv[0] is the binary).
387
+ * The exact argv oneharness built; its first element is the binary.
388
388
  */
389
389
  command: string[];
390
390
  /**
@@ -458,7 +458,7 @@ export interface RunResult {
458
458
  */
459
459
  bin: string;
460
460
  /**
461
- * The exact argv oneharness built (argv[0] is the binary).
461
+ * The exact argv oneharness built; its first element is the binary.
462
462
  */
463
463
  command: string[];
464
464
  /**
@@ -1842,7 +1842,7 @@
1842
1842
  "const": "quota"
1843
1843
  },
1844
1844
  {
1845
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
1845
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
1846
1846
  "type": "string",
1847
1847
  "const": "session_not_found"
1848
1848
  },
@@ -2057,7 +2057,7 @@
2057
2057
  "type": "string"
2058
2058
  },
2059
2059
  "command": {
2060
- "description": "The exact argv oneharness built (argv[0] is the binary).",
2060
+ "description": "The exact argv oneharness built; its first element is the binary.",
2061
2061
  "type": "array",
2062
2062
  "items": {
2063
2063
  "type": "string"
@@ -2923,7 +2923,7 @@
2923
2923
  "const": "quota"
2924
2924
  },
2925
2925
  {
2926
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
2926
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
2927
2927
  "type": "string",
2928
2928
  "const": "session_not_found"
2929
2929
  },
@@ -3302,7 +3302,7 @@
3302
3302
  "type": "string"
3303
3303
  },
3304
3304
  "command": {
3305
- "description": "The exact argv oneharness built (argv[0] is the binary).",
3305
+ "description": "The exact argv oneharness built; its first element is the binary.",
3306
3306
  "type": "array",
3307
3307
  "items": {
3308
3308
  "type": "string"
@@ -4016,12 +4016,12 @@
4016
4016
  "description": "How the selected harnesses are run. Accepted as a CLI value (`--run-mode`,\nparsed in the `oneharness` binary) and a config-file value (`run_mode`, via\n`Deserialize`); the CLI parsing lives in the binary so this core crate stays\nfree of `clap`.",
4017
4017
  "oneOf": [
4018
4018
  {
4019
- "description": "Run every selected harness at once, each an independent subprocess, and\nreport them all. The default — the historical behavior.",
4019
+ "description": "Run every selected harness at once, each an independent subprocess, and\nreport them all. The opt-in (`--run-mode parallel`, `run_mode =\n\"parallel\"`, `ONEHARNESS_RUN_MODE=parallel`); it was the default before\nthe fallback chain became one.",
4020
4020
  "type": "string",
4021
4021
  "const": "parallel"
4022
4022
  },
4023
4023
  {
4024
- "description": "Run the selected harnesses in priority order (the `--harness` / config\norder, else registry order under `--all`), stopping at the first that\nactually runs the task; fall through only the candidates that cannot run\nat all (see [`startup_failure_reason`]).",
4024
+ "description": "Run the selected harnesses in priority order (the `--harness` / config\norder, else registry order under `--all`), stopping at the first that\nactually runs the task; fall through only the candidates that cannot run\nat all (see [`startup_failure_reason`]). The default wherever a run mode\nis left unset — in the request, every config layer and the environment.",
4025
4025
  "type": "string",
4026
4026
  "const": "fallback"
4027
4027
  }
@@ -5974,7 +5974,7 @@
5974
5974
  "const": "quota"
5975
5975
  },
5976
5976
  {
5977
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
5977
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
5978
5978
  "type": "string",
5979
5979
  "const": "session_not_found"
5980
5980
  },
@@ -8976,7 +8976,7 @@
8976
8976
  "const": "quota"
8977
8977
  },
8978
8978
  {
8979
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
8979
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
8980
8980
  "type": "string",
8981
8981
  "const": "session_not_found"
8982
8982
  },
@@ -9360,7 +9360,7 @@
9360
9360
  "const": "quota"
9361
9361
  },
9362
9362
  {
9363
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
9363
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
9364
9364
  "type": "string",
9365
9365
  "const": "session_not_found"
9366
9366
  },
@@ -12482,7 +12482,7 @@
12482
12482
  "const": "quota"
12483
12483
  },
12484
12484
  {
12485
- "description": "The session this run asked to continue does not exist for the identity it\nran as, so the harness refused before doing any work (see\n[`unknown_session_rejection`]). Distinct from every other kind because the\ntask itself is fine: another identity — or a fresh session on this one —\ncan still run it.",
12485
+ "description": "The session this run asked to continue does not exist for the identity\nit ran as, so the harness refused before doing any work (see the private\n`unknown_session_rejection` rule). Distinct from every other kind\nbecause the task itself is fine: another identity — or a fresh session\non this one — can still run it.",
12486
12486
  "type": "string",
12487
12487
  "const": "session_not_found"
12488
12488
  },
@@ -15986,7 +15986,7 @@
15986
15986
  "$ref": "#/$defs/Field"
15987
15987
  },
15988
15988
  "run_mode": {
15989
- "description": "The configured run mode, if any. Unset falls back to `parallel` (the\nbuilt-in default) at run time.",
15989
+ "description": "The effective run mode: a configured value, else `fallback` (the\nbuilt-in default, attributed to [`DEFAULT_SOURCE`]) — the report says what\na run would do, so an unset mode is never shown as `null`.",
15990
15990
  "$ref": "#/$defs/Field9"
15991
15991
  },
15992
15992
  "schema_file": {
@@ -16453,12 +16453,12 @@
16453
16453
  "description": "How the selected harnesses are run. Accepted as a CLI value (`--run-mode`,\nparsed in the `oneharness` binary) and a config-file value (`run_mode`, via\n`Deserialize`); the CLI parsing lives in the binary so this core crate stays\nfree of `clap`.",
16454
16454
  "oneOf": [
16455
16455
  {
16456
- "description": "Run every selected harness at once, each an independent subprocess, and\nreport them all. The default — the historical behavior.",
16456
+ "description": "Run every selected harness at once, each an independent subprocess, and\nreport them all. The opt-in (`--run-mode parallel`, `run_mode =\n\"parallel\"`, `ONEHARNESS_RUN_MODE=parallel`); it was the default before\nthe fallback chain became one.",
16457
16457
  "type": "string",
16458
16458
  "const": "parallel"
16459
16459
  },
16460
16460
  {
16461
- "description": "Run the selected harnesses in priority order (the `--harness` / config\norder, else registry order under `--all`), stopping at the first that\nactually runs the task; fall through only the candidates that cannot run\nat all (see [`startup_failure_reason`]).",
16461
+ "description": "Run the selected harnesses in priority order (the `--harness` / config\norder, else registry order under `--all`), stopping at the first that\nactually runs the task; fall through only the candidates that cannot run\nat all (see [`startup_failure_reason`]). The default wherever a run mode\nis left unset — in the request, every config layer and the environment.",
16462
16462
  "type": "string",
16463
16463
  "const": "fallback"
16464
16464
  }
@@ -16760,7 +16760,7 @@
16760
16760
  "usage_report": {
16761
16761
  "$schema": "https://json-schema.org/draft/2020-12/schema",
16762
16762
  "title": "UsageReport",
16763
- "description": "One usage report: every probed identity, stamped with a single observation\ntime supplied by the caller (this module reads no clock).\n\nDeserializing is a consumer boundary — `oneharness-core` is published for\nsibling tools — so the envelope is validated on the way in rather than\ntrusted: see [`UsageReportWire`].",
16763
+ "description": "One usage report: every probed identity, stamped with a single observation\ntime supplied by the caller (this module reads no clock).\n\nDeserializing is a consumer boundary — `oneharness-core` is published for\nsibling tools — so the envelope is validated on the way in rather than\ntrusted: see the private `UsageReportWire` shape.",
16764
16764
  "type": "object",
16765
16765
  "properties": {
16766
16766
  "identities": {
@@ -17057,7 +17057,7 @@
17057
17057
  ]
17058
17058
  },
17059
17059
  "UsageIdentity": {
17060
- "description": "One harness identity's headroom.\n\nDeserializing is a consumer boundary like the envelope's, so every string an\nidentity carries is flattened through [`without_control_chars`] on the way in\n— see [`UsageIdentityWire`].",
17060
+ "description": "One harness identity's headroom.\n\nDeserializing is a consumer boundary like the envelope's, so every string an\nidentity carries is flattened through the private `without_control_chars`\nfilter on the way in — see the private `UsageIdentityWire` shape.",
17061
17061
  "type": "object",
17062
17062
  "properties": {
17063
17063
  "auth_mode": {
@@ -145,7 +145,7 @@ export type UnknownReason = {
145
145
  *
146
146
  * Deserializing is a consumer boundary — `oneharness-core` is published for
147
147
  * sibling tools — so the envelope is validated on the way in rather than
148
- * trusted: see [`UsageReportWire`].
148
+ * trusted: see the private `UsageReportWire` shape.
149
149
  */
150
150
  export interface UsageReport {
151
151
  identities: UsageIdentity[];
@@ -163,8 +163,8 @@ export interface UsageReport {
163
163
  * One harness identity's headroom.
164
164
  *
165
165
  * Deserializing is a consumer boundary like the envelope's, so every string an
166
- * identity carries is flattened through [`without_control_chars`] on the way in
167
- * — see [`UsageIdentityWire`].
166
+ * identity carries is flattened through the private `without_control_chars`
167
+ * filter on the way in — see the private `UsageIdentityWire` shape.
168
168
  */
169
169
  export interface UsageIdentity {
170
170
  auth_mode: AuthMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneharness/sdk",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
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.14.0",
22
+ "oneharness-cli": "0.15.1",
23
23
  "zod": "^4.4.3"
24
24
  }
25
25
  }