duckhunt-runner 0.12.0 → 0.13.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 +379 -16
- package/dist/announced-capabilities.d.ts +2 -0
- package/dist/announced-capabilities.d.ts.map +1 -1
- package/dist/announced-capabilities.js +6 -0
- package/dist/announced-capabilities.js.map +1 -1
- package/dist/audit-cli.d.ts +7 -0
- package/dist/audit-cli.d.ts.map +1 -0
- package/dist/audit-cli.js +84 -0
- package/dist/audit-cli.js.map +1 -0
- package/dist/audit.d.ts +163 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +286 -0
- package/dist/audit.js.map +1 -0
- package/dist/aws.d.ts +10 -1
- package/dist/aws.d.ts.map +1 -1
- package/dist/aws.js +35 -9
- package/dist/aws.js.map +1 -1
- package/dist/browser-cli.d.ts +9 -0
- package/dist/browser-cli.d.ts.map +1 -0
- package/dist/browser-cli.js +200 -0
- package/dist/browser-cli.js.map +1 -0
- package/dist/claim.d.ts +44 -28
- package/dist/claim.d.ts.map +1 -1
- package/dist/claim.js +106 -85
- package/dist/claim.js.map +1 -1
- package/dist/claude.d.ts +1 -0
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +9 -3
- package/dist/claude.js.map +1 -1
- package/dist/config-legacy.d.ts +20 -0
- package/dist/config-legacy.d.ts.map +1 -0
- package/dist/config-legacy.js +253 -0
- package/dist/config-legacy.js.map +1 -0
- package/dist/config.d.ts +38 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +42 -26
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +81 -20
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +889 -417
- package/dist/daemon.js.map +1 -1
- package/dist/feed.d.ts +5 -1
- package/dist/feed.d.ts.map +1 -1
- package/dist/feed.js +78 -13
- package/dist/feed.js.map +1 -1
- package/dist/index.js +64 -4
- package/dist/index.js.map +1 -1
- package/dist/local/mcp.d.ts +93 -0
- package/dist/local/mcp.d.ts.map +1 -0
- package/dist/local/mcp.js +170 -0
- package/dist/local/mcp.js.map +1 -0
- package/dist/local/policy.d.ts +39 -0
- package/dist/local/policy.d.ts.map +1 -0
- package/dist/local/policy.js +88 -0
- package/dist/local/policy.js.map +1 -0
- package/dist/local/socket.d.ts +68 -0
- package/dist/local/socket.d.ts.map +1 -0
- package/dist/local/socket.js +140 -0
- package/dist/local/socket.js.map +1 -0
- package/dist/local/store.d.ts +75 -0
- package/dist/local/store.d.ts.map +1 -0
- package/dist/local/store.js +110 -0
- package/dist/local/store.js.map +1 -0
- package/dist/logout.d.ts +10 -11
- package/dist/logout.d.ts.map +1 -1
- package/dist/logout.js +65 -35
- package/dist/logout.js.map +1 -1
- package/dist/machine.d.ts +4 -0
- package/dist/machine.d.ts.map +1 -1
- package/dist/machine.js +35 -0
- package/dist/machine.js.map +1 -1
- package/dist/mcp-stdio.d.ts +19 -0
- package/dist/mcp-stdio.d.ts.map +1 -0
- package/dist/mcp-stdio.js +65 -0
- package/dist/mcp-stdio.js.map +1 -0
- package/dist/oauth.d.ts +32 -4
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +70 -35
- package/dist/oauth.js.map +1 -1
- package/dist/paths.d.ts +43 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +136 -0
- package/dist/paths.js.map +1 -0
- package/dist/platform-login.d.ts +19 -0
- package/dist/platform-login.d.ts.map +1 -0
- package/dist/platform-login.js +178 -0
- package/dist/platform-login.js.map +1 -0
- package/dist/platforms/claim-v0.d.ts +44 -0
- package/dist/platforms/claim-v0.d.ts.map +1 -0
- package/dist/platforms/claim-v0.js +243 -0
- package/dist/platforms/claim-v0.js.map +1 -0
- package/dist/platforms/credentials.d.ts +18 -0
- package/dist/platforms/credentials.d.ts.map +1 -0
- package/dist/platforms/credentials.js +64 -0
- package/dist/platforms/credentials.js.map +1 -0
- package/dist/platforms/discovery.d.ts +30 -0
- package/dist/platforms/discovery.d.ts.map +1 -0
- package/dist/platforms/discovery.js +91 -0
- package/dist/platforms/discovery.js.map +1 -0
- package/dist/platforms/duckhunt42.d.ts +33 -0
- package/dist/platforms/duckhunt42.d.ts.map +1 -0
- package/dist/platforms/duckhunt42.js +231 -0
- package/dist/platforms/duckhunt42.js.map +1 -0
- package/dist/platforms/factories.d.ts +3 -0
- package/dist/platforms/factories.d.ts.map +1 -0
- package/dist/platforms/factories.js +10 -0
- package/dist/platforms/factories.js.map +1 -0
- package/dist/platforms/http-transport.d.ts +29 -0
- package/dist/platforms/http-transport.d.ts.map +1 -0
- package/dist/platforms/http-transport.js +88 -0
- package/dist/platforms/http-transport.js.map +1 -0
- package/dist/platforms/local.d.ts +79 -0
- package/dist/platforms/local.d.ts.map +1 -0
- package/dist/platforms/local.js +302 -0
- package/dist/platforms/local.js.map +1 -0
- package/dist/platforms/origin.d.ts +12 -0
- package/dist/platforms/origin.d.ts.map +1 -0
- package/dist/platforms/origin.js +32 -0
- package/dist/platforms/origin.js.map +1 -0
- package/dist/platforms/platform.d.ts +135 -0
- package/dist/platforms/platform.d.ts.map +1 -0
- package/dist/platforms/platform.js +33 -0
- package/dist/platforms/platform.js.map +1 -0
- package/dist/platforms/scheduler.d.ts +32 -0
- package/dist/platforms/scheduler.d.ts.map +1 -0
- package/dist/platforms/scheduler.js +76 -0
- package/dist/platforms/scheduler.js.map +1 -0
- package/dist/platforms/supervisor.d.ts +45 -0
- package/dist/platforms/supervisor.d.ts.map +1 -0
- package/dist/platforms/supervisor.js +112 -0
- package/dist/platforms/supervisor.js.map +1 -0
- package/dist/platforms/types.d.ts +50 -0
- package/dist/platforms/types.d.ts.map +1 -0
- package/dist/platforms/types.js +69 -0
- package/dist/platforms/types.js.map +1 -0
- package/dist/platforms/v0.d.ts +41 -0
- package/dist/platforms/v0.d.ts.map +1 -0
- package/dist/platforms/v0.js +301 -0
- package/dist/platforms/v0.js.map +1 -0
- package/dist/platforms-cli.d.ts +5 -0
- package/dist/platforms-cli.d.ts.map +1 -0
- package/dist/platforms-cli.js +163 -0
- package/dist/platforms-cli.js.map +1 -0
- package/dist/read-shell-guard.d.ts.map +1 -1
- package/dist/read-shell-guard.js +4 -3
- package/dist/read-shell-guard.js.map +1 -1
- package/dist/repo-commands.js +2 -2
- package/dist/repo-commands.js.map +1 -1
- package/dist/repo-key.js +1 -1
- package/dist/repo-key.js.map +1 -1
- package/dist/repos.js +2 -2
- package/dist/repos.js.map +1 -1
- package/dist/resource.d.ts +2 -0
- package/dist/resource.d.ts.map +1 -0
- package/dist/resource.js +91 -0
- package/dist/resource.js.map +1 -0
- package/dist/resources/aws.d.ts +36 -0
- package/dist/resources/aws.d.ts.map +1 -0
- package/dist/resources/aws.js +160 -0
- package/dist/resources/aws.js.map +1 -0
- package/dist/resources/browser/config.d.ts +33 -0
- package/dist/resources/browser/config.d.ts.map +1 -0
- package/dist/resources/browser/config.js +86 -0
- package/dist/resources/browser/config.js.map +1 -0
- package/dist/resources/browser/health.d.ts +48 -0
- package/dist/resources/browser/health.d.ts.map +1 -0
- package/dist/resources/browser/health.js +100 -0
- package/dist/resources/browser/health.js.map +1 -0
- package/dist/resources/browser/odysea-cli.d.ts +41 -0
- package/dist/resources/browser/odysea-cli.d.ts.map +1 -0
- package/dist/resources/browser/odysea-cli.js +122 -0
- package/dist/resources/browser/odysea-cli.js.map +1 -0
- package/dist/resources/browser/origins.d.ts +17 -0
- package/dist/resources/browser/origins.d.ts.map +1 -0
- package/dist/resources/browser/origins.js +72 -0
- package/dist/resources/browser/origins.js.map +1 -0
- package/dist/resources/browser/provider.d.ts +49 -0
- package/dist/resources/browser/provider.d.ts.map +1 -0
- package/dist/resources/browser/provider.js +166 -0
- package/dist/resources/browser/provider.js.map +1 -0
- package/dist/resources/browser/state-filter.d.ts +28 -0
- package/dist/resources/browser/state-filter.d.ts.map +1 -0
- package/dist/resources/browser/state-filter.js +61 -0
- package/dist/resources/browser/state-filter.js.map +1 -0
- package/dist/resources/legacy.d.ts +13 -0
- package/dist/resources/legacy.d.ts.map +1 -0
- package/dist/resources/legacy.js +46 -0
- package/dist/resources/legacy.js.map +1 -0
- package/dist/resources/lifecycle.d.ts +48 -0
- package/dist/resources/lifecycle.d.ts.map +1 -0
- package/dist/resources/lifecycle.js +137 -0
- package/dist/resources/lifecycle.js.map +1 -0
- package/dist/resources/registry.d.ts +20 -0
- package/dist/resources/registry.d.ts.map +1 -0
- package/dist/resources/registry.js +37 -0
- package/dist/resources/registry.js.map +1 -0
- package/dist/{conversation-gc.d.ts → resources/repo/gc.d.ts} +6 -6
- package/dist/resources/repo/gc.d.ts.map +1 -0
- package/dist/{conversation-gc.js → resources/repo/gc.js} +16 -13
- package/dist/resources/repo/gc.js.map +1 -0
- package/dist/{repo-health.d.ts → resources/repo/health.d.ts} +4 -2
- package/dist/resources/repo/health.d.ts.map +1 -0
- package/dist/{repo-health.js → resources/repo/health.js} +14 -9
- package/dist/resources/repo/health.js.map +1 -0
- package/dist/resources/repo/provider.d.ts +14 -0
- package/dist/resources/repo/provider.d.ts.map +1 -0
- package/dist/resources/repo/provider.js +75 -0
- package/dist/resources/repo/provider.js.map +1 -0
- package/dist/{worktree.d.ts → resources/repo/worktree.d.ts} +3 -5
- package/dist/resources/repo/worktree.d.ts.map +1 -0
- package/dist/{worktree.js → resources/repo/worktree.js} +24 -27
- package/dist/resources/repo/worktree.js.map +1 -0
- package/dist/resources/s3-read.d.ts +29 -0
- package/dist/resources/s3-read.d.ts.map +1 -0
- package/dist/resources/s3-read.js +68 -0
- package/dist/resources/s3-read.js.map +1 -0
- package/dist/resources/types.d.ts +106 -0
- package/dist/resources/types.d.ts.map +1 -0
- package/dist/resources/types.js +73 -0
- package/dist/resources/types.js.map +1 -0
- package/dist/run-cli.d.ts +25 -0
- package/dist/run-cli.d.ts.map +1 -0
- package/dist/run-cli.js +432 -0
- package/dist/run-cli.js.map +1 -0
- package/dist/run-id.d.ts +10 -0
- package/dist/run-id.d.ts.map +1 -0
- package/dist/run-id.js +36 -0
- package/dist/run-id.js.map +1 -0
- package/dist/run-lease.d.ts +2 -2
- package/dist/run-mcp-config.d.ts +7 -4
- package/dist/run-mcp-config.d.ts.map +1 -1
- package/dist/run-mcp-config.js +14 -8
- package/dist/run-mcp-config.js.map +1 -1
- package/dist/s3-read-server.d.ts +22 -0
- package/dist/s3-read-server.d.ts.map +1 -0
- package/dist/s3-read-server.js +173 -0
- package/dist/s3-read-server.js.map +1 -0
- package/dist/secret-paths.d.ts +12 -0
- package/dist/secret-paths.d.ts.map +1 -1
- package/dist/secret-paths.js +82 -10
- package/dist/secret-paths.js.map +1 -1
- package/dist/server-state.d.ts +7 -9
- package/dist/server-state.d.ts.map +1 -1
- package/dist/server-state.js +14 -17
- package/dist/server-state.js.map +1 -1
- package/dist/status-report.d.ts +2 -0
- package/dist/status-report.d.ts.map +1 -1
- package/dist/status-report.js.map +1 -1
- package/dist/status.d.ts +5 -1
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +100 -6
- package/dist/status.js.map +1 -1
- package/dist/toolset/intersect.d.ts +10 -0
- package/dist/toolset/intersect.d.ts.map +1 -0
- package/dist/toolset/intersect.js +36 -0
- package/dist/toolset/intersect.js.map +1 -0
- package/dist/toolset/legacy-render.d.ts +12 -0
- package/dist/toolset/legacy-render.d.ts.map +1 -0
- package/dist/toolset/legacy-render.js +69 -0
- package/dist/toolset/legacy-render.js.map +1 -0
- package/dist/toolset/parse.d.ts +4 -0
- package/dist/toolset/parse.d.ts.map +1 -0
- package/dist/toolset/parse.js +74 -0
- package/dist/toolset/parse.js.map +1 -0
- package/dist/toolset/render.d.ts +28 -0
- package/dist/toolset/render.d.ts.map +1 -0
- package/dist/toolset/render.js +78 -0
- package/dist/toolset/render.js.map +1 -0
- package/dist/toolset/shadow.d.ts +16 -0
- package/dist/toolset/shadow.d.ts.map +1 -0
- package/dist/toolset/shadow.js +61 -0
- package/dist/toolset/shadow.js.map +1 -0
- package/dist/vendor/runner-protocol/aws.d.ts +6 -0
- package/dist/vendor/runner-protocol/aws.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/aws.js +69 -0
- package/dist/vendor/runner-protocol/aws.js.map +1 -0
- package/dist/vendor/runner-protocol/capabilities.d.ts +20 -0
- package/dist/vendor/runner-protocol/capabilities.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/capabilities.js +58 -0
- package/dist/vendor/runner-protocol/capabilities.js.map +1 -0
- package/dist/vendor/runner-protocol/claim.d.ts +112 -0
- package/dist/vendor/runner-protocol/claim.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/claim.js +54 -0
- package/dist/vendor/runner-protocol/claim.js.map +1 -0
- package/dist/vendor/runner-protocol/errors.d.ts +17 -0
- package/dist/vendor/runner-protocol/errors.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/errors.js +19 -0
- package/dist/vendor/runner-protocol/errors.js.map +1 -0
- package/dist/vendor/runner-protocol/events.d.ts +14 -0
- package/dist/vendor/runner-protocol/events.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/events.js +22 -0
- package/dist/vendor/runner-protocol/events.js.map +1 -0
- package/dist/vendor/runner-protocol/index.d.ts +10 -0
- package/dist/vendor/runner-protocol/index.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/index.js +24 -0
- package/dist/vendor/runner-protocol/index.js.map +1 -0
- package/dist/vendor/runner-protocol/limits.d.ts +31 -0
- package/dist/vendor/runner-protocol/limits.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/limits.js +60 -0
- package/dist/vendor/runner-protocol/limits.js.map +1 -0
- package/dist/vendor/runner-protocol/resources.d.ts +35 -0
- package/dist/vendor/runner-protocol/resources.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/resources.js +39 -0
- package/dist/vendor/runner-protocol/resources.js.map +1 -0
- package/dist/vendor/runner-protocol/toolset.d.ts +59 -0
- package/dist/vendor/runner-protocol/toolset.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/toolset.js +50 -0
- package/dist/vendor/runner-protocol/toolset.js.map +1 -0
- package/dist/vendor/runner-protocol/v0.d.ts +277 -0
- package/dist/vendor/runner-protocol/v0.d.ts.map +1 -0
- package/dist/vendor/runner-protocol/v0.js +121 -0
- package/dist/vendor/runner-protocol/v0.js.map +1 -0
- package/package.json +3 -2
- package/dist/aws-env.d.ts +0 -21
- package/dist/aws-env.d.ts.map +0 -1
- package/dist/aws-env.js +0 -80
- package/dist/aws-env.js.map +0 -1
- package/dist/conversation-gc.d.ts.map +0 -1
- package/dist/conversation-gc.js.map +0 -1
- package/dist/repo-health.d.ts.map +0 -1
- package/dist/repo-health.js.map +0 -1
- package/dist/worktree.d.ts.map +0 -1
- package/dist/worktree.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,6 +10,12 @@ answers in the run's conversation in duckhunt, which reaches you as a push notif
|
|
|
10
10
|
You can also start a run yourself: the *Agents* page in duckhunt is a chat with an agent running
|
|
11
11
|
on this machine, in a checkout of one of your repos (see [Prompt runs](#prompt-runs)).
|
|
12
12
|
|
|
13
|
+
From 0.13.0 the daemon can also take runs from other platforms that speak the same open protocol
|
|
14
|
+
(see [Platforms](#platforms-0130-or-later)), let a run browse with a session you saved (see
|
|
15
|
+
[Browser sessions](#browser-sessions-0130-or-later)) and run an agent with no server at all (see
|
|
16
|
+
[Local runs](#local-runs-runner-run-0130-or-later)). duckhunt stays the built-in platform. **Read
|
|
17
|
+
[Upgrading to 0.13.0](#upgrading-to-0130) first**: runs without an AWS account change.
|
|
18
|
+
|
|
13
19
|
The server never sees your credentials, your filesystem paths or your git tokens. It only ever
|
|
14
20
|
learns a repo's `workspace/slug` key and, optionally, an AWS account id — never where they live on
|
|
15
21
|
disk. With the progress feed on, it also receives what the agent says and one line per tool call
|
|
@@ -25,12 +31,35 @@ disk. With the progress feed on, it also receives what the agent says and one li
|
|
|
25
31
|
> `ANTHROPIC_API_KEY` in your environment silently shadows your Claude subscription login. If it is
|
|
26
32
|
> set and you did not mean to bill the API, unset it for the daemon's environment.
|
|
27
33
|
|
|
34
|
+
## Upgrading to 0.13.0
|
|
35
|
+
|
|
36
|
+
From 0.13.0 the daemon builds each run's Claude tool lists itself, from the permissions duckhunt sends
|
|
37
|
+
in a platform-neutral form, instead of taking duckhunt's lists as they come (see
|
|
38
|
+
[Tool lists](#tool-lists-built-by-the-daemon-0130-or-later)). For almost every run the result is the
|
|
39
|
+
same. The exception is AWS:
|
|
40
|
+
|
|
41
|
+
- **A run without an AWS account no longer inherits this machine's AWS.** Before, a run whose entry
|
|
42
|
+
had no AWS account (or only a region) used your environment's default profile: read-only patterns in
|
|
43
|
+
a `read` run, the whole AWS CLI through the shell in an `edit` one. Now it gets an empty AWS config.
|
|
44
|
+
- **To keep the old behaviour**, map your default identity: `duckhunt-runner resource add aws default
|
|
45
|
+
<profile> [region]`. The daemon then tells duckhunt it exposes `default`, and duckhunt grants it to
|
|
46
|
+
runs without an account: read-only in `read` runs, the whole AWS CLI in `edit` runs.
|
|
47
|
+
- Runs whose account you mapped with `aws add` behave as before, and so does an account you did not
|
|
48
|
+
map (empty AWS, with a note in the feed).
|
|
49
|
+
- The daemon warns once when it starts if this machine has AWS configured (the AWS CLI, AWS variables
|
|
50
|
+
or `~/.aws`) and `default` is not exposed to duckhunt.
|
|
51
|
+
- **To go back entirely**, set `"defaults": { "toolsetRender": false }` in the config file: the daemon
|
|
52
|
+
launches with duckhunt's lists again, only compares them with its own, announces neither
|
|
53
|
+
`toolset_render` nor `default`, and does not warn. Browser sessions need the switch on.
|
|
54
|
+
|
|
55
|
+
A run from a duckhunt that does not send the neutral form yet launches exactly as in 0.12.0.
|
|
56
|
+
|
|
28
57
|
## Setup
|
|
29
58
|
|
|
30
59
|
```sh
|
|
31
|
-
npx duckhunt-runner@0.
|
|
32
|
-
npx duckhunt-runner@0.
|
|
33
|
-
npx duckhunt-runner@0.
|
|
60
|
+
npx duckhunt-runner@0.13.0 login
|
|
61
|
+
npx duckhunt-runner@0.13.0 repos discover ~/dev
|
|
62
|
+
npx duckhunt-runner@0.13.0 start
|
|
34
63
|
```
|
|
35
64
|
|
|
36
65
|
Pin the version: the daemon runs `claude -p` with a shell on your machine, so install the release you
|
|
@@ -42,20 +71,33 @@ recommends). That is the whole thing. Step by step:
|
|
|
42
71
|
| `login [base-url] [label]` | Connects the daemon to your account. Opens the browser, you paste the code back. 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. |
|
|
43
72
|
| `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`. |
|
|
44
73
|
| `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). |
|
|
45
|
-
| `aws add <accountId> <profile
|
|
74
|
+
| `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)). |
|
|
46
75
|
| `aws list\|remove` | Manage the AWS map. |
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
76
|
+
| `resource list\|add\|remove\|check [repo\|aws\|browser]` | The same maps by resource type (0.13.0 or later): `repos`, `aws` and `browser` are its `repo`, `aws` and `browser` types, with the same output and exit codes (`resource discover repo` is `repos discover`). `resource add aws default <profile> [region]` maps the machine's default AWS identity (see [AWS accounts](#aws-accounts-0110-or-later)). `resource check` prints the repo and browser warnings and exits 1 if one blocks runs. |
|
|
77
|
+
| `browser login\|list\|check\|remove` | Browser sessions saved on this machine (0.13.0 or later; see [Browser sessions](#browser-sessions-0130-or-later)). |
|
|
78
|
+
| `status [--platforms]` | Reports whether a daemon is running, this machine's kit (Claude version, which credential it will use, AWS profiles and mapped repos) and what duckhunt last said about this machine (see [Machines](#machines-and-credentials)). Run this first when something does not work. `--platforms` shows each platform instead (see [Platforms](#platforms-0130-or-later)). |
|
|
79
|
+
| `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. |
|
|
80
|
+
| `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)). |
|
|
49
81
|
| `start [--verbose]` | Starts the claim loop. |
|
|
82
|
+
| `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. |
|
|
50
83
|
|
|
51
84
|
Configuration lives in `~/.duckhunt-runner.json`. It holds the base URL, the OAuth credential, this
|
|
52
|
-
machine's id, the repo and AWS maps, and optional defaults (`model`, `maxBudgetUsd`, `maxConcurrent`). Set `DUCKHUNT_RUNNER_CONFIG` to use
|
|
85
|
+
machine's id, the repo and AWS maps, and optional defaults (`model`, `maxBudgetUsd`, `maxConcurrent`, `auditRetentionDays`, `toolsetRender`). Set `DUCKHUNT_RUNNER_CONFIG` to use
|
|
53
86
|
another file (a second account, a test instance) and `DUCKHUNT_RUNNER_HOME` to move the state
|
|
54
87
|
directory (`~/.duckhunt-runner`: the scratch directory, `--verbose` logs, the daemon lock, the
|
|
55
|
-
per-run MCP configs and `server-state.json`, what duckhunt last said about this machine
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
88
|
+
per-run MCP configs and `server-state.json`, what duckhunt last said about this machine; from 0.13.0
|
|
89
|
+
also `audit/`, `platforms/<id>/` for other platforms, `browser-vault/` for saved browser sessions and
|
|
90
|
+
`sockets/` for `runner run`). `--version` prints the daemon version.
|
|
91
|
+
|
|
92
|
+
From 0.13.0 the same file can also hold `platforms` (other platforms and your settings for each, see
|
|
93
|
+
[Platforms](#platforms-0130-or-later)), `resources` (resource types other than repos and AWS: today
|
|
94
|
+
`browser`), `providers` (where to find odysea and the vault) and `version: 2`. These keys only appear once you use something that needs them, so a file
|
|
95
|
+
without them is exactly what 0.12.0 wrote, and the duckhunt credential and the repo and AWS maps stay
|
|
96
|
+
in their usual keys either way. An older daemon on the same file keeps working and leaves the new keys
|
|
97
|
+
alone (daemons before 0.10.1 rewrite the whole file and drop them). A file with a `version` this daemon
|
|
98
|
+
does not know is refused rather than half-read.
|
|
99
|
+
|
|
100
|
+
The daemon does not need a restart after `login`, `repos`, `aws`, `resource`, `browser`, `platforms` or a hand edit of the file: it
|
|
59
101
|
rereads the config every few seconds, even while all its slots are busy. Each command, and the
|
|
60
102
|
daemon itself when it rotates its token, rewrites only its own keys and replaces the file in one
|
|
61
103
|
step, so nothing undoes another's change. If the file does not parse (a hand edit in progress), the
|
|
@@ -109,7 +151,7 @@ already does for this — a `screen`/`tmux` session, a systemd user service, `la
|
|
|
109
151
|
Description=duckhunt runner
|
|
110
152
|
|
|
111
153
|
[Service]
|
|
112
|
-
ExecStart=/usr/bin/npx duckhunt-runner@0.
|
|
154
|
+
ExecStart=/usr/bin/npx duckhunt-runner@0.13.0 start
|
|
113
155
|
Restart=always
|
|
114
156
|
# 78: this machine was unpaired (or its credential expired); it needs a new `login`, not a restart.
|
|
115
157
|
RestartPreventExitStatus=78
|
|
@@ -151,7 +193,17 @@ next call.
|
|
|
151
193
|
|
|
152
194
|
When the credential is rejected (the machine was unpaired from duckhunt or with `logout`, or the
|
|
153
195
|
credential was revoked or expired), the daemon stops claiming, stops its runs and exits with code
|
|
154
|
-
**78** instead of retrying every few seconds.
|
|
196
|
+
**78** instead of retrying every few seconds. It also deletes that credential from the config file,
|
|
197
|
+
just like `logout` (0.13.1 or later), so unpairing a machine from duckhunt is enough: you don't need to
|
|
198
|
+
run `logout` on it. If a `login` replaced the credential in the meantime, the new one is kept. A
|
|
199
|
+
read-only config file is left as it is, with a warning. Run `login` again to pair it. With other platforms
|
|
200
|
+
configured (0.13.0 or later), only the platform whose credential died stops, along with its runs; the
|
|
201
|
+
daemon exits with 78 when none is left usable, and a new `login` brings that platform back without a
|
|
202
|
+
restart.
|
|
203
|
+
|
|
204
|
+
The machine's label is `label` from the config, or the hostname. From 0.13.0 a label longer than
|
|
205
|
+
duckhunt accepts (100 characters) is clipped, and a blank one falls back to the hostname; before,
|
|
206
|
+
duckhunt refused every claim with it.
|
|
155
207
|
|
|
156
208
|
`status` prints what duckhunt said about this machine in the daemon's last claim, and how long ago:
|
|
157
209
|
its name in duckhunt, whether it is paused, what it accepts, its slot cap, why it is not getting work
|
|
@@ -174,7 +226,9 @@ share on this machine takes turns: git operations on the same checkout (fetch, w
|
|
|
174
226
|
creation and cleanup), conversations opened in the checkout itself, and prompt runs with the `edit`
|
|
175
227
|
profile and no repo (they share the scratch directory). A run waiting for its turn
|
|
176
228
|
still heartbeats and says so in its feed. The daemon reports its slot count, and Settings → Agents
|
|
177
|
-
shows how many are in use.
|
|
229
|
+
shows how many are in use. With other platforms (0.13.0 or later), `maxConcurrent` is the pool they
|
|
230
|
+
all share, each one capped by its own `slots`, and a slot that frees up goes to the next waiting
|
|
231
|
+
platform in turn. Never run two daemons on the same config file: the credential rotates on
|
|
178
232
|
every refresh and duckhunt revokes it when it sees an old one again. `start` refuses a second daemon
|
|
179
233
|
on the same state directory; raise one daemon's slots instead.
|
|
180
234
|
|
|
@@ -226,6 +280,45 @@ may belong to another account: the AWS CLI runs with empty config and credential
|
|
|
226
280
|
call fails, and the run's feed says which account to map. duckhunt already omits the AWS read
|
|
227
281
|
patterns for an investigation whose account this machine does not announce; this is the second line.
|
|
228
282
|
|
|
283
|
+
From 0.13.0 a run without an account gets an empty AWS config too, unless you map the machine's
|
|
284
|
+
default identity under the key `default` (`resource add aws default <profile> [region]`; `aws add`
|
|
285
|
+
still takes only account ids). Nothing creates it for you. When it is exposed to duckhunt (it is by
|
|
286
|
+
default, like every AWS key), the daemon announces that it has one, never its profile, and duckhunt
|
|
287
|
+
grants it to runs without an account (see [Upgrading to 0.13.0](#upgrading-to-0130)). Other platforms
|
|
288
|
+
ask for AWS by key (see [Platforms](#platforms-0130-or-later)), and their runs get no AWS at all
|
|
289
|
+
unless they are granted a key you exposed to them.
|
|
290
|
+
|
|
291
|
+
#### S3 object reads (0.13.0 or later)
|
|
292
|
+
|
|
293
|
+
A `read` run can list S3 (`aws s3 ls`) but not read objects: `s3api get-object` needs a local output
|
|
294
|
+
file, and a permission rule can't limit `get-object` or `aws s3 cp` to stdout, so both stay denied.
|
|
295
|
+
To let investigations read objects such as ALB access logs, opt in per AWS key:
|
|
296
|
+
|
|
297
|
+
```sh
|
|
298
|
+
duckhunt-runner aws add <account-id> <profile> [region] --s3-read acme-alb-logs/AWSLogs/
|
|
299
|
+
duckhunt-runner aws add <account-id> <profile> [region] --s3-read # any bucket the profile can read
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The targets are `bucket` or `bucket/prefix`. They are stored as `aws.<key>.s3Read` (`true` or a
|
|
303
|
+
list) and shown by `aws list`. Running `aws add` again without the flag removes it.
|
|
304
|
+
`resource add aws` takes the same flag, including for the `default` key.
|
|
305
|
+
|
|
306
|
+
A run that has a grant for that key then gets one more MCP server, `res_aws_<key>`. It is the runner
|
|
307
|
+
itself (a hidden `mcp-s3` subcommand) with only the run's AWS settings, `PATH`, `HOME` and the
|
|
308
|
+
allowed targets in its environment. Its single tool, `s3_read {bucket, key, offset?, maxBytes?, region?}`:
|
|
309
|
+
|
|
310
|
+
- refuses anything outside the allowed buckets and prefixes;
|
|
311
|
+
- checks the size first (`head-object`) and won't read an object over 256 MB compressed;
|
|
312
|
+
- streams it with `aws s3 cp s3://… -` (stdout only, no shell), gunzipping `.gz` objects, and stops as
|
|
313
|
+
soon as it has the requested window: at most 512 KB of text per call, never past 64 MB of
|
|
314
|
+
decompressed data. The reply says which bytes it holds and the `offset` to continue from;
|
|
315
|
+
- returns text only: for a binary object (NUL bytes) it reports the size read, not the content.
|
|
316
|
+
|
|
317
|
+
It never writes a local file and has no upload path. The feed shows `s3://bucket/key` and the window
|
|
318
|
+
asked for, never the content. It is offered only when the daemon builds the run's tool lists (the
|
|
319
|
+
default from 0.13.0, v0 platforms and `runner run`); with `defaults.toolsetRender: false` the run
|
|
320
|
+
gets a note instead. An `edit` run gets it too, though its shell could already read the object.
|
|
321
|
+
|
|
229
322
|
## Prompt runs
|
|
230
323
|
|
|
231
324
|
A prompt run is a conversation you start from the *Agents* page: you pick one of the repos mapped
|
|
@@ -308,7 +401,12 @@ directory (the logs, the lock, `server-state.json` and the run configs; not the
|
|
|
308
401
|
which is the working directory of runs without a repo), `$CLAUDE_CONFIG_DIR/.credentials.json`,
|
|
309
402
|
`AWS_SHARED_CREDENTIALS_FILE` and `AWS_CONFIG_FILE` when they are set, and the real path behind any
|
|
310
403
|
of the listed ones that is a symlink (dotfiles). A path that a Claude permission rule cannot express
|
|
311
|
-
(commas, brackets, wildcards) is skipped with a warning at startup.
|
|
404
|
+
(commas, brackets, wildcards) is skipped with a warning at startup. From 0.13.0 that includes the
|
|
405
|
+
audit directory (from the first start after it exists), and every run is also denied the state of the
|
|
406
|
+
other platforms: their logs, run configs, `server-state.json`, audit and scratch directory,
|
|
407
|
+
including a platform added while the daemon runs (from its next step). Once a browser session is
|
|
408
|
+
configured, every run, `edit` included, is also denied the browser vault (see
|
|
409
|
+
[Browser sessions](#browser-sessions-0130-or-later)).
|
|
312
410
|
|
|
313
411
|
Checked with Claude Code 2.1.296: `Read`, `Grep` and `Glob` honour these deny rules, through symlinks
|
|
314
412
|
and in recursive searches. The read-only shell approves nothing outside its working directory, and
|
|
@@ -328,6 +426,13 @@ allows them.
|
|
|
328
426
|
(automation runs included); user, project and local settings for the legacy automation runs of an
|
|
329
427
|
older duckhunt. If a settings file can't be read, those tools are denied outright (and the run
|
|
330
428
|
gets no memory).
|
|
429
|
+
- **A symlinked project folder blocks memory writes.** If `~/.claude/projects/<repo>` (or its
|
|
430
|
+
`memory/`) is a symlink to somewhere outside `~/.claude`, as GNU stow does with a dotfiles repo,
|
|
431
|
+
runs can still edit `MEMORY.md` but every other memory file they write is refused ("denied
|
|
432
|
+
because Claude Code is running in don't ask mode"). The Claude CLI resolves the link before applying
|
|
433
|
+
the auto-memory exception, and under `dontAsk` no allow rule or `--add-dir` brings it back (checked
|
|
434
|
+
with the CLI 2.1.304), so the daemon can't work around it. Keep those folders as real directories
|
|
435
|
+
for the repos your runs work on, and link the dotfiles side to them instead.
|
|
331
436
|
- duckhunt can now let investigations and rule runs extend Claude Code's native memory too: a setting
|
|
332
437
|
of yours in Settings → Agents, on by default (nothing changes in the daemon; the server just stops
|
|
333
438
|
denying `Edit` and `Write` for them). Repo runs write the repo's memory, the one your interactive
|
|
@@ -414,12 +519,270 @@ for your home; a file opened outside the worktree shows only its name) and anyth
|
|
|
414
519
|
a secret (AWS keys, GitHub, Slack, Atlassian, Bitbucket and Anthropic tokens, credentials in a remote
|
|
415
520
|
URL, `password=`/`token=`-style assignments, `Bearer` headers, private keys) is masked before it
|
|
416
521
|
leaves the machine, also in the final result, error and stderr; the server masks it again. Set *progress feed* to *counter only* in Settings → Agents to send just the
|
|
417
|
-
tool-call count.
|
|
522
|
+
tool-call count. From 0.13.0, what the agent types or evaluates in a tool that is not the platform's
|
|
523
|
+
own (the `value` of a form fill, a script it runs in a page) shows only its length, and a URL shows
|
|
524
|
+
only its origin and path, never its query or fragment. Browser tools get a summary of their own: the
|
|
525
|
+
selector of a `fill` or `select_option`, `js ‹length›` for an `evaluate`, the action of a dialog and
|
|
526
|
+
the key pressed.
|
|
418
527
|
|
|
419
528
|
The daemon also strips variables of the Claude Code session it may have been started from
|
|
420
529
|
(`CLAUDECODE`, `CLAUDE_CODE_SESSION_ID`…), empty `ANTHROPIC_*` values and a dead `SSH_AUTH_SOCK` from
|
|
421
530
|
the environment of each run, and disables git's terminal prompts.
|
|
422
531
|
|
|
532
|
+
## Platforms (0.13.0 or later)
|
|
533
|
+
|
|
534
|
+
duckhunt is the built-in platform: `login` and `logout` without an id are still the duckhunt ones,
|
|
535
|
+
and it keeps its current protocol (`duckhunt-42`) even against a duckhunt that already publishes the
|
|
536
|
+
new one. Other platforms speak `agent-runner/0`, an open protocol they describe at
|
|
537
|
+
`/.well-known/agent-runner`. Each one gets its own credential, its own state directory and its own
|
|
538
|
+
worktrees (`<checkout>/.runner/worktrees/<id>/`), and sees only what you expose to it.
|
|
539
|
+
|
|
540
|
+
### Adding one
|
|
541
|
+
|
|
542
|
+
```sh
|
|
543
|
+
npx duckhunt-runner@0.13.0 login https://platform.example --as acme --name "Acme"
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
`login <url> --as [id] [--name <name>] [--trusted]` reads the platform's discovery document and its
|
|
547
|
+
OAuth metadata, registers this machine, and asks you to open a URL and paste the code back, like the
|
|
548
|
+
duckhunt `login`. Every OAuth endpoint has to be on the platform's own origin, the platform has to
|
|
549
|
+
serve HTTPS (plain HTTP only on localhost, for development) and support PKCE `S256`; otherwise
|
|
550
|
+
nothing is sent. Without a value, `--as` derives the id from the platform's host. `duckhunt` and
|
|
551
|
+
`local` are reserved. Logging in again with the same id and the same platform renews the credential
|
|
552
|
+
and keeps everything you set for it; an id already used by another platform is refused.
|
|
553
|
+
|
|
554
|
+
A platform without a discovery document can only be added with `--trusted`: it then speaks the
|
|
555
|
+
duckhunt protocol, in which this machine cannot apply your limits (see below).
|
|
556
|
+
|
|
557
|
+
A new platform starts with nothing exposed, one slot and the lowest ceiling: no shell, no edits, no
|
|
558
|
+
memory, no web, no push and no access to any resource. It can still call its own MCP tools
|
|
559
|
+
(`platformTools: "*"`), which only ever reach that platform. To let it work on a repo, expose the key
|
|
560
|
+
*and* give the type an `access` level in its ceiling, by editing the config file (example below). A
|
|
561
|
+
running daemon picks it up within a few seconds.
|
|
562
|
+
|
|
563
|
+
| Command | What it does |
|
|
564
|
+
| --- | --- |
|
|
565
|
+
| `platforms list` | Every platform with its protocol, server, whether it is trusted, paused, its slots and what it can see. Never contacts a server. |
|
|
566
|
+
| `platforms pause\|resume <id>` | Stop or resume claiming; runs in progress finish. |
|
|
567
|
+
| `platforms expose\|unexpose <id> <type> <key\|*>` | What it can see of this machine: `repo`, `aws` and `browser` keys you mapped, or `*` for all of a type, including those you map later. |
|
|
568
|
+
| `platforms trust\|untrust <id>` | Whether it may get a full shell (see below). `untrust` lowers a full-shell ceiling to the read-only shell. |
|
|
569
|
+
| `platforms remove <id>` | Unpairs it on its server and deletes its entry. Its directories stay, since they may hold work, and the command prints where. |
|
|
570
|
+
| `logout <id>` | Unpairs it and deletes only its credential. |
|
|
571
|
+
|
|
572
|
+
duckhunt can be paused and its exposure edited (by default it sees every repo and AWS key, as
|
|
573
|
+
before, but no browser session until you run `platforms expose duckhunt browser <key>`), but not
|
|
574
|
+
removed or untrusted: `logout` unpairs it. `local` is the platform behind `runner run` (see
|
|
575
|
+
[Local runs](#local-runs-runner-run-0130-or-later)): it exists without an entry, is trusted, has the
|
|
576
|
+
whole ceiling and sees nothing until you expose it.
|
|
577
|
+
|
|
578
|
+
### What a platform may do
|
|
579
|
+
|
|
580
|
+
What a run can do is what the platform asks for, intersected with the ceiling you set for that
|
|
581
|
+
platform in the config file:
|
|
582
|
+
|
|
583
|
+
```json
|
|
584
|
+
{
|
|
585
|
+
"platforms": {
|
|
586
|
+
"acme": {
|
|
587
|
+
"expose": { "repo": ["acme/api"] },
|
|
588
|
+
"ceiling": { "shell": "read", "fsWrite": false, "memory": false, "web": true, "vcsPush": false, "access": { "repo": "read" }, "platformTools": "*" },
|
|
589
|
+
"slots": 1,
|
|
590
|
+
"runsPerDay": 20
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
For an `agent-runner/0` platform, this daemon enforces it. It builds the Claude tool lists itself from
|
|
597
|
+
the platform's request cut down to the ceiling, never from lists the platform sends, and a `read`
|
|
598
|
+
run never edits or gets a full shell. A resource is only materialized when the platform asks for it,
|
|
599
|
+
you exposed that key to it, and its type has an `access` level in the ceiling. A run without an AWS
|
|
600
|
+
grant gets an empty AWS config. A claim that asks for an unknown resource type, a key you did not
|
|
601
|
+
expose, a type the ceiling does not allow, or a policy field this daemon does not know is refused and
|
|
602
|
+
reported as failed, with a code and no paths. Its MCP servers have to be on the platform's own
|
|
603
|
+
origin, so a platform cannot point a run at another host or at a service on your machine.
|
|
604
|
+
|
|
605
|
+
`shell: "full"` is only allowed for platforms you marked `trusted` (`login --trusted` or
|
|
606
|
+
`platforms trust`); the config is invalid otherwise. A second platform that speaks the duckhunt
|
|
607
|
+
protocol only runs when trusted, because on that protocol the ceiling cannot be applied.
|
|
608
|
+
|
|
609
|
+
**Quotas.** `slots` (1 by default) caps its runs within `defaults.maxConcurrent`. `budgetUsdPerDay`
|
|
610
|
+
and `runsPerDay` cap a local day, counted from the [audit](#status-and-audit); once reached, the
|
|
611
|
+
platform stops claiming until midnight while the others carry on. On a Claude subscription the cost
|
|
612
|
+
is the one Claude reports, not what you are billed.
|
|
613
|
+
|
|
614
|
+
**Identity.** Each platform other than duckhunt is announced a machine id derived from a secret
|
|
615
|
+
stored in the config file (`machineSecret`) and the platform's address, so two platforms cannot tell
|
|
616
|
+
they share a machine by its id. duckhunt keeps its id. `label` under a platform overrides the label it
|
|
617
|
+
sees.
|
|
618
|
+
|
|
619
|
+
### Isolation between platforms
|
|
620
|
+
|
|
621
|
+
Kept apart: credentials (each refresh writes only its own), run configs with their tokens, scratch
|
|
622
|
+
directories, worktrees, logs, `server-state.json` and audit files. Every run's `Read` deny covers the
|
|
623
|
+
other platforms' state.
|
|
624
|
+
|
|
625
|
+
Not kept apart:
|
|
626
|
+
|
|
627
|
+
- A full shell. `Read` denies do not bind `Bash`, so an `edit` run can read this config file, which
|
|
628
|
+
holds every platform's refresh token, and the tokens of runs in other slots. Only give
|
|
629
|
+
`shell: "full"` to platforms you trust; that is what the `trusted` flag is for.
|
|
630
|
+
- Claude's native memory is stored by directory, so runs of different platforms in the same repo, and
|
|
631
|
+
your own sessions there, share it. Leave `memory` off in a ceiling to keep a platform out of it.
|
|
632
|
+
- A platform can notice the machine is busy when its claims stop being served, though not by whom.
|
|
633
|
+
|
|
634
|
+
### Status and audit
|
|
635
|
+
|
|
636
|
+
`status --platforms` shows each platform: protocol, credential, local state (active, paused, out of
|
|
637
|
+
its daily quota…), what its server last said and when, quota use, a summary of its ceiling, what it
|
|
638
|
+
can see with the health of those repos, and its audit for the last 24 hours. Like `status`, it never
|
|
639
|
+
contacts a server; plain `status` prints what it always did.
|
|
640
|
+
|
|
641
|
+
The daemon keeps an audit of every platform's runs, duckhunt's included, in
|
|
642
|
+
`~/.duckhunt-runner/audit/<id>/YYYY-MM.jsonl` (files `0600`): one line when a run is claimed, one when
|
|
643
|
+
a claim is refused (with its code) and one when each step closes. It records ids, times, resource
|
|
644
|
+
keys and access levels, MCP server names, the model, tool names with their counts, cost, the outcome
|
|
645
|
+
and a SHA-256 of the prompt. It never records the prompt, results, tool arguments, paths or tokens.
|
|
646
|
+
A month's file is deleted once that month ended more than `defaults.auditRetentionDays` (180) ago,
|
|
647
|
+
and each platform keeps at most 50 MB, oldest months first, never the current one.
|
|
648
|
+
`audit [--platform <id>] [--since 7d|<date>] [--json]` prints it (the last 7 days by default).
|
|
649
|
+
|
|
650
|
+
### Tool lists built by the daemon (0.13.0 or later)
|
|
651
|
+
|
|
652
|
+
0.13.0 announces `toolset_v1` and `toolset_render`. duckhunt then sends each run's permissions in the
|
|
653
|
+
platform-neutral form next to its usual tool lists, and the daemon launches the run with the lists it
|
|
654
|
+
builds itself, capped by duckhunt's ceiling. The run's resources (its repo, its AWS key, a browser
|
|
655
|
+
session) come from the grants in that form, so a key you did not expose to duckhunt is refused rather
|
|
656
|
+
than used. Worktree paths do not change.
|
|
657
|
+
|
|
658
|
+
The daemon still compares its lists with duckhunt's and reports in each step's status whether they
|
|
659
|
+
match; duckhunt logs only a difference the daemon cannot explain. With
|
|
660
|
+
`"defaults": { "toolsetRender": false }` it launches with duckhunt's lists again and only compares
|
|
661
|
+
(see [Upgrading to 0.13.0](#upgrading-to-0130)).
|
|
662
|
+
|
|
663
|
+
## Browser sessions (0.13.0 or later)
|
|
664
|
+
|
|
665
|
+
A run can browse with a session you logged into yourself, such as your Jira or an admin console, without
|
|
666
|
+
the agent ever seeing your password. The browser is [odysea](https://github.com/miermontoto/odysea), an
|
|
667
|
+
MCP server installed separately (0.5.1 or later): the daemon finds it on `PATH` or at
|
|
668
|
+
`providers.browser.bin`, and launches it as its own process for each run. It never loads a browser
|
|
669
|
+
itself.
|
|
670
|
+
|
|
671
|
+
On npm it is `@miermontoto/odysea` (the unscoped `odysea` package is an unrelated project). Set
|
|
672
|
+
`providers.browser.bin` to the installed binary's absolute path, so the daemon never depends on what
|
|
673
|
+
`PATH` resolves:
|
|
674
|
+
|
|
675
|
+
```sh
|
|
676
|
+
npm i -g @miermontoto/odysea
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
Before using a binary, the daemon asks it for its identity (`odysea --identify`) and only accepts
|
|
680
|
+
`@miermontoto/odysea` 0.5.1 or later; anything else counts as odysea missing. That keeps an unrelated
|
|
681
|
+
program called `odysea` from being handed a copy of your session by accident. It is not protection
|
|
682
|
+
against a binary made to impersonate it: whatever is on your `PATH` already runs as you.
|
|
683
|
+
|
|
684
|
+
```sh
|
|
685
|
+
duckhunt-runner browser login jira https://acme.atlassian.net --origin https://acme.atlassian.net --origin https://id.atlassian.com
|
|
686
|
+
duckhunt-runner platforms expose duckhunt browser jira
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
| Command | What it does |
|
|
690
|
+
| --- | --- |
|
|
691
|
+
| `browser login <key> <url> [--origin <pattern> …] [--session <name>] [--exclusive] [--probe-url <url> [--login-pattern <regex>]]` | Opens a visible odysea window on `<url>` so you log in, then saves the session in the vault (`~/.duckhunt-runner/browser-vault/`, or `providers.browser.vaultDir`; `0700`). The entry is only saved if odysea saved a session. Without `--origin` it keeps the previous origins or, for a new key, uses the URL's origin. |
|
|
692
|
+
| `browser list` | Each session with its origins and health. |
|
|
693
|
+
| `browser check [key]` | Health, running each session's probe now (see below). Exits 1 if one is unusable. |
|
|
694
|
+
| `browser remove <key> [--purge]` | Removes the entry. `--purge` also deletes the saved session, unless another key uses it. |
|
|
695
|
+
|
|
696
|
+
**Origins** (`scheme://host[:port]`, `*.` for any subdomain, never a wildcard on fewer than two
|
|
697
|
+
labels) are the only part of the session a run gets: list the sign-in host too when the site logs you
|
|
698
|
+
in through another domain, or the session will look expired. **`--exclusive`** makes runs take turns on
|
|
699
|
+
the session and write back what they change (a site that rotates its token keeps working).
|
|
700
|
+
**`--probe-url`** is a page that tells whether you are still logged in (a redirect matching
|
|
701
|
+
`--login-pattern`, or a 401/403). The daemon checks each session every 10 minutes from the saved file
|
|
702
|
+
alone, and runs its probe at most once a day, since that opens a browser.
|
|
703
|
+
|
|
704
|
+
No platform sees a session until you expose it (`platforms expose <id> browser <key>`). duckhunt then
|
|
705
|
+
offers it in the composer, next to the model, where you choose what the run may do, and shows each
|
|
706
|
+
machine's sessions with their health under Settings → Agents → Machines. It only sends a run with a
|
|
707
|
+
session to a machine that has odysea and builds the tool lists itself (see
|
|
708
|
+
[Tool lists](#tool-lists-built-by-the-daemon-0130-or-later)).
|
|
709
|
+
|
|
710
|
+
| Access | Browser tools |
|
|
711
|
+
| --- | --- |
|
|
712
|
+
| `read` | `navigate`, `reload`, `back`, `tabs`, `resize`, `scroll`, `hover`, `wait_for`, `screenshot`, `dom_snapshot`, `dom_query`, `console_messages`, `network_requests` |
|
|
713
|
+
| `interact` | also `click`, `fill`, `press_key`, `select_option`, `handle_dialog` |
|
|
714
|
+
| `full` | also `evaluate` and `network_details` (request headers, cookies included) |
|
|
715
|
+
|
|
716
|
+
The `session` tool is never allowed. duckhunt gives a `read` conversation `read` (or `interact`, if you
|
|
717
|
+
turn that on in Settings → Agents, which asks you to confirm your identity) and never `full`.
|
|
718
|
+
|
|
719
|
+
**What a run gets.** Its own MCP server, `res_browser_<key>`, with a copy of the session filtered by
|
|
720
|
+
the daemon to the session's origins: cookies of those hosts (and parent-domain cookies they need),
|
|
721
|
+
their local storage and IndexedDB, no expired cookies. The copy lives in the run's private config
|
|
722
|
+
directory and is deleted when the step ends. An exclusive session writes back only what changed on
|
|
723
|
+
its origins, never anything the run collected from other sites, and never when the run was aborted
|
|
724
|
+
before it started. A session that is missing, unreadable, expired or logged out fails the run before
|
|
725
|
+
it launches, with the reason and no paths. A key this machine does not map, or a machine without
|
|
726
|
+
odysea, runs without a browser and says so in the feed. A run waiting for an exclusive session says
|
|
727
|
+
so too.
|
|
728
|
+
|
|
729
|
+
**Limits.**
|
|
730
|
+
|
|
731
|
+
- odysea's navigation allowlist covers the pages a run opens, not the requests a page makes, so
|
|
732
|
+
cookies from other sites can land in a run's copy. They are never written back.
|
|
733
|
+
- Every run's `Read` deny covers the vault, but `Read` denies do not bind `Bash`: an `edit` run's
|
|
734
|
+
shell can read every saved session. Only give a full shell to platforms you trust.
|
|
735
|
+
- A session's cookies are as good as your login while they last. Expose a session only to the
|
|
736
|
+
platforms you would hand that login to, and pick the lowest access that does the job.
|
|
737
|
+
|
|
738
|
+
## Local runs: `runner run` (0.13.0 or later)
|
|
739
|
+
|
|
740
|
+
`run` starts an agent on this machine with no server: you are the platform (`local`), and the answer
|
|
741
|
+
goes to stdout, so `$(duckhunt-runner run …)` captures it while the feed goes to stderr.
|
|
742
|
+
|
|
743
|
+
```sh
|
|
744
|
+
duckhunt-runner platforms expose local repo acme/api
|
|
745
|
+
duckhunt-runner run --repo acme/api "why does the nightly import fail?"
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
| Flag | Effect |
|
|
749
|
+
| --- | --- |
|
|
750
|
+
| `--repo <ws/slug> [--branch <branch>]` | Works in a worktree of that mapped repo. |
|
|
751
|
+
| `--profile read\|edit` | `read` (default): read-only shell, no edits, memory and web. `edit`: full shell and edits. |
|
|
752
|
+
| `--push` | Allows `git push`. |
|
|
753
|
+
| `--grant <type:key[:access]>` | Adds a resource, such as `--grant browser:jira:interact` or `--grant aws:123456789012`. `read` by default. |
|
|
754
|
+
| `--model <model>` | The model for the run. |
|
|
755
|
+
| `--yes` | Accepts the escalation without asking. |
|
|
756
|
+
| `--json` | NDJSON on stdout of the conversation's messages instead (claim, event, question, result). Never prompts. |
|
|
757
|
+
| `--wait <duration>` | Gives up if no slot frees within it (`30s`, `5m`, `1h`). Without it, waits. |
|
|
758
|
+
| `--resume <conversation> "<answer>"` | Answers a question and continues. Policy flags do not apply to a resume. |
|
|
759
|
+
|
|
760
|
+
It goes through the same checks as any platform: a key you did not expose to `local`, or a request
|
|
761
|
+
its ceiling would cut, is refused before launch and names the fix. Anything above `read` (full shell,
|
|
762
|
+
edits, push, an `interact` or `full` grant) is listed and asked on the terminal; without a terminal it
|
|
763
|
+
needs `--yes` **and** `"unattendedEscalation": true` under `platforms.local`, so a cron line cannot
|
|
764
|
+
quietly run an edit.
|
|
765
|
+
|
|
766
|
+
The agent answers with a `reply` tool and asks with `ask_user`, served by a small MCP server on
|
|
767
|
+
`127.0.0.1` for that run only. On a terminal you answer inline; otherwise `run` prints the question and
|
|
768
|
+
exits 3, and `--resume` continues the conversation.
|
|
769
|
+
|
|
770
|
+
| Exit | Meaning |
|
|
771
|
+
| --- | --- |
|
|
772
|
+
| 0 | done |
|
|
773
|
+
| 1 | failed |
|
|
774
|
+
| 2 | the agent replied with a blocker |
|
|
775
|
+
| 3 | waiting for your answer |
|
|
776
|
+
| 64 | usage error |
|
|
777
|
+
| 75 | no free slot within `--wait`, or the daemon lock is held by something `run` cannot talk to |
|
|
778
|
+
| 77 | refused by the ceiling, the exposure or consent |
|
|
779
|
+
| 130 / 143 | interrupted (`ctrl-c` cancels the run within one heartbeat; a second one exits at once) |
|
|
780
|
+
|
|
781
|
+
With the daemon running, `run` hands the run to it over `~/.duckhunt-runner/sockets/local.sock`
|
|
782
|
+
(`0600`), so local runs share its slots, its git locks and its audit. Without one, `run` holds the daemon
|
|
783
|
+
lock while it works and `start` refuses to start meanwhile. Conversations live in
|
|
784
|
+
`~/.duckhunt-runner/platforms/local/`, so one can be resumed from either.
|
|
785
|
+
|
|
423
786
|
## Licence
|
|
424
787
|
|
|
425
788
|
Copyright © 2026 miermontoto.
|
|
@@ -4,6 +4,8 @@ export interface MachineKit {
|
|
|
4
4
|
hasAws: boolean;
|
|
5
5
|
supported: ReadonlySet<OptionalFlag>;
|
|
6
6
|
remoteRepoEdits?: boolean;
|
|
7
|
+
toolsetRender?: boolean;
|
|
8
|
+
browser?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** capacidades del claim: prompt (y lo que va con él) solo si el cli puede cumplir su perfil, model solo con --model. */
|
|
9
11
|
export declare function announcedCapabilities(kit: MachineKit): RunnerCapability[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announced-capabilities.d.ts","sourceRoot":"","sources":["../src/announced-capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,UAAU;IAEzB,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAErC,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"announced-capabilities.d.ts","sourceRoot":"","sources":["../src/announced-capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,UAAU;IAEzB,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAErC,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yHAAyH;AACzH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,EAAE,CAyBzE"}
|
|
@@ -22,6 +22,12 @@ export function announcedCapabilities(kit) {
|
|
|
22
22
|
RUNNER_CAPABILITY.logout,
|
|
23
23
|
// al final: el orden de las anteriores no cambia para el server.
|
|
24
24
|
...(kit.supported.has('--model') ? [RUNNER_CAPABILITY.model] : []),
|
|
25
|
+
// toolset_v1 en sombra (t#495, M5): solo lo renderiza y compara (toolset/shadow.ts); las listas siguen mandando.
|
|
26
|
+
RUNNER_CAPABILITY.toolsetV1,
|
|
27
|
+
// el flip (t#495, M5): lanza los runs de duckhunt con su render (toolset/legacy-render.ts). salvo el interruptor.
|
|
28
|
+
...(kit.toolsetRender === false ? [] : [RUNNER_CAPABILITY.toolsetRender]),
|
|
29
|
+
// sesiones de navegador (t#495, M7): con odysea y con el flip (las tools del navegador solo las pinta el render).
|
|
30
|
+
...(kit.browser && kit.toolsetRender !== false ? [RUNNER_CAPABILITY.browser] : []),
|
|
25
31
|
];
|
|
26
32
|
}
|
|
27
33
|
//# sourceMappingURL=announced-capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announced-capabilities.js","sourceRoot":"","sources":["../src/announced-capabilities.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,gGAAgG;AAEhG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"announced-capabilities.js","sourceRoot":"","sources":["../src/announced-capabilities.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,gGAAgG;AAEhG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,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aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AuditRecord } from './audit.js';
|
|
2
|
+
/** desde cuándo: `<n>d` hacia atrás desde `now` o una fecha (local). null si no se entiende. */
|
|
3
|
+
export declare function parseSince(raw: string, now: number): number | null;
|
|
4
|
+
/** la tabla de unos registros, con su cabecera y columnas alineadas. */
|
|
5
|
+
export declare function auditTable(records: readonly AuditRecord[]): string[];
|
|
6
|
+
export declare function auditCommand(args: string[], now?: number): void;
|
|
7
|
+
//# sourceMappingURL=audit-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-cli.d.ts","sourceRoot":"","sources":["../src/audit-cli.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAoB9E,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKlE;AA0BD,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAIpE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,SAAa,GAAG,IAAI,CA0BnE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// `duckhunt-runner audit [--platform <id>] [--since 7d|<fecha>] [--json]` (t#495, M6.6): la auditoría local de lo
|
|
2
|
+
// que esta máquina corrió para cada plataforma (audit.ts), en una tabla o en jsonl. solo lee: ni el daemon ni el
|
|
3
|
+
// server se enteran.
|
|
4
|
+
import { AUDIT_EVENT, DAY_MS, readAudit } from './audit.js';
|
|
5
|
+
import { PLATFORM_ID_RE } from './paths.js';
|
|
6
|
+
const FLAG = { platform: '--platform', since: '--since', json: '--json' };
|
|
7
|
+
// flags que llevan un valor detrás.
|
|
8
|
+
const VALUED = new Set([FLAG.platform, FLAG.since]);
|
|
9
|
+
const DEFAULT_SINCE_DAYS = 7;
|
|
10
|
+
const USAGE = `uso:
|
|
11
|
+
duckhunt-runner audit [--platform <id>] [--since 7d|<fecha>] [--json]
|
|
12
|
+
(por defecto los últimos ${DEFAULT_SINCE_DAYS} días de todas las plataformas; --since acepta <n>d o una fecha como 2026-10-01)
|
|
13
|
+
`;
|
|
14
|
+
const DAYS_RE = /^(\d+)d$/;
|
|
15
|
+
// herramientas que se enseñan por cierre en la tabla.
|
|
16
|
+
const TOP_TOOLS = 3;
|
|
17
|
+
const COLUMN_GAP = ' ';
|
|
18
|
+
const NONE = '—';
|
|
19
|
+
const USD_DECIMALS = 2;
|
|
20
|
+
const DATE_PART_PAD = 2;
|
|
21
|
+
/** desde cuándo: `<n>d` hacia atrás desde `now` o una fecha (local). null si no se entiende. */
|
|
22
|
+
export function parseSince(raw, now) {
|
|
23
|
+
const days = DAYS_RE.exec(raw);
|
|
24
|
+
if (days)
|
|
25
|
+
return now - Number(days[1]) * DAY_MS;
|
|
26
|
+
const at = new Date(raw.includes('T') ? raw : `${raw}T00:00:00`).getTime();
|
|
27
|
+
return Number.isNaN(at) ? null : at;
|
|
28
|
+
}
|
|
29
|
+
const pad = (n) => String(n).padStart(DATE_PART_PAD, '0');
|
|
30
|
+
const when = (at) => {
|
|
31
|
+
const d = new Date(at);
|
|
32
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
33
|
+
};
|
|
34
|
+
const seconds = (ms) => `${Math.round(ms / 1000)}s`;
|
|
35
|
+
// una fila de la tabla por registro: hora, plataforma, run, qué pasó, duración, grants, recortes, tools y coste.
|
|
36
|
+
function row(r) {
|
|
37
|
+
const head = [when(r.at), r.platform, r.runId ?? NONE];
|
|
38
|
+
if (r.event === AUDIT_EVENT.rejected)
|
|
39
|
+
return [...head, `rechazado (${r.code})`, NONE, NONE, NONE, NONE, NONE];
|
|
40
|
+
if (r.event === AUDIT_EVENT.claimed) {
|
|
41
|
+
const grants = r.grants.map((g) => `${g.type}:${g.key ?? NONE}(${g.access})`).join(',') || NONE;
|
|
42
|
+
return [...head, `reclamado${r.model ? ` · ${r.model}` : ''}`, NONE, grants, r.toolset?.narrowed.join(',') || NONE, NONE, NONE];
|
|
43
|
+
}
|
|
44
|
+
const tools = Object.entries(r.toolCalls.byTool)
|
|
45
|
+
.slice(0, TOP_TOOLS)
|
|
46
|
+
.map(([tool, n]) => `${tool}×${n}`)
|
|
47
|
+
.join(',') || NONE;
|
|
48
|
+
const outcome = `${r.outcome.status}${r.outcome.code ? ` (${r.outcome.code})` : ''}`;
|
|
49
|
+
return [...head, outcome, seconds(r.durationMs), NONE, NONE, tools, r.costUsd === null ? NONE : r.costUsd.toFixed(USD_DECIMALS)];
|
|
50
|
+
}
|
|
51
|
+
/** la tabla de unos registros, con su cabecera y columnas alineadas. */
|
|
52
|
+
export function auditTable(records) {
|
|
53
|
+
const rows = [['hora', 'plataforma', 'run', 'qué', 'duración', 'grants', 'recortado', 'tools', 'usd'], ...records.map(row)];
|
|
54
|
+
const widths = rows[0].map((_, i) => Math.max(...rows.map((r) => r[i].length)));
|
|
55
|
+
return rows.map((r) => r.map((cell, i) => cell.padEnd(widths[i])).join(COLUMN_GAP).trimEnd());
|
|
56
|
+
}
|
|
57
|
+
export function auditCommand(args, now = Date.now()) {
|
|
58
|
+
const value = (flag) => {
|
|
59
|
+
const i = args.indexOf(flag);
|
|
60
|
+
return i >= 0 ? args[i + 1] : undefined;
|
|
61
|
+
};
|
|
62
|
+
const known = new Set(Object.values(FLAG));
|
|
63
|
+
const platform = value(FLAG.platform);
|
|
64
|
+
const sinceRaw = value(FLAG.since);
|
|
65
|
+
const since = sinceRaw === undefined ? now - DEFAULT_SINCE_DAYS * DAY_MS : parseSince(sinceRaw, now);
|
|
66
|
+
// un flag que no existe, o un valor suelto que no va detrás de un flag que lo lleve.
|
|
67
|
+
const stray = args.filter((a, i) => (a.startsWith('--') ? !known.has(a) : !VALUED.has(args[i - 1] ?? '')));
|
|
68
|
+
if (stray.length > 0 || since === null || (args.includes(FLAG.platform) && (platform === undefined || !PLATFORM_ID_RE.test(platform)))) {
|
|
69
|
+
console.error(USAGE);
|
|
70
|
+
process.exitCode = 1;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const records = readAudit(since, platform);
|
|
74
|
+
if (args.includes(FLAG.json)) {
|
|
75
|
+
records.forEach((r) => console.log(JSON.stringify(r)));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (records.length === 0) {
|
|
79
|
+
console.log('auditoría: nada en ese intervalo');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
auditTable(records).forEach((line) => console.log(line));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=audit-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-cli.js","sourceRoot":"","sources":["../src/audit-cli.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,iHAAiH;AACjH,qBAAqB;AAErB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAoB,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAW,CAAC;AACnF,oCAAoC;AACpC,MAAM,MAAM,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,KAAK,GAAG;;6BAEe,kBAAkB;CAC9C,CAAC;A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