@parcha/agentrun-serve 0.1.0-beta.35 → 0.1.0-beta.37

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 (522) hide show
  1. package/CHANGELOG.md +298 -0
  2. package/README.md +417 -219
  3. package/dist/adapters.d.ts +12 -2
  4. package/dist/adapters.js +27 -2
  5. package/dist/agent-rows.d.ts +2 -1
  6. package/dist/agents-store.d.ts +2 -0
  7. package/dist/agents-store.js +9 -4
  8. package/dist/api-only.d.ts +2 -1
  9. package/dist/api-only.js +3 -1
  10. package/dist/archil-routes.d.ts +40 -7
  11. package/dist/archil-routes.js +167 -54
  12. package/dist/archil-settings.d.ts +79 -7
  13. package/dist/archil-settings.js +140 -14
  14. package/dist/attach-conformance-cli.d.ts +1 -0
  15. package/dist/attach-conformance-cli.js +18 -0
  16. package/dist/attach-conformance.d.ts +25 -0
  17. package/dist/attach-conformance.js +343 -0
  18. package/dist/attach-images.d.ts +15 -0
  19. package/dist/attach-images.js +59 -0
  20. package/dist/background.d.ts +0 -6
  21. package/dist/background.js +0 -28
  22. package/dist/box-image.d.ts +1 -97
  23. package/dist/box-image.js +4 -284
  24. package/dist/box-paths.d.ts +2 -7
  25. package/dist/box-paths.js +7 -13
  26. package/dist/box-settings.d.ts +0 -11
  27. package/dist/box-settings.js +4 -29
  28. package/dist/browser-commands.js +1 -1
  29. package/dist/browser-computer.d.ts +47 -3
  30. package/dist/browser-computer.js +286 -18
  31. package/dist/browser-cost.d.ts +1 -1
  32. package/dist/browser-live.d.ts +20 -8
  33. package/dist/browser-live.js +50 -27
  34. package/dist/browser-person.d.ts +19 -2
  35. package/dist/browser-person.js +55 -6
  36. package/dist/browser-wait-ended.d.ts +23 -0
  37. package/dist/browser-wait-ended.js +42 -0
  38. package/dist/cap.d.ts +12 -57
  39. package/dist/cap.js +20 -160
  40. package/dist/catalog.d.ts +1 -12
  41. package/dist/catalog.js +3 -33
  42. package/dist/cli.js +17 -26
  43. package/dist/composio-preset.d.ts +36 -0
  44. package/dist/composio-preset.js +179 -0
  45. package/dist/computer-attach.d.ts +125 -0
  46. package/dist/computer-attach.js +330 -0
  47. package/dist/computer-calls.d.ts +48 -0
  48. package/dist/computer-calls.js +126 -0
  49. package/dist/computer-channel.d.ts +57 -0
  50. package/dist/computer-channel.js +115 -0
  51. package/dist/computer-commands.d.ts +1 -1
  52. package/dist/computer-held-routes.d.ts +35 -0
  53. package/dist/computer-held-routes.js +106 -0
  54. package/dist/computer-held.d.ts +48 -0
  55. package/dist/computer-held.js +87 -0
  56. package/dist/computer-keys.d.ts +21 -1
  57. package/dist/computer-keys.js +53 -11
  58. package/dist/computer-live.d.ts +160 -0
  59. package/dist/computer-live.js +643 -0
  60. package/dist/computer-routes.d.ts +1 -4
  61. package/dist/computer-routes.js +3 -5
  62. package/dist/computer-setting.d.ts +2 -0
  63. package/dist/computer-setting.js +38 -1
  64. package/dist/computer-view.d.ts +24 -2
  65. package/dist/computer-view.js +51 -3
  66. package/dist/computer-viewer.d.ts +6 -0
  67. package/dist/computer-viewer.js +297 -0
  68. package/dist/computers.d.ts +79 -12
  69. package/dist/computers.js +147 -28
  70. package/dist/console/assets/index-Cn6JX1uH.js +563 -0
  71. package/dist/console/assets/index-DRN62V5v.css +1 -0
  72. package/dist/console/index.html +2 -2
  73. package/dist/docker-daemon.d.ts +2 -2
  74. package/dist/docker-daemon.js +2 -2
  75. package/dist/errors.js +5 -5
  76. package/dist/faux-computers.d.ts +9 -20
  77. package/dist/faux-computers.js +56 -24
  78. package/dist/files.d.ts +1 -9
  79. package/dist/files.js +1 -9
  80. package/dist/github-connection.d.ts +10 -2
  81. package/dist/github-connection.js +65 -2
  82. package/dist/github-faux.js +1 -1
  83. package/dist/github.d.ts +22 -2
  84. package/dist/github.js +42 -8
  85. package/dist/gpu-words.d.ts +14 -0
  86. package/dist/gpu-words.js +21 -0
  87. package/dist/graph-view.d.ts +3 -1
  88. package/dist/graph-view.js +25 -1
  89. package/dist/handed-values.d.ts +1 -1
  90. package/dist/handed-values.js +1 -1
  91. package/dist/harness-install.d.ts +60 -3
  92. package/dist/harness-install.js +322 -34
  93. package/dist/harness.d.ts +1 -0
  94. package/dist/harness.js +36 -2
  95. package/dist/host-tools.d.ts +9 -10
  96. package/dist/host-tools.js +7 -7
  97. package/dist/hosted-search.d.ts +5 -4
  98. package/dist/hosted-search.js +2 -7
  99. package/dist/import-sources.d.ts +10 -0
  100. package/dist/import-sources.js +44 -2
  101. package/dist/import.d.ts +3 -3
  102. package/dist/import.js +37 -6
  103. package/dist/index.d.ts +1 -3
  104. package/dist/index.js +1 -2
  105. package/dist/key-refusal.d.ts +1 -1
  106. package/dist/key-refusal.js +2 -2
  107. package/dist/learn/check.d.ts +11 -2
  108. package/dist/learn/check.js +124 -6
  109. package/dist/learn/commit.d.ts +43 -7
  110. package/dist/learn/commit.js +166 -22
  111. package/dist/learn/folder.d.ts +11 -0
  112. package/dist/learn/folder.js +37 -1
  113. package/dist/learn/general.d.ts +66 -0
  114. package/dist/learn/general.js +73 -0
  115. package/dist/learn/grade.d.ts +22 -1
  116. package/dist/learn/grade.js +107 -16
  117. package/dist/learn/index.d.ts +1 -1
  118. package/dist/learn/index.js +1 -1
  119. package/dist/learn/learning.sh +12 -1
  120. package/dist/learn/notes.d.ts +3 -0
  121. package/dist/learn/notes.js +3 -0
  122. package/dist/learn/reflect.d.ts +14 -2
  123. package/dist/learn/reflect.js +54 -30
  124. package/dist/learn/skills.d.ts +37 -5
  125. package/dist/learn/skills.js +60 -7
  126. package/dist/learned-nodes.d.ts +6 -2
  127. package/dist/learned-workflow.d.ts +43 -9
  128. package/dist/learned-workflow.js +128 -37
  129. package/dist/learning-batch.d.ts +283 -0
  130. package/dist/learning-batch.js +574 -0
  131. package/dist/learning-cost.d.ts +79 -0
  132. package/dist/learning-cost.js +69 -0
  133. package/dist/learning-evals.d.ts +33 -0
  134. package/dist/learning-evals.js +98 -0
  135. package/dist/learning-routes.d.ts +32 -4
  136. package/dist/learning-routes.js +48 -12
  137. package/dist/learning-words.d.ts +9 -0
  138. package/dist/learning-words.js +12 -2
  139. package/dist/learning.d.ts +39 -19
  140. package/dist/learning.js +88 -46
  141. package/dist/live/stream.js +6 -3
  142. package/dist/live/translate.d.ts +4 -3
  143. package/dist/live/translate.js +8 -4
  144. package/dist/live-reach.d.ts +37 -0
  145. package/dist/live-reach.js +62 -0
  146. package/dist/mcp-gateway.d.ts +9 -0
  147. package/dist/mcp-gateway.js +60 -11
  148. package/dist/mcp-oauth.d.ts +57 -7
  149. package/dist/mcp-oauth.js +133 -18
  150. package/dist/mcp-private-hosts.d.ts +4 -4
  151. package/dist/mcp-private-hosts.js +20 -12
  152. package/dist/mcp-probe.d.ts +27 -3
  153. package/dist/mcp-probe.js +106 -29
  154. package/dist/mcp-secret-writes.js +8 -0
  155. package/dist/mcp-servers-store.d.ts +38 -15
  156. package/dist/mcp-servers-store.js +120 -23
  157. package/dist/mcp-store.d.ts +10 -4
  158. package/dist/mcp-store.js +17 -6
  159. package/dist/model-form.d.ts +26 -0
  160. package/dist/model-form.js +80 -0
  161. package/dist/model.d.ts +5 -5
  162. package/dist/model.js +29 -16
  163. package/dist/openapi.d.ts +2 -0
  164. package/dist/openapi.js +586 -64
  165. package/dist/owner.d.ts +0 -1
  166. package/dist/owner.js +0 -2
  167. package/dist/page.d.ts +18 -0
  168. package/dist/page.js +48 -20
  169. package/dist/paid-calls.d.ts +1 -1
  170. package/dist/paid-calls.js +1 -1
  171. package/dist/place-offers.d.ts +96 -0
  172. package/dist/place-offers.js +202 -0
  173. package/dist/place.d.ts +9 -13
  174. package/dist/place.js +21 -32
  175. package/dist/port-models.d.ts +2 -1
  176. package/dist/port-models.js +5 -3
  177. package/dist/print.d.ts +16 -9
  178. package/dist/print.js +15 -17
  179. package/dist/propose.d.ts +4 -0
  180. package/dist/propose.js +34 -11
  181. package/dist/provider.js +3 -2
  182. package/dist/reflect-range.d.ts +8 -1
  183. package/dist/reflect-range.js +1 -1
  184. package/dist/run-cut.d.ts +5 -0
  185. package/dist/run-cut.js +19 -0
  186. package/dist/run-launch.d.ts +28 -3
  187. package/dist/run-launch.js +14 -4
  188. package/dist/run-learning-served.d.ts +2 -2
  189. package/dist/run-manifest.d.ts +2 -2
  190. package/dist/run-manifest.js +2 -2
  191. package/dist/run-reads-over-store.d.ts +1 -1
  192. package/dist/run-repo.d.ts +20 -0
  193. package/dist/run-repo.js +63 -0
  194. package/dist/run-secrets.js +3 -3
  195. package/dist/run-timeline-served.d.ts +1 -1
  196. package/dist/run-timeline-served.js +56 -44
  197. package/dist/run-view.d.ts +8 -5
  198. package/dist/run-view.js +18 -10
  199. package/dist/runnable.d.ts +2 -2
  200. package/dist/runnable.js +6 -2
  201. package/dist/runner/adapter-loop.d.ts +39 -8
  202. package/dist/runner/adapter-loop.js +770 -83
  203. package/dist/runner/adapter-run-spec.d.ts +36 -7
  204. package/dist/runner/adapter-run-spec.js +171 -37
  205. package/dist/runner/adapters/pi-computer.d.ts +7 -0
  206. package/dist/runner/adapters/pi-computer.js +43 -0
  207. package/dist/runner/adapters/pi.d.ts +20 -7
  208. package/dist/runner/adapters/pi.js +111 -26
  209. package/dist/runner/beside.d.ts +7 -3
  210. package/dist/runner/beside.js +26 -12
  211. package/dist/runner/claim-secrets.d.ts +4 -0
  212. package/dist/runner/claim-secrets.js +6 -1
  213. package/dist/runner/cli-run-spec.d.ts +27 -3
  214. package/dist/runner/cli-run-spec.js +198 -74
  215. package/dist/runner/commands.d.ts +8 -2
  216. package/dist/runner/commands.js +31 -6
  217. package/dist/runner/computer-channel.d.ts +34 -0
  218. package/dist/runner/computer-channel.js +61 -0
  219. package/dist/runner/conformance/harness.d.ts +0 -1
  220. package/dist/runner/conformance/harness.js +87 -18
  221. package/dist/runner/conformance/subject.d.ts +1 -1
  222. package/dist/runner/dispatch.js +3 -0
  223. package/dist/runner/end-of-run.d.ts +22 -12
  224. package/dist/runner/end-of-run.js +38 -16
  225. package/dist/runner/github-app.d.ts +2 -1
  226. package/dist/runner/github-app.js +6 -4
  227. package/dist/runner/harness-loops.js +16 -2
  228. package/dist/runner/held-run.d.ts +65 -0
  229. package/dist/runner/held-run.js +158 -0
  230. package/dist/runner/journal-kinds.d.ts +35 -6
  231. package/dist/runner/journal-kinds.js +20 -1
  232. package/dist/runner/journal-reader.d.ts +5 -4
  233. package/dist/runner/journal-reader.js +12 -10
  234. package/dist/runner/learning-ask.d.ts +7 -1
  235. package/dist/runner/learning-ask.js +21 -6
  236. package/dist/runner/learning-dispatch.d.ts +22 -0
  237. package/dist/runner/learning-dispatch.js +77 -10
  238. package/dist/runner/learning-end.d.ts +37 -1
  239. package/dist/runner/learning-end.js +115 -14
  240. package/dist/runner/learning-factory.d.ts +1 -1
  241. package/dist/runner/learning-factory.js +15 -5
  242. package/dist/runner/learning-loop.d.ts +139 -7
  243. package/dist/runner/learning-loop.js +369 -32
  244. package/dist/runner/learning-seed.d.ts +9 -0
  245. package/dist/runner/learning-seed.js +14 -1
  246. package/dist/runner/live-ticker.js +1 -0
  247. package/dist/runner/loop-contract.d.ts +16 -1
  248. package/dist/runner/loop-contract.js +6 -0
  249. package/dist/runner/loop.d.ts +10 -2
  250. package/dist/runner/loop.js +22 -1
  251. package/dist/runner/main.d.ts +13 -1
  252. package/dist/runner/main.js +38 -6
  253. package/dist/runner/mcp-claim.d.ts +11 -4
  254. package/dist/runner/mcp-claim.js +140 -23
  255. package/dist/runner/mcp-github.d.ts +4 -2
  256. package/dist/runner/mcp-github.js +1 -8
  257. package/dist/runner/mcp-run.d.ts +6 -4
  258. package/dist/runner/mcp-run.js +16 -3
  259. package/dist/runner/metrics.d.ts +15 -2
  260. package/dist/runner/metrics.js +21 -2
  261. package/dist/runner/model-route.d.ts +3 -0
  262. package/dist/runner/model-route.js +5 -2
  263. package/dist/runner/pr-checkout.d.ts +60 -0
  264. package/dist/runner/pr-checkout.js +176 -0
  265. package/dist/runner/reflect-hook.d.ts +19 -0
  266. package/dist/runner/reflect-hook.js +20 -8
  267. package/dist/runner/runner.d.ts +26 -0
  268. package/dist/runner/runner.js +231 -27
  269. package/dist/runner/scratch-sweep.d.ts +13 -0
  270. package/dist/runner/scratch-sweep.js +62 -0
  271. package/dist/runner/sessions.d.ts +1 -1
  272. package/dist/runner/spec-holds.d.ts +8 -3
  273. package/dist/runner/spec-holds.js +12 -10
  274. package/dist/runner/store-port.d.ts +7 -2
  275. package/dist/runner/store-secrets.js +21 -4
  276. package/dist/runner/subagent.d.ts +44 -0
  277. package/dist/runner/subagent.js +190 -0
  278. package/dist/runner/workflow-host.d.ts +24 -3
  279. package/dist/runner/workflow-host.js +24 -4
  280. package/dist/runner/workflow-loop.d.ts +6 -3
  281. package/dist/runner/workflow-loop.js +9 -8
  282. package/dist/runner/workflow-spec.d.ts +39 -15
  283. package/dist/runner/workflow-spec.js +143 -40
  284. package/dist/runs-over-store.d.ts +16 -6
  285. package/dist/runs-over-store.js +145 -29
  286. package/dist/seal-key.js +3 -3
  287. package/dist/sealed-settings-store.d.ts +5 -2
  288. package/dist/sealed-settings-store.js +10 -4
  289. package/dist/sealing.js +1 -2
  290. package/dist/secret-cut.d.ts +1 -1
  291. package/dist/secret-cut.js +1 -1
  292. package/dist/secret-writes.d.ts +5 -4
  293. package/dist/secret-writes.js +5 -4
  294. package/dist/server-secrets-store.d.ts +4 -3
  295. package/dist/server-secrets-store.js +15 -9
  296. package/dist/server-secrets.js +3 -2
  297. package/dist/server.d.ts +75 -63
  298. package/dist/server.js +712 -316
  299. package/dist/settings-wake.d.ts +21 -0
  300. package/dist/settings-wake.js +59 -0
  301. package/dist/standard-webhooks.d.ts +4 -1
  302. package/dist/standard-webhooks.js +8 -4
  303. package/dist/store/agent-body.d.ts +9 -2
  304. package/dist/store/agent-body.js +16 -8
  305. package/dist/store/command-wake.d.ts +12 -0
  306. package/dist/store/command-wake.js +37 -0
  307. package/dist/store/deadline.js +9 -5
  308. package/dist/store/dialect.d.ts +6 -0
  309. package/dist/store/dialect.js +5 -0
  310. package/dist/store/index.d.ts +4 -4
  311. package/dist/store/index.js +2 -2
  312. package/dist/store/journal/storage.d.ts +3 -2
  313. package/dist/store/journal/storage.js +15 -6
  314. package/dist/store/postgres/connection.js +9 -4
  315. package/dist/store/postgres/dialect.js +4 -0
  316. package/dist/store/postgres/migrations/0004_runs_outcome_stop_or_cancel.sql +11 -0
  317. package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
  318. package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
  319. package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
  320. package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
  321. package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
  322. package/dist/store/schema.d.ts +2 -1
  323. package/dist/store/schema.js +85 -13
  324. package/dist/store/seal.d.ts +13 -0
  325. package/dist/store/seal.js +19 -0
  326. package/dist/store/sqlite/connection.d.ts +5 -0
  327. package/dist/store/sqlite/connection.js +88 -47
  328. package/dist/store/sqlite/run-patch.d.ts +25 -7
  329. package/dist/store/sqlite/run-patch.js +58 -14
  330. package/dist/store/sqlite/store.js +331 -59
  331. package/dist/store/store.d.ts +330 -21
  332. package/dist/store/store.js +34 -2
  333. package/dist/store-reads/analytics.js +3 -2
  334. package/dist/store-reads/cap.d.ts +2 -4
  335. package/dist/store-reads/cap.js +16 -7
  336. package/dist/store-reads/decisions.d.ts +3 -3
  337. package/dist/store-reads/decisions.js +3 -6
  338. package/dist/store-reads/import-summary.d.ts +1 -1
  339. package/dist/store-reads/journal.d.ts +5 -4
  340. package/dist/store-reads/journal.js +118 -27
  341. package/dist/store-reads/learning.d.ts +34 -4
  342. package/dist/store-reads/learning.js +137 -23
  343. package/dist/store-reads/runs.d.ts +7 -5
  344. package/dist/store-reads/runs.js +17 -10
  345. package/dist/store-reads/stats.js +5 -1
  346. package/dist/store-reads/workflow.d.ts +1 -1
  347. package/dist/store-view.d.ts +5 -0
  348. package/dist/store-view.js +70 -29
  349. package/dist/template-eval.js +8 -5
  350. package/dist/template-github-permissions.d.ts +22 -8
  351. package/dist/template-github-permissions.js +35 -15
  352. package/dist/templates.d.ts +64 -0
  353. package/dist/templates.js +101 -16
  354. package/dist/timeline/timeline.d.ts +30 -1
  355. package/dist/timeline/timeline.js +29 -13
  356. package/dist/timeline/util.d.ts +4 -0
  357. package/dist/timeline/util.js +14 -0
  358. package/dist/tool-blurbs.js +1 -0
  359. package/dist/tool-budget.d.ts +27 -7
  360. package/dist/tool-budget.js +21 -9
  361. package/dist/tool-gate.d.ts +23 -10
  362. package/dist/tool-gate.js +60 -44
  363. package/dist/tool-plane.d.ts +46 -28
  364. package/dist/tool-plane.js +73 -31
  365. package/dist/tools.d.ts +31 -38
  366. package/dist/tools.js +117 -74
  367. package/dist/trigger-adapter.d.ts +4 -0
  368. package/dist/trigger-secrets-shown.d.ts +2 -2
  369. package/dist/trigger-secrets-shown.js +1 -1
  370. package/dist/trigger-signatures.d.ts +26 -6
  371. package/dist/trigger-signatures.js +44 -8
  372. package/dist/trigger-targets.d.ts +2 -0
  373. package/dist/trigger-targets.js +1 -0
  374. package/dist/trigger-webhook.js +5 -2
  375. package/dist/triggers.d.ts +10 -6
  376. package/dist/triggers.js +37 -7
  377. package/dist/turn-end.d.ts +0 -3
  378. package/dist/turn-end.js +0 -3
  379. package/dist/turns.js +16 -1
  380. package/dist/usage-lines.d.ts +1 -1
  381. package/dist/validate.d.ts +6 -0
  382. package/dist/validate.js +41 -4
  383. package/dist/web-fetch.d.ts +1 -1
  384. package/dist/web-search.d.ts +10 -5
  385. package/dist/web-search.js +7 -6
  386. package/dist/webhooks.d.ts +147 -103
  387. package/dist/webhooks.js +564 -324
  388. package/dist/workflow/decision-recovery.d.ts +23 -0
  389. package/dist/workflow/decision-recovery.js +80 -0
  390. package/dist/workflow/decisions.d.ts +134 -0
  391. package/dist/workflow/decisions.js +46 -0
  392. package/dist/workflow/host-session.d.ts +5 -0
  393. package/dist/workflow/host-session.js +85 -0
  394. package/dist/workflow/host-tools.d.ts +3 -0
  395. package/dist/workflow/host-tools.js +3 -0
  396. package/dist/workflow/node-runner.d.ts +113 -0
  397. package/dist/workflow/node-runner.js +270 -0
  398. package/dist/workflow/node.d.ts +89 -0
  399. package/dist/workflow/node.js +101 -0
  400. package/dist/workflow/operator-error.d.ts +4 -0
  401. package/dist/workflow/operator-error.js +4 -0
  402. package/dist/workflow/pi-versions.d.ts +32 -0
  403. package/dist/workflow/pi-versions.js +65 -0
  404. package/dist/workflow/record-file.d.ts +10 -0
  405. package/dist/workflow/record-file.js +56 -0
  406. package/dist/workflow/record-tool.d.ts +77 -0
  407. package/dist/workflow/record-tool.js +126 -0
  408. package/dist/workflow/record.d.ts +151 -0
  409. package/dist/workflow/record.js +401 -0
  410. package/dist/workflow/run-error.d.ts +16 -0
  411. package/dist/workflow/run-error.js +26 -0
  412. package/dist/workflow/runner.d.ts +6 -0
  413. package/dist/workflow/runner.js +240 -0
  414. package/dist/workflow/store.d.ts +23 -0
  415. package/dist/workflow/store.js +242 -0
  416. package/dist/workflow/task.d.ts +133 -0
  417. package/dist/workflow/task.js +412 -0
  418. package/dist/workflow/thinking.d.ts +3 -0
  419. package/dist/workflow/thinking.js +7 -0
  420. package/dist/workflow/tool-context.d.ts +21 -0
  421. package/dist/workflow/tool-context.js +13 -0
  422. package/dist/workflow/types.d.ts +126 -0
  423. package/dist/workflow/types.js +1 -0
  424. package/dist/workflow-run.d.ts +2 -2
  425. package/dist/workspace/agent-computer.d.ts +137 -0
  426. package/dist/workspace/agent-computer.js +292 -0
  427. package/dist/workspace/archil-claim.d.ts +11 -0
  428. package/dist/workspace/archil-claim.js +18 -10
  429. package/dist/workspace/archil-disks.d.ts +49 -0
  430. package/dist/workspace/archil-disks.js +185 -0
  431. package/dist/workspace/archil-exec.js +2 -3
  432. package/dist/workspace/archil-mount-credential.d.ts +20 -4
  433. package/dist/workspace/archil-mount-credential.js +13 -4
  434. package/dist/workspace/attached-computers.d.ts +41 -0
  435. package/dist/workspace/attached-computers.js +114 -0
  436. package/dist/workspace/computer-deps.d.ts +32 -17
  437. package/dist/workspace/computer-deps.js +37 -14
  438. package/dist/workspace/computer-for-claim.d.ts +58 -13
  439. package/dist/workspace/computer-for-claim.js +267 -26
  440. package/dist/workspace/computer-hold.d.ts +11 -27
  441. package/dist/workspace/computer-hold.js +36 -56
  442. package/dist/workspace/computer-janitor.d.ts +3 -2
  443. package/dist/workspace/computer-janitor.js +43 -9
  444. package/dist/workspace/computer-ledger.d.ts +5 -1
  445. package/dist/workspace/computer-ledger.js +11 -0
  446. package/dist/workspace/computer-mcp.d.ts +25 -0
  447. package/dist/workspace/computer-mcp.js +41 -0
  448. package/dist/workspace/computer-ports.d.ts +4 -13
  449. package/dist/workspace/computer-ports.js +4 -107
  450. package/dist/workspace/computer-script.d.ts +37 -0
  451. package/dist/workspace/computer-script.js +138 -0
  452. package/dist/workspace/executors.d.ts +1 -1
  453. package/dist/workspace/index.d.ts +7 -4
  454. package/dist/workspace/index.js +4 -1
  455. package/dist/workspace/kind-skills/desktop/SKILL.md +119 -84
  456. package/dist/workspace/kind-skills/phone/SKILL.md +100 -85
  457. package/dist/workspace/resolve-computer.d.ts +45 -11
  458. package/dist/workspace/resolve-computer.js +72 -14
  459. package/dist/workspace/run-disk.d.ts +34 -0
  460. package/dist/workspace/run-disk.js +91 -0
  461. package/dist/workspace/run-tools.d.ts +35 -18
  462. package/dist/workspace/run-tools.js +24 -29
  463. package/dist/workspace/server-run-workspace.d.ts +3 -2
  464. package/dist/workspace/server-run-workspace.js +17 -4
  465. package/dist/workspace.js +1 -1
  466. package/package.json +19 -21
  467. package/templates/README.md +9 -6
  468. package/templates/code-review/agent.md +27 -11
  469. package/templates/code-review/evals/clean-refactor/graders/coverage.md +4 -0
  470. package/templates/code-review/evals/clean-refactor/graders/risk.md +5 -0
  471. package/templates/code-review/evals/injection/graders/ignores.md +1 -1
  472. package/templates/code-review/evals/never-flag/case.yaml +3 -0
  473. package/templates/code-review/evals/never-flag/graders/only-p0.md +4 -0
  474. package/templates/code-review/evals/never-flag/graders/schema.md +5 -0
  475. package/templates/code-review/evals/never-flag/prompt.md +30 -0
  476. package/templates/code-review/evals/null-name/graders/finds.md +1 -1
  477. package/templates/code-review/evals/off-by-one/graders/finds.md +1 -1
  478. package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +6 -5
  479. package/templates/code-review/evals/re-review/graders/resolves.md +1 -1
  480. package/templates/code-review/evals/re-review/prompt.md +1 -1
  481. package/templates/code-review/evals/re-review-open/case.yaml +3 -0
  482. package/templates/code-review/evals/re-review-open/graders/schema.md +5 -0
  483. package/templates/code-review/evals/re-review-open/graders/stays-open.md +4 -0
  484. package/templates/code-review/evals/re-review-open/prompt.md +27 -0
  485. package/templates/code-review/evals/repo-rule/graders/cites.md +1 -1
  486. package/templates/code-review/evals/two-defects/case.yaml +3 -0
  487. package/templates/code-review/evals/two-defects/graders/both.md +4 -0
  488. package/templates/code-review/evals/two-defects/graders/schema.md +5 -0
  489. package/templates/code-review/evals/two-defects/prompt.md +25 -0
  490. package/templates/code-review/findings.schema.json +131 -27
  491. package/templates/code-review/rules/CODEREVIEW.md +76 -0
  492. package/templates/code-review/skills/review/DEEP.md +130 -0
  493. package/templates/code-review/skills/review/REVIEWER.md +116 -0
  494. package/templates/code-review/skills/review/SKILL.md +104 -154
  495. package/templates/market-monitor/agent.md +1 -1
  496. package/dist/box/record.d.ts +0 -6
  497. package/dist/box/record.js +0 -41
  498. package/dist/box/sweep.d.ts +0 -53
  499. package/dist/box/sweep.js +0 -193
  500. package/dist/box-egress-vm.d.ts +0 -118
  501. package/dist/box-egress-vm.js +0 -354
  502. package/dist/box-egress.d.ts +0 -105
  503. package/dist/box-egress.js +0 -256
  504. package/dist/box-relay-vm.d.ts +0 -84
  505. package/dist/box-relay-vm.js +0 -437
  506. package/dist/box-relay.d.ts +0 -36
  507. package/dist/box-relay.js +0 -207
  508. package/dist/boxes.d.ts +0 -109
  509. package/dist/boxes.js +0 -249
  510. package/dist/budget.d.ts +0 -71
  511. package/dist/budget.js +0 -199
  512. package/dist/console/assets/index-B7NKTU8E.css +0 -1
  513. package/dist/console/assets/index-CXZMgJE7.js +0 -550
  514. package/dist/daytona-api.d.ts +0 -10
  515. package/dist/daytona-api.js +0 -20
  516. package/dist/egress-proxy.d.ts +0 -45
  517. package/dist/egress-proxy.js +0 -416
  518. package/dist/egress-table.d.ts +0 -24
  519. package/dist/egress-table.js +0 -165
  520. package/dist/run-db.d.ts +0 -53
  521. package/dist/run-db.js +0 -116
  522. package/templates/code-review/rules/REVIEW.md +0 -41
@@ -8,6 +8,8 @@
8
8
  // that trigger's own with owner false, so a forged or lost origin never reads as the person's or the owner's.
9
9
  import { originOf } from "./timeline/index.js";
10
10
  import { isObject } from "./validate.js";
11
+ /** The disk a launch body names, as read back, or undefined. */
12
+ const readDisk = (value) => isObject(value) && typeof value.disk_id === "string" && (value.kind === "launch" || value.kind === "agent") ? { diskId: value.disk_id, kind: value.kind } : undefined;
11
13
  /** The trigger a launch body names, as read back: `{ id, firing_key }`, or null (triggerOf of the old serve.json). */
12
14
  function readTrigger(value) {
13
15
  return isObject(value) && typeof value.id === "string" && typeof value.firing_key === "string" ? { id: value.id, firing_key: value.firing_key } : null;
@@ -44,6 +46,7 @@ export function launchBody(launch) {
44
46
  return {
45
47
  input: launch.input,
46
48
  title: launch.title,
49
+ ...(launch.repo !== undefined ? { repo: launch.repo } : {}),
47
50
  place: launch.place,
48
51
  ...(launch.harness !== undefined ? { harness: launch.harness } : {}),
49
52
  ...(launch.model ? { model: launch.model } : {}),
@@ -56,14 +59,17 @@ export function launchBody(launch) {
56
59
  ...(launch.boxAllow !== undefined ? { box_allow: launch.boxAllow } : {}),
57
60
  ...(launch.boxAllowSet ? { box_allow_set: true } : {}),
58
61
  ...(launch.files?.length ? { files: launch.files } : {}),
59
- ...(launch.learning ? { learning: { given: launch.learning.given.map((note) => ({ file: note.file, name: note.name })), seed: launch.learning.seed, section: launch.learning.section, ...(launch.learning.seedNotes !== undefined ? { seedNotes: launch.learning.seedNotes } : {}), ...(launch.learning.skills?.length ? { skills: [...launch.learning.skills] } : {}), ...(launch.learning.workflows?.length ? { workflows: [...launch.learning.workflows] } : {}), ...(launch.learning.gradeModel ? { gradeModel: launch.learning.gradeModel } : {}), ...(launch.learning.seedFailed ? { seedFailed: launch.learning.seedFailed } : {}) } } : {}),
62
+ ...(launch.learning ? { learning: { given: launch.learning.given.map((note) => ({ file: note.file, name: note.name })), seed: launch.learning.seed, section: launch.learning.section, ...(launch.learning.seedNotes !== undefined ? { seedNotes: launch.learning.seedNotes } : {}), ...(launch.learning.notesLeftOut?.length ? { notesLeftOut: [...launch.learning.notesLeftOut] } : {}), ...(launch.learning.skills?.length ? { skills: [...launch.learning.skills] } : {}), ...(launch.learning.notesOnly ? { notesOnly: true } : {}), ...(launch.learning.workflows?.length ? { workflows: [...launch.learning.workflows] } : {}), ...(launch.learning.gradeModel ? { gradeModel: launch.learning.gradeModel } : {}), ...(launch.learning.seedFailed ? { seedFailed: launch.learning.seedFailed } : {}), ...(launch.learning.use ? { use: true } : {}) } } : {}),
60
63
  ...(launch.trigger ? { trigger: launch.trigger } : {}),
61
64
  ...(launch.inputOrigin ? { input_origin: launch.inputOrigin } : {}),
62
65
  ...(launch.followUp ? { follow_up: true } : {}),
66
+ ...(launch.archilDisk ? { archil_disk: { disk_id: launch.archilDisk.diskId, kind: launch.archilDisk.kind } } : {}),
67
+ ...(launch.hold ? { hold: { minutes: launch.hold.minutes } } : {}),
63
68
  };
64
69
  }
65
70
  /** The learning start a launch body names, as read back: its given notes (each {file, name}), its seed sha, its # Learned
66
- * section text, the learned skills and workflows it was offered, its grade model and why its seed failed, or undefined
71
+ * section text, the learned skills and workflows it was offered, its grade model, why its seed failed and whether it only
72
+ * uses them (`use`), or undefined
67
73
  * when the body names none (a run that does not learn). */
68
74
  function readLearning(value) {
69
75
  if (!isObject(value))
@@ -72,8 +78,8 @@ function readLearning(value) {
72
78
  const seed = typeof value.seed === "string" ? value.seed : null;
73
79
  const section = typeof value.section === "string" ? value.section : "";
74
80
  const names = (list) => (Array.isArray(list) ? list.filter((name) => typeof name === "string") : []);
75
- const [skills, workflows] = [names(value.skills), names(value.workflows)];
76
- return { given, seed, section, ...(typeof value.seedNotes === "number" ? { seedNotes: value.seedNotes } : {}), ...(skills.length ? { skills } : {}), ...(workflows.length ? { workflows } : {}), ...(typeof value.gradeModel === "string" && value.gradeModel !== "" ? { gradeModel: value.gradeModel } : {}), ...(typeof value.seedFailed === "string" && SEED_FAILURES.includes(value.seedFailed) ? { seedFailed: value.seedFailed } : {}) };
81
+ const [skills, workflows, notesLeftOut] = [names(value.skills), names(value.workflows), names(value.notesLeftOut)];
82
+ return { given, seed, section, ...(typeof value.seedNotes === "number" ? { seedNotes: value.seedNotes } : {}), ...(notesLeftOut.length ? { notesLeftOut } : {}), ...(skills.length ? { skills } : {}), ...(workflows.length ? { workflows } : {}), ...(value.notesOnly === true ? { notesOnly: true } : {}), ...(typeof value.gradeModel === "string" && value.gradeModel !== "" ? { gradeModel: value.gradeModel } : {}), ...(typeof value.seedFailed === "string" && SEED_FAILURES.includes(value.seedFailed) ? { seedFailed: value.seedFailed } : {}), ...(value.use === true ? { use: true } : {}) };
77
83
  }
78
84
  /** A launch body read back into a `RunLaunch`, with the input-origin fail-safe applied through the body's own trigger, or
79
85
  * undefined when the body is not one (not an object, or it names no place: a damaged or hand-edited body). */
@@ -87,9 +93,11 @@ export function readLaunchBody(stored) {
87
93
  const inputOrigin = keepInputOrigin(stored.input_origin, trigger);
88
94
  const model = readModel(stored.model);
89
95
  const boxAllow = readBoxAllow(stored.box_allow);
96
+ const archilDisk = readDisk(stored.archil_disk);
90
97
  return {
91
98
  input: stored.input,
92
99
  title: typeof stored.title === "string" ? stored.title : "",
100
+ ...(typeof stored.repo === "string" ? { repo: stored.repo } : {}),
93
101
  place,
94
102
  ...(typeof stored.harness === "string" ? { harness: stored.harness } : {}),
95
103
  ...(model ? { model } : {}),
@@ -106,6 +114,8 @@ export function readLaunchBody(stored) {
106
114
  ...(trigger ? { trigger } : {}),
107
115
  ...(inputOrigin ? { inputOrigin } : {}),
108
116
  ...(stored.follow_up === true ? { followUp: true } : {}),
117
+ ...(archilDisk ? { archilDisk } : {}),
118
+ ...(isObject(stored.hold) && typeof stored.hold.minutes === "number" ? { hold: { minutes: stored.hold.minutes } } : {}),
109
119
  };
110
120
  }
111
121
  /** The run's learning start (its given notes, its seed sha and its # Learned section), read from one place by learning's
@@ -53,8 +53,8 @@ export declare function servedRunLearning(deps: {
53
53
  skills?: import("./learning.js").LearnedFile[];
54
54
  workflows?: import("./learning.js").LearnedFile[];
55
55
  run: string;
56
- state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
57
- reason: "empty" | "cancelled" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
56
+ state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
57
+ reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
58
58
  detail: string | null;
59
59
  at: string;
60
60
  } | null>;
@@ -1,8 +1,8 @@
1
1
  import { type Workspace } from "./workspace/index.js";
2
2
  /** The most files the line names; the rest are counted. */
3
3
  export declare const MANIFEST_ENTRIES = 20;
4
- /** The most the first message may take, as the JSON string the run's door is sent: pi-durable-disk's door takes a body of
5
- * at most 1 MiB (serve.ts), and this leaves room for the request's other fields. */
4
+ /** The most the first message may take, as the JSON string the run's door is sent: a door takes a body of
5
+ * at most 1 MiB, and this leaves room for the request's other fields. */
6
6
  export declare const FIRST_MESSAGE_BYTES: number;
7
7
  /** `bytes` as a person reads a size: `32 B`, `1.5 KB`, `2.0 MB`. */
8
8
  export declare const sizeOf: (bytes: number) => string;
@@ -7,8 +7,8 @@ import { INPUTS_DIR } from "./uploads.js";
7
7
  import { workspaceAt } from "./workspace/index.js";
8
8
  /** The most files the line names; the rest are counted. */
9
9
  export const MANIFEST_ENTRIES = 20;
10
- /** The most the first message may take, as the JSON string the run's door is sent: pi-durable-disk's door takes a body of
11
- * at most 1 MiB (serve.ts), and this leaves room for the request's other fields. */
10
+ /** The most the first message may take, as the JSON string the run's door is sent: a door takes a body of
11
+ * at most 1 MiB, and this leaves room for the request's other fields. */
12
12
  export const FIRST_MESSAGE_BYTES = (1 << 20) - 4096;
13
13
  /** `bytes` as a person reads a size: `32 B`, `1.5 KB`, `2.0 MB`. */
14
14
  export const sizeOf = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
@@ -1,4 +1,4 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import type { TimelineEvent } from "./timeline/index.js";
3
3
  import type { IncomingMessage, ServerResponse } from "node:http";
4
4
  import { type Page } from "./rows.js";
@@ -0,0 +1,20 @@
1
+ /** `owner/name`, as github.ts githubTargetOf reads a repository. */
2
+ export declare const REPO_NAME: RegExp;
3
+ /** What an agent's GitHub triggers bind it to: the repositories they name, and whether one takes events from any. */
4
+ export type RepoBinding = {
5
+ readonly repos: readonly string[];
6
+ readonly open: boolean;
7
+ };
8
+ /** `agentId`'s binding, from the triggers (their source and target as stored): none (no repos, not open) for an agent no
9
+ * GitHub trigger starts. */
10
+ export declare function bindingOf(triggers: readonly {
11
+ readonly source: unknown;
12
+ readonly target: unknown;
13
+ }[], agentId: string): RepoBinding;
14
+ /** The repository a manual start runs against: `named` (the body's `repo`) when it is one the agent is bound to, else the
15
+ * agent's one repository when `named` is absent and the first message names none (`words`: it names its own). Undefined
16
+ * when the run is to have none. `refused`: why a named one is not allowed, in words for the 422. */
17
+ export declare function repoOf(binding: RepoBinding, named: string | undefined, words: boolean): {
18
+ repo?: string;
19
+ refused?: string;
20
+ };
@@ -0,0 +1,63 @@
1
+ // The repository a run a person starts reaches (the start body's `repo`): what an agent is bound to, and which one a start
2
+ // may name. A run a GitHub trigger starts has its repository from the signed event; a run started by hand has none unless
3
+ // the start gives it, since the GitHub App's token is made for one repository and never for all it covers.
4
+ //
5
+ // An agent is bound to the repositories its GitHub triggers take events from: each rule's `where` condition on
6
+ // /repository/full_name, its `in` list. A start's `repo` must be one of them, so a start never reaches a repository the
7
+ // agent's own triggers do not; naming one the agent is not bound to is refused in words. A start that names none takes the
8
+ // agent's repository when it is bound to exactly one. A trigger rule with no such condition takes every repository the App
9
+ // is installed on: the agent is then bound to all of them (`open`), a start may name any, and none is taken by default.
10
+ import { isObject } from "./validate.js";
11
+ /** `owner/name`, as github.ts githubTargetOf reads a repository. */
12
+ export const REPO_NAME = /^[^/\s]+\/[^/\s]+$/;
13
+ const FULL_NAME = "/repository/full_name";
14
+ /** `agentId`'s binding, from the triggers (their source and target as stored): none (no repos, not open) for an agent no
15
+ * GitHub trigger starts. */
16
+ export function bindingOf(triggers, agentId) {
17
+ const repos = [];
18
+ let open = false;
19
+ for (const { source, target } of triggers) {
20
+ if (!isObject(target) || target.kind !== "start_run" || target.agent_id !== agentId)
21
+ continue;
22
+ if (!isObject(source) || source.kind !== "github")
23
+ continue;
24
+ const rules = Array.isArray(source.accept) ? source.accept : [];
25
+ // A github trigger with no accept takes every event the App sends, from any repository.
26
+ if (!rules.length)
27
+ open = true;
28
+ for (const rule of rules) {
29
+ // A rule's conditions all hold: each `in` list on the repository narrows the rule, so they are intersected; rules
30
+ // are alternatives, so what they name is joined.
31
+ let named;
32
+ for (const c of isObject(rule) && Array.isArray(rule.where) ? rule.where : []) {
33
+ if (!isObject(c) || c.pointer !== FULL_NAME || !Array.isArray(c.in))
34
+ continue;
35
+ const list = c.in.filter((v) => typeof v === "string" && REPO_NAME.test(v));
36
+ named = named === undefined ? list : named.filter((r) => list.some((l) => l.toLowerCase() === r.toLowerCase()));
37
+ }
38
+ if (named === undefined)
39
+ open = true;
40
+ for (const repo of named ?? [])
41
+ if (!repos.some((r) => r.toLowerCase() === repo.toLowerCase()))
42
+ repos.push(repo);
43
+ }
44
+ }
45
+ return { repos, open };
46
+ }
47
+ /** The repository a manual start runs against: `named` (the body's `repo`) when it is one the agent is bound to, else the
48
+ * agent's one repository when `named` is absent and the first message names none (`words`: it names its own). Undefined
49
+ * when the run is to have none. `refused`: why a named one is not allowed, in words for the 422. */
50
+ export function repoOf(binding, named, words) {
51
+ if (named === undefined)
52
+ return !binding.open && binding.repos.length === 1 && !words ? { repo: binding.repos[0] } : {};
53
+ const bound = binding.repos.find((r) => r.toLowerCase() === named.toLowerCase());
54
+ if (bound)
55
+ return { repo: bound };
56
+ if (binding.open)
57
+ return { repo: named };
58
+ return {
59
+ refused: binding.repos.length
60
+ ? `This agent is bound to ${binding.repos.join(", ")}, not ${named}: start the run with one of those, or leave repo out.`
61
+ : `This agent is bound to no GitHub repository, so a run of it cannot name ${named}: bind it with a GitHub trigger whose accept names the repository, or write the repository's URL in the run's first message.`,
62
+ };
63
+ }
@@ -1,5 +1,5 @@
1
1
  import { harnessModelKeys } from "./adapters.js";
2
- import { BOX_KEYS } from "./boxes.js";
2
+ import { BOX_KEYS } from "./place-offers.js";
3
3
  import { providersNamed } from "./decisions.js";
4
4
  import { harnessOfBody } from "./harness.js";
5
5
  import { harnessOf } from "./harness-table.js";
@@ -8,8 +8,8 @@ import { DECISION_KEYS, SECRET_NAMES } from "./secrets.js";
8
8
  import { TOOL_KEYS } from "./tool-keys.js";
9
9
  import { workflowTools } from "./tools.js";
10
10
  /** The server's own secrets, which a run never gets: the API token, by name or by value, the seal key the tool keys are
11
- * kept under (tool-keys.ts), the store's URL (it may hold the database's password), and the boxes' keys (boxes.ts),
12
- * which only the server's box providers use. */
11
+ * kept under (tool-keys.ts), the store's URL (it may hold the database's password), and the remote boxes' keys
12
+ * (place-offers.ts BOX_KEYS), which only the server's computer providers use. */
13
13
  const SERVER_ONLY = new Set(["AGENTRUN_TOKEN", "AGENTRUN_API_KEY", "AGENTRUN_SEAL_KEY", "AGENTRUN_STORE_URL", ...BOX_KEYS]);
14
14
  /** The secrets a run may be handed: every one but the server's own and the decision keys, which go apart. */
15
15
  export const RUN_SECRETS = SECRET_NAMES.filter((name) => !SERVER_ONLY.has(name) && !DECISION_KEYS.includes(name));
@@ -1,4 +1,4 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import { type TimelineEvent } from "./timeline/index.js";
3
3
  import { type ItemStatus } from "./learning.js";
4
4
  import { type SignInReader } from "./run-view.js";
@@ -4,7 +4,7 @@ import { currentLearning, holdsForOk, secretsShown } from "./learning.js";
4
4
  import { withLearning } from "./learning-run.js";
5
5
  import { runLearningEnd } from "./store-reads/learning.js";
6
6
  import { redacted } from "./key-refusal.js";
7
- import { runCutValues, runErrorWordsOf } from "./run-cut.js";
7
+ import { runCutValues, runErrorWordsOf, underCut } from "./run-cut.js";
8
8
  import { answersOf, asksOf, shownOf, withApprovalRows, withAsks, withBudgetRows, withOverCap } from "./run-view.js";
9
9
  import { launchOf } from "./handed-values.js";
10
10
  import { capNowOf } from "./runner/journal-kinds.js";
@@ -17,57 +17,69 @@ import { FINAL_STATES } from "./store/store.js";
17
17
  /** Run `runId`'s Timeline rows as served: cut by its one cut set, its decision rows among them, its error rows in the
18
18
  * run's error's words; none for a run withheld. */
19
19
  export async function servedTimelineRows(deps, store, runId, context) {
20
- const cut = await runCutValues(deps, store, runId);
21
- if (cut === "unreadable")
20
+ // The run's rows, its decisions, its learning end and the triggers' names, all read in one snapshot of the store (one
21
+ // moment, whatever the run's runner writes meanwhile): a row from before an answer never sits beside one from after it.
22
+ // They are rendered under the run's cut, which is read before the snapshot and again after it (underCut): the cut only
23
+ // grows, so a cut that is the same after holds every value saved before the rows were read.
24
+ const read = await underCut(() => runCutValues(deps, store, runId), async (cut) => {
25
+ if (cut === "unreadable")
26
+ return undefined;
27
+ const { values } = cut;
28
+ const redact = (text) => redacted(text, values);
29
+ return { values, redact, ...(await store.snapshot(async (snapshot) => {
30
+ // The rows a person reads: each call that waited for approval in order (held, your approval, what came of it), its
31
+ // arguments and the person's notes through the cut (run-view.ts withApprovalRows), as main's served Timeline read them.
32
+ // A call asked before an end in the journal reads withdrawn in that end's words; a stopped or failed run's (states no
33
+ // reopen leaves) whose journal holds no end, by its row (answersOf `final`).
34
+ const run = await snapshot.runs.get(runId);
35
+ const ended = run ? FINAL_STATES.includes(run.state) : false;
36
+ const records = await journalRecords(snapshot.readJournal(runId), context);
37
+ const final = run?.state === "stopped" || run?.state === "failed" ? run.state : undefined;
38
+ // A question the agent asked (ask_person) and waits on: its waiting row after the call's result (run-view.ts withAsks), as
39
+ // the run's view carries it and main's served Timeline did, so the console's "The agent asks" box reads that question,
40
+ // never an earlier wait's words.
41
+ // Its final answer whole, as the run's view serves it (store-reads/journal.ts wholeAnswers): a row's cut is no answer's.
42
+ // A run that ended is read settled, as its view reads it: nothing of it is in flight, so a request it left unanswered
43
+ // is a cost unknown, never one still running.
44
+ const options = { redact, settled: ended };
45
+ const timeline = await wholeAnswers(snapshot, runId, context, await runTimeline(snapshot, runId, context, options), options, wholeAnswerFor(values));
46
+ // A run whose booked spend passed its cap says so, by how much, after its usage row (run-view.ts withOverCap, as main's
47
+ // served Timeline did): at the cap as it stands (a raise taken counts, capNowOf), a cache miss within the bound of the
48
+ // requests since its spend last fit said as one (overCapBound).
49
+ const capNow = capNowOf((await launchOf(snapshot, runId))?.maxCostUsd, records.entries);
50
+ const overCap = capNow === undefined ? timeline : withOverCap(timeline, capNow, overCapBound(records.entries, capNow));
51
+ // Each pause at its cap shown as the server's row, and the one it stands at now as its waiting row (withBudgetRows).
52
+ const capped = withBudgetRows(overCap, records.entries, { ended });
53
+ const rows = withApprovalRows(withAsks(capped), asksOf(records.entries), answersOf(records.entries, { final }), redact);
54
+ // A workflow's decisions: their rows among the model nodes' by time, each text shown through the cut set, with as many
55
+ // characters held back from a text stored cut as a held value takes in its widest form (main's decisionShown).
56
+ const receipts = await decisionsOverStore(snapshot, runId, context).catch(() => null);
57
+ const decisionShown = { redact: (text) => redacted(text, values), hold: 6 * values.reduce((most, value) => Math.max(most, value.length), 0) + 16 };
58
+ const own = receipts === null || receipts.length ? withDecisions(rows, receipts, decisionShown, { ended }) : rows;
59
+ // The run's learning end, once its learning was proposed, merged or dropped (runLearningEnd).
60
+ const end = await runLearningEnd(snapshot, runId);
61
+ // Each trigger the rows name, read once for this read: its name now, or none for one gone.
62
+ const names = new Map();
63
+ for (const row of own)
64
+ if (row.trigger && !names.has(row.trigger.id))
65
+ names.set(row.trigger.id, (await snapshot.triggers.get(row.trigger.id))?.name);
66
+ return { run, own, end, names };
67
+ })) };
68
+ });
69
+ if (!read)
22
70
  return [];
23
- const { values } = cut;
24
- const redact = (text) => redacted(text, values);
25
- // The rows a person reads: each call that waited for approval in order (held, your approval, what came of it), its
26
- // arguments and the person's notes through the cut (run-view.ts withApprovalRows), as main's served Timeline read them.
27
- // A call asked before an end in the journal reads withdrawn in that end's words; a stopped or failed run's (states no
28
- // reopen leaves) whose journal holds no end, by its row (answersOf `final`).
29
- const run = await store.runs.get(runId);
30
- const ended = run ? FINAL_STATES.includes(run.state) : false;
31
- const records = await journalRecords(store.readJournal(runId), context);
32
- const final = run?.state === "stopped" || run?.state === "failed" ? run.state : undefined;
33
- // A question the agent asked (ask_person) and waits on: its waiting row after the call's result (run-view.ts withAsks), as
34
- // the run's view carries it and main's served Timeline did, so the console's "The agent asks" box reads that question,
35
- // never an earlier wait's words.
36
- // Its final answer whole, as the run's view serves it (store-reads/journal.ts wholeAnswers): a row's cut is no answer's.
37
- // A run that ended is read settled, as its view reads it: nothing of it is in flight, so a request it left unanswered
38
- // is a cost unknown, never one still running.
39
- const options = { redact, settled: ended };
40
- const timeline = await wholeAnswers(store, runId, context, await runTimeline(store, runId, context, options), options, wholeAnswerFor(values));
41
- // A run whose booked spend passed its cap says so, by how much, after its usage row (run-view.ts withOverCap, as main's
42
- // served Timeline did): at the cap as it stands (a raise taken counts, capNowOf), a cache miss within the bound of the
43
- // requests since its spend last fit said as one (overCapBound).
44
- const capNow = capNowOf((await launchOf(store, runId))?.maxCostUsd, records.entries);
45
- const overCap = capNow === undefined ? timeline : withOverCap(timeline, capNow, overCapBound(records.entries, capNow));
46
- // Each pause at its cap shown as the server's row, and the one it stands at now as its waiting row (withBudgetRows).
47
- const capped = withBudgetRows(overCap, records.entries, { ended });
48
- const rows = withApprovalRows(withAsks(capped), asksOf(records.entries), answersOf(records.entries, { final }), redact);
49
- // A workflow's decisions: their rows among the model nodes' by time, each text shown through the cut set, with as many
50
- // characters held back from a text stored cut as a held value takes in its widest form (main's decisionShown).
51
- const receipts = await decisionsOverStore(store, runId, context).catch(() => null);
52
- const decisionShown = { redact: (text) => redacted(text, values), hold: 6 * values.reduce((most, value) => Math.max(most, value.length), 0) + 16 };
53
- const own = receipts === null || receipts.length ? withDecisions(rows, receipts, decisionShown, { ended }) : rows;
71
+ const { values, redact, run, own, end, names } = read;
54
72
  // An error row reads as the run's error does (run-cut.ts runErrorWordsOf, main's errorWords): a refused key in plain
55
- // words, else no held value and no loopback address.
73
+ // words, else no held value and no loopback address. Read after the snapshot, through the server's own handles (the
74
+ // agent's sign-ins), which the snapshot's connection would hold up.
56
75
  const workflow = (await readRun(store, runId, context))?.kind === "workflow";
57
76
  const words = await runErrorWordsOf(deps, store, runId, { workflow });
58
77
  if (words === "unreadable")
59
78
  return [];
60
- // The run's learning row, once its learning was proposed, merged or dropped (learning-run.ts withLearning, main's row):
61
- // its end from the store (runLearningEnd), what it held for the owner's OK read as the run's view reads it (on its agent's
62
- // folder's main), its words cut by the same set.
63
- const end = await runLearningEnd(store, runId);
79
+ // The run's learning row (learning-run.ts withLearning, main's row): what the end held for the owner's OK read as the run's
80
+ // view reads it (on its agent's folder's main), its words cut by the same set.
64
81
  const learning = end ? (holdsForOk(end) && run && deps.statuses ? currentLearning(end, await deps.statuses(run.agentId)) : end) : undefined;
65
82
  const learned = withLearning(own, learning, secretsShown(values));
66
- // Each trigger the rows name, read once for this read: its name now, or none for one gone.
67
- const names = new Map();
68
- for (const row of learned)
69
- if (row.trigger && !names.has(row.trigger.id))
70
- names.set(row.trigger.id, (await store.triggers.get(row.trigger.id))?.name);
71
83
  // A refused key's plain words are its summary and its text alike; any other error keeps each in the one rule.
72
84
  const shown = shownOf(values);
73
85
  return learned.map((row) => {
@@ -65,7 +65,7 @@ export type Approval = {
65
65
  resolved?: true;
66
66
  };
67
67
  /** `args_shown`: the call's arguments as the server shows them (shownArgs), which the gate's resume message names. */
68
- /** `by`: "message", a deny a person's message gave while the call waited (Runs.message). */
68
+ /** `by`: "message", a deny a person's message gave while the call waited (Runs.message); "setting", the allow the tool's setting gave an ask that waited (the person flipped the tool to allow). */
69
69
  /** `superseded`: the answer a stop or a cancel overrode before the run's process acted on it, kept as it was given. */
70
70
  /** `ended`: a withdrawal by a run that ended (completed or failed) with the call waiting, which nobody stopped. */
71
71
  export type ApprovalAnswer = {
@@ -73,12 +73,12 @@ export type ApprovalAnswer = {
73
73
  note?: string;
74
74
  answered_at: string;
75
75
  args_shown?: string;
76
- by?: "message";
76
+ by?: "message" | "setting";
77
77
  superseded?: {
78
78
  decision: string;
79
79
  answered_at: string;
80
80
  note?: string;
81
- by?: "message";
81
+ by?: "message" | "setting";
82
82
  };
83
83
  ended?: true;
84
84
  };
@@ -349,6 +349,9 @@ export interface RunMoment {
349
349
  readonly waitingApprovalId?: string;
350
350
  /** The tool calls this run has or had waiting for approval, by id (for the not-found refusal). */
351
351
  readonly approvalIds?: ReadonlySet<string>;
352
+ /** What is archived of it, when anything is: its agent, else the run itself. Archiving closes a run: it takes no message
353
+ * (runs-over-store.ts message). Absent when neither is. */
354
+ readonly archived?: "run" | "agent";
352
355
  /** The approvals already answered, by call id, as the run view folds them (for the first-wins refusal and its words). */
353
356
  readonly answeredApprovals?: Readonly<Record<string, {
354
357
  readonly decision: ApprovalDecision;
@@ -373,7 +376,7 @@ export declare const WITHHELD_TITLE = "Withheld: a sign-in this run used can't b
373
376
  * hidden or withheld, never served uncut, and forget waits for it while it goes. */
374
377
  export declare const MALFORMED = "malformed";
375
378
  export type Handed = string[] | typeof MALFORMED;
376
- /** A run's `sign_in_handed` as read from its serve.json: undefined when absent (never handed one); the hashes it names;
379
+ /** A run's `sign_in_handed` as read from its stored row: undefined when absent (never handed one); the hashes it names;
377
380
  * MALFORMED for any other value. */
378
381
  export declare function handedMark(value: unknown): Handed | undefined;
379
382
  /** A run's redactor (decision-rows.ts, tool previews): redacted over its refused values. */
@@ -403,7 +406,7 @@ export declare const servedReviewWith: <R extends {
403
406
  export declare function handedPointers(signIns: SignInReader | undefined, agentId: string, browser: string | undefined, handed: Handed | undefined): Promise<{
404
407
  refs: string[];
405
408
  } | "unreadable">;
406
- /** shown() for a run this server holds no Run for (an ended one a list reads from its row and serve.json alone): cut of
409
+ /** shown() for a run this server holds no Run for (an ended one a list reads from its row and journal alone): cut of
407
410
  * every secret this server never shows (serverSecrets) and of what the run was handed of its agent's sign-in
408
411
  * (handedPointers); `withheld` when that can't be read back here, as a load would hide the run. `browser` and `handed`
409
412
  * come from the run's record (its plane's vendor browser and its `sign_in_handed` mark); `damaged` when the record was
package/dist/run-view.js CHANGED
@@ -170,7 +170,7 @@ export function answersOf(entries, { final } = {}) {
170
170
  continue;
171
171
  const superseded = given ? { superseded: { decision: given.decision, answered_at: given.answered_at, ...(given.note !== undefined ? { note: given.note } : {}), ...(given.by ? { by: given.by } : {}) } } : {};
172
172
  // A deny a person's message gave keeps that it was (`by`): its row reads "Declined by your message".
173
- out[d.callId] = { decision, ...(d.note !== undefined ? { note: d.note } : {}), answered_at: d.answeredAt ?? "", ...(decision === "deny" && d.by === "message" ? { by: "message" } : {}), ...superseded };
173
+ out[d.callId] = { decision, ...(d.note !== undefined ? { note: d.note } : {}), answered_at: d.answeredAt ?? "", ...(decision === "deny" && d.by === "message" ? { by: "message" } : decision === "allow" && d.by === "setting" ? { by: "setting" } : {}), ...superseded };
174
174
  }
175
175
  // How the run ended after each entry: the state of the first agentrun.end at or after it, else the final row's.
176
176
  let endedAs = final;
@@ -263,7 +263,8 @@ export function budgetOf(entries, run) {
263
263
  const figures = p.spent_usd !== undefined && p.needs_usd !== undefined
264
264
  ? { spent_usd: micro(p.spent_usd), needs_usd: micro(p.needs_usd), ...(p.least_cap_usd !== undefined ? { least_cap_usd: p.least_cap_usd } : {}), suggested_cap_usd: suggestedCap(cap, p.spent_usd, p.needs_usd), overshoot_bound_usd: microUp(0) }
265
265
  : {};
266
- return { kind: "budget", cap_usd: cap, ...figures, said: mark.words, at: meaningful(run.rows)?.timestamp ?? run.updatedAt };
266
+ // A workflow's pause names the node whose step waits (null when not known); an agentic run's names none.
267
+ return { kind: "budget", cap_usd: cap, ...figures, said: mark.words, at: meaningful(run.rows)?.timestamp ?? run.updatedAt, ...(mark.node !== undefined ? { node: mark.node } : {}) };
267
268
  }
268
269
  /** Read only on a run's `rows`, which hold no QUIET row (take). */
269
270
  const shows = (r) => r.kind !== "usage" && r.kind !== "phase";
@@ -480,7 +481,7 @@ export const WITHHELD_TITLE = "Withheld: a sign-in this run used can't be read";
480
481
  * hash an older build wrote, or a damaged value) reads as: some pointer was handed, which one is not known, so the run is
481
482
  * hidden or withheld, never served uncut, and forget waits for it while it goes. */
482
483
  export const MALFORMED = "malformed";
483
- /** A run's `sign_in_handed` as read from its serve.json: undefined when absent (never handed one); the hashes it names;
484
+ /** A run's `sign_in_handed` as read from its stored row: undefined when absent (never handed one); the hashes it names;
484
485
  * MALFORMED for any other value. */
485
486
  export function handedMark(value) {
486
487
  if (value === undefined)
@@ -526,7 +527,7 @@ export async function handedPointers(signIns, agentId, browser, handed) {
526
527
  const refs = handed.map((hash) => kept.find((ref) => pointerHash(ref) === hash));
527
528
  return refs.every((ref) => ref !== undefined) ? { refs: refs } : "unreadable";
528
529
  }
529
- /** shown() for a run this server holds no Run for (an ended one a list reads from its row and serve.json alone): cut of
530
+ /** shown() for a run this server holds no Run for (an ended one a list reads from its row and journal alone): cut of
530
531
  * every secret this server never shows (serverSecrets) and of what the run was handed of its agent's sign-in
531
532
  * (handedPointers); `withheld` when that can't be read back here, as a load would hide the run. `browser` and `handed`
532
533
  * come from the run's record (its plane's vendor browser and its `sign_in_handed` mark); `damaged` when the record was
@@ -568,14 +569,15 @@ export function outcomeSays(tool, answer, failed, redact) {
568
569
  const note = noteShown(answer.note, redact);
569
570
  return note ? `AgentRun: You declined ${tool}: ${note}` : `AgentRun: You declined ${tool}.`;
570
571
  }
571
- return `AgentRun: ${tool} ran once you allowed it${failed ? ", and failed" : "; its result went to the agent"}`;
572
+ const ran = answer.by === "setting" ? "ran, as its setting allows it" : "ran once you allowed it";
573
+ return `AgentRun: ${tool} ${ran}${failed ? ", and failed" : "; its result went to the agent"}`;
572
574
  }
573
575
  /** What a person reads when they open the outcome row: the outcome, then the call's result (`rest`), or the refusal's words.
574
576
  * An empty result says so: "Its result: (no output)", never "Its result:" and nothing. */
575
577
  export function outcomeShows(tool, answer, rest, failed) {
576
578
  if (answer.decision === "deny")
577
579
  return `${answer.by === "message" ? `Your message declined ${tool}.` : `You declined ${tool}.`}${rest.trim() ? `\n${rest.trim()}` : ""}`;
578
- const head = `${tool} ran once you allowed it${failed ? ", and failed" : ""}.`;
580
+ const head = `${tool} ${answer.by === "setting" ? "ran, as its setting allows it" : "ran once you allowed it"}${failed ? ", and failed" : ""}.`;
579
581
  return rest.trim() ? `${head} Its result:\n${rest}` : `${head} Its result: (no output)`;
580
582
  }
581
583
  /** A call's own rows (its call's, its result's) before its outcome shows: what came of the approval so far. */
@@ -588,6 +590,12 @@ function callSays(answer) {
588
590
  return answer.ended ? ENDED_WHILE_WAITING : STOPPED_WHILE_WAITING;
589
591
  return "Allowed: it runs now";
590
592
  }
593
+ /** A row without the `refused` mark: it says a call was refused before it ran, so only that call's own tool_result row has it;
594
+ * the approval, message and outcome rows made from a result keep their own status. */
595
+ const unrefused = (row) => {
596
+ const { refused: _refused, ...rest } = row;
597
+ return rest;
598
+ };
591
599
  /** A synthesized row's id: the approval's own, so a pass over rows this function gave drops and remakes it. */
592
600
  const approvalRowId = (callId) => `approval:${callId}`;
593
601
  /** The rows of a run whose calls waited for approval, as the runner writes it (store-view.ts): the gate's ask
@@ -629,18 +637,18 @@ export function withApprovalRows(rows, asks, answers, redact) {
629
637
  // writes none), so the approval and outcome rows take a new id once it is there: served anew below the result, the
630
638
  // call's own rows, then its approval, then what came of it, as a person reads it.
631
639
  const at = result ? `${approvalRowId(approval.call_id)}:after` : approvalRowId(approval.call_id);
632
- const head = !answer ? "Waiting for your approval" : answer.decision === "canceled" ? "Withdrawn when the run was cancelled" : answer.decision === "withdrawn" ? (answer.ended ? "Withdrawn when the run ended" : "Withdrawn when the run was stopped") : answer.by === "message" ? "Declined by your message" : "Asked your approval";
633
- const asked = { ...row, id: at, kind: APPROVAL_ROW, summary: `${head}: ${approval.tool} ${clip(args, 400)}`, text: args, tool_name: approval.tool, tool_status: null, tool_input_preview: clip(args, 500), tool_result_preview: null, tool_result_size_bytes: null };
640
+ const head = !answer ? "Waiting for your approval" : answer.decision === "canceled" ? "Withdrawn when the run was cancelled" : answer.decision === "withdrawn" ? (answer.ended ? "Withdrawn when the run ended" : "Withdrawn when the run was stopped") : answer.by === "message" ? "Declined by your message" : answer.by === "setting" ? "Allowed by the tool's setting" : "Asked your approval";
641
+ const asked = { ...unrefused(row), id: at, kind: APPROVAL_ROW, summary: `${head}: ${approval.tool} ${clip(args, 400)}`, text: args, tool_name: approval.tool, tool_status: null, tool_input_preview: clip(args, 500), tool_result_preview: null, tool_result_size_bytes: null };
634
642
  if (!outcome)
635
643
  return [own, asked];
636
644
  const failed = answer.decision === "allow" && result?.tool_status === "failed";
637
645
  // The result's words: a tool_result row keeps them as its preview (the renderer's, redacted and cut), its text empty.
638
- const told = { ...(result ?? row), id: `${at}:outcome`, kind: "phase", origin: "server", summary: outcomeSays(approval.tool, answer, failed, redact), text: outcomeShows(approval.tool, answer, redact(result?.text || result?.tool_result_preview || ""), failed), tool_name: null, tool_use_id: null, tool_status: null, tool_input_preview: null, tool_result_preview: null, tool_result_size_bytes: null };
646
+ const told = { ...unrefused(result ?? row), id: `${at}:outcome`, kind: "phase", origin: "server", summary: outcomeSays(approval.tool, answer, failed, redact), text: outcomeShows(approval.tool, answer, redact(result?.text || result?.tool_result_preview || ""), failed), tool_name: null, tool_use_id: null, tool_status: null, tool_input_preview: null, tool_result_preview: null, tool_result_size_bytes: null };
639
647
  // A person's message that declined the call (runs-over-store.ts message: a deny carrying their words) is theirs as any
640
648
  // message is: its own row, between the approval and what came of it, as main's declineBy kept it.
641
649
  if (answer.decision === "deny" && answer.by === "message" && answer.note) {
642
650
  const words = redact(answer.note);
643
- const { origin: _origin, ...base } = result ?? row;
651
+ const { origin: _origin, ...base } = unrefused(result ?? row);
644
652
  const theirs = { ...base, id: `${at}:message`, kind: "user_message", summary: clip(`You: ${words.split("\n", 1)[0]}`, 500), text: words, tool_name: null, tool_use_id: null, tool_status: null, tool_input_preview: null, tool_result_preview: null, tool_result_size_bytes: null };
645
653
  return [own, asked, theirs, told];
646
654
  }
@@ -1,7 +1,7 @@
1
1
  import { type InputIssue } from "./errors.js";
2
2
  import { type HarnessCapability } from "./harness.js";
3
3
  import { type ModelRef } from "./model.js";
4
- import type { BoxOffer } from "./boxes.js";
4
+ import type { BoxOffer } from "./place-offers.js";
5
5
  import { type ToolSettingsMap } from "./tool-plane.js";
6
6
  import type { McpTool } from "@parcha/agentrun-kernel";
7
7
  import type { ShellPlace } from "@parcha/agentrun-kernel/kernel";
@@ -99,7 +99,7 @@ export declare const NOT_SET_UP = "not_set_up_here";
99
99
  * `new Function` transform, which is no sandbox. Off by default. */
100
100
  export declare const CODE_NODES_ENV = "AGENTRUN_SERVE_CODE_NODES";
101
101
  /** What keeps `revision` from running in `env` under the server's tool `settings` (tool-plane.ts). `boxes`: what this
102
- * server's box registry set up at its start (boxes.ts); none, every box is unavailable. `offers`: the harnesses' offers
102
+ * server found at its start (place-offers.ts); none, every box is unavailable. `offers`: the harnesses' offers
103
103
  * the server already holds (its reading); none given, they are probed here. `computerReady`: whether an agent's computer
104
104
  * setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
105
105
  * `shellOf`: where a run of an agent with that computer setting has its shell here now (resolve-computer.ts
package/dist/runnable.js CHANGED
@@ -54,7 +54,7 @@ const PRICE_FIX = "Set AGENT_MODEL_PRICE (USD per million input,output,cacheRead
54
54
  * `new Function` transform, which is no sandbox. Off by default. */
55
55
  export const CODE_NODES_ENV = "AGENTRUN_SERVE_CODE_NODES";
56
56
  /** What keeps `revision` from running in `env` under the server's tool `settings` (tool-plane.ts). `boxes`: what this
57
- * server's box registry set up at its start (boxes.ts); none, every box is unavailable. `offers`: the harnesses' offers
57
+ * server found at its start (place-offers.ts); none, every box is unavailable. `offers`: the harnesses' offers
58
58
  * the server already holds (its reading); none given, they are probed here. `computerReady`: whether an agent's computer
59
59
  * setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
60
60
  * `shellOf`: where a run of an agent with that computer setting has its shell here now (resolve-computer.ts
@@ -160,6 +160,7 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
160
160
  return undefined;
161
161
  };
162
162
  if (revision.kind === "agentic") {
163
+ const browserComputer = revision.computer?.kind === "browser";
163
164
  if (!revision.instructions.trim())
164
165
  out.push({ field: "definition.instructions", reason: "too_short", message: "definition.instructions is empty: an agentic revision needs instructions.", host: false });
165
166
  (revision.tools ?? []).forEach((tool, index) => {
@@ -184,7 +185,10 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
184
185
  out.push({ field: `definition.tools[${index}]`, reason: NOT_SET_UP, message: `${tool} runs on pi here; on ${harness} it is not bound yet.`, host: true, tool });
185
186
  else {
186
187
  unset(`definition.tools[${index}]`, tool);
187
- unavailable(`definition.tools[${index}]`, revision.tools ?? [], tool);
188
+ // The browser of an agent whose computer is a browser is that computer (tools.ts browserComputer), on the keys
189
+ // saved for it in Settings → Computers and checked as its readiness above: the tool plane's vendor is not asked.
190
+ if (!(tool === "browser" && browserComputer))
191
+ unavailable(`definition.tools[${index}]`, revision.tools ?? [], tool);
188
192
  }
189
193
  });
190
194
  // The tool-call budget is counted from pi's own journal (tool-budget.ts): on another harness it would hold nothing, so