@parcha/agentrun-serve 0.1.0-beta.32 → 0.1.0-beta.34

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 (444) hide show
  1. package/CHANGELOG.md +270 -0
  2. package/README.md +343 -246
  3. package/dist/adapters.d.ts +0 -7
  4. package/dist/adapters.js +11 -22
  5. package/dist/agent-rows.d.ts +98 -0
  6. package/dist/agent-rows.js +1 -0
  7. package/dist/agents-store.d.ts +6 -2
  8. package/dist/agents-store.js +60 -25
  9. package/dist/agents.d.ts +9 -125
  10. package/dist/agents.js +15 -305
  11. package/dist/answer-json.d.ts +23 -0
  12. package/dist/answer-json.js +58 -0
  13. package/dist/api-only.d.ts +14 -0
  14. package/dist/api-only.js +33 -0
  15. package/dist/archil-routes.d.ts +1 -1
  16. package/dist/bash-read-only.d.ts +22 -0
  17. package/dist/bash-read-only.js +701 -0
  18. package/dist/box-egress-vm.d.ts +0 -8
  19. package/dist/box-egress-vm.js +0 -10
  20. package/dist/box-egress.d.ts +0 -4
  21. package/dist/box-egress.js +1 -16
  22. package/dist/box-paths.d.ts +25 -2
  23. package/dist/box-paths.js +79 -11
  24. package/dist/box-relay.d.ts +0 -11
  25. package/dist/box-relay.js +0 -20
  26. package/dist/box-settings.d.ts +26 -0
  27. package/dist/box-settings.js +63 -0
  28. package/dist/boxes.d.ts +21 -1
  29. package/dist/boxes.js +27 -20
  30. package/dist/browser-commands.d.ts +5 -2
  31. package/dist/browser-commands.js +4 -4
  32. package/dist/browser-computer.d.ts +5 -0
  33. package/dist/browser-computer.js +21 -0
  34. package/dist/browser-cost.d.ts +9 -6
  35. package/dist/browser-cost.js +94 -51
  36. package/dist/browser-live.d.ts +7 -20
  37. package/dist/browser-live.js +15 -93
  38. package/dist/browser-person.d.ts +18 -53
  39. package/dist/browser-person.js +94 -279
  40. package/dist/budget.d.ts +0 -4
  41. package/dist/budget.js +0 -7
  42. package/dist/cap.d.ts +8 -12
  43. package/dist/cap.js +12 -27
  44. package/dist/cli.js +61 -20
  45. package/dist/closed-pipes.d.ts +2 -0
  46. package/dist/closed-pipes.js +13 -0
  47. package/dist/computer-commands.d.ts +2 -0
  48. package/dist/computer-commands.js +2 -0
  49. package/dist/computer-keys.js +5 -2
  50. package/dist/computer-setting.d.ts +20 -4
  51. package/dist/computer-setting.js +25 -5
  52. package/dist/computers.d.ts +31 -3
  53. package/dist/computers.js +70 -11
  54. package/dist/confine.d.ts +120 -0
  55. package/dist/confine.js +436 -0
  56. package/dist/console/assets/index-RPHGlXmM.js +540 -0
  57. package/dist/console/assets/index-opTN5Naq.css +1 -0
  58. package/dist/console/index.html +2 -2
  59. package/dist/daytona-api.d.ts +0 -11
  60. package/dist/daytona-api.js +1 -82
  61. package/dist/decision-rows.d.ts +1 -1
  62. package/dist/decision-rows.js +1 -1
  63. package/dist/docker-daemon.d.ts +31 -0
  64. package/dist/docker-daemon.js +56 -0
  65. package/dist/docker-host-addresses.d.ts +37 -0
  66. package/dist/docker-host-addresses.js +110 -0
  67. package/dist/effort-guidance.js +4 -3
  68. package/dist/environment.d.ts +0 -3
  69. package/dist/environment.js +3 -5
  70. package/dist/errors.d.ts +0 -2
  71. package/dist/errors.js +6 -9
  72. package/dist/filed-answer.d.ts +32 -0
  73. package/dist/filed-answer.js +160 -0
  74. package/dist/files.d.ts +1 -11
  75. package/dist/files.js +2 -21
  76. package/dist/github-connection.d.ts +2 -2
  77. package/dist/github-connection.js +1 -1
  78. package/dist/graph-view.d.ts +3 -5
  79. package/dist/graph-view.js +4 -14
  80. package/dist/handed-values.d.ts +9 -0
  81. package/dist/handed-values.js +26 -0
  82. package/dist/harness-install.d.ts +22 -5
  83. package/dist/harness-install.js +98 -20
  84. package/dist/harness-opencode/adapter.d.ts +7 -0
  85. package/dist/harness-opencode/adapter.js +23 -6
  86. package/dist/harness-opencode/index.d.ts +1 -1
  87. package/dist/harness-opencode/index.js +1 -1
  88. package/dist/harness-opencode/verify.d.ts +17 -0
  89. package/dist/harness-opencode/verify.js +30 -10
  90. package/dist/harness-table.js +6 -1
  91. package/dist/harness.d.ts +4 -3
  92. package/dist/harness.js +16 -1
  93. package/dist/heard.js +1 -1
  94. package/dist/held-fd.d.ts +5 -0
  95. package/dist/held-fd.js +14 -0
  96. package/dist/host-calls.d.ts +20 -0
  97. package/dist/host-calls.js +12 -0
  98. package/dist/host-tools.d.ts +4 -21
  99. package/dist/host-tools.js +4 -61
  100. package/dist/host.d.ts +2 -4
  101. package/dist/host.js +2 -7
  102. package/dist/import-summary.d.ts +1 -5
  103. package/dist/import-summary.js +0 -21
  104. package/dist/import.d.ts +6 -6
  105. package/dist/import.js +62 -24
  106. package/dist/key-refusal.d.ts +5 -1
  107. package/dist/key-refusal.js +19 -4
  108. package/dist/learn/check.d.ts +6 -2
  109. package/dist/learn/check.js +83 -29
  110. package/dist/learn/folder.d.ts +5 -1
  111. package/dist/learn/folder.js +10 -3
  112. package/dist/learn/grade.d.ts +14 -0
  113. package/dist/learn/grade.js +68 -12
  114. package/dist/learn/index.d.ts +4 -4
  115. package/dist/learn/index.js +4 -4
  116. package/dist/learn/reflect.d.ts +31 -2
  117. package/dist/learn/reflect.js +79 -4
  118. package/dist/learn/relevance.d.ts +24 -0
  119. package/dist/learn/relevance.js +91 -0
  120. package/dist/learn/secrets.d.ts +8 -1
  121. package/dist/learn/secrets.js +95 -15
  122. package/dist/learn/skills.d.ts +112 -14
  123. package/dist/learn/skills.js +556 -52
  124. package/dist/learned-workflow.d.ts +37 -5
  125. package/dist/learned-workflow.js +106 -12
  126. package/dist/learning-routes.d.ts +16 -49
  127. package/dist/learning-routes.js +46 -36
  128. package/dist/learning-run.d.ts +6 -250
  129. package/dist/learning-run.js +11 -665
  130. package/dist/learning-words.d.ts +12 -5
  131. package/dist/learning-words.js +18 -9
  132. package/dist/learning.d.ts +93 -77
  133. package/dist/learning.js +176 -304
  134. package/dist/live/stream.js +1 -1
  135. package/dist/live/translate.js +13 -3
  136. package/dist/local-models.d.ts +11 -5
  137. package/dist/local-models.js +13 -8
  138. package/dist/mcp-gateway.d.ts +11 -52
  139. package/dist/mcp-gateway.js +44 -148
  140. package/dist/mcp-oauth.d.ts +10 -14
  141. package/dist/mcp-oauth.js +14 -32
  142. package/dist/mcp-probe.d.ts +0 -7
  143. package/dist/mcp-probe.js +4 -10
  144. package/dist/mcp-servers-store.d.ts +6 -6
  145. package/dist/mcp-servers-store.js +13 -15
  146. package/dist/mcp-store.js +3 -4
  147. package/dist/mcp.js +4 -3
  148. package/dist/model.d.ts +6 -7
  149. package/dist/model.js +43 -27
  150. package/dist/monid.d.ts +0 -2
  151. package/dist/monid.js +3 -6
  152. package/dist/openapi.d.ts +8 -1
  153. package/dist/openapi.js +124 -50
  154. package/dist/page.d.ts +1 -3
  155. package/dist/page.js +9 -19
  156. package/dist/paid-calls.d.ts +21 -27
  157. package/dist/paid-calls.js +28 -62
  158. package/dist/pause.d.ts +0 -2
  159. package/dist/pause.js +1 -8
  160. package/dist/place.d.ts +0 -5
  161. package/dist/place.js +0 -10
  162. package/dist/print.d.ts +2 -1
  163. package/dist/print.js +4 -2
  164. package/dist/propose.js +83 -39
  165. package/dist/push-handler.d.ts +1 -1
  166. package/dist/reflect-range.d.ts +25 -0
  167. package/dist/reflect-range.js +30 -0
  168. package/dist/refusal-words.d.ts +5 -1
  169. package/dist/refusal-words.js +5 -1
  170. package/dist/rows.d.ts +1 -1
  171. package/dist/run-cut.d.ts +0 -6
  172. package/dist/run-cut.js +0 -6
  173. package/dist/run-db.d.ts +2 -13
  174. package/dist/run-db.js +2 -41
  175. package/dist/run-launch.d.ts +19 -2
  176. package/dist/run-launch.js +13 -5
  177. package/dist/run-learning-served.d.ts +46 -2
  178. package/dist/run-learning-served.js +26 -7
  179. package/dist/run-reads-over-store.d.ts +1 -1
  180. package/dist/run-reads-over-store.js +15 -6
  181. package/dist/run-secrets.d.ts +33 -0
  182. package/dist/run-secrets.js +53 -0
  183. package/dist/run-timeline-served.d.ts +5 -1
  184. package/dist/run-timeline-served.js +19 -5
  185. package/dist/run-view.d.ts +12 -17
  186. package/dist/run-view.js +29 -28
  187. package/dist/runnable.d.ts +18 -10
  188. package/dist/runnable.js +21 -10
  189. package/dist/runner/adapter-loop.d.ts +14 -3
  190. package/dist/runner/adapter-loop.js +464 -62
  191. package/dist/runner/adapter-run-spec.d.ts +29 -8
  192. package/dist/runner/adapter-run-spec.js +96 -37
  193. package/dist/runner/adapters/index.js +11 -1
  194. package/dist/runner/adapters/pi.d.ts +15 -1
  195. package/dist/runner/adapters/pi.js +19 -5
  196. package/dist/runner/beside.d.ts +30 -3
  197. package/dist/runner/beside.js +54 -12
  198. package/dist/runner/claim-secrets.d.ts +10 -1
  199. package/dist/runner/claim-secrets.js +49 -15
  200. package/dist/runner/cli-run-spec.d.ts +2 -0
  201. package/dist/runner/cli-run-spec.js +60 -17
  202. package/dist/runner/commands.js +1 -1
  203. package/dist/runner/computer-journal.d.ts +15 -2
  204. package/dist/runner/computer-journal.js +41 -5
  205. package/dist/runner/conformance/harness.js +118 -8
  206. package/dist/runner/conformance/subject.d.ts +4 -1
  207. package/dist/runner/dispatch.d.ts +8 -1
  208. package/dist/runner/dispatch.js +81 -7
  209. package/dist/runner/end-of-run.d.ts +8 -2
  210. package/dist/runner/end-of-run.js +10 -4
  211. package/dist/runner/github-app.js +1 -1
  212. package/dist/runner/harness-loops.d.ts +9 -1
  213. package/dist/runner/harness-loops.js +15 -2
  214. package/dist/runner/journal-kinds.d.ts +30 -6
  215. package/dist/runner/journal-kinds.js +20 -5
  216. package/dist/runner/journal-reader.d.ts +1 -1
  217. package/dist/runner/journal-reader.js +2 -2
  218. package/dist/runner/learning-ask.d.ts +4 -0
  219. package/dist/runner/learning-ask.js +15 -1
  220. package/dist/runner/learning-end.d.ts +18 -3
  221. package/dist/runner/learning-end.js +113 -11
  222. package/dist/runner/learning-loop.d.ts +5 -0
  223. package/dist/runner/learning-loop.js +26 -6
  224. package/dist/runner/live-ticker.d.ts +1 -1
  225. package/dist/runner/live-ticker.js +28 -4
  226. package/dist/runner/loop-contract.d.ts +3 -2
  227. package/dist/runner/main.d.ts +64 -10
  228. package/dist/runner/main.js +165 -27
  229. package/dist/runner/mcp-claim.d.ts +1 -1
  230. package/dist/runner/mcp-claim.js +2 -3
  231. package/dist/runner/mcp-run.d.ts +2 -0
  232. package/dist/runner/mcp-run.js +15 -5
  233. package/dist/runner/memory-claim.d.ts +9 -0
  234. package/dist/runner/memory-claim.js +25 -0
  235. package/dist/runner/metrics.d.ts +33 -1
  236. package/dist/runner/metrics.js +85 -1
  237. package/dist/runner/model-route.d.ts +13 -0
  238. package/dist/runner/model-route.js +154 -11
  239. package/dist/runner/redact.d.ts +8 -2
  240. package/dist/runner/redact.js +11 -2
  241. package/dist/runner/reflect-hook.d.ts +12 -1
  242. package/dist/runner/reflect-hook.js +33 -3
  243. package/dist/runner/runner.d.ts +20 -0
  244. package/dist/runner/runner.js +56 -10
  245. package/dist/runner/store-port.d.ts +1 -1
  246. package/dist/runner/store-secrets.d.ts +3 -3
  247. package/dist/runner/store-secrets.js +8 -12
  248. package/dist/runner/text-tools.d.ts +44 -0
  249. package/dist/runner/text-tools.js +237 -0
  250. package/dist/runner/workflow-loop.d.ts +6 -0
  251. package/dist/runner/workflow-loop.js +6 -4
  252. package/dist/runner/workflow-spec.d.ts +18 -0
  253. package/dist/runner/workflow-spec.js +68 -26
  254. package/dist/runs-over-store.d.ts +8 -3
  255. package/dist/runs-over-store.js +76 -19
  256. package/dist/seal-key.d.ts +54 -15
  257. package/dist/seal-key.js +232 -82
  258. package/dist/sealed-settings-store.d.ts +19 -4
  259. package/dist/sealed-settings-store.js +9 -9
  260. package/dist/sealing.d.ts +4 -0
  261. package/dist/sealing.js +20 -0
  262. package/dist/secret-cut.d.ts +1 -1
  263. package/dist/secret-cut.js +1 -1
  264. package/dist/secret-name.d.ts +9 -0
  265. package/dist/secret-name.js +15 -0
  266. package/dist/secret-writes.d.ts +0 -1
  267. package/dist/secret-writes.js +0 -1
  268. package/dist/secrets.d.ts +2 -10
  269. package/dist/secrets.js +21 -17
  270. package/dist/server-fs.d.ts +4 -0
  271. package/dist/server-fs.js +8 -2
  272. package/dist/server-lock.d.ts +0 -24
  273. package/dist/server-lock.js +1 -80
  274. package/dist/server-secrets-store.d.ts +4 -4
  275. package/dist/server-secrets-store.js +10 -32
  276. package/dist/server-secrets.d.ts +4 -9
  277. package/dist/server-secrets.js +12 -33
  278. package/dist/server.d.ts +26 -44
  279. package/dist/server.js +229 -142
  280. package/dist/sign-ins-store.d.ts +34 -36
  281. package/dist/sign-ins-store.js +27 -38
  282. package/dist/sign-ins.d.ts +2 -119
  283. package/dist/sign-ins.js +5 -311
  284. package/dist/standard-webhooks.d.ts +1 -1
  285. package/dist/standard-webhooks.js +1 -1
  286. package/dist/stats.d.ts +3 -2
  287. package/dist/stats.js +1 -1
  288. package/dist/store/agent-body.d.ts +8 -2
  289. package/dist/store/agent-body.js +16 -4
  290. package/dist/store/index.d.ts +3 -3
  291. package/dist/store/index.js +3 -3
  292. package/dist/store/open.d.ts +18 -5
  293. package/dist/store/open.js +23 -3
  294. package/dist/store/postgres/connection.d.ts +18 -2
  295. package/dist/store/postgres/connection.js +156 -32
  296. package/dist/store/postgres/migrate.d.ts +4 -0
  297. package/dist/store/postgres/migrate.js +27 -3
  298. package/dist/store/postgres/migrations/0003_commands_one_answer.check.sql +19 -0
  299. package/dist/store/postgres/migrations/0003_commands_one_answer.sql +13 -0
  300. package/dist/store/postgres/store.d.ts +9 -2
  301. package/dist/store/postgres/store.js +9 -0
  302. package/dist/store/schema.js +1 -1
  303. package/dist/store/seal.js +2 -2
  304. package/dist/store/sqlite/connection.js +49 -5
  305. package/dist/store/sqlite/run-patch.d.ts +3 -0
  306. package/dist/store/sqlite/run-patch.js +3 -0
  307. package/dist/store/sqlite/store.js +64 -20
  308. package/dist/store/store.d.ts +38 -6
  309. package/dist/store/store.js +12 -2
  310. package/dist/store-reads/cap.d.ts +1 -1
  311. package/dist/store-reads/cap.js +22 -4
  312. package/dist/store-reads/journal.d.ts +25 -6
  313. package/dist/store-reads/journal.js +173 -21
  314. package/dist/store-reads/learning.d.ts +26 -8
  315. package/dist/store-reads/learning.js +12 -4
  316. package/dist/store-reads/workflow.d.ts +1 -1
  317. package/dist/store-reads/workflow.js +1 -1
  318. package/dist/store-view.d.ts +5 -1
  319. package/dist/store-view.js +91 -23
  320. package/dist/template-eval.d.ts +60 -4
  321. package/dist/template-eval.js +120 -54
  322. package/dist/templates.d.ts +24 -10
  323. package/dist/templates.js +69 -38
  324. package/dist/timeline/group.d.ts +33 -0
  325. package/dist/timeline/group.js +77 -0
  326. package/dist/timeline/index.d.ts +7 -0
  327. package/dist/timeline/index.js +7 -0
  328. package/dist/timeline/labels.d.ts +79 -0
  329. package/dist/timeline/labels.js +150 -0
  330. package/dist/timeline/origin.d.ts +56 -0
  331. package/dist/timeline/origin.js +92 -0
  332. package/dist/timeline/render-text.d.ts +11 -0
  333. package/dist/timeline/render-text.js +62 -0
  334. package/dist/timeline/timeline.d.ts +274 -0
  335. package/dist/timeline/timeline.js +1308 -0
  336. package/dist/timeline/util.d.ts +17 -0
  337. package/dist/timeline/util.js +49 -0
  338. package/dist/tool-gate.d.ts +41 -216
  339. package/dist/tool-gate.js +79 -540
  340. package/dist/tool-keys-store.d.ts +11 -12
  341. package/dist/tool-keys-store.js +24 -31
  342. package/dist/tool-keys.d.ts +9 -104
  343. package/dist/tool-keys.js +15 -271
  344. package/dist/tool-plane.d.ts +14 -42
  345. package/dist/tool-plane.js +23 -81
  346. package/dist/tool-settings-store.d.ts +1 -2
  347. package/dist/tool-settings-store.js +5 -8
  348. package/dist/tools.d.ts +31 -19
  349. package/dist/tools.js +101 -108
  350. package/dist/trigger-adapter.d.ts +2 -2
  351. package/dist/trigger-schedule.js +2 -1
  352. package/dist/trigger-secrets-shown.js +5 -1
  353. package/dist/trigger-targets.d.ts +13 -1
  354. package/dist/trigger-targets.js +31 -1
  355. package/dist/triggers.d.ts +2 -2
  356. package/dist/triggers.js +3 -3
  357. package/dist/turn-end.d.ts +1 -1
  358. package/dist/turn-end.js +1 -1
  359. package/dist/turns.d.ts +0 -6
  360. package/dist/turns.js +0 -19
  361. package/dist/uploads.js +1 -1
  362. package/dist/usage.d.ts +0 -2
  363. package/dist/usage.js +0 -2
  364. package/dist/validate.d.ts +2 -0
  365. package/dist/validate.js +23 -14
  366. package/dist/webhooks.d.ts +102 -76
  367. package/dist/webhooks.js +266 -233
  368. package/dist/workflow-run.d.ts +114 -0
  369. package/dist/workflow-run.js +144 -0
  370. package/dist/workspace/beneath.d.ts +19 -0
  371. package/dist/workspace/beneath.js +106 -0
  372. package/dist/workspace/computer-deps.d.ts +52 -5
  373. package/dist/workspace/computer-deps.js +154 -19
  374. package/dist/workspace/computer-for-claim.d.ts +19 -14
  375. package/dist/workspace/computer-for-claim.js +77 -16
  376. package/dist/workspace/computer-hold.d.ts +6 -1
  377. package/dist/workspace/computer-hold.js +6 -1
  378. package/dist/workspace/computer-janitor.d.ts +47 -0
  379. package/dist/workspace/computer-janitor.js +182 -0
  380. package/dist/workspace/computer-providers.d.ts +6 -2
  381. package/dist/workspace/computer-providers.js +1 -1
  382. package/dist/workspace/grep-worker.d.ts +5 -0
  383. package/dist/workspace/grep-worker.js +9 -6
  384. package/dist/workspace/index.d.ts +4 -3
  385. package/dist/workspace/index.js +4 -4
  386. package/dist/workspace/local.d.ts +11 -2
  387. package/dist/workspace/local.js +161 -43
  388. package/dist/workspace/resolve-computer.d.ts +50 -10
  389. package/dist/workspace/resolve-computer.js +46 -11
  390. package/dist/workspace/run-tools.d.ts +13 -31
  391. package/dist/workspace/run-tools.js +10 -27
  392. package/dist/workspace-paths.d.ts +0 -17
  393. package/dist/workspace-paths.js +1 -41
  394. package/dist/workspace.d.ts +0 -17
  395. package/dist/workspace.js +3 -99
  396. package/launcher/agentrun-serve +6 -33
  397. package/package.json +14 -14
  398. package/templates/README.md +9 -3
  399. package/templates/inbound-lead/agent.md +1 -1
  400. package/templates/kyb/agent.md +1 -1
  401. package/templates/market-monitor/agent.md +2 -2
  402. package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
  403. package/dist/app.d.ts +0 -5
  404. package/dist/app.js +0 -514
  405. package/dist/bound-files.d.ts +0 -4
  406. package/dist/bound-files.js +0 -164
  407. package/dist/bounds.d.ts +0 -26
  408. package/dist/bounds.js +0 -137
  409. package/dist/coding-tools.d.ts +0 -47
  410. package/dist/coding-tools.js +0 -189
  411. package/dist/computer-adb.d.ts +0 -12
  412. package/dist/computer-adb.js +0 -14
  413. package/dist/console/assets/index-35-7aeIZ.js +0 -519
  414. package/dist/console/assets/index-Cejbov-Y.css +0 -1
  415. package/dist/content-filter.d.ts +0 -7
  416. package/dist/content-filter.js +0 -23
  417. package/dist/disk.d.ts +0 -33
  418. package/dist/disk.js +0 -85
  419. package/dist/door-line.d.ts +0 -23
  420. package/dist/door-line.js +0 -83
  421. package/dist/grade.d.ts +0 -63
  422. package/dist/grade.js +0 -150
  423. package/dist/harness-app.d.ts +0 -69
  424. package/dist/harness-app.js +0 -1162
  425. package/dist/mcp-servers.d.ts +0 -269
  426. package/dist/mcp-servers.js +0 -456
  427. package/dist/packs.d.ts +0 -71
  428. package/dist/packs.js +0 -180
  429. package/dist/request-start.d.ts +0 -27
  430. package/dist/request-start.js +0 -381
  431. package/dist/run-box.d.ts +0 -205
  432. package/dist/run-box.js +0 -661
  433. package/dist/run-holder.d.ts +0 -52
  434. package/dist/run-holder.js +0 -139
  435. package/dist/runs.d.ts +0 -1200
  436. package/dist/runs.js +0 -4103
  437. package/dist/sealed-settings.d.ts +0 -60
  438. package/dist/sealed-settings.js +0 -178
  439. package/dist/served-only.d.ts +0 -5
  440. package/dist/served-only.js +0 -12
  441. package/dist/sessions.d.ts +0 -6
  442. package/dist/sessions.js +0 -109
  443. package/dist/workspace/computer-serves.d.ts +0 -12
  444. package/dist/workspace/computer-serves.js +0 -15
@@ -12,7 +12,7 @@ type ToolKeysStore = {
12
12
  /** What the start's log line says to a person when saved keys do not open, by why: where they are kept is the server's
13
13
  * store (`kept=store`), and what to do is to save them again in the console's Settings. */
14
14
  export declare const REENTER_SAID: Readonly<Record<(typeof UNREADABLE)[number], string>>;
15
- /** The store-backed ToolKeys. `toolKeysOverStore` builds it; the switch awaits load() once before the first read. */
15
+ /** The saved tool keys over the store. `toolKeysOverStore` builds it; the server awaits load() once before the first read. */
16
16
  declare class ToolKeysOverStore {
17
17
  private readonly store;
18
18
  private readonly env;
@@ -30,15 +30,15 @@ declare class ToolKeysOverStore {
30
30
  /** The checks and fingerprints the settings row holds, failing closed (an unreadable row reads as none, so no value is
31
31
  * lost and each field is just asked to be checked again). */
32
32
  private readChecks;
33
- /** Opens a field's sealed bytes now, or why not: no seal key (seal_key_missing); a fingerprint that no longer matches
34
- * (seal_key_changed); else unseal, which fails as file_unreadable. */
33
+ /** Opens a field's sealed bytes now, or why not: a fingerprint that no longer matches (seal_key_changed); else unseal,
34
+ * which fails as file_unreadable. */
35
35
  private openAt;
36
36
  /** The stored value of the field `name`, opened; undefined with none, or one that does not open: never a clear fallback. */
37
37
  value(name: string): string | undefined;
38
38
  /** Every stored value that opens, by field name. */
39
39
  values(): Record<string, string>;
40
40
  /** GET: each key's fields, whether set and where from (never a value), what it unlocks, its check, and what to enter
41
- * again, with why. The ToolKeys.view shape, over the snapshot. */
41
+ * again, with why. Over the snapshot. */
42
42
  view(offers?: Parameters<typeof rowUnlocks>[3]): {
43
43
  keys: {
44
44
  fields: ({
@@ -75,17 +75,17 @@ declare class ToolKeysOverStore {
75
75
  label: string;
76
76
  }[];
77
77
  reenter: {
78
- reason: "seal_key_missing" | "seal_key_changed" | "file_unreadable";
78
+ reason: "seal_key_changed" | "file_unreadable";
79
79
  fields: string[];
80
80
  } | null;
81
81
  };
82
82
  /** Each tool key the server is started with, checked against its provider once (key-check.ts), all at once; `answered`
83
- * as each answers unless `stop` came first. Held in memory for this start, like ToolKeys.checkServer. */
83
+ * as each answers unless `stop` came first. Held in memory for this start. */
84
84
  checkServer(fetchFor: (id: string) => Promise<typeof fetch | null>, stop: AbortSignal, answered: () => void): Promise<void>;
85
85
  /** The variables of the keys the server was started with that their provider refused at the start, each with why. */
86
86
  refused(): Record<string, string>;
87
87
  /** A PUT's check, before save(): the key it sends checked against its provider, or 422 when the provider refuses it;
88
- * undefined when the body sends no key. The ToolKeys.check shape. */
88
+ * undefined when the body sends no key. */
89
89
  check(id: string, body: Record<string, unknown>, fetchFor: (id: string) => Promise<typeof fetch | undefined>, stop?: AbortSignal): Promise<KeyCheck | undefined>;
90
90
  /** PUT: each of `body.values` sealed under the seal key in its own row, the check kept for the key when given; the key's
91
91
  * other fields stay as they are. Durable before it resolves (as writeDurableSync was), so a 204 never outruns the disk. */
@@ -94,17 +94,16 @@ declare class ToolKeysOverStore {
94
94
  remove(id: string): Promise<void>;
95
95
  /** The checks and fingerprints written back as one settings row. */
96
96
  private writeChecks;
97
- /** What a PUT may save: the key's row and the body's values, or 422 (the body), 409 (a field the server's, or no seal
98
- * key). No message holds a value. The ToolKeys.admit, byte for byte. */
97
+ /** What a PUT may save: the key's row and the body's values, or 422 (the body), 409 (a field the server's). No message
98
+ * holds a value. */
99
99
  private admit;
100
100
  private row;
101
101
  /** 409 when this server's own environment sets one of `names`: that one wins, and is changed where the server starts. */
102
102
  private notServers;
103
103
  }
104
104
  export type { ToolKeysOverStore };
105
- /** The ToolKeys surface over the one store: the switch swaps `new ToolKeys(data, env, say)` for this, then awaits load()
106
- * once at start before the first read. `env` is what the server is started with (its own keys; never a saved one), as
107
- * ToolKeys takes it. */
105
+ /** The saved tool keys over the one store, awaited load() once at start before the first read. `env` is what the server is
106
+ * started with (its own keys, and its seal key; never a saved one). */
108
107
  export declare function toolKeysOverStore(store: ToolKeysStore, env: NodeJS.ProcessEnv, say: (fields: Record<string, string>) => void): ToolKeysOverStore;
109
108
  /** The bytes a value would be sealed as, for a test that checks a field is sealed at rest, not in the clear. */
110
109
  export declare const sealedToolKeyBytes: (key: Buffer, name: string, value: string) => Uint8Array;
@@ -1,15 +1,12 @@
1
- // The keys a person saves for this server's tools, over the one store (A), the store-backed replacement for tool-keys.ts's
2
- // tool-keys.json field store. Each field's value is a sealed row in store.sealedKeys (server-keys.ts, AAD
1
+ // The keys a person saves for this server's tools, over the one store. Each field's value is a sealed row in store.sealedKeys (server-keys.ts, AAD
3
2
  // sealed_keys|<name>|sealed); the store holds ciphertext alone and never opens it. The per-key provider checks and the
4
3
  // seal-key fingerprints that tell "sealed under another key" from "damaged" live in one store.settings row (no secret: a
5
4
  // check is state and a time, a fingerprint is an HMAC of a fixed label, neither the key nor a hash of it). Only this
6
- // process opens a value, with the seal key the launcher hands it (AGENTRUN_SEAL_KEY), never in the data directory.
5
+ // process opens a value, with the server's seal key (seal-key.ts bootSealKey: the server never starts without one).
7
6
  //
8
- // The surface is ToolKeys' (tool-keys.ts), byte for byte, so the switch swaps `new ToolKeys(data, env, say)` for
9
- // `toolKeysOverStore(store, env, say)` without touching a route: value/values/view/refused/checkServer/check are the same
10
- // shapes, and save/remove return a promise the handler awaits (durable before the 204, as writeDurableSync was). The reads
11
- // are served from an in-memory snapshot the server (the one writer of these rows) loads once at start (load()) and keeps in
12
- // step with every write, so a read answers without a round trip, exactly as ToolKeys read its file.
7
+ // save/remove return a promise the handler awaits (durable before the 204). The reads are served from an in-memory
8
+ // snapshot the server (the one writer of these rows) loads once at start (load()) and keeps in step with every write, so a
9
+ // read answers without a round trip.
13
10
  import { createHmac } from "node:crypto";
14
11
  import { decisionsOf } from "./decisions.js";
15
12
  import { ApiError, invalid } from "./errors.js";
@@ -23,11 +20,11 @@ import { isObject, unknownFields } from "./validate.js";
23
20
  export const TOOL_KEY_CHECKS_KEY = "tool-key-checks";
24
21
  const MAX_VALUE_BYTES = 1024;
25
22
  const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
26
- /** Every field a person may save (the fields of every key row), the same set ToolKeys keeps. */
23
+ /** Every field a person may save (the fields of every key row). */
27
24
  const FIELDS = TOOL_KEYS.flatMap((row) => row.fields);
28
- /** The check a key kept before this server checked keys reads as: none was made. Mirrors ToolKeys' UNCHECKED. */
25
+ /** The check a key kept before this server checked keys reads as: none was made. */
29
26
  const UNCHECKED = { state: "not_checked", reason: "Saved before this server checked keys; save it again to check it" };
30
- /** A check as the store row keeps it, else undefined (mirrors ToolKeys' keptCheck). */
27
+ /** A check as the store row keeps it, else undefined. */
31
28
  const keptCheck = (entry) => !isObject(entry) ? undefined
32
29
  : entry.state === "accepted" && typeof entry.at === "string" ? { state: "accepted", at: entry.at }
33
30
  : entry.state === "not_checked" && typeof entry.reason === "string" ? { state: "not_checked", reason: entry.reason, ...(typeof entry.at === "string" ? { at: entry.at } : {}) }
@@ -39,10 +36,9 @@ const fingerprint = (key) => createHmac("sha256", key).update("agentrun-serve se
39
36
  * store (`kept=store`), and what to do is to save them again in the console's Settings. */
40
37
  export const REENTER_SAID = {
41
38
  seal_key_changed: "these saved keys were sealed under another seal key, so they do not open: save them again in Settings → Tool keys",
42
- seal_key_missing: "no seal key opens these saved keys: start the server with its seal key, or save them again in Settings → Tool keys",
43
39
  file_unreadable: "these saved keys do not read: save them again in Settings → Tool keys",
44
40
  };
45
- /** The store-backed ToolKeys. `toolKeysOverStore` builds it; the switch awaits load() once before the first read. */
41
+ /** The saved tool keys over the store. `toolKeysOverStore` builds it; the server awaits load() once before the first read. */
46
42
  class ToolKeysOverStore {
47
43
  store;
48
44
  env;
@@ -57,10 +53,12 @@ class ToolKeysOverStore {
57
53
  this.store = store;
58
54
  this.env = env;
59
55
  this.say = say;
60
- this.key = sealKeyOf(env[SEAL_KEY_ENV]);
61
- this.sealCheck = this.key && fingerprint(this.key);
62
- if (env[SEAL_KEY_ENV] !== undefined && !this.key)
63
- say({ condition: "seal_key_invalid", name: SEAL_KEY_ENV });
56
+ // There is always a seal key (seal-key.ts bootSealKey): no tool key is ever kept, or read, without one.
57
+ const key = sealKeyOf(env[SEAL_KEY_ENV]);
58
+ if (!key)
59
+ throw new Error(`tool keys are kept under the server's seal key (${SEAL_KEY_ENV}), and none was handed over: the server does not start without one`);
60
+ this.key = key;
61
+ this.sealCheck = fingerprint(key);
64
62
  }
65
63
  /** Reads the store once into the snapshot: each sealed field opened now, the checks and the fingerprints beside them.
66
64
  * Awaited once at start, before the first read. */
@@ -95,11 +93,9 @@ class ToolKeysOverStore {
95
93
  }
96
94
  return { checks, seals };
97
95
  }
98
- /** Opens a field's sealed bytes now, or why not: no seal key (seal_key_missing); a fingerprint that no longer matches
99
- * (seal_key_changed); else unseal, which fails as file_unreadable. */
96
+ /** Opens a field's sealed bytes now, or why not: a fingerprint that no longer matches (seal_key_changed); else unseal,
97
+ * which fails as file_unreadable. */
100
98
  openAt(name, sealed, fp) {
101
- if (!this.key)
102
- return { unreadable: "seal_key_missing" };
103
99
  if (fp !== undefined && fp !== this.sealCheck)
104
100
  return { unreadable: "seal_key_changed" };
105
101
  try {
@@ -124,7 +120,7 @@ class ToolKeysOverStore {
124
120
  }));
125
121
  }
126
122
  /** GET: each key's fields, whether set and where from (never a value), what it unlocks, its check, and what to enter
127
- * again, with why. The ToolKeys.view shape, over the snapshot. */
123
+ * again, with why. Over the snapshot. */
128
124
  view(offers = []) {
129
125
  const again = [];
130
126
  const tools = toolsView(this.env);
@@ -156,7 +152,7 @@ class ToolKeysOverStore {
156
152
  return { keys, reenter };
157
153
  }
158
154
  /** Each tool key the server is started with, checked against its provider once (key-check.ts), all at once; `answered`
159
- * as each answers unless `stop` came first. Held in memory for this start, like ToolKeys.checkServer. */
155
+ * as each answers unless `stop` came first. Held in memory for this start. */
160
156
  async checkServer(fetchFor, stop, answered) {
161
157
  await Promise.all(TOOL_KEYS.filter((row) => row.kind === "tool" && this.env[row.fields[0]]).map(async (row) => {
162
158
  const name = row.fields[0];
@@ -189,7 +185,7 @@ class ToolKeysOverStore {
189
185
  }));
190
186
  }
191
187
  /** A PUT's check, before save(): the key it sends checked against its provider, or 422 when the provider refuses it;
192
- * undefined when the body sends no key. The ToolKeys.check shape. */
188
+ * undefined when the body sends no key. */
193
189
  async check(id, body, fetchFor, stop) {
194
190
  const { row, values } = this.admit(id, body);
195
191
  const name = row.fields[0];
@@ -242,8 +238,8 @@ class ToolKeysOverStore {
242
238
  async writeChecks() {
243
239
  await this.store.settings.put(TOOL_KEY_CHECKS_KEY, { v: 1, checks: Object.fromEntries(this.snapshot.checks), seals: Object.fromEntries(this.snapshot.seals) });
244
240
  }
245
- /** What a PUT may save: the key's row and the body's values, or 422 (the body), 409 (a field the server's, or no seal
246
- * key). No message holds a value. The ToolKeys.admit, byte for byte. */
241
+ /** What a PUT may save: the key's row and the body's values, or 422 (the body), 409 (a field the server's). No message
242
+ * holds a value. */
247
243
  admit(id, body) {
248
244
  const row = this.row(id);
249
245
  const issues = unknownFields(body, ["values"]);
@@ -264,8 +260,6 @@ class ToolKeysOverStore {
264
260
  if (issues.length)
265
261
  throw invalid(issues);
266
262
  this.notServers(Object.keys(values));
267
- if (!this.key)
268
- throw new ApiError("no_sealing_key", `This server was handed no seal key (${SEAL_KEY_ENV}), so it keeps no tool key: it never keeps one in the clear.`);
269
263
  return { row, values };
270
264
  }
271
265
  row(id) {
@@ -281,9 +275,8 @@ class ToolKeysOverStore {
281
275
  throw new ApiError("key_set_by_server", `This server is started with ${held.join(" and ")}: change it where the server is started.`, { details: { fields: held } });
282
276
  }
283
277
  }
284
- /** The ToolKeys surface over the one store: the switch swaps `new ToolKeys(data, env, say)` for this, then awaits load()
285
- * once at start before the first read. `env` is what the server is started with (its own keys; never a saved one), as
286
- * ToolKeys takes it. */
278
+ /** The saved tool keys over the one store, awaited load() once at start before the first read. `env` is what the server is
279
+ * started with (its own keys, and its seal key; never a saved one). */
287
280
  export function toolKeysOverStore(store, env, say) {
288
281
  return new ToolKeysOverStore(store, env, say);
289
282
  }
@@ -1,6 +1,5 @@
1
- import { type KeyCheck } from "./key-check.js";
1
+ import type { KeyCheck } from "./key-check.js";
2
2
  import { type SecretMeta } from "./secret-writes.js";
3
- export declare const TOOL_KEYS_FILE = "tool-keys.json";
4
3
  export declare const SEAL_KEY_ENV = "AGENTRUN_SEAL_KEY";
5
4
  /** Each key a person may save, fixed here: its kind, the fields it is entered as (BROWSERBASE_PROJECT_ID is no secret,
6
5
  * and is kept the same way), and what it may unlock: tools by name, and `decisions.<id>`, a workflow's decision
@@ -63,9 +62,10 @@ export declare function unlockedBy(candidates: readonly string[], tools: readonl
63
62
  };
64
63
  /** What a row unlocks here: a `tool` row's, its tools and providers as capabilities bind them (unlockedBy); any other
65
64
  * kind's (a model's), no tool, on those that run on it (its `harnesses`, when it names them) that this server runs
66
- * (`offers`, harness.ts' harnessOffers) or would once its key is set: one unavailable only for want of a model key
67
- * among whose `keys` is the row's (its first field). So OpenRouter's row names all three before any key is saved; a
68
- * harness not installed, off its pins or too big for this host is left out. */
65
+ * (`offers`, harness.ts' harnessOffers) on the row's key: one whose `keys` (the model keys that run it here, available
66
+ * now or once one is saved) include the row's (its first field). So OpenRouter's row names all three before any key
67
+ * is saved, and no row changes when another provider's key is saved; a harness not installed, off its pins or too big
68
+ * for this host is left out. */
69
69
  export declare function rowUnlocks(row: {
70
70
  kind: string;
71
71
  unlocks: readonly string[];
@@ -81,10 +81,10 @@ export declare function rowUnlocks(row: {
81
81
  };
82
82
  /** The key that unlocks the tool `name` (capabilities' `tools[].key`, so a page links "needs the X key" to it), if any. */
83
83
  export declare const keyOf: (name: string) => string | undefined;
84
- /** Why a stored value does not open, in the order a re-entry names one: no seal key now, another than it was sealed
85
- * under, or the file (or its entry) damaged. */
86
- export declare const UNREADABLE: readonly ["seal_key_missing", "seal_key_changed", "file_unreadable"];
87
- /** The check of a key the server was started with (ToolKeys.checkServer): a KeyCheck, or refused by its provider, why in
84
+ /** Why a stored value does not open, in the order a re-entry names one: sealed under another key than the server's, or
85
+ * its row damaged. */
86
+ export declare const UNREADABLE: readonly ["seal_key_changed", "file_unreadable"];
87
+ /** The check of a key the server was started with (tool-keys-store.ts checkServer): a KeyCheck, or refused by its provider, why in
88
88
  * plain words. Held in memory only, for this start. */
89
89
  export type StartCheck = KeyCheck | {
90
90
  state: "refused";
@@ -104,98 +104,3 @@ export declare function rowSecrets(row: {
104
104
  }[], changedAt: (name: string) => string | null): SecretMeta[];
105
105
  /** The seal key `text` gives: 32 bytes in base64 (or base64url), else none. */
106
106
  export declare function sealKeyOf(text: string | undefined): Buffer | undefined;
107
- export declare class ToolKeys {
108
- private readonly env;
109
- private readonly say;
110
- readonly file: string;
111
- private readonly key;
112
- private readonly sealCheck;
113
- private said;
114
- /** The checks of the keys the server was started with, by key id, each once it answered (checkServer). */
115
- private readonly started;
116
- /** `env` is what the server is started with (withSecrets' `"own"`, never a saved key, or each would read as the
117
- * server's and could not be deleted): a field it sets is the server's, and wins. `say` takes a log line's fields. */
118
- constructor(data: string, env: NodeJS.ProcessEnv, say: (fields: Record<string, string>) => void);
119
- /** The file's entries, none with no file; "unreadable" when it does not read as this format. A file from before checks
120
- * has none. */
121
- private kept;
122
- private open;
123
- /** The stored value of the field `name`, opened now (secrets.ts reads a saved key by name through this); undefined
124
- * with none, or one that does not open, which view() asks for again: never a clear fallback. */
125
- value(name: string): string | undefined;
126
- /** Every stored value that opens, by field name. */
127
- values(): Record<string, string>;
128
- /** GET: each key's fields, whether set and where from (never a value), what it unlocks of what capabilities shows
129
- * here (a model key: the harnesses `offers` says this server runs or would on the key), its check when its key (its first field) is
130
- * stored here (null otherwise: the server's own is not checked here), and what to enter again, with why. */
131
- view(offers?: Parameters<typeof rowUnlocks>[3]): {
132
- keys: {
133
- fields: ({
134
- name: string;
135
- set: boolean;
136
- source: "server";
137
- } | {
138
- name: string;
139
- set: boolean;
140
- source: "stored";
141
- } | {
142
- stored_unreadable?: true | undefined;
143
- name: string;
144
- set: boolean;
145
- source: null;
146
- })[];
147
- secrets: SecretMeta[];
148
- check: {
149
- state: "accepted";
150
- at: string;
151
- } | {
152
- state: "not_checked";
153
- reason: string;
154
- at?: string;
155
- } | {
156
- state: "refused";
157
- reason: string;
158
- at: string;
159
- } | null;
160
- unlocks: string[];
161
- harnesses: ("opencode" | "codex" | "pi" | "claude-agent")[];
162
- id: string;
163
- kind: "model" | "tool";
164
- label: string;
165
- }[];
166
- reenter: {
167
- reason: "seal_key_missing" | "seal_key_changed" | "file_unreadable";
168
- fields: string[];
169
- } | null;
170
- };
171
- /** Each tool key the server is started with (a `tool` row whose key, its first field, the server sets), checked against
172
- * its provider once, as a saved one is (key-check.ts), through the fetch `fetchFor` gives for the row (null: not
173
- * checked, its check stays null); all at once, none holding up another or the start. `answered` is called as each
174
- * answers, unless `stop` (the server closing) came first. A fetch that cannot be made (a fake that does not load)
175
- * reads as not checked, saying so; this never rejects. A model key is not checked here: a run on a refused one fails
176
- * at its first request, saying so. */
177
- checkServer(fetchFor: (id: string) => Promise<typeof fetch | null>, stop: AbortSignal, answered: () => void): Promise<void>;
178
- /** The variables of the keys the server was started with that their provider refused at the start, each with why
179
- * (capabilities' tools that need one read unavailable: tools.ts toolsView). */
180
- refused(): Record<string, string>;
181
- /** A PUT's check, before save(): the key it sends (its row's first field; Browserbase's project id is no key) checked
182
- * against its provider (key-check.ts), the fetch `fetchFor` gives for the row (undefined: none, so not checked), its
183
- * wait cut by `stop`. The body is held to what save() takes first, so a save that would be refused sends nothing. A
184
- * key the provider refuses is 422 in its words, and nothing is kept; undefined when the body sends no key: the row's
185
- * check stays as it was. */
186
- check(id: string, body: Record<string, unknown>, fetchFor: (id: string) => Promise<typeof fetch | undefined>, stop?: AbortSignal): Promise<KeyCheck | undefined>;
187
- /** PUT: each of `body.values` sealed under the seal key, and `check` (check()'s) kept for the key when given; the key's
188
- * other fields stay as they are. A key saved with no check (a caller other than the route) drops the one it had. */
189
- save(id: string, body: Record<string, unknown>, check?: KeyCheck): void;
190
- /** What a PUT may save: the key's row and the body's values, or 422 (the body), 409 (a field the server's, or no seal
191
- * key). No message holds a value, or any part of one. */
192
- private admit;
193
- /** DELETE: the key's stored fields gone, and its check. Refused only when the server sets every field of it: none is
194
- * the page's. */
195
- remove(id: string): void;
196
- private row;
197
- /** 409 when this server's own environment (its launcher) sets one of `names`: that one wins, and is changed where the
198
- * server is started. */
199
- private notServers;
200
- private write;
201
- }