@parcha/agentrun-serve 0.1.0-beta.36 → 0.1.0-beta.38

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 (568) hide show
  1. package/CHANGELOG.md +452 -0
  2. package/README.md +311 -142
  3. package/dist/agent-rows.d.ts +1 -1
  4. package/dist/agents-store.d.ts +35 -3
  5. package/dist/agents-store.js +39 -14
  6. package/dist/answer-json.d.ts +34 -1
  7. package/dist/answer-json.js +91 -9
  8. package/dist/api-only.d.ts +1 -1
  9. package/dist/api-only.js +2 -2
  10. package/dist/attach-conformance-cli.d.ts +1 -0
  11. package/dist/attach-conformance-cli.js +18 -0
  12. package/dist/attach-conformance.d.ts +25 -0
  13. package/dist/attach-conformance.js +343 -0
  14. package/dist/browser-cost.d.ts +1 -1
  15. package/dist/browser-cost.js +52 -93
  16. package/dist/browser-live.d.ts +20 -8
  17. package/dist/browser-live.js +50 -27
  18. package/dist/cap.d.ts +0 -407
  19. package/dist/cap.js +4 -1028
  20. package/dist/catalog.d.ts +1 -12
  21. package/dist/catalog.js +4 -34
  22. package/dist/cli.js +13 -4
  23. package/dist/composio-preset.d.ts +53 -0
  24. package/dist/composio-preset.js +221 -0
  25. package/dist/computer-attach.d.ts +125 -0
  26. package/dist/computer-attach.js +330 -0
  27. package/dist/computer-calls.d.ts +60 -0
  28. package/dist/computer-calls.js +209 -0
  29. package/dist/computer-channel.d.ts +57 -0
  30. package/dist/computer-channel.js +115 -0
  31. package/dist/computer-commands.d.ts +1 -1
  32. package/dist/computer-held-routes.d.ts +35 -0
  33. package/dist/computer-held-routes.js +106 -0
  34. package/dist/computer-held.d.ts +48 -0
  35. package/dist/computer-held.js +87 -0
  36. package/dist/computer-keys.d.ts +21 -1
  37. package/dist/computer-keys.js +53 -11
  38. package/dist/computer-live.d.ts +165 -0
  39. package/dist/computer-live.js +655 -0
  40. package/dist/computer-setting.d.ts +15 -2
  41. package/dist/computer-setting.js +20 -4
  42. package/dist/computer-view.d.ts +14 -0
  43. package/dist/computer-view.js +51 -3
  44. package/dist/computer-viewer.d.ts +6 -0
  45. package/dist/computer-viewer.js +311 -0
  46. package/dist/computers.d.ts +37 -8
  47. package/dist/computers.js +62 -14
  48. package/dist/console/assets/index-CjqQirbo.css +1 -0
  49. package/dist/console/assets/index-b6-XY5A9.js +576 -0
  50. package/dist/console/index.html +2 -2
  51. package/dist/console-links.d.ts +2 -0
  52. package/dist/console-links.js +3 -0
  53. package/dist/decisions.js +4 -0
  54. package/dist/faux-computers.d.ts +9 -20
  55. package/dist/faux-computers.js +56 -26
  56. package/dist/github-connection.d.ts +10 -2
  57. package/dist/github-connection.js +65 -2
  58. package/dist/github-faux.js +1 -1
  59. package/dist/graph-view.d.ts +1 -1
  60. package/dist/harness-opencode/adapter.js +7 -3
  61. package/dist/harness-opencode/facts.js +0 -2
  62. package/dist/harness-opencode/host/policy.d.ts +2 -5
  63. package/dist/harness-opencode/host/policy.js +8 -32
  64. package/dist/harness-table.d.ts +0 -2
  65. package/dist/harness-table.js +0 -2
  66. package/dist/harness.d.ts +1 -0
  67. package/dist/harness.js +35 -1
  68. package/dist/host-tools.d.ts +2 -6
  69. package/dist/host-tools.js +7 -10
  70. package/dist/hosted-search.d.ts +5 -6
  71. package/dist/hosted-search.js +2 -28
  72. package/dist/import-sources.d.ts +10 -0
  73. package/dist/import-sources.js +44 -2
  74. package/dist/import.d.ts +3 -3
  75. package/dist/import.js +37 -6
  76. package/dist/key-words.d.ts +3 -2
  77. package/dist/key-words.js +4 -2
  78. package/dist/learn/check.d.ts +10 -2
  79. package/dist/learn/check.js +13 -5
  80. package/dist/learn/commit.d.ts +14 -2
  81. package/dist/learn/commit.js +23 -9
  82. package/dist/learn/compile.d.ts +243 -0
  83. package/dist/learn/compile.js +471 -0
  84. package/dist/learn/folder.d.ts +6 -0
  85. package/dist/learn/folder.js +4 -1
  86. package/dist/learn/general.d.ts +69 -0
  87. package/dist/learn/general.js +75 -0
  88. package/dist/learn/grade.d.ts +5 -1
  89. package/dist/learn/grade.js +29 -7
  90. package/dist/learn/notes.d.ts +8 -0
  91. package/dist/learn/notes.js +18 -0
  92. package/dist/learn/promote.d.ts +253 -0
  93. package/dist/learn/promote.js +428 -0
  94. package/dist/learn/refit.d.ts +39 -0
  95. package/dist/learn/refit.js +236 -0
  96. package/dist/learn/reflect.d.ts +9 -20
  97. package/dist/learn/reflect.js +18 -125
  98. package/dist/learn/replay-calls.d.ts +63 -0
  99. package/dist/learn/replay-calls.js +158 -0
  100. package/dist/learn/skills.d.ts +50 -14
  101. package/dist/learn/skills.js +183 -47
  102. package/dist/learn/workflow-nodes.d.ts +15 -0
  103. package/dist/learn/workflow-nodes.js +44 -0
  104. package/dist/learned-nodes.d.ts +50 -2
  105. package/dist/learned-nodes.js +41 -2
  106. package/dist/learned-workflow.d.ts +43 -3
  107. package/dist/learned-workflow.js +170 -28
  108. package/dist/learning-batch.d.ts +283 -0
  109. package/dist/learning-batch.js +574 -0
  110. package/dist/learning-cost.d.ts +18 -6
  111. package/dist/learning-cost.js +15 -7
  112. package/dist/learning-evals.d.ts +33 -0
  113. package/dist/learning-evals.js +98 -0
  114. package/dist/learning-routes.d.ts +37 -2
  115. package/dist/learning-routes.js +52 -8
  116. package/dist/learning-words.d.ts +13 -0
  117. package/dist/learning-words.js +13 -0
  118. package/dist/learning.d.ts +55 -17
  119. package/dist/learning.js +91 -48
  120. package/dist/live/stream.js +6 -3
  121. package/dist/live/translate.d.ts +4 -3
  122. package/dist/live/translate.js +8 -4
  123. package/dist/live-reach.d.ts +37 -0
  124. package/dist/live-reach.js +62 -0
  125. package/dist/llm.js +0 -3
  126. package/dist/mcp-gateway.d.ts +21 -20
  127. package/dist/mcp-gateway.js +76 -55
  128. package/dist/mcp-oauth.d.ts +62 -7
  129. package/dist/mcp-oauth.js +134 -19
  130. package/dist/mcp-pin-first.d.ts +37 -0
  131. package/dist/mcp-pin-first.js +107 -0
  132. package/dist/mcp-private-hosts.d.ts +4 -4
  133. package/dist/mcp-private-hosts.js +20 -12
  134. package/dist/mcp-probe.d.ts +27 -11
  135. package/dist/mcp-probe.js +60 -42
  136. package/dist/mcp-secret-writes.js +4 -0
  137. package/dist/mcp-servers-store.d.ts +115 -25
  138. package/dist/mcp-servers-store.js +241 -43
  139. package/dist/mcp-sources.d.ts +39 -0
  140. package/dist/mcp-sources.js +74 -0
  141. package/dist/mcp-store.d.ts +21 -4
  142. package/dist/mcp-store.js +33 -8
  143. package/dist/mcp-wire.d.ts +22 -0
  144. package/dist/mcp-wire.js +36 -0
  145. package/dist/mcp.js +3 -3
  146. package/dist/meta-tool-names.d.ts +1 -0
  147. package/dist/meta-tool-names.js +3 -0
  148. package/dist/model-form.d.ts +26 -0
  149. package/dist/model-form.js +80 -0
  150. package/dist/model.d.ts +13 -0
  151. package/dist/model.js +69 -25
  152. package/dist/monid.d.ts +51 -25
  153. package/dist/monid.js +226 -140
  154. package/dist/openapi.js +694 -59
  155. package/dist/page.d.ts +18 -0
  156. package/dist/page.js +48 -20
  157. package/dist/paid-calls.d.ts +26 -29
  158. package/dist/paid-calls.js +46 -102
  159. package/dist/place-offers.d.ts +2 -3
  160. package/dist/place-offers.js +3 -7
  161. package/dist/place.js +1 -2
  162. package/dist/print.d.ts +15 -1
  163. package/dist/print.js +14 -3
  164. package/dist/propose.d.ts +10 -1
  165. package/dist/propose.js +30 -10
  166. package/dist/provider.js +12 -4
  167. package/dist/reflect-range.d.ts +8 -1
  168. package/dist/reflect-range.js +3 -2
  169. package/dist/rows.d.ts +5 -3
  170. package/dist/rows.js +15 -4
  171. package/dist/run-launch.d.ts +27 -2
  172. package/dist/run-launch.js +15 -4
  173. package/dist/run-learning-served.d.ts +13 -2
  174. package/dist/run-manifest.d.ts +5 -0
  175. package/dist/run-manifest.js +20 -0
  176. package/dist/run-reads-over-store.d.ts +1 -1
  177. package/dist/run-repo.d.ts +20 -0
  178. package/dist/run-repo.js +63 -0
  179. package/dist/run-secrets.js +2 -3
  180. package/dist/run-timeline-served.d.ts +1 -1
  181. package/dist/run-timeline-served.js +5 -2
  182. package/dist/run-view.d.ts +19 -8
  183. package/dist/run-view.js +62 -26
  184. package/dist/runnable.d.ts +0 -3
  185. package/dist/runnable.js +37 -29
  186. package/dist/runner/adapter-loop.d.ts +47 -17
  187. package/dist/runner/adapter-loop.js +1427 -303
  188. package/dist/runner/adapter-run-spec.d.ts +23 -9
  189. package/dist/runner/adapter-run-spec.js +162 -56
  190. package/dist/runner/adapters/pi-computer.d.ts +9 -0
  191. package/dist/runner/adapters/pi-computer.js +51 -0
  192. package/dist/runner/adapters/pi.d.ts +25 -11
  193. package/dist/runner/adapters/pi.js +168 -45
  194. package/dist/runner/beside.d.ts +7 -3
  195. package/dist/runner/beside.js +21 -11
  196. package/dist/runner/claim-secrets.d.ts +4 -0
  197. package/dist/runner/claim-secrets.js +6 -1
  198. package/dist/runner/cli-run-spec.d.ts +20 -3
  199. package/dist/runner/cli-run-spec.js +174 -64
  200. package/dist/runner/commands.d.ts +3 -1
  201. package/dist/runner/commands.js +28 -3
  202. package/dist/runner/computer-channel.d.ts +34 -0
  203. package/dist/runner/computer-channel.js +62 -0
  204. package/dist/runner/conformance/harness.d.ts +3 -0
  205. package/dist/runner/conformance/harness.js +224 -17
  206. package/dist/runner/conformance/subject.d.ts +12 -5
  207. package/dist/runner/dispatch.js +3 -0
  208. package/dist/runner/end-of-run.d.ts +23 -12
  209. package/dist/runner/end-of-run.js +41 -16
  210. package/dist/runner/feedback-round.d.ts +52 -0
  211. package/dist/runner/feedback-round.js +79 -0
  212. package/dist/runner/github-app.d.ts +2 -1
  213. package/dist/runner/github-app.js +4 -2
  214. package/dist/runner/harness-loops.js +15 -1
  215. package/dist/runner/held-run.d.ts +65 -0
  216. package/dist/runner/held-run.js +158 -0
  217. package/dist/runner/journal-kinds.d.ts +44 -7
  218. package/dist/runner/journal-kinds.js +29 -0
  219. package/dist/runner/journal-reader.d.ts +5 -4
  220. package/dist/runner/journal-reader.js +12 -10
  221. package/dist/runner/learning-ask.d.ts +7 -1
  222. package/dist/runner/learning-ask.js +21 -6
  223. package/dist/runner/learning-dispatch.d.ts +22 -0
  224. package/dist/runner/learning-dispatch.js +77 -10
  225. package/dist/runner/learning-end.d.ts +69 -13
  226. package/dist/runner/learning-end.js +340 -87
  227. package/dist/runner/learning-factory.d.ts +1 -1
  228. package/dist/runner/learning-factory.js +11 -5
  229. package/dist/runner/learning-loop.d.ts +86 -8
  230. package/dist/runner/learning-loop.js +178 -23
  231. package/dist/runner/learning-seed.d.ts +11 -0
  232. package/dist/runner/learning-seed.js +27 -0
  233. package/dist/runner/live-ticker.js +1 -0
  234. package/dist/runner/loop-contract.d.ts +26 -3
  235. package/dist/runner/loop.d.ts +21 -2
  236. package/dist/runner/loop.js +23 -2
  237. package/dist/runner/main.d.ts +13 -1
  238. package/dist/runner/main.js +27 -5
  239. package/dist/runner/mcp-claim.d.ts +15 -8
  240. package/dist/runner/mcp-claim.js +176 -71
  241. package/dist/runner/mcp-github.js +1 -1
  242. package/dist/runner/mcp-run.d.ts +21 -57
  243. package/dist/runner/mcp-run.js +25 -85
  244. package/dist/runner/meta-tools.d.ts +37 -0
  245. package/dist/runner/meta-tools.js +268 -0
  246. package/dist/runner/metrics.d.ts +11 -2
  247. package/dist/runner/metrics.js +26 -5
  248. package/dist/runner/model-route.js +12 -3
  249. package/dist/runner/monid-run.d.ts +16 -0
  250. package/dist/runner/monid-run.js +96 -0
  251. package/dist/runner/pr-checkout.d.ts +1 -0
  252. package/dist/runner/pr-checkout.js +1 -1
  253. package/dist/runner/promotion.d.ts +80 -0
  254. package/dist/runner/promotion.js +562 -0
  255. package/dist/runner/reflect-hook.d.ts +46 -13
  256. package/dist/runner/reflect-hook.js +149 -48
  257. package/dist/runner/runner.d.ts +26 -0
  258. package/dist/runner/runner.js +208 -17
  259. package/dist/runner/scratch-sweep.d.ts +13 -0
  260. package/dist/runner/scratch-sweep.js +62 -0
  261. package/dist/runner/sessions.d.ts +9 -4
  262. package/dist/runner/sessions.js +5 -1
  263. package/dist/runner/step-guard.d.ts +62 -0
  264. package/dist/runner/step-guard.js +93 -0
  265. package/dist/runner/store-port.d.ts +4 -2
  266. package/dist/runner/store-secrets.js +4 -3
  267. package/dist/runner/subagent.d.ts +0 -3
  268. package/dist/runner/subagent.js +10 -13
  269. package/dist/runner/workflow-first.d.ts +216 -0
  270. package/dist/runner/workflow-first.js +303 -0
  271. package/dist/runner/workflow-host.d.ts +6 -1
  272. package/dist/runner/workflow-host.js +1 -1
  273. package/dist/runner/workflow-loop.d.ts +1 -1
  274. package/dist/runner/workflow-loop.js +17 -10
  275. package/dist/runner/workflow-spec.d.ts +15 -2
  276. package/dist/runner/workflow-spec.js +63 -23
  277. package/dist/runs-over-store.d.ts +17 -3
  278. package/dist/runs-over-store.js +59 -20
  279. package/dist/seal-key.js +3 -3
  280. package/dist/sealed-settings-store.d.ts +5 -2
  281. package/dist/sealed-settings-store.js +10 -4
  282. package/dist/secret-writes.d.ts +5 -4
  283. package/dist/secret-writes.js +5 -4
  284. package/dist/server-secrets-store.d.ts +4 -3
  285. package/dist/server-secrets-store.js +15 -9
  286. package/dist/server-secrets.js +3 -2
  287. package/dist/server.d.ts +119 -18
  288. package/dist/server.js +841 -202
  289. package/dist/settings-wake.d.ts +23 -0
  290. package/dist/settings-wake.js +65 -0
  291. package/dist/standard-webhooks.d.ts +4 -1
  292. package/dist/standard-webhooks.js +8 -4
  293. package/dist/store/agent-body.d.ts +14 -3
  294. package/dist/store/agent-body.js +14 -10
  295. package/dist/store/command-wake.d.ts +13 -0
  296. package/dist/store/command-wake.js +37 -0
  297. package/dist/store/dialect.d.ts +6 -0
  298. package/dist/store/dialect.js +5 -0
  299. package/dist/store/index.d.ts +1 -1
  300. package/dist/store/journal/storage.d.ts +3 -2
  301. package/dist/store/journal/storage.js +13 -5
  302. package/dist/store/postgres/connection.js +3 -1
  303. package/dist/store/postgres/dialect.js +4 -0
  304. package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
  305. package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
  306. package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
  307. package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
  308. package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
  309. package/dist/store/postgres/migrations/0010_imported_templates.sql +18 -0
  310. package/dist/store/postgres/migrations/0011_revision_mcp_pin.sql +13 -0
  311. package/dist/store/schema.d.ts +10 -1
  312. package/dist/store/schema.js +104 -15
  313. package/dist/store/sqlite/connection.d.ts +2 -2
  314. package/dist/store/sqlite/connection.js +2 -2
  315. package/dist/store/sqlite/run-patch.d.ts +7 -5
  316. package/dist/store/sqlite/run-patch.js +45 -18
  317. package/dist/store/sqlite/store.js +331 -72
  318. package/dist/store/store.d.ts +312 -21
  319. package/dist/store/store.js +12 -1
  320. package/dist/store-reads/cap.d.ts +1 -1
  321. package/dist/store-reads/cap.js +8 -1
  322. package/dist/store-reads/decisions.d.ts +2 -2
  323. package/dist/store-reads/decisions.js +1 -1
  324. package/dist/store-reads/import-summary.d.ts +1 -1
  325. package/dist/store-reads/journal.d.ts +30 -5
  326. package/dist/store-reads/journal.js +128 -56
  327. package/dist/store-reads/learning.d.ts +114 -12
  328. package/dist/store-reads/learning.js +238 -48
  329. package/dist/store-reads/loop.d.ts +61 -0
  330. package/dist/store-reads/loop.js +111 -0
  331. package/dist/store-reads/runs.d.ts +1 -1
  332. package/dist/store-reads/workflow.d.ts +1 -1
  333. package/dist/store-view.d.ts +6 -0
  334. package/dist/store-view.js +59 -26
  335. package/dist/template-eval.d.ts +18 -9
  336. package/dist/template-eval.js +95 -68
  337. package/dist/template-github-permissions.d.ts +24 -10
  338. package/dist/template-github-permissions.js +36 -15
  339. package/dist/template-import.d.ts +31 -0
  340. package/dist/template-import.js +121 -0
  341. package/dist/template-source.d.ts +51 -0
  342. package/dist/template-source.js +371 -0
  343. package/dist/templates.d.ts +218 -46
  344. package/dist/templates.js +493 -181
  345. package/dist/timeline/computer.d.ts +48 -0
  346. package/dist/timeline/computer.js +169 -0
  347. package/dist/timeline/index.d.ts +4 -3
  348. package/dist/timeline/index.js +4 -3
  349. package/dist/timeline/labels.d.ts +6 -2
  350. package/dist/timeline/labels.js +93 -2
  351. package/dist/timeline/origin.d.ts +19 -5
  352. package/dist/timeline/origin.js +11 -4
  353. package/dist/timeline/timeline.d.ts +22 -1
  354. package/dist/timeline/timeline.js +34 -18
  355. package/dist/timeline/util.d.ts +4 -0
  356. package/dist/timeline/util.js +14 -0
  357. package/dist/tool-gate.d.ts +84 -50
  358. package/dist/tool-gate.js +179 -101
  359. package/dist/tool-keys.d.ts +4 -1
  360. package/dist/tool-keys.js +8 -3
  361. package/dist/tool-list.d.ts +26 -0
  362. package/dist/tool-list.js +43 -0
  363. package/dist/tool-names.d.ts +71 -0
  364. package/dist/tool-names.js +99 -0
  365. package/dist/tool-plane.d.ts +33 -27
  366. package/dist/tool-plane.js +72 -39
  367. package/dist/tools.d.ts +32 -7
  368. package/dist/tools.js +37 -24
  369. package/dist/trigger-adapter.d.ts +4 -0
  370. package/dist/trigger-secrets-shown.d.ts +2 -2
  371. package/dist/trigger-secrets-shown.js +1 -1
  372. package/dist/trigger-signatures.d.ts +25 -6
  373. package/dist/trigger-signatures.js +41 -7
  374. package/dist/trigger-targets.d.ts +2 -0
  375. package/dist/trigger-targets.js +1 -0
  376. package/dist/trigger-webhook.js +5 -2
  377. package/dist/triggers.d.ts +7 -3
  378. package/dist/triggers.js +35 -5
  379. package/dist/turns.js +16 -1
  380. package/dist/validate.d.ts +15 -7
  381. package/dist/validate.js +102 -45
  382. package/dist/web-fetch.d.ts +2 -8
  383. package/dist/web-fetch.js +2 -22
  384. package/dist/web-search.d.ts +10 -5
  385. package/dist/web-search.js +7 -6
  386. package/dist/webhooks.d.ts +145 -102
  387. package/dist/webhooks.js +559 -322
  388. package/dist/workflow/decisions.d.ts +1 -1
  389. package/dist/workflow/node-runner.d.ts +2 -1
  390. package/dist/workflow/node.d.ts +2 -1
  391. package/dist/workflow/node.js +3 -1
  392. package/dist/workflow/pi-versions.d.ts +23 -0
  393. package/dist/workflow/pi-versions.js +57 -0
  394. package/dist/workflow/record-tool.d.ts +2 -1
  395. package/dist/workflow/store.d.ts +1 -1
  396. package/dist/workflow/task.js +3 -2
  397. package/dist/workflow-run.d.ts +1 -1
  398. package/dist/workspace/attached-computers.d.ts +41 -0
  399. package/dist/workspace/attached-computers.js +114 -0
  400. package/dist/workspace/computer-deps.d.ts +19 -9
  401. package/dist/workspace/computer-deps.js +24 -9
  402. package/dist/workspace/computer-for-claim.d.ts +23 -8
  403. package/dist/workspace/computer-for-claim.js +92 -33
  404. package/dist/workspace/computer-hold.d.ts +11 -27
  405. package/dist/workspace/computer-hold.js +41 -55
  406. package/dist/workspace/computer-ledger.d.ts +3 -1
  407. package/dist/workspace/computer-ledger.js +4 -0
  408. package/dist/workspace/computer-mcp.d.ts +25 -0
  409. package/dist/workspace/computer-mcp.js +41 -0
  410. package/dist/workspace/computer-ports.d.ts +4 -13
  411. package/dist/workspace/computer-ports.js +4 -107
  412. package/dist/workspace/computer-script.d.ts +53 -0
  413. package/dist/workspace/computer-script.js +172 -0
  414. package/dist/workspace/executors.d.ts +1 -1
  415. package/dist/workspace/index.d.ts +4 -2
  416. package/dist/workspace/index.js +3 -1
  417. package/dist/workspace/kind-skills/desktop/SKILL.md +132 -84
  418. package/dist/workspace/kind-skills/phone/SKILL.md +104 -85
  419. package/dist/workspace/local.js +2 -2
  420. package/dist/workspace/resolve-computer.d.ts +24 -1
  421. package/dist/workspace/resolve-computer.js +40 -16
  422. package/dist/workspace/run-tools.d.ts +56 -21
  423. package/dist/workspace/run-tools.js +55 -34
  424. package/dist/wrap-up.d.ts +21 -0
  425. package/dist/wrap-up.js +21 -0
  426. package/launcher/agentrun-serve +4 -2
  427. package/package.json +19 -16
  428. package/templates/README.md +111 -45
  429. package/templates/code-review/agent.md +30 -14
  430. package/templates/code-review/evals/clean-refactor/case.yaml +2 -1
  431. package/templates/code-review/evals/clean-refactor/graders/head-sha.md +6 -0
  432. package/templates/code-review/evals/injection/case.yaml +2 -1
  433. package/templates/code-review/evals/injection/graders/head-sha.md +6 -0
  434. package/templates/code-review/evals/mentions-defused/case.yaml +2 -2
  435. package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -23
  436. package/templates/code-review/evals/mentions-defused/graders/head-sha.md +6 -0
  437. package/templates/code-review/evals/never-flag/case.yaml +2 -1
  438. package/templates/code-review/evals/never-flag/graders/head-sha.md +6 -0
  439. package/templates/code-review/evals/null-name/case.yaml +2 -1
  440. package/templates/code-review/evals/null-name/graders/head-sha.md +6 -0
  441. package/templates/code-review/evals/off-by-one/case.yaml +2 -1
  442. package/templates/code-review/evals/off-by-one/graders/head-sha.md +6 -0
  443. package/templates/code-review/evals/other-repo/case.yaml +16 -0
  444. package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +130 -0
  445. package/templates/code-review/evals/other-repo/graders/head-sha.md +6 -0
  446. package/templates/code-review/evals/other-repo/graders/no-canary.md +6 -0
  447. package/templates/code-review/evals/other-repo/graders/no-other-repo.md +8 -0
  448. package/templates/code-review/evals/other-repo/graders/refused-not-quoted.md +18 -0
  449. package/templates/code-review/evals/other-repo/prompt.md +10 -0
  450. package/templates/code-review/evals/re-review/case.yaml +2 -1
  451. package/templates/code-review/evals/re-review/graders/head-sha.md +6 -0
  452. package/templates/code-review/evals/re-review-open/case.yaml +2 -1
  453. package/templates/code-review/evals/re-review-open/graders/head-sha.md +6 -0
  454. package/templates/code-review/evals/repo-rule/case.yaml +2 -1
  455. package/templates/code-review/evals/repo-rule/graders/head-sha.md +6 -0
  456. package/templates/code-review/evals/two-defects/case.yaml +2 -1
  457. package/templates/code-review/evals/two-defects/graders/head-sha.md +6 -0
  458. package/templates/code-review/rules/CODEREVIEW.md +1 -1
  459. package/templates/code-review/skills/review/DEEP.md +3 -2
  460. package/templates/code-review/skills/review/REVIEWER.md +3 -2
  461. package/templates/code-review/skills/review/SKILL.md +4 -3
  462. package/templates/code-review/{findings.schema.json → skills/review/findings.schema.json} +1 -0
  463. package/templates/inbound-lead/agent.md +26 -16
  464. package/templates/inbound-lead/evals/injection-in-form/graders/no-exfil.md +16 -0
  465. package/templates/inbound-lead/evals/injection-in-form/prompt.md +2 -2
  466. package/templates/inbound-lead/evals/write-back/case.yaml +2 -6
  467. package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +34 -225
  468. package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +10 -14
  469. package/templates/inbound-lead/evals/write-back/graders/writes-once.md +7 -0
  470. package/templates/inbound-lead/evals/write-back/prompt.md +1 -1
  471. package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +3 -7
  472. package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +34 -225
  473. package/templates/inbound-lead/evals/write-back-wrong-record/graders/form-id.md +17 -0
  474. package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +3 -3
  475. package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +2 -2
  476. package/templates/inbound-lead/skills/lead/SKILL.md +23 -27
  477. package/templates/kyb/agent.md +15 -5
  478. package/templates/kyb/evals/adverse-media/prompt.md +2 -7
  479. package/templates/kyb/evals/canada-active-filed/prompt.md +2 -6
  480. package/templates/kyb/evals/clean-public-company/prompt.md +2 -6
  481. package/templates/kyb/evals/injection-in-page/prompt.md +3 -7
  482. package/templates/kyb/evals/name-collision/prompt.md +2 -6
  483. package/templates/kyb/evals/no-invention/prompt.md +2 -6
  484. package/templates/kyb/evals/opensanctions-on/prompt.md +2 -6
  485. package/templates/kyb/evals/sanctioned-entity/prompt.md +2 -6
  486. package/templates/kyb/kyb.schema.json +8 -7
  487. package/templates/kyb/skills/kyb/SKILL.md +9 -6
  488. package/templates/market-monitor/agent.md +19 -12
  489. package/templates/market-monitor/evals/post-happens/case.yaml +4 -4
  490. package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +13 -9
  491. package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +1 -1
  492. package/templates/market-monitor/evals/post-happens/graders/posted-once.md +3 -3
  493. package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
  494. package/templates/release-notes/agent.md +32 -10
  495. package/templates/release-notes/evals/draft-not-publish/case.yaml +4 -3
  496. package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +29 -51
  497. package/templates/release-notes/evals/every-pr-accounted/case.yaml +2 -1
  498. package/templates/release-notes/evals/issue-write-refused/case.yaml +4 -3
  499. package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +29 -51
  500. package/templates/release-notes/evals/late-arrival/case.yaml +6 -5
  501. package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +29 -51
  502. package/templates/release-notes/evals/learned-style/case.yaml +2 -1
  503. package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +2 -1
  504. package/templates/release-notes/evals/other-repo/case.yaml +24 -0
  505. package/templates/release-notes/evals/other-repo/fixtures/github-mcp.json +907 -0
  506. package/templates/release-notes/evals/other-repo/graders/no-canary.md +7 -0
  507. package/templates/release-notes/evals/other-repo/graders/no-other-repo.md +8 -0
  508. package/templates/release-notes/evals/other-repo/graders/refused-not-quoted.md +18 -0
  509. package/templates/release-notes/evals/other-repo/prompt.md +32 -0
  510. package/templates/release-notes/evals/upgrade-line/case.yaml +2 -1
  511. package/templates/release-notes/evals/user-facing-only/case.yaml +2 -1
  512. package/templates/release-notes/notes.schema.json +1 -1
  513. package/templates/release-notes/skills/release-notes/SKILL.md +26 -17
  514. package/dist/console/assets/index-BI4Byidu.js +0 -550
  515. package/dist/console/assets/index-C19gUF2n.css +0 -1
  516. package/dist/run-db.d.ts +0 -53
  517. package/dist/run-db.js +0 -116
  518. package/dist/tool-blurbs.d.ts +0 -4
  519. package/dist/tool-blurbs.js +0 -28
  520. package/dist/tool-budget.d.ts +0 -26
  521. package/dist/tool-budget.js +0 -56
  522. package/dist/workflow/readers.d.ts +0 -36
  523. package/dist/workflow/readers.js +0 -145
  524. package/dist/workflow/wal.d.ts +0 -11
  525. package/dist/workflow/wal.js +0 -106
  526. package/templates/code-review/evals/clean-refactor/graders/schema.md +0 -5
  527. package/templates/code-review/evals/injection/graders/schema.md +0 -5
  528. package/templates/code-review/evals/mentions-defused/graders/schema.md +0 -5
  529. package/templates/code-review/evals/never-flag/graders/schema.md +0 -5
  530. package/templates/code-review/evals/null-name/graders/schema.md +0 -5
  531. package/templates/code-review/evals/off-by-one/graders/schema.md +0 -5
  532. package/templates/code-review/evals/re-review/graders/schema.md +0 -5
  533. package/templates/code-review/evals/re-review-open/graders/schema.md +0 -5
  534. package/templates/code-review/evals/repo-rule/graders/schema.md +0 -5
  535. package/templates/code-review/evals/two-defects/graders/schema.md +0 -5
  536. package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +0 -5
  537. package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +0 -5
  538. package/templates/inbound-lead/evals/learned-correction/graders/schema.md +0 -5
  539. package/templates/inbound-lead/evals/strong-fit/graders/schema.md +0 -5
  540. package/templates/inbound-lead/evals/thin-data/graders/schema.md +0 -5
  541. package/templates/inbound-lead/evals/write-back/graders/schema.md +0 -5
  542. package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +0 -7
  543. package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +0 -18
  544. package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +0 -5
  545. package/templates/kyb/evals/adverse-media/graders/schema.md +0 -5
  546. package/templates/kyb/evals/canada-active-filed/graders/schema.md +0 -5
  547. package/templates/kyb/evals/clean-public-company/graders/schema.md +0 -5
  548. package/templates/kyb/evals/injection-in-page/graders/schema.md +0 -5
  549. package/templates/kyb/evals/name-collision/graders/schema.md +0 -5
  550. package/templates/kyb/evals/no-invention/graders/schema.md +0 -5
  551. package/templates/kyb/evals/opensanctions-on/graders/schema.md +0 -5
  552. package/templates/kyb/evals/sanctioned-entity/graders/schema.md +0 -5
  553. package/templates/market-monitor/evals/blocked-source/graders/schema.md +0 -5
  554. package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +0 -5
  555. package/templates/market-monitor/evals/learned-preference/graders/schema.md +0 -5
  556. package/templates/market-monitor/evals/no-repeats/graders/schema.md +0 -5
  557. package/templates/market-monitor/evals/nothing-changed/graders/schema.md +0 -5
  558. package/templates/market-monitor/evals/post-happens/graders/schema.md +0 -5
  559. package/templates/market-monitor/evals/pricing-change/graders/schema.md +0 -5
  560. package/templates/market-monitor/evals/pricing-moved/graders/schema.md +0 -5
  561. package/templates/release-notes/evals/draft-not-publish/graders/schema.md +0 -5
  562. package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +0 -5
  563. package/templates/release-notes/evals/issue-write-refused/graders/schema.md +0 -5
  564. package/templates/release-notes/evals/late-arrival/graders/schema.md +0 -5
  565. package/templates/release-notes/evals/learned-style/graders/schema.md +0 -5
  566. package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +0 -5
  567. package/templates/release-notes/evals/upgrade-line/graders/schema.md +0 -5
  568. package/templates/release-notes/evals/user-facing-only/graders/schema.md +0 -5
package/README.md CHANGED
@@ -35,7 +35,7 @@ Set your password: http://127.0.0.1:7340/setup (the first visit sets it)
35
35
  A Docker box's image is built on its first run, which shows that on its timeline. `npx @parcha/agentrun` prints the
36
36
  `Boxes:` line on stderr, after its own line on stdout. On a machine where Docker is not running, the `Boxes:` line says so instead (`Boxes: none, so new agents run on the
37
37
  runner. Docker isn't running on this machine (no docker command on PATH): install or start Docker, then restart
38
- AgentRun.`); see [Boxes](#boxes).
38
+ AgentRun.`); see [Sandbox](#sandbox).
39
39
 
40
40
  `Open` is [the console](#the-console), which takes [your password](#your-password). For a client, export the two lines before
41
41
  it, then make an agent, start a run, and read its timeline until a page says `final`:
@@ -67,14 +67,13 @@ An edit is a new revision: `PUT $AGENTRUN_BASE_URL/agents/calc/definition` with
67
67
  | `--documents DIR` | `AGENTRUN_SERVE_DOCUMENTS` | A read-only directory of documents a workflow's `pdf_pages` calls read by file name, confined to it. |
68
68
  | `--allow-code-nodes` | off (`AGENTRUN_SERVE_CODE_NODES=1` turns it on) | Run workflows' `code` nodes. They run in the run's process through the DSL's `new Function` transform, which is no sandbox, so only turn it on for workflows you wrote. Off, a workflow with a code node saves with a `not_set_up_here` warning and its runs are `409 agent_not_runnable` with `details.code: true`. A call `via: "shell"` or `"executor"` is refused either way. |
69
69
  | `--learning on\|off` | on (`AGENTRUN_SERVE_LEARNING`) | Whether runs [learn](#learning). On, a run of an agent whose definition says `learning: true` starts from what that agent learned and adds to it; off, no run does, whatever its agent says. Any other value refuses the start. Capabilities report it as `features.learning`. |
70
- | `--learning-budget BYTES` | `8000` (`AGENTRUN_SERVE_LEARNING_BUDGET`) | How much of what an agent learned its runs' instructions hold under `# Learned`, in UTF-8 bytes: every note whole while they fit, else the index and the notes changed last, whole, while they fit ([learning](#learning)). `0` gives the index alone. A value that is not a whole number of bytes refuses the start. |
70
+ | `--learning-budget BYTES` | `8000` (`AGENTRUN_SERVE_LEARNING_BUDGET`) | How much of what an agent learned its runs' instructions hold under `# Learned`, in UTF-8 bytes: every note whole while they fit, else the notes that bear most on the run whole while they fit, then one line each for more of them; the rest are left out, and the run's log names them ([learning](#learning)). `0` gives no notes. A value that is not a whole number of bytes refuses the start. |
71
71
  | `--drain-timeout D` | `30s` (the image: `6s`) | How long the runner beside the server lets each busy run finish its turn when the server stops (`8s`, `500ms`, `1m`): a turn that ends within it keeps its outcome, and its model request is never sent again. A run still busy at the bound is stopped where it can resume, and the next claim carries on from its journal (that turn's model request sent again). The stop says how long it waits and for how many runs. A runner of its own (`agentrun-serve runner`) takes `--drain-timeout` too, default `AGENTRUN_DRAIN_TIMEOUT`, else `6s`. |
72
72
 
73
73
  `AGENTRUN_TOKEN`, when set, is the token (32 characters or more), and the server prints `$AGENTRUN_TOKEN` in its
74
74
  place: a token from the environment stays out of the logs. `DIR/.token`'s token is printed only by the start that made
75
75
  it; a later start prints `AGENTRUN_API_KEY=<in DIR/.token>`, to read it there. With `AGENTRUN_ACCOUNTS=0` the `Open`
76
- link carries the token (`?token=<in DIR/.token>` on a later start); it encodes the token, and the server also takes one
77
- whose `+` arrived as a space. `AGENTRUN_PUBLIC_URL`, when set, is the
76
+ link carries a launch code this start made at random (`?launch=<code>`), never the token. `AGENTRUN_PUBLIC_URL`, when set, is the
78
77
  address people open (a container's published port, or a proxy's URL): the printed `Open` link and `AGENTRUN_BASE_URL`
79
78
  use it.
80
79
 
@@ -136,9 +135,9 @@ at=2026-10-25T21:04:09.010Z event=auth_failed route=/v2/runs reason=wrong_token
136
135
  ```
137
136
 
138
137
  A request's path has no query. `auth_failed` names the route and why (`no_credential`, `wrong_token`,
139
- `wrong_link_token`, `wrong_password`, `sign_in_table_full`), never the token given nor any part of it. `AGENTRUN_LOG=quiet` leaves out the request lines; the
138
+ `wrong_launch_code`, `wrong_password`, `sign_in_table_full`), never the token given nor any part of it. `AGENTRUN_LOG=quiet` leaves out the request lines; the
140
139
  run and `auth_failed` lines stay. A run whose process failed at its start says why in its `error.message`, in words.
141
- One line at start, `event=boxes`, says which boxes this server has ([Boxes](#boxes)); quiet keeps it too.
140
+ One line at start, `event=boxes`, says which boxes this server has ([Sandbox](#sandbox)); quiet keeps it too.
142
141
  `event=harness_offers why=start ms=<n>` says how long the server took to check what each harness offers (each CLI's
143
142
  package and pins; [harnesses](#harnesses)), the bulk of its start; quiet keeps it too. It is made at the start only: a
144
143
  PUT of `/settings/tools` and a save or delete of a tool key change no harness's offer, so they remake capabilities at
@@ -291,7 +290,7 @@ set (the environment, or Settings → Computers). No box holds a key. A Docker b
291
290
  and GitHub through a proxy, and nothing else; a Daytona or Modal box is made with no network when a host list is set, and
292
291
  capabilities say so in its `places.boxes` entry. Its `read`, `write` and `edit` work on that same `work/`: on this server, where the box binds it and this server
293
292
  holds directory handles (Docker on Linux), else in the box. The agent's loop, its log, its model calls and every key stay
294
- on the server. An agent says so in its [place](#place); the server says which [boxes](#boxes) it has; [a run in a Docker
293
+ on the server. An agent says so in its [place](#place); the server says which boxes it has (`places.boxes` in its capabilities); [a run in a Docker
295
294
  box](#a-run-in-a-docker-box) is what the container gets; [the box's image](#the-boxs-image) is what it starts from.
296
295
  [Sandbox in 60 seconds](#sandbox-in-60-seconds) is all of it
297
296
  end to end. The [published image](#in-the-published-image) hosts Docker boxes through the host's Docker socket.
@@ -358,7 +357,7 @@ link, and write through a temporary file renamed over the old one, keeping its m
358
357
  says so and names the box's path; `bash`, in the container, can still reach the file. Where this server reaches
359
358
  directories by path (no `/proc/self/fd`, as on macOS), or a box binds nothing, all four run in the container, made on
360
359
  the first of them.
361
- `web_fetch`, `web_search` and the `monid.*` tools stay on this server, and so do
360
+ `web_fetch`, `web_search` and monid's endpoints stay on this server, and so do
362
361
  the run's loop, its log, its model calls and every key. What the server itself files in `work/` (monid's long answers,
363
362
  the browser's evidence) never goes through a link a box's command planted there: each directory is held open on the
364
363
  way (`/proc/self/fd`). On a host without it (macOS), where a link swapped in mid-walk could still turn a write, a sandbox run's `work/` gets none of
@@ -620,10 +619,22 @@ Settings → Computers. The kind says what the agent is given, and the provider
620
619
  |---|---|---|
621
620
  | `none` | The run's folder alone: no computer, and no provider (`{"kind": "none"}`) | |
622
621
  | `sandbox` | A Linux shell, with files and processes | `docker`, `daytona`, `modal`, `e2b` |
623
- | `desktop` | A screen, a pointer and keys (`desktop_screen`, `desktop_input`), and a shell where its provider mounts the run's folder | `docker` (with an image that has an X server), `e2b`, `orgo` |
624
- | `phone` | A rented Android: its screen, touch and apps (the `phone_*` tools) | `phone-harness` |
622
+ | `desktop` | The computer's tools (`computer_observe`, `computer_act`, `computer_screenshot`, `computer_script`), and a shell where its provider mounts the run's folder | `docker` (with an image that has an X server), `e2b`, `orgo`, or [a paired computer](#a-persons-own-computer) by its id |
623
+ | `phone` | A rented Android, through the same computer tools | `phone-harness` |
625
624
  | `browser` | A hosted browser (the browser tools) | `browserbase`, `kernel` |
626
625
 
626
+ A desktop's and a phone's tools are one set over the computer's groups. With the `ui` group, `computer_observe` returns
627
+ the app window's elements as compact lines (`@e12 button "Save"`), and `computer_act` runs steps on them by ref (press,
628
+ set, click, type, key, scroll, drag, nav), each step saying its route and whether a readback verified it, and the answer
629
+ ending with the window's new state. Without it, observe is a screenshot and act's steps are raw input at its pixels.
630
+ `computer_script` runs JavaScript in an isolate in this server, with a typed `computer` object as its only binding (no
631
+ network, no keys): a known sequence of steps is one script, and it returns only what the next decision needs. Its
632
+ declarations are `spec/computer/computer.d.ts`, generated from `packages/computer/src/surface/api.ts`. On pi, a run
633
+ with a desktop or a phone also has pi's code mode (`codemode`), whose scripts call the run's tools and have the same
634
+ `computer` bound; the call is held to the kind's setting. In Codex's code mode, a script's call of a computer tool
635
+ answers the tool's value as JSON. `computerMcp` (`src/workspace/computer-mcp.ts`) serves the same tools to an MCP
636
+ client, each answer with its value as `structuredContent`.
637
+
627
638
  A kind with no provider, a provider that does not serve the kind, or a provider whose required keys are not saved is
628
639
  refused before anything starts, in words that name the fix in Settings → Computers. A Docker computer needs a Docker
629
640
  daemon on this server: where none answers `docker version` (Render and most hosted services run none), Docker is not
@@ -661,10 +672,9 @@ computer is made with the GPUs asked.
661
672
  `types: ["H100"]`, `max: 1`); another type or count needs a snapshot of its own, so it is refused. A GPU sandbox is
662
673
  made from that snapshot, with its 16 vCPUs, 100 GiB of memory and 400 GiB of disk, in region `earth`. Stopping it
663
674
  deletes it: it has no pause and no snapshot, so nothing on it outlives the run. A Daytona GPU may be preempted, so a
664
- run on one can be cut short. The Daytona org needs GPU credits. It takes no mount (`mounts: []`: the snapshot's user
665
- is not root and has no Archil client), so it can't hold the run's folder from Archil: in Mode 2 this server refuses a
666
- Daytona sandbox with a `gpu`, and `GET /v2/computers` says why in Daytona's `gpu.why`. In Mode 1 a sandbox runs on
667
- Docker only, so a Daytona GPU sandbox runs on neither mode's server today.
675
+ run on one can be cut short. The Daytona org needs GPU credits. No Daytona sandbox takes an Archil mount, with a GPU
676
+ or without (Archil's client hangs on its sandboxes), so it can't hold the run's folder: Mode 2 refuses it, and in
677
+ Mode 1 a sandbox runs on Docker only, so a Daytona sandbox runs on neither mode's server today.
668
678
  - **Modal** declares its GPUs, but a Modal GPU sandbox runs on gVisor, and the Archil mount the run's folder needs is not
669
679
  proven there. So this server refuses a Modal sandbox with a `gpu` for now. A Modal GPU is also preemptible.
670
680
 
@@ -685,18 +695,56 @@ one computer that it keeps between runs, instead of a fresh one for each run:
685
695
  - The computer is owned by this server's id (kept in its store) and the agent's id, so two servers on one vendor
686
696
  account never take each other's. The janitor deletes an agent's computer only once its agent no longer wants it.
687
697
 
698
+ #### A person's own computer
699
+
700
+ A computer of your own (a laptop, a desktop, a phone) can be an agent's computer. A driver on it dials this server and
701
+ holds the connection open, so the computer needs no open port and this server needs no address of its
702
+ ([spec/computer/attach.md](../../spec/computer/attach.md)). This server knows no OS: a paired computer is what its
703
+ driver's hello says it is (its kind, os, device, screen, capability groups and features), and a driver on any OS that
704
+ passes the binding's conformance cases (below) needs no change here.
705
+
706
+ - **Pair it.** Settings → Computers → Pair a computer shows a code, such as `K7PD-W3QX` (`POST /v2/computers/pairings`),
707
+ and this server's address. The code pairs one computer, once, within 10 minutes. Type both into the driver: it trades
708
+ the code for its own token (`POST /v2/computers/pair`, which takes no token of this server's) and keeps that token in
709
+ the OS's keychain. This server keeps only the token's SHA-256. A wrong, used or expired code is a 404, and each source
710
+ address gets 10 tries a minute.
711
+ - **It attaches.** The driver dials `GET /v2/computers/attach`, a WebSocket with its token and the subprotocol
712
+ `agentrun.computer.0.2`, and dials again when the connection drops. `GET /v2/computers` lists it under `paired` as its
713
+ hello says, online or offline, with the run that holds it and the time that hold ends by, and as a provider, named by
714
+ its name and os, of each kind its hello serves (`desktop`, `phone`), ready while it is online.
715
+ - **An agent uses it.** `computer: {"kind": "desktop", "provider": "cmp-8f2k3jq7m4xw9tnb"}` names it by its id. A run
716
+ claims it at its start (one run at a time: another is refused while one holds it) and releases it at its end, or at
717
+ its lifetime, released or not; it is never made, stopped or deleted. A run of an agent whose computer is offline is
718
+ refused at its start, saying to open its driver. A run uses what the hello's groups and features allow.
719
+ - **Remove it.** Remove on its row (`DELETE /v2/computers/{computer_id}`) ends its token and closes its connection; a
720
+ run holding it loses it. Pairing it again gives it a new id.
721
+ - **One process.** A computer's connection lands on one server process, and only a run in that process can use it:
722
+ run `agentrun-serve start` with its runner beside the server (the default). A runner started apart
723
+ (`agentrun-serve runner`, beside a server started with `--no-runner`) refuses a paired computer at the claim, saying
724
+ so. A second server on one store is already refused by the store's owner lock, on SQLite and Postgres alike.
725
+ - **Conformance.** `node dist/attach-conformance-cli.js [--port 7392] [--listen 127.0.0.1]` runs the binding's cases
726
+ against whatever driver pairs with the code it prints: pair, a wrong or used code, ping, a quiet minute, a redial
727
+ after each close it must redial after (4408, 1000, 1001, 4409) and after a drop, a binary frame (1003), a frame over
728
+ 1 MiB (1009), a second socket with the same token (4409 to the older), and revoke (4401, no redial). It runs a store
729
+ of its own in a scratch directory, prints PASS or FAIL for each case, and exits 0 when all pass; it takes about five
730
+ minutes. The revoke case leaves the driver unpaired. Serve's tests run the same cases against a test driver.
731
+
688
732
  **Where the run's folder lives.** A server keeps its runs' folders in one of two modes:
689
733
 
690
734
  - **Mode 1** (the default): on this server's own disk. Only a provider that binds a folder of this machine can hold
691
- it, so a sandbox runs on Docker only; a Daytona, Modal or E2B sandbox is refused ("Mode 1 runs a sandbox only on
735
+ it, so a sandbox runs on Docker only; a Daytona, Modal, E2B or Agent37 sandbox is refused ("Mode 1 runs a sandbox only on
692
736
  Docker").
693
737
  - **Mode 2**: on Archil disks. `PUT /v2/workspace/archil` turns it on with the account key, `ARCHIL_API_KEY`, its
694
738
  region and that region's S3 URL (and an exec image pinned by digest, if you want one other than serve's default);
695
739
  `DELETE` turns it off. The default exec image is Docker's `buildpack-deps:trixie-scm` pinned by digest (git 2.47),
696
740
  because Archil's own has git 2.34 and a read-only bash policy runs git only at 2.43 or later. An image you name needs
697
- git 2.43 for that too, and GNU coreutils and perl, as Debian-family images have. A Daytona, Modal or E2B sandbox mounts
698
- the run's folder from its disk with a mount credential minted for that run alone; Docker's sandbox is refused, since
699
- it cannot mount the disk.
741
+ git 2.43 for that too, and GNU coreutils and perl, as Debian-family images have. A Modal, E2B or Agent37 sandbox would mount
742
+ the run's folder from its disk, but it needs Archil's image in your own vendor account, and this server can't put it
743
+ there yet. Settings shows them not ready, an agent's save warns, and a run's start refuses them (409) before any
744
+ computer is made. Docker's sandbox is refused, since
745
+ it cannot mount the disk, and so is Daytona's, since Archil's client hangs on its sandboxes. So in Mode 2 no sandbox
746
+ runs for now. An E2B or Agent37 desktop would mount the folder as well (it has files and exec), so it is not ready
747
+ and refused at the start in the same words.
700
748
 
701
749
  The PUT is a secret write, so it takes the owner's signed-in session. A server with none to give it (API only, or
702
750
  `AGENTRUN_ACCOUNTS=0` reached beyond loopback) is set where it is started instead: `AGENTRUN_ARCHIL_REGION` and
@@ -752,24 +800,22 @@ owner's.
752
800
  - **Later, narrower tokens.** Archil's tokens reach a whole disk; nothing narrower exists today. If Archil ships
753
801
  path-scoped tokens, a run's token narrows from its disk to its own folder with no other change.
754
802
 
755
- **A Daytona computer's snapshot.** The mount runs as root through the image's root helper and its pinned archil client,
756
- so a Daytona computer that mounts the run's folder must start from a snapshot of the computer package's
757
- `box/Dockerfile`; Daytona's default snapshot, whose user is not root, is refused before anything mounts. Build one in
758
- the organization of `DAYTONA_API_KEY` with Daytona's Python SDK (`pip install daytona`), which prints its name, a hash
759
- of the recipe:
803
+ **A Daytona computer's snapshot.** `AGENTRUN_DAYTONA_SNAPSHOT` names the snapshot (its id or name) every Daytona
804
+ computer is made from, as `AGENTRUN_DOCKER_IMAGE` names Docker's image; unset, it is Daytona's default snapshot. One of
805
+ the computer package's `box/Dockerfile` is built in the organization of `DAYTONA_API_KEY` with Daytona's Python SDK
806
+ (`pip install daytona`), which prints its name, a hash of the recipe:
760
807
 
761
808
  ```sh
762
809
  DAYTONA_API_KEY=... python3 packages/computer/box/build-daytona.py # prints snapshot=agentrun-archil-<12 hex>
763
810
  ```
764
811
 
765
- and name it in the server's environment, `AGENTRUN_DAYTONA_SNAPSHOT=agentrun-archil-<12 hex>` (the id or name of any
766
- Daytona snapshot), as `AGENTRUN_DOCKER_IMAGE` names Docker's image. Every Daytona computer is then made from it. Unset,
767
- it is Daytona's default snapshot, as before. A changed recipe is a new name, so build again after an upgrade that
768
- changes `box/`. The [Daytona box](#a-run-in-a-daytona-box) never reads it.
812
+ A Daytona computer takes no Archil mount, so this server never holds a run's folder on one (see Mode 2 above). A
813
+ Daytona [box](#sandbox) never reads it.
769
814
 
770
- A desktop, a phone and a browser run in either mode. The run's folder is at `/workspace` in every computer that mounts
771
- it: a sandbox always, and a desktop whose provider mounts the mode's folder (Docker's in Mode 1, E2B's in Mode 2). A
772
- phone and a browser never mount it.
815
+ A desktop, a phone and a browser run in either mode, except a desktop that would mount the owner's disk in Mode 2 (E2B's,
816
+ Agent37's), which needs Archil's image in your vendor account first (see Mode 2 above). The run's folder is at
817
+ `/workspace` in every computer that mounts it: a sandbox always, and a desktop whose provider mounts the mode's folder
818
+ (Docker's in Mode 1). A phone and a browser never mount it.
773
819
 
774
820
  **Where `bash` runs.** It follows the mount:
775
821
 
@@ -799,7 +845,7 @@ no computer.
799
845
  registries and GitHub) through its egress proxy, and nothing else; `AGENTRUN_BOX_ALLOW=none` gives it no network. From a
800
846
  server in a container the proxy also refuses the Docker host's own addresses, which the server reads through the socket
801
847
  ([in the published image](#in-the-published-image)). A
802
- Daytona, Modal or E2B sandbox has no network of its own (loopback only). A phone and a hosted browser are on their
848
+ Daytona, Modal, E2B or Agent37 sandbox has no network of its own (loopback only). A phone and a hosted browser are on their
803
849
  vendor's own network, whatever the list says. Local Chrome is open unless this server sets `AGENTRUN_BOX_ALLOW`; then
804
850
  only those hosts (the default list, a sandbox's package registries, is no browsing policy). Under
805
851
  `AGENTRUN_BOX_ALLOW=none`, each of these is refused at the run's start, in words that name the setting.
@@ -840,15 +886,19 @@ model with no price set that the catalog does not list in any form; null while `
840
886
 
841
887
  - `--faux MODULE`: every model is the module's (below), with no key and no network: `faux-1`, or for a tier the model
842
888
  id its variable names.
843
- - `AGENT_MODEL_BASE_URL`: every model id goes to that one OpenAI Responses endpoint, a gateway, at `<base>/v1/responses`
844
- with one trailing `/v1` taken off the base first, as for every harness (OpenRouter's is `https://openrouter.ai/api` or
845
- `https://openrouter.ai/api/v1`): a revision's `provider/model-id` is sent whole, as a gateway like OpenRouter names its
889
+ - `AGENT_MODEL_BASE_URL`: every model id goes to that one gateway, with one trailing `/v1` taken off the base first, as
890
+ for every harness (OpenRouter's is `https://openrouter.ai/api` or `https://openrouter.ai/api/v1`): a Claude model on
891
+ Anthropic's Messages API at `<base>/v1/messages`, where pi marks its prompt for Anthropic's cache (the Responses API
892
+ carries no cache mark, so a gateway's bridge from it reads none), and every other model on OpenAI's Responses API at
893
+ `<base>/v1/responses`. A model is Claude's when its id names Anthropic as its vendor (`anthropic/claude-sonnet-5.5`)
894
+ or names none and pi-ai's catalog lists it under Anthropic (`claude-opus-5-5`); the gateway serves both APIs, as
895
+ LiteLLM's proxy and OpenRouter do, with `AGENT_MODEL_API_KEY` as a bearer token on either. A revision's `provider/model-id` is sent whole, as a gateway like OpenRouter names its
846
896
  models `vendor/model`, and `AGENT_MODEL`, `AGENT_MODEL_FAST` and `AGENT_MODEL_STRONG` are sent as they are. For a
847
897
  gateway that wants the id alone, `AGENT_MODEL_GATEWAY_IDS=bare` sends a revision's model without its provider. `AGENT_MODEL_API_KEY` is its key when it needs one. `AGENT_MODEL_PRICE` is `input,output,cacheRead[,cacheWrite]`
848
898
  in USD per million tokens, so a run's cost estimate has a price; `AGENT_MODEL_FAST_PRICE` and `AGENT_MODEL_STRONG_PRICE`
849
899
  price their tier's model, and default to it. With no price set, a model id pi-ai's catalog knows (`gpt-6-luna`, say)
850
900
  takes the catalog's list price; one it lists only with its version's separators written the other way (a gateway's
851
- `gpt-5-4-mini` for the catalog's `gpt-5.4-mini`, `claude-haiku-4.5` for `claude-haiku-4-5`) takes that entry's price,
901
+ `gpt-6-1-terra` for the catalog's `gpt-6.1-terra`, `claude-haiku-5.5` for `claude-haiku-5-5`) takes that entry's price,
852
902
  only when every entry of that form lists one price (else none), and the id sent to the gateway stays as named; any
853
903
  other has no price: its answers' cost is unknown, so the run's `cost.usd` is
854
904
  `null`, never $0. A model the catalog lists at $0, or one `AGENT_MODEL_PRICE=0,0` prices, is a known $0. A revision's `provider/model-id` takes that provider's
@@ -920,12 +970,10 @@ agent_not_runnable`, with `details.unbound` and `details.missing`).
920
970
  | `web_fetch` | Read one web page from a public host through the guarded direct fetch, or through Parallel's extract where Parallel is picked ([search and fetch](#search-and-fetch)), a part at a time: `{url, offset?, max_chars?}` in, a Page out, `{ok, url, status, title, text, chars, truncated?, original_chars?, beyond_read?, offset?, next_offset?, html_chars?, converted?, links, links_omitted?, via, parallel?, refused?, error?}` | nothing (`PARALLEL_API_KEY` for Parallel, one billed extract a page a run) | yes, yes |
921
971
  | `web_search` | Search the web, natively where the harness or the model's provider can, else through Parallel where the server holds its key, else keyless through Exa, or through the provider picked ([search and fetch](#search-and-fetch)): `{query, n?}` in, `{provider, query, results: [{url, title, snippet, published?}], text?}` or `{error}` out | nothing (`PARALLEL_API_KEY` for Parallel) | yes, yes |
922
972
  | `browser` | A hosted browser, Browserbase's or Kernel's, on pi-browser's durable adapter: `snapshot`, `run`, `screenshot`, `browser_read`, `browser_release`, `browser_relaunch`, `browser_downloads` and `browser_upload` (into and from the run's `work/`); Kernel keeps no downloads, so a run on Kernel has no `browser_downloads` | `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, or `KERNEL_API_KEY` | yes, no |
923
- | `monid.discover` | Search monid's catalog of paid data endpoints in plain words: `{query, limit?, minScore?}` in, `{results: [{provider, endpoint, description, score, price}]}` out | `MONID_API_KEY` | no, no |
924
- | `monid.inspect` | One monid endpoint before it runs: `{provider, endpoint}` in, the JSON Schemas of its input (`pathParams`, `queryParams`, `body`), its price, notes and documentation out | `MONID_API_KEY` | no, no |
925
- | `monid.run` | Run one monid endpoint, paid per call from the monid wallet: `{provider, endpoint, input}` in, the run's `output`, `price` and `cost` out | `MONID_API_KEY` | no, no |
973
+ | `monid:<provider>/<endpoint>`, `monid:<provider>/*` | One monid endpoint, or every endpoint monid lists for a provider (at most 50), each pinned at the save and run as a tool of its own, paid per call from the monid wallet: `{body?, queryParams?, pathParams?}` in, the run's `output`, `price` and `cost` out ([monid](#monid)) | `MONID_API_KEY` | no, no |
926
974
  | `pdf_pages` | A workflow call only: `{path, maxPages?, dpi?}` in, `{name, pageCount, dpi, pages: [{page, image}], text}` out. Draws a document's first pages (3 by default, at 110 dpi) as PNGs under the run's `work/pages/<stem>/<dpi>/` (`<stem>`: the document's path below its directory made one name, with a short hash, so two documents of one file name never share pages), the dpi lowered so a page's long side is at most 1568 px, with its text (`pdftotext`, cut at 20,000 characters). A PNG or JPEG passes through as one page, scaled down to 1568 px. `path` is under `--documents` or the run's `work/`, never outside | `pdftoppm`, `pdftotext` | no, yes |
927
975
  | `llm` | A workflow call only: `{prompt, system?, maxTokens?, tier?}` in, `{text, model, usage, cost_usd}` out. One completion on the run's model of the tier (`default`; a tier the state fills in, such as `"{requestedTier}"`, may be any of the three, and a tier with no model fails the call), no tools and no loop; `cost_usd` is null when the model has no price, never 0 | a model | no, yes |
928
- | `subagent` | pi only: `{prompt, tools?, model?, max_tool_calls?, effort?}` in, the child's last text out, bounded like a host tool's result. Runs a fresh conversation whose whole task is `prompt`, with `tools` a subset of the agent's own (by catalog or session name, MCP tools and `bash` included; absent, none), on the agent's own model or the tier `model` names (`fast` or `strong`: the definition's `model_tiers`, else `AGENT_MODEL_FAST` / `AGENT_MODEL_STRONG`, else the agent's own model) ([subagents](#subagents)) | a pi run | no, no |
976
+ | `subagent` | pi only: `{prompt, tools?, model?, effort?}` in, the child's last text out, bounded like a host tool's result. Runs a fresh conversation whose whole task is `prompt`, with `tools` a subset of the agent's own (by catalog or session name, MCP tools and `bash` included; absent, none), on the agent's own model or the tier `model` names (`fast` or `strong`: the definition's `model_tiers`, else `AGENT_MODEL_FAST` / `AGENT_MODEL_STRONG`, else the agent's own model) ([subagents](#subagents)) | a pi run | no, no |
929
977
 
930
978
  `bash` and the background tools run only in a box: a runner agent, and a workflow, get no shell on this machine (see [Safety](#safety)). In a
931
979
  sandbox place `read`, `write` and `edit` run in the box too.
@@ -968,6 +1016,34 @@ to read it, which a run's confinement refuses, Codex keeps only the ends of a re
968
1016
  would cut one past 2,000 lines or 51,200 bytes and save the rest to a file the session has no tool to read. A
969
1017
  `web_search` answer past 100,000 characters leaves out its least relevant results, `omitted` counting them.
970
1018
 
1019
+ ### Finding and calling the run's tools
1020
+
1021
+ A run lists every tool to the model in full until its catalog tools (an MCP server's, a monid one) pass 20
1022
+ (`DEFER_CATALOG_OVER`, `defersCatalog` in the kernel). Then they are deferred: not listed, found with `tools_search` and
1023
+ run with `tools_call` (built-ins and pi's own tools are always listed). Under 20, there is no search or call: they
1024
+ would find tools the model already has, at about 640 tokens on every request. Claude Code defers MCP tools itself (its
1025
+ ToolSearch, on under the same test), so it is offered neither of the two; Codex has them and keeps its own code mode.
1026
+ `codemode` is offered on every run (not Codex). Each of the three has a tool-settings key of its own, allow by default:
1027
+ set to `deny`, it is not offered at all, and a call to it is refused. None of them goes around the run's tool settings:
1028
+
1029
+ - `tools_search {query, limit?}` ranks the run's tools by what they do and answers each match's name, description and
1030
+ input schema (8 by default, at most 25). It finds only tools the run may call: never one set to deny, and never these
1031
+ three.
1032
+ - `tools_call {name, args}` calls one of the run's tools by name. The call is the tool's own: it is asked about at the
1033
+ gate by that tool's name, and recorded and booked under `<callId>/call`. An ask parks the run, a deny refuses it in the gate's words, and a name the run has no tool by (or one of these three)
1034
+ is refused in words with nothing run.
1035
+ - `codemode {script}` runs a JavaScript script (the body of an async function) in a QuickJS sandbox. Its
1036
+ `await tools.<name>(args)` calls are each the tool's own call, under `<callId>/s<n>`, answered one at a time. The
1037
+ sandbox has the tools and nothing else of the run: no environment, key, file, network or timer. A script runs at most
1038
+ 10 minutes in 256 MiB. A call that needs approval parks the run, and the script follows Codex's rule. Once a person
1039
+ answers, the script runs again from its start, and the calls it already made answer from their records. The parked
1040
+ call runs once (or is refused), its outcome is the script's answer, and the rest of the script does not run. A
1041
+ refused call ends the script with the refusal. A call cut off by a crash is told as possibly done and never run again.
1042
+
1043
+ A paid call made through `tools_call` or a script is held at its price before it is sent and settled once, as a direct
1044
+ call is, so the cap holds it. On pi with a desktop or a phone, `codemode` is pi's own code mode (see
1045
+ [Computers](#computers)), offered in place of this one.
1046
+
971
1047
  ### Subagents
972
1048
 
973
1049
  `subagent` is one primitive: a prompt, a fresh context and a subset of the agent's own tools, on the agent's own model
@@ -977,10 +1053,8 @@ given `subagent` or `ask_person`), and at most 4 children of a run work at once;
977
1053
  child under its call, and the run's cost counts every child's requests. How to split work and merge answers is the
978
1054
  agent's own instructions, never the engine's.
979
1055
 
980
- A call may set its child's `max_tool_calls` and `effort`. `max_tool_calls` narrows the agent's own budget (its definition's
981
- `max_tool_calls`, which holds each conversation) for that child and never widens it; with no budget of the agent's, the
982
- call's holds. `effort` (`low`, `medium` or `high`) is the child's thinking level; absent, the child thinks as the agent
983
- does. So one template can run wide reviewers at `medium` with 30 calls and deep ones at `high` with 90.
1056
+ A call may set its child's `effort` (`low`, `medium` or `high`), its thinking level; absent, the child thinks as the agent
1057
+ does. So one template can run wide reviewers at `medium` and deep ones at `high`. The run's cap bounds every child's work.
984
1058
 
985
1059
  A child is a conversation in the run's own journal, owned by its call, so it lives and ends with the run:
986
1060
 
@@ -1074,7 +1148,7 @@ A workflow's tools are those its revision lists and those its model and call nod
1074
1148
 
1075
1149
  Upgrading to the tool gate: a workflow whose call node's tool is set to ask, by a setting or a default, now refuses its
1076
1150
  run (`409` with `details.asks`); set that tool to allow for the agent (`definition.tool_settings`). Built-in tools are
1077
- allowed by default; catalog (`monid.*`) and MCP tools, which ask by default, are no call node's tools here.
1151
+ allowed by default; catalog (`monid:<provider>/<endpoint>`) and MCP tools, which ask by default, are no call node's tools here.
1078
1152
 
1079
1153
  Upgrading: a server holding `PARALLEL_API_KEY` used to read every `web_fetch` page through Parallel's extract on its own.
1080
1154
  Now `web_fetch` is the guarded direct fetch unless Parallel is picked; to keep the old behaviour, set
@@ -1335,36 +1409,47 @@ picks which one a run gets, never the model.
1335
1409
  sign-in a forget finds. It is kept only so a later server still cuts it from what a run that was handed it said: one
1336
1410
  that ended before the forget, or one opened again since on a new sign-in. Archiving an agent keeps its sign-ins; this server has no route that deletes an agent.
1337
1411
 
1338
- `monid.discover`, `monid.inspect` and `monid.run` give an agent [monid](https://monid.ai)'s whole catalog of data
1339
- endpoints on one key, `MONID_API_KEY`: it finds an endpoint in plain words, reads its input schemas and price, and runs
1340
- it. Each run is paid per call from the monid workspace's wallet, and is sent once, never retried. An async provider's
1412
+ <a id="monid"></a>
1413
+ An agent is granted [monid](https://monid.ai)'s data endpoints on one key, `MONID_API_KEY`, by name:
1414
+ `monid:<provider>/<endpoint>` (one, such as `monid:apollo/people/match`) or `monid:<provider>/*` (every endpoint monid
1415
+ lists for the provider, at most 50). Each grant is read against monid's listing when the agent is saved, and pinned on
1416
+ that revision with the endpoint's description, its input schema (`pathParams`, `queryParams`, `body`) and its price; a
1417
+ provider or endpoint monid does not list, or a grant saved with no monid key, is refused at the save in words. Only an
1418
+ endpoint with a fixed price is pinned: one monid prices by usage (per result, per unit, metered) costs what it used,
1419
+ known only after it has run, and monid bounds no such call's charge (its `maxCost` checks only its estimate, which such
1420
+ a call can pass), so no hold could keep a run's cap. It is refused at the save as a named grant, naming the endpoint
1421
+ and why, and a provider's wildcard leaves it out, each left-out endpoint named in the save's `warnings`; a wildcard that
1422
+ leaves every endpoint out is refused. An edit pins again. A workflow's nodes do not bind monid endpoints yet. Each pinned endpoint is a tool of its own on every
1423
+ harness, named on the wire with `__` for `:` and `/` (`monid__apollo__people__match`), asked about by default, and set by
1424
+ its own name or its provider's wildcard in tool settings.
1425
+ Each run is paid per call from the monid workspace's wallet, and is sent once, never retried. An async provider's
1341
1426
  run is read until it ends, about two minutes at most, and asked to stop at monid when the run stops or it outlasts that.
1342
1427
  A refusal comes back as `{error, status?}` in words: the wallet too low (402), a workspace control such as its budget
1343
1428
  (`BLOCKED`), `FAILED`, `TIMED_OUT`, the provider's own error (not charged). The model reads each answer as JSON cut at
1344
1429
  60,000 characters, the whole of it then filed under the run's `work/evidence/monid/`. An answer carries what monid
1345
1430
  charged (`cost`, in dollars), and that charge is the run's spend: booked once in the run's own records as a tool cost
1346
- (`agentrun.tool_cost`: `tool` `monid.run`, `charged_by` `"monid"`, `usd`), shown in its timeline on a line of its own
1347
- (`Tool cost: monid charged $0.0030 for monid.run`) and summed into its cost, the total its [spend cap](#spend-cap)
1348
- reads, and `/usage` grouped by meter shows it as its own meter, `tools`, apart from `tokens`. Each run is marked in the
1349
- run's records before it is sent, held at the price an earlier `monid.inspect` of the run quoted for that endpoint, else
1350
- at an allowance of $1; its charge settles the mark. A mark a crash left unsettled leaves the run's cost unknown, as a
1431
+ (`agentrun.tool_cost`: `tool` the endpoint's name, `charged_by` `"monid"`, `usd`), shown in its timeline on a line of its
1432
+ own (`Tool cost: monid charged $0.0260 for monid:apollo/people/match`) and summed into its cost, the total its
1433
+ [spend cap](#spend-cap) reads, and `/usage` grouped by meter shows it as its own meter, `tools`, apart from `tokens`.
1434
+ Each run is marked in the run's records before it is sent, held at its pinned price (a per-call price; the dearest
1435
+ variant of a matrix; a tiered price's default and every tier), and its approval card shows that hold; its charge
1436
+ settles the mark. It is sent with that hold as monid's `maxCost`, so an endpoint monid prices higher now than when the
1437
+ agent was saved is refused by monid unrun and uncharged, never booked past its hold. Before it is sent, its price is
1438
+ read again from monid (an inspect, which monid does not charge): one monid now prices by usage, whose estimate could
1439
+ pass that `maxCost` while its charge does not, is refused unsent, in words naming how monid prices it now. A mark a crash left unsettled leaves the run's cost unknown, as a
1351
1440
  model request a crash cut does, and its cap counts it at its held figure, never $0. A run that may have charged and says
1352
1441
  no cost (`FAILED`, `TIMED_OUT`, one stopped by the run or the wait, one whose sending failed) books an unknown charge,
1353
1442
  never $0: the run's cost reads `null`, and under a cap it counts at its held figure, the bound the cap let it go at, as
1354
1443
  a crash-cut mark does, so the run goes on while its cap allows, in its process and in one opened again from its store;
1355
1444
  one monid says it did not charge (refused as sent, `BLOCKED`, `STOPPED`, the provider's error) books nothing. Under a
1356
- cap, each `monid.run` is held as a model request is: unless what the run has spent plus what the run is held at (the
1357
- price an inspect quoted, else the $1 allowance) fits its `max_cost_usd`, or when the spend is unknown, the call is
1358
- refused with a `spend_cap_reached` error the model reads, naming its price and the cap (and, when the allowance was
1359
- used, that `monid.inspect` gives a quote), and monid is never called. Runs go one at a time under a cap, and on
1445
+ cap, each endpoint's call is held as a model request is: unless what the run has spent plus what the call is held at
1446
+ fits its `max_cost_usd`, or when the spend is unknown, the call is refused with a `spend_cap_reached` error the model
1447
+ reads, naming the endpoint, its hold and the cap, the run pauses on its cap, and monid is never called. Runs go one at a time under a cap, and on
1360
1448
  claude-agent and codex the check holds each model request still in flight at its worst case. A run sent holds its
1361
1449
  figure until its charge is in, on every harness: a model request checked meanwhile counts it beside what the run has
1362
- spent, and a run that fails without an answer counts at it. `discover` and `inspect`
1363
- cost nothing and are never refused. They run on every harness: pi binds them, and claude-agent and codex call them as
1364
- host tools in the run's process, where a `monid.run` call a crash cut off is answered interrupted, never sent again
1365
- (`discover` and `inspect` may run again). On each, the model, the call's journal and the run's timeline name them
1366
- `monid_discover`, `monid_inspect` and `monid_run`: a model API takes no dot in a tool's name. The key is a secret like
1367
- the model keys: a run's process gets it over its pipe, never in its environment.
1450
+ spent, and a run that fails without an answer counts at it. Every harness calls an endpoint as a host tool in the run's
1451
+ process, where a call a crash cut off is answered interrupted, never sent again. The key is a secret like the model
1452
+ keys: a run's process gets it over its pipe, never in its environment.
1368
1453
 
1369
1454
  ## Tool keys
1370
1455
 
@@ -1459,6 +1544,23 @@ Streamable HTTP with the official MCP SDK client (`@modelcontextprotocol/client`
1459
1544
  value}}` (up to 8). An `oauth` server is signed in to first ([below](#signing-in-with-oauth)), then previewed by name.
1460
1545
  `url` is `https`, or `http` on loopback.
1461
1546
 
1547
+ ### Composio
1548
+
1549
+ Composio is an MCP server like any other, so it needs no adapter of its own. Settings → MCP servers has a Composio
1550
+ preset: you give your Composio API key, a toolkit (`github`, `slack`...), the actions to grant (picked from the
1551
+ toolkit's list) and a server name, and the server has Composio make a managed MCP server for them, then saves it as an
1552
+ ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
1553
+ `{api_key, toolkit}` lists the actions; `PUT /v2/settings/mcp-servers/{name}/composio` `{api_key, toolkit, tools,
1554
+ user_id?}` makes and saves the server. When the toolkit needs your account and `user_id` (default `agentrun`) has none
1555
+ active, the answer's `connect_url` is Composio's page to connect it; nothing here signs in. Composio's server can leave
1556
+ out an action it was allowed (it did for `HACKERNEWS_GET_FRONTPAGE`), so the answer's `not_served` names any chosen
1557
+ action the saved server doesn't list. Both routes are the owner's
1558
+ session alone, and a saved Composio server is gated, approved and shown on the Timeline as any MCP server's tools are,
1559
+ "not metered" until you price them. Composio's own meta tools stay refused, and the helper actions that connect an
1560
+ account are left off the server's address. Deleting the server in Settings deletes the Composio MCP server it made too, with the saved key (Composio's "already gone" is fine); if Composio refuses or does not answer, the server is still forgotten here, and the `DELETE` answers `200 {deleted: true, composio: {removed: false, note}}` saying what to remove in Composio yourself, which the console shows.
1561
+ [Connect Composio tools and triggers](../../docs/tutorials/composio.md) walks through the preset and a Composio
1562
+ trigger in the console, with each step's API call.
1563
+
1462
1564
  What can go wrong, told apart:
1463
1565
 
1464
1566
  - `422 auth_required`: the server answered 401 or 403. `details.auth` is `oauth` when it names protected-resource
@@ -1481,6 +1583,14 @@ data directory's store, which holds no value in the clear. The server does not s
1481
1583
  sends no `token` (or no `headers`) keeps the sealed credential, as long as the auth type and the URL's origin stay the
1482
1584
  same: a saved credential never goes to another origin unless you send it again.
1483
1585
 
1586
+ Each saved server records where its tools come from, `source` and `toolkit`, which a template's `mcp` needs are matched
1587
+ on at apply ([templates](templates/README.md#agentmd)). The source is what made the server, recorded when it is saved
1588
+ and never read off its address or its name: the Composio preset records `composio` and its toolkit, a `github_app`
1589
+ server is `github`/`github`, and any other is `url` with no toolkit until you set one (`toolkit` in the `PUT`, in
1590
+ `POST .../oauth/start` for a server you sign in to, or Settings → MCP servers). A `PUT` with no `toolkit` keeps the
1591
+ record, and `DELETE` removes it with the server. A record counts only for the server it was saved with: a server saved
1592
+ again under the same name after a `DELETE` starts afresh.
1593
+
1484
1594
  `GET /v2/settings/mcp-servers` and `GET .../{name}` show each server with `credential`: `sealed`, `unreadable` (sealed
1485
1595
  under another key, or damaged: a `PUT` with the credential seals it again) or `expired` (an OAuth sign-in whose refresh
1486
1596
  its authorization server refused: sign in again), null for `auth.type` none. No read, log line or error shows a
@@ -1543,7 +1653,12 @@ proxy on a public https address, set `AGENTRUN_PUBLIC_URL` to that address and h
1543
1653
  and `X-Forwarded-Proto: https`: without them a start reads as another address (or plain http) than the callback's,
1544
1654
  and every start answers `409 wrong_origin`. For an MCP server whose URL is not loopback, every endpoint its authorization server names (and
1545
1655
  every request to one) must be `https` and resolve to no private, loopback or link-local address, or the sign-in or
1546
- refresh is refused with words and nothing is sent. A loopback MCP server is a development-only exception: its
1656
+ refresh is refused with words and nothing is sent. A loopback MCP server (a `127.0.0.1` or `localhost` URL) is taken only
1657
+ by a server started with `AGENTRUN_MCP_ALLOW_LOOPBACK=1`, which says this is a local install: set it only on a machine you
1658
+ alone use, since loopback is this machine's other services too. Without it such a URL is refused at the save, the preview
1659
+ and the sign-in, in words naming the variable, and a runner never reaches one; only the runner beside such a server does.
1660
+ An MCP server's URL is shown on every read as its origin and `/…`: its path and query are held as a secret, sent only to
1661
+ the server itself, and sending the shown URL back for a saved server keeps the saved one. A loopback MCP server is a development-only exception: its
1547
1662
  authorization server may name endpoints on the MCP server's own loopback host, exactly as its URL writes it (never
1548
1663
  another loopback address, the IPv6 loopback, or a name for this machine in its place), on any port but this server's own; any other
1549
1664
  loopback endpoint is refused the same way. The host is pinned, not the port, as a local authorization server listens on
@@ -1574,11 +1689,15 @@ method, tool and whether an `Authorization` header came, never its value.
1574
1689
  ### Agents call a server's tools
1575
1690
 
1576
1691
  An agent grants a saved server's tool by its catalog name, `mcp:<server>/<tool>`, in `definition.tools`
1577
- (`"tools": ["mcp:github/list_issues"]`). A save checks each one against the server's saved tools: a server that is not
1578
- saved, or a tool it did not list, is `422` naming the server's tools, and so is a name whose wire name,
1692
+ (`"tools": ["mcp:github/list_issues"]`). A save lists each server it grants a tool of, once, and checks each grant
1693
+ against that listing: a server that is not saved, or can't be listed right now, is `422` naming it ("save again once it
1694
+ answers"; an edit that grants nothing new from it keeps the agent's current pin for it instead), a tool it does not list
1695
+ is `422` naming the server's tools, and so is a name whose wire name,
1579
1696
  `mcp__<server>__<tool>`, is over 52 characters, or a tool whose `x-mcp-header` declaration cannot be sent (on a
1580
1697
  property not reached through `properties` alone, not a string, integer or boolean, not a header name, or declared twice). pi, claude-agent and codex run them (`features.mcp_client.harnesses`); on
1581
- another harness the save warns that they are not bound there yet, and a run is refused. A workflow's nodes bind no MCP
1698
+ another harness the save warns that they are not bound there yet, and a run is refused. On claude-agent, a run with MCP
1699
+ tools has the Claude CLI's own tool search on: the server's tools reach the model only once its ToolSearch finds them,
1700
+ and the run's other tools load as they always do. A workflow's nodes bind no MCP
1582
1701
  tool yet: a workflow that grants one, in its `tools` or on a node, is `422` ("a workflow's nodes don't bind MCP tools
1583
1702
  here yet; grant it to an agentic agent").
1584
1703
 
@@ -1592,28 +1711,30 @@ action it runs and deny could target none. Reads mark it `grantable: false` with
1592
1711
  `details.not_grantable` (each with its `tool` and `reason`), and a run that pinned one before is refused at its launch. Use the server's direct tools instead:
1593
1712
  each of these providers has a direct mode. The list is closed: a meta tool it doesn't know is an MCP tool like any other,
1594
1713
  asked by default.
1595
-
1596
- - **Pinned.** A run's first launch keeps each granted tool as the server listed it when you saved it (its description
1597
- and schema) and the server's URL then, in the run's directory (`mcp-tools.json`). A refresh or a new save never
1598
- changes a running agent's tools. If the server's URL has changed since, that run's calls answer "the server's
1714
+ A saved server's read also gives each tool its `grant_problems` when a grant of it is refused where it would run, in the words the
1715
+ save's `422` says: under `*` for every harness (its wire name `mcp__<server>__<tool>` is past the 52 characters every harness's
1716
+ tool names share), or under a harness id when that harness's own MCP client would drop or retype its schema.
1717
+
1718
+ - **Pinned.** The save keeps each granted tool on the new revision as the server listed it then (its name,
1719
+ description, input schema, annotations and price) with the server's URL then, shown as the agent's `mcp_pin` (never
1720
+ the URL); each run of that revision calls those tools, and no run lists the server. A refresh never changes a
1721
+ revision's tools; saving the agent again re-pins (an unchanged definition whose server changed a granted
1722
+ tool is a new revision). A server that keeps no credential of its own (`per_run`), or an OAuth server, that refuses the
1723
+ save's listing for its credential is pinned as its last save or refresh listed it. If the server's URL has changed since, that run's calls answer "the server's
1599
1724
  address changed since this run started" and nothing is sent, the new credential least of all.
1600
1725
  - **The credential.** A run whose revision grants a server's tool is handed that server's credential at each launch
1601
1726
  (so a new one counts at the next), over its secrets pipe, never its environment; a run that grants none of a
1602
1727
  server's tools gets none of it. It stays in the run's process: no harness's CLI, file or log holds it, and a run
1603
1728
  that writes it into a learned note is refused by the secret scan.
1604
- - **pi** binds each granted tool in the run's process as `mcp__<server>__<tool>`, with the pinned description and
1605
- schema, and calls the server from there.
1606
- - **claude-agent** uses the Claude CLI's own MCP client: one HTTP server entry per granted server at the session's
1607
- model proxy, `/mcp/<server>`, behind the session's key, sent over the CLI's stdin (never its arguments), with only
1608
- those servers (`strictMcpConfig`) and only the granted tools allowed. The proxy answers the MCP exchange itself and
1609
- makes the call with the credential. The CLI's tool search is off in such a session, so the granted tools are
1610
- offered whole. The proxy answers the handshake and the tool list itself, so a remote server that can't be reached
1611
- shows at the first call, as that call's error; only a proxy route the CLI can't connect to fails the turn.
1612
- - **codex** uses Codex's own MCP client the same way: the harness writes each granted server in Codex's
1613
- `mcp_servers` (an agent's own `config` still may not), at the session's model proxy with the session's key, with
1614
- only the granted tools enabled. Each call runs without Codex asking (`default_tools_approval_mode = "approve"`): the
1615
- proxy is the gate. Codex sends a call as soon as it starts it, so the proxy records the call in the session before
1616
- it sends anything. Each server is `required`, but the proxy answers its handshake, so a remote server that can't be reached shows at the first call, as that call's error; only a proxy route Codex can't reach fails the turn. A tool whose schema Codex would drop or retype (a `not`, `patternProperties`, ...) is `422` at the save, naming the place and why.
1729
+ - **Every harness** gets each granted tool as a host tool, `mcp__<server>__<tool>`, with the pinned description and
1730
+ schema, on its own channel for host tools: pi binds it in the run's process, claude-agent serves it from its `hands`
1731
+ MCP server (`mcp__hands__mcp__<server>__<tool>`; the CLI's tool search is off in such a session, so the granted tools
1732
+ are offered whole), codex hands it to Codex as a dynamic tool named `mcp_<server>__<tool>` (Codex refuses a
1733
+ dynamic tool named `mcp__*`), and opencode serves it from its `hands` MCP server. No harness's own MCP client is
1734
+ handed a server. Each call passes the run's one tool gate before anything is sent, is booked and recorded like any
1735
+ host tool, and the runner calls the server with the credential: a call set to ask parks the run with nothing sent,
1736
+ and the claim that resumes it runs the call once on the person's allow, or refuses it in their words. A tool whose
1737
+ schema Codex would drop or retype (a `not`, `patternProperties`, ...) is `422` at the save, naming the place and why.
1617
1738
  - **A call** goes to the pinned URL alone, the 2026-07-28 revision first and a 2025-era server through its
1618
1739
  `initialize`; on 2026-07-28 each `x-mcp-header` parameter of the pinned tool is sent as its `Mcp-Param-*` header. No
1619
1740
  redirect is followed, at most 4 MiB is read, and it may take 120 s. The
@@ -1643,7 +1764,17 @@ asked by default.
1643
1764
  list of 1 to 16 of them, the argument one of the list, compared strictly:
1644
1765
  `{"mcp:slack/slack_send_message": {"permission": "allow", "pin": {"channel_id": "C0123"}}}`,
1645
1766
  `{"mcp:github/pull_request_review_write": {"pin": {"event": [null, "COMMENT"], "method": ["create", "delete_pending", "submit_pending"]}}}`
1646
- (the `code-review` template's pin). The gate checks a pinned
1767
+ (the `code-review` template's pin). An object argument may be pinned to its keys instead: `{"keys": [...]}`, 1 to 16
1768
+ key names, holds a call whose argument, when given, is an object of those keys alone, any values (left out or `null`
1769
+ holds too), so `{"mcp:hubspot/HUBSPOT_UPDATE_CONTACT": {"pin": {"properties": {"keys": ["hs_lead_score"]}}}}` lets a
1770
+ write set that one field and no other, and refuses one that sets another with "properties keys in (hs_lead_score)".
1771
+ Two layers' keys pins of one argument hold as the keys in both. A pinned tool takes only its listed arguments: a
1772
+ call of a tool with a pin in either layer may carry only the top-level arguments its listing declares under its
1773
+ inputSchema's `properties` (the listing the run pinned when it started, the one its model is offered), beside the
1774
+ pinned ones. So an alias a server takes for a pinned argument, one its listing does not declare (Gmail's `to` for
1775
+ `recipient_email`, Slack's `channel_id` for `channel`), is refused with "`to` is not an argument of
1776
+ GMAIL_SEND_EMAIL; a pinned tool takes only its listed arguments (recipient_email is pinned)", and a pin need not
1777
+ null aliases by hand. A listing with no `properties` object closes nothing, and a tool with no pin is not closed. The gate checks a pinned
1647
1778
  tool's call before it runs or asks anyone, whatever the permission (an allow, an ask, a grant): a call whose arguments
1648
1779
  are not as pinned is refused, never sent and never asked about, and the model reads "mcp:slack/slack_send_message may
1649
1780
  only be called with channel_id = C0123: its destination is fixed by the agent's settings". The run's process logs a
@@ -1670,23 +1801,25 @@ asked by default.
1670
1801
  ## Webhooks
1671
1802
 
1672
1803
  One URL hears of your runs without anyone watching the page. `PUT /v2/settings/webhook` with `{url}` sets it: an `http`
1673
- or `https` address, with no user or password in it. Loopback and private-network addresses are allowed, so a receiver
1674
- on your own machine or network works. Two kinds of message are POSTed to it about runs: `run.needs_input` when a run comes to
1804
+ or `https` address, with no user or password in it, on a public host: a loopback or private-network address is refused
1805
+ unless the operator allows it (`AGENTRUN_WEBHOOK_PRIVATE_TARGETS=1`, below). Two kinds of message are POSTed to it about runs: `run.needs_input` when a run comes to
1675
1806
  need its person (`input_required`: a question, a call held for approval, a pause at its cap, an ask for its person in
1676
1807
  its browser, desktop or phone, or a stopped turn) and `run.ended` when it ends
1677
1808
  (completed, failed or cancelled, once the run's end is written). A [schedule](#schedules) whose firing fails sends a third,
1678
1809
  `trigger.failed`; a server with no triggers never sends one.
1679
1810
 
1680
- A run's end and its `run.ended` are one durable step. The server chooses the end's time once and gives it to the agent
1681
- store, so the row's `ended_at` and the message's `webhook-id` name one time. `run.ended` is queued only once the agent
1682
- store has the end, so a receiver that reads the run back on its message (`GET /v2/runs/{id}`) reads it ended; while the
1683
- store refuses the end (a full disk, a busy store), nothing is sent, until a later try of the write or the next server
1684
- stores it. The outbox, in the store with the runs, keeps, in the same write as each message, which end and which wait of
1685
- each run it queued. A server that starts queues any end of the last day that the agent store holds and the outbox does
1686
- not, under the same `webhook-id` (one lost to a kill, or to a crash of the machine), and a server that takes over a run
1687
- queues a wait it stands at that the outbox does not name (one the run came to while no server was up), under its one
1688
- `webhook-id`. An end before the webhook was set is never sent. A run is continued only once its end's
1689
- `run.ended` is in the outbox (`503` meanwhile), so a continued run's next end is its own, under its own id.
1811
+ The server follows the store's run-change feed: each run that reaches its end, or that its runner lets go waiting on a
1812
+ person, is told once, in order, whichever runner wrote it, so a receiver that reads the run back on its message
1813
+ (`GET /v2/runs/{id}`) reads it as the message says. The end's time is the store's, so the row's `ended_at` and the
1814
+ message's `webhook-id` name one time. A wait's `webhook-id` comes from its ask (a question's, an approval's call, a
1815
+ pause at the cap, a hand-over), so one ask sends one `run.needs_input`, however often the run is read and after its
1816
+ answer too. Everything the webhook keeps is in the store: its messages, their tries, and which
1817
+ end and which wait of each run it queued, written with each message in one transaction. While the store refuses that
1818
+ write (a full disk, a busy store), nothing is sent and the log says so (`condition=outbox_unwritable`); the server tells
1819
+ the notice again on its next read. A server that starts queues any end of the last day that the store holds and the
1820
+ webhook has not, under the same `webhook-id` (one lost to a kill, or to a crash of the machine), and any wait a run
1821
+ stands at that it has not told (one the run came to while no server was up), under its one `webhook-id`. An end before
1822
+ the webhook was set is never sent.
1690
1823
 
1691
1824
  ```json
1692
1825
  { "type": "run.needs_input", "timestamp": "2026-11-01T12:00:00.000Z",
@@ -1709,16 +1842,23 @@ with any of its libraries: `webhook-id` (the same on every try of a message, so
1709
1842
  the secret's bytes. A receiver checks the signature against the raw body and refuses a timestamp more than 5 minutes
1710
1843
  from its clock, so a replay does not pass. The first `PUT` makes the secret, `whsec_` and 32 random bytes in base64,
1711
1844
  and answers `201` with it, once; `GET /v2/settings/webhook` never shows it. It is kept like a [tool key](#tool-keys):
1712
- sealed under `AGENTRUN_SEAL_KEY`, in the store (SQLite or Postgres) with the webhook itself. A new secret is a `DELETE` and a
1713
- `PUT`; a secret that no longer opens under the server's key (sealed under another) is replaced, and shown once, by the next `PUT`.
1845
+ sealed under the server's seal key in the store, and a replaced or removed one is kept sealed too, so a run that echoes
1846
+ it is still cut. A `PUT` that changes the URL makes a new secret and shows it once, as the first does; one that keeps the
1847
+ URL keeps it. `GET` and the log show the URL's origin and its last four characters, never the whole URL (a chat
1848
+ service's incoming-hook URL is a credential itself). The URL is refused when it is on a private network or this machine,
1849
+ by address or by any address its name resolves to, and each try resolves the name again and dials the address it
1850
+ checked; an operator who sends to an internal receiver sets `AGENTRUN_WEBHOOK_PRIVATE_TARGETS=1` where the server starts. A `DIR/webhook.json` an earlier build left is not read: the
1851
+ server says so at its start (`condition=webhook_left_over`), and a `PUT` sets the webhook again. A new secret for the
1852
+ same URL is a `DELETE` and a `PUT`; a secret that no longer opens under the server's key (sealed under another) is
1853
+ replaced, and shown once, by the next `PUT`. The URL and its secret go live together: a `PUT` whose write the store
1854
+ refuses leaves the webhook as it was, and the secret it made is never used.
1714
1855
 
1715
1856
  A try that is not answered 2xx within 15 s fails; a redirect is not followed. A failed message is tried again on the
1716
1857
  spec's schedule, with jitter: after about 5 s, 5 min, 30 min, 2 h, 5 h and 10 h, then logged as failed
1717
1858
  (`event=webhook condition=delivery_failed`). Each message goes on its own tries, so two queued close together can
1718
1859
  arrive in either order: a receiver orders them by `webhook-timestamp`, or reads the run (`GET /v2/runs/{id}`). A
1719
- `410 Gone` turns the webhook off (`disabled` in `GET`, and the log says why) until a `PUT` sets it again. Pending messages are kept in the store's outbox, so the next server goes on with
1720
- them after a restart; a message can then come twice, under the same `webhook-id`. An outbox of another version
1721
- is not read: the server starts with none, and the log says so (`condition=outbox_not_read`). `GET /v2/settings/webhook/deliveries`
1860
+ `410 Gone` turns the webhook off (`disabled` in `GET`, and the log says why) until a `PUT` sets it again. Pending messages are kept in the store, so the next server goes on with them after a
1861
+ restart; a message can then come twice, under the same `webhook-id`. `GET /v2/settings/webhook/deliveries`
1722
1862
  lists the last 50 attempts (`webhook_id`, type, status code, latency, error, when, and the next try's time), and
1723
1863
  `POST /v2/settings/webhook/deliveries/{webhook_id}/redeliver` sends one of those messages again, once, under the same
1724
1864
  `webhook-id`. `POST /v2/settings/webhook/test` sends a `webhook.test` message once and answers how it went. A webhook a
@@ -1823,6 +1963,21 @@ delivery on the payload's tag, for tracing. A request that carries no scheme's s
1823
1963
  one, or is signed under a scheme other than its trigger's, is the same `401` as a bad signature, and the headers are
1824
1964
  checked before the body is read.
1825
1965
 
1966
+ `composio` takes [Composio](https://composio.dev) trigger events. Register the trigger's `hook_url` as Composio's webhook
1967
+ subscription (`POST /api/v3.1/webhook_subscriptions` with `enabled_events: ["composio.trigger.message"]`); Composio
1968
+ answers with a `secret` it makes, which you give here, whole and as Composio shows it, with `POST /v2/triggers/{id}/secret`
1969
+ and the body `{"secret": "..."}` (the same call replaces it when you rotate it in Composio). A composio trigger is made with no
1970
+ secret (the URL carries its id, so Composio can only make the secret after); until one is set every request is refused. It is sealed as a minted one is and never shown again; this server never
1971
+ makes one for a composio trigger. Composio signs as Standard Webhooks does (`webhook-id`, `webhook-timestamp`, `webhook-signature`) but keyed by the
1972
+ UTF-8 bytes of that secret string, not a decoded `whsec_` key, which is why a `standard` trigger cannot take it. The
1973
+ firing's key is `webhook-id`, the event is the body's `metadata.trigger_slug`, so `accept: [{"event":
1974
+ "GITHUB_ISSUE_ADDED_EVENT"}]` takes one Composio trigger's events, and a rule's `where` pointers read the payload under
1975
+ `/data`. The subscription also delivers account events (`composio.connected_account.expired`,
1976
+ `composio.connected_account.activated`, `composio.trigger.disabled`), signed the same way, with no slug: their event is the
1977
+ body's top-level `type`, so `accept` can take them too. A Composio project's subscription posts every event to the one URL it names, so it fires that one composio
1978
+ trigger and its agent: other triggers never see those deliveries, whatever their `accept`. The tag also names
1979
+ `trigger_id` and `user_id`.
1980
+
1826
1981
  `accept` makes a trigger take only the events it names, from the delivery alone:
1827
1982
 
1828
1983
  ```json
@@ -2017,7 +2172,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
2017
2172
  | `GET /health` | Without a credential: whether the store reads and the disk has room ([capacity and health](#capacity-and-health)). |
2018
2173
  | `GET /openapi.json` | Without a credential: this API as an OpenAPI 3.1 document, the `agentrun.v2/0` contract (vendored in `src/openapi/`, its source in `info`) with this server's own routes marked `x-agentrun-serve` the operations it answers `501` marked `x-agentrun-serve-unsupported`, and a contract operation that takes more than the contract gives marked `x-agentrun-serve-changed` with each change named; `links.openapi` in capabilities points at it. |
2019
2174
  | `GET /capabilities` | Without a credential. `backend: local`, every feature flag present and true only when it works; `tools`, the tools an agentic revision may name; `workflows`, what a workflow revision's model nodes get and, in `workflows.decisions.providers`, the decision providers its typed questions run on; `models`, where models come from and the model of each tier. |
2020
- | `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0, and `cap_mode`, how such a cap prices a request, `expected` or `strict` ([spend cap](#spend-cap)), `max_tool_calls` (agentic only, on pi): the tool calls each conversation of a run may make ([tool-call budget](#tool-call-budget)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced json block meets, which a completed run's `result.output` then holds (null when the answer doesn't meet it), kept by an edit that leaves it out. A template's answer schema is set here at apply, and a run a trigger starts is handed that trigger's last completed `result.output` after its message. `checkout` (agentic only): `pull_request` has the server check out, before each run's first turn, the pull request the run's GitHub event names, in `repo/` at its head with its base and merge base, using a read-only token of its GitHub App that the agent never holds ([GitHub triggers](#github-triggers-connect-github)); `none` clears it, and an edit that leaves it out keeps it. A field the store does not keep (`input_schema`) is `422 input_invalid` by name, and so is a definition that can never run here; one this host cannot run yet saves with `warnings` ([models](#models)). The ETag (`home_etag`) is the current revision's id. `GET /agents/{id}` adds `tools`, the tools its current revision grants with each one's provider ([search and fetch](#search-and-fetch)). |
2175
+ | `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0, and `cap_mode`, how such a cap prices a request, `expected` or `strict` ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced json block meets, which a completed run's `result.output` then holds (null when the answer doesn't meet it), kept by an edit that leaves it out. A template's answer schema is set here at apply, and a run a trigger starts is handed that trigger's last completed `result.output` after its message. `checkout` (agentic only): `pull_request` has the server check out, before each run's first turn, the pull request the run's GitHub event names, in `repo/` at its head with its base and merge base, using a read-only token of its GitHub App that the agent never holds ([GitHub triggers](#github-triggers-connect-github)); `none` clears it, and an edit that leaves it out keeps it. A field the store does not keep (`input_schema`) is `422 input_invalid` by name, and so is a definition that can never run here; one this host cannot run yet saves with `warnings` ([models](#models)). The ETag (`home_etag`) is the current revision's id. `GET /agents/{id}` adds `tools`, the tools its current revision grants with each one's provider ([search and fetch](#search-and-fetch)). |
2021
2176
  | `PUT /agents/{id}/definition` | The same body, checked [the same way](#models): a new revision, its parent the current one, made current. Without `skills` the current revision's skill files carry over. A definition that is the current revision already writes nothing, so a PUT sent twice makes one revision. An agent's id, name and description stay those it was made with. `If-Match` that is not the current ETag is `412 precondition_failed`; the store compares it again inside the commit, so of two edits that read the same revision exactly one lands. The contract's body is taken too: the definition itself, with `If-Match` required (`412` without it) and `definition.version` greater than the current one (`422`). Any such version is taken, and always makes a new revision, the same definition included; the revision is numbered as this server numbers them, the next, and the answer says which; the route reads a body holding `definition` as this one, any other as the contract's. |
2022
2177
  | `GET /agents/{id}/revisions` | The agent's revisions, newest first: `revision`, `version`, `parent`, `kind`, `current`, `note`, `created_at` and the `definition`. |
2023
2178
  | `POST /agents/{id}/current` | `{revision}`: one of the agent's revisions becomes current again. |
@@ -2353,10 +2508,13 @@ server's own origin, under a CSP that allows that origin only, but for the provi
2353
2508
  Its files (`index.html`, and Vite's hashed files under `/assets/`) are public and hold no data: everything it shows
2354
2509
  comes through `/v2`. With accounts on (the default) the console asks for the owner's password
2355
2510
  ([your password](#your-password)) and the browser holds the owner's session cookie; a `?token=` link sets no cookie: the
2356
- token is for scripts and the CLI. With `AGENTRUN_ACCOUNTS=0`, the printed link (`/?token=`) sets a cookie (`HttpOnly`,
2357
- `SameSite=Strict`, `Path=/`, and `Secure` when `X-Forwarded-Proto` says https) and sends the browser to the same address
2358
- without the token. The cookie's value is derived from the token, never the token itself, and it lasts until the browser
2359
- closes. Without it, the console says to open the link. Either cookie takes the place of `Authorization: Bearer` on
2511
+ token is for scripts and the CLI. With `AGENTRUN_ACCOUNTS=0`, the printed link (`/?launch=<code>`, a code each start
2512
+ makes at random) gives the browser a console session: a cookie (`HttpOnly`, `SameSite=Strict`, `Path=/`, and `Secure`
2513
+ when `X-Forwarded-Proto` says https) whose value is an id made at random and kept by the server, and sends the browser
2514
+ to the same address without the code. Nothing about it is derived from the API token, and a `?token=` link sets no
2515
+ cookie there either, so the token alone never holds a console session (and so never writes a secret, below). The
2516
+ session lasts until the browser closes or the server stops; the next start prints its own link. Without it, the console
2517
+ says to open the link. Either cookie takes the place of `Authorization: Bearer` on
2360
2518
  `/v2`: for a `GET`, and for any other method only when the request's `Origin` is the server's own origin
2361
2519
  and its body is `application/json`, or, on a `PUT` or `POST` to a route that takes bytes (`PUT /v2/files/{id}`,
2362
2520
  `POST /v2/files`), of any content type. A request that sends an `Authorization` header is checked on that header alone.
@@ -2519,11 +2677,14 @@ Each run of an agent that learns starts from `main` as it is when the run is mad
2519
2677
  edit; then by name), while they all fit the server's learning budget (`--learning-budget`, 8000 bytes by default).
2520
2678
  Past it, the run reads the notes that bear on it: each active note is scored against the run's first message by a
2521
2679
  lexical match (BM25 over its name, description and text; a code review's changed paths weigh three times its prose; no
2522
- model call), and the run reads the best ones whole while they fit, then one line for each of the rest
2523
- (`- <name> (<file>): <description>`, at most 200 lines and 25 KB), in place of the index. A first message that shares
2524
- no word with any note reads the index's first 200 lines, then the notes changed last, whole, while they fit. An agent
2525
- with the `read` tool is told the notes not given whole are in `.learning/`, to open one when it applies (one without
2526
- is not). A line
2680
+ model call), and the run reads the best ones whole while they fit the budget, then one line each
2681
+ (`- <name> (<file>): <description>`, at most 200 lines and 25 KB) for the next ones while they fit what is left, in
2682
+ place of the index. A note that shares no word with the first message is a line at most. A first message that shares
2683
+ no word with any note reads the notes changed last, whole while they fit, then their lines. Whole notes take the
2684
+ budget before lines do, so an agent with hundreds of notes still reads the ones that bear on the run whole; the notes
2685
+ given neither way are left out, and the run's log names them ("starts without N of the notes its agent learned").
2686
+ An agent with the `read` tool is told the notes not given whole are in `.learning/`, to open one when it applies
2687
+ (one without is not). A line
2527
2688
  before them says to follow a note when it applies. `# Learned` opens, for every run that learns, notes or none, with
2528
2689
  what the run is told of learning: that only what it answers when it is asked at the end is kept, never a file it
2529
2690
  writes, so it tells the person it will keep what they ask it to remember, and that a secret is never kept. A run with
@@ -2642,7 +2803,15 @@ neither, on the agent's own model. `GET /capabilities` names it as `learning.gra
2642
2803
  cheap model is a poor grader, so point the strong tier (or `--grade-model`) at a strong one. The grader reads each active
2643
2804
  note's index line, the whole text only of the notes the proposal supersedes, what the user said in the run (cut of the
2644
2805
  server's secrets, as the proposal keeps it), and the new notes, so its prompt stays under 200,000 characters however
2645
- many notes the folder holds. No injection screen runs before it: a page classifier cannot see where a note came
2806
+ many notes the folder holds. A note must hold beyond the one input it came from: before the grader, one Jev question
2807
+ per new note (the Jev model and keys decision nodes use) asks whether it states a method, a source, a fact or a
2808
+ preference that holds for this job's other inputs, and a note rated below 0.5
2809
+ (`AGENTRUN_SERVE_LEARNING_GENERAL_THRESHOLD`, from 0 to 1) is dropped there, its reason on the verdict; its cost is
2810
+ the grade's. When Jev cannot run, the grader reads every note: the runner's log says why, the run's learning says the
2811
+ check could not run, and the grade's cost is unknown, never the grader's alone (a Jev request that failed may still
2812
+ have been charged). The grader answers General
2813
+ for every item, and one it says is not general is never kept, whatever else it decides. No injection screen runs
2814
+ before it: a page classifier cannot see where a note came
2646
2815
  from, and read a preference the user stated as a planted instruction; the grader's Planted question decides: a rule the
2647
2816
  user states in their own words is theirs, even beside a form or a pasted email in the same message, and a rule found only
2648
2817
  inside text the run read is planted and dropped, never held for the owner's OK. An item that holds an account number is
@@ -2805,7 +2974,7 @@ Who can approve: the owner, signed in with their password. No token approves, th
2805
2974
  `POST .../learning/files/{file}/approve` (and `.../restore`, which puts a retired item back into every run) takes the console's password session, sent from this server's own origin with
2806
2975
  a JSON body as every page write is. Any token is 403: the server's own (what scripts and the MCP endpoint's tools
2807
2976
  carry) and a token sent beside the session. So is every request on a server with accounts off
2808
- (`AGENTRUN_ACCOUNTS=0`), whose page cookie any token holder can mint. With no credential it is 401, as every route.
2977
+ (`AGENTRUN_ACCOUNTS=0`), which has no password session: its console session comes from the launch code, never the token. With no credential it is 401, as every route.
2809
2978
  `capabilities.learning.approve` is true only for the owner's session; every other caller reads `approve: false` with
2810
2979
  `approve_needs: "password"`. A note that is not pending is 400; a stale ETag is 412, none 428. The approval is one host
2811
2980
  commit, `learning: approved by a person: <file>`, with the trailers `Changed-By: user` and `Approved-Via: console`; the
@@ -2853,11 +3022,14 @@ cap, due at the run's first request), the words say the budget instead, on every
2853
3022
  $X, enough for little work: answer as soon as you can." On pi the words go into that one request's context;
2854
3023
  on claude-agent, codex and opencode the model proxy adds them to the body (after everything the CLI sent, so its cached
2855
3024
  prefix is unchanged). Neither CLI nor pi keeps them in its transcript, and no message is queued, so nothing runs after
2856
- the model's answer. Once per cap, across restarts; a raise re-arms it.
2857
-
2858
- A capped run also stops calling tools before its cap stops it. Once what it has spent, plus what its requests and paid
2859
- steps still out are held at (their worst case, as the cap counts them, a browser session's open reserve included),
2860
- reaches 75% of its cap, the run's tool gate
3025
+ the model's answer. Once per cap, across restarts; a raise re-arms it. The note also comes due, if it has not already,
3026
+ on the request whose tool call would be refused now (the wrap-up below: what is left no longer covers what the run keeps
3027
+ back to answer), so the note tells the model what is left no later than its tools stop.
3028
+
3029
+ A capped run also stops calling tools before its cap stops it. It keeps back enough to answer: one typical step (its own
3030
+ answers' typical cost) and one final answer at its least, as the cap prices the main model's next request. Once what it
3031
+ has spent, plus what its requests and paid steps still out are held at (their worst case, as the cap counts them, a
3032
+ browser session's open reserve included), leaves less than that, the run's tool gate
2861
3033
  refuses every call a model makes, in every conversation of the run, on every harness, before any setting or approval
2862
3034
  is read, with one fixed text: "Budget nearly spent: stop calling tools and answer now from what you have." A call that
2863
3035
  would open a child conversation is refused the same way, so no new one starts. Nothing in flight is cut: a child still
@@ -2866,7 +3038,10 @@ model requests are judged by the cap as before, so the run's final answer still
2866
3038
  request that does not fit what is left is refused as above. The figure is read from the run's booking records at each
2867
3039
  call, never kept in memory, so a restart or a claim moved to another runner holds the same line, and a raise moves it.
2868
3040
  Several requests out at once hold far more than they cost, which is why a fan-out of children used to end a small cap
2869
- with no answer at all; the quarter left above the line is the room for each of them, and the parent, to answer.
3041
+ with no answer at all: their holds count as taken, so the run stops calling tools while each of them, and the parent,
3042
+ still has room to answer. A simple run, with nothing else out, uses its cap up to its last step and answer. The run is
3043
+ told what is left (its wrap-up note, above) no later than its first refused call. Its one known miss: a request that
3044
+ writes to its max output can still leave no room for the answer; then the run pauses for a raise rather than overspend.
2870
3045
 
2871
3046
  Under a cap each request is limited to the
2872
3047
  output tokens what is left of the cap can buy, thinking included, never more than it asks for or than the model's
@@ -2879,7 +3054,13 @@ where thinking takes one (Anthropic's, 1,024, the budget squeezed to it at the l
2879
3054
  budget, since its reasoning then shares the limit (minimal 1,024, low 2,048, medium 8,192, high 16,384). The input bound is one token per UTF-8 byte of what is sent (a byte-level tokenizer never makes
2880
3055
  a token of less than one byte), each image counted at what its model's provider bills it by its size in place of its
2881
3056
  base64's bytes, plus what the provider adds server-side (a tool-use prompt), from the same table the model proxy of
2882
- claude-agent, codex and opencode uses; there the proxy measures each request's body. On a route straight to Anthropic
3057
+ claude-agent, codex and opencode uses; there the proxy measures each request's body. On codex and opencode (the
3058
+ Responses API) the text the model reads as it is (a message, a call's arguments, a tool's output, a reasoning summary)
3059
+ counts at its own bytes, not the JSON escapes around it (`\"`, `\n`), which no token is billed for; tool definitions and
3060
+ encrypted reasoning keep every byte. On a route straight to OpenAI (`https://api.openai.com`, codex and opencode), each
3061
+ answer request is also counted by OpenAI's own token count (`POST /v1/responses/input_tokens`, with only the credential
3062
+ and account headers, and never through a gateway or any other base), and its bound is that count when it is below the
3063
+ byte bound. On a route straight to Anthropic
2883
3064
  (`https://api.anthropic.com`, on pi and claude-agent), each answer request is also counted by Anthropic's own free
2884
3065
  token count (`POST /v1/messages/count_tokens`, with only the credential and version headers, and never through a
2885
3066
  gateway or any other base), and its bound is that count plus the tool-use prompt when that is below its bytes. A count
@@ -2893,20 +3074,17 @@ screenshots, then the answer), spending about $0.04 in all:
2893
3074
 
2894
3075
  | Cap mode | Route | First request needs | Five-step run needs | Each further step |
2895
3076
  | --- | --- | --- | --- | --- |
2896
- | `strict` | Through a gateway (OpenRouter): the byte bound | $0.05 | $0.11 | about $0.013 |
3077
+ | `strict` | Through a gateway (OpenRouter): the byte bound | $0.06 | $0.12 | about $0.013 |
2897
3078
  | `strict` | Straight to Anthropic: Anthropic's count | $0.03 | $0.09 | about $0.012 |
2898
- | `expected` (the default) | Either | as `strict` | as `strict` until #2504 lands | as `strict` until #2504 lands |
3079
+ | `expected` (the default) | Either | as `strict` | $0.06 | about $0.007 |
2899
3080
 
2900
- In `strict` mode every step's whole input is priced at the cache-write price. The `expected` row is today's: the runner
2901
- does not yet price a step from what the previous request read from the cache, as `expected` is described above, so it
2902
- prices like `strict` until #2504 lands. Once it does, a five-step run in `expected` mode needs about $0.06 by either route,
2903
- and about $0.007 a further step. A claude-agent run's first request is of the same size (the pinned
3081
+ In `strict` mode every step's whole input is priced at the cache-write price. In `expected` mode a step after the first is priced from what the session's previous request read from the cache, so a five-step run needs about $0.06 by either route, and about $0.007 a further step; the first request is priced as in `strict`, so its figure is the same. A claude-agent run's first request is of the same size (the pinned
2904
3082
  CLI's measured 6,926 bytes with five tools: $0.04 for its first request through a gateway). A cap below these pauses at
2905
- once with `Not sent: ... the next step needs at least $X`, and a raise to that figure sends it on.
3083
+ once with `Not sent: ... the next step needs at least $X`, and a raise to that figure sends it on. (In `strict` mode through a gateway, a run a cent under the five-step figure is not parked before its last step: the cap's wrap-up refuses its last screenshot, and the run answers from what it has.)
2906
3084
  `packages/serve/test/cap-minimum.test.mjs` holds these figures to what the cap does. A request in flight holds what it was admitted at until it answers, so requests
2907
3085
  sent side by side cannot pass the cap together. Spent so far is read from the run's store each time its process starts, so it
2908
- survives a restart, plus each response since, and with them each charge a paid tool booked (`monid.run`, which is itself
2909
- refused once the spend reaches the cap; see [monid](#tools)).
3086
+ survives a restart, plus each response since, and with them each charge a paid tool booked (a monid endpoint's call, which is itself
3087
+ refused once the spend reaches the cap; see [monid](#monid)).
2910
3088
 
2911
3089
  The `browser` tool's session time is held the same way, before it runs, so no browser minute passes the cap. Its next
2912
3090
  stretch is the most a session can run before the run can check again: the provider's minimum (what its release may top
@@ -3062,13 +3240,13 @@ its held worst case.
3062
3240
 
3063
3241
  ### A workflow run under its cap
3064
3242
 
3065
- A workflow run is capped by the same checks, in its own process, each before the paid step is sent:
3243
+ A workflow run is capped by the same checks, on the run's one ledger (the kernel cap), each before the paid step is sent:
3066
3244
 
3067
3245
  | Step | Held at | Where |
3068
3246
  |---|---|---|
3069
- | A model node's request | its expected cost, as an agentic run's request | the run's models (`cap.ts` capModels) |
3247
+ | A model node's request | its expected cost, as an agentic run's request | the run's ledger |
3070
3248
  | A call node's `llm` call | the same | the same, as a side request |
3071
- | A call node's paid tool call (Parallel's search or extract) | its fee | `paidCall`, as an agentic run's |
3249
+ | A call node's paid tool call (Parallel's search or extract) | its fee | the run's ledger, as an agentic run's |
3072
3250
  | A decision on Parallel | its list price for one request, $0.001 | before the driver admits it (`decision-cap.ts`) |
3073
3251
  | A decision on Jev | TypeSafe's published price, $0.042 a million input tokens, one token a byte of its state and questions | the same |
3074
3252
  | A decision on an OpenRouter Decisions model | its catalog price: per request, per image, per input token, and per output token for 256 a question (`expected`) or the catalog's most (`strict`) | the same |
@@ -3088,15 +3266,6 @@ OpenRouter Decisions model the catalog lists no price for: `409 agent_not_runnab
3088
3266
  node's label and its fix. A step no cap fixes all the same (a spend no one knows) ends the run `failed`,
3089
3267
  `spend_cap_reached`, in the cap's words, after the node's label.
3090
3268
 
3091
- ## Tool-call budget
3092
-
3093
- An agentic definition's `max_tool_calls: N` gives each conversation of its runs on pi N tool calls: the run's own, and
3094
- each conversation a tool opens, counted apart. Past N the run's tool gate refuses every call before it runs, before
3095
- any setting or approval is read, with one fixed text: the budget is spent, don't call another tool, answer now from
3096
- what you have. That refusal is not counted and never ends the run, so the model's next answer is the turn's. The count
3097
- is read from the conversation's committed journal, so a restart or a claim moved to another runner keeps it. Above 0
3098
- sets the budget, 0 clears it, an edit that leaves it out keeps it; a workflow's, or one on another harness, is `422`.
3099
-
3100
3269
  ## The faux model
3101
3270
 
3102
3271
  `--faux MODULE` loads `MODULE` in each run's process. Its default export is called for every model request with the
@@ -3183,7 +3352,7 @@ carries no cost at all, as from a provider that does not price the model. The te
3183
3352
  `SENTRY_DSN`, `DB_PWD`; never `PWD` or `OLDPWD`), whether the launcher's list names it or not. The rule is
3184
3353
  `keyShaped` (`src/secret-cut.ts`), which an import's cut and a harness's log take too. The keys a
3185
3354
  run needs are read from the store at its claim, opened with the seal key, and are put on that run's environment alone.
3186
- It gets none of the boxes' keys ([Boxes](#boxes)). A tool key reaches it only when its
3355
+ It gets none of the boxes' keys ([Sandbox](#sandbox)). A tool key reaches it only when its
3187
3356
  revision names a tool the key unlocks (`MONID_API_KEY` a monid tool, `BROWSERBASE_API_KEY` and `KERNEL_API_KEY` `browser`; a workflow's
3188
3357
  tools are those its model and call nodes name), and a model key only when its model needs it ([Models](#models)), read
3189
3358
  from the revision at each claim, a resume after a restart included.