@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
@@ -16,6 +16,10 @@ export declare const defaultData: (env?: NodeJS.ProcessEnv) => string;
16
16
  * npxLine). */
17
17
  export declare const DATA_ENV = "AGENTRUN_SERVE_DATA";
18
18
  /** Agent `agentId`'s folder on the disk, which holds its learning folder (learning.ts) and its runs: `<data>/disk/agents/<agent>`. */
19
+ /** The folder of a data directory that holds each agent's disk: its runs and its learning. */
20
+ export declare const DISK_DIR = "disk";
21
+ /** Agent `agentId`'s folder on the disk of data directory `data`: `<data>/disk/agents/<name>`. */
22
+ export declare const agentDiskDir: (data: string, agentId: string) => string;
19
23
  export declare const agentFolderOf: (data: string, agentId: string) => string;
20
24
  /** The file parsed as JSON, or null when it is missing, unreadable, or not whole JSON (a half-written file). */
21
25
  export declare const readJson: (path: string) => Promise<Json | null>;
package/dist/server-fs.js CHANGED
@@ -3,12 +3,11 @@
3
3
  // runner cutover deletes) can go on their own. Nothing here knows a run: it is whole-file writes made durable, a directory
4
4
  // sync, a JSON read that fails to null, a per-key work queue, the data-directory location and the names of the two files
5
5
  // the owner's CLI reads (the API token and the server record).
6
- import { randomBytes } from "node:crypto";
6
+ import { createHash, randomBytes } from "node:crypto";
7
7
  import { closeSync, constants, fsyncSync, openSync, readFileSync, renameSync, unlinkSync, writeSync } from "node:fs";
8
8
  import { open, readFile, rename, unlink, writeFile } from "node:fs/promises";
9
9
  import { homedir } from "node:os";
10
10
  import { dirname, join } from "node:path";
11
- import { agentDiskDir } from "@parcha/pi-durable-agent";
12
11
  /** The server's API token (`ar_local_...`), in the data directory, made at its first start when it is given none. */
13
12
  export const TOKEN_FILE = ".token";
14
13
  /** Where a running server is, for the launcher's CLI (`npx @parcha/agentrun agents list`), in the data directory: its
@@ -33,6 +32,13 @@ export const defaultData = (env = process.env) => join(env.XDG_DATA_HOME || join
33
32
  * npxLine). */
34
33
  export const DATA_ENV = "AGENTRUN_SERVE_DATA";
35
34
  /** Agent `agentId`'s folder on the disk, which holds its learning folder (learning.ts) and its runs: `<data>/disk/agents/<agent>`. */
35
+ /** The folder of a data directory that holds each agent's disk: its runs and its learning. */
36
+ export const DISK_DIR = "disk";
37
+ /** An agent's folder's name on the disk: its id in lower case, then 16 hex digits of the id's SHA-256, so ids that differ
38
+ * only in case never share one on a disk that folds case. */
39
+ const agentDirName = (agentId) => `${agentId.toLowerCase()}-${createHash("sha256").update(agentId, "utf8").digest("hex").slice(0, 16)}`;
40
+ /** Agent `agentId`'s folder on the disk of data directory `data`: `<data>/disk/agents/<name>`. */
41
+ export const agentDiskDir = (data, agentId) => join(data, DISK_DIR, "agents", agentDirName(agentId));
36
42
  export const agentFolderOf = (data, agentId) => agentDiskDir(data, agentId);
37
43
  /** The file parsed as JSON, or null when it is missing, unreadable, or not whole JSON (a half-written file). */
38
44
  export const readJson = (path) => readFile(path, "utf8")
@@ -1,6 +1,4 @@
1
1
  export declare const SERVER_LOCK = "server.lock";
2
- /** The data root's server, as it last said: `{ pid, until }`, `until` (epoch ms) when it stops, null while it runs. */
3
- export declare const SERVER_STATE = "server.state";
4
2
  /** Another server holds the data root. Its message is the one line the CLI prints before it exits 1. */
5
3
  export declare class ServerLockHeldError extends Error {
6
4
  readonly code = "SERVER_LOCK_HELD";
@@ -20,25 +18,3 @@ export interface ServerLock {
20
18
  export declare function takeServerLock(dataRoot: string, options?: {
21
19
  chmod?: (file: string, mode: number) => void;
22
20
  }): ServerLock;
23
- /** A server that is stopping, by its mark: its process, and when its stop is over at the latest (epoch ms). */
24
- export type Stopping = {
25
- pid: number;
26
- until: number;
27
- };
28
- /** Records the data root's server as this process, running: once, as it starts, right after it takes the lock. */
29
- export declare function markRunning(dataRoot: string): void;
30
- /** Records the data root's server as stopping until `until`, as its close begins: the same file, rewritten in place in one
31
- * write of the same length, never made again (a record that is gone is left gone), so the stop adds no entry. */
32
- export declare function markStopping(dataRoot: string, until: number): void;
33
- /** The data root's server, when its record says it is stopping, its process lives and its time is still ahead; none
34
- * otherwise (no record, one that can't be read, a server that runs, or one that died as it stopped). */
35
- export declare function stoppingOf(dataRoot: string, now?: number): Stopping | undefined;
36
- /** Takes the data root's server lock, as takeServerLock. When another server holds it and is stopping (its record),
37
- * waits for that server as long as its process lives, under one cap, its record's `until` (the server's whole close:
38
- * its runs' drain, their carry backs and their boxes' cleanup), retrying every `everyMs`, and tells `waiting` once as it
39
- * starts to. A server that is not stopping is refused at once with ServerLockHeldError, as is one that still holds the
40
- * lock at its `until`, or a holder that is not the stopping server (its process gone, the lock still held). */
41
- export declare function takeServerLockAfterStop(dataRoot: string, options?: {
42
- waiting?: (stopping: Stopping) => void;
43
- everyMs?: number;
44
- }): Promise<ServerLock>;
@@ -9,24 +9,11 @@
9
9
  //
10
10
  // pi-durable-disk forgets a command record written in another pid namespace only under the precondition this lock
11
11
  // keeps: two servers never hold one data root at once.
12
- //
13
- // A server that stops keeps the lock until its runs' processes have drained and exited, which takes up to their drain
14
- // and a second. It says so in <data>/server.state: written once as the server starts, right after it takes the lock
15
- // (its pid, not stopping), and rewritten in place as its close begins (when its stop is over at the latest). A stop never
16
- // adds an entry to the data root, so a caller that removes the directory as soon as it signals the stop meets nothing
17
- // new there. A start that finds the lock held reads that file only then, and waits for a server that is stopping instead
18
- // of refusing it; a record whose pid is gone or whose time has passed is no stop.
19
- import { chmodSync, closeSync, openSync, readFileSync, writeFileSync, writeSync } from "node:fs";
12
+ import { chmodSync } from "node:fs";
20
13
  import { join } from "node:path";
21
14
  import { DatabaseSync } from "node:sqlite";
22
- import { processAlive } from "@parcha/agentrun-kernel/host";
23
15
  import { sqliteBusy } from "./agents.js";
24
16
  export const SERVER_LOCK = "server.lock";
25
- /** The data root's server, as it last said: `{ pid, until }`, `until` (epoch ms) when it stops, null while it runs. */
26
- export const SERVER_STATE = "server.state";
27
- /** The record's length on disk: its JSON padded with spaces, so a rewrite in place leaves no tail of an earlier one. */
28
- const STATE_BYTES = 128;
29
- const stateOf = (until) => Buffer.from(JSON.stringify({ pid: process.pid, until }).padEnd(STATE_BYTES - 1) + "\n");
30
17
  /** Another server holds the data root. Its message is the one line the CLI prints before it exits 1. */
31
18
  export class ServerLockHeldError extends Error {
32
19
  code = "SERVER_LOCK_HELD";
@@ -72,69 +59,3 @@ export function takeServerLock(dataRoot, options = {}) {
72
59
  },
73
60
  };
74
61
  }
75
- /** Records the data root's server as this process, running: once, as it starts, right after it takes the lock. */
76
- export function markRunning(dataRoot) {
77
- writeFileSync(join(dataRoot, SERVER_STATE), stateOf(null), { mode: 0o600 });
78
- }
79
- /** Records the data root's server as stopping until `until`, as its close begins: the same file, rewritten in place in one
80
- * write of the same length, never made again (a record that is gone is left gone), so the stop adds no entry. */
81
- export function markStopping(dataRoot, until) {
82
- let fd;
83
- try {
84
- fd = openSync(join(dataRoot, SERVER_STATE), "r+");
85
- }
86
- catch (error) {
87
- if (error.code === "ENOENT")
88
- return;
89
- throw error;
90
- }
91
- try {
92
- writeSync(fd, stateOf(until), 0, STATE_BYTES, 0);
93
- }
94
- finally {
95
- closeSync(fd);
96
- }
97
- }
98
- /** The data root's server, when its record says it is stopping, its process lives and its time is still ahead; none
99
- * otherwise (no record, one that can't be read, a server that runs, or one that died as it stopped). */
100
- export function stoppingOf(dataRoot, now = Date.now()) {
101
- let mark;
102
- try {
103
- mark = JSON.parse(readFileSync(join(dataRoot, SERVER_STATE), "utf8"));
104
- }
105
- catch {
106
- return undefined;
107
- }
108
- const { pid, until } = (mark ?? {});
109
- if (typeof pid !== "number" || !Number.isSafeInteger(pid) || pid <= 0 || typeof until !== "number" || !(until > now))
110
- return undefined;
111
- return processAlive(pid) ? { pid, until } : undefined;
112
- }
113
- /** Takes the data root's server lock, as takeServerLock. When another server holds it and is stopping (its record),
114
- * waits for that server as long as its process lives, under one cap, its record's `until` (the server's whole close:
115
- * its runs' drain, their carry backs and their boxes' cleanup), retrying every `everyMs`, and tells `waiting` once as it
116
- * starts to. A server that is not stopping is refused at once with ServerLockHeldError, as is one that still holds the
117
- * lock at its `until`, or a holder that is not the stopping server (its process gone, the lock still held). */
118
- export async function takeServerLockAfterStop(dataRoot, options = {}) {
119
- try {
120
- return takeServerLock(dataRoot);
121
- }
122
- catch (error) {
123
- if (!(error instanceof ServerLockHeldError))
124
- throw error;
125
- const stopping = stoppingOf(dataRoot);
126
- if (!stopping)
127
- throw error;
128
- options.waiting?.(stopping);
129
- for (;;) {
130
- await new Promise((resolve) => setTimeout(resolve, options.everyMs ?? 250));
131
- try {
132
- return takeServerLock(dataRoot);
133
- }
134
- catch (again) {
135
- if (!(again instanceof ServerLockHeldError) || Date.now() >= stopping.until || !processAlive(stopping.pid))
136
- throw again;
137
- }
138
- }
139
- }
140
- }
@@ -1,5 +1,5 @@
1
1
  import { type SealedSettingsOverStore } from "./sealed-settings-store.js";
2
- import { ServerSecrets } from "./server-secrets.js";
2
+ import { type ServerSecrets } from "./server-secrets.js";
3
3
  import type { TriggerAdapter } from "./trigger-adapter.js";
4
4
  import type { TriggerSettings } from "./store/index.js";
5
5
  /** The store slice this layer needs (handed to each adapter's sealed settings). */
@@ -7,11 +7,11 @@ type ServerSecretsStore = {
7
7
  readonly triggerSettings: Pick<TriggerSettings, "get" | "put" | "removeScope">;
8
8
  flush(): Promise<void>;
9
9
  };
10
- /** The server's own secrets over the store: the owner's token and the session secret (still files beside the store), the
11
- * outbound webhook's secret, and every adapter's sealed settings (now store rows), which are returned too, by adapter id,
10
+ /** The server's own secrets over the store: what it keeps beside the store (besideTheStore), every adapter's sealed
11
+ * settings and the outbound webhook's (OUTBOUND_WEBHOOK, its signing secret), store rows, which are returned too, by id,
12
12
  * for the server to keep using. Loads each adapter's settings before it answers (awaited once at start), so the redaction
13
13
  * list is whole from the first use. A value that does not open is said to `say`. */
14
- export declare function openServerSecretsOverStore(store: ServerSecretsStore, data: string, env: NodeJS.ProcessEnv, adapters: readonly TriggerAdapter[], say?: (fields: Record<string, string>) => void): Promise<{
14
+ export declare function openServerSecretsOverStore(store: ServerSecretsStore, data: string, env: NodeJS.ProcessEnv, adapters: readonly Pick<TriggerAdapter, "id" | "settings">[], say?: (fields: Record<string, string>) => void): Promise<{
15
15
  secrets: ServerSecrets;
16
16
  settings: Map<string, SealedSettingsOverStore>;
17
17
  }>;
@@ -1,46 +1,24 @@
1
- // The server's own secrets as one redaction list, over the one store, the store-backed replacement for openServerSecrets
2
- // (server-secrets.ts). What changes from the file version: each trigger source's sealed settings are store rows
3
- // (sealed-settings-store.ts, store.triggerSettings), not per-adapter files; the deleted per-run door token (.door-token) is
4
- // no longer a source. What stays a file: the owner's API token (.token, the CLI reads it) and the sign-in session secret,
5
- // which the cutover keeps beside the store; and the outbound webhook's signing secret, read as before. The list is still
1
+ // The server's own secrets as one redaction list, over the one store: each trigger source's sealed settings and the
2
+ // outbound webhook's signing secret are store rows (sealed-settings-store.ts, store.triggerSettings); the owner's API
3
+ // token (.token, the CLI reads it) and the sign-in session secret stay beside the store (server-secrets.ts besideTheStore). The list is
6
4
  // the one the server never shows (server.ts serverSecrets): what a run shows, what learning keeps and what the server
7
5
  // answers are cut of it.
8
- import { readFileSync } from "node:fs";
9
- import { join } from "node:path";
10
- import { TOKEN_FILE } from "./files.js";
11
- import { SESSION_SECRET_FILE } from "./owner.js";
12
6
  import { sealedSettingsOverStore } from "./sealed-settings-store.js";
13
- import { ServerSecrets } from "./server-secrets.js";
7
+ import { besideTheStore } from "./server-secrets.js";
14
8
  import { SEAL_KEY_ENV, sealKeyOf } from "./tool-keys.js";
15
- import { webhookSecretIn } from "./webhooks.js";
16
- /** The file `name` in `data`, trimmed; empty when it is not there. */
17
- const fileIn = (data, name) => {
18
- try {
19
- return readFileSync(join(data, name), "utf8").trim();
20
- }
21
- catch {
22
- return "";
23
- }
24
- };
25
- /** The server's own secrets over the store: the owner's token and the session secret (still files beside the store), the
26
- * outbound webhook's secret, and every adapter's sealed settings (now store rows), which are returned too, by adapter id,
9
+ import { OUTBOUND_WEBHOOK } from "./webhooks.js";
10
+ /** The server's own secrets over the store: what it keeps beside the store (besideTheStore), every adapter's sealed
11
+ * settings and the outbound webhook's (OUTBOUND_WEBHOOK, its signing secret), store rows, which are returned too, by id,
27
12
  * for the server to keep using. Loads each adapter's settings before it answers (awaited once at start), so the redaction
28
13
  * list is whole from the first use. A value that does not open is said to `say`. */
29
14
  export async function openServerSecretsOverStore(store, data, env, adapters, say = () => { }) {
30
- const secrets = new ServerSecrets();
31
- // Each read until it is there, then kept: they are made once, and a redaction reads the list often.
32
- const read = new Map();
33
- const kept = (name) => read.get(name) || (read.set(name, fileIn(data, name)), read.get(name));
34
- // The owner's API token and the sign-in session secret stay files beside the store; the per-run door token is gone.
35
- secrets.add("files", () => [kept(TOKEN_FILE), kept(SESSION_SECRET_FILE)]);
36
- const webhook = webhookSecretIn(data, env);
37
- secrets.add("webhook", () => (webhook && "secret" in webhook ? [webhook.secret] : []));
38
- // The server always has its seal key (seal-key.ts ensureSealKey, at its start): no setting is ever kept in the clear.
15
+ // The server always has its seal key (seal-key.ts bootSealKey, at its start): no setting is ever kept in the clear.
39
16
  const key = sealKeyOf(env[SEAL_KEY_ENV]);
40
17
  if (!key)
41
18
  throw new Error(`the server starts with its seal key (${SEAL_KEY_ENV}), made at the first start when none is handed over`);
19
+ const secrets = besideTheStore(data);
42
20
  const settings = new Map();
43
- for (const adapter of adapters) {
21
+ for (const adapter of [...adapters, OUTBOUND_WEBHOOK]) {
44
22
  if (!adapter.settings)
45
23
  continue;
46
24
  const adapterSettings = sealedSettingsOverStore(store, adapter.id, adapter.settings, key, say);
@@ -1,5 +1,3 @@
1
- import { SealedSettings } from "./sealed-settings.js";
2
- import type { TriggerAdapter } from "./trigger-adapter.js";
3
1
  export declare class ServerSecrets {
4
2
  private readonly sources;
5
3
  /** Sources whose every value is listed as it is, of any length and whitespace and all: a PEM key's lines and whole. */
@@ -14,10 +12,7 @@ export declare class ServerSecrets {
14
12
  * in every spelling of it (standard-webhooks.ts secretForms). */
15
13
  values(): string[];
16
14
  }
17
- /** The server's own secrets data directory `data` keeps, each store opened with the seal key of `env`: the tokens' and
18
- * the session secret's files, the outbound webhook's secret, and every adapter's sealed settings (a value that does not
19
- * open is said to `say`), which are returned too, by adapter id, for the server to keep using. */
20
- export declare function openServerSecrets(data: string, env: NodeJS.ProcessEnv, adapters: readonly TriggerAdapter[], say?: (fields: Record<string, string>) => void): {
21
- secrets: ServerSecrets;
22
- settings: Map<string, SealedSettings>;
23
- };
15
+ /** The server's own secrets data directory `data` keeps beside the store: the owner's API token and the sign-in session
16
+ * secret (files the CLI and the console's sign-in read). Each file is read until it is there, then kept: they are made
17
+ * once, and a redaction reads the list often. */
18
+ export declare function besideTheStore(data: string): ServerSecrets;
@@ -1,17 +1,14 @@
1
- // The server's own secrets, as one list: its API token, its door token, its sign-in sessions' secret, its outbound
2
- // webhook's signing secret, and every value a trigger source keeps sealed (sealed-settings.ts). Each store adds itself
3
- // when it opens, as a reader, so a secret made or rotated since is in the list at once. With the host's, they are the one
4
- // list a server never shows (server.ts serverSecrets): what a run shows (runs.ts), what learning keeps (learning-run.ts),
5
- // what the server answers and the VM relay's errors are cut of it, and what an import writes (import.ts) of these; none
6
- // of them assembles its own.
7
- import { existsSync, readFileSync } from "node:fs";
1
+ // The server's own secrets, as one list: its API token, its sign-in sessions' secret, and every value the server keeps
2
+ // sealed among its settings (sealed-settings-store.ts): each trigger source's, and the outbound webhook's signing secret. Each source is added as a reader, so a
3
+ // secret made or rotated since is in the list at once. With the host's, they are the one list a server never shows
4
+ // (server.ts serverSecrets): what a run shows, what learning keeps, what the server answers and what an import writes are
5
+ // cut of it; none of them assembles its own. The trigger settings are store rows (server-secrets-store.ts); what stays
6
+ // beside the store in the data directory is read here (besideTheStore), by the server and by a runner that shares it.
7
+ import { readFileSync } from "node:fs";
8
8
  import { join } from "node:path";
9
9
  import { TOKEN_FILE } from "./files.js";
10
10
  import { SESSION_SECRET_FILE } from "./owner.js";
11
- import { SealedSettings } from "./sealed-settings.js";
12
11
  import { secretForms } from "./standard-webhooks.js";
13
- import { SEAL_KEY_ENV, sealKeyOf } from "./tool-keys.js";
14
- import { webhookSecretIn } from "./webhooks.js";
15
12
  export class ServerSecrets {
16
13
  sources = new Map();
17
14
  /** Sources whose every value is listed as it is, of any length and whitespace and all: a PEM key's lines and whole. */
@@ -43,31 +40,13 @@ const fileIn = (data, name) => {
43
40
  return "";
44
41
  }
45
42
  };
46
- /** The server's own secrets data directory `data` keeps, each store opened with the seal key of `env`: the tokens' and
47
- * the session secret's files, the outbound webhook's secret, and every adapter's sealed settings (a value that does not
48
- * open is said to `say`), which are returned too, by adapter id, for the server to keep using. */
49
- export function openServerSecrets(data, env, adapters, say = () => { }) {
43
+ /** The server's own secrets data directory `data` keeps beside the store: the owner's API token and the sign-in session
44
+ * secret (files the CLI and the console's sign-in read). Each file is read until it is there, then kept: they are made
45
+ * once, and a redaction reads the list often. */
46
+ export function besideTheStore(data) {
50
47
  const secrets = new ServerSecrets();
51
- // Each read until it is there, then kept: they are made once, and a redaction reads the list often.
52
48
  const read = new Map();
53
49
  const kept = (name) => read.get(name) || (read.set(name, fileIn(data, name)), read.get(name));
54
50
  secrets.add("files", () => [kept(TOKEN_FILE), kept(SESSION_SECRET_FILE)]);
55
- const webhook = webhookSecretIn(data, env);
56
- secrets.add("webhook", () => (webhook && "secret" in webhook ? [webhook.secret] : []));
57
- // Where a webhook trigger's secret was kept before its source's sealed settings were: no longer read.
58
- const leftover = join(data, "trigger-secrets.json");
59
- if (existsSync(leftover))
60
- say({ condition: "trigger_secrets_left_over", file: leftover, effect: "not read: give each webhook trigger made before a new secret with POST /v2/triggers/{id}/secret, or make it again" });
61
- const key = sealKeyOf(env[SEAL_KEY_ENV]);
62
- const settings = new Map();
63
- for (const adapter of adapters) {
64
- if (!adapter.settings)
65
- continue;
66
- const store = new SealedSettings(data, adapter.id, adapter.settings, key, say);
67
- settings.set(adapter.id, store);
68
- secrets.add(`trigger-settings:${adapter.id}`, () => store.values());
69
- // A PEM key's lines, its short last one too, and the key whole: listed with no floor.
70
- secrets.add(`trigger-settings-pem:${adapter.id}`, () => store.pemValues(), { whole: true });
71
- }
72
- return { secrets, settings };
51
+ return secrets;
73
52
  }
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type ModelNeeds } from "./model.js";
2
2
  import { type HarnessCapability } from "./harness.js";
3
- import type { MessageOrigin } from "@parcha/pi-durable-agent/timeline";
3
+ import type { MessageOrigin } from "./timeline/index.js";
4
4
  import { type LearningMode } from "./learning.js";
5
5
  import { type Place } from "./place.js";
6
6
  import { type Store } from "./store/index.js";
@@ -16,6 +16,9 @@ export declare const DEFAULT_PORT = 7340;
16
16
  export type ServeOptions = {
17
17
  /** The data directory: the agent store (`store.sqlite`) and its runs (`runs/<id>/`). */
18
18
  data: string;
19
+ /** On Postgres: told when this server's owner lock is lost for good (another server took the schema, or the lock could
20
+ * not be taken back): every store call is refused from then. The CLI exits 1 on it, so the platform restarts the server. */
21
+ onStoreLost?: (error: Error) => void;
19
22
  /** The owner, signed in with a password (owner.ts): the page asks for it, and the token stays for scripts and the CLI. */
20
23
  accounts?: boolean;
21
24
  /** With accounts: the first visit sets the password with no setup code (a server with no public address). Honored only
@@ -59,6 +62,10 @@ export type ServeOptions = {
59
62
  allowCodeNodes?: boolean;
60
63
  /** A faux model module (no key, no network): see the README. */
61
64
  faux?: string;
65
+ /** The API-only profile (AGENTRUN_API_ONLY=1, api-only.ts): serve the run routes alone and refuse every other address
66
+ * (the console, sign-in, setup, settings, MCP, triggers, hooks, ...) with a 404 before anything reads the request.
67
+ * It has no owner: accounts and open setup are off, there being no page to sign in to. */
68
+ apiOnly?: boolean;
62
69
  /** With `faux` only: a module whose default export gives the `browser` tool's `{ provider, driver }` (the tests' fake
63
70
  * backend), in place of Browserbase's or Kernel's. */
64
71
  fauxBrowser?: string;
@@ -126,8 +133,6 @@ export type ServeOptions = {
126
133
  maxRuns?: number;
127
134
  /** Free disk under the data directory below which GET /v2/health fails (default 64 MiB, or AGENTRUN_MIN_FREE_MB). */
128
135
  minFreeBytes?: number;
129
- /** How often a carry back the store refused is tried again while the server lives (default 30 s). */
130
- settleRetryMs?: number;
131
136
  /** Where the log lines go (print.ts); none without it. AGENTRUN_LOG=quiet leaves out the request lines. */
132
137
  log?: (line: string) => void;
133
138
  /** Told the Docker box image's state at the start, when this server has a Docker box, then each change (box-image.ts):
@@ -137,41 +142,18 @@ export type ServeOptions = {
137
142
  * left to finish their turn, and this start's, when it waits for a server that is stopping (server-lock.ts). Default:
138
143
  * standard error, after `agentrun-serve: `. */
139
144
  notice?: (line: string) => void;
140
- /** The waits between carry backs that found the store held by another writer (default 0.5, 1, 2, 4 and 8 s), and a
141
- * hook called at each such refusal. */
142
- /** A test hook the per-run process used for carry-back; the runner owns carry-back now (unused by the server cut). */
143
- carryBackRetry?: unknown;
144
145
  /** A test's seam: awaited by a stop between its mark and its abort, so a test can hold a stop in flight there. */
145
146
  beforeAbort?: (runId: string) => Promise<void> | void;
146
147
  /** A test's seam: awaited by a completed run's reopen for a follow-up, after the run reads open again and before its
147
148
  * process is launched, so a test can hold a reopen there. */
148
149
  beforeReopenLaunch?: (runId: string) => Promise<void> | void;
149
- /** A test's seam: awaited where a raise that opens a let-go workflow pins what its launch needs, after its place is
150
- * taken (runs.ts finishRaise); one that throws stands for a pin that fails there. */
151
- beforeRaiseLaunch?: (runId: string) => Promise<void> | void;
152
150
  /** A test's seam: the host's memory, in bytes, that the runs' limit reads (host.ts), in place of this host's. */
153
151
  hostMemory?: number;
154
- /** A test's seam: told each stat and each read of a workflow run's pause by its watch (runs.ts watchPause). */
155
- onPauseCheck?: (runId: string, what: "stat" | "read") => void;
156
- /** A test's seam: awaited by a message before it goes to the run's door, so a test can act while it is in flight. */
157
- beforeSubmit?: (runId: string, content: string) => Promise<void> | void;
158
152
  /** A test's seam: told each run read in from its store (runs.ts onRunLoad). */
159
153
  onRunLoad?: (runId: string) => void;
160
- /** A test's seam: awaited before a run's serve.json is written (runs.ts beforeMetaSave). */
161
- beforeMetaSave?: (runId: string, meta: Readonly<Record<string, unknown>>) => Promise<void> | void;
162
154
  /** A test's seam: who wrote a message sent to a run through its messages route (`origin`, as a raised cap's follow-up
163
155
  * carries it), so a test sends a server-written message down the path a person's message takes. */
164
156
  messageOrigin?: (runId: string, content: string) => MessageOrigin | undefined;
165
- /** How long a request waits for a run's door, its process coming up or a settle in progress (default 45 s). */
166
- readyTimeoutMs?: number;
167
- /** How long a launched run's process has to open its run before it is stopped and the run opened again (default 45 s,
168
- * READY_TIMEOUT_MS: the wait of a run's first message). */
169
- openTimeoutMs?: number;
170
- /** With `faux` only: the door nonce each run's process is handed in place of its launch's own, so its door answers the
171
- * launch's proof wrongly (a test of a door that fails its proof). */
172
- fauxHandedNonce?: string;
173
- /** How long a run's end-of-run turn may take before it is aborted and the run finishes without it (default 5 min). */
174
- reflectTimeoutMs?: number;
175
157
  /** The model the grader runs on (`--grade-model`; default AGENTRUN_SERVE_GRADE_MODEL, else the strong tier,
176
158
  * AGENT_MODEL_STRONG, else each run's agent's own model). */
177
159
  gradeModel?: string;
@@ -180,8 +162,8 @@ export type ServeOptions = {
180
162
  * its agent's definition says, and its `learning` is null. */
181
163
  learning?: LearningMode;
182
164
  /** How much of what a run learned its instructions hold under `# Learned`, in UTF-8 bytes (`--learning-budget`;
183
- * default AGENTRUN_SERVE_LEARNING_BUDGET, else 8000): every note whole while they fit, else the index and the notes
184
- * changed last, whole, while they fit (learning.ts learnedOf). */
165
+ * default AGENTRUN_SERVE_LEARNING_BUDGET, else 8000): every note whole while they fit, else the notes that bear on
166
+ * the run's input whole and a line for each of the rest (learning.ts learnedParts, its note selector). */
185
167
  learningBudget?: number;
186
168
  /** A test's seam: the triggers' clock and timer (triggers.ts), in place of Date.now and setTimeout. */
187
169
  triggerClock?: TriggerClock;
@@ -321,7 +303,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
321
303
  * web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
322
304
  * it (tool-keys.ts), when one does. */
323
305
  tools: ({
324
- providers?: ("auto" | "native" | "off" | "parallel" | "browserbase" | "kernel" | "exa-keyless" | "chrome")[] | undefined;
306
+ providers?: ("auto" | "native" | "parallel" | "browserbase" | "kernel" | "off" | "exa-keyless" | "chrome")[] | undefined;
325
307
  provider?: string | undefined;
326
308
  default_provider?: "auto" | "kernel" | undefined;
327
309
  resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", import("./tool-plane.js").Resolution> | undefined;
@@ -342,7 +324,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
342
324
  summary: string;
343
325
  } | {
344
326
  key: string | undefined;
345
- providers?: ("auto" | "native" | "off" | "parallel" | "browserbase" | "kernel" | "exa-keyless" | "chrome")[] | undefined;
327
+ providers?: ("auto" | "native" | "parallel" | "browserbase" | "kernel" | "off" | "exa-keyless" | "chrome")[] | undefined;
346
328
  provider?: string | undefined;
347
329
  default_provider?: "auto" | "kernel" | undefined;
348
330
  resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", import("./tool-plane.js").Resolution> | undefined;
@@ -456,13 +438,13 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
456
438
  take_over: boolean;
457
439
  ask: boolean;
458
440
  };
459
- /** An agent's browser stays signed in between its runs (sign-ins.ts): with a seal key to keep each pointer under, and a
460
- * browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
441
+ /** An agent's browser stays signed in between its runs (sign-ins-store.ts), each pointer sealed under the server's seal
442
+ * key: with a browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
461
443
  sign_ins: boolean;
462
444
  vault: boolean;
463
445
  query: boolean;
464
- /** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the launcher's seal key
465
- * (tool-keys.ts); with none handed over, nothing is kept, never in the clear. */
446
+ /** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the server's seal key
447
+ * (tool-keys-store.ts), never in the clear. */
466
448
  tool_keys: {
467
449
  routes: boolean;
468
450
  at_rest: string;
@@ -476,9 +458,9 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
476
458
  harnesses: string[];
477
459
  };
478
460
  /** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
479
- learning: "off" | "on";
461
+ learning: "on" | "off";
480
462
  /** /settings/webhook: one URL POSTed, signed by the Standard Webhooks spec, when a run needs its person and when it
481
- * ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
463
+ * ends (webhooks.ts); its secret kept sealed under the same seal key. */
482
464
  webhooks: {
483
465
  routes: boolean;
484
466
  events: ("run.needs_input" | "run.ended" | "trigger.failed")[];
@@ -579,7 +561,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
579
561
  * web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
580
562
  * it (tool-keys.ts), when one does. */
581
563
  tools: ({
582
- providers?: ("auto" | "native" | "off" | "parallel" | "browserbase" | "kernel" | "exa-keyless" | "chrome")[] | undefined;
564
+ providers?: ("auto" | "native" | "parallel" | "browserbase" | "kernel" | "off" | "exa-keyless" | "chrome")[] | undefined;
583
565
  provider?: string | undefined;
584
566
  default_provider?: "auto" | "kernel" | undefined;
585
567
  resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", import("./tool-plane.js").Resolution> | undefined;
@@ -600,7 +582,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
600
582
  summary: string;
601
583
  } | {
602
584
  key: string | undefined;
603
- providers?: ("auto" | "native" | "off" | "parallel" | "browserbase" | "kernel" | "exa-keyless" | "chrome")[] | undefined;
585
+ providers?: ("auto" | "native" | "parallel" | "browserbase" | "kernel" | "off" | "exa-keyless" | "chrome")[] | undefined;
604
586
  provider?: string | undefined;
605
587
  default_provider?: "auto" | "kernel" | undefined;
606
588
  resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", import("./tool-plane.js").Resolution> | undefined;
@@ -714,13 +696,13 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
714
696
  take_over: boolean;
715
697
  ask: boolean;
716
698
  };
717
- /** An agent's browser stays signed in between its runs (sign-ins.ts): with a seal key to keep each pointer under, and a
718
- * browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
699
+ /** An agent's browser stays signed in between its runs (sign-ins-store.ts), each pointer sealed under the server's seal
700
+ * key: with a browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
719
701
  sign_ins: boolean;
720
702
  vault: boolean;
721
703
  query: boolean;
722
- /** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the launcher's seal key
723
- * (tool-keys.ts); with none handed over, nothing is kept, never in the clear. */
704
+ /** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the server's seal key
705
+ * (tool-keys-store.ts), never in the clear. */
724
706
  tool_keys: {
725
707
  routes: boolean;
726
708
  at_rest: string;
@@ -734,9 +716,9 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
734
716
  harnesses: string[];
735
717
  };
736
718
  /** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
737
- learning: "off" | "on";
719
+ learning: "on" | "off";
738
720
  /** /settings/webhook: one URL POSTed, signed by the Standard Webhooks spec, when a run needs its person and when it
739
- * ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
721
+ * ends (webhooks.ts); its secret kept sealed under the same seal key. */
740
722
  webhooks: {
741
723
  routes: boolean;
742
724
  events: ("run.needs_input" | "run.ended" | "trigger.failed")[];