duckhunt-runner 0.11.0 → 0.13.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.
Files changed (326) hide show
  1. package/README.md +425 -35
  2. package/dist/announced-capabilities.d.ts +12 -0
  3. package/dist/announced-capabilities.d.ts.map +1 -0
  4. package/dist/announced-capabilities.js +33 -0
  5. package/dist/announced-capabilities.js.map +1 -0
  6. package/dist/audit-cli.d.ts +7 -0
  7. package/dist/audit-cli.d.ts.map +1 -0
  8. package/dist/audit-cli.js +84 -0
  9. package/dist/audit-cli.js.map +1 -0
  10. package/dist/audit.d.ts +163 -0
  11. package/dist/audit.d.ts.map +1 -0
  12. package/dist/audit.js +286 -0
  13. package/dist/audit.js.map +1 -0
  14. package/dist/aws.d.ts +10 -1
  15. package/dist/aws.d.ts.map +1 -1
  16. package/dist/aws.js +35 -9
  17. package/dist/aws.js.map +1 -1
  18. package/dist/browser-cli.d.ts +9 -0
  19. package/dist/browser-cli.d.ts.map +1 -0
  20. package/dist/browser-cli.js +200 -0
  21. package/dist/browser-cli.js.map +1 -0
  22. package/dist/claim.d.ts +46 -27
  23. package/dist/claim.d.ts.map +1 -1
  24. package/dist/claim.js +125 -85
  25. package/dist/claim.js.map +1 -1
  26. package/dist/claude-args.d.ts.map +1 -1
  27. package/dist/claude-args.js +8 -0
  28. package/dist/claude-args.js.map +1 -1
  29. package/dist/claude.d.ts +8 -1
  30. package/dist/claude.d.ts.map +1 -1
  31. package/dist/claude.js +41 -9
  32. package/dist/claude.js.map +1 -1
  33. package/dist/config-legacy.d.ts +20 -0
  34. package/dist/config-legacy.d.ts.map +1 -0
  35. package/dist/config-legacy.js +253 -0
  36. package/dist/config-legacy.js.map +1 -0
  37. package/dist/config.d.ts +39 -10
  38. package/dist/config.d.ts.map +1 -1
  39. package/dist/config.js +44 -28
  40. package/dist/config.js.map +1 -1
  41. package/dist/daemon.d.ts +80 -20
  42. package/dist/daemon.d.ts.map +1 -1
  43. package/dist/daemon.js +878 -438
  44. package/dist/daemon.js.map +1 -1
  45. package/dist/feed.d.ts +5 -1
  46. package/dist/feed.d.ts.map +1 -1
  47. package/dist/feed.js +78 -13
  48. package/dist/feed.js.map +1 -1
  49. package/dist/index.js +64 -4
  50. package/dist/index.js.map +1 -1
  51. package/dist/local/mcp.d.ts +93 -0
  52. package/dist/local/mcp.d.ts.map +1 -0
  53. package/dist/local/mcp.js +170 -0
  54. package/dist/local/mcp.js.map +1 -0
  55. package/dist/local/policy.d.ts +39 -0
  56. package/dist/local/policy.d.ts.map +1 -0
  57. package/dist/local/policy.js +88 -0
  58. package/dist/local/policy.js.map +1 -0
  59. package/dist/local/socket.d.ts +68 -0
  60. package/dist/local/socket.d.ts.map +1 -0
  61. package/dist/local/socket.js +140 -0
  62. package/dist/local/socket.js.map +1 -0
  63. package/dist/local/store.d.ts +75 -0
  64. package/dist/local/store.d.ts.map +1 -0
  65. package/dist/local/store.js +110 -0
  66. package/dist/local/store.js.map +1 -0
  67. package/dist/logout.d.ts +10 -11
  68. package/dist/logout.d.ts.map +1 -1
  69. package/dist/logout.js +63 -34
  70. package/dist/logout.js.map +1 -1
  71. package/dist/machine.d.ts +4 -0
  72. package/dist/machine.d.ts.map +1 -1
  73. package/dist/machine.js +35 -0
  74. package/dist/machine.js.map +1 -1
  75. package/dist/mcp-stdio.d.ts +19 -0
  76. package/dist/mcp-stdio.d.ts.map +1 -0
  77. package/dist/mcp-stdio.js +65 -0
  78. package/dist/mcp-stdio.js.map +1 -0
  79. package/dist/oauth.d.ts +31 -3
  80. package/dist/oauth.d.ts.map +1 -1
  81. package/dist/oauth.js +64 -31
  82. package/dist/oauth.js.map +1 -1
  83. package/dist/paths.d.ts +43 -0
  84. package/dist/paths.d.ts.map +1 -0
  85. package/dist/paths.js +136 -0
  86. package/dist/paths.js.map +1 -0
  87. package/dist/platform-login.d.ts +19 -0
  88. package/dist/platform-login.d.ts.map +1 -0
  89. package/dist/platform-login.js +178 -0
  90. package/dist/platform-login.js.map +1 -0
  91. package/dist/platforms/claim-v0.d.ts +44 -0
  92. package/dist/platforms/claim-v0.d.ts.map +1 -0
  93. package/dist/platforms/claim-v0.js +243 -0
  94. package/dist/platforms/claim-v0.js.map +1 -0
  95. package/dist/platforms/credentials.d.ts +15 -0
  96. package/dist/platforms/credentials.d.ts.map +1 -0
  97. package/dist/platforms/credentials.js +40 -0
  98. package/dist/platforms/credentials.js.map +1 -0
  99. package/dist/platforms/discovery.d.ts +30 -0
  100. package/dist/platforms/discovery.d.ts.map +1 -0
  101. package/dist/platforms/discovery.js +91 -0
  102. package/dist/platforms/discovery.js.map +1 -0
  103. package/dist/platforms/duckhunt42.d.ts +33 -0
  104. package/dist/platforms/duckhunt42.d.ts.map +1 -0
  105. package/dist/platforms/duckhunt42.js +231 -0
  106. package/dist/platforms/duckhunt42.js.map +1 -0
  107. package/dist/platforms/factories.d.ts +3 -0
  108. package/dist/platforms/factories.d.ts.map +1 -0
  109. package/dist/platforms/factories.js +10 -0
  110. package/dist/platforms/factories.js.map +1 -0
  111. package/dist/platforms/http-transport.d.ts +29 -0
  112. package/dist/platforms/http-transport.d.ts.map +1 -0
  113. package/dist/platforms/http-transport.js +88 -0
  114. package/dist/platforms/http-transport.js.map +1 -0
  115. package/dist/platforms/local.d.ts +79 -0
  116. package/dist/platforms/local.d.ts.map +1 -0
  117. package/dist/platforms/local.js +302 -0
  118. package/dist/platforms/local.js.map +1 -0
  119. package/dist/platforms/origin.d.ts +12 -0
  120. package/dist/platforms/origin.d.ts.map +1 -0
  121. package/dist/platforms/origin.js +32 -0
  122. package/dist/platforms/origin.js.map +1 -0
  123. package/dist/platforms/platform.d.ts +133 -0
  124. package/dist/platforms/platform.d.ts.map +1 -0
  125. package/dist/platforms/platform.js +30 -0
  126. package/dist/platforms/platform.js.map +1 -0
  127. package/dist/platforms/scheduler.d.ts +32 -0
  128. package/dist/platforms/scheduler.d.ts.map +1 -0
  129. package/dist/platforms/scheduler.js +76 -0
  130. package/dist/platforms/scheduler.js.map +1 -0
  131. package/dist/platforms/supervisor.d.ts +45 -0
  132. package/dist/platforms/supervisor.d.ts.map +1 -0
  133. package/dist/platforms/supervisor.js +112 -0
  134. package/dist/platforms/supervisor.js.map +1 -0
  135. package/dist/platforms/types.d.ts +50 -0
  136. package/dist/platforms/types.d.ts.map +1 -0
  137. package/dist/platforms/types.js +69 -0
  138. package/dist/platforms/types.js.map +1 -0
  139. package/dist/platforms/v0.d.ts +41 -0
  140. package/dist/platforms/v0.d.ts.map +1 -0
  141. package/dist/platforms/v0.js +301 -0
  142. package/dist/platforms/v0.js.map +1 -0
  143. package/dist/platforms-cli.d.ts +5 -0
  144. package/dist/platforms-cli.d.ts.map +1 -0
  145. package/dist/platforms-cli.js +163 -0
  146. package/dist/platforms-cli.js.map +1 -0
  147. package/dist/read-shell-guard.d.ts.map +1 -1
  148. package/dist/read-shell-guard.js +4 -3
  149. package/dist/read-shell-guard.js.map +1 -1
  150. package/dist/repo-commands.js +2 -2
  151. package/dist/repo-commands.js.map +1 -1
  152. package/dist/repo-key.js +1 -1
  153. package/dist/repo-key.js.map +1 -1
  154. package/dist/repos.js +4 -4
  155. package/dist/repos.js.map +1 -1
  156. package/dist/resource.d.ts +2 -0
  157. package/dist/resource.d.ts.map +1 -0
  158. package/dist/resource.js +91 -0
  159. package/dist/resource.js.map +1 -0
  160. package/dist/resources/aws.d.ts +36 -0
  161. package/dist/resources/aws.d.ts.map +1 -0
  162. package/dist/resources/aws.js +160 -0
  163. package/dist/resources/aws.js.map +1 -0
  164. package/dist/resources/browser/config.d.ts +33 -0
  165. package/dist/resources/browser/config.d.ts.map +1 -0
  166. package/dist/resources/browser/config.js +86 -0
  167. package/dist/resources/browser/config.js.map +1 -0
  168. package/dist/resources/browser/health.d.ts +48 -0
  169. package/dist/resources/browser/health.d.ts.map +1 -0
  170. package/dist/resources/browser/health.js +100 -0
  171. package/dist/resources/browser/health.js.map +1 -0
  172. package/dist/resources/browser/odysea-cli.d.ts +41 -0
  173. package/dist/resources/browser/odysea-cli.d.ts.map +1 -0
  174. package/dist/resources/browser/odysea-cli.js +122 -0
  175. package/dist/resources/browser/odysea-cli.js.map +1 -0
  176. package/dist/resources/browser/origins.d.ts +17 -0
  177. package/dist/resources/browser/origins.d.ts.map +1 -0
  178. package/dist/resources/browser/origins.js +72 -0
  179. package/dist/resources/browser/origins.js.map +1 -0
  180. package/dist/resources/browser/provider.d.ts +49 -0
  181. package/dist/resources/browser/provider.d.ts.map +1 -0
  182. package/dist/resources/browser/provider.js +166 -0
  183. package/dist/resources/browser/provider.js.map +1 -0
  184. package/dist/resources/browser/state-filter.d.ts +28 -0
  185. package/dist/resources/browser/state-filter.d.ts.map +1 -0
  186. package/dist/resources/browser/state-filter.js +61 -0
  187. package/dist/resources/browser/state-filter.js.map +1 -0
  188. package/dist/resources/legacy.d.ts +13 -0
  189. package/dist/resources/legacy.d.ts.map +1 -0
  190. package/dist/resources/legacy.js +46 -0
  191. package/dist/resources/legacy.js.map +1 -0
  192. package/dist/resources/lifecycle.d.ts +48 -0
  193. package/dist/resources/lifecycle.d.ts.map +1 -0
  194. package/dist/resources/lifecycle.js +137 -0
  195. package/dist/resources/lifecycle.js.map +1 -0
  196. package/dist/resources/registry.d.ts +20 -0
  197. package/dist/resources/registry.d.ts.map +1 -0
  198. package/dist/resources/registry.js +37 -0
  199. package/dist/resources/registry.js.map +1 -0
  200. package/dist/{conversation-gc.d.ts → resources/repo/gc.d.ts} +6 -6
  201. package/dist/resources/repo/gc.d.ts.map +1 -0
  202. package/dist/{conversation-gc.js → resources/repo/gc.js} +16 -13
  203. package/dist/resources/repo/gc.js.map +1 -0
  204. package/dist/{repo-health.d.ts → resources/repo/health.d.ts} +4 -2
  205. package/dist/resources/repo/health.d.ts.map +1 -0
  206. package/dist/{repo-health.js → resources/repo/health.js} +14 -9
  207. package/dist/resources/repo/health.js.map +1 -0
  208. package/dist/resources/repo/provider.d.ts +14 -0
  209. package/dist/resources/repo/provider.d.ts.map +1 -0
  210. package/dist/resources/repo/provider.js +75 -0
  211. package/dist/resources/repo/provider.js.map +1 -0
  212. package/dist/{worktree.d.ts → resources/repo/worktree.d.ts} +3 -5
  213. package/dist/resources/repo/worktree.d.ts.map +1 -0
  214. package/dist/{worktree.js → resources/repo/worktree.js} +24 -27
  215. package/dist/resources/repo/worktree.js.map +1 -0
  216. package/dist/resources/s3-read.d.ts +29 -0
  217. package/dist/resources/s3-read.d.ts.map +1 -0
  218. package/dist/resources/s3-read.js +68 -0
  219. package/dist/resources/s3-read.js.map +1 -0
  220. package/dist/resources/types.d.ts +106 -0
  221. package/dist/resources/types.d.ts.map +1 -0
  222. package/dist/resources/types.js +73 -0
  223. package/dist/resources/types.js.map +1 -0
  224. package/dist/run-cli.d.ts +25 -0
  225. package/dist/run-cli.d.ts.map +1 -0
  226. package/dist/run-cli.js +432 -0
  227. package/dist/run-cli.js.map +1 -0
  228. package/dist/run-id.d.ts +10 -0
  229. package/dist/run-id.d.ts.map +1 -0
  230. package/dist/run-id.js +36 -0
  231. package/dist/run-id.js.map +1 -0
  232. package/dist/run-lease.d.ts +2 -2
  233. package/dist/run-mcp-config.d.ts +7 -4
  234. package/dist/run-mcp-config.d.ts.map +1 -1
  235. package/dist/run-mcp-config.js +14 -8
  236. package/dist/run-mcp-config.js.map +1 -1
  237. package/dist/s3-read-server.d.ts +22 -0
  238. package/dist/s3-read-server.d.ts.map +1 -0
  239. package/dist/s3-read-server.js +173 -0
  240. package/dist/s3-read-server.js.map +1 -0
  241. package/dist/secret-paths.d.ts +12 -0
  242. package/dist/secret-paths.d.ts.map +1 -1
  243. package/dist/secret-paths.js +82 -10
  244. package/dist/secret-paths.js.map +1 -1
  245. package/dist/server-state.d.ts +7 -9
  246. package/dist/server-state.d.ts.map +1 -1
  247. package/dist/server-state.js +14 -17
  248. package/dist/server-state.js.map +1 -1
  249. package/dist/status-report.d.ts +2 -0
  250. package/dist/status-report.d.ts.map +1 -1
  251. package/dist/status-report.js.map +1 -1
  252. package/dist/status.d.ts +5 -1
  253. package/dist/status.d.ts.map +1 -1
  254. package/dist/status.js +111 -11
  255. package/dist/status.js.map +1 -1
  256. package/dist/toolset/intersect.d.ts +10 -0
  257. package/dist/toolset/intersect.d.ts.map +1 -0
  258. package/dist/toolset/intersect.js +36 -0
  259. package/dist/toolset/intersect.js.map +1 -0
  260. package/dist/toolset/legacy-render.d.ts +12 -0
  261. package/dist/toolset/legacy-render.d.ts.map +1 -0
  262. package/dist/toolset/legacy-render.js +69 -0
  263. package/dist/toolset/legacy-render.js.map +1 -0
  264. package/dist/toolset/parse.d.ts +4 -0
  265. package/dist/toolset/parse.d.ts.map +1 -0
  266. package/dist/toolset/parse.js +74 -0
  267. package/dist/toolset/parse.js.map +1 -0
  268. package/dist/toolset/render.d.ts +28 -0
  269. package/dist/toolset/render.d.ts.map +1 -0
  270. package/dist/toolset/render.js +78 -0
  271. package/dist/toolset/render.js.map +1 -0
  272. package/dist/toolset/shadow.d.ts +16 -0
  273. package/dist/toolset/shadow.d.ts.map +1 -0
  274. package/dist/toolset/shadow.js +61 -0
  275. package/dist/toolset/shadow.js.map +1 -0
  276. package/dist/vendor/runner-protocol/aws.d.ts +6 -0
  277. package/dist/vendor/runner-protocol/aws.d.ts.map +1 -0
  278. package/dist/vendor/runner-protocol/aws.js +69 -0
  279. package/dist/vendor/runner-protocol/aws.js.map +1 -0
  280. package/dist/vendor/runner-protocol/capabilities.d.ts +20 -0
  281. package/dist/vendor/runner-protocol/capabilities.d.ts.map +1 -0
  282. package/dist/vendor/runner-protocol/capabilities.js +58 -0
  283. package/dist/vendor/runner-protocol/capabilities.js.map +1 -0
  284. package/dist/vendor/runner-protocol/claim.d.ts +112 -0
  285. package/dist/vendor/runner-protocol/claim.d.ts.map +1 -0
  286. package/dist/vendor/runner-protocol/claim.js +54 -0
  287. package/dist/vendor/runner-protocol/claim.js.map +1 -0
  288. package/dist/vendor/runner-protocol/errors.d.ts +17 -0
  289. package/dist/vendor/runner-protocol/errors.d.ts.map +1 -0
  290. package/dist/vendor/runner-protocol/errors.js +19 -0
  291. package/dist/vendor/runner-protocol/errors.js.map +1 -0
  292. package/dist/vendor/runner-protocol/events.d.ts +14 -0
  293. package/dist/vendor/runner-protocol/events.d.ts.map +1 -0
  294. package/dist/vendor/runner-protocol/events.js +22 -0
  295. package/dist/vendor/runner-protocol/events.js.map +1 -0
  296. package/dist/vendor/runner-protocol/index.d.ts +10 -0
  297. package/dist/vendor/runner-protocol/index.d.ts.map +1 -0
  298. package/dist/vendor/runner-protocol/index.js +24 -0
  299. package/dist/vendor/runner-protocol/index.js.map +1 -0
  300. package/dist/vendor/runner-protocol/limits.d.ts +31 -0
  301. package/dist/vendor/runner-protocol/limits.d.ts.map +1 -0
  302. package/dist/vendor/runner-protocol/limits.js +60 -0
  303. package/dist/vendor/runner-protocol/limits.js.map +1 -0
  304. package/dist/vendor/runner-protocol/resources.d.ts +35 -0
  305. package/dist/vendor/runner-protocol/resources.d.ts.map +1 -0
  306. package/dist/vendor/runner-protocol/resources.js +39 -0
  307. package/dist/vendor/runner-protocol/resources.js.map +1 -0
  308. package/dist/vendor/runner-protocol/toolset.d.ts +59 -0
  309. package/dist/vendor/runner-protocol/toolset.d.ts.map +1 -0
  310. package/dist/vendor/runner-protocol/toolset.js +50 -0
  311. package/dist/vendor/runner-protocol/toolset.js.map +1 -0
  312. package/dist/vendor/runner-protocol/v0.d.ts +277 -0
  313. package/dist/vendor/runner-protocol/v0.d.ts.map +1 -0
  314. package/dist/vendor/runner-protocol/v0.js +121 -0
  315. package/dist/vendor/runner-protocol/v0.js.map +1 -0
  316. package/package.json +3 -2
  317. package/dist/aws-env.d.ts +0 -21
  318. package/dist/aws-env.d.ts.map +0 -1
  319. package/dist/aws-env.js +0 -80
  320. package/dist/aws-env.js.map +0 -1
  321. package/dist/conversation-gc.d.ts.map +0 -1
  322. package/dist/conversation-gc.js.map +0 -1
  323. package/dist/repo-health.d.ts.map +0 -1
  324. package/dist/repo-health.js.map +0 -1
  325. package/dist/worktree.d.ts.map +0 -1
  326. 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.11.0 login
32
- npx duckhunt-runner@0.11.0 repos discover ~/dev
33
- npx duckhunt-runner@0.11.0 start
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>` | 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. |
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
- | `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)). |
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). `--version`
56
- prints the daemon version.
57
-
58
- The daemon does not need a restart after `login`, `repos`, `aws` or a hand edit of the file: it
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.11.0 start
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,14 @@ 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. Run `login` again to pair it.
196
+ **78** instead of retrying every few seconds. Run `login` again to pair it. With other platforms
197
+ configured (0.13.0 or later), only the platform whose credential died stops, along with its runs; the
198
+ daemon exits with 78 when none is left usable, and a new `login` brings that platform back without a
199
+ restart.
200
+
201
+ The machine's label is `label` from the config, or the hostname. From 0.13.0 a label longer than
202
+ duckhunt accepts (100 characters) is clipped, and a blank one falls back to the hostname; before,
203
+ duckhunt refused every claim with it.
155
204
 
156
205
  `status` prints what duckhunt said about this machine in the daemon's last claim, and how long ago:
157
206
  its name in duckhunt, whether it is paused, what it accepts, its slot cap, why it is not getting work
@@ -174,19 +223,23 @@ share on this machine takes turns: git operations on the same checkout (fetch, w
174
223
  creation and cleanup), conversations opened in the checkout itself, and prompt runs with the `edit`
175
224
  profile and no repo (they share the scratch directory). A run waiting for its turn
176
225
  still heartbeats and says so in its feed. The daemon reports its slot count, and Settings → Agents
177
- shows how many are in use. Never run two daemons on the same config file: the credential rotates on
226
+ shows how many are in use. With other platforms (0.13.0 or later), `maxConcurrent` is the pool they
227
+ all share, each one capped by its own `slots`, and a slot that frees up goes to the next waiting
228
+ platform in turn. Never run two daemons on the same config file: the credential rotates on
178
229
  every refresh and duckhunt revokes it when it sees an old one again. `start` refuses a second daemon
179
230
  on the same state directory; raise one daemon's slots instead.
180
231
 
181
232
  ## How a run works
182
233
 
183
234
  1. **A run is queued** from duckhunt: the *investigate with agent* action on an entry, the same
184
- button on an alert notification, or an automation rule with that action.
185
- 2. **The daemon claims it** and gets a prompt, a tool profile and a short-lived MCP token scoped to
186
- that single run. It launches `claude -p` in a worktree of the mapped checkout (or a scratch
187
- directory when the alarm has no repo). An automation run is a `read` conversation like any other
188
- (see [Prompt runs](#prompt-runs)), with an even smaller kit: no web, no memory, and no shell when
189
- the rule may comment on the ticket.
235
+ button on an alert notification, or an automation rule with that action (or one that runs a
236
+ prompt of yours, see below).
237
+ 2. **The daemon claims it** and gets a prompt, a tool profile, the model to use and a short-lived MCP
238
+ token scoped to that single run. It launches `claude -p` in a worktree of the mapped checkout (or a
239
+ scratch directory when the alarm has no repo). An investigation is a `read` conversation like any
240
+ other (see [Prompt runs](#prompt-runs)), with an even smaller kit: no web, and no shell when the
241
+ rule may comment on the ticket. Whether it can extend Claude's native memory is your choice (see
242
+ [Native memory](#native-memory-080-or-later)).
190
243
  3. **The agent investigates** and answers in the run's conversation, on the *Agents* page. You get a
191
244
  push with a one-line summary on top and can reply to it straight from the notification.
192
245
  4. **If it needs a decision from you**, it asks and ends its turn. Your answer resumes it in the
@@ -203,9 +256,17 @@ run's token:
203
256
  | Born from an instruction of yours | Also write inside duckhunt (create tasks, snooze the inbox, label). |
204
257
  | Born from a yes/no you confirmed | Also act outside duckhunt through its tools (comment on or move the ticket). |
205
258
 
206
- So an unattended run can never change anything, and anything that leaves duckhunt needs you to have
207
- said yes to that specific action, spelled out with the literal command. Changing AWS resources or
208
- code is never part of that: the run proposes an `edit` conversation, which you review and launch.
259
+ So an unattended investigation can never change anything, and anything that leaves duckhunt needs you
260
+ to have said yes to that specific action, spelled out with the literal command. Changing AWS resources
261
+ or code is never part of that: the run proposes an `edit` conversation, which you review and launch.
262
+
263
+ A rule can also *run a prompt* you wrote (on a schedule, when an entry is created, updated or
264
+ 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
265
+ duckhunt (create, move and organise tasks, label, take notes) and read the repo you chose. With the
266
+ `edit` profile, which you arm once with the identity check when you save the rule, it may also change
267
+ code in its own worktree, never in your checkout; below the confirmed tier its deny list also blocks
268
+ `git push`, `git remote` and `gh` (a best-effort guard, not a sandbox). Anything that leaves duckhunt
269
+ (a Jira comment or transition, an email, a pull request) still needs your yes in that run.
209
270
 
210
271
  #### AWS accounts (0.11.0 or later)
211
272
 
@@ -216,6 +277,45 @@ may belong to another account: the AWS CLI runs with empty config and credential
216
277
  call fails, and the run's feed says which account to map. duckhunt already omits the AWS read
217
278
  patterns for an investigation whose account this machine does not announce; this is the second line.
218
279
 
280
+ From 0.13.0 a run without an account gets an empty AWS config too, unless you map the machine's
281
+ default identity under the key `default` (`resource add aws default <profile> [region]`; `aws add`
282
+ still takes only account ids). Nothing creates it for you. When it is exposed to duckhunt (it is by
283
+ default, like every AWS key), the daemon announces that it has one, never its profile, and duckhunt
284
+ grants it to runs without an account (see [Upgrading to 0.13.0](#upgrading-to-0130)). Other platforms
285
+ ask for AWS by key (see [Platforms](#platforms-0130-or-later)), and their runs get no AWS at all
286
+ unless they are granted a key you exposed to them.
287
+
288
+ #### S3 object reads (0.13.0 or later)
289
+
290
+ A `read` run can list S3 (`aws s3 ls`) but not read objects: `s3api get-object` needs a local output
291
+ file, and a permission rule can't limit `get-object` or `aws s3 cp` to stdout, so both stay denied.
292
+ To let investigations read objects such as ALB access logs, opt in per AWS key:
293
+
294
+ ```sh
295
+ duckhunt-runner aws add <account-id> <profile> [region] --s3-read acme-alb-logs/AWSLogs/
296
+ duckhunt-runner aws add <account-id> <profile> [region] --s3-read # any bucket the profile can read
297
+ ```
298
+
299
+ The targets are `bucket` or `bucket/prefix`. They are stored as `aws.<key>.s3Read` (`true` or a
300
+ list) and shown by `aws list`. Running `aws add` again without the flag removes it.
301
+ `resource add aws` takes the same flag, including for the `default` key.
302
+
303
+ A run that has a grant for that key then gets one more MCP server, `res_aws_<key>`. It is the runner
304
+ itself (a hidden `mcp-s3` subcommand) with only the run's AWS settings, `PATH`, `HOME` and the
305
+ allowed targets in its environment. Its single tool, `s3_read {bucket, key, offset?, maxBytes?, region?}`:
306
+
307
+ - refuses anything outside the allowed buckets and prefixes;
308
+ - checks the size first (`head-object`) and won't read an object over 256 MB compressed;
309
+ - streams it with `aws s3 cp s3://… -` (stdout only, no shell), gunzipping `.gz` objects, and stops as
310
+ soon as it has the requested window: at most 512 KB of text per call, never past 64 MB of
311
+ decompressed data. The reply says which bytes it holds and the `offset` to continue from;
312
+ - returns text only: for a binary object (NUL bytes) it reports the size read, not the content.
313
+
314
+ It never writes a local file and has no upload path. The feed shows `s3://bucket/key` and the window
315
+ asked for, never the content. It is offered only when the daemon builds the run's tool lists (the
316
+ default from 0.13.0, v0 platforms and `runner run`); with `defaults.toolsetRender: false` the run
317
+ gets a note instead. An `edit` run gets it too, though its shell could already read the object.
318
+
219
319
  ## Prompt runs
220
320
 
221
321
  A prompt run is a conversation you start from the *Agents* page: you pick one of the repos mapped
@@ -225,6 +325,21 @@ Requires daemon 0.4.0+ and a Claude CLI that supports `--permission-mode`, `--st
225
325
  `--disallowedTools` and `--setting-sources`; otherwise the daemon does not offer prompt runs and is
226
326
  never handed one.
227
327
 
328
+ ### Model (0.12.0 or later)
329
+
330
+ The model is the one duckhunt asks for: your default in Settings → Agents, the one you pick in the
331
+ composer or later in the thread, or the one set on a rule action. When duckhunt asks for none, the
332
+ daemon uses `defaults.model` from the config file, and without that the Claude CLI default. A model you
333
+ change in the thread applies from the next step on, resumed sessions included. The daemon only passes a
334
+ model alias or id (`opus`, `sonnet`, `claude-opus-5-5`…) and ignores anything else with a note in the
335
+ feed; the run then uses this machine's model.
336
+
337
+ It announces the `model` capability only when `claude --help` lists `--model`, and duckhunt only sends
338
+ a model to daemons that announce it, so an older daemon keeps using `defaults.model`. The model each
339
+ run reports back is the one its main loop used (the CLI's init event), not the small auxiliary model
340
+ the CLI also calls for titles and summaries. `status` prints the capabilities this machine announces
341
+ (`capacidades`, `model` among them) and `start` logs them when it starts.
342
+
228
343
  ### Profiles
229
344
 
230
345
  Each conversation has a profile, chosen when it starts. The Claude CLI enforces it (tool allowlist,
@@ -283,7 +398,12 @@ directory (the logs, the lock, `server-state.json` and the run configs; not the
283
398
  which is the working directory of runs without a repo), `$CLAUDE_CONFIG_DIR/.credentials.json`,
284
399
  `AWS_SHARED_CREDENTIALS_FILE` and `AWS_CONFIG_FILE` when they are set, and the real path behind any
285
400
  of the listed ones that is a symlink (dotfiles). A path that a Claude permission rule cannot express
286
- (commas, brackets, wildcards) is skipped with a warning at startup.
401
+ (commas, brackets, wildcards) is skipped with a warning at startup. From 0.13.0 that includes the
402
+ audit directory (from the first start after it exists), and every run is also denied the state of the
403
+ other platforms: their logs, run configs, `server-state.json`, audit and scratch directory,
404
+ including a platform added while the daemon runs (from its next step). Once a browser session is
405
+ configured, every run, `edit` included, is also denied the browser vault (see
406
+ [Browser sessions](#browser-sessions-0130-or-later)).
287
407
 
288
408
  Checked with Claude Code 2.1.296: `Read`, `Grep` and `Glob` honour these deny rules, through symlinks
289
409
  and in recursive searches. The read-only shell approves nothing outside its working directory, and
@@ -303,9 +423,21 @@ allows them.
303
423
  (automation runs included); user, project and local settings for the legacy automation runs of an
304
424
  older duckhunt. If a settings file can't be read, those tools are denied outright (and the run
305
425
  gets no memory).
306
- - Automation runs get no memory: they process alerts nobody reviewed, and whatever they wrote would load
307
- into your later sessions. The server keeps denying `Edit` and `Write` for them; the daemon would still
308
- mirror rules and re-deny both under `--dangerously-skip-permissions` if that ever changed.
426
+ - **A symlinked project folder blocks memory writes.** If `~/.claude/projects/<repo>` (or its
427
+ `memory/`) is a symlink to somewhere outside `~/.claude`, as GNU stow does with a dotfiles repo,
428
+ runs can still edit `MEMORY.md` but every other memory file they write is refused ("denied
429
+ because Claude Code is running in don't ask mode"). The Claude CLI resolves the link before applying
430
+ the auto-memory exception, and under `dontAsk` no allow rule or `--add-dir` brings it back (checked
431
+ with the CLI 2.1.304), so the daemon can't work around it. Keep those folders as real directories
432
+ for the repos your runs work on, and link the dotfiles side to them instead.
433
+ - duckhunt can now let investigations and rule runs extend Claude Code's native memory too: a setting
434
+ of yours in Settings → Agents, on by default (nothing changes in the daemon; the server just stops
435
+ denying `Edit` and `Write` for them). Repo runs write the repo's memory, the one your interactive
436
+ sessions in that repo load. Repo-less runs share the scratch directory's memory with your repo-less
437
+ conversations. Those runs process content nobody reviewed (an alert, a ticket), and whatever they
438
+ write loads into your later sessions: turn the setting off if you do not want unattended content in
439
+ your memory. The daemon still mirrors your rules and, for the legacy automation runs of an older
440
+ duckhunt under `--dangerously-skip-permissions`, denies both again.
309
441
  - `edit` conversations always could write their memory: the agent is now told it may, outside its
310
442
  worktree too.
311
443
 
@@ -324,14 +456,14 @@ machine accepts. Read-only mode applies to existing `edit` conversations from
324
456
  their next step on. A per-repo `read` lock covers conversations on that repo; it is not a sandbox,
325
457
  since an `edit` conversation on another repo (or none) still has a shell. Conversations you start
326
458
  have no turn or budget limit: each step is capped by the wall-clock limit chosen in Settings → Agents
327
- (1 to 8 hours, 4 by default), and the model is your `defaults.model` (or the CLI default). Automation
328
- runs keep 30 minutes per step and, from 0.11.0, their budget again when you pay with an API key
329
- (`ANTHROPIC_API_KEY`) or set `defaults.maxBudgetUsd`.
459
+ (1 to 8 hours, 4 by default), and the model is the one duckhunt asks for (see
460
+ [Model](#model-0120-or-later)). Automation runs keep 30 minutes per step and, from 0.11.0, their
461
+ budget again when you pay with an API key (`ANTHROPIC_API_KEY`) or set `defaults.maxBudgetUsd`.
330
462
  `worktree: false` and `--dangerously-skip-permissions` in the repo map are deprecated (0.11.0) and go
331
- away in 0.12.0: nothing a current duckhunt sends applies them, because every conversation, automation
332
- runs included, is a prompt run with its own worktree (or the checkout, when you choose it). They only
333
- affect the legacy automation runs an older duckhunt server queued; `repos add`, `repos list` and
334
- `status` say they are ignored.
463
+ away in a later release: nothing a current duckhunt sends applies them, because every conversation,
464
+ automation runs included, is a prompt run with its own worktree (or the checkout, when you choose it).
465
+ They only affect the legacy automation runs an older duckhunt server queued; `repos add`, `repos list`
466
+ and `status` say they are ignored.
335
467
 
336
468
  Each step's MCP config, which holds the run's token, is written to `~/.duckhunt-runner/run-config/`
337
469
  (a `0700` directory, files `0600`) and deleted when the step ends; the daemon removes any left
@@ -384,12 +516,270 @@ for your home; a file opened outside the worktree shows only its name) and anyth
384
516
  a secret (AWS keys, GitHub, Slack, Atlassian, Bitbucket and Anthropic tokens, credentials in a remote
385
517
  URL, `password=`/`token=`-style assignments, `Bearer` headers, private keys) is masked before it
386
518
  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
387
- tool-call count.
519
+ tool-call count. From 0.13.0, what the agent types or evaluates in a tool that is not the platform's
520
+ own (the `value` of a form fill, a script it runs in a page) shows only its length, and a URL shows
521
+ only its origin and path, never its query or fragment. Browser tools get a summary of their own: the
522
+ selector of a `fill` or `select_option`, `js ‹length›` for an `evaluate`, the action of a dialog and
523
+ the key pressed.
388
524
 
389
525
  The daemon also strips variables of the Claude Code session it may have been started from
390
526
  (`CLAUDECODE`, `CLAUDE_CODE_SESSION_ID`…), empty `ANTHROPIC_*` values and a dead `SSH_AUTH_SOCK` from
391
527
  the environment of each run, and disables git's terminal prompts.
392
528
 
529
+ ## Platforms (0.13.0 or later)
530
+
531
+ duckhunt is the built-in platform: `login` and `logout` without an id are still the duckhunt ones,
532
+ and it keeps its current protocol (`duckhunt-42`) even against a duckhunt that already publishes the
533
+ new one. Other platforms speak `agent-runner/0`, an open protocol they describe at
534
+ `/.well-known/agent-runner`. Each one gets its own credential, its own state directory and its own
535
+ worktrees (`<checkout>/.runner/worktrees/<id>/`), and sees only what you expose to it.
536
+
537
+ ### Adding one
538
+
539
+ ```sh
540
+ npx duckhunt-runner@0.13.0 login https://platform.example --as acme --name "Acme"
541
+ ```
542
+
543
+ `login <url> --as [id] [--name <name>] [--trusted]` reads the platform's discovery document and its
544
+ OAuth metadata, registers this machine, and asks you to open a URL and paste the code back, like the
545
+ duckhunt `login`. Every OAuth endpoint has to be on the platform's own origin, the platform has to
546
+ serve HTTPS (plain HTTP only on localhost, for development) and support PKCE `S256`; otherwise
547
+ nothing is sent. Without a value, `--as` derives the id from the platform's host. `duckhunt` and
548
+ `local` are reserved. Logging in again with the same id and the same platform renews the credential
549
+ and keeps everything you set for it; an id already used by another platform is refused.
550
+
551
+ A platform without a discovery document can only be added with `--trusted`: it then speaks the
552
+ duckhunt protocol, in which this machine cannot apply your limits (see below).
553
+
554
+ A new platform starts with nothing exposed, one slot and the lowest ceiling: no shell, no edits, no
555
+ memory, no web, no push and no access to any resource. It can still call its own MCP tools
556
+ (`platformTools: "*"`), which only ever reach that platform. To let it work on a repo, expose the key
557
+ *and* give the type an `access` level in its ceiling, by editing the config file (example below). A
558
+ running daemon picks it up within a few seconds.
559
+
560
+ | Command | What it does |
561
+ | --- | --- |
562
+ | `platforms list` | Every platform with its protocol, server, whether it is trusted, paused, its slots and what it can see. Never contacts a server. |
563
+ | `platforms pause\|resume <id>` | Stop or resume claiming; runs in progress finish. |
564
+ | `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. |
565
+ | `platforms trust\|untrust <id>` | Whether it may get a full shell (see below). `untrust` lowers a full-shell ceiling to the read-only shell. |
566
+ | `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. |
567
+ | `logout <id>` | Unpairs it and deletes only its credential. |
568
+
569
+ duckhunt can be paused and its exposure edited (by default it sees every repo and AWS key, as
570
+ before, but no browser session until you run `platforms expose duckhunt browser <key>`), but not
571
+ removed or untrusted: `logout` unpairs it. `local` is the platform behind `runner run` (see
572
+ [Local runs](#local-runs-runner-run-0130-or-later)): it exists without an entry, is trusted, has the
573
+ whole ceiling and sees nothing until you expose it.
574
+
575
+ ### What a platform may do
576
+
577
+ What a run can do is what the platform asks for, intersected with the ceiling you set for that
578
+ platform in the config file:
579
+
580
+ ```json
581
+ {
582
+ "platforms": {
583
+ "acme": {
584
+ "expose": { "repo": ["acme/api"] },
585
+ "ceiling": { "shell": "read", "fsWrite": false, "memory": false, "web": true, "vcsPush": false, "access": { "repo": "read" }, "platformTools": "*" },
586
+ "slots": 1,
587
+ "runsPerDay": 20
588
+ }
589
+ }
590
+ }
591
+ ```
592
+
593
+ For an `agent-runner/0` platform, this daemon enforces it. It builds the Claude tool lists itself from
594
+ the platform's request cut down to the ceiling, never from lists the platform sends, and a `read`
595
+ run never edits or gets a full shell. A resource is only materialized when the platform asks for it,
596
+ you exposed that key to it, and its type has an `access` level in the ceiling. A run without an AWS
597
+ grant gets an empty AWS config. A claim that asks for an unknown resource type, a key you did not
598
+ expose, a type the ceiling does not allow, or a policy field this daemon does not know is refused and
599
+ reported as failed, with a code and no paths. Its MCP servers have to be on the platform's own
600
+ origin, so a platform cannot point a run at another host or at a service on your machine.
601
+
602
+ `shell: "full"` is only allowed for platforms you marked `trusted` (`login --trusted` or
603
+ `platforms trust`); the config is invalid otherwise. A second platform that speaks the duckhunt
604
+ protocol only runs when trusted, because on that protocol the ceiling cannot be applied.
605
+
606
+ **Quotas.** `slots` (1 by default) caps its runs within `defaults.maxConcurrent`. `budgetUsdPerDay`
607
+ and `runsPerDay` cap a local day, counted from the [audit](#status-and-audit); once reached, the
608
+ platform stops claiming until midnight while the others carry on. On a Claude subscription the cost
609
+ is the one Claude reports, not what you are billed.
610
+
611
+ **Identity.** Each platform other than duckhunt is announced a machine id derived from a secret
612
+ stored in the config file (`machineSecret`) and the platform's address, so two platforms cannot tell
613
+ they share a machine by its id. duckhunt keeps its id. `label` under a platform overrides the label it
614
+ sees.
615
+
616
+ ### Isolation between platforms
617
+
618
+ Kept apart: credentials (each refresh writes only its own), run configs with their tokens, scratch
619
+ directories, worktrees, logs, `server-state.json` and audit files. Every run's `Read` deny covers the
620
+ other platforms' state.
621
+
622
+ Not kept apart:
623
+
624
+ - A full shell. `Read` denies do not bind `Bash`, so an `edit` run can read this config file, which
625
+ holds every platform's refresh token, and the tokens of runs in other slots. Only give
626
+ `shell: "full"` to platforms you trust; that is what the `trusted` flag is for.
627
+ - Claude's native memory is stored by directory, so runs of different platforms in the same repo, and
628
+ your own sessions there, share it. Leave `memory` off in a ceiling to keep a platform out of it.
629
+ - A platform can notice the machine is busy when its claims stop being served, though not by whom.
630
+
631
+ ### Status and audit
632
+
633
+ `status --platforms` shows each platform: protocol, credential, local state (active, paused, out of
634
+ its daily quota…), what its server last said and when, quota use, a summary of its ceiling, what it
635
+ can see with the health of those repos, and its audit for the last 24 hours. Like `status`, it never
636
+ contacts a server; plain `status` prints what it always did.
637
+
638
+ The daemon keeps an audit of every platform's runs, duckhunt's included, in
639
+ `~/.duckhunt-runner/audit/<id>/YYYY-MM.jsonl` (files `0600`): one line when a run is claimed, one when
640
+ a claim is refused (with its code) and one when each step closes. It records ids, times, resource
641
+ keys and access levels, MCP server names, the model, tool names with their counts, cost, the outcome
642
+ and a SHA-256 of the prompt. It never records the prompt, results, tool arguments, paths or tokens.
643
+ A month's file is deleted once that month ended more than `defaults.auditRetentionDays` (180) ago,
644
+ and each platform keeps at most 50 MB, oldest months first, never the current one.
645
+ `audit [--platform <id>] [--since 7d|<date>] [--json]` prints it (the last 7 days by default).
646
+
647
+ ### Tool lists built by the daemon (0.13.0 or later)
648
+
649
+ 0.13.0 announces `toolset_v1` and `toolset_render`. duckhunt then sends each run's permissions in the
650
+ platform-neutral form next to its usual tool lists, and the daemon launches the run with the lists it
651
+ builds itself, capped by duckhunt's ceiling. The run's resources (its repo, its AWS key, a browser
652
+ session) come from the grants in that form, so a key you did not expose to duckhunt is refused rather
653
+ than used. Worktree paths do not change.
654
+
655
+ The daemon still compares its lists with duckhunt's and reports in each step's status whether they
656
+ match; duckhunt logs only a difference the daemon cannot explain. With
657
+ `"defaults": { "toolsetRender": false }` it launches with duckhunt's lists again and only compares
658
+ (see [Upgrading to 0.13.0](#upgrading-to-0130)).
659
+
660
+ ## Browser sessions (0.13.0 or later)
661
+
662
+ A run can browse with a session you logged into yourself, such as your Jira or an admin console, without
663
+ the agent ever seeing your password. The browser is [odysea](https://github.com/miermontoto/odysea), an
664
+ MCP server installed separately (0.5.1 or later): the daemon finds it on `PATH` or at
665
+ `providers.browser.bin`, and launches it as its own process for each run. It never loads a browser
666
+ itself.
667
+
668
+ On npm it is `@miermontoto/odysea` (the unscoped `odysea` package is an unrelated project). Set
669
+ `providers.browser.bin` to the installed binary's absolute path, so the daemon never depends on what
670
+ `PATH` resolves:
671
+
672
+ ```sh
673
+ npm i -g @miermontoto/odysea
674
+ ```
675
+
676
+ Before using a binary, the daemon asks it for its identity (`odysea --identify`) and only accepts
677
+ `@miermontoto/odysea` 0.5.1 or later; anything else counts as odysea missing. That keeps an unrelated
678
+ program called `odysea` from being handed a copy of your session by accident. It is not protection
679
+ against a binary made to impersonate it: whatever is on your `PATH` already runs as you.
680
+
681
+ ```sh
682
+ duckhunt-runner browser login jira https://acme.atlassian.net --origin https://acme.atlassian.net --origin https://id.atlassian.com
683
+ duckhunt-runner platforms expose duckhunt browser jira
684
+ ```
685
+
686
+ | Command | What it does |
687
+ | --- | --- |
688
+ | `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. |
689
+ | `browser list` | Each session with its origins and health. |
690
+ | `browser check [key]` | Health, running each session's probe now (see below). Exits 1 if one is unusable. |
691
+ | `browser remove <key> [--purge]` | Removes the entry. `--purge` also deletes the saved session, unless another key uses it. |
692
+
693
+ **Origins** (`scheme://host[:port]`, `*.` for any subdomain, never a wildcard on fewer than two
694
+ labels) are the only part of the session a run gets: list the sign-in host too when the site logs you
695
+ in through another domain, or the session will look expired. **`--exclusive`** makes runs take turns on
696
+ the session and write back what they change (a site that rotates its token keeps working).
697
+ **`--probe-url`** is a page that tells whether you are still logged in (a redirect matching
698
+ `--login-pattern`, or a 401/403). The daemon checks each session every 10 minutes from the saved file
699
+ alone, and runs its probe at most once a day, since that opens a browser.
700
+
701
+ No platform sees a session until you expose it (`platforms expose <id> browser <key>`). duckhunt then
702
+ offers it in the composer, next to the model, where you choose what the run may do, and shows each
703
+ machine's sessions with their health under Settings → Agents → Machines. It only sends a run with a
704
+ session to a machine that has odysea and builds the tool lists itself (see
705
+ [Tool lists](#tool-lists-built-by-the-daemon-0130-or-later)).
706
+
707
+ | Access | Browser tools |
708
+ | --- | --- |
709
+ | `read` | `navigate`, `reload`, `back`, `tabs`, `resize`, `scroll`, `hover`, `wait_for`, `screenshot`, `dom_snapshot`, `dom_query`, `console_messages`, `network_requests` |
710
+ | `interact` | also `click`, `fill`, `press_key`, `select_option`, `handle_dialog` |
711
+ | `full` | also `evaluate` and `network_details` (request headers, cookies included) |
712
+
713
+ The `session` tool is never allowed. duckhunt gives a `read` conversation `read` (or `interact`, if you
714
+ turn that on in Settings → Agents, which asks you to confirm your identity) and never `full`.
715
+
716
+ **What a run gets.** Its own MCP server, `res_browser_<key>`, with a copy of the session filtered by
717
+ the daemon to the session's origins: cookies of those hosts (and parent-domain cookies they need),
718
+ their local storage and IndexedDB, no expired cookies. The copy lives in the run's private config
719
+ directory and is deleted when the step ends. An exclusive session writes back only what changed on
720
+ its origins, never anything the run collected from other sites, and never when the run was aborted
721
+ before it started. A session that is missing, unreadable, expired or logged out fails the run before
722
+ it launches, with the reason and no paths. A key this machine does not map, or a machine without
723
+ odysea, runs without a browser and says so in the feed. A run waiting for an exclusive session says
724
+ so too.
725
+
726
+ **Limits.**
727
+
728
+ - odysea's navigation allowlist covers the pages a run opens, not the requests a page makes, so
729
+ cookies from other sites can land in a run's copy. They are never written back.
730
+ - Every run's `Read` deny covers the vault, but `Read` denies do not bind `Bash`: an `edit` run's
731
+ shell can read every saved session. Only give a full shell to platforms you trust.
732
+ - A session's cookies are as good as your login while they last. Expose a session only to the
733
+ platforms you would hand that login to, and pick the lowest access that does the job.
734
+
735
+ ## Local runs: `runner run` (0.13.0 or later)
736
+
737
+ `run` starts an agent on this machine with no server: you are the platform (`local`), and the answer
738
+ goes to stdout, so `$(duckhunt-runner run …)` captures it while the feed goes to stderr.
739
+
740
+ ```sh
741
+ duckhunt-runner platforms expose local repo acme/api
742
+ duckhunt-runner run --repo acme/api "why does the nightly import fail?"
743
+ ```
744
+
745
+ | Flag | Effect |
746
+ | --- | --- |
747
+ | `--repo <ws/slug> [--branch <branch>]` | Works in a worktree of that mapped repo. |
748
+ | `--profile read\|edit` | `read` (default): read-only shell, no edits, memory and web. `edit`: full shell and edits. |
749
+ | `--push` | Allows `git push`. |
750
+ | `--grant <type:key[:access]>` | Adds a resource, such as `--grant browser:jira:interact` or `--grant aws:123456789012`. `read` by default. |
751
+ | `--model <model>` | The model for the run. |
752
+ | `--yes` | Accepts the escalation without asking. |
753
+ | `--json` | NDJSON on stdout of the conversation's messages instead (claim, event, question, result). Never prompts. |
754
+ | `--wait <duration>` | Gives up if no slot frees within it (`30s`, `5m`, `1h`). Without it, waits. |
755
+ | `--resume <conversation> "<answer>"` | Answers a question and continues. Policy flags do not apply to a resume. |
756
+
757
+ It goes through the same checks as any platform: a key you did not expose to `local`, or a request
758
+ its ceiling would cut, is refused before launch and names the fix. Anything above `read` (full shell,
759
+ edits, push, an `interact` or `full` grant) is listed and asked on the terminal; without a terminal it
760
+ needs `--yes` **and** `"unattendedEscalation": true` under `platforms.local`, so a cron line cannot
761
+ quietly run an edit.
762
+
763
+ The agent answers with a `reply` tool and asks with `ask_user`, served by a small MCP server on
764
+ `127.0.0.1` for that run only. On a terminal you answer inline; otherwise `run` prints the question and
765
+ exits 3, and `--resume` continues the conversation.
766
+
767
+ | Exit | Meaning |
768
+ | --- | --- |
769
+ | 0 | done |
770
+ | 1 | failed |
771
+ | 2 | the agent replied with a blocker |
772
+ | 3 | waiting for your answer |
773
+ | 64 | usage error |
774
+ | 75 | no free slot within `--wait`, or the daemon lock is held by something `run` cannot talk to |
775
+ | 77 | refused by the ceiling, the exposure or consent |
776
+ | 130 / 143 | interrupted (`ctrl-c` cancels the run within one heartbeat; a second one exits at once) |
777
+
778
+ With the daemon running, `run` hands the run to it over `~/.duckhunt-runner/sockets/local.sock`
779
+ (`0600`), so local runs share its slots, its git locks and its audit. Without one, `run` holds the daemon
780
+ lock while it works and `start` refuses to start meanwhile. Conversations live in
781
+ `~/.duckhunt-runner/platforms/local/`, so one can be resumed from either.
782
+
393
783
  ## Licence
394
784
 
395
785
  Copyright © 2026 miermontoto.
@@ -0,0 +1,12 @@
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
+ toolsetRender?: boolean;
8
+ browser?: boolean;
9
+ }
10
+ /** capacidades del claim: prompt (y lo que va con él) solo si el cli puede cumplir su perfil, model solo con --model. */
11
+ export declare function announcedCapabilities(kit: MachineKit): RunnerCapability[];
12
+ //# 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;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"}
@@ -0,0 +1,33 @@
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
+ // 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] : []),
31
+ ];
32
+ }
33
+ //# 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;AAgBzD,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;QAClE,iHAAiH;QACjH,iBAAiB,CAAC,SAAS;QAC3B,kHAAkH;QAClH,GAAG,CAAC,GAAG,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzE,kHAAkH;QAClH,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAC;AACJ,CAAC"}