harness-dispatch 0.7.9 → 0.9.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/CHANGELOG.md +1170 -1
- package/README.md +52 -6
- package/config.default.yaml +49 -5
- package/dist/auth.d.ts +29 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +58 -5
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +24 -0
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +24 -0
- package/dist/billing.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +529 -31
- package/dist/bin.js.map +1 -1
- package/dist/breaker-store.d.ts +25 -1
- package/dist/breaker-store.d.ts.map +1 -1
- package/dist/breaker-store.js +193 -25
- package/dist/breaker-store.js.map +1 -1
- package/dist/circuit-breaker.d.ts +9 -1
- package/dist/circuit-breaker.d.ts.map +1 -1
- package/dist/circuit-breaker.js +15 -1
- package/dist/circuit-breaker.js.map +1 -1
- package/dist/client-register.d.ts +157 -0
- package/dist/client-register.d.ts.map +1 -0
- package/dist/client-register.js +389 -0
- package/dist/client-register.js.map +1 -0
- package/dist/config/validation.d.ts +41 -0
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +215 -1
- package/dist/config/validation.js.map +1 -1
- package/dist/config.d.ts +4 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +143 -6
- package/dist/config.js.map +1 -1
- package/dist/configure-yaml.d.ts +2 -0
- package/dist/configure-yaml.d.ts.map +1 -1
- package/dist/configure-yaml.js +69 -3
- package/dist/configure-yaml.js.map +1 -1
- package/dist/dispatch-log.d.ts +14 -0
- package/dist/dispatch-log.d.ts.map +1 -1
- package/dist/dispatch-log.js +3 -0
- package/dist/dispatch-log.js.map +1 -1
- package/dist/dispatchers/generic-cli.d.ts.map +1 -1
- package/dist/dispatchers/generic-cli.js +92 -15
- package/dist/dispatchers/generic-cli.js.map +1 -1
- package/dist/dispatchers/openai-compatible.d.ts +20 -4
- package/dist/dispatchers/openai-compatible.d.ts.map +1 -1
- package/dist/dispatchers/openai-compatible.js +167 -19
- package/dist/dispatchers/openai-compatible.js.map +1 -1
- package/dist/dispatchers/shared/harness-login.d.ts +25 -0
- package/dist/dispatchers/shared/harness-login.d.ts.map +1 -0
- package/dist/dispatchers/shared/harness-login.js +68 -0
- package/dist/dispatchers/shared/harness-login.js.map +1 -0
- package/dist/dispatchers/shared/stream-subprocess.d.ts.map +1 -1
- package/dist/dispatchers/shared/stream-subprocess.js +70 -4
- package/dist/dispatchers/shared/stream-subprocess.js.map +1 -1
- package/dist/file-lock.d.ts +29 -1
- package/dist/file-lock.d.ts.map +1 -1
- package/dist/file-lock.js +22 -1
- package/dist/file-lock.js.map +1 -1
- package/dist/http/answer-stream.d.ts +52 -0
- package/dist/http/answer-stream.d.ts.map +1 -0
- package/dist/http/answer-stream.js +47 -0
- package/dist/http/answer-stream.js.map +1 -0
- package/dist/http/parse.d.ts.map +1 -1
- package/dist/http/parse.js +41 -0
- package/dist/http/parse.js.map +1 -1
- package/dist/http/server.d.ts +2 -0
- package/dist/http/server.d.ts.map +1 -1
- package/dist/http/server.js +281 -23
- package/dist/http/server.js.map +1 -1
- package/dist/jobs/context.d.ts +0 -7
- package/dist/jobs/context.d.ts.map +1 -1
- package/dist/jobs/context.js +95 -7
- package/dist/jobs/context.js.map +1 -1
- package/dist/jobs/store.d.ts.map +1 -1
- package/dist/jobs/store.js +45 -4
- package/dist/jobs/store.js.map +1 -1
- package/dist/jobs/types.d.ts +8 -1
- package/dist/jobs/types.d.ts.map +1 -1
- package/dist/jobs.d.ts +39 -0
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +207 -15
- package/dist/jobs.js.map +1 -1
- package/dist/leaderboard.d.ts.map +1 -1
- package/dist/leaderboard.js +39 -27
- package/dist/leaderboard.js.map +1 -1
- package/dist/mcp/config-hot-reload.d.ts +14 -3
- package/dist/mcp/config-hot-reload.d.ts.map +1 -1
- package/dist/mcp/config-hot-reload.js +33 -5
- package/dist/mcp/config-hot-reload.js.map +1 -1
- package/dist/mcp/dispatcher-factory.d.ts.map +1 -1
- package/dist/mcp/dispatcher-factory.js +14 -3
- package/dist/mcp/dispatcher-factory.js.map +1 -1
- package/dist/mcp/near-miss-guard.d.ts +45 -0
- package/dist/mcp/near-miss-guard.d.ts.map +1 -0
- package/dist/mcp/near-miss-guard.js +98 -0
- package/dist/mcp/near-miss-guard.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +36 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-schemas.d.ts +1 -1
- package/dist/mcp/tool-schemas.d.ts.map +1 -1
- package/dist/mcp/tool-schemas.js +27 -7
- package/dist/mcp/tool-schemas.js.map +1 -1
- package/dist/mcp/tools.d.ts +33 -4
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +85 -8
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-clients.d.ts +72 -0
- package/dist/mcp-clients.d.ts.map +1 -0
- package/dist/mcp-clients.js +121 -0
- package/dist/mcp-clients.js.map +1 -0
- package/dist/near-miss.d.ts +63 -0
- package/dist/near-miss.d.ts.map +1 -0
- package/dist/near-miss.js +132 -0
- package/dist/near-miss.js.map +1 -0
- package/dist/quota.d.ts +31 -1
- package/dist/quota.d.ts.map +1 -1
- package/dist/quota.js +84 -8
- package/dist/quota.js.map +1 -1
- package/dist/route-policy.d.ts +12 -1
- package/dist/route-policy.d.ts.map +1 -1
- package/dist/route-policy.js +74 -2
- package/dist/route-policy.js.map +1 -1
- package/dist/router.d.ts +61 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +160 -29
- package/dist/router.js.map +1 -1
- package/dist/safety.d.ts.map +1 -1
- package/dist/safety.js +37 -1
- package/dist/safety.js.map +1 -1
- package/dist/state-dir.d.ts +10 -0
- package/dist/state-dir.d.ts.map +1 -1
- package/dist/state-dir.js +12 -0
- package/dist/state-dir.js.map +1 -1
- package/dist/status.d.ts +30 -21
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +152 -8
- package/dist/status.js.map +1 -1
- package/dist/types.d.ts +49 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/working-dir.d.ts.map +1 -1
- package/dist/working-dir.js +16 -0
- package/dist/working-dir.js.map +1 -1
- package/dist/workspace-resolve.d.ts.map +1 -1
- package/dist/workspace-resolve.js +196 -15
- package/dist/workspace-resolve.js.map +1 -1
- package/dist/workspaces.d.ts +98 -0
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +609 -20
- package/dist/workspaces.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,10 +66,23 @@ harness-dispatch configure --yes
|
|
|
66
66
|
harness-dispatch doctor --live
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
`configure --yes` detects installed harnesses
|
|
70
|
-
|
|
69
|
+
`configure --yes` detects installed harnesses, writes `config.yaml` into the
|
|
70
|
+
tool's own state directory (`~/.harness-dispatch/`, or `HARNESS_DISPATCH_STATE_DIR`),
|
|
71
|
+
and then
|
|
72
|
+
offers to register this server with each MCP client it finds (Claude Code,
|
|
73
|
+
Cursor) — showing you what it would write, and what is already there, before
|
|
74
|
+
changing anything. `--no-clients` skips the offer and prints a snippet to paste
|
|
75
|
+
instead; `harness-dispatch connect` does the same registration later on its own,
|
|
76
|
+
and `connect --remove` undoes it. Without
|
|
77
|
+
`--yes` configure previews and writes nothing. Re-running it regenerates a file it
|
|
78
|
+
wrote and you have not edited, so installing a harness later is just `configure --yes`
|
|
79
|
+
again; a file you have changed is refused without `--force`, and because such a file
|
|
80
|
+
lists its own routes, even `--force` regenerates it from the file rather than from a
|
|
81
|
+
fresh detection (it says so; add `detect: true` to the file to merge new harnesses). `doctor` then checks the whole chain:
|
|
71
82
|
binary, config load, harness detection, auth and billing classification, route
|
|
72
|
-
readiness
|
|
83
|
+
readiness, and for a Codex route asks `codex login status` whether the CLI is
|
|
84
|
+
logged in (the other harnesses have no equivalent this tool has verified, so
|
|
85
|
+
their login state is not checked). `--live` goes further and routes one tiny real prompt, so you see a
|
|
73
86
|
completion before wiring anything into your agent. The live probe never touches paid or
|
|
74
87
|
unknown-billing routes unless you pass `--allow-paid`.
|
|
75
88
|
|
|
@@ -206,6 +219,8 @@ Adding a harness that isn't auto-detected — a second Codex route pinned to a s
|
|
|
206
219
|
model, or a local/hosted OpenAI-compatible endpoint — is a few lines:
|
|
207
220
|
|
|
208
221
|
```yaml
|
|
222
|
+
detect: true # keep auto-detected harnesses as well; see below
|
|
223
|
+
|
|
209
224
|
clis:
|
|
210
225
|
- name: codex_sol
|
|
211
226
|
harness: codex # picks the dispatcher: claude_code | codex | cursor | antigravity_cli | generic
|
|
@@ -219,6 +234,21 @@ endpoints:
|
|
|
219
234
|
tier: 3
|
|
220
235
|
```
|
|
221
236
|
|
|
237
|
+
**`detect: true` is doing real work there.** A config that lists any `clis:` or
|
|
238
|
+
`endpoints:` is authoritative: it gets exactly the routes it names, and nothing is
|
|
239
|
+
auto-detected alongside them. Without that line, the snippet above does not *add*
|
|
240
|
+
`codex_sol` and `ollama` to your installed harnesses — it replaces them, and
|
|
241
|
+
`claude_code_cli`, `codex_cli`, `cursor_cli` and `antigravity_cli` are gone.
|
|
242
|
+
|
|
243
|
+
Which one you want depends on the goal:
|
|
244
|
+
|
|
245
|
+
| You want | Write |
|
|
246
|
+
|---|---|
|
|
247
|
+
| My routes *plus* whatever is installed | `detect: true` alongside your entries |
|
|
248
|
+
| Exactly the routes I list, nothing else | just the entries (the default) |
|
|
249
|
+
| Nothing but auto-detection, minus a route | no `clis:`/`endpoints:`, plus `disabled: [name]` |
|
|
250
|
+
| No routes at all | `detect: false` |
|
|
251
|
+
|
|
222
252
|
See the shipped [`config.default.yaml`](config.default.yaml) for the full field
|
|
223
253
|
reference (capability weights, tiers, escalation, workspace policy, and more) — copy
|
|
224
254
|
it to your own `config.yaml` and edit, or run `harness-dispatch configure` to generate
|
|
@@ -348,6 +378,10 @@ set `billing_kind:` / `paid_usage_possible:` explicitly once you know it.
|
|
|
348
378
|
harness-dispatch # stdio MCP
|
|
349
379
|
harness-dispatch configure # detect harnesses and prepare config
|
|
350
380
|
harness-dispatch configure --print # inspect generated config YAML
|
|
381
|
+
harness-dispatch connect # register with the MCP clients you have
|
|
382
|
+
harness-dispatch connect --clients cursor # no prompt; ids from the listing it prints
|
|
383
|
+
harness-dispatch connect --dev # point clients at THIS checkout's build
|
|
384
|
+
harness-dispatch connect --remove # take the entry back out
|
|
351
385
|
harness-dispatch doctor # validate install, auth, config, and routes
|
|
352
386
|
harness-dispatch doctor --live # run one eligible live routed probe
|
|
353
387
|
harness-dispatch doctor --live --allow-paid
|
|
@@ -376,9 +410,9 @@ version bump.
|
|
|
376
410
|
| `dispatch` | Always starts new routed coding work — one task to the best-fit harness, or a fanout to several for independent opinions. Every call runs as a background job from the first moment: a fast task returns its full result inline (`completed: true`), a slow one returns `completed: false` plus a `jobId` to check on. Nothing is ever lost to a timeout — including the MCP call's own. |
|
|
377
411
|
| `job_status` | Checks work started by `dispatch`. Pass the `jobId` it returned to get a `partialOutput` tail while running and the full `result` once done; omit `jobId` to list recent background dispatches (compact, newest first). |
|
|
378
412
|
| `cancel_job` | Stops work started by `dispatch` — a wrong turn, a wrong directory, a superseded run. A job still waiting for a slot stops outright; a running one tears down within about a second (poll `job_status` to see it land), killing the agent CLI and its children. Files it already changed are **not** reverted, and a cancelled run is not counted as a route failure. |
|
|
379
|
-
| `retry_job` | Re-runs a finished job's task from its own record — same prompt (as the delegate saw it), files, working directory, hints and workspace policy. Pass `service` to send the retry to a different route, which is the usual reason to retry: the task was fine and the route was not
|
|
413
|
+
| `retry_job` | Re-runs a finished job's task from its own record — same prompt (as the delegate saw it), files, working directory, hints and workspace policy. Pass `service` to send the retry to a different route, which is the usual reason to retry: the task was fine and the route was not — the original's model is left behind when the new route does not declare it, reported as `droppedModel`. Returns a new jobId; the original is untouched. |
|
|
380
414
|
| `workspace` | For a job that ran with `workspacePolicy: "copy"` or `"git_worktree"`, the agent's changes live in an isolated workspace and were **never** applied to your project. `action: "diff"` returns the real patch; `"apply"` applies it (refusing when your project has uncommitted changes, since the patch was built against a clean base — `force: true` overrides); `"discard"` deletes the workspace. The full patch is always written to the job directory, so `git apply` by hand is available either way. |
|
|
381
|
-
| `usage` | Per-route call counts, quota, billing kind, and breaker state — check this before passing an unfamiliar `hints.model`/`service`/`models` value
|
|
415
|
+
| `usage` | Per-route call counts, quota, billing kind, and breaker state — check this before passing an unfamiliar `hints.model`/`service`/`models` value. `service` and `models` are validated — an unknown route id is rejected, naming the valid ones — while `hints.model` is forwarded to the picked harness as-is, so a wrong model name fails at the harness instead. Pass `listModels: <route id>` to fetch that `openai_compatible` route's live `GET /models` catalog instead of (or alongside) the summary. |
|
|
382
416
|
|
|
383
417
|
`workingDir` is effectively required when starting work: if you omit it, the task runs
|
|
384
418
|
in the router server's own process directory instead of your project, and the response
|
|
@@ -449,9 +483,21 @@ Status is exposed as resources:
|
|
|
449
483
|
|
|
450
484
|
Endpoints:
|
|
451
485
|
|
|
486
|
+
- `GET /health` — liveness, and the **only** route served without a token, so a
|
|
487
|
+
deploy gate or container probe can ask without being handed a credential. It
|
|
488
|
+
answers `{"status","service","version"}` and nothing else: no routes, no
|
|
489
|
+
endpoints, no quota, no config.
|
|
452
490
|
- `POST /mcp` for streamable HTTP MCP
|
|
491
|
+
- `POST /v1/chat/completions` with `stream: true` sends the answer as SSE
|
|
492
|
+
deltas. An endpoint route streams its text as it arrives; a CLI harness emits
|
|
493
|
+
protocol on stdout, so its answer is sent once, at completion — the deltas
|
|
494
|
+
never carry harness protocol either way. **Streaming creates no job record**,
|
|
495
|
+
so unlike the non-streaming call there is no `jobId` to poll and an
|
|
496
|
+
interrupted stream cannot be recovered. Use the non-streaming form for work
|
|
497
|
+
you would mind losing.
|
|
453
498
|
- `GET /v1/status` — full route/quota/billing/breaker detail (same shape as
|
|
454
|
-
`harness-dispatch://status.json`)
|
|
499
|
+
`harness-dispatch://status.json`). Authenticated, because that answer is not
|
|
500
|
+
for strangers.
|
|
455
501
|
- `GET /v1/usage` — per-route call counts, quota, billing kind, and breaker state only
|
|
456
502
|
- `GET /v1/models` — OpenAI-style model list; each entry's `id` is a route id you can
|
|
457
503
|
pass as `model` in `/v1/chat/completions`
|
package/config.default.yaml
CHANGED
|
@@ -11,7 +11,15 @@
|
|
|
11
11
|
# actually installed. To customize, copy this file to config.yaml in your
|
|
12
12
|
# own project and edit — or run `harness-dispatch configure` to generate a
|
|
13
13
|
# starting point instead. Same schema, same parser, no special cases either
|
|
14
|
-
# way. Add a new entry and it's a route
|
|
14
|
+
# way. Add a new entry and it's a route.
|
|
15
|
+
#
|
|
16
|
+
# A config that lists any `clis:` or `endpoints:` is AUTHORITATIVE: it gets
|
|
17
|
+
# exactly the routes it names, and nothing is auto-detected alongside them.
|
|
18
|
+
# So deleting an entry from your own config.yaml removes that route, full
|
|
19
|
+
# stop — `disabled:` is not needed for it, and has no effect in such a file.
|
|
20
|
+
# `disabled:` applies only to a config that names no routes of its own and is
|
|
21
|
+
# therefore still relying on auto-detection. Add `detect: true` if you want
|
|
22
|
+
# both: your entries AND whatever is installed.
|
|
15
23
|
#
|
|
16
24
|
# Route selection scores each entry by task fit:
|
|
17
25
|
# capabilities[task_type] x leaderboard ELO x cli_capability x quota x weight
|
|
@@ -47,7 +55,23 @@ clis:
|
|
|
47
55
|
# line; {{tokens}} are substituted at dispatch time (see the reference at
|
|
48
56
|
# the bottom of this file).
|
|
49
57
|
protocol:
|
|
50
|
-
|
|
58
|
+
# The prompt goes on STDIN, not in argv.
|
|
59
|
+
#
|
|
60
|
+
# `claude -p` accepts either; argv was the original choice and it is the
|
|
61
|
+
# one that carries every command-line defect this project has fixed. On
|
|
62
|
+
# Windows a .CMD/.bat target is re-spawned through cmd.exe, which caps
|
|
63
|
+
# the whole command line at 8,191 characters — so a long prompt was
|
|
64
|
+
# refused before it reached the harness at all, and the machinery
|
|
65
|
+
# deciding where that boundary sits had to replicate cross-spawn's own
|
|
66
|
+
# escaping to know. generic-cli.ts skips that check entirely when
|
|
67
|
+
# `stdin: true` (the guard is `if (!protocol.stdin)`), because a prompt
|
|
68
|
+
# on stdin has no such limit. codex_cli has always worked this way.
|
|
69
|
+
#
|
|
70
|
+
# Verified live: a 21,670-character prompt — 2.65x the 8,191-character ceiling, and
|
|
71
|
+
# measured at 20,064 characters as argv, which the old form refused
|
|
72
|
+
# outright — dispatched and answered.
|
|
73
|
+
stdin: true
|
|
74
|
+
args: ["-p", "--output-format", "json", "{{safety}}", "{{model}}"]
|
|
51
75
|
model: { flag: "--model" }
|
|
52
76
|
safety:
|
|
53
77
|
read_only: ["--allowedTools", "Read", "--permission-mode", "plan"]
|
|
@@ -181,8 +205,16 @@ clis:
|
|
|
181
205
|
surface: cursor_agent_cli
|
|
182
206
|
auth_source: product_login
|
|
183
207
|
billing_kind: included_usage_then_on_demand
|
|
184
|
-
# Cursor
|
|
185
|
-
#
|
|
208
|
+
# Cursor stops at the plan's included pool unless you have turned on
|
|
209
|
+
# on-demand usage in Settings -> Billing -> Spending. Set true here if you
|
|
210
|
+
# did — and note the second half, which the earlier wording ("hard-stops")
|
|
211
|
+
# missed: once on-demand IS on, overage is billed in ARREARS at the end of
|
|
212
|
+
# the cycle, and Cursor's own docs recommend setting a spend limit because
|
|
213
|
+
# without one there is no cap. So this route is the one subscription in the
|
|
214
|
+
# shipped set whose overage is not prepaid, which is why the `true` here is
|
|
215
|
+
# a bigger statement than it looks. Checked against Cursor's 2026 pricing
|
|
216
|
+
# documentation on 2026-08-31; NOT live-verified, because doing so means
|
|
217
|
+
# exhausting a real included pool.
|
|
186
218
|
paid_usage_possible: false
|
|
187
219
|
# Capability floor, per requested profile. cursor-agent's capability really
|
|
188
220
|
# does differ by mode, so a single value cannot describe it:
|
|
@@ -206,7 +238,19 @@ clis:
|
|
|
206
238
|
protocol:
|
|
207
239
|
# -p is Cursor's boolean "print mode" flag; the prompt itself is the
|
|
208
240
|
# trailing positional {{prompt}}.
|
|
209
|
-
|
|
241
|
+
# Prompt on STDIN, for the same reason as claude_code_cli above: a
|
|
242
|
+
# prompt in argv is measured against cmd.exe's 8,191-character ceiling
|
|
243
|
+
# and escaped to get there, and this route is a `cursor-agent.CMD`
|
|
244
|
+
# PowerShell wrapper — the one that failed at ~9k characters and drove
|
|
245
|
+
# two releases of escaping work. generic-cli.ts skips the check
|
|
246
|
+
# entirely when `stdin: true`.
|
|
247
|
+
#
|
|
248
|
+
# Verified live before changing: `cursor-agent -p --trust
|
|
249
|
+
# --output-format json` with the prompt piped in returns
|
|
250
|
+
# {"type":"result","subtype":"success","is_error":false,...,"result":"pong"}.
|
|
251
|
+
# --trust is required or it refuses with a workspace-trust prompt.
|
|
252
|
+
stdin: true
|
|
253
|
+
args: ["-p", "--trust", "{{safety}}", "{{working_dir}}", "--output-format", "json", "{{model}}"]
|
|
210
254
|
# Only read_only gets extra flags; the other profiles run print mode as
|
|
211
255
|
# before. --trust is unrelated to capability — it just suppresses the
|
|
212
256
|
# workspace-trust prompt, which would hang a non-interactive run.
|
package/dist/auth.d.ts
CHANGED
|
@@ -2,8 +2,37 @@ export declare function authDir(): string;
|
|
|
2
2
|
export declare function tokenPath(): string;
|
|
3
3
|
export declare function generateHttpToken(): string;
|
|
4
4
|
export declare function readHttpToken(): Promise<string | null>;
|
|
5
|
+
/**
|
|
6
|
+
* The token as it is on disk RIGHT NOW, for a running server to consult.
|
|
7
|
+
*
|
|
8
|
+
* A server read the token once at startup and held it forever, so `auth
|
|
9
|
+
* rotate` was a lie in both directions: an acceptance pass measured the old
|
|
10
|
+
* token still returning 200 after rotation, and the newly issued one being
|
|
11
|
+
* rejected with 401. Invalidating the old token is the entire reason anyone
|
|
12
|
+
* rotates a credential, so telling the user it rotated while the leaked value
|
|
13
|
+
* kept working is the worst possible outcome.
|
|
14
|
+
*
|
|
15
|
+
* Synchronous because it is consulted on the authorization path of every
|
|
16
|
+
* request, which is not async. The file is a few dozen bytes on local disk and
|
|
17
|
+
* the read is guarded by an mtime check in the caller.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readHttpTokenSync(): string | null;
|
|
20
|
+
/** Modification time of the token file, or 0 when there isn't one. */
|
|
21
|
+
export declare function httpTokenMtimeMs(): number;
|
|
5
22
|
export declare function ensureHttpToken(): Promise<string>;
|
|
6
23
|
export declare function rotateHttpToken(): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Whether a request carries the expected bearer token.
|
|
26
|
+
*
|
|
27
|
+
* A `token` of null means NO AUTH IS CONFIGURED, and every request is
|
|
28
|
+
* authorized — this function fails open, deliberately, and a caller that
|
|
29
|
+
* cannot guarantee a token must not rely on it to deny anything. The HTTP
|
|
30
|
+
* server can: it calls `ensureHttpToken()` at startup and falls back to the
|
|
31
|
+
* token it read from disk on refresh, so null never reaches here from there.
|
|
32
|
+
*
|
|
33
|
+
* Spelled out because the fail-open branch is one line and reads like a
|
|
34
|
+
* guard clause rather than the policy decision it is.
|
|
35
|
+
*/
|
|
7
36
|
export declare function isAuthorized(authorizationHeader: string | string[] | undefined, token: string | null): boolean;
|
|
8
37
|
export declare function maskToken(token: string): string;
|
|
9
38
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AASA,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS5D;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAOvD;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAKvD;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AASA,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CASjD;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAOvD;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAKvD;AAyBD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,mBAAmB,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAClD,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,OAAO,CAOT;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/C"}
|
package/dist/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
-
import { promises as fs } from "node:fs";
|
|
2
|
+
import { promises as fs, readFileSync, statSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { stateRoot } from "./state-dir.js";
|
|
5
5
|
const TOKEN_ENV = "HARNESS_DISPATCH_HTTP_TOKEN";
|
|
@@ -24,6 +24,41 @@ export async function readHttpToken() {
|
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The token as it is on disk RIGHT NOW, for a running server to consult.
|
|
29
|
+
*
|
|
30
|
+
* A server read the token once at startup and held it forever, so `auth
|
|
31
|
+
* rotate` was a lie in both directions: an acceptance pass measured the old
|
|
32
|
+
* token still returning 200 after rotation, and the newly issued one being
|
|
33
|
+
* rejected with 401. Invalidating the old token is the entire reason anyone
|
|
34
|
+
* rotates a credential, so telling the user it rotated while the leaked value
|
|
35
|
+
* kept working is the worst possible outcome.
|
|
36
|
+
*
|
|
37
|
+
* Synchronous because it is consulted on the authorization path of every
|
|
38
|
+
* request, which is not async. The file is a few dozen bytes on local disk and
|
|
39
|
+
* the read is guarded by an mtime check in the caller.
|
|
40
|
+
*/
|
|
41
|
+
export function readHttpTokenSync() {
|
|
42
|
+
const fromEnv = process.env[TOKEN_ENV];
|
|
43
|
+
if (fromEnv)
|
|
44
|
+
return fromEnv;
|
|
45
|
+
try {
|
|
46
|
+
const token = readFileSync(tokenPath(), "utf-8").trim();
|
|
47
|
+
return token || null;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Modification time of the token file, or 0 when there isn't one. */
|
|
54
|
+
export function httpTokenMtimeMs() {
|
|
55
|
+
try {
|
|
56
|
+
return statSync(tokenPath()).mtimeMs;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
27
62
|
export async function ensureHttpToken() {
|
|
28
63
|
const existing = await readHttpToken();
|
|
29
64
|
if (existing)
|
|
@@ -42,19 +77,37 @@ export async function rotateHttpToken() {
|
|
|
42
77
|
/**
|
|
43
78
|
* Constant-time string compare. `value === expected` short-circuits on the
|
|
44
79
|
* first mismatching byte — a textbook timing side channel for guessing a
|
|
45
|
-
* bearer token one byte at a time.
|
|
46
|
-
*
|
|
47
|
-
*
|
|
80
|
+
* bearer token one byte at a time.
|
|
81
|
+
*
|
|
82
|
+
* On a length mismatch it still does comparison work rather than returning
|
|
83
|
+
* early. That work is now sized by `expected`, not by `value`: the previous
|
|
84
|
+
* version compared the caller-supplied buffer against ITSELF, so its cost
|
|
85
|
+
* scaled with the length an attacker chose, and the comment claiming "a length
|
|
86
|
+
* mismatch alone doesn't leak timing info either" asserted a property the code
|
|
87
|
+
* did not have. The remaining signal is the same for every wrong length, which
|
|
88
|
+
* is what that sentence was meant to say.
|
|
48
89
|
*/
|
|
49
90
|
function safeEqual(value, expected) {
|
|
50
91
|
const valueBuf = Buffer.from(value, "utf8");
|
|
51
92
|
const expectedBuf = Buffer.from(expected, "utf8");
|
|
52
93
|
if (valueBuf.length !== expectedBuf.length) {
|
|
53
|
-
timingSafeEqual(
|
|
94
|
+
timingSafeEqual(expectedBuf, expectedBuf);
|
|
54
95
|
return false;
|
|
55
96
|
}
|
|
56
97
|
return timingSafeEqual(valueBuf, expectedBuf);
|
|
57
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Whether a request carries the expected bearer token.
|
|
101
|
+
*
|
|
102
|
+
* A `token` of null means NO AUTH IS CONFIGURED, and every request is
|
|
103
|
+
* authorized — this function fails open, deliberately, and a caller that
|
|
104
|
+
* cannot guarantee a token must not rely on it to deny anything. The HTTP
|
|
105
|
+
* server can: it calls `ensureHttpToken()` at startup and falls back to the
|
|
106
|
+
* token it read from disk on refresh, so null never reaches here from there.
|
|
107
|
+
*
|
|
108
|
+
* Spelled out because the fail-open branch is one line and reads like a
|
|
109
|
+
* guard clause rather than the policy decision it is.
|
|
110
|
+
*/
|
|
58
111
|
export function isAuthorized(authorizationHeader, token) {
|
|
59
112
|
if (token === null)
|
|
60
113
|
return true;
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA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AC5C,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QAC3C,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,mBAAkD,EAClD,KAAoB;IAEpB,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC;QAC9C,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,mBAAmB,CAAC;IACxB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,SAAS,CAAC,KAAK,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IACrC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC"}
|
package/dist/billing.d.ts
CHANGED
|
@@ -33,6 +33,30 @@ export declare function inferredPaidUsagePossible(kind: BillingKind): boolean;
|
|
|
33
33
|
* implying a time dependency that no longer exists.
|
|
34
34
|
*/
|
|
35
35
|
export declare function buildRouteBilling(svc: ServiceConfig): RouteBilling;
|
|
36
|
+
/**
|
|
37
|
+
* Whether this route's billing is too uncertain to run without an opt-in.
|
|
38
|
+
*
|
|
39
|
+
* `confidence` LOOKS like a four-value enum and behaves like one bit: only
|
|
40
|
+
* `unknown` changes anything, and `documented`/`inferred`/`unsupported` are
|
|
41
|
+
* indistinguishable to every caller. That invited a real mistake — this
|
|
42
|
+
* repo's own config carried `billing_confidence: undocumented`, an invalid
|
|
43
|
+
* value that resolved to the less restrictive default (now warned about, but
|
|
44
|
+
* still the wrong direction).
|
|
45
|
+
*
|
|
46
|
+
* Collapsing the field was considered on 2026-08-31 and rejected on
|
|
47
|
+
* measurement rather than taste. In every INFERRED case, confidence tracks
|
|
48
|
+
* kind exactly — loopback and custom surfaces already get `kind: unknown`, so
|
|
49
|
+
* the second test is redundant there. It does independent work in exactly one
|
|
50
|
+
* case: an operator explicitly writing `billing_confidence: unknown` on a
|
|
51
|
+
* route whose kind IS known, which is how you say "I do not trust this
|
|
52
|
+
* classification" about a route you have otherwise described. Removing it
|
|
53
|
+
* would silently unblock that config — a behaviour change in the unsafe
|
|
54
|
+
* direction, to tidy a field whose actual defect (invalid values failing
|
|
55
|
+
* open) is already fixed elsewhere.
|
|
56
|
+
*
|
|
57
|
+
* So it stays, and this comment is the collapse: the four values are one bit,
|
|
58
|
+
* `unknown` is the bit, and nothing else here reads the other three.
|
|
59
|
+
*/
|
|
36
60
|
export declare function billingIsUnknown(billing: RouteBilling): boolean;
|
|
37
61
|
export declare function billingIsBlocked(billing: RouteBilling): boolean;
|
|
38
62
|
//# sourceMappingURL=billing.d.ts.map
|
package/dist/billing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EAGX,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AA0IpB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAapE;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAoBlE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAI/D"}
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EAGX,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AA0IpB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAapE;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAoBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAI/D"}
|
package/dist/billing.js
CHANGED
|
@@ -219,6 +219,30 @@ export function buildRouteBilling(svc) {
|
|
|
219
219
|
billing.notes = notes;
|
|
220
220
|
return billing;
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Whether this route's billing is too uncertain to run without an opt-in.
|
|
224
|
+
*
|
|
225
|
+
* `confidence` LOOKS like a four-value enum and behaves like one bit: only
|
|
226
|
+
* `unknown` changes anything, and `documented`/`inferred`/`unsupported` are
|
|
227
|
+
* indistinguishable to every caller. That invited a real mistake — this
|
|
228
|
+
* repo's own config carried `billing_confidence: undocumented`, an invalid
|
|
229
|
+
* value that resolved to the less restrictive default (now warned about, but
|
|
230
|
+
* still the wrong direction).
|
|
231
|
+
*
|
|
232
|
+
* Collapsing the field was considered on 2026-08-31 and rejected on
|
|
233
|
+
* measurement rather than taste. In every INFERRED case, confidence tracks
|
|
234
|
+
* kind exactly — loopback and custom surfaces already get `kind: unknown`, so
|
|
235
|
+
* the second test is redundant there. It does independent work in exactly one
|
|
236
|
+
* case: an operator explicitly writing `billing_confidence: unknown` on a
|
|
237
|
+
* route whose kind IS known, which is how you say "I do not trust this
|
|
238
|
+
* classification" about a route you have otherwise described. Removing it
|
|
239
|
+
* would silently unblock that config — a behaviour change in the unsafe
|
|
240
|
+
* direction, to tidy a field whose actual defect (invalid values failing
|
|
241
|
+
* open) is already fixed elsewhere.
|
|
242
|
+
*
|
|
243
|
+
* So it stays, and this comment is the collapse: the four values are one bit,
|
|
244
|
+
* `unknown` is the bit, and nothing else here reads the other three.
|
|
245
|
+
*/
|
|
222
246
|
export function billingIsUnknown(billing) {
|
|
223
247
|
return billing.kind === "unknown" || billing.confidence === "unknown";
|
|
224
248
|
}
|
package/dist/billing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;GAcG;AACH,SAAS,MAAM,CAAC,OAA2B;IACzC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3E,SAAS,UAAU,CAAC,OAA2B;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,MAAM,KAAK,SAAS,IAAI,cAAc,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,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,IAAI,gBAAgB,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;IAC9D,IAAI,OAAO,CAAC,iBAAiB;QAAE,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;IAC9D,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;GAEG;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;GAEG;AA+iCH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgK1D"}
|