@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
@@ -6,8 +6,8 @@
6
6
  <meta name="color-scheme" content="light dark" />
7
7
  <title>AgentRun</title>
8
8
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23ff8000'/%3E%3Cpath d='M12 9l11 7-11 7z' fill='%23000'/%3E%3C/svg%3E" />
9
- <script type="module" crossorigin src="./assets/index-BI4Byidu.js"></script>
10
- <link rel="stylesheet" crossorigin href="./assets/index-C19gUF2n.css">
9
+ <script type="module" crossorigin src="./assets/index-b6-XY5A9.js"></script>
10
+ <link rel="stylesheet" crossorigin href="./assets/index-CjqQirbo.css">
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
@@ -1,2 +1,4 @@
1
1
  export declare const runLink: (origin: string, runId: string) => string;
2
2
  export declare const agentLink: (origin: string, agentId: string) => string;
3
+ export declare const templateLink: (origin: string, id: string) => string;
4
+ export declare const templateInstallLink: (origin: string, source: string) => string;
@@ -4,3 +4,6 @@ export const runLink = (origin, runId) => `${origin}/#/runs/${encodeURIComponent
4
4
  // `#/agents/new` is the console's new-agent form, so an agent whose id is "new" gets its Runs tab, as the console's own
5
5
  // agentHash gives it (apps/console AgentPage.tsx).
6
6
  export const agentLink = (origin, agentId) => `${origin}/#/agents/${encodeURIComponent(agentId)}${agentId === "new" ? "/runs" : ""}`;
7
+ // A template package's apply page; for a package not stored (a dry run), the install page, which shows it whole first.
8
+ export const templateLink = (origin, id) => `${origin}/#/templates/${encodeURIComponent(id)}`;
9
+ export const templateInstallLink = (origin, source) => `${origin}/#/templates/install?src=${encodeURIComponent(source)}`;
package/dist/decisions.js CHANGED
@@ -145,6 +145,10 @@ export function providersNamed(nodes) {
145
145
  }
146
146
  if (node.verify)
147
147
  ids.add(DEFAULT_DECISION_PROVIDER);
148
+ // A step guard that reads Jev (runner/step-guard.ts) asks Jev, whatever provider its node names.
149
+ const signal = node.guard?.signal;
150
+ if (signal === "jev" || signal === "both")
151
+ ids.add("jev");
148
152
  }
149
153
  return [...ids];
150
154
  }
@@ -1,17 +1,13 @@
1
1
  import type { KeyTable, ProviderFactories } from "./computer-keys.js";
2
2
  import type { KindRegistry, ProviderEntry } from "./computers.js";
3
+ import type { WatchOf } from "./workspace/computer-for-claim.js";
3
4
  import type { ComputerSettingKind, LaunchedComputer } from "./workspace/resolve-computer.js";
4
- /** A started faux desktop: the claim's LaunchedComputer, with the provider's live stream of its screen. */
5
+ /** A started faux desktop: the claim's LaunchedComputer, with its provider's watch of its screen (ComputerProvider.watch
6
+ * bound to it), which feeds the run's proxied live view (computer-live.ts) as a real desktop's does. */
5
7
  export type FauxDesktop = LaunchedComputer & {
6
- stream(options: {
7
- readonly viewOnly: boolean;
8
- }): Promise<{
9
- readonly url: string;
10
- }>;
8
+ readonly watch: WatchOf;
11
9
  };
12
- /** The path a faux desktop's live view is served at, on serve's own address: FAUX_VIEW_PATH/<id>/view or /drive. */
13
- export declare const FAUX_VIEW_PATH = "/faux/desktops";
14
- /** What serve takes in place of the computer package under --faux. */
10
+ /** What serve and its runner take in place of the computer package under --faux. */
15
11
  export interface FauxComputers {
16
12
  readonly kinds: KindRegistry;
17
13
  readonly factories: ProviderFactories;
@@ -21,15 +17,8 @@ export interface FauxComputers {
21
17
  readonly kind: ComputerSettingKind;
22
18
  readonly keys: Readonly<Record<string, string>>;
23
19
  }): Promise<FauxDesktop>;
24
- /** The live view's page for a path under FAUX_VIEW_PATH, for serve to answer; undefined for any other path, or a
25
- * desktop that is released or never was. */
26
- viewPage(pathname: string): string | undefined;
20
+ /** Whether a provider id is one of these (the claim's launch takes it): any other is the package's. */
21
+ owns(provider: string): boolean;
27
22
  }
28
- /**
29
- * --faux's computers. `viewerBase` is serve's own address (scheme, host and port), so a faux desktop's live view is a page
30
- * serve itself answers (viewPage), with no other listener. The server answers FAUX_VIEW_PATH with viewPage only under
31
- * --faux.
32
- */
33
- export declare function fauxComputers({ viewerBase }: {
34
- readonly viewerBase: string;
35
- }): FauxComputers;
23
+ /** --faux's computers: the server's Settings → Computers and start check read them, and its runner's claim launches them. */
24
+ export declare function fauxComputers(): FauxComputers;
@@ -7,16 +7,16 @@
7
7
  // no computer.
8
8
  // - faux-broken: a sandbox with no key, whose test always fails: it is never reached. It starts no computer.
9
9
  // - faux-desktop: a desktop with no key. Its run computer answers screen.shot (a plain grey screen) and input.actions
10
- // (each action done, none performed). Its live view is a page serve itself answers on its own address, view-only or
11
- // driving, so the run's take-over and hand-back have a viewer to open; after the release the page is gone.
10
+ // (each action done, none performed). Its watch gives the run's live view grey frames and takes its input, so a --faux
11
+ // run's desktop is watched and taken over through the same proxied viewer a real one's is; the release ends it.
12
12
  import { crc32, deflateSync } from "node:zlib";
13
13
  // The computer package's setting kinds and servingRefusals, as its kinds.ts gives them (the swap to its exports
14
14
  // replaces these two with the package's own).
15
15
  const SETTING_KINDS = {
16
16
  none: { machineKinds: [], required: [], optional: [] },
17
17
  sandbox: { machineKinds: ["linux"], required: ["exec", "files", "processes"], optional: [] },
18
- desktop: { machineKinds: ["desktop"], required: ["screen", "input.pointer", "input.keys"], optional: ["exec", "files", "processes", "apps", "stream"] },
19
- phone: { machineKinds: ["android", "ios"], required: ["screen", "input.touch", "apps"], optional: ["input.keys", "apps.install", "apps.ui_tree", "stream"] },
18
+ desktop: { machineKinds: ["desktop"], required: ["screen", "input.pointer", "input.keys"], optional: ["exec", "files", "processes", "apps", "ui", "stream"] },
19
+ phone: { machineKinds: ["android", "ios"], required: ["screen", "input.touch", "apps"], optional: ["input.keys", "apps.install", "ui", "stream"] },
20
20
  browser: { machineKinds: ["browser"], required: ["cdp"], optional: ["stream", "downloads"] },
21
21
  };
22
22
  const KIND_NAMES = Object.keys(SETTING_KINDS);
@@ -75,39 +75,75 @@ function greyPng(width, height) {
75
75
  }
76
76
  const WIDTH = 1280;
77
77
  const HEIGHT = 800;
78
- /** The path a faux desktop's live view is served at, on serve's own address: FAUX_VIEW_PATH/<id>/view or /drive. */
79
- export const FAUX_VIEW_PATH = "/faux/desktops";
80
- /**
81
- * --faux's computers. `viewerBase` is serve's own address (scheme, host and port), so a faux desktop's live view is a page
82
- * serve itself answers (viewPage), with no other listener. The server answers FAUX_VIEW_PATH with viewPage only under
83
- * --faux.
84
- */
85
- export function fauxComputers({ viewerBase }) {
86
- const live = new Set();
78
+ /** How long a faux desktop's watch waits after a frame's ack before it gives the next. */
79
+ const FRAME_MS = 1_000;
80
+ /** --faux's computers: the server's Settings → Computers and start check read them, and its runner's claim launches them. */
81
+ export function fauxComputers() {
87
82
  let started = 0;
88
- /** A faux desktop for a run: screen.shot gives a grey screen, input.actions does each action and performs none, and its
89
- * live view is its page on serve, view-only or driving, until the release. */
83
+ /** A faux desktop for a run: ping answers, as every computer's does; screen.shot gives a grey screen, input.actions does
84
+ * each action and performs none, and its watch gives the same grey frame, the next a second after each ack, and takes every input (performing none) until it
85
+ * is closed or the desktop is released, which ends it gone. */
90
86
  function fauxDesktop() {
91
87
  const id = `faux-desktop-${++started}`;
92
88
  const png = greyPng(WIDTH, HEIGHT);
93
- live.add(id);
94
- const hello = { protocol: "0.2", version: "faux", os: "linux", kind: "desktop", arch: "amd64", groups: [...DESKTOP_GROUPS] };
89
+ const watches = new Set();
90
+ const hello = { protocol: "0.2", version: "faux", os: "linux", kind: "desktop", arch: "amd64", groups: [...DESKTOP_GROUPS], screen: { width: WIDTH, height: HEIGHT, scale: 1 } };
95
91
  const call = async (method, params) => {
96
92
  if (method === "hello")
97
93
  return { ok: true, value: hello };
94
+ if (method === "ping")
95
+ return { ok: true, value: {} };
98
96
  if (method === "screen.shot")
99
97
  return { ok: true, value: { id: `${id}-shot`, data: png.toString("base64"), eof: true, size: png.length, width: WIDTH, height: HEIGHT } };
100
98
  if (method === "input.actions")
101
99
  return { ok: true, value: { done: Array.isArray(params.actions) ? params.actions.length : 0 } };
102
100
  return { ok: false, error: { code: "unsupported", message: `the faux desktop has no ${method}` } };
103
101
  };
102
+ const watch = async (handlers, options) => {
103
+ let open = true;
104
+ let seq = 0;
105
+ let timer;
106
+ const stop = () => {
107
+ open = false;
108
+ clearTimeout(timer);
109
+ watches.delete(gone);
110
+ options.signal?.removeEventListener("abort", stop);
111
+ };
112
+ const gone = () => {
113
+ if (!open)
114
+ return;
115
+ stop();
116
+ handlers.ended({ code: "gone", message: `the faux desktop ${id} was released` });
117
+ };
118
+ const give = () => {
119
+ if (!open)
120
+ return;
121
+ handlers.frame({ seq: ++seq, format: "png", bytes: png, width: WIDTH, height: HEIGHT, frameWidth: WIDTH, frameHeight: HEIGHT }, () => {
122
+ if (open)
123
+ (timer = setTimeout(give, FRAME_MS)).unref();
124
+ });
125
+ };
126
+ if (options.signal?.aborted)
127
+ return { ok: false, error: { code: "aborted", message: "the watch was cancelled before it began" } };
128
+ options.signal?.addEventListener("abort", stop, { once: true });
129
+ watches.add(gone);
130
+ setImmediate(give);
131
+ const screen = {
132
+ input: async (actions) => (open ? { ok: true, value: { done: actions.length } } : { ok: false, error: { code: "gone", message: `the faux desktop ${id}'s watch is closed` } }),
133
+ close: async () => stop(),
134
+ };
135
+ return { ok: true, value: screen };
136
+ };
104
137
  return {
105
138
  id,
106
139
  groups: [...DESKTOP_GROUPS],
107
140
  hello,
108
141
  client: { call },
109
- stream: async ({ viewOnly }) => ({ url: new URL(`${FAUX_VIEW_PATH}/${id}/${viewOnly ? "view" : "drive"}`, viewerBase).href }),
110
- release: async () => void live.delete(id),
142
+ watch,
143
+ release: async () => {
144
+ for (const end of [...watches])
145
+ end();
146
+ },
111
147
  };
112
148
  }
113
149
  return {
@@ -119,12 +155,6 @@ export function fauxComputers({ viewerBase }) {
119
155
  return fauxDesktop();
120
156
  throw new Error(`${entryOf.label} starts no computer: under --faux, only Faux desktop does (set this agent's computer to desktop on Faux desktop, or none)`);
121
157
  },
122
- viewPage(pathname) {
123
- const match = new RegExp(`^${FAUX_VIEW_PATH}/(faux-desktop-\\d+)/(view|drive)$`).exec(pathname);
124
- if (!match || !live.has(match[1]))
125
- return undefined;
126
- const driving = match[2] === "drive";
127
- return `<!doctype html><meta charset="utf-8"><title>Faux desktop ${match[1]}</title><body style="background:#c0c0c0;font:16px sans-serif"><p>Faux desktop ${match[1]}: ${driving ? "driving (taken over)" : "watching (view only)"}</p></body>`;
128
- },
158
+ owns: (provider) => PROVIDERS.some((one) => one.id === provider),
129
159
  };
130
160
  }
@@ -1,10 +1,11 @@
1
1
  import { ApiError } from "./errors.js";
2
2
  import { githubTargetOf } from "./github.js";
3
3
  import type { SealedSettingsOverStore } from "./sealed-settings-store.js";
4
+ import type { Held } from "./template-github-permissions.js";
4
5
  import { type Json } from "./validate.js";
5
6
  /** What every GitHub App Connect GitHub makes asks of the repositories it is installed on (its manifest's
6
- * default_permissions): the least its templates need. A tool that needs more is warned of when a template granting it is
7
- * applied (template-github-permissions.ts), never quietly refused at its first call. */
7
+ * default_permissions): the least its templates need. Applying a template warns from each installation's real permissions
8
+ * (installationPermissions, template-github-permissions.ts), never from this. */
8
9
  export declare const APP_PERMISSIONS: {
9
10
  readonly pull_requests: "write";
10
11
  readonly contents: "read";
@@ -194,6 +195,13 @@ export declare class GitHubConnect {
194
195
  } | {
195
196
  unusable: string;
196
197
  } | Unanswered>;
198
+ /** What each installation of the App holds now, as GitHub says (GET /app/installations/{id} with the App's JWT: its
199
+ * `permissions` map, `admin` read as `write`, which it includes). Never a guess: no App, no installation, GitHub out of
200
+ * reach, an answer that is not a 200 or has no map, or a level it does not know is `unreadable`, with why. */
201
+ installationPermissions(signal?: AbortSignal, limits?: {
202
+ parallel?: number;
203
+ withinMs?: number;
204
+ }): Promise<Held>;
197
205
  /** The first repository installation `id` covers, if any: asked with a metadata-read token that never leaves this
198
206
  * server (only GitHub's API sees it), revoked at once, whatever the answer. A read GitHub did not answer (a 429, a
199
207
  * 5xx, nothing) is UNANSWERED, never "none". */
@@ -13,8 +13,8 @@ import { isObject } from "./validate.js";
13
13
  registerSecretWrite("connectGitHub", () => true);
14
14
  registerSecretWrite("disconnectGitHub", () => true);
15
15
  /** What every GitHub App Connect GitHub makes asks of the repositories it is installed on (its manifest's
16
- * default_permissions): the least its templates need. A tool that needs more is warned of when a template granting it is
17
- * applied (template-github-permissions.ts), never quietly refused at its first call. */
16
+ * default_permissions): the least its templates need. Applying a template warns from each installation's real permissions
17
+ * (installationPermissions, template-github-permissions.ts), never from this. */
18
18
  export const APP_PERMISSIONS = { pull_requests: "write", contents: "read", metadata: "read", issues: "read" };
19
19
  /** How long a Connect's state is good for, and the most kept at once. */
20
20
  export const STATE_MS = 60 * 60 * 1000;
@@ -34,6 +34,9 @@ const consoleAt = (base, page) => `${base ?? ""}${page}`;
34
34
  /** A GitHub login (a user or an organization), as GitHub allows one. */
35
35
  const LOGIN = /^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$/;
36
36
  const SCOPE = GITHUB_SCOPE;
37
+ /** Apply's warning reads the installations' permissions this many at a time, all within one limit (installationPermissions). */
38
+ const PERMISSIONS_PARALLEL = 4;
39
+ const PERMISSIONS_WITHIN_MS = 4_000;
37
40
  /** The installations a sealed `installations` field holds; none for one that does not read. */
38
41
  export function installationsIn(text) {
39
42
  try {
@@ -572,6 +575,66 @@ export class GitHubConnect {
572
575
  return { unusable: `GitHub did not give a token: ${error.message}.` };
573
576
  }
574
577
  }
578
+ /** What each installation of the App holds now, as GitHub says (GET /app/installations/{id} with the App's JWT: its
579
+ * `permissions` map, `admin` read as `write`, which it includes). Never a guess: no App, no installation, GitHub out of
580
+ * reach, an answer that is not a 200 or has no map, or a level it does not know is `unreadable`, with why. */
581
+ async installationPermissions(signal, limits = {}) {
582
+ const credentials = this.connection.credentials();
583
+ const view = this.connection.view();
584
+ if (!credentials || !view)
585
+ return { unreadable: "this server has no GitHub App" };
586
+ if (!view.installations.length)
587
+ return { unreadable: "the GitHub App is not installed on any account yet" };
588
+ // Bounded: a few reads at a time and one time limit for them all, so a slow GitHub or many accounts never hold the
589
+ // caller (Apply) past it. A read the limit cut off is `unread`, said so, never passed.
590
+ const withinMs = limits.withinMs ?? PERMISSIONS_WITHIN_MS;
591
+ const deadline = AbortSignal.timeout(withinMs);
592
+ const both = signal ? AbortSignal.any([signal, deadline]) : deadline;
593
+ const read = async (installation) => {
594
+ if (deadline.aborted)
595
+ return { why: `no answer within ${withinMs / 1000} s` };
596
+ let answer;
597
+ try {
598
+ const jwt = appJwt(credentials.appId, credentials.pem, this.options.now?.() ?? Date.now());
599
+ answer = await githubCall(this.options.api, `/app/installations/${installation.id}`, { jwt, signal: both });
600
+ }
601
+ catch (error) {
602
+ return { why: deadline.aborted ? `no answer within ${withinMs / 1000} s` : error.message };
603
+ }
604
+ const map = isObject(answer.json) ? answer.json.permissions : undefined;
605
+ if (answer.status !== 200 || !isObject(map))
606
+ return { why: `GitHub gave no permissions for the installation on ${installation.account} (HTTP ${answer.status})` };
607
+ const permissions = {};
608
+ for (const [name, level] of Object.entries(map)) {
609
+ if (level !== "read" && level !== "write" && level !== "admin")
610
+ return { why: `GitHub gave a level this server does not know for ${name} on ${installation.account}` };
611
+ permissions[name] = level === "read" ? "read" : "write";
612
+ }
613
+ return { permissions };
614
+ };
615
+ const results = new Array(view.installations.length);
616
+ let next = 0;
617
+ const worker = async () => {
618
+ while (next < view.installations.length) {
619
+ const at = next++;
620
+ results[at] = await read(view.installations[at]);
621
+ }
622
+ };
623
+ await Promise.all(Array.from({ length: Math.min(limits.parallel ?? PERMISSIONS_PARALLEL, view.installations.length) }, worker));
624
+ const installations = [];
625
+ const unread = [];
626
+ view.installations.forEach((installation, at) => {
627
+ const result = results[at];
628
+ if ("permissions" in result)
629
+ installations.push({ account: installation.account, permissions: result.permissions });
630
+ else
631
+ unread.push({ account: installation.account, why: result.why });
632
+ });
633
+ // Nothing read at all: the check could not be made, with the first reason.
634
+ if (!installations.length)
635
+ return { unreadable: unread[0].why };
636
+ return unread.length ? { installations, unread } : { installations };
637
+ }
575
638
  /** The first repository installation `id` covers, if any: asked with a metadata-read token that never leaves this
576
639
  * server (only GitHub's API sees it), revoked at once, whatever the answer. A read GitHub did not answer (a 429, a
577
640
  * 5xx, nothing) is UNANSWERED, never "none". */
@@ -16,7 +16,7 @@ const TOKEN_MS = 60 * 60_000;
16
16
  export async function startFauxGitHub() {
17
17
  const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 2048, privateKeyEncoding: { type: "pkcs1", format: "pem" }, publicKeyEncoding: { type: "spki", format: "pem" } });
18
18
  const app = { id: FAUX_GITHUB.appId, slug: FAUX_GITHUB.slug, clientId: `Iv1.faux${randomBytes(6).toString("hex")}`, pem: privateKey, webhookSecret: randomBytes(24).toString("hex"), settingsUrl: `https://github.com/organizations/${FAUX_GITHUB.account}/settings/apps/${FAUX_GITHUB.slug}` };
19
- const installation = { id: FAUX_GITHUB.installation, account: { login: FAUX_GITHUB.account, type: "Organization" }, app_id: Number(FAUX_GITHUB.appId), suspended_at: null };
19
+ const installation = { id: FAUX_GITHUB.installation, account: { login: FAUX_GITHUB.account, type: "Organization" }, app_id: Number(FAUX_GITHUB.appId), suspended_at: null, permissions: { metadata: "read", contents: "read", pull_requests: "write", issues: "read" } };
20
20
  /** Each token minted, by its value: the repositories it was narrowed to (by name), or every one the installation covers. */
21
21
  const tokens = new Map();
22
22
  const covered = (names) => FAUX_GITHUB.repositories.filter((full) => !names || names.includes(full.split("/")[1]));
@@ -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 { Store } from "./store/store.js";
3
3
  export type GraphNodeStatus = "pending" | "working" | "done" | "failed" | "stopped" | "escalated" | "not_run" | "needs_review";
4
4
  type Item = {
@@ -34,13 +34,18 @@ function kernelTool(tool) {
34
34
  description: tool.description,
35
35
  inputSchema: tool.inputSchema,
36
36
  replay: tool.replay,
37
+ ...(tool.nests ? { nests: true } : {}),
38
+ ...(tool.deferred ? { deferred: true } : {}),
37
39
  async execute(input, io) {
38
40
  // The effect's step is `tool:<the model's call id>#<attempt>`: the host sees the model's call id.
39
41
  const callId = (io.stepId ?? "").replace(/^tool:/, "").replace(/#\d+$/, "");
40
- const result = await tool.call(input, { callId, signal: io.signal });
42
+ // A tool that nests calls (tools_call, codemode) gets the session's tools as its nested calls, through the bridge.
43
+ const result = await tool.call(input, { callId, signal: io.signal, ...(io.nested ? { nested: io.nested } : {}) });
41
44
  if (result.isError)
42
45
  throw new Error(result.text);
43
- return result.images?.length ? { text: result.text, images: result.images } : result.text;
46
+ // Its value, recorded with the outcome: a script's nested call is answered it (meta-tools.ts).
47
+ const structured = result.structured !== undefined ? { structured: result.structured } : {};
48
+ return result.images?.length ? { text: result.text, images: result.images, ...structured } : result.structured === undefined ? result.text : { text: result.text, ...structured };
44
49
  },
45
50
  };
46
51
  }
@@ -105,7 +110,6 @@ export function openCodeAdapter(options) {
105
110
  };
106
111
  return {
107
112
  id: "opencode",
108
- capabilities: () => ({}),
109
113
  check(spec) {
110
114
  const problems = [];
111
115
  if (spec.context === "fork")
@@ -13,8 +13,6 @@ export const facts = Object.freeze({
13
13
  // One run's memory, measured with the server's (host.ts): OpenCode's server beside the run's process.
14
14
  runMib: 704,
15
15
  // OpenAI's reasoning efforts stop at xhigh.
16
- // Its MCP client is not bound to the session's remote MCP servers yet.
17
- mcp: false,
18
16
  thinking: Object.freeze(["low", "medium", "high", "xhigh"]),
19
17
  // OpenCode's model requests carry no provider-hosted tool: no search of its own.
20
18
  ownModel: false,
@@ -37,12 +37,9 @@ export interface OpenCodePolicyOptions {
37
37
  */
38
38
  export declare function filtered(text: string, lineStarts?: readonly string[]): boolean;
39
39
  /** The usage of the response an answer ends with: its `response.completed` (or `response.incomplete`) event, each `data:`
40
- * line parsed on its own, or a whole JSON body's; for a line the proxy's 64 KiB window cut, the last `"usage":{` object
41
- * in the text. Undefined, an unknown cost, when there is none. */
40
+ * line parsed on its own, or a whole JSON body's; for a line the proxy's 64 KiB window cut, the last `"usage": {` object
41
+ * in the text, whatever its spacing (the kernel's `lastObjectOf`). Undefined, an unknown cost, when there is none. */
42
42
  export declare function usageOf(text: string): ProxyUsage | undefined;
43
- /** The input tokens the provider bills for `body` that it does not carry (codex's figure: the same Responses API). A file
44
- * input has no stated bound, so a body with one cannot be measured. */
45
- export declare function responsesServerInputOverhead(body: Record<string, unknown>): number;
46
43
  /** The tokens a request keeps for its answer when a spend cap limits its output. */
47
44
  export declare const ANSWER_TOKENS_LEAST = 1024;
48
45
  /** What a reasoning request at each effort is allowed for its reasoning beside its answer, when its output is limited:
@@ -1,4 +1,4 @@
1
- import { providerInputOverhead, ProxyRefusal, responsesImagesIn } from "@parcha/agentrun-kernel/host";
1
+ import { lastObjectOf, OPENAI_INPUT_COUNTER, ProxyRefusal, responsesInputOverhead } from "@parcha/agentrun-kernel/host";
2
2
  /** The prefix OpenCode gives the adapter's MCP tools: the server is `hands`. */
3
3
  export const TOOL_PREFIX = "hands_";
4
4
  export const OPENCODE_RESPONSES_ROUTES = Object.freeze([
@@ -168,8 +168,8 @@ function startOfResponse(data) {
168
168
  }
169
169
  }
170
170
  /** The usage of the response an answer ends with: its `response.completed` (or `response.incomplete`) event, each `data:`
171
- * line parsed on its own, or a whole JSON body's; for a line the proxy's 64 KiB window cut, the last `"usage":{` object
172
- * in the text. Undefined, an unknown cost, when there is none. */
171
+ * line parsed on its own, or a whole JSON body's; for a line the proxy's 64 KiB window cut, the last `"usage": {` object
172
+ * in the text, whatever its spacing (the kernel's `lastObjectOf`). Undefined, an unknown cost, when there is none. */
173
173
  export function usageOf(text) {
174
174
  let found;
175
175
  let ended = false;
@@ -202,34 +202,7 @@ export function usageOf(text) {
202
202
  }
203
203
  catch { }
204
204
  }
205
- const mark = "\"usage\":{";
206
- const at = text.lastIndexOf(mark);
207
- if (at < 0)
208
- return undefined;
209
- const json = objectAt(text, at + mark.length - 1);
210
- if (json === undefined)
211
- return undefined;
212
- try {
213
- return usageFrom(JSON.parse(json));
214
- }
215
- catch {
216
- return undefined;
217
- }
218
- }
219
- /** The items of `type` in `value`, at any depth. */
220
- function itemsIn(value, type) {
221
- if (Array.isArray(value))
222
- return value.reduce((n, item) => n + itemsIn(item, type), 0);
223
- if (!isPlain(value))
224
- return 0;
225
- return (value.type === type ? 1 : 0) + Object.values(value).reduce((n, item) => n + itemsIn(item, type), 0);
226
- }
227
- /** The input tokens the provider bills for `body` that it does not carry (codex's figure: the same Responses API). A file
228
- * input has no stated bound, so a body with one cannot be measured. */
229
- export function responsesServerInputOverhead(body) {
230
- if (itemsIn(body.input, "input_file") > 0)
231
- throw new Error("a file input's billed size has no stated bound");
232
- return providerInputOverhead("openai-responses", { tools: Array.isArray(body.tools) && body.tools.length > 0, images: responsesImagesIn(body.input), ...(typeof body.model === "string" ? { model: body.model } : {}) });
205
+ return usageFrom(lastObjectOf(text, "usage"));
233
206
  }
234
207
  /** An event that is not whole by this many characters is not read. */
235
208
  const EVENT_CAP = 4 * 1024 * 1024;
@@ -418,7 +391,10 @@ export function openCodePolicy(options) {
418
391
  outputAsked: responsesOutputAsked,
419
392
  outputLeast: responsesOutputLeast,
420
393
  limitOutput: limitResponsesOutput,
421
- serverInputOverhead: responsesServerInputOverhead,
394
+ // Its bytes less the escapes in the text it carries (codex's figure: the same Responses API), and on a route straight
395
+ // to OpenAI, OpenAI's own count when that is lower.
396
+ serverInputOverhead: responsesInputOverhead,
397
+ countInput: OPENAI_INPUT_COUNTER,
422
398
  // A stop counts the content it streamed, not the wire, and the part of its reasoning budget that did not stream.
423
399
  reasoningHidden: (body) => responsesReasoningHidden(body, maxOutputTokens),
424
400
  reasoningBytesOf: responsesReasoningBytes,
@@ -24,8 +24,6 @@ export interface HarnessEntry {
24
24
  readonly steer: boolean;
25
25
  /** What one of its runs reserves in memory while its process lives, in MiB (host.ts). */
26
26
  readonly runMib: number;
27
- /** Whether it binds a run's remote MCP servers. */
28
- readonly mcp: boolean;
29
27
  /** A server too small for even one of its runs still runs one at a time (pi's, as before runs were admitted by memory). */
30
28
  readonly oneAlwaysFits: boolean;
31
29
  /** Its adapter's facts; none for pi, which runs in the run's own process on its own models. */
@@ -42,7 +42,6 @@ const PI = Object.freeze({
42
42
  id: DEFAULT_HARNESS,
43
43
  steer: true,
44
44
  runMib: 128,
45
- mcp: true,
46
45
  oneAlwaysFits: true,
47
46
  runs: () => true,
48
47
  onWire: () => false,
@@ -61,7 +60,6 @@ function adapterEntry(facts, make, extra = {}) {
61
60
  id,
62
61
  steer: facts.steer,
63
62
  runMib: facts.runMib,
64
- mcp: facts.mcp,
65
63
  oneAlwaysFits: false,
66
64
  facts,
67
65
  ...(installs ? { installs } : {}),
package/dist/harness.d.ts CHANGED
@@ -23,6 +23,7 @@ export type HarnessOffer = {
23
23
  * the memory a run of it reserves (`run_memory_mib`). */
24
24
  export type HarnessCapability = HarnessOffer & {
25
25
  default_model: string | null;
26
+ models: string[];
26
27
  run_memory_mib: number;
27
28
  };
28
29
  /** What this server offers of each harness, checked once per environment: each one's entry in the harness table says
package/dist/harness.js CHANGED
@@ -53,9 +53,43 @@ export function harnessOffers(env) {
53
53
  // Each harness's model when a definition names none, as a save and a run resolve it (runnable.ts): none for a
54
54
  // harness that does not run here, or that no model here would run on.
55
55
  const { harnessModel } = await import("./runnable.js");
56
+ const { pickerCandidates } = await import("./model-form.js");
56
57
  return Promise.all(base.map(async (offer) => {
57
58
  const resolved = offer.available ? await harnessModel(env, offer.id, undefined, true) : undefined;
58
- return { ...offer, default_model: resolved && "model" in resolved ? `${resolved.model.provider}/${resolved.model.modelId}` : null, run_memory_mib: harnessOf(env, offer.id).runMib };
59
+ // The models a person may pick for it (model-form.ts), each in the form it takes: those its entry's own choice
60
+ // takes (the catalog it runs on knows the id, a key may still be missing: a save warns of that, never refuses),
61
+ // so the picker never offers one a save would refuse. None for a harness that does not run here.
62
+ const entry = harnessOf(env, offer.id);
63
+ const models = [];
64
+ if (offer.available) {
65
+ // Each choice passes what a save and a run ask, by construction: the save's own shape check (MODEL_REF), the
66
+ // harness's own choice of it, and, on an adapter's wire, providerFor, the function a run starts with. A model
67
+ // the wire cannot take (a vendor it does not run, an endpoint a key may not go to) is not offered; one that
68
+ // lacks only a key is (a save warns of that, never refuses).
69
+ const { MODEL_REF } = await import("./validate.js");
70
+ const { providerFor, HarnessUnavailable } = await import("./provider.js");
71
+ const { ADAPTER_FACTS } = await import("./adapter-facts.js");
72
+ const { FAUX_ENV } = await import("./model.js");
73
+ const facts = ADAPTER_FACTS.find((f) => f.id === offer.id);
74
+ for (const id of pickerCandidates(env, offer.id)) {
75
+ if (!MODEL_REF.test(id))
76
+ continue;
77
+ const chosen = await entry.model(env, id, true);
78
+ if (!chosen || !("model" in chosen || chosen.needs === "key"))
79
+ continue;
80
+ if (facts && "model" in chosen && !env[FAUX_ENV]) {
81
+ try {
82
+ providerFor(facts.wire, env, chosen.model, offer.id);
83
+ }
84
+ catch (error) {
85
+ if (!(error instanceof HarnessUnavailable && error.keys?.length))
86
+ continue;
87
+ }
88
+ }
89
+ models.push(id);
90
+ }
91
+ }
92
+ return { ...offer, default_model: resolved && "model" in resolved ? `${resolved.model.provider}/${resolved.model.modelId}` : null, models, run_memory_mib: entry.runMib };
59
93
  }));
60
94
  })();
61
95
  offered.set(env, offers);
@@ -1,11 +1,7 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import { type ToolExecutionApi, type ToolRegistration } from "@earendil-works/pi-durable";
3
3
  import type { HostTool } from "@parcha/agentrun-kernel";
4
4
  export { workspaceRelative } from "./workspace-paths.js";
5
- /** Each tool a harness other than pi runs here, by catalog name, and whether a call a crash cut off may run again.
6
- * `learned_workflow` (learned-workflow.ts LEARNED_WORKFLOW_TOOL, named here as a string so the modules do not import
7
- * each other) is never run again. */
8
- export declare const REPLAY: Record<string, "safe" | "never">;
9
5
  export { cutUtf8, MAX_BYTES, MAX_LINES } from "./workspace/executors.js";
10
6
  /** One call's result, kept by its call id for the run's timeline (an adapter's tool_end carries none). */
11
7
  export type ToolResults = Map<string, {
@@ -51,5 +47,5 @@ export interface HostToolCtx {
51
47
  /** One pi ToolRegistration `tool` (named `name` by its catalog name) as the kernel's HostTool an adapter session takes:
52
48
  * the paid-call seam, then the tool on the run's environment and harness, its answer the text a
53
49
  * model reads (the output or the failure, a write's or an error's path named relative to the run's folder). Undefined when
54
- * `name` is not one a host runs (REPLAY). */
50
+ * `name` is not one a host runs (tool-list.ts `replay`). */
55
51
  export declare function hostToolOf(name: string, tool: ToolRegistration, ctx: HostToolCtx): HostTool | undefined;
@@ -1,15 +1,12 @@
1
1
  import { withAbortSignal } from "@earendil-works/chord/context";
2
2
  import { createModels } from "@earendil-works/pi-ai/models";
3
3
  import { ROOT_CONVERSATION_ID } from "@earendil-works/pi-durable";
4
- import { WEB_FETCH_TOOL } from "./web-fetch.js";
5
- import { WEB_SEARCH_TOOL } from "./web-search.js";
4
+ import { replayOf } from "./tool-list.js";
6
5
  import { realOf, workspaceRelative } from "./workspace-paths.js";
7
6
  import { bounded, imagesOf, textOf } from "./workspace/executors.js";
8
7
  export { workspaceRelative } from "./workspace-paths.js";
9
- /** Each tool a harness other than pi runs here, by catalog name, and whether a call a crash cut off may run again.
10
- * `learned_workflow` (learned-workflow.ts LEARNED_WORKFLOW_TOOL, named here as a string so the modules do not import
11
- * each other) is never run again. */
12
- export const REPLAY = { read: "safe", write: "never", edit: "never", bash: "never", [WEB_FETCH_TOOL]: "safe", [WEB_SEARCH_TOOL]: "safe", "monid.discover": "safe", "monid.inspect": "safe", "monid.run": "never", bash_background: "never", bash_output: "safe", bash_input: "never", bash_signal: "never", bash_list: "safe", learned_workflow: "never" };
8
+ // Each tool a harness other than pi runs here, by catalog name, and whether a call a crash cut off may run again, is its
9
+ // row's `replay` (tool-list.ts). `learned_workflow` (learned-workflow.ts LEARNED_WORKFLOW_TOOL) is never run again.
13
10
  // pi's limits on a tool's output, and how a call's output is held within them, are the executors' (workspace/executors.ts).
14
11
  export { cutUtf8, MAX_BYTES, MAX_LINES } from "./workspace/executors.js";
15
12
  /** The members of pi's ToolExecutionApi a host tool's api gives. They are typed against pi's own type (`HostApi`), so a
@@ -38,9 +35,9 @@ const SAYS_PATH = new Set(["write", "edit"]);
38
35
  /** One pi ToolRegistration `tool` (named `name` by its catalog name) as the kernel's HostTool an adapter session takes:
39
36
  * the paid-call seam, then the tool on the run's environment and harness, its answer the text a
40
37
  * model reads (the output or the failure, a write's or an error's path named relative to the run's folder). Undefined when
41
- * `name` is not one a host runs (REPLAY). */
38
+ * `name` is not one a host runs (tool-list.ts `replay`). */
42
39
  export function hostToolOf(name, tool, ctx) {
43
- const replay = REPLAY[name];
40
+ const replay = replayOf(name);
44
41
  if (!replay)
45
42
  return undefined;
46
43
  return {
@@ -59,7 +56,7 @@ export function hostToolOf(name, tool, ctx) {
59
56
  const out = bounded(tool.outputLimits);
60
57
  const notes = [];
61
58
  const env = await ctx.env();
62
- // The call's id and the run's store, as pi's: a paid call marks and books its charge there (monid.ts).
59
+ // The call's id and the run's store, as pi's: a paid call marks and books its charge there.
63
60
  const api = hostApi({
64
61
  env, callId,
65
62
  commit: ctx.commit,
@@ -71,7 +68,7 @@ export function hostToolOf(name, tool, ctx) {
71
68
  snapshot: ctx.snapshot, waitForTask: ctx.waitForTask,
72
69
  });
73
70
  // A tool that throws (bash on a non-zero exit or a timeout) still answers with its output, as pi's harness does;
74
- // monid's answer a failure as an error result, which is kept as it is.
71
+ // one that answers a failure as an error result is kept as it is.
75
72
  const result = await tool.execute(args, api, withAbortSignal(signal, ctx.context)).catch((error) => ({ failed: error.message, isError: true }));
76
73
  // pi names a result's blocks `output`; its bash answers its exit as a result's diagnostic.
77
74
  const given = result;