duckhunt-runner 0.10.2 → 0.12.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 +141 -38
- package/dist/announced-capabilities.d.ts +10 -0
- package/dist/announced-capabilities.d.ts.map +1 -0
- package/dist/announced-capabilities.js +27 -0
- package/dist/announced-capabilities.js.map +1 -0
- package/dist/aws-env.d.ts +21 -0
- package/dist/aws-env.d.ts.map +1 -0
- package/dist/aws-env.js +80 -0
- package/dist/aws-env.js.map +1 -0
- package/dist/aws.d.ts.map +1 -1
- package/dist/aws.js +3 -2
- package/dist/aws.js.map +1 -1
- package/dist/claim.d.ts +14 -0
- package/dist/claim.d.ts.map +1 -1
- package/dist/claim.js +40 -3
- package/dist/claim.js.map +1 -1
- package/dist/claude-args.d.ts +3 -1
- package/dist/claude-args.d.ts.map +1 -1
- package/dist/claude-args.js +19 -4
- package/dist/claude-args.js.map +1 -1
- package/dist/claude.d.ts +7 -1
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +33 -7
- package/dist/claude.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -1
- package/dist/conversation-gc.d.ts +9 -2
- package/dist/conversation-gc.d.ts.map +1 -1
- package/dist/conversation-gc.js +13 -6
- package/dist/conversation-gc.js.map +1 -1
- package/dist/daemon.d.ts +8 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +173 -49
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/logout.d.ts +16 -0
- package/dist/logout.d.ts.map +1 -0
- package/dist/logout.js +78 -0
- package/dist/logout.js.map +1 -0
- package/dist/machine.d.ts +18 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/machine.js +52 -0
- package/dist/machine.js.map +1 -0
- package/dist/oauth.d.ts +4 -0
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +49 -4
- package/dist/oauth.js.map +1 -1
- package/dist/repos.d.ts.map +1 -1
- package/dist/repos.js +9 -3
- package/dist/repos.js.map +1 -1
- package/dist/run-mcp-config.d.ts +7 -0
- package/dist/run-mcp-config.d.ts.map +1 -1
- package/dist/run-mcp-config.js +34 -0
- package/dist/run-mcp-config.js.map +1 -1
- package/dist/secret-paths.d.ts +8 -0
- package/dist/secret-paths.d.ts.map +1 -0
- package/dist/secret-paths.js +77 -0
- package/dist/secret-paths.js.map +1 -0
- package/dist/server-state.d.ts +40 -0
- package/dist/server-state.d.ts.map +1 -0
- package/dist/server-state.js +76 -0
- package/dist/server-state.js.map +1 -0
- package/dist/status.d.ts +3 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +58 -8
- package/dist/status.js.map +1 -1
- package/dist/worktree.d.ts +9 -0
- package/dist/worktree.d.ts.map +1 -1
- package/dist/worktree.js +14 -6
- package/dist/worktree.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,12 +28,14 @@ disk. With the progress feed on, it also receives what the agent says and one li
|
|
|
28
28
|
## Setup
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
|
-
npx duckhunt-runner login
|
|
32
|
-
npx duckhunt-runner repos discover ~/dev
|
|
33
|
-
npx duckhunt-runner start
|
|
31
|
+
npx duckhunt-runner@0.12.0 login
|
|
32
|
+
npx duckhunt-runner@0.12.0 repos discover ~/dev
|
|
33
|
+
npx duckhunt-runner@0.12.0 start
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Pin the version: the daemon runs `claude -p` with a shell on your machine, so install the release you
|
|
37
|
+
mean to run (Settings → Agents → Machines shows the commands pinned to the version duckhunt
|
|
38
|
+
recommends). That is the whole thing. Step by step:
|
|
37
39
|
|
|
38
40
|
| Command | What it does |
|
|
39
41
|
| --- | --- |
|
|
@@ -42,14 +44,16 @@ That is the whole thing. Step by step:
|
|
|
42
44
|
| `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). |
|
|
43
45
|
| `aws add <accountId> <profile>` | 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. |
|
|
44
46
|
| `aws list\|remove` | Manage the AWS map. |
|
|
45
|
-
| `status` | Reports whether a daemon is running
|
|
47
|
+
| `status` | 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. |
|
|
48
|
+
| `logout` | Unpairs this machine from duckhunt and deletes its credential from the config file (0.11.0 or later; see [Machines](#machines-and-credentials)). |
|
|
46
49
|
| `start [--verbose]` | Starts the claim loop. |
|
|
47
50
|
|
|
48
|
-
Configuration lives in `~/.duckhunt-runner.json`. It holds the base URL, the OAuth credential,
|
|
49
|
-
repo and AWS maps, and optional defaults (`model`, `maxBudgetUsd`, `maxConcurrent`). Set `DUCKHUNT_RUNNER_CONFIG` to use
|
|
51
|
+
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
|
|
50
53
|
another file (a second account, a test instance) and `DUCKHUNT_RUNNER_HOME` to move the state
|
|
51
|
-
directory (`~/.duckhunt-runner`: the scratch directory, `--verbose` logs, the daemon lock
|
|
52
|
-
per-run MCP configs
|
|
54
|
+
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). `--version`
|
|
56
|
+
prints the daemon version.
|
|
53
57
|
|
|
54
58
|
The daemon does not need a restart after `login`, `repos`, `aws` or a hand edit of the file: it
|
|
55
59
|
rereads the config every few seconds, even while all its slots are busy. Each command, and the
|
|
@@ -60,8 +64,9 @@ daemon keeps the config it has and says so.
|
|
|
60
64
|
### Repo health
|
|
61
65
|
|
|
62
66
|
The daemon checks every mapped checkout when it starts and every 10 minutes, prints what changed,
|
|
63
|
-
and reports it to duckhunt, which shows it on the
|
|
64
|
-
you when a repo stops being usable. Only the repo key and a code travel,
|
|
67
|
+
and reports it to duckhunt, which shows it on the machine's row (Settings → Agents → Machines) and in
|
|
68
|
+
the repo picker and notifies you when a repo stops being usable. Only the repo key and a code travel,
|
|
69
|
+
never a path.
|
|
65
70
|
|
|
66
71
|
| Code | Meaning | Blocks runs |
|
|
67
72
|
| --- | --- | --- |
|
|
@@ -78,7 +83,7 @@ Duplicates are looked for among the siblings of each mapped checkout, one level
|
|
|
78
83
|
|
|
79
84
|
#### Fixing the map from duckhunt
|
|
80
85
|
|
|
81
|
-
The mapped-repos list on the
|
|
86
|
+
The mapped-repos list on the machine's row can remove a repo from this machine's map, or point it at
|
|
82
87
|
another folder when the daemon found more than one checkout of it (or found it somewhere else after
|
|
83
88
|
its folder disappeared). To make that choice possible, the daemon sends the **folder name** of each
|
|
84
89
|
candidate (with its parent only when two share a name), its branch, the age of its last commit and
|
|
@@ -91,7 +96,7 @@ daemon writes only that entry of its map to the config file, checks again and re
|
|
|
91
96
|
a few seconds.
|
|
92
97
|
|
|
93
98
|
To keep the map CLI-only on a machine, set `"remoteRepoEdits": false` under `defaults` in
|
|
94
|
-
`~/.duckhunt-runner.json`: the
|
|
99
|
+
`~/.duckhunt-runner.json`: the row then hides the controls.
|
|
95
100
|
|
|
96
101
|
### Keeping it running
|
|
97
102
|
|
|
@@ -104,8 +109,10 @@ already does for this — a `screen`/`tmux` session, a systemd user service, `la
|
|
|
104
109
|
Description=duckhunt runner
|
|
105
110
|
|
|
106
111
|
[Service]
|
|
107
|
-
ExecStart=/usr/bin/npx duckhunt-runner start
|
|
112
|
+
ExecStart=/usr/bin/npx duckhunt-runner@0.12.0 start
|
|
108
113
|
Restart=always
|
|
114
|
+
# 78: this machine was unpaired (or its credential expired); it needs a new `login`, not a restart.
|
|
115
|
+
RestartPreventExitStatus=78
|
|
109
116
|
|
|
110
117
|
[Install]
|
|
111
118
|
WantedBy=default.target
|
|
@@ -119,6 +126,39 @@ run while the daemon that holds it is alive; a lock left by a daemon that died,
|
|
|
119
126
|
reboot, is replaced. To run a
|
|
120
127
|
second account on the same machine, give it its own `DUCKHUNT_RUNNER_CONFIG` and `DUCKHUNT_RUNNER_HOME`.
|
|
121
128
|
|
|
129
|
+
### Machines and credentials
|
|
130
|
+
|
|
131
|
+
Each `login` registers a new credential, and duckhunt lists every machine you have paired under
|
|
132
|
+
Settings → Agents → Machines, where you can rename it, pause it, choose what it accepts
|
|
133
|
+
(conversations, unattended investigations or both), cap its slots and unpair it.
|
|
134
|
+
|
|
135
|
+
From 0.11.0 the daemon gives this machine a stable id (a random UUID, stored in the config file
|
|
136
|
+
together with the hostname it was created on) and announces it with every claim. Until the first
|
|
137
|
+
claim with a new credential, it also announces the client id that `login` replaced. When duckhunt
|
|
138
|
+
sees a known id from the same account, it **adopts** the existing machine: the new credential takes
|
|
139
|
+
over the machine's name, settings and conversations, the old credential is revoked, and no ghost
|
|
140
|
+
machine is left behind. Runs already in progress keep their MCP access: their per-run tokens are
|
|
141
|
+
only revoked when each step ends. Adoption never crosses accounts. A config file copied to another
|
|
142
|
+
host does not claim to be the original machine: `login` there creates a new id instead.
|
|
143
|
+
|
|
144
|
+
`duckhunt-runner logout` unpairs the machine from the machine itself: duckhunt revokes its
|
|
145
|
+
credential, deletes the machine and cancels the runs it had in progress (exactly what the × on its
|
|
146
|
+
row does), and the daemon deletes `clientId` and `refreshToken` from the config file. The maps,
|
|
147
|
+
defaults and machine id stay, so a later `login` pairs it again. Against a duckhunt that does not
|
|
148
|
+
know `logout` yet (404), or with a credential that was already dead, it only deletes the local one and
|
|
149
|
+
says so; a network or server error deletes nothing, so you can retry. A running daemon stops on its
|
|
150
|
+
next call.
|
|
151
|
+
|
|
152
|
+
When the credential is rejected (the machine was unpaired from duckhunt or with `logout`, or the
|
|
153
|
+
credential was revoked or expired), the daemon stops claiming, stops its runs and exits with code
|
|
154
|
+
**78** instead of retrying every few seconds. Run `login` again to pair it.
|
|
155
|
+
|
|
156
|
+
`status` prints what duckhunt said about this machine in the daemon's last claim, and how long ago:
|
|
157
|
+
its name in duckhunt, whether it is paused, what it accepts, its slot cap, why it is not getting work
|
|
158
|
+
(paused, no free slot, needs an update) and the worktrees kept with unsaved work. It never talks to
|
|
159
|
+
the server itself: refreshing the credential from a second process would rotate the running daemon's
|
|
160
|
+
token, which duckhunt treats as a replay.
|
|
161
|
+
|
|
122
162
|
### Parallel runs
|
|
123
163
|
|
|
124
164
|
By default the daemon works one run at a time. Set `defaults.maxConcurrent` in the config (1 to 8)
|
|
@@ -141,12 +181,14 @@ on the same state directory; raise one daemon's slots instead.
|
|
|
141
181
|
## How a run works
|
|
142
182
|
|
|
143
183
|
1. **A run is queued** from duckhunt: the *investigate with agent* action on an entry, the same
|
|
144
|
-
button on an alert notification, or an automation rule with that action
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
184
|
+
button on an alert notification, or an automation rule with that action (or one that runs a
|
|
185
|
+
prompt of yours, see below).
|
|
186
|
+
2. **The daemon claims it** and gets a prompt, a tool profile, the model to use and a short-lived MCP
|
|
187
|
+
token scoped to that single run. It launches `claude -p` in a worktree of the mapped checkout (or a
|
|
188
|
+
scratch directory when the alarm has no repo). An investigation is a `read` conversation like any
|
|
189
|
+
other (see [Prompt runs](#prompt-runs)), with an even smaller kit: no web, and no shell when the
|
|
190
|
+
rule may comment on the ticket. Whether it can extend Claude's native memory is your choice (see
|
|
191
|
+
[Native memory](#native-memory-080-or-later)).
|
|
150
192
|
3. **The agent investigates** and answers in the run's conversation, on the *Agents* page. You get a
|
|
151
193
|
push with a one-line summary on top and can reply to it straight from the notification.
|
|
152
194
|
4. **If it needs a decision from you**, it asks and ends its turn. Your answer resumes it in the
|
|
@@ -163,9 +205,26 @@ run's token:
|
|
|
163
205
|
| Born from an instruction of yours | Also write inside duckhunt (create tasks, snooze the inbox, label). |
|
|
164
206
|
| Born from a yes/no you confirmed | Also act outside duckhunt through its tools (comment on or move the ticket). |
|
|
165
207
|
|
|
166
|
-
So an unattended
|
|
167
|
-
said yes to that specific action, spelled out with the literal command. Changing AWS resources
|
|
168
|
-
code is never part of that: the run proposes an `edit` conversation, which you review and launch.
|
|
208
|
+
So an unattended investigation can never change anything, and anything that leaves duckhunt needs you
|
|
209
|
+
to have said yes to that specific action, spelled out with the literal command. Changing AWS resources
|
|
210
|
+
or code is never part of that: the run proposes an `edit` conversation, which you review and launch.
|
|
211
|
+
|
|
212
|
+
A rule can also *run a prompt* you wrote (on a schedule, when an entry is created, updated or
|
|
213
|
+
notified, or when you move a task; a move by someone you share the workspace with never starts it). That run starts with your instruction, so it may also write inside
|
|
214
|
+
duckhunt (create, move and organise tasks, label, take notes) and read the repo you chose. With the
|
|
215
|
+
`edit` profile, which you arm once with the identity check when you save the rule, it may also change
|
|
216
|
+
code in its own worktree, never in your checkout; below the confirmed tier its deny list also blocks
|
|
217
|
+
`git push`, `git remote` and `gh` (a best-effort guard, not a sandbox). Anything that leaves duckhunt
|
|
218
|
+
(a Jira comment or transition, an email, a pull request) still needs your yes in that run.
|
|
219
|
+
|
|
220
|
+
#### AWS accounts (0.11.0 or later)
|
|
221
|
+
|
|
222
|
+
A run carries the AWS account of its entry. The daemon maps it to the profile you bound with
|
|
223
|
+
`aws add`. An account this machine does not map no longer falls back to your default profile, which
|
|
224
|
+
may belong to another account: the AWS CLI runs with empty config and credentials files of its own
|
|
225
|
+
(and no profile, no keys from the environment and no instance or container credentials), so every
|
|
226
|
+
call fails, and the run's feed says which account to map. duckhunt already omits the AWS read
|
|
227
|
+
patterns for an investigation whose account this machine does not announce; this is the second line.
|
|
169
228
|
|
|
170
229
|
## Prompt runs
|
|
171
230
|
|
|
@@ -176,6 +235,21 @@ Requires daemon 0.4.0+ and a Claude CLI that supports `--permission-mode`, `--st
|
|
|
176
235
|
`--disallowedTools` and `--setting-sources`; otherwise the daemon does not offer prompt runs and is
|
|
177
236
|
never handed one.
|
|
178
237
|
|
|
238
|
+
### Model (0.12.0 or later)
|
|
239
|
+
|
|
240
|
+
The model is the one duckhunt asks for: your default in Settings → Agents, the one you pick in the
|
|
241
|
+
composer or later in the thread, or the one set on a rule action. When duckhunt asks for none, the
|
|
242
|
+
daemon uses `defaults.model` from the config file, and without that the Claude CLI default. A model you
|
|
243
|
+
change in the thread applies from the next step on, resumed sessions included. The daemon only passes a
|
|
244
|
+
model alias or id (`opus`, `sonnet`, `claude-opus-5-5`…) and ignores anything else with a note in the
|
|
245
|
+
feed; the run then uses this machine's model.
|
|
246
|
+
|
|
247
|
+
It announces the `model` capability only when `claude --help` lists `--model`, and duckhunt only sends
|
|
248
|
+
a model to daemons that announce it, so an older daemon keeps using `defaults.model`. The model each
|
|
249
|
+
run reports back is the one its main loop used (the CLI's init event), not the small auxiliary model
|
|
250
|
+
the CLI also calls for titles and summaries. `status` prints the capabilities this machine announces
|
|
251
|
+
(`capacidades`, `model` among them) and `start` logs them when it starts.
|
|
252
|
+
|
|
179
253
|
### Profiles
|
|
180
254
|
|
|
181
255
|
Each conversation has a profile, chosen when it starts. The Claude CLI enforces it (tool allowlist,
|
|
@@ -224,6 +298,23 @@ pattern other than a read-only AWS CLI one:
|
|
|
224
298
|
|
|
225
299
|
Older daemons keep the previous `read` profile: no shell.
|
|
226
300
|
|
|
301
|
+
#### Credential paths (0.11.0 or later)
|
|
302
|
+
|
|
303
|
+
duckhunt denies `Read` on a fixed list of home-relative credential paths in every `read` kit
|
|
304
|
+
(`~/.aws/**`, `~/.ssh/**`, `~/.duckhunt-runner.json`, `~/.claude/.credentials.json` and a few more),
|
|
305
|
+
because the server never learns your paths. The daemon adds the ones only this machine knows, without
|
|
306
|
+
sending them anywhere: its real config file (also when `DUCKHUNT_RUNNER_CONFIG` moves it), its state
|
|
307
|
+
directory (the logs, the lock, `server-state.json` and the run configs; not the scratch directory,
|
|
308
|
+
which is the working directory of runs without a repo), `$CLAUDE_CONFIG_DIR/.credentials.json`,
|
|
309
|
+
`AWS_SHARED_CREDENTIALS_FILE` and `AWS_CONFIG_FILE` when they are set, and the real path behind any
|
|
310
|
+
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.
|
|
312
|
+
|
|
313
|
+
Checked with Claude Code 2.1.296: `Read`, `Grep` and `Glob` honour these deny rules, through symlinks
|
|
314
|
+
and in recursive searches. The read-only shell approves nothing outside its working directory, and
|
|
315
|
+
inside it honours a denied path named directly but not a recursive read, which is why a committed
|
|
316
|
+
symlink that leaves the working directory takes the shell away for that step (see above).
|
|
317
|
+
|
|
227
318
|
#### Native memory (0.8.0 or later)
|
|
228
319
|
|
|
229
320
|
The daemon announces `native_memory` and the server stops denying `Edit` and `Write` outright for
|
|
@@ -237,9 +328,14 @@ allows them.
|
|
|
237
328
|
(automation runs included); user, project and local settings for the legacy automation runs of an
|
|
238
329
|
older duckhunt. If a settings file can't be read, those tools are denied outright (and the run
|
|
239
330
|
gets no memory).
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
331
|
+
- duckhunt can now let investigations and rule runs extend Claude Code's native memory too: a setting
|
|
332
|
+
of yours in Settings → Agents, on by default (nothing changes in the daemon; the server just stops
|
|
333
|
+
denying `Edit` and `Write` for them). Repo runs write the repo's memory, the one your interactive
|
|
334
|
+
sessions in that repo load. Repo-less runs share the scratch directory's memory with your repo-less
|
|
335
|
+
conversations. Those runs process content nobody reviewed (an alert, a ticket), and whatever they
|
|
336
|
+
write loads into your later sessions: turn the setting off if you do not want unattended content in
|
|
337
|
+
your memory. The daemon still mirrors your rules and, for the legacy automation runs of an older
|
|
338
|
+
duckhunt under `--dangerously-skip-permissions`, denies both again.
|
|
243
339
|
- `edit` conversations always could write their memory: the agent is now told it may, outside its
|
|
244
340
|
worktree too.
|
|
245
341
|
|
|
@@ -252,16 +348,20 @@ conversation (with the identity check) linked to the one that proposed it. This
|
|
|
252
348
|
change.
|
|
253
349
|
|
|
254
350
|
Every prompt run uses `--strict-mcp-config`, so a `.mcp.json` in the checkout never loads.
|
|
255
|
-
Settings → Agents can force `read` for everything (read-only mode)
|
|
256
|
-
|
|
351
|
+
Settings → Agents can force `read` for everything (read-only mode), and Settings → Agents → Repos
|
|
352
|
+
per repo. Settings → Agents → Machines pauses all your agents or one machine, and chooses what each
|
|
353
|
+
machine accepts. Read-only mode applies to existing `edit` conversations from
|
|
257
354
|
their next step on. A per-repo `read` lock covers conversations on that repo; it is not a sandbox,
|
|
258
|
-
since an `edit` conversation on another repo (or none) still has a shell.
|
|
259
|
-
by the wall-clock limit chosen in Settings → Agents
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
worktree
|
|
264
|
-
duckhunt
|
|
355
|
+
since an `edit` conversation on another repo (or none) still has a shell. Conversations you start
|
|
356
|
+
have no turn or budget limit: each step is capped by the wall-clock limit chosen in Settings → Agents
|
|
357
|
+
(1 to 8 hours, 4 by default), and the model is the one duckhunt asks for (see
|
|
358
|
+
[Model](#model-0120-or-later)). Automation runs keep 30 minutes per step and, from 0.11.0, their
|
|
359
|
+
budget again when you pay with an API key (`ANTHROPIC_API_KEY`) or set `defaults.maxBudgetUsd`.
|
|
360
|
+
`worktree: false` and `--dangerously-skip-permissions` in the repo map are deprecated (0.11.0) and go
|
|
361
|
+
away in a later release: nothing a current duckhunt sends applies them, because every conversation,
|
|
362
|
+
automation runs included, is a prompt run with its own worktree (or the checkout, when you choose it).
|
|
363
|
+
They only affect the legacy automation runs an older duckhunt server queued; `repos add`, `repos list`
|
|
364
|
+
and `status` say they are ignored.
|
|
265
365
|
|
|
266
366
|
Each step's MCP config, which holds the run's token, is written to `~/.duckhunt-runner/run-config/`
|
|
267
367
|
(a `0700` directory, files `0600`) and deleted when the step ends; the daemon removes any left
|
|
@@ -269,7 +369,8 @@ behind by a daemon that died when it starts. Every run, `read` or `edit`, has `R
|
|
|
269
369
|
directory (Claude still loads its own `--mcp-config` from it), and no run's working directory is
|
|
270
370
|
inside it, so a `read` run can't read the token of a run in another slot. An `edit` run's shell
|
|
271
371
|
still could: it runs only after you confirm your identity. Daemons before 0.10.2 used the system
|
|
272
|
-
temp directory.
|
|
372
|
+
temp directory; from 0.11.0 the daemon removes, once when it starts, the ones they left there
|
|
373
|
+
(`duckhunt-runner-<run>-<hex>.json`, your own regular files only).
|
|
273
374
|
|
|
274
375
|
### One worktree per conversation
|
|
275
376
|
|
|
@@ -288,8 +389,10 @@ its whole process group; a late report from that step never closes the step that
|
|
|
288
389
|
At most every 30 minutes the daemon removes the worktrees of conversations that duckhunt reports as
|
|
289
390
|
closed, and any worktree unused for 7 days, skipping those of runs it is working on. It never removes one with
|
|
290
391
|
uncommitted changes or with commits that no branch or remote contains: those are kept and logged, and
|
|
291
|
-
you can remove them with `git worktree remove` when you are done.
|
|
292
|
-
|
|
392
|
+
you can remove them with `git worktree remove` when you are done. From 0.11.0 the daemon also tells
|
|
393
|
+
duckhunt how many changed files and unpushed commits each kept conversation worktree holds (counts
|
|
394
|
+
only, never paths), and the conversation shows it with a button that asks the agent to commit them.
|
|
395
|
+
Worktrees kept from failed automation runs (`run-<id>`) expire after the same 7 days.
|
|
293
396
|
|
|
294
397
|
### Working in the checkout instead
|
|
295
398
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RunnerCapability } from './claim.js';
|
|
2
|
+
import type { OptionalFlag } from './claude.js';
|
|
3
|
+
export interface MachineKit {
|
|
4
|
+
hasAws: boolean;
|
|
5
|
+
supported: ReadonlySet<OptionalFlag>;
|
|
6
|
+
remoteRepoEdits?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** capacidades del claim: prompt (y lo que va con él) solo si el cli puede cumplir su perfil, model solo con --model. */
|
|
9
|
+
export declare function announcedCapabilities(kit: MachineKit): RunnerCapability[];
|
|
10
|
+
//# sourceMappingURL=announced-capabilities.d.ts.map
|
|
@@ -0,0 +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;CAC3B;AAED,yHAAyH;AACzH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,EAAE,CAmBzE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// capacidades que el daemon anuncia en cada claim, según el kit de esta máquina (cli de claude, aws
|
|
2
|
+
// cli, config). pura para poder probarla: el daemon le pasa lo que detectó al arrancar y su config
|
|
3
|
+
// recargada. el server decide con ellas qué entrega y cómo (ver RUNNER_CAPABILITY en claim.ts).
|
|
4
|
+
import { RUNNER_CAPABILITY } from './claim.js';
|
|
5
|
+
import { PROMPT_REQUIRED_FLAGS } from './claude-args.js';
|
|
6
|
+
/** capacidades del claim: prompt (y lo que va con él) solo si el cli puede cumplir su perfil, model solo con --model. */
|
|
7
|
+
export function announcedCapabilities(kit) {
|
|
8
|
+
return [
|
|
9
|
+
...(kit.hasAws ? [RUNNER_CAPABILITY.aws] : []),
|
|
10
|
+
// read_shell y native_memory van con prompt: exigen poder cumplir el perfil read (parseClaim lo
|
|
11
|
+
// valida) y pasar el deny espejado (--disallowedTools).
|
|
12
|
+
...(PROMPT_REQUIRED_FLAGS.every((f) => kit.supported.has(f))
|
|
13
|
+
? [RUNNER_CAPABILITY.prompt, RUNNER_CAPABILITY.readShell, RUNNER_CAPABILITY.nativeMemory]
|
|
14
|
+
: []),
|
|
15
|
+
RUNNER_CAPABILITY.events,
|
|
16
|
+
RUNNER_CAPABILITY.checkout,
|
|
17
|
+
...(kit.remoteRepoEdits === false ? [] : [RUNNER_CAPABILITY.repoEdit]),
|
|
18
|
+
RUNNER_CAPABILITY.secretPaths,
|
|
19
|
+
RUNNER_CAPABILITY.seedBudget,
|
|
20
|
+
RUNNER_CAPABILITY.awsStrict,
|
|
21
|
+
RUNNER_CAPABILITY.worktreeReport,
|
|
22
|
+
RUNNER_CAPABILITY.logout,
|
|
23
|
+
// al final: el orden de las anteriores no cambia para el server.
|
|
24
|
+
...(kit.supported.has('--model') ? [RUNNER_CAPABILITY.model] : []),
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=announced-capabilities.js.map
|
|
@@ -0,0 +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;AAYzD,yHAAyH;AACzH,MAAM,UAAU,qBAAqB,CAAC,GAAe;IACnD,OAAO;QACL,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,gGAAgG;QAChG,wDAAwD;QACxD,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,CAAC,YAAY,CAAC;YACzF,CAAC,CAAC,EAAE,CAAC;QACP,iBAAiB,CAAC,MAAM;QACxB,iBAAiB,CAAC,QAAQ;QAC1B,GAAG,CAAC,GAAG,CAAC,eAAe,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QACtE,iBAAiB,CAAC,WAAW;QAC7B,iBAAiB,CAAC,UAAU;QAC5B,iBAAiB,CAAC,SAAS;QAC3B,iBAAiB,CAAC,cAAc;QAChC,iBAAiB,CAAC,MAAM;QACxB,iEAAiE;QACjE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACnE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type AwsAccountConfig } from './config.js';
|
|
2
|
+
/** la cuenta y región aws que trae el claim de un run (null = sin aws). */
|
|
3
|
+
export type RunAws = {
|
|
4
|
+
accountId: string | null;
|
|
5
|
+
region: string | null;
|
|
6
|
+
} | null;
|
|
7
|
+
/** env aws de un run y, si falló cerrado, la cuenta sin mapear (para el feed). */
|
|
8
|
+
export interface RunAwsEnv {
|
|
9
|
+
env: NodeJS.ProcessEnv;
|
|
10
|
+
unmapped: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* env del proceso claude con la aws del run: el perfil mapeado (y su región), o, con una cuenta sin
|
|
14
|
+
* mapear, la aws cli sin credenciales (emptyDir: el directorio con config y credentials vacíos). no muta `base`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runAwsEnv(base: NodeJS.ProcessEnv, aws: RunAws, map: Record<string, AwsAccountConfig>, emptyDir: () => string): RunAwsEnv;
|
|
17
|
+
/** crea el directorio de un run con la config y las credenciales de aws vacías (0700 / 0600). devuelve su ruta. */
|
|
18
|
+
export declare function writeEmptyAwsConfig(runId: number): string;
|
|
19
|
+
/** borra los directorios de aws vacía que dejó un daemon anterior. solo al arrancar, con el lock tomado. devuelve cuántos. */
|
|
20
|
+
export declare function clearRunAwsConfigs(): number;
|
|
21
|
+
//# sourceMappingURL=aws-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-env.d.ts","sourceRoot":"","sources":["../src/aws-env.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA0BlE,2EAA2E;AAC3E,MAAM,MAAM,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC;AAEhF,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAkBxI;AAED,mHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,8HAA8H;AAC9H,wBAAgB,kBAAkB,IAAI,MAAM,CAK3C"}
|
package/dist/aws-env.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// aws del proceso claude de un run: la cuenta del claim → el perfil que la mapea en esta máquina
|
|
2
|
+
// (`aws add`). desde 0.11.0 (capability aws_strict, t#465 P12) una cuenta que esta máquina NO mapea falla
|
|
3
|
+
// cerrado: AWS_CONFIG_FILE y AWS_SHARED_CREDENTIALS_FILE apuntan a ficheros vacíos del propio run, sin
|
|
4
|
+
// perfil, sin claves en el env y sin metadata de instancia o contenedor. antes caía en el perfil por
|
|
5
|
+
// defecto, que puede ser OTRA cuenta (el server ya no manda los patrones aws a una plantilla cuya cuenta
|
|
6
|
+
// no anuncia la máquina, t#465 P6; esto es la segunda línea, también para los prompt runs).
|
|
7
|
+
// decisiones:
|
|
8
|
+
// - los ficheros vacíos van en <runnerHome>/run-config/aws-<run>-<rand>/ (0700, como los mcp-config: ya
|
|
9
|
+
// negado a Read en todo kit) y se borran al cerrar el segmento; un run en edición podría escribir en
|
|
10
|
+
// ellos (`aws configure set`) y uno compartido contaminaría a otros runs. los que dejó un daemon muerto
|
|
11
|
+
// se borran al arrancar.
|
|
12
|
+
// - sin cuenta en el claim (o sin aws) nada cambia: el env del usuario tal cual, como siempre.
|
|
13
|
+
import crypto from 'node:crypto';
|
|
14
|
+
import fs from 'node:fs';
|
|
15
|
+
import path from 'node:path';
|
|
16
|
+
import { runConfigDir } from './config.js';
|
|
17
|
+
const AWS_EMPTY_PREFIX = 'aws-';
|
|
18
|
+
const AWS_EMPTY_RANDOM_BYTES = 4;
|
|
19
|
+
const AWS_EMPTY_DIR_MODE = 0o700;
|
|
20
|
+
const AWS_EMPTY_FILE_MODE = 0o600;
|
|
21
|
+
const AWS_CONFIG = 'config';
|
|
22
|
+
const AWS_CREDENTIALS = 'credentials';
|
|
23
|
+
// todo lo que daría credenciales a la aws cli sin los ficheros de config: perfiles, claves en el env,
|
|
24
|
+
// web identity y los endpoints de credenciales de contenedor.
|
|
25
|
+
const AWS_CREDENTIAL_VARS = [
|
|
26
|
+
'AWS_PROFILE',
|
|
27
|
+
'AWS_DEFAULT_PROFILE',
|
|
28
|
+
'AWS_ACCESS_KEY_ID',
|
|
29
|
+
'AWS_SECRET_ACCESS_KEY',
|
|
30
|
+
'AWS_SESSION_TOKEN',
|
|
31
|
+
'AWS_SECURITY_TOKEN',
|
|
32
|
+
'AWS_ROLE_ARN',
|
|
33
|
+
'AWS_ROLE_SESSION_NAME',
|
|
34
|
+
'AWS_WEB_IDENTITY_TOKEN_FILE',
|
|
35
|
+
'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI',
|
|
36
|
+
'AWS_CONTAINER_CREDENTIALS_FULL_URI',
|
|
37
|
+
'AWS_CONTAINER_AUTHORIZATION_TOKEN',
|
|
38
|
+
'AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE',
|
|
39
|
+
];
|
|
40
|
+
/**
|
|
41
|
+
* env del proceso claude con la aws del run: el perfil mapeado (y su región), o, con una cuenta sin
|
|
42
|
+
* mapear, la aws cli sin credenciales (emptyDir: el directorio con config y credentials vacíos). no muta `base`.
|
|
43
|
+
*/
|
|
44
|
+
export function runAwsEnv(base, aws, map, emptyDir) {
|
|
45
|
+
const env = { ...base };
|
|
46
|
+
const accountId = aws?.accountId ?? null;
|
|
47
|
+
const account = accountId && Object.hasOwn(map, accountId) ? map[accountId] : undefined;
|
|
48
|
+
if (account) {
|
|
49
|
+
env.AWS_PROFILE = account.profile;
|
|
50
|
+
const region = account.region ?? aws?.region ?? undefined;
|
|
51
|
+
if (region)
|
|
52
|
+
env.AWS_DEFAULT_REGION = region;
|
|
53
|
+
return { env, unmapped: null };
|
|
54
|
+
}
|
|
55
|
+
if (aws?.region)
|
|
56
|
+
env.AWS_DEFAULT_REGION = aws.region;
|
|
57
|
+
if (!accountId)
|
|
58
|
+
return { env, unmapped: null };
|
|
59
|
+
const dir = emptyDir();
|
|
60
|
+
AWS_CREDENTIAL_VARS.forEach((key) => delete env[key]);
|
|
61
|
+
env.AWS_CONFIG_FILE = path.join(dir, AWS_CONFIG);
|
|
62
|
+
env.AWS_SHARED_CREDENTIALS_FILE = path.join(dir, AWS_CREDENTIALS);
|
|
63
|
+
env.AWS_EC2_METADATA_DISABLED = 'true';
|
|
64
|
+
return { env, unmapped: accountId };
|
|
65
|
+
}
|
|
66
|
+
/** crea el directorio de un run con la config y las credenciales de aws vacías (0700 / 0600). devuelve su ruta. */
|
|
67
|
+
export function writeEmptyAwsConfig(runId) {
|
|
68
|
+
const dir = path.join(runConfigDir(), `${AWS_EMPTY_PREFIX}${runId}-${crypto.randomBytes(AWS_EMPTY_RANDOM_BYTES).toString('hex')}`);
|
|
69
|
+
fs.mkdirSync(dir, { mode: AWS_EMPTY_DIR_MODE });
|
|
70
|
+
[AWS_CONFIG, AWS_CREDENTIALS].forEach((name) => fs.writeFileSync(path.join(dir, name), '', { mode: AWS_EMPTY_FILE_MODE, flag: 'wx' }));
|
|
71
|
+
return dir;
|
|
72
|
+
}
|
|
73
|
+
/** borra los directorios de aws vacía que dejó un daemon anterior. solo al arrancar, con el lock tomado. devuelve cuántos. */
|
|
74
|
+
export function clearRunAwsConfigs() {
|
|
75
|
+
const dir = runConfigDir();
|
|
76
|
+
const stale = fs.readdirSync(dir, { withFileTypes: true }).filter((d) => d.isDirectory() && d.name.startsWith(AWS_EMPTY_PREFIX));
|
|
77
|
+
stale.forEach((d) => fs.rmSync(path.join(dir, d.name), { recursive: true, force: true }));
|
|
78
|
+
return stale.length;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=aws-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-env.js","sourceRoot":"","sources":["../src/aws-env.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,0GAA0G;AAC1G,uGAAuG;AACvG,qGAAqG;AACrG,yGAAyG;AACzG,4FAA4F;AAC5F,cAAc;AACd,wGAAwG;AACxG,uGAAuG;AACvG,0GAA0G;AAC1G,2BAA2B;AAC3B,+FAA+F;AAE/F,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAElE,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,UAAU,GAAG,Q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I,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACjI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1F,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC"}
|
package/dist/aws.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws.d.ts","sourceRoot":"","sources":["../src/aws.ts"],"names":[],"mappings":"AAcA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"aws.d.ts","sourceRoot":"","sources":["../src/aws.ts"],"names":[],"mappings":"AAcA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAmD/C"}
|
package/dist/aws.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// subcomandos `duckhunt-runner aws ...`: mapa id de cuenta aws → perfil local de la aws cli. el
|
|
2
2
|
// claim trae solo el id de cuenta (y región) de la conexión del entry; el daemon lo traduce a
|
|
3
3
|
// AWS_PROFILE/AWS_DEFAULT_REGION del proceso claude. el server nunca ve perfiles ni credenciales.
|
|
4
|
-
import { configPath,
|
|
4
|
+
import { configPath, loadStoredConfig, saveConfig } from './config.js';
|
|
5
5
|
const ACCOUNT_ID_RE = /^\d{12}$/;
|
|
6
6
|
const USAGE = `uso:
|
|
7
7
|
duckhunt-runner aws list
|
|
@@ -9,7 +9,8 @@ const USAGE = `uso:
|
|
|
9
9
|
duckhunt-runner aws remove <account-id>
|
|
10
10
|
`;
|
|
11
11
|
export function awsCommand(args) {
|
|
12
|
-
|
|
12
|
+
// sin credencial también (tras `logout` los mapas se quedan): solo se leen y escriben los mapas.
|
|
13
|
+
const cfg = loadStoredConfig();
|
|
13
14
|
if (!cfg) {
|
|
14
15
|
console.error('sin config: ejecuta `duckhunt-runner login <base-url>` primero');
|
|
15
16
|
process.exitCode = 1;
|
package/dist/aws.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../src/aws.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,8FAA8F;AAC9F,kGAAkG;AAElG,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../src/aws.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,8FAA8F;AAC9F,kGAAkG;AAElG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,MAAM,KAAK,GAAG;;;;CAIb,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,iGAAiG;IACjG,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;QAChF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAE5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,+FAA+F,CAAC,CAAC;YAC7G,OAAO;QACT,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,EA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,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACjE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvH,OAAO,CAAC,GAAG,CAAC,uBAAuB,OAAO,EAAE,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/claim.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ export declare const RUNNER_CAPABILITY: {
|
|
|
6
6
|
readonly readShell: "read_shell";
|
|
7
7
|
readonly nativeMemory: "native_memory";
|
|
8
8
|
readonly repoEdit: "repo_edit";
|
|
9
|
+
readonly secretPaths: "secret_paths";
|
|
10
|
+
readonly seedBudget: "seed_budget";
|
|
11
|
+
readonly awsStrict: "aws_strict";
|
|
12
|
+
readonly worktreeReport: "worktree_report";
|
|
13
|
+
readonly logout: "logout";
|
|
14
|
+
readonly model: "model";
|
|
9
15
|
};
|
|
10
16
|
export type RunnerCapability = (typeof RUNNER_CAPABILITY)[keyof typeof RUNNER_CAPABILITY];
|
|
11
17
|
export declare const RUN_ISOLATION: {
|
|
@@ -23,6 +29,11 @@ export declare const PROMPT_PROFILE: {
|
|
|
23
29
|
readonly edit: "edit";
|
|
24
30
|
};
|
|
25
31
|
export type PromptProfile = (typeof PROMPT_PROFILE)[keyof typeof PROMPT_PROFILE];
|
|
32
|
+
export declare const RUN_SEED: {
|
|
33
|
+
readonly template: "template";
|
|
34
|
+
readonly prompt: "prompt";
|
|
35
|
+
};
|
|
36
|
+
export type RunSeed = (typeof RUN_SEED)[keyof typeof RUN_SEED];
|
|
26
37
|
export declare const ALLOWED_PERMISSION_MODES: readonly string[];
|
|
27
38
|
export declare const EVENTS_DEFAULTS: {
|
|
28
39
|
readonly nextSeq: 1;
|
|
@@ -40,6 +51,7 @@ export declare const BASH_TOOL = "Bash";
|
|
|
40
51
|
export declare const READ_AWS_VERBS: readonly string[];
|
|
41
52
|
export declare const READ_AWS_COMMANDS: readonly string[];
|
|
42
53
|
export declare const AWS_OUTFILE_COMMANDS: readonly string[];
|
|
54
|
+
export declare const MODEL_RE: RegExp;
|
|
43
55
|
export declare const REPO_KEY_RE: RegExp;
|
|
44
56
|
export interface ClaimedRun {
|
|
45
57
|
id: number;
|
|
@@ -57,8 +69,10 @@ export interface ClaimedRun {
|
|
|
57
69
|
sessionId: string | null;
|
|
58
70
|
parentRunId: number | null;
|
|
59
71
|
profile: PromptProfile | null;
|
|
72
|
+
seed: RunSeed | null;
|
|
60
73
|
isolation: RunIsolation;
|
|
61
74
|
segment: number | null;
|
|
75
|
+
model: string | null;
|
|
62
76
|
}
|
|
63
77
|
export interface EventsConfig {
|
|
64
78
|
enabled: boolean;
|
package/dist/claim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../src/claim.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../src/claim.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CAqBpB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,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