@parcha/agentrun-serve 0.1.0-beta.37 → 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 (399) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/README.md +155 -92
  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/browser-cost.js +52 -93
  11. package/dist/cap.d.ts +0 -390
  12. package/dist/cap.js +4 -937
  13. package/dist/catalog.js +1 -1
  14. package/dist/composio-preset.d.ts +17 -0
  15. package/dist/composio-preset.js +43 -1
  16. package/dist/computer-calls.d.ts +36 -24
  17. package/dist/computer-calls.js +110 -27
  18. package/dist/computer-live.d.ts +5 -0
  19. package/dist/computer-live.js +12 -0
  20. package/dist/computer-setting.d.ts +15 -2
  21. package/dist/computer-setting.js +20 -4
  22. package/dist/computer-view.d.ts +3 -2
  23. package/dist/computer-view.js +5 -4
  24. package/dist/computer-viewer.js +26 -12
  25. package/dist/computers.d.ts +4 -1
  26. package/dist/computers.js +12 -6
  27. package/dist/console/assets/index-CjqQirbo.css +1 -0
  28. package/dist/console/assets/index-b6-XY5A9.js +576 -0
  29. package/dist/console/index.html +2 -2
  30. package/dist/console-links.d.ts +2 -0
  31. package/dist/console-links.js +3 -0
  32. package/dist/decisions.js +4 -0
  33. package/dist/faux-computers.js +4 -2
  34. package/dist/harness-opencode/adapter.js +7 -3
  35. package/dist/harness-opencode/facts.js +0 -2
  36. package/dist/harness-opencode/host/policy.d.ts +2 -5
  37. package/dist/harness-opencode/host/policy.js +8 -32
  38. package/dist/harness-table.d.ts +0 -2
  39. package/dist/harness-table.js +0 -2
  40. package/dist/host-tools.d.ts +1 -5
  41. package/dist/host-tools.js +7 -10
  42. package/dist/hosted-search.d.ts +0 -2
  43. package/dist/hosted-search.js +0 -21
  44. package/dist/key-words.d.ts +3 -2
  45. package/dist/key-words.js +4 -2
  46. package/dist/learn/check.d.ts +6 -1
  47. package/dist/learn/check.js +12 -4
  48. package/dist/learn/commit.d.ts +10 -0
  49. package/dist/learn/commit.js +18 -4
  50. package/dist/learn/compile.d.ts +243 -0
  51. package/dist/learn/compile.js +471 -0
  52. package/dist/learn/general.d.ts +3 -0
  53. package/dist/learn/general.js +4 -2
  54. package/dist/learn/grade.d.ts +1 -1
  55. package/dist/learn/grade.js +7 -6
  56. package/dist/learn/notes.d.ts +8 -0
  57. package/dist/learn/notes.js +18 -0
  58. package/dist/learn/promote.d.ts +253 -0
  59. package/dist/learn/promote.js +428 -0
  60. package/dist/learn/refit.d.ts +39 -0
  61. package/dist/learn/refit.js +236 -0
  62. package/dist/learn/reflect.d.ts +5 -25
  63. package/dist/learn/reflect.js +14 -131
  64. package/dist/learn/replay-calls.d.ts +63 -0
  65. package/dist/learn/replay-calls.js +158 -0
  66. package/dist/learn/skills.d.ts +17 -9
  67. package/dist/learn/skills.js +132 -42
  68. package/dist/learn/workflow-nodes.d.ts +15 -0
  69. package/dist/learn/workflow-nodes.js +44 -0
  70. package/dist/learned-nodes.d.ts +50 -2
  71. package/dist/learned-nodes.js +41 -2
  72. package/dist/learned-workflow.d.ts +19 -3
  73. package/dist/learned-workflow.js +105 -26
  74. package/dist/learning-batch.d.ts +2 -2
  75. package/dist/learning-batch.js +1 -1
  76. package/dist/learning-cost.d.ts +18 -6
  77. package/dist/learning-cost.js +15 -7
  78. package/dist/learning-routes.d.ts +14 -2
  79. package/dist/learning-routes.js +14 -3
  80. package/dist/learning-words.d.ts +7 -0
  81. package/dist/learning-words.js +7 -0
  82. package/dist/learning.d.ts +31 -6
  83. package/dist/learning.js +7 -4
  84. package/dist/llm.js +0 -3
  85. package/dist/mcp-gateway.d.ts +12 -20
  86. package/dist/mcp-gateway.js +16 -44
  87. package/dist/mcp-oauth.d.ts +5 -0
  88. package/dist/mcp-oauth.js +1 -1
  89. package/dist/mcp-pin-first.d.ts +37 -0
  90. package/dist/mcp-pin-first.js +107 -0
  91. package/dist/mcp-probe.d.ts +8 -9
  92. package/dist/mcp-probe.js +16 -33
  93. package/dist/mcp-servers-store.d.ts +89 -22
  94. package/dist/mcp-servers-store.js +131 -25
  95. package/dist/mcp-sources.d.ts +39 -0
  96. package/dist/mcp-sources.js +74 -0
  97. package/dist/mcp-store.d.ts +11 -0
  98. package/dist/mcp-store.js +16 -2
  99. package/dist/mcp-wire.d.ts +22 -0
  100. package/dist/mcp-wire.js +36 -0
  101. package/dist/mcp.js +3 -3
  102. package/dist/meta-tool-names.d.ts +1 -0
  103. package/dist/meta-tool-names.js +3 -0
  104. package/dist/model.d.ts +13 -0
  105. package/dist/model.js +46 -15
  106. package/dist/monid.d.ts +51 -25
  107. package/dist/monid.js +226 -140
  108. package/dist/openapi.js +336 -66
  109. package/dist/paid-calls.d.ts +26 -29
  110. package/dist/paid-calls.js +46 -102
  111. package/dist/propose.d.ts +7 -1
  112. package/dist/propose.js +18 -6
  113. package/dist/provider.js +9 -2
  114. package/dist/reflect-range.js +2 -1
  115. package/dist/rows.d.ts +5 -3
  116. package/dist/rows.js +15 -4
  117. package/dist/run-launch.d.ts +13 -0
  118. package/dist/run-launch.js +6 -0
  119. package/dist/run-learning-served.d.ts +13 -2
  120. package/dist/run-manifest.d.ts +5 -0
  121. package/dist/run-manifest.js +20 -0
  122. package/dist/run-secrets.js +2 -3
  123. package/dist/run-timeline-served.js +5 -2
  124. package/dist/run-view.d.ts +17 -6
  125. package/dist/run-view.js +51 -22
  126. package/dist/runnable.d.ts +0 -3
  127. package/dist/runnable.js +37 -29
  128. package/dist/runner/adapter-loop.d.ts +24 -10
  129. package/dist/runner/adapter-loop.js +852 -314
  130. package/dist/runner/adapter-run-spec.d.ts +12 -6
  131. package/dist/runner/adapter-run-spec.js +97 -46
  132. package/dist/runner/adapters/pi-computer.d.ts +3 -1
  133. package/dist/runner/adapters/pi-computer.js +13 -5
  134. package/dist/runner/adapters/pi.d.ts +16 -7
  135. package/dist/runner/adapters/pi.js +94 -33
  136. package/dist/runner/cli-run-spec.js +67 -27
  137. package/dist/runner/computer-channel.js +2 -1
  138. package/dist/runner/conformance/harness.d.ts +3 -0
  139. package/dist/runner/conformance/harness.js +145 -4
  140. package/dist/runner/conformance/subject.d.ts +11 -4
  141. package/dist/runner/end-of-run.d.ts +6 -5
  142. package/dist/runner/end-of-run.js +9 -6
  143. package/dist/runner/feedback-round.d.ts +52 -0
  144. package/dist/runner/feedback-round.js +79 -0
  145. package/dist/runner/journal-kinds.d.ts +24 -6
  146. package/dist/runner/journal-kinds.js +15 -0
  147. package/dist/runner/learning-end.d.ts +54 -19
  148. package/dist/runner/learning-end.js +272 -99
  149. package/dist/runner/learning-loop.d.ts +19 -1
  150. package/dist/runner/learning-loop.js +5 -2
  151. package/dist/runner/learning-seed.d.ts +4 -0
  152. package/dist/runner/learning-seed.js +14 -0
  153. package/dist/runner/loop-contract.d.ts +19 -3
  154. package/dist/runner/loop.d.ts +16 -1
  155. package/dist/runner/loop.js +21 -1
  156. package/dist/runner/mcp-claim.d.ts +5 -1
  157. package/dist/runner/mcp-claim.js +66 -50
  158. package/dist/runner/mcp-run.d.ts +16 -52
  159. package/dist/runner/mcp-run.js +12 -84
  160. package/dist/runner/meta-tools.d.ts +37 -0
  161. package/dist/runner/meta-tools.js +268 -0
  162. package/dist/runner/metrics.js +14 -3
  163. package/dist/runner/model-route.js +12 -3
  164. package/dist/runner/monid-run.d.ts +16 -0
  165. package/dist/runner/monid-run.js +96 -0
  166. package/dist/runner/promotion.d.ts +80 -0
  167. package/dist/runner/promotion.js +562 -0
  168. package/dist/runner/reflect-hook.d.ts +36 -21
  169. package/dist/runner/reflect-hook.js +138 -49
  170. package/dist/runner/runner.js +26 -4
  171. package/dist/runner/sessions.d.ts +8 -3
  172. package/dist/runner/sessions.js +5 -1
  173. package/dist/runner/step-guard.d.ts +62 -0
  174. package/dist/runner/step-guard.js +93 -0
  175. package/dist/runner/subagent.d.ts +0 -3
  176. package/dist/runner/subagent.js +7 -12
  177. package/dist/runner/workflow-first.d.ts +216 -0
  178. package/dist/runner/workflow-first.js +303 -0
  179. package/dist/runner/workflow-loop.js +17 -10
  180. package/dist/runner/workflow-spec.d.ts +1 -0
  181. package/dist/runner/workflow-spec.js +7 -3
  182. package/dist/runs-over-store.d.ts +11 -2
  183. package/dist/runs-over-store.js +21 -11
  184. package/dist/server.d.ts +88 -16
  185. package/dist/server.js +380 -87
  186. package/dist/settings-wake.d.ts +8 -6
  187. package/dist/settings-wake.js +13 -7
  188. package/dist/store/agent-body.d.ts +14 -3
  189. package/dist/store/agent-body.js +14 -10
  190. package/dist/store/command-wake.d.ts +3 -2
  191. package/dist/store/command-wake.js +4 -4
  192. package/dist/store/postgres/connection.js +3 -1
  193. package/dist/store/postgres/migrations/0010_imported_templates.sql +18 -0
  194. package/dist/store/postgres/migrations/0011_revision_mcp_pin.sql +13 -0
  195. package/dist/store/schema.d.ts +9 -0
  196. package/dist/store/schema.js +28 -8
  197. package/dist/store/sqlite/connection.d.ts +2 -2
  198. package/dist/store/sqlite/connection.js +2 -2
  199. package/dist/store/sqlite/run-patch.js +19 -7
  200. package/dist/store/sqlite/store.js +59 -18
  201. package/dist/store/store.d.ts +46 -14
  202. package/dist/store-reads/journal.d.ts +25 -1
  203. package/dist/store-reads/journal.js +63 -49
  204. package/dist/store-reads/learning.d.ts +101 -15
  205. package/dist/store-reads/learning.js +195 -61
  206. package/dist/store-reads/loop.d.ts +61 -0
  207. package/dist/store-reads/loop.js +111 -0
  208. package/dist/store-view.d.ts +3 -2
  209. package/dist/store-view.js +35 -17
  210. package/dist/template-eval.d.ts +18 -9
  211. package/dist/template-eval.js +91 -66
  212. package/dist/template-github-permissions.d.ts +2 -2
  213. package/dist/template-github-permissions.js +2 -1
  214. package/dist/template-import.d.ts +31 -0
  215. package/dist/template-import.js +121 -0
  216. package/dist/template-source.d.ts +51 -0
  217. package/dist/template-source.js +371 -0
  218. package/dist/templates.d.ts +218 -46
  219. package/dist/templates.js +493 -181
  220. package/dist/timeline/computer.d.ts +48 -0
  221. package/dist/timeline/computer.js +169 -0
  222. package/dist/timeline/index.d.ts +4 -3
  223. package/dist/timeline/index.js +4 -3
  224. package/dist/timeline/labels.d.ts +6 -2
  225. package/dist/timeline/labels.js +93 -2
  226. package/dist/timeline/origin.d.ts +19 -5
  227. package/dist/timeline/origin.js +11 -4
  228. package/dist/timeline/timeline.d.ts +11 -17
  229. package/dist/timeline/timeline.js +24 -9
  230. package/dist/tool-gate.d.ts +73 -46
  231. package/dist/tool-gate.js +133 -66
  232. package/dist/tool-keys.d.ts +4 -1
  233. package/dist/tool-keys.js +8 -3
  234. package/dist/tool-list.d.ts +26 -0
  235. package/dist/tool-list.js +43 -0
  236. package/dist/tool-names.d.ts +71 -0
  237. package/dist/tool-names.js +99 -0
  238. package/dist/tool-plane.d.ts +29 -27
  239. package/dist/tool-plane.js +65 -37
  240. package/dist/tools.d.ts +22 -6
  241. package/dist/tools.js +24 -20
  242. package/dist/validate.d.ts +15 -7
  243. package/dist/validate.js +91 -44
  244. package/dist/web-fetch.d.ts +1 -7
  245. package/dist/web-fetch.js +2 -22
  246. package/dist/workspace/computer-deps.d.ts +3 -0
  247. package/dist/workspace/computer-deps.js +5 -2
  248. package/dist/workspace/computer-for-claim.d.ts +6 -0
  249. package/dist/workspace/computer-for-claim.js +32 -14
  250. package/dist/workspace/computer-hold.js +7 -1
  251. package/dist/workspace/computer-script.d.ts +23 -7
  252. package/dist/workspace/computer-script.js +48 -14
  253. package/dist/workspace/index.d.ts +2 -2
  254. package/dist/workspace/index.js +1 -1
  255. package/dist/workspace/kind-skills/desktop/SKILL.md +13 -0
  256. package/dist/workspace/kind-skills/phone/SKILL.md +4 -0
  257. package/dist/workspace/local.js +2 -2
  258. package/dist/workspace/resolve-computer.d.ts +21 -1
  259. package/dist/workspace/resolve-computer.js +32 -14
  260. package/dist/workspace/run-tools.d.ts +28 -10
  261. package/dist/workspace/run-tools.js +39 -11
  262. package/dist/{tool-budget.d.ts → wrap-up.d.ts} +1 -18
  263. package/dist/wrap-up.js +21 -0
  264. package/launcher/agentrun-serve +4 -2
  265. package/package.json +9 -9
  266. package/templates/README.md +111 -45
  267. package/templates/code-review/agent.md +30 -14
  268. package/templates/code-review/evals/clean-refactor/case.yaml +2 -1
  269. package/templates/code-review/evals/clean-refactor/graders/head-sha.md +6 -0
  270. package/templates/code-review/evals/injection/case.yaml +2 -1
  271. package/templates/code-review/evals/injection/graders/head-sha.md +6 -0
  272. package/templates/code-review/evals/mentions-defused/case.yaml +2 -2
  273. package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -23
  274. package/templates/code-review/evals/mentions-defused/graders/head-sha.md +6 -0
  275. package/templates/code-review/evals/never-flag/case.yaml +2 -1
  276. package/templates/code-review/evals/never-flag/graders/head-sha.md +6 -0
  277. package/templates/code-review/evals/null-name/case.yaml +2 -1
  278. package/templates/code-review/evals/null-name/graders/head-sha.md +6 -0
  279. package/templates/code-review/evals/off-by-one/case.yaml +2 -1
  280. package/templates/code-review/evals/off-by-one/graders/head-sha.md +6 -0
  281. package/templates/code-review/evals/other-repo/case.yaml +16 -0
  282. package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +130 -0
  283. package/templates/code-review/evals/other-repo/graders/head-sha.md +6 -0
  284. package/templates/code-review/evals/other-repo/graders/no-canary.md +6 -0
  285. package/templates/code-review/evals/other-repo/graders/no-other-repo.md +8 -0
  286. package/templates/code-review/evals/other-repo/graders/refused-not-quoted.md +18 -0
  287. package/templates/code-review/evals/other-repo/prompt.md +10 -0
  288. package/templates/code-review/evals/re-review/case.yaml +2 -1
  289. package/templates/code-review/evals/re-review/graders/head-sha.md +6 -0
  290. package/templates/code-review/evals/re-review-open/case.yaml +2 -1
  291. package/templates/code-review/evals/re-review-open/graders/head-sha.md +6 -0
  292. package/templates/code-review/evals/repo-rule/case.yaml +2 -1
  293. package/templates/code-review/evals/repo-rule/graders/head-sha.md +6 -0
  294. package/templates/code-review/evals/two-defects/case.yaml +2 -1
  295. package/templates/code-review/evals/two-defects/graders/head-sha.md +6 -0
  296. package/templates/code-review/rules/CODEREVIEW.md +1 -1
  297. package/templates/code-review/skills/review/DEEP.md +3 -2
  298. package/templates/code-review/skills/review/REVIEWER.md +3 -2
  299. package/templates/code-review/skills/review/SKILL.md +4 -3
  300. package/templates/code-review/{findings.schema.json → skills/review/findings.schema.json} +1 -0
  301. package/templates/inbound-lead/agent.md +26 -16
  302. package/templates/inbound-lead/evals/injection-in-form/graders/no-exfil.md +16 -0
  303. package/templates/inbound-lead/evals/injection-in-form/prompt.md +2 -2
  304. package/templates/inbound-lead/evals/write-back/case.yaml +2 -6
  305. package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +34 -225
  306. package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +10 -14
  307. package/templates/inbound-lead/evals/write-back/graders/writes-once.md +7 -0
  308. package/templates/inbound-lead/evals/write-back/prompt.md +1 -1
  309. package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +3 -7
  310. package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +34 -225
  311. package/templates/inbound-lead/evals/write-back-wrong-record/graders/form-id.md +17 -0
  312. package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +3 -3
  313. package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +2 -2
  314. package/templates/inbound-lead/skills/lead/SKILL.md +23 -27
  315. package/templates/kyb/agent.md +15 -5
  316. package/templates/kyb/evals/adverse-media/prompt.md +2 -7
  317. package/templates/kyb/evals/canada-active-filed/prompt.md +2 -6
  318. package/templates/kyb/evals/clean-public-company/prompt.md +2 -6
  319. package/templates/kyb/evals/injection-in-page/prompt.md +3 -7
  320. package/templates/kyb/evals/name-collision/prompt.md +2 -6
  321. package/templates/kyb/evals/no-invention/prompt.md +2 -6
  322. package/templates/kyb/evals/opensanctions-on/prompt.md +2 -6
  323. package/templates/kyb/evals/sanctioned-entity/prompt.md +2 -6
  324. package/templates/kyb/kyb.schema.json +8 -7
  325. package/templates/kyb/skills/kyb/SKILL.md +9 -6
  326. package/templates/market-monitor/agent.md +19 -12
  327. package/templates/market-monitor/evals/post-happens/case.yaml +4 -4
  328. package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +13 -9
  329. package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +1 -1
  330. package/templates/market-monitor/evals/post-happens/graders/posted-once.md +3 -3
  331. package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
  332. package/templates/release-notes/agent.md +32 -10
  333. package/templates/release-notes/evals/draft-not-publish/case.yaml +4 -3
  334. package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +29 -51
  335. package/templates/release-notes/evals/every-pr-accounted/case.yaml +2 -1
  336. package/templates/release-notes/evals/issue-write-refused/case.yaml +4 -3
  337. package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +29 -51
  338. package/templates/release-notes/evals/late-arrival/case.yaml +6 -5
  339. package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +29 -51
  340. package/templates/release-notes/evals/learned-style/case.yaml +2 -1
  341. package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +2 -1
  342. package/templates/release-notes/evals/other-repo/case.yaml +24 -0
  343. package/templates/release-notes/evals/other-repo/fixtures/github-mcp.json +907 -0
  344. package/templates/release-notes/evals/other-repo/graders/no-canary.md +7 -0
  345. package/templates/release-notes/evals/other-repo/graders/no-other-repo.md +8 -0
  346. package/templates/release-notes/evals/other-repo/graders/refused-not-quoted.md +18 -0
  347. package/templates/release-notes/evals/other-repo/prompt.md +32 -0
  348. package/templates/release-notes/evals/upgrade-line/case.yaml +2 -1
  349. package/templates/release-notes/evals/user-facing-only/case.yaml +2 -1
  350. package/templates/release-notes/notes.schema.json +1 -1
  351. package/templates/release-notes/skills/release-notes/SKILL.md +26 -17
  352. package/dist/console/assets/index-Cn6JX1uH.js +0 -563
  353. package/dist/console/assets/index-DRN62V5v.css +0 -1
  354. package/dist/tool-blurbs.d.ts +0 -4
  355. package/dist/tool-blurbs.js +0 -28
  356. package/dist/tool-budget.js +0 -62
  357. package/templates/code-review/evals/clean-refactor/graders/schema.md +0 -5
  358. package/templates/code-review/evals/injection/graders/schema.md +0 -5
  359. package/templates/code-review/evals/mentions-defused/graders/schema.md +0 -5
  360. package/templates/code-review/evals/never-flag/graders/schema.md +0 -5
  361. package/templates/code-review/evals/null-name/graders/schema.md +0 -5
  362. package/templates/code-review/evals/off-by-one/graders/schema.md +0 -5
  363. package/templates/code-review/evals/re-review/graders/schema.md +0 -5
  364. package/templates/code-review/evals/re-review-open/graders/schema.md +0 -5
  365. package/templates/code-review/evals/repo-rule/graders/schema.md +0 -5
  366. package/templates/code-review/evals/two-defects/graders/schema.md +0 -5
  367. package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +0 -5
  368. package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +0 -5
  369. package/templates/inbound-lead/evals/learned-correction/graders/schema.md +0 -5
  370. package/templates/inbound-lead/evals/strong-fit/graders/schema.md +0 -5
  371. package/templates/inbound-lead/evals/thin-data/graders/schema.md +0 -5
  372. package/templates/inbound-lead/evals/write-back/graders/schema.md +0 -5
  373. package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +0 -7
  374. package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +0 -18
  375. package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +0 -5
  376. package/templates/kyb/evals/adverse-media/graders/schema.md +0 -5
  377. package/templates/kyb/evals/canada-active-filed/graders/schema.md +0 -5
  378. package/templates/kyb/evals/clean-public-company/graders/schema.md +0 -5
  379. package/templates/kyb/evals/injection-in-page/graders/schema.md +0 -5
  380. package/templates/kyb/evals/name-collision/graders/schema.md +0 -5
  381. package/templates/kyb/evals/no-invention/graders/schema.md +0 -5
  382. package/templates/kyb/evals/opensanctions-on/graders/schema.md +0 -5
  383. package/templates/kyb/evals/sanctioned-entity/graders/schema.md +0 -5
  384. package/templates/market-monitor/evals/blocked-source/graders/schema.md +0 -5
  385. package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +0 -5
  386. package/templates/market-monitor/evals/learned-preference/graders/schema.md +0 -5
  387. package/templates/market-monitor/evals/no-repeats/graders/schema.md +0 -5
  388. package/templates/market-monitor/evals/nothing-changed/graders/schema.md +0 -5
  389. package/templates/market-monitor/evals/post-happens/graders/schema.md +0 -5
  390. package/templates/market-monitor/evals/pricing-change/graders/schema.md +0 -5
  391. package/templates/market-monitor/evals/pricing-moved/graders/schema.md +0 -5
  392. package/templates/release-notes/evals/draft-not-publish/graders/schema.md +0 -5
  393. package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +0 -5
  394. package/templates/release-notes/evals/issue-write-refused/graders/schema.md +0 -5
  395. package/templates/release-notes/evals/late-arrival/graders/schema.md +0 -5
  396. package/templates/release-notes/evals/learned-style/graders/schema.md +0 -5
  397. package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +0 -5
  398. package/templates/release-notes/evals/upgrade-line/graders/schema.md +0 -5
  399. package/templates/release-notes/evals/user-facing-only/graders/schema.md +0 -5
@@ -1,4 +1,5 @@
1
1
  import { type InputIssue } from "./errors.js";
2
+ import { type McpSource } from "./mcp-sources.js";
2
3
  import type { GitHubConnectionView } from "./github-connection.js";
3
4
  import { type Tier } from "./model.js";
4
5
  import { type PinValue } from "./tool-gate.js";
@@ -15,15 +16,21 @@ export declare const TEMPLATES_DIR: string;
15
16
  export declare const MANIFEST = "agent.md";
16
17
  /** A package's model tier, mapped to the server's own (model.ts Tier: AGENT_MODEL_FAST, AGENT_MODEL, AGENT_MODEL_STRONG). */
17
18
  export declare const MODEL_TIERS: Readonly<Record<string, Tier>>;
18
- export declare const PARAMETER_TYPES: readonly ["string", "number", "integer", "boolean"];
19
- /** What a string parameter's value is, for a form to ask for it as such: a schedule's cron line, or an IANA time zone
20
- * (market-monitor's schedule). A form shows a schedule picker and a time-zone choice; the value is the same text. */
21
- export declare const PARAMETER_FORMATS: readonly ["cron", "timezone"];
22
- export declare const GRADER_TYPES: readonly ["llm", "regex", "tool_used", "file_exists", "schema"];
19
+ /** A case's grader types. The answer's output schema is no grader's: every graded run of a package with `output` is held
20
+ * to it by the server's own verdict (template-eval.ts outputVerdict). */
21
+ export declare const GRADER_TYPES: readonly ["llm", "regex", "tool_used", "file_exists"];
23
22
  /** The entries of a package's `computer` preference list: `shell`, a computer that gives the agent a shell here (bash);
24
23
  * `none`, no shell, the file tools alone. Apply takes the first this server meets now (pickComputer). */
25
24
  export declare const COMPUTER_ENTRIES: readonly ["shell", "none"];
26
25
  export type ComputerEntry = (typeof COMPUTER_ENTRIES)[number];
26
+ /** What a package is for, shown on a marketplace page and the console's list: display only, never applied. */
27
+ export declare const CATEGORIES: readonly ["engineering", "security", "sales", "marketing", "research", "finance", "operations", "compliance", "personal"];
28
+ /** An input's or a parameter's types: a scalar, or a list of one. */
29
+ export declare const INPUT_TYPES: readonly ["string", "number", "integer", "boolean", "array"];
30
+ /** What a string input's or parameter's value is: a form asks for it as such, and the server checks the JSON Schema
31
+ * formats it knows. cron and timezone are for the form alone (a schedule picker, a zone choice); where a parameter fills
32
+ * a schedule, the schedule's own check reads the value at apply. */
33
+ export declare const INPUT_FORMATS: readonly ["uri", "email", "hostname", "date", "date-time", "uuid", "cron", "timezone"];
27
34
  /** The keys a package may need: those Settings saves (a tool's or a model provider's), each one a run is handed. */
28
35
  export declare const PACKAGE_SECRETS: readonly string[];
29
36
  /** A package's bounds: each file, all its files together (POST /agents' own body limit), and how many it holds. */
@@ -33,27 +40,41 @@ export declare const MAX_PACKAGE_FILES = 256;
33
40
  /** A file of a package's evals/ (a case's fake MCP server fixture, say), which no agent is given: its own bound, apart
34
41
  * from the agent's files' limits above. The answer's schema is given to the agent, so under evals/ too it keeps those. */
35
42
  export declare const MAX_EVAL_FILE_BYTES: number;
36
- /** An MCP server a package uses: its tools, granted to the agent, and `allow`, those of them the package asks the owner to
37
- * allow (a consent screen shows it). The package sets no permission itself: an apply's `grants`, the owner's answer, do.
38
- * `pin`, by tool: the arguments each of its calls must carry (a value, or `${parameters.<name>}`), which apply writes as
39
- * the tool's pin in the agent's tool settings, so a send goes only to the destination the owner set. */
43
+ /** An MCP server a package uses, by where it comes from (`source`, `toolkit`), never by the name an owner saves it under:
44
+ * inside the package its tools are `mcp:<toolkit>/<tool>`. `tools`, granted to the agent, and `allow`, those of them the
45
+ * package asks the owner to allow (a consent screen shows it, with `reason`). The package sets no permission itself: an
46
+ * apply's `grants`, the owner's answer, do. `pin`, by tool: the arguments each of its calls must carry (a value, or
47
+ * `${parameters.<name>}`), which apply writes as the tool's pin in the agent's tool settings, so a send goes only to the
48
+ * destination the owner set. */
40
49
  export type McpNeed = {
41
- server: string;
50
+ source: McpSource;
51
+ toolkit: string;
42
52
  tools: string[];
43
53
  required: boolean;
54
+ reason?: string;
44
55
  allow: string[];
45
56
  pin: Record<string, Record<string, PinValue>>;
46
57
  };
47
- type Parameter = {
48
- type: (typeof PARAMETER_TYPES)[number];
49
- required: boolean;
50
- description: string;
51
- pattern?: string;
52
- enum?: (string | number | boolean)[];
53
- format?: (typeof PARAMETER_FORMATS)[number];
54
- default?: string | number | boolean;
58
+ /** A need mapped to the saved MCP server an apply gives it (`server`, its saved name). */
59
+ export type McpServed = McpNeed & {
60
+ server: string;
61
+ };
62
+ /** A compiled field schema's (fieldsSchema's) properties, by name. */
63
+ export declare const fieldsOf: (schema: Json) => Record<string, Json>;
64
+ /** Where an imported package came from (POST /v2/templates/import): its source as given, ref and all (the ref an upgrade
65
+ * reads again), the full commit SHA that ref was at when it was read, which is what was imported, and the GitHub account
66
+ * that publishes it. */
67
+ export type PackageOrigin = {
68
+ source: string;
69
+ sha: string;
70
+ publisher: string;
55
71
  };
56
72
  export type Package = {
73
+ /** Its identity here, the one apply and delete take: a bundled package's name (`kyb`); an imported one's source without
74
+ * its ref (`github:<owner>/<repo>[/<path>]`), so the bundled kyb and an imported kyb are two packages. */
75
+ id: string;
76
+ /** Null for a package this server ships. */
77
+ origin: PackageOrigin | null;
57
78
  name: string;
58
79
  /** The agent's name, placeholders unfilled; absent, the package's name. */
59
80
  displayName?: string;
@@ -62,6 +83,9 @@ export type Package = {
62
83
  license?: string;
63
84
  author?: Json;
64
85
  repository?: string;
86
+ /** What it is for and its tags (CATEGORIES, TAG): display only. */
87
+ category?: (typeof CATEGORIES)[number];
88
+ tags: string[];
65
89
  /** Harness ids in the order the package prefers them; absent, any (the server's default). */
66
90
  harness?: string[];
67
91
  /** The agent's tier and the model it prefers on it; `fast` and `strong`, the model it prefers for each of those tiers
@@ -75,8 +99,8 @@ export type Package = {
75
99
  effort?: string;
76
100
  /** Absent, the tools the server gives a new agent that names none. */
77
101
  tools?: string[];
78
- /** MCP servers by the name a server saves them under, and the tools of each the agent is granted. One `required`
79
- * refuses an apply on a server that has not saved it; any other is skipped there, with a warning. */
102
+ /** MCP servers by their source and toolkit, and the tools of each the agent is granted. One `required` refuses an apply
103
+ * on a server that has saved none that matches; any other is skipped there, with a warning. */
80
104
  mcp: McpNeed[];
81
105
  /** The computers it prefers, in order (`[shell, none]`): apply takes the first this server meets now (pickComputer)
82
106
  * and writes it as the agent's computer. Absent (or `default` in the manifest): where this server puts a new agent. */
@@ -89,13 +113,15 @@ export type Package = {
89
113
  /** What the server checks out in each run's folder before its first turn (the definition's `checkout`,
90
114
  * runner/pr-checkout.ts): the pull request the run's GitHub event names. */
91
115
  checkout?: "pull_request";
92
- parameters: Record<string, Parameter>;
116
+ /** The setup an apply takes (manifest `parameters`), compiled as `inputs` are (fieldsSchema): a closed object schema,
117
+ * with no properties when the package names none. */
118
+ parameters: Json;
119
+ /** Each run's typed input (manifest `inputs`), compiled: the agent's input_schema. Absent, a run takes {content}. */
120
+ inputSchema?: Json;
93
121
  secrets: string[];
94
- /** Each run's limits: its spend cap (the agent's max_cost_usd) and the tool calls each of its conversations may make
95
- * (the agent's max_tool_calls, tool-budget.ts). */
122
+ /** Each run's limit: its spend cap (the agent's max_cost_usd). */
96
123
  budget?: {
97
- per_run_usd?: number;
98
- tool_calls?: number;
124
+ per_run_usd: number;
99
125
  };
100
126
  learning?: boolean;
101
127
  /** Whether the agent asks its person before a tool runs (`ask`) or runs unattended (`never`): the package's default,
@@ -108,7 +134,6 @@ export type Package = {
108
134
  };
109
135
  /** The output schema's JSON, parsed (GET /v2/templates shows it). */
110
136
  outputSchema?: Json;
111
- checks: string[];
112
137
  instructions: string;
113
138
  /** Skill files by path under the agent's skills folder (`review/SKILL.md`), each rule beside each SKILL.md. */
114
139
  skills: Record<string, string>;
@@ -127,17 +152,113 @@ export declare function githubTriggerWords(packageName: string, source: Json): s
127
152
  /** What an apply says of a github trigger it skipped because GitHub is not connected here: what to do, and what the
128
153
  * trigger would then run on, in the package's own words ("Code review runs on each pull request to acme/widgets."). */
129
154
  export declare const githubTriggerUnconnected: (packageName: string, source: Json) => string;
130
- /** Reads `dir` checked whole: a valid package, or PackageError with every problem found. */
131
- export declare function readPackage(dir: string): Package;
155
+ /** One entry of a package's folder, as readdirSync's withFileTypes gives it. */
156
+ export type PackageEntry = {
157
+ name: string;
158
+ isDirectory(): boolean;
159
+ isFile(): boolean;
160
+ };
161
+ /** Where readPackage reads a package's files from: a folder on disk (the packages a server ships, `agentrun template
162
+ * validate`), or files held in memory (a package imported from GitHub, template-source.ts), which never touch the disk.
163
+ * Paths are from the package's folder, with forward slashes; "" is the folder itself. */
164
+ export type PackageFiles = {
165
+ /** The package's name: its folder's. */
166
+ readonly name: string;
167
+ /** Where it is, as a refusal names it. */
168
+ readonly where: string;
169
+ /** The entries of the folder at `sub`. */
170
+ entries(sub: string): PackageEntry[];
171
+ kind(path: string): "dir" | "file" | "other" | undefined;
172
+ size(path: string): number;
173
+ text(path: string): string;
174
+ };
175
+ /** A package's folder on disk: each entry as lstat sees it, so a link is an entry of its own kind, never followed. */
176
+ export declare function folderFiles(dir: string): PackageFiles;
177
+ /** A package held in memory, by path (template-source.ts keeps regular files alone): its folders are those its files'
178
+ * paths name. */
179
+ export declare function memoryFiles(name: string, where: string, files: ReadonlyMap<string, Buffer>): PackageFiles;
180
+ /** Reads the package at `from` (its folder, or its files: PackageFiles) checked whole: a valid package, or PackageError
181
+ * with every problem found. */
182
+ export declare function readPackage(from: string | PackageFiles): Package;
132
183
  /** What is wrong with the trigger bodies an apply makes (compiled's `triggers`), as POST /v2/triggers checks a body, all
133
184
  * but the agent each names (the one the apply makes), as of `now`, each field under `triggers.<i>`. A trigger's input is
134
- * its runs' input, and a package's agent is agentic, so each input is checked against DEFAULT_INPUT_SCHEMA too. The
135
- * validator runs it as of the epoch (a time's form only); an apply runs it before it makes anything. */
136
- export declare function madeTriggerIssues(made: Json[], now: number): InputIssue[];
185
+ * its runs' input, and a package's agent is agentic, so each input is checked against the package's input schema in
186
+ * force too (`inputSchema`, its `inputs` compiled: inputSchemaOf). The validator runs it as of the epoch (a time's form
187
+ * only); an apply runs it before it makes anything. */
188
+ export declare function madeTriggerIssues(made: Json[], now: number, inputSchema?: Json): InputIssue[];
137
189
  /** Every package in `dir`: each folder in it, by name. One that does not check throws, so a broken one never serves. */
138
190
  export declare function readPackages(dir?: string): Package[];
139
191
  /** A package as GET /v2/templates lists it: what an apply asks for and makes. */
140
192
  export declare function packageView(p: Package): {
193
+ id: string;
194
+ bundled: boolean;
195
+ source: string | null;
196
+ sha: string | null;
197
+ publisher: string | null;
198
+ name: string;
199
+ display_name: string | null;
200
+ version: string;
201
+ description: string;
202
+ license: string | null;
203
+ author: Json | null;
204
+ repository: string | null;
205
+ category: "engineering" | "security" | "sales" | "marketing" | "research" | "finance" | "operations" | "compliance" | "personal" | null;
206
+ tags: string[];
207
+ output: {
208
+ schema: string;
209
+ json_schema: Json | null;
210
+ } | null;
211
+ harness: string[] | null;
212
+ model: {
213
+ tier: string;
214
+ prefer?: string;
215
+ fast?: string;
216
+ strong?: string;
217
+ } | null;
218
+ effort: string | null;
219
+ tools: string[] | null;
220
+ tool_policy: {
221
+ bash: BashPolicy;
222
+ } | null;
223
+ computer: ("none" | "shell")[] | null;
224
+ checkout: "pull_request" | null;
225
+ mcp: {
226
+ source: "url" | "github" | "composio";
227
+ toolkit: string;
228
+ required: boolean;
229
+ reason: string | null;
230
+ tools: {
231
+ pin?: Record<string, PinValue> | undefined;
232
+ name: string;
233
+ tool: string;
234
+ asks: string;
235
+ }[];
236
+ }[];
237
+ parameters: Json;
238
+ input_schema: Json | null;
239
+ secrets: string[];
240
+ budget: {
241
+ per_run_usd: number;
242
+ } | null;
243
+ learning: boolean;
244
+ approvals_default: "ask" | "never";
245
+ triggers: Json[];
246
+ skills: string[];
247
+ evals: string[];
248
+ };
249
+ /** A package as an import answers it: its listing, and every text its agent would be given, the instructions and each
250
+ * skill file by path (a rule and the answer's schema beside each SKILL.md among them), so a person reads what a third
251
+ * party's package would tell their agent before it is installed. */
252
+ export declare function packageDetail(p: Package): {
253
+ instructions: string;
254
+ skill_files: {
255
+ [x: string]: string;
256
+ };
257
+ id: string;
258
+ bundled: boolean;
259
+ source: string | null;
260
+ sha: string | null;
261
+ publisher: string | null;
141
262
  name: string;
142
263
  display_name: string | null;
143
264
  version: string;
@@ -145,6 +266,8 @@ export declare function packageView(p: Package): {
145
266
  license: string | null;
146
267
  author: Json | null;
147
268
  repository: string | null;
269
+ category: "engineering" | "security" | "sales" | "marketing" | "research" | "finance" | "operations" | "compliance" | "personal" | null;
270
+ tags: string[];
148
271
  output: {
149
272
  schema: string;
150
273
  json_schema: Json | null;
@@ -164,8 +287,10 @@ export declare function packageView(p: Package): {
164
287
  computer: ("none" | "shell")[] | null;
165
288
  checkout: "pull_request" | null;
166
289
  mcp: {
167
- server: string;
290
+ source: "url" | "github" | "composio";
291
+ toolkit: string;
168
292
  required: boolean;
293
+ reason: string | null;
169
294
  tools: {
170
295
  pin?: Record<string, PinValue> | undefined;
171
296
  name: string;
@@ -173,11 +298,11 @@ export declare function packageView(p: Package): {
173
298
  asks: string;
174
299
  }[];
175
300
  }[];
176
- parameters: Record<string, Parameter>;
301
+ parameters: Json;
302
+ input_schema: Json | null;
177
303
  secrets: string[];
178
304
  budget: {
179
- per_run_usd?: number;
180
- tool_calls?: number;
305
+ per_run_usd: number;
181
306
  } | null;
182
307
  learning: boolean;
183
308
  approvals_default: "ask" | "never";
@@ -185,12 +310,28 @@ export declare function packageView(p: Package): {
185
310
  skills: string[];
186
311
  evals: string[];
187
312
  };
313
+ /** The packages this server serves: the ones it ships, read at its start, and the ones imported here (the store keeps
314
+ * them; the server loads them beside the bundled ones at its start). An id is one package; a bundled one is never
315
+ * replaced or removed, and an imported id (`github:…`) is never a bundled one's name. */
316
+ export declare class TemplateRegistry {
317
+ private readonly bundled;
318
+ private readonly imported;
319
+ constructor(bundled: readonly Package[]);
320
+ /** The bundled packages by name, then the imported ones by id. */
321
+ list(): Package[];
322
+ get(id: string): Package | undefined;
323
+ /** An imported package, in place of the one under its id. */
324
+ put(p: Package): void;
325
+ /** Whether an imported package of that id was there to remove. */
326
+ remove(id: string): boolean;
327
+ }
188
328
  /** POST /v2/templates/{name}/apply's body (`{parameters, grants?, overrides?: {model}}`), checked against the package:
189
- * the parameters as given, the MCP tools the owner allows (each one the package lists, by its gate name), and the model
329
+ * the parameters as given (a blank one at its default), the MCP tools the owner allows (each one the package lists, by its gate name), and the model
190
330
  * asked for in place of the package's. 422 naming every field that is wrong. */
191
331
  export declare function applyBodyOf(p: Package, body: Json): {
192
- parameters: Record<string, string | number | boolean>;
332
+ parameters: Json;
193
333
  grants: string[];
334
+ servers: Record<string, string>;
194
335
  model?: string;
195
336
  approvals?: Approvals;
196
337
  };
@@ -249,19 +390,23 @@ export declare function packageTiers(env: NodeJS.ProcessEnv, model: Package["mod
249
390
  warning?: string;
250
391
  }>;
251
392
  /** The bodies an apply makes: POST /v2/agents' (its definition and skill files) and each trigger's, with no agent_id,
252
- * every `${parameters.x}` filled. `mcp`: the package's MCP servers this server has saved, whose tools are granted beside
253
- * the package's tools (or, when it names none, `defaultTools`, those this server gives a new agent), each at the
254
- * owner's own setting; `grants`, the owner's answer at apply, alone are set to allow. A tool the package pins gets its
255
- * pin, filled, in the agent's tool settings, whatever its permission; one whose pin fills empty (its parameter not
256
- * given) is set to deny instead, granted or not, and named in `unpinned` (by gate name, with the parameters not given):
257
- * a send with no destination set never runs. */
393
+ * every `${parameters.x}` filled. `grants`, the owner's answer at apply (the tools ticked, by the saved servers' names):
394
+ * of the package's tools on `mcp`, its needs each served by a saved server, those alone are granted, beside the package's tools (or, when it names
395
+ * none, `defaultTools`, those this server gives a new agent), each set to allow but those `held` (a deny the owner set on
396
+ * this server holds them: granted, never allowed). A tool left unticked is not the agent's at all, so no harness offers
397
+ * it and approvals never, which lifts an ask of a tool the agent has, has nothing to lift: the owner grants it later in
398
+ * the agent's tools. A tool the package pins gets its pin, filled, in the agent's tool settings, whatever its permission
399
+ * and ticked or not (it holds once the tool is granted later); one whose pin fills empty (its parameter not given) is set
400
+ * to deny instead, and named in `unpinned` (by gate name, with the parameters not given): a send with no destination set
401
+ * never runs. */
258
402
  export declare function compiled(p: Package, parameters: Json, chosen: {
259
403
  harness?: string;
260
404
  model?: string;
261
405
  modelTiers?: Record<string, string>;
262
- mcp: McpNeed[];
406
+ mcp: McpServed[];
263
407
  defaultTools: readonly string[];
264
408
  grants: readonly string[];
409
+ held?: readonly string[];
265
410
  approvals?: Approvals;
266
411
  computer?: ComputerPick;
267
412
  }, _deps?: TemplatesDeps): {
@@ -274,9 +419,36 @@ export declare function compiled(p: Package, parameters: Json, chosen: {
274
419
  };
275
420
  /** Each pin the package's MCP servers (`mcp`) set, by the tool's gate name, its values filled from `parameters`, and the
276
421
  * parameters it names that were not given (`empty`, none when it fills whole). */
277
- export declare function filledPins(mcp: readonly McpNeed[], parameters: Json): {
422
+ export declare function filledPins(mcp: readonly McpServed[], parameters: Json): {
278
423
  tool: string;
279
424
  pin: Record<string, PinValue>;
280
425
  empty: string[];
281
426
  }[];
282
- export {};
427
+ /** How the owner sets up a need no saved server matches, in words: the Composio preset with its toolkit and actions,
428
+ * GitHub's MCP on the App, or any server marked with the toolkit in Settings. */
429
+ export declare function mcpSetUp(need: Pick<McpNeed, "source" | "toolkit" | "tools">): string;
430
+ /** A saved MCP server as an apply matches it: its name and the source and toolkit it records (mcp-sources.ts). */
431
+ export type SavedSource = {
432
+ name: string;
433
+ source: McpSource;
434
+ toolkit: string | null;
435
+ };
436
+ /** Each MCP need of `p` mapped to a saved server here: `candidates`, those whose record is the need's {source, toolkit},
437
+ * by name; `server`, the owner's pick among them (`picks`, by toolkit), else the one candidate, else none. Never picked
438
+ * silently: several candidates and no pick is refused (422 under servers.<toolkit>, naming them), and so is a pick that
439
+ * is not a candidate (an owner never maps a need to a server that says it is something else). */
440
+ export declare function serversFor(p: Package, saved: readonly SavedSource[], picks: Readonly<Record<string, string>>): {
441
+ need: McpNeed;
442
+ server: string | null;
443
+ candidates: string[];
444
+ }[];
445
+ /** Catalog name `name` on the saved servers of `servers` ({toolkit: saved name}): read (parseToolName), its server swapped
446
+ * when it is one of the package's toolkits, and written again (formatToolName); a wildcard `mcp:<toolkit>/*` the same
447
+ * way. Any other name, or one outside the grammar, as it is. */
448
+ export declare function onServerName(name: string, servers: Readonly<Record<string, string>>): string;
449
+ /** `text` with each whole catalog MCP name in it on the saved servers' (onServerName), in one pass, so a server named as
450
+ * another of the package's toolkits is never rewritten twice. */
451
+ export declare function onServerNames(text: string, servers: Readonly<Record<string, string>>): string;
452
+ /** `p` as the agent an apply makes on `servers` sees it: its instructions and each skill file with the package's tool
453
+ * names on the saved servers' (onServerNames). Nothing else of it names a server: its pins and allow are by tool. */
454
+ export declare function onServers(p: Package, servers: Readonly<Record<string, string>>): Package;