duckhunt-runner 0.26.0 → 0.28.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 +140 -10
- package/dist/aws-discover.d.ts +26 -0
- package/dist/aws-discover.d.ts.map +1 -0
- package/dist/aws-discover.js +78 -0
- package/dist/aws-discover.js.map +1 -0
- package/dist/backends/agent-driver.d.ts +91 -0
- package/dist/backends/agent-driver.d.ts.map +1 -0
- package/dist/backends/agent-driver.js +20 -0
- package/dist/backends/agent-driver.js.map +1 -0
- package/dist/backends/attestation-evidence.d.ts +52 -0
- package/dist/backends/attestation-evidence.d.ts.map +1 -0
- package/dist/backends/attestation-evidence.js +74 -0
- package/dist/backends/attestation-evidence.js.map +1 -0
- package/dist/backends/claude/claude-driver.d.ts +27 -0
- package/dist/backends/claude/claude-driver.d.ts.map +1 -0
- package/dist/backends/claude/claude-driver.js +227 -0
- package/dist/backends/claude/claude-driver.js.map +1 -0
- package/dist/backends/driver-registry.d.ts +15 -0
- package/dist/backends/driver-registry.d.ts.map +1 -0
- package/dist/backends/driver-registry.js +37 -0
- package/dist/backends/driver-registry.js.map +1 -0
- package/dist/backends/spawn-agent.d.ts +36 -0
- package/dist/backends/spawn-agent.d.ts.map +1 -0
- package/dist/backends/spawn-agent.js +117 -0
- package/dist/backends/spawn-agent.js.map +1 -0
- package/dist/browser-open.d.ts +13 -0
- package/dist/browser-open.d.ts.map +1 -0
- package/dist/browser-open.js +55 -0
- package/dist/browser-open.js.map +1 -0
- package/dist/conformance/anthropic-dialect.d.ts +25 -0
- package/dist/conformance/anthropic-dialect.d.ts.map +1 -0
- package/dist/conformance/anthropic-dialect.js +140 -0
- package/dist/conformance/anthropic-dialect.js.map +1 -0
- package/dist/conformance/backend-registry.d.ts +6 -0
- package/dist/conformance/backend-registry.d.ts.map +1 -0
- package/dist/conformance/backend-registry.js +9 -0
- package/dist/conformance/backend-registry.js.map +1 -0
- package/dist/conformance/canary-home.d.ts +63 -0
- package/dist/conformance/canary-home.d.ts.map +1 -0
- package/dist/conformance/canary-home.js +175 -0
- package/dist/conformance/canary-home.js.map +1 -0
- package/dist/conformance/claude/claude-conformance.d.ts +4 -0
- package/dist/conformance/claude/claude-conformance.d.ts.map +1 -0
- package/dist/conformance/claude/claude-conformance.js +63 -0
- package/dist/conformance/claude/claude-conformance.js.map +1 -0
- package/dist/conformance/claude/claude-launch.d.ts +9 -0
- package/dist/conformance/claude/claude-launch.d.ts.map +1 -0
- package/dist/conformance/claude/claude-launch.js +153 -0
- package/dist/conformance/claude/claude-launch.js.map +1 -0
- package/dist/conformance/claude/claude-probes.d.ts +6 -0
- package/dist/conformance/claude/claude-probes.d.ts.map +1 -0
- package/dist/conformance/claude/claude-probes.js +201 -0
- package/dist/conformance/claude/claude-probes.js.map +1 -0
- package/dist/conformance/cli-binary.d.ts +5 -0
- package/dist/conformance/cli-binary.d.ts.map +1 -0
- package/dist/conformance/cli-binary.js +42 -0
- package/dist/conformance/cli-binary.js.map +1 -0
- package/dist/conformance/conformance-backend.d.ts +40 -0
- package/dist/conformance/conformance-backend.d.ts.map +1 -0
- package/dist/conformance/conformance-backend.js +10 -0
- package/dist/conformance/conformance-backend.js.map +1 -0
- package/dist/conformance/conformance-cache.d.ts +21 -0
- package/dist/conformance/conformance-cache.d.ts.map +1 -0
- package/dist/conformance/conformance-cache.js +66 -0
- package/dist/conformance/conformance-cache.js.map +1 -0
- package/dist/conformance/conformance-cli.d.ts +10 -0
- package/dist/conformance/conformance-cli.d.ts.map +1 -0
- package/dist/conformance/conformance-cli.js +91 -0
- package/dist/conformance/conformance-cli.js.map +1 -0
- package/dist/conformance/conformance-report.d.ts +9 -0
- package/dist/conformance/conformance-report.d.ts.map +1 -0
- package/dist/conformance/conformance-report.js +40 -0
- package/dist/conformance/conformance-report.js.map +1 -0
- package/dist/conformance/platform-stub.d.ts +13 -0
- package/dist/conformance/platform-stub.d.ts.map +1 -0
- package/dist/conformance/platform-stub.js +59 -0
- package/dist/conformance/platform-stub.js.map +1 -0
- package/dist/conformance/probe-worker.d.ts +5 -0
- package/dist/conformance/probe-worker.d.ts.map +1 -0
- package/dist/conformance/probe-worker.js +42 -0
- package/dist/conformance/probe-worker.js.map +1 -0
- package/dist/conformance/probe.d.ts +86 -0
- package/dist/conformance/probe.d.ts.map +1 -0
- package/dist/conformance/probe.js +44 -0
- package/dist/conformance/probe.js.map +1 -0
- package/dist/conformance/provider-dialect.d.ts +50 -0
- package/dist/conformance/provider-dialect.d.ts.map +1 -0
- package/dist/conformance/provider-dialect.js +14 -0
- package/dist/conformance/provider-dialect.js.map +1 -0
- package/dist/conformance/run-conformance.d.ts +40 -0
- package/dist/conformance/run-conformance.d.ts.map +1 -0
- package/dist/conformance/run-conformance.js +170 -0
- package/dist/conformance/run-conformance.js.map +1 -0
- package/dist/conformance/scripted-provider.d.ts +14 -0
- package/dist/conformance/scripted-provider.d.ts.map +1 -0
- package/dist/conformance/scripted-provider.js +77 -0
- package/dist/conformance/scripted-provider.js.map +1 -0
- package/dist/conformance/verdict.d.ts +41 -0
- package/dist/conformance/verdict.d.ts.map +1 -0
- package/dist/conformance/verdict.js +98 -0
- package/dist/conformance/verdict.js.map +1 -0
- package/dist/daemon.d.ts +4 -5
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +86 -300
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +49 -7
- package/dist/index.js.map +1 -1
- package/dist/loopback.d.ts +14 -0
- package/dist/loopback.d.ts.map +1 -0
- package/dist/loopback.js +85 -0
- package/dist/loopback.js.map +1 -0
- package/dist/oauth.d.ts +35 -8
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +143 -44
- package/dist/oauth.js.map +1 -1
- package/dist/paths.d.ts +2 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +7 -0
- package/dist/paths.js.map +1 -1
- package/dist/platform-login.d.ts +4 -3
- package/dist/platform-login.d.ts.map +1 -1
- package/dist/platform-login.js +4 -3
- package/dist/platform-login.js.map +1 -1
- package/dist/ptrace-scope.d.ts +7 -0
- package/dist/ptrace-scope.d.ts.map +1 -0
- package/dist/ptrace-scope.js +27 -0
- package/dist/ptrace-scope.js.map +1 -0
- package/dist/repos.d.ts +16 -0
- package/dist/repos.d.ts.map +1 -1
- package/dist/repos.js +53 -45
- package/dist/repos.js.map +1 -1
- package/dist/secret-paths.d.ts.map +1 -1
- package/dist/secret-paths.js +32 -2
- package/dist/secret-paths.js.map +1 -1
- package/dist/service.d.ts +26 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +229 -0
- package/dist/service.js.map +1 -0
- package/dist/setup.d.ts +29 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +306 -0
- package/dist/setup.js.map +1 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -0
- package/dist/status.js.map +1 -1
- package/dist/terminal-prompt.d.ts +3 -0
- package/dist/terminal-prompt.d.ts.map +1 -0
- package/dist/terminal-prompt.js +20 -0
- package/dist/terminal-prompt.js.map +1 -0
- package/dist/toolset/render.d.ts.map +1 -1
- package/dist/toolset/render.js +4 -2
- package/dist/toolset/render.js.map +1 -1
- package/dist/vendor/runner-protocol/agent-credentials.d.ts +2 -0
- package/dist/vendor/runner-protocol/agent-credentials.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/agent-credentials.js +32 -0
- package/dist/vendor/runner-protocol/agent-credentials.js.map +1 -0
- package/dist/vendor/runner-protocol/approval-match.d.ts +7 -0
- package/dist/vendor/runner-protocol/approval-match.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/approval-match.js +112 -0
- package/dist/vendor/runner-protocol/approval-match.js.map +1 -0
- package/dist/vendor/runner-protocol/autonomy.d.ts +1 -2
- package/dist/vendor/runner-protocol/autonomy.d.ts.map +1 -1
- package/dist/vendor/runner-protocol/autonomy.js +1 -2
- package/dist/vendor/runner-protocol/autonomy.js.map +1 -1
- package/dist/vendor/runner-protocol/backends.d.ts +86 -0
- package/dist/vendor/runner-protocol/backends.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/backends.js +171 -0
- package/dist/vendor/runner-protocol/backends.js.map +1 -0
- package/dist/vendor/runner-protocol/index.d.ts +3 -0
- package/dist/vendor/runner-protocol/index.d.ts.map +1 -1
- package/dist/vendor/runner-protocol/index.js +6 -1
- package/dist/vendor/runner-protocol/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,18 +61,52 @@ A run from a duckhunt that does not send the neutral form yet launches exactly a
|
|
|
61
61
|
## Setup
|
|
62
62
|
|
|
63
63
|
```sh
|
|
64
|
-
npx duckhunt-runner@0.
|
|
65
|
-
npx duckhunt-runner@0.13.0 repos discover ~/dev
|
|
66
|
-
npx duckhunt-runner@0.13.0 start
|
|
64
|
+
npx duckhunt-runner@0.28.0 setup
|
|
67
65
|
```
|
|
68
66
|
|
|
69
67
|
Pin the version: the daemon runs `claude -p` with a shell on your machine, so install the release you
|
|
70
|
-
mean to run (Settings → Agents →
|
|
71
|
-
recommends
|
|
68
|
+
mean to run (Settings → Agents → Connections shows the command pinned to the version duckhunt
|
|
69
|
+
recommends, and ticks off each step as this machine pairs and comes online).
|
|
70
|
+
|
|
71
|
+
`setup` (0.28.0 or later) walks you through the whole thing in one go:
|
|
72
|
+
|
|
73
|
+
1. **Requirements.** Checks Node, Claude Code and git. A missing Claude Code is a warning, not an
|
|
74
|
+
error: the machine pairs anyway, and its first run tells you.
|
|
75
|
+
2. **Connect.** Asks for this machine's name (the hostname by default), opens your browser to approve
|
|
76
|
+
it and comes back to the terminal by itself, like `claude` does. If the browser is on another
|
|
77
|
+
computer, or did not open, paste the code that duckhunt shows instead (see `login` below). A machine
|
|
78
|
+
already connected to that instance is kept unless you ask to reconnect it.
|
|
79
|
+
3. **Repos.** Proposes the folder where your checkouts live (`~/dev`, `~/code`, `~/src`… whichever
|
|
80
|
+
exists), shows what it found and maps it if you agree. It only adds: repos you already mapped stay.
|
|
81
|
+
4. **AWS accounts.** Lists the profiles of your AWS CLI, asks AWS which account each one reaches
|
|
82
|
+
(`aws sts get-caller-identity`, read-only) and offers to map the accounts not mapped yet, each with
|
|
83
|
+
its profile and region, as `aws add` would. When several profiles reach the same account it asks
|
|
84
|
+
which one to use; a profile AWS rejects (an expired SSO session, revoked keys) is listed with how to
|
|
85
|
+
fix it and skipped. Only the account id reaches duckhunt.
|
|
86
|
+
5. **Keep it running.** Offers to install the daemon as a service of your session — a systemd user
|
|
87
|
+
unit on Linux, a launchd agent on macOS — so it starts with your session and restarts if it
|
|
88
|
+
crashes. Otherwise, or where there is neither (Windows, a container), it starts in the foreground.
|
|
89
|
+
|
|
90
|
+
Every question has a flag, so `setup` also works in a script: `setup [base-url] [--name <name>]
|
|
91
|
+
[--repos <dir> | --no-repos] [--no-aws] [--service | --no-service] [--yes] [--no-browser]`. `--yes` takes the
|
|
92
|
+
default answer to every question (so it maps every account reached by a single profile and installs the
|
|
93
|
+
service); without a terminal it does the same.
|
|
94
|
+
Running `setup` again is safe, and it is how you move the service to a new version.
|
|
95
|
+
|
|
96
|
+
Step by step, the same thing is three commands:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npx duckhunt-runner@0.28.0 login
|
|
100
|
+
npx duckhunt-runner@0.28.0 repos discover ~/dev
|
|
101
|
+
npx duckhunt-runner@0.28.0 start
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Every command:
|
|
72
105
|
|
|
73
106
|
| Command | What it does |
|
|
74
107
|
| --- | --- |
|
|
75
|
-
| `
|
|
108
|
+
| `setup [base-url] [flags]` | The guided setup above (0.28.0 or later). |
|
|
109
|
+
| `login [base-url] [label] [--no-browser]` | Connects the daemon to your account. Opens the browser and, once you approve, comes back by itself through a one-off listener on `127.0.0.1` (0.28.0 or later); you can always paste the code duckhunt shows instead, which is what works over SSH or with the browser on another computer. With no browser to open (no display, an SSH session) or `--no-browser`, it only asks for the code. Defaults to `https://duckhunt.info`; pass a URL for another instance (`https://` is assumed if you omit the scheme). Both arguments are optional — an argument that does not look like a URL is taken as the label, which distinguishes machines if you run more than one. A running daemon switches to the new credential before its next claim; one connected to another instance keeps it until you restart it. |
|
|
76
110
|
| `repos discover [dir]` | Scans a directory for git checkouts and maps each one by its `origin` remote, so an agent can read the code behind an alarm. Add `--dry-run` to see what it would map. Only the `workspace/slug` key reaches the server. A repo checked out in more than one directory is listed but not mapped: pick one with `repos add`. |
|
|
77
111
|
| `repos list\|add\|remove` | Manage that map by hand: `repos add <workspace/slug> <path>`. `list` and `add` show each repo's health warnings (see below). |
|
|
78
112
|
| `aws add <accountId> <profile> [region] [--s3-read [bucket[/prefix]]…]` | Optional. Binds an AWS account id to a profile of your local AWS CLI, so the agent can read metrics, logs and resource state for that account. `--s3-read` (0.13.0 or later) also lets runs read S3 objects (see [S3 object reads](#s3-object-reads-0130-or-later)). |
|
|
@@ -83,6 +117,7 @@ recommends). That is the whole thing. Step by step:
|
|
|
83
117
|
| `logout [id]` | Unpairs this machine from duckhunt and deletes its credential from the config file (0.11.0 or later; see [Machines](#machines-and-credentials)). With an id, does the same for another platform. |
|
|
84
118
|
| `login <url> --as [id]`, `platforms …`, `audit …` | Add and manage other platforms, and read what each one ran here (0.13.0 or later; see [Platforms](#platforms-0130-or-later)). |
|
|
85
119
|
| `start [--verbose]` | Starts the claim loop. |
|
|
120
|
+
| `service install\|remove` | Installs the daemon as a service of your session (systemd user unit on Linux, launchd agent on macOS) and starts it, or stops and removes it (0.28.0 or later; see [Keeping it running](#keeping-it-running)). |
|
|
86
121
|
| `run [flags] "<prompt>"` | Runs an agent on this machine with no server (0.13.0 or later; see [Local runs](#local-runs-runner-run-0130-or-later)). `run` with no prompt still starts the daemon, with a deprecation warning. |
|
|
87
122
|
|
|
88
123
|
Configuration lives in `~/.duckhunt-runner.json`. It holds the base URL, the OAuth credential, this
|
|
@@ -147,8 +182,19 @@ To keep the map CLI-only on a machine, set `"remoteRepoEdits": false` under `def
|
|
|
147
182
|
|
|
148
183
|
### Keeping it running
|
|
149
184
|
|
|
150
|
-
`start` runs in the foreground and has to stay alive to claim runs.
|
|
151
|
-
|
|
185
|
+
`start` runs in the foreground and has to stay alive to claim runs. `service install` (0.28.0 or
|
|
186
|
+
later, also offered by `setup`) does it for you: on Linux it writes
|
|
187
|
+
`~/.config/systemd/user/duckhunt-runner.service` and enables it (`journalctl --user -u duckhunt-runner -f`
|
|
188
|
+
for the logs; run `loginctl enable-linger` once if it should keep running with no session open); on
|
|
189
|
+
macOS it writes `~/Library/LaunchAgents/info.duckhunt.runner.plist` and loads it, with its output in
|
|
190
|
+
`~/.duckhunt-runner/daemon.log`. The service runs the same pinned version that installed it (through
|
|
191
|
+
`npx` when you ran it with `npx`), with your current `PATH` so it finds `claude`, `git` and `aws`, and
|
|
192
|
+
with `DUCKHUNT_RUNNER_CONFIG`/`DUCKHUNT_RUNNER_HOME` if you set them. It does not restart a daemon that
|
|
193
|
+
stopped because the machine was unpaired. `service remove` stops and deletes it. To upgrade, run
|
|
194
|
+
`setup` or `service install` with the new version.
|
|
195
|
+
|
|
196
|
+
Or use whatever your machine already does for this — a `screen`/`tmux` session, your own systemd
|
|
197
|
+
unit, `launchd`:
|
|
152
198
|
|
|
153
199
|
```ini
|
|
154
200
|
# ~/.config/systemd/user/duckhunt-runner.service
|
|
@@ -156,7 +202,7 @@ already does for this — a `screen`/`tmux` session, a systemd user service, `la
|
|
|
156
202
|
Description=duckhunt runner
|
|
157
203
|
|
|
158
204
|
[Service]
|
|
159
|
-
ExecStart=/usr/bin/npx duckhunt-runner@0.
|
|
205
|
+
ExecStart=/usr/bin/npx duckhunt-runner@0.28.0 start
|
|
160
206
|
Restart=always
|
|
161
207
|
# 78: this machine was unpaired (or its credential expired); it needs a new `login`, not a restart.
|
|
162
208
|
RestartPreventExitStatus=78
|
|
@@ -413,6 +459,15 @@ including a platform added while the daemon runs (from its next step). Once a br
|
|
|
413
459
|
configured, every run, `edit` included, is also denied the browser vault (see
|
|
414
460
|
[Browser sessions](#browser-sessions-0130-or-later)).
|
|
415
461
|
|
|
462
|
+
Read runs also deny the credential and session stores of other agent CLIs (Codex, OpenCode, Amp,
|
|
463
|
+
Gemini, Copilot, Goose, Cursor) and the `.jsonl` transcripts of other Claude Code sessions and runs,
|
|
464
|
+
so a read run cannot read another conversation's transcript, even one from another workspace; the
|
|
465
|
+
native-memory `.md` files stay readable. The generic `~`-relative list comes from duckhunt and is
|
|
466
|
+
shared with the server; the daemon adds the real path behind any of these that is a symlink and the
|
|
467
|
+
relocated homes set by `CODEX_HOME`, `XDG_DATA_HOME` (OpenCode data), `OPENCODE_CONFIG_DIR`,
|
|
468
|
+
`GEMINI_CLI_HOME` and `COPILOT_HOME`. It also denies `<runner home>/backends/`, where per-conversation
|
|
469
|
+
agent homes will live.
|
|
470
|
+
|
|
416
471
|
Checked with Claude Code 2.1.296: `Read`, `Grep` and `Glob` honour these deny rules, through symlinks
|
|
417
472
|
and in recursive searches. The read-only shell approves nothing outside its working directory, and
|
|
418
473
|
inside it honours a denied path named directly but not a recursive read, which is why a committed
|
|
@@ -607,6 +662,14 @@ does it when the claim asks for it.
|
|
|
607
662
|
is listed with its counts but without its diff.
|
|
608
663
|
- It is uploaded after the feed and before the step's status. If git or the upload fails, the turn
|
|
609
664
|
just shows no changes; the run is never affected.
|
|
665
|
+
- A turn that moves `HEAD` to another line of history (`git checkout -b x origin/y`) is diffed from its
|
|
666
|
+
starting snapshot carried onto the new `HEAD`, so the distance between the two branches never counts as
|
|
667
|
+
the turn's changes (0.25.1 or later). Commits on top of the same line and a reset back still diff from
|
|
668
|
+
the snapshot.
|
|
669
|
+
- From 0.26.0, when duckhunt asks for it (`changes.run` in the claim), each step also uploads the net diff
|
|
670
|
+
of the whole conversation: from the conversation's base snapshot (the one duckhunt sends, or the first
|
|
671
|
+
turn of the process) to the end of the step, extra repos included. A base that `git gc` removed uploads
|
|
672
|
+
nothing; no changes upload an empty report.
|
|
610
673
|
- In the checkout (instead of a worktree), the snapshots also catch what you edit there while the turn
|
|
611
674
|
runs.
|
|
612
675
|
|
|
@@ -660,6 +723,33 @@ don't announce it).
|
|
|
660
723
|
snapshot, the step fails with `restore_failed` without launching Claude, and nothing is changed.
|
|
661
724
|
- What the agent did outside the worktree (in duckhunt, Jira, a push) stays done.
|
|
662
725
|
|
|
726
|
+
### Subagents and workflows (0.23.0 or later)
|
|
727
|
+
|
|
728
|
+
With a Claude Code that lists `--forward-subagent-text` in `--help`, the daemon announces subagents and
|
|
729
|
+
passes that flag, so the conversation shows what each subagent says and does, nested under the tool call
|
|
730
|
+
that started it. The feed carries the id of each tool call and of its parent, and the milestones of
|
|
731
|
+
subagents, workflows and background commands as `task` events. The tool lists grant `Agent`, `Task` and
|
|
732
|
+
`TaskStop` (and `Workflow` when duckhunt grants it) and deny `ListAgents` and `SendMessage`, which reach other
|
|
733
|
+
Claude Code sessions on the machine. A subagent inherits the step's permissions and tools, nothing more.
|
|
734
|
+
|
|
735
|
+
### Talking to a run while it works (0.24.0 or later)
|
|
736
|
+
|
|
737
|
+
With a Claude Code that lists `--input-format`, a step can keep Claude's stdin open (in stream-json): the
|
|
738
|
+
prompt goes in as the first message, and while the process lives the daemon long-polls the run's inbox in
|
|
739
|
+
duckhunt.
|
|
740
|
+
|
|
741
|
+
- **Stopping a task** (0.24.0). Stopping a subagent, workflow or background command from duckhunt becomes
|
|
742
|
+
Claude Code's own `stop_task` request. The daemon closes stdin on the first result that leaves no task
|
|
743
|
+
running (or on an error). If the main agent does not wake up within 60 seconds of its last task ending,
|
|
744
|
+
or the process says nothing for 15 minutes, stdin is closed anyway; the step's timeout still applies.
|
|
745
|
+
- **Messages** (0.25.0). With `--replay-user-messages` too, a message you send while the agent works is
|
|
746
|
+
written to stdin with its id, and Claude Code echoes it back when it takes it: that is the
|
|
747
|
+
acknowledgement. Taken while the agent is idle, it starts a new turn in the same process; taken mid-turn,
|
|
748
|
+
it joins that turn. A message not yet acknowledged keeps stdin open, like a task.
|
|
749
|
+
- Each new turn inside the process (a message, or Claude Code waking the main agent after a background
|
|
750
|
+
task) closes the previous one: its diff is uploaded with its own step number, the next turn's snapshot is
|
|
751
|
+
taken, and heartbeat, feed and inbox move to the new step.
|
|
752
|
+
|
|
663
753
|
## Platforms (0.13.0 or later)
|
|
664
754
|
|
|
665
755
|
duckhunt is the built-in platform: `login` and `logout` without an id are still the duckhunt ones,
|
|
@@ -671,7 +761,7 @@ worktrees (`<checkout>/.runner/worktrees/<id>/`), and sees only what you expose
|
|
|
671
761
|
### Adding one
|
|
672
762
|
|
|
673
763
|
```sh
|
|
674
|
-
npx duckhunt-runner@0.
|
|
764
|
+
npx duckhunt-runner@0.28.0 login https://platform.example --as acme --name "Acme"
|
|
675
765
|
```
|
|
676
766
|
|
|
677
767
|
`login <url> --as [id] [--name <name>] [--trusted]` reads the platform's discovery document and its
|
|
@@ -914,6 +1004,46 @@ With the daemon running, `run` hands the run to it over `~/.duckhunt-runner/sock
|
|
|
914
1004
|
lock while it works and `start` refuses to start meanwhile. Conversations live in
|
|
915
1005
|
`~/.duckhunt-runner/platforms/local/`, so one can be resumed from either.
|
|
916
1006
|
|
|
1007
|
+
## Conformance: checking an agent CLI's guarantees
|
|
1008
|
+
|
|
1009
|
+
The daemon leans on the agent CLI to honour the sandbox it is launched with: that a read-only run
|
|
1010
|
+
cannot run project code, that denied paths stay unreadable, that one run cannot reach another's token.
|
|
1011
|
+
`conformance <backend>` checks those guarantees for the exact CLI you have installed, and **spends no
|
|
1012
|
+
model tokens**: it runs the CLI against a local scripted model server, not the real API.
|
|
1013
|
+
|
|
1014
|
+
```sh
|
|
1015
|
+
duckhunt-runner conformance claude_code
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
Each check (a *probe*) builds a throwaway home with random *canary* values seeded everywhere a run
|
|
1019
|
+
should not be able to reach — other agent CLIs' credentials, another run's config, another session's
|
|
1020
|
+
transcript, a repo that tries to plant a hook or load its own MCP server, symlinks that escape the
|
|
1021
|
+
repo. It then launches the CLI exactly as the daemon would, with a scripted model that tells it to
|
|
1022
|
+
try reading or writing each of those places. The probe passes or fails by whether a canary value
|
|
1023
|
+
reaches the model or a file it should not — never by what the model says. The scripted server also
|
|
1024
|
+
acts as the run's outbound proxy and refuses every connection, so nothing leaves your machine and the
|
|
1025
|
+
report lists anything the CLI tried to contact.
|
|
1026
|
+
|
|
1027
|
+
The verdicts:
|
|
1028
|
+
|
|
1029
|
+
| verdict | meaning |
|
|
1030
|
+
|---|---|
|
|
1031
|
+
| `PASS` | the guarantee held |
|
|
1032
|
+
| `FAIL` | a canary leaked: the guarantee did not hold |
|
|
1033
|
+
| `XFAIL` | a *known* gap (a `t#…` target that will close it) is still open, as expected |
|
|
1034
|
+
| `XPASS` | a known gap looks closed — check whether the expectation is stale |
|
|
1035
|
+
| `ERROR` | the probe could not be measured (the CLI never ran, or a step went unanswered); never a pass |
|
|
1036
|
+
| `SKIP` | the probe does not apply on this OS |
|
|
1037
|
+
|
|
1038
|
+
Results are cached under `~/.duckhunt-runner/conformance/` per CLI version, the binary's SHA-256 and
|
|
1039
|
+
the OS, so a probe re-runs only when the CLI changes. `conformance <backend> --probe <id>` runs one
|
|
1040
|
+
probe, `--keep` leaves its canary home and the recorded requests on disk to inspect, and `--json`
|
|
1041
|
+
prints the machine-readable record. Later phases use this to let duckhunt admit a run class on a
|
|
1042
|
+
backend only once the needed guarantees are proven for that exact version.
|
|
1043
|
+
|
|
1044
|
+
On Linux, `status` also prints `kernel.yama.ptrace_scope`: a host setting that one of those guarantees
|
|
1045
|
+
(a run cannot read a sibling's process memory) depends on. `1` or higher is the hardened value.
|
|
1046
|
+
|
|
917
1047
|
## Licence
|
|
918
1048
|
|
|
919
1049
|
Copyright © 2026 miermontoto.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AwsAccountConfig } from './config.js';
|
|
2
|
+
/** un perfil de la aws cli con su cuenta y su región; `error` si sts lo rechazó (account null). */
|
|
3
|
+
export interface AwsProfileAccount {
|
|
4
|
+
profile: string;
|
|
5
|
+
account: string | null;
|
|
6
|
+
region: string | null;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/** una cuenta sin mapear y los perfiles que llegan a ella. */
|
|
10
|
+
export interface AwsAccountCandidate {
|
|
11
|
+
account: string;
|
|
12
|
+
profiles: AwsProfileAccount[];
|
|
13
|
+
}
|
|
14
|
+
/** los perfiles de la aws cli; null si no hay aws cli. */
|
|
15
|
+
export declare function listAwsProfiles(): Promise<string[] | null>;
|
|
16
|
+
/** la cuenta de cada perfil, en paralelo (ver cabecera). */
|
|
17
|
+
export declare function resolveAwsProfiles(profiles: readonly string[]): Promise<AwsProfileAccount[]>;
|
|
18
|
+
/** lo que se propone sobre lo ya mapeado: las cuentas nuevas con sus perfiles y una línea por perfil o cuenta vista
|
|
19
|
+
* (`+` una cuenta con un perfil, `?` varios perfiles de una cuenta, `=` ya mapeada, `!` perfil rechazado). */
|
|
20
|
+
export declare function planAwsAccounts(found: readonly AwsProfileAccount[], mapped: Readonly<Record<string, AwsAccountConfig>>): {
|
|
21
|
+
fresh: AwsAccountCandidate[];
|
|
22
|
+
lines: string[];
|
|
23
|
+
};
|
|
24
|
+
/** la entrada del mapa para un perfil (la de `aws add <cuenta> <perfil> [región]`). */
|
|
25
|
+
export declare const awsEntryOf: (p: AwsProfileAccount) => AwsAccountConfig;
|
|
26
|
+
//# sourceMappingURL=aws-discover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-discover.d.ts","sourceRoot":"","sources":["../src/aws-discover.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAYpD,mGAAmG;AACnG,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAMD,0DAA0D;AAC1D,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAOhE;AAsBD,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAE5F;AAED;+GAC+G;AAC/G,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAkB1K;AAED,uFAAuF;AACvF,eAAO,MAAM,UAAU,GAAI,GAAG,iBAAiB,KAAG,gBAAuF,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// cuentas aws de la máquina para el paso aws de `setup` (t#660): los perfiles de la aws cli, la cuenta de cada uno
|
|
2
|
+
// (sts get-caller-identity) y su región, y qué se propone mapear sobre lo ya mapeado. el mapa es el de `aws add`
|
|
3
|
+
// (aws.ts): id de cuenta → perfil; el server nunca ve perfiles ni credenciales.
|
|
4
|
+
// decisiones:
|
|
5
|
+
// - la cuenta la dice sts con el propio perfil (lo que el run usará), no el nombre del perfil: dos perfiles pueden ser
|
|
6
|
+
// la misma cuenta (lectura y admin) y elegir uno es de la persona; sin terminal, una cuenta así no se mapea.
|
|
7
|
+
// - un perfil que sts rechaza (sso caducado, claves revocadas) no bloquea nada: se dice con su arreglo y se sigue.
|
|
8
|
+
// - sts va en paralelo y con tope de tiempo: un perfil colgado (proceso de credenciales, red) no cuelga setup.
|
|
9
|
+
import { execFile } from 'node:child_process';
|
|
10
|
+
import { promisify } from 'node:util';
|
|
11
|
+
import { AWS_ACCOUNT_ID_RE } from './resources/aws.js';
|
|
12
|
+
const execFileP = promisify(execFile);
|
|
13
|
+
const AWS_TIMEOUT_MS = 15_000;
|
|
14
|
+
// sin paginador: la cli abriría less sobre la salida.
|
|
15
|
+
const AWS_ENV = { ...process.env, AWS_PAGER: '' };
|
|
16
|
+
// el rechazo de un perfil sso sin sesión (o caducada): su arreglo es `aws sso login`.
|
|
17
|
+
const SSO_EXPIRED_RE = /sso|token has expired|refresh failed/i;
|
|
18
|
+
const ERROR_MAX_CHARS = 120;
|
|
19
|
+
async function aws(args) {
|
|
20
|
+
return (await execFileP('aws', args, { encoding: 'utf-8', timeout: AWS_TIMEOUT_MS, env: AWS_ENV })).stdout.trim();
|
|
21
|
+
}
|
|
22
|
+
/** los perfiles de la aws cli; null si no hay aws cli. */
|
|
23
|
+
export async function listAwsProfiles() {
|
|
24
|
+
try {
|
|
25
|
+
return (await aws(['configure', 'list-profiles'])).split('\n').map((p) => p.trim()).filter(Boolean);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
if (err.code === 'ENOENT')
|
|
29
|
+
return null;
|
|
30
|
+
throw new Error(`aws configure list-profiles falló: ${err.message}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// lo que dice un rechazo de sts, en una línea y con su arreglo si es una sesión sso.
|
|
34
|
+
function stsError(profile, err) {
|
|
35
|
+
const stderr = String(err.stderr ?? err.message).trim();
|
|
36
|
+
if (SSO_EXPIRED_RE.test(stderr))
|
|
37
|
+
return `sin sesión: \`aws sso login --profile ${profile}\``;
|
|
38
|
+
const line = stderr.split('\n').find((l) => l.trim()) ?? 'sin respuesta';
|
|
39
|
+
return line.length > ERROR_MAX_CHARS ? `${line.slice(0, ERROR_MAX_CHARS)}…` : line;
|
|
40
|
+
}
|
|
41
|
+
// cuenta y región de un perfil.
|
|
42
|
+
async function resolveProfile(profile) {
|
|
43
|
+
// sin región configurada la cli sale con 1: el perfil va sin región (la del claim o la de la cli al correr).
|
|
44
|
+
const region = await aws(['configure', 'get', 'region', '--profile', profile]).catch(() => '');
|
|
45
|
+
try {
|
|
46
|
+
const account = await aws(['sts', 'get-caller-identity', '--profile', profile, '--query', 'Account', '--output', 'text']);
|
|
47
|
+
return AWS_ACCOUNT_ID_RE.test(account) ? { profile, account, region: region || null } : { profile, account: null, region: region || null, error: `sts devolvió «${account}»` };
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
return { profile, account: null, region: region || null, error: stsError(profile, err) };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** la cuenta de cada perfil, en paralelo (ver cabecera). */
|
|
54
|
+
export function resolveAwsProfiles(profiles) {
|
|
55
|
+
return Promise.all(profiles.map(resolveProfile));
|
|
56
|
+
}
|
|
57
|
+
/** lo que se propone sobre lo ya mapeado: las cuentas nuevas con sus perfiles y una línea por perfil o cuenta vista
|
|
58
|
+
* (`+` una cuenta con un perfil, `?` varios perfiles de una cuenta, `=` ya mapeada, `!` perfil rechazado). */
|
|
59
|
+
export function planAwsAccounts(found, mapped) {
|
|
60
|
+
const byAccount = found
|
|
61
|
+
.filter((p) => p.account !== null)
|
|
62
|
+
.reduce((acc, p) => acc.set(p.account, [...(acc.get(p.account) ?? []), p]), new Map());
|
|
63
|
+
const accounts = [...byAccount.entries()].map(([account, profiles]) => ({ account, profiles }));
|
|
64
|
+
const fresh = accounts.filter((a) => !(a.account in mapped));
|
|
65
|
+
const describe = (p) => `${p.profile}${p.region ? ` (${p.region})` : ''}`;
|
|
66
|
+
const lines = [
|
|
67
|
+
...accounts.map((a) => a.account in mapped
|
|
68
|
+
? ` = ${a.account} ya mapeada (perfil ${mapped[a.account].profile})`
|
|
69
|
+
: a.profiles.length === 1
|
|
70
|
+
? ` + ${a.account} ← perfil ${describe(a.profiles[0])}`
|
|
71
|
+
: ` ? ${a.account}: perfiles ${a.profiles.map(describe).join(', ')}`),
|
|
72
|
+
...found.filter((p) => p.error).map((p) => ` ! perfil ${p.profile}: ${p.error}`),
|
|
73
|
+
];
|
|
74
|
+
return { fresh, lines };
|
|
75
|
+
}
|
|
76
|
+
/** la entrada del mapa para un perfil (la de `aws add <cuenta> <perfil> [región]`). */
|
|
77
|
+
export const awsEntryOf = (p) => ({ profile: p.profile, ...(p.region ? { region: p.region } : {}) });
|
|
78
|
+
//# sourceMappingURL=aws-discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-discover.js","sourceRoot":"","sources":["../src/aws-discover.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,iHAAiH;AACjH,gFAAgF;AAChF,cAAc;AACd,uHAAuH;AACvH,+GAA+G;AAC/G,mHAAmH;AACnH,+GAA+G;AAE/G,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEtC,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,sDAAsD;AACtD,MAAM,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAClD,sFAAsF;AACtF,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAC/D,MAAM,eAAe,GAAG,GAAG,CAAC;AAgB5B,KAAK,UAAU,GAAG,CAAC,IAAc;IAC/B,OAAO,CAAC,MAAM,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACpH,CAAC;AAED,0DAA0D;AAC1D,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,O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,cAAc,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;KAClF,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAoB,EAAoB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Writable } from 'node:stream';
|
|
2
|
+
import type { AttemptFacts } from '../audit.js';
|
|
3
|
+
import type { ClaimResponse } from '../claim.js';
|
|
4
|
+
import type { EventUploader } from '../event-uploader.js';
|
|
5
|
+
import type { FeedContext } from '../feed.js';
|
|
6
|
+
import type { MaterializedRun, RunMcp } from '../resources/lifecycle.js';
|
|
7
|
+
import type { RunLease } from '../run-lease.js';
|
|
8
|
+
import type { SlashCommand } from '../vendor/runner-protocol/index.js';
|
|
9
|
+
import type { StatusReport } from '../status-report.js';
|
|
10
|
+
import type { RunInboxCommand, RunTurnReport } from '../vendor/runner-protocol/index.js';
|
|
11
|
+
/** lo que el daemon sabe de la máquina y de su config, de lo que dependen las capabilities de un driver. */
|
|
12
|
+
export interface HostFacts {
|
|
13
|
+
hasAws: boolean;
|
|
14
|
+
bypassPermissions: boolean;
|
|
15
|
+
remoteRepoEdits: boolean | undefined;
|
|
16
|
+
toolsetRender: boolean | undefined;
|
|
17
|
+
browser: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** lo que un `result` del agente principal cuenta de su turno (t#636, fase 3): el informe y el total de tool calls. */
|
|
20
|
+
export interface TurnEnded {
|
|
21
|
+
toolCallsTotal: number;
|
|
22
|
+
report: RunTurnReport;
|
|
23
|
+
}
|
|
24
|
+
/** los límites de turno dentro de un proceso vivo, del lado del daemon. */
|
|
25
|
+
export interface TurnHooks {
|
|
26
|
+
onTurnEnd(ended: TurnEnded): void;
|
|
27
|
+
onTurnStart(delivered: string[]): void;
|
|
28
|
+
onDelivered(ids: string[]): void;
|
|
29
|
+
}
|
|
30
|
+
/** a quién entrega el buzón del run sus órdenes mientras el proceso vive. */
|
|
31
|
+
export interface InboxTarget {
|
|
32
|
+
readonly open: boolean;
|
|
33
|
+
command(c: RunInboxCommand): boolean;
|
|
34
|
+
}
|
|
35
|
+
/** lo que el daemon pone a disposición del driver durante un segmento. */
|
|
36
|
+
export interface SegmentIo {
|
|
37
|
+
readonly log: string;
|
|
38
|
+
readonly feed: EventUploader | null;
|
|
39
|
+
readonly ctx: FeedContext;
|
|
40
|
+
note(text: string): void;
|
|
41
|
+
progress(toolCalls: number, workdir?: string): void;
|
|
42
|
+
serveInbox(target: InboxTarget, waitMs: number, signal: AbortSignal): void;
|
|
43
|
+
readonly verboseLog: (() => string) | null;
|
|
44
|
+
toolCallsAt(): number;
|
|
45
|
+
readonly turns: TurnHooks;
|
|
46
|
+
}
|
|
47
|
+
/** lo de un segmento que el driver necesita y no sale del claim. */
|
|
48
|
+
export interface SegmentSpec {
|
|
49
|
+
readonly claim: ClaimResponse;
|
|
50
|
+
readonly res: MaterializedRun;
|
|
51
|
+
readonly resourceMcp: RunMcp;
|
|
52
|
+
readonly lease: RunLease;
|
|
53
|
+
readonly platform: {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
configured(): string[];
|
|
56
|
+
};
|
|
57
|
+
defaults(): {
|
|
58
|
+
model: string | undefined;
|
|
59
|
+
maxBudgetUsd: number | undefined;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** cómo acabó un segmento, ya traducido por el driver. */
|
|
63
|
+
export interface SegmentOutcome {
|
|
64
|
+
report: StatusReport;
|
|
65
|
+
facts: AttemptFacts;
|
|
66
|
+
toolsByName: Record<string, number>;
|
|
67
|
+
commands(projectCwd: string | null): SlashCommand[] | null;
|
|
68
|
+
}
|
|
69
|
+
/** lo que el driver dejó preparado para un segmento y retira al cerrarlo. */
|
|
70
|
+
export interface PreparedSegment {
|
|
71
|
+
dispose(): void;
|
|
72
|
+
}
|
|
73
|
+
/** un cli de agente detrás del seam. */
|
|
74
|
+
export interface AgentDriver {
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly command: string;
|
|
77
|
+
readonly version: string | null;
|
|
78
|
+
/** detecta el cli instalado (versión y flags). */
|
|
79
|
+
detect(): Promise<void>;
|
|
80
|
+
/** comprobaciones y cálculos del arranque del daemon; lanza si el driver no puede trabajar. */
|
|
81
|
+
start(): void;
|
|
82
|
+
/** las capabilities que este cli deja anunciar, en el orden del cable. */
|
|
83
|
+
capabilities(facts: HostFacts): string[];
|
|
84
|
+
/** lo de un segmento que vive en disco mientras corre (y que `dispose` borra); lanza si no se puede preparar. */
|
|
85
|
+
prepare(spec: SegmentSpec): PreparedSegment;
|
|
86
|
+
/** lanza el segmento (con los reintentos propios del cli) y lo traduce a su informe; nunca lanza. */
|
|
87
|
+
run(spec: SegmentSpec, prepared: PreparedSegment, io: SegmentIo): Promise<SegmentOutcome>;
|
|
88
|
+
}
|
|
89
|
+
/** el stdin de un proceso, si el driver lo pidió. */
|
|
90
|
+
export type AgentStdin = Writable | null;
|
|
91
|
+
//# sourceMappingURL=agent-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-driver.d.ts","sourceRoot":"","sources":["../../src/backends/agent-driver.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAA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CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kDAAkD;IAClD,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,+FAA+F;IAC/F,KAAK,IAAI,IAAI,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,CAAC;IACzC,iHAAiH;IACjH,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CAAC;IAC5C,qGAAqG;IACrG,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3F;AAED,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// el seam de drivers (t#440 P1): lo único que el daemon sabe de un cli de agente. executeRun hace lo neutral
|
|
2
|
+
// (recursos, turnos del cwd, fotos del diff, feed, latido, auditoría, informe) y delega en el driver del backend lo
|
|
3
|
+
// propio del cli: qué anuncia, qué prepara por segmento, cómo se lanza, cómo se lee su salida y cómo se cierra.
|
|
4
|
+
// decisiones:
|
|
5
|
+
// - claude es el driver #0 y se envuelve EN SU SITIO (backends/claude/claude-driver.ts): sus módulos (claude.ts,
|
|
6
|
+
// claude-args.ts, run-mcp-config.ts, live-session.ts, read-shell-guard.ts, user-permissions.ts, slash-commands.ts)
|
|
7
|
+
// no se mueven, así el plan de lanzamiento, la salida y el cable quedan iguales byte a byte (spawn-plan.json,
|
|
8
|
+
// claude-output.json, wire-legacy).
|
|
9
|
+
// - el proceso lo vigila spawn-agent.ts (grupo propio, latido del lease, timeout, stderr, log, progreso): la mitad
|
|
10
|
+
// neutral de lo que era spawnClaude. el driver solo abre la sesión que lee su stdout.
|
|
11
|
+
// - los turnos dentro de un proceso vivo (t#636, fase 3) son del daemon: el driver le avisa con TurnEnded neutral
|
|
12
|
+
// (`onTurnEnd`), nunca con el evento de su cli.
|
|
13
|
+
// - el informe sale del driver ya con la forma del status; recortarlo y enmascararlo es neutral (clampReport en la
|
|
14
|
+
// plataforma) y vale para todo driver.
|
|
15
|
+
// - el claim sigue siendo el del cable legacy (ClaimResponse): el RunSpec neutral con su `legacy` aparte llega con el
|
|
16
|
+
// cable de backends (P4), cuando un claim no-claude traiga solo su toolset.
|
|
17
|
+
// non-goals (P1): elegir driver por claim (todo va al de claude_code hasta P4), deny-paths neutral (P7, cuando codex
|
|
18
|
+
// necesite las rutas absolutas para su deny_read), vocabulario canónico de tools (P4/P7).
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=agent-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-driver.js","sourceRoot":"","sources":["../../src/backends/agent-driver.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,oHAAoH;AACpH,gHAAgH;AAChH,cAAc;AACd,iHAAiH;AACjH,qHAAqH;AACrH,gHAAgH;AAChH,sCAAsC;AACtC,mHAAmH;AACnH,wFAAwF;AACxF,kHAAkH;AAClH,kDAAkD;AAClD,mHAAmH;AACnH,yCAAyC;AACzC,sHAAsH;AACtH,8EAA8E;AAC9E,qHAAqH;AACrH,0FAA0F"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** garantías de seguridad que un backend demuestra para su versión (runner-protocol, t#440 P2). */
|
|
2
|
+
export declare const BACKEND_ATTESTATION: {
|
|
3
|
+
readonly closedPolicy: "closed_policy";
|
|
4
|
+
readonly strictMcp: "strict_mcp";
|
|
5
|
+
readonly tokenIsolation: "token_isolation";
|
|
6
|
+
readonly controlPrivate: "control_private";
|
|
7
|
+
readonly processContained: "process_contained";
|
|
8
|
+
readonly ownTokenPrivate: "own_token_private";
|
|
9
|
+
readonly isolatedConfig: "isolated_config";
|
|
10
|
+
readonly secretPaths: "secret_paths";
|
|
11
|
+
readonly ownCredentialConfined: "own_credential_confined";
|
|
12
|
+
readonly noRepoExec: "no_repo_exec";
|
|
13
|
+
readonly vcsPushDeny: "vcs_push_deny";
|
|
14
|
+
readonly netPolicy: "net_policy";
|
|
15
|
+
readonly subagentInherit: "subagent_inherit";
|
|
16
|
+
};
|
|
17
|
+
export type BackendAttestation = (typeof BACKEND_ATTESTATION)[keyof typeof BACKEND_ATTESTATION];
|
|
18
|
+
/** de dónde sale la evidencia de una atestación: estructural, la tabla VERIFIED por versión exacta o conformidad local. */
|
|
19
|
+
export declare const ATTESTATION_EVIDENCE: {
|
|
20
|
+
readonly structural: "structural";
|
|
21
|
+
readonly verified: "verified";
|
|
22
|
+
readonly conformance: "conformance";
|
|
23
|
+
};
|
|
24
|
+
export type AttestationEvidence = (typeof ATTESTATION_EVIDENCE)[keyof typeof ATTESTATION_EVIDENCE];
|
|
25
|
+
/** cómo quedó una atestación tras medir sus sondas. */
|
|
26
|
+
export declare const ATTESTATION_STATUS: {
|
|
27
|
+
readonly proven: "proven";
|
|
28
|
+
readonly refuted: "refuted";
|
|
29
|
+
readonly unmeasured: "unmeasured";
|
|
30
|
+
readonly unprobed: "unprobed";
|
|
31
|
+
};
|
|
32
|
+
export type AttestationStatus = (typeof ATTESTATION_STATUS)[keyof typeof ATTESTATION_STATUS];
|
|
33
|
+
/** lo que una sonda medida aporta a sus atestaciones. */
|
|
34
|
+
export interface MeasuredProbe {
|
|
35
|
+
id: string;
|
|
36
|
+
attestations: readonly BackendAttestation[];
|
|
37
|
+
outcome: 'held' | 'broken' | 'unmeasured';
|
|
38
|
+
}
|
|
39
|
+
/** una atestación, cómo quedó y qué sondas la decidieron. */
|
|
40
|
+
export interface AttestationVerdict {
|
|
41
|
+
id: BackendAttestation;
|
|
42
|
+
status: AttestationStatus;
|
|
43
|
+
probes: string[];
|
|
44
|
+
}
|
|
45
|
+
/** el estado de cada atestación según las sondas medidas (ver cabecera), en el orden de BACKEND_ATTESTATION. */
|
|
46
|
+
export declare function attestationVerdicts(measured: readonly MeasuredProbe[]): AttestationVerdict[];
|
|
47
|
+
/** las atestaciones demostradas por conformidad, con su evidencia: lo que un driver puede anunciar para esa versión. */
|
|
48
|
+
export declare const provenByConformance: (verdicts: readonly AttestationVerdict[]) => {
|
|
49
|
+
id: BackendAttestation;
|
|
50
|
+
by: AttestationEvidence;
|
|
51
|
+
}[];
|
|
52
|
+
//# sourceMappingURL=attestation-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation-evidence.d.ts","sourceRoot":"","sources":["../../src/backends/attestation-evidence.ts"],"names":[],"mappings":"AAYA,mGAAmG;AACnG,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CA2BtB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEhG,2HAA2H;AAC3H,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnG,uDAAuD;AACvD,eAAO,MAAM,kBAAkB;;;;;CASrB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE7F,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAE5C,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC;CAC3C;AAED,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,kBAAkB,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,gHAAgH;AAChH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAa5F;AAED,wHAAwH;AACxH,eAAO,MAAM,mBAAmB,GAAI,UAAU,SAAS,kBAAkB,EAAE,KAAG;IAAE,EAAE,EAAE,kBAAkB,CAAC;IAAC,EAAE,EAAE,mBAAmB,CAAA;CAAE,EACA,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// las atestaciones de un backend y su evidencia (t#440 P6): qué garantía de seguridad aplica un cli de agente y con qué
|
|
2
|
+
// se demostró para SU versión exacta. el arnés de conformidad (src/conformance/) mide sondas contra el cli instalado;
|
|
3
|
+
// aquí se decide qué atestaciones quedan demostradas por esas medidas, que es lo que un driver anunciará (P7/P8).
|
|
4
|
+
// decisiones:
|
|
5
|
+
// - BACKEND_ATTESTATION y ATTESTATION_EVIDENCE tienen que ser IDÉNTICOS a los de runner-protocol (src/backends.ts del
|
|
6
|
+
// paquete, que añade la fase P2 del server en paralelo): mismos ids, mismos valores, mismo orden. es una copia
|
|
7
|
+
// provisional; al re-vendorizar el protocolo en P4 pasan a importarse de src/vendor/runner-protocol y aquí queda solo
|
|
8
|
+
// la lógica de evidencia. test/attestation-evidence.test.ts fija las listas exactas para que una deriva se note.
|
|
9
|
+
// - una atestación queda demostrada por conformidad solo si TODAS sus sondas pasan. una sola que filtra (o un hueco
|
|
10
|
+
// conocido que sigue abierto) la refuta; una sonda que no se pudo medir la deja en error, nunca demostrada.
|
|
11
|
+
// - sin sonda no hay evidencia de conformidad: «sin sonda», que para el server es lo mismo que no atestar.
|
|
12
|
+
/** garantías de seguridad que un backend demuestra para su versión (runner-protocol, t#440 P2). */
|
|
13
|
+
export const BACKEND_ATTESTATION = {
|
|
14
|
+
// política cerrada y explícita en cada arranque: nunca un bypass total.
|
|
15
|
+
closedPolicy: 'closed_policy',
|
|
16
|
+
// solo carga los servidores mcp que le da el daemon.
|
|
17
|
+
strictMcp: 'strict_mcp',
|
|
18
|
+
// el token per-run no es alcanzable desde otro run.
|
|
19
|
+
tokenIsolation: 'token_isolation',
|
|
20
|
+
// el canal de control y de aprobaciones es privado del segmento.
|
|
21
|
+
controlPrivate: 'control_private',
|
|
22
|
+
// un proceso privado por segmento, en su grupo, que muere entero al cancelar.
|
|
23
|
+
processContained: 'process_contained',
|
|
24
|
+
// el token per-run nunca en argv, env ni en reposo en un sitio compartido.
|
|
25
|
+
ownTokenPrivate: 'own_token_private',
|
|
26
|
+
// su config es la que escribe el daemon (ni la del usuario ni la del proyecto la amplían).
|
|
27
|
+
isolatedConfig: 'isolated_config',
|
|
28
|
+
// las rutas de secretos son ilegibles.
|
|
29
|
+
secretPaths: 'secret_paths',
|
|
30
|
+
// sus propias credenciales no salen de su home.
|
|
31
|
+
ownCredentialConfined: 'own_credential_confined',
|
|
32
|
+
// un run de lectura nunca ejecuta código, config ni hooks del repo.
|
|
33
|
+
noRepoExec: 'no_repo_exec',
|
|
34
|
+
// no puede hacer push.
|
|
35
|
+
vcsPushDeny: 'vcs_push_deny',
|
|
36
|
+
// sin red ni tools alojadas cuando el run no navega.
|
|
37
|
+
netPolicy: 'net_policy',
|
|
38
|
+
// sus subagentes heredan el sandbox y la política.
|
|
39
|
+
subagentInherit: 'subagent_inherit',
|
|
40
|
+
};
|
|
41
|
+
/** de dónde sale la evidencia de una atestación: estructural, la tabla VERIFIED por versión exacta o conformidad local. */
|
|
42
|
+
export const ATTESTATION_EVIDENCE = {
|
|
43
|
+
structural: 'structural',
|
|
44
|
+
verified: 'verified',
|
|
45
|
+
conformance: 'conformance',
|
|
46
|
+
};
|
|
47
|
+
/** cómo quedó una atestación tras medir sus sondas. */
|
|
48
|
+
export const ATTESTATION_STATUS = {
|
|
49
|
+
// todas sus sondas pasan: demostrada por conformidad.
|
|
50
|
+
proven: 'proven',
|
|
51
|
+
// alguna filtra (también un hueco conocido que sigue abierto).
|
|
52
|
+
refuted: 'refuted',
|
|
53
|
+
// ninguna filtra pero alguna no se pudo medir.
|
|
54
|
+
unmeasured: 'unmeasured',
|
|
55
|
+
// ninguna sonda la mide.
|
|
56
|
+
unprobed: 'unprobed',
|
|
57
|
+
};
|
|
58
|
+
/** el estado de cada atestación según las sondas medidas (ver cabecera), en el orden de BACKEND_ATTESTATION. */
|
|
59
|
+
export function attestationVerdicts(measured) {
|
|
60
|
+
return Object.values(BACKEND_ATTESTATION).map((id) => {
|
|
61
|
+
const mine = measured.filter((p) => p.attestations.includes(id));
|
|
62
|
+
const status = mine.length === 0
|
|
63
|
+
? ATTESTATION_STATUS.unprobed
|
|
64
|
+
: mine.some((p) => p.outcome === 'broken')
|
|
65
|
+
? ATTESTATION_STATUS.refuted
|
|
66
|
+
: mine.some((p) => p.outcome === 'unmeasured')
|
|
67
|
+
? ATTESTATION_STATUS.unmeasured
|
|
68
|
+
: ATTESTATION_STATUS.proven;
|
|
69
|
+
return { id, status, probes: mine.map((p) => p.id) };
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** las atestaciones demostradas por conformidad, con su evidencia: lo que un driver puede anunciar para esa versión. */
|
|
73
|
+
export const provenByConformance = (verdicts) => verdicts.filter((v) => v.status === ATTESTATION_STATUS.proven).map((v) => ({ id: v.id, by: ATTESTATION_EVIDENCE.conformance }));
|
|
74
|
+
//# sourceMappingURL=attestation-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation-evidence.js","sourceRoot":"","sources":["../../src/backends/attestation-evidence.ts"],"names":[],"mappings":"AAAA,wHAAwH;AACxH,sHAAsH;AACtH,kHAAkH;AAClH,cAAc;AACd,sHAAsH;AACtH,iHAAiH;AACjH,wHAAwH;AACxH,mHAAmH;AACnH,oHAAoH;AACpH,8GAA8G;AAC9G,2GAA2G;AAE3G,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,wEAAwE;IACxE,YAAY,EAAE,eA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BAAkB,CAAC,QAAQ;YAC7B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC;gBACxC,CAAC,CAAC,kBAAkB,CAAC,OAAO;gBAC5B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,YAAY,CAAC;oBAC5C,CAAC,CAAC,kBAAkB,CAAC,UAAU;oBAC/B,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC;QACpC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,wHAAwH;AACxH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAuC,EAAyD,EAAE,CACpI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ClaudeInfo, type StreamLine, type StreamState } from '../../claude.js';
|
|
2
|
+
import type { AgentDriver, HostFacts, PreparedSegment, SegmentIo, SegmentOutcome, SegmentSpec, TurnEnded } from '../agent-driver.js';
|
|
3
|
+
/** lo que un `result` cuenta de su turno (t#636, fase 3): el total de la sesión, sus vueltas y las tool calls desde `toolCallsAt`. */
|
|
4
|
+
export declare function turnEndedOf(ev: StreamLine, stream: StreamState, toolCallsAt: number): TurnEnded;
|
|
5
|
+
interface ClaudePrepared extends PreparedSegment {
|
|
6
|
+
readonly mcpFile: string;
|
|
7
|
+
}
|
|
8
|
+
/** claude code (`claude -p` con stream-json) como driver del daemon. */
|
|
9
|
+
export declare class ClaudeDriver implements AgentDriver {
|
|
10
|
+
readonly id: "claude_code";
|
|
11
|
+
readonly command = "claude";
|
|
12
|
+
info: ClaudeInfo;
|
|
13
|
+
secretDeny: string[];
|
|
14
|
+
get version(): string | null;
|
|
15
|
+
detect(): Promise<void>;
|
|
16
|
+
start(): void;
|
|
17
|
+
capabilities(facts: HostFacts): string[];
|
|
18
|
+
prepare(spec: SegmentSpec): ClaudePrepared;
|
|
19
|
+
run(spec: SegmentSpec, prepared: PreparedSegment, io: SegmentIo): Promise<SegmentOutcome>;
|
|
20
|
+
/** el deny de todo kit de un segmento de `platform` (por intento: una plataforma añadida en caliente queda cubierta). */
|
|
21
|
+
platformDeny(platform: SegmentSpec['platform']): string[];
|
|
22
|
+
private attempt;
|
|
23
|
+
private session;
|
|
24
|
+
private turnHooks;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=claude-driver.d.ts.map
|