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

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 (466) hide show
  1. package/CHANGELOG.md +368 -0
  2. package/README.md +341 -208
  3. package/dist/adapters.d.ts +3 -4
  4. package/dist/adapters.js +18 -15
  5. package/dist/agent-rows.d.ts +99 -0
  6. package/dist/agent-rows.js +1 -0
  7. package/dist/agents-store.d.ts +6 -2
  8. package/dist/agents-store.js +75 -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 +1 -1
  14. package/dist/api-only.js +2 -2
  15. package/dist/archil-settings.d.ts +11 -1
  16. package/dist/archil-settings.js +10 -0
  17. package/dist/bash-read-only.d.ts +35 -0
  18. package/dist/bash-read-only.js +778 -0
  19. package/dist/box-settings.d.ts +3 -23
  20. package/dist/box-settings.js +7 -51
  21. package/dist/boxes.d.ts +17 -0
  22. package/dist/boxes.js +27 -20
  23. package/dist/browser-commands.d.ts +5 -2
  24. package/dist/browser-commands.js +4 -4
  25. package/dist/browser-computer.d.ts +5 -0
  26. package/dist/browser-computer.js +21 -0
  27. package/dist/browser-cost.d.ts +9 -6
  28. package/dist/browser-cost.js +95 -51
  29. package/dist/browser-live.d.ts +7 -20
  30. package/dist/browser-live.js +15 -93
  31. package/dist/browser-person.d.ts +18 -51
  32. package/dist/browser-person.js +94 -277
  33. package/dist/budget.d.ts +0 -5
  34. package/dist/budget.js +0 -5
  35. package/dist/cap.d.ts +14 -8
  36. package/dist/cap.js +19 -9
  37. package/dist/cli.js +71 -18
  38. package/dist/closed-pipes.d.ts +2 -0
  39. package/dist/closed-pipes.js +13 -0
  40. package/dist/computer-commands.d.ts +2 -0
  41. package/dist/computer-commands.js +2 -0
  42. package/dist/computer-keys.d.ts +20 -10
  43. package/dist/computer-keys.js +36 -54
  44. package/dist/computer-setting.d.ts +20 -3
  45. package/dist/computer-setting.js +58 -10
  46. package/dist/computers.d.ts +35 -2
  47. package/dist/computers.js +72 -11
  48. package/dist/confine.d.ts +120 -0
  49. package/dist/confine.js +436 -0
  50. package/dist/console/assets/index-B7NKTU8E.css +1 -0
  51. package/dist/console/assets/index-CXZMgJE7.js +550 -0
  52. package/dist/console/index.html +2 -2
  53. package/dist/content-filter.d.ts +7 -0
  54. package/dist/content-filter.js +23 -0
  55. package/dist/decision-cap.d.ts +7 -29
  56. package/dist/decision-cap.js +3 -94
  57. package/dist/decision-rows.d.ts +1 -1
  58. package/dist/decision-rows.js +1 -1
  59. package/dist/docker-daemon.d.ts +31 -0
  60. package/dist/docker-daemon.js +56 -0
  61. package/dist/effort-guidance.js +4 -3
  62. package/dist/environment.d.ts +0 -3
  63. package/dist/environment.js +3 -5
  64. package/dist/errors.d.ts +1 -2
  65. package/dist/errors.js +9 -9
  66. package/dist/explain.js +3 -1
  67. package/dist/filed-answer.d.ts +32 -0
  68. package/dist/filed-answer.js +160 -0
  69. package/dist/files.d.ts +1 -3
  70. package/dist/files.js +2 -4
  71. package/dist/github-connection.d.ts +1 -1
  72. package/dist/github-connection.js +25 -7
  73. package/dist/github-faux.d.ts +26 -0
  74. package/dist/github-faux.js +76 -0
  75. package/dist/github.d.ts +6 -2
  76. package/dist/github.js +5 -3
  77. package/dist/graph-served.d.ts +5 -3
  78. package/dist/graph-served.js +14 -6
  79. package/dist/graph-view.d.ts +3 -5
  80. package/dist/graph-view.js +9 -16
  81. package/dist/handed-values.d.ts +9 -0
  82. package/dist/handed-values.js +26 -0
  83. package/dist/harness-install.d.ts +1 -7
  84. package/dist/harness-install.js +1 -18
  85. package/dist/harness-opencode/adapter.d.ts +7 -0
  86. package/dist/harness-opencode/adapter.js +23 -6
  87. package/dist/harness-opencode/harness.js +0 -1
  88. package/dist/harness-opencode/host/policy.js +2 -2
  89. package/dist/harness-opencode/index.d.ts +1 -1
  90. package/dist/harness-opencode/index.js +1 -1
  91. package/dist/harness-opencode/verify.d.ts +17 -0
  92. package/dist/harness-opencode/verify.js +30 -10
  93. package/dist/harness-table.js +6 -1
  94. package/dist/heard.js +1 -1
  95. package/dist/held-fd.d.ts +5 -0
  96. package/dist/held-fd.js +14 -0
  97. package/dist/host-calls.d.ts +20 -0
  98. package/dist/host-calls.js +12 -0
  99. package/dist/host-tools.d.ts +4 -21
  100. package/dist/host-tools.js +4 -61
  101. package/dist/host.d.ts +2 -4
  102. package/dist/host.js +2 -7
  103. package/dist/import-summary.d.ts +1 -5
  104. package/dist/import-summary.js +0 -21
  105. package/dist/import.d.ts +6 -6
  106. package/dist/import.js +14 -15
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +1 -0
  109. package/dist/key-refusal.d.ts +5 -1
  110. package/dist/key-refusal.js +19 -4
  111. package/dist/learn/check.d.ts +8 -2
  112. package/dist/learn/check.js +85 -31
  113. package/dist/learn/folder.d.ts +11 -4
  114. package/dist/learn/folder.js +17 -19
  115. package/dist/learn/grade.d.ts +18 -1
  116. package/dist/learn/grade.js +108 -14
  117. package/dist/learn/index.d.ts +5 -5
  118. package/dist/learn/index.js +5 -5
  119. package/dist/learn/learning.sh +1 -14
  120. package/dist/learn/notes.d.ts +14 -3
  121. package/dist/learn/notes.js +16 -6
  122. package/dist/learn/reflect.d.ts +31 -2
  123. package/dist/learn/reflect.js +83 -6
  124. package/dist/learn/relevance.d.ts +24 -0
  125. package/dist/learn/relevance.js +91 -0
  126. package/dist/learn/secrets.d.ts +7 -1
  127. package/dist/learn/secrets.js +86 -19
  128. package/dist/learn/skills.d.ts +159 -18
  129. package/dist/learn/skills.js +644 -64
  130. package/dist/learned-nodes.d.ts +14 -0
  131. package/dist/learned-nodes.js +8 -0
  132. package/dist/learned-workflow.d.ts +41 -6
  133. package/dist/learned-workflow.js +153 -18
  134. package/dist/learning-routes.d.ts +49 -4
  135. package/dist/learning-routes.js +113 -31
  136. package/dist/learning-run.d.ts +16 -31
  137. package/dist/learning-run.js +31 -38
  138. package/dist/learning-words.d.ts +12 -5
  139. package/dist/learning-words.js +18 -9
  140. package/dist/learning.d.ts +91 -97
  141. package/dist/learning.js +176 -320
  142. package/dist/live/stream.js +1 -1
  143. package/dist/live/translate.js +12 -2
  144. package/dist/llm.d.ts +4 -1
  145. package/dist/llm.js +4 -2
  146. package/dist/local-models.d.ts +11 -5
  147. package/dist/local-models.js +13 -8
  148. package/dist/mcp-gateway.d.ts +17 -49
  149. package/dist/mcp-gateway.js +55 -136
  150. package/dist/mcp-oauth.d.ts +10 -14
  151. package/dist/mcp-oauth.js +14 -32
  152. package/dist/mcp-probe.d.ts +0 -7
  153. package/dist/mcp-probe.js +4 -10
  154. package/dist/mcp-servers-store.d.ts +18 -18
  155. package/dist/mcp-servers-store.js +12 -14
  156. package/dist/mcp-store.js +3 -4
  157. package/dist/mcp.js +4 -3
  158. package/dist/model.d.ts +9 -7
  159. package/dist/model.js +51 -27
  160. package/dist/monid.d.ts +0 -2
  161. package/dist/monid.js +3 -6
  162. package/dist/openapi.d.ts +8 -1
  163. package/dist/openapi.js +156 -58
  164. package/dist/page.d.ts +1 -3
  165. package/dist/page.js +6 -18
  166. package/dist/paid-calls.d.ts +21 -27
  167. package/dist/paid-calls.js +26 -61
  168. package/dist/pause.d.ts +2 -19
  169. package/dist/pause.js +5 -74
  170. package/dist/port-models.d.ts +10 -3
  171. package/dist/port-models.js +26 -6
  172. package/dist/propose.d.ts +2 -0
  173. package/dist/propose.js +80 -45
  174. package/dist/push-handler.d.ts +1 -1
  175. package/dist/reflect-range.d.ts +25 -0
  176. package/dist/reflect-range.js +30 -0
  177. package/dist/refusal-words.d.ts +5 -1
  178. package/dist/refusal-words.js +5 -1
  179. package/dist/rows.d.ts +1 -1
  180. package/dist/run-cut.d.ts +0 -6
  181. package/dist/run-cut.js +0 -6
  182. package/dist/run-db.d.ts +2 -11
  183. package/dist/run-db.js +2 -37
  184. package/dist/run-launch.d.ts +21 -2
  185. package/dist/run-launch.js +14 -5
  186. package/dist/run-learning-served.d.ts +21 -4
  187. package/dist/run-learning-served.js +23 -13
  188. package/dist/run-reads-over-store.d.ts +5 -3
  189. package/dist/run-reads-over-store.js +25 -14
  190. package/dist/run-secrets.d.ts +1 -1
  191. package/dist/run-timeline-served.d.ts +5 -1
  192. package/dist/run-timeline-served.js +27 -6
  193. package/dist/run-view.d.ts +37 -22
  194. package/dist/run-view.js +85 -38
  195. package/dist/runnable.d.ts +21 -10
  196. package/dist/runnable.js +35 -12
  197. package/dist/runner/adapter-loop.d.ts +36 -5
  198. package/dist/runner/adapter-loop.js +663 -69
  199. package/dist/runner/adapter-run-spec.d.ts +42 -8
  200. package/dist/runner/adapter-run-spec.js +186 -52
  201. package/dist/runner/adapters/index.js +11 -1
  202. package/dist/runner/adapters/pi.d.ts +40 -2
  203. package/dist/runner/adapters/pi.js +110 -27
  204. package/dist/runner/beside.d.ts +38 -3
  205. package/dist/runner/beside.js +54 -5
  206. package/dist/runner/claim-secrets.d.ts +16 -1
  207. package/dist/runner/claim-secrets.js +62 -14
  208. package/dist/runner/cli-run-spec.d.ts +5 -0
  209. package/dist/runner/cli-run-spec.js +159 -41
  210. package/dist/runner/commands.js +1 -1
  211. package/dist/runner/computer-journal.d.ts +15 -2
  212. package/dist/runner/computer-journal.js +41 -5
  213. package/dist/runner/conformance/harness.d.ts +1 -0
  214. package/dist/runner/conformance/harness.js +123 -13
  215. package/dist/runner/conformance/subject.d.ts +4 -1
  216. package/dist/runner/dispatch.d.ts +8 -1
  217. package/dist/runner/dispatch.js +81 -7
  218. package/dist/runner/end-of-run.d.ts +8 -2
  219. package/dist/runner/end-of-run.js +10 -4
  220. package/dist/runner/github-app.d.ts +7 -2
  221. package/dist/runner/github-app.js +47 -16
  222. package/dist/runner/harness-loops.d.ts +15 -2
  223. package/dist/runner/harness-loops.js +38 -2
  224. package/dist/runner/journal-kinds.d.ts +60 -6
  225. package/dist/runner/journal-kinds.js +43 -5
  226. package/dist/runner/journal-reader.d.ts +1 -1
  227. package/dist/runner/journal-reader.js +2 -2
  228. package/dist/runner/learning-ask.d.ts +4 -0
  229. package/dist/runner/learning-ask.js +15 -1
  230. package/dist/runner/learning-end.d.ts +18 -3
  231. package/dist/runner/learning-end.js +194 -20
  232. package/dist/runner/learning-loop.d.ts +7 -0
  233. package/dist/runner/learning-loop.js +36 -8
  234. package/dist/runner/learning-seed.d.ts +6 -0
  235. package/dist/runner/learning-seed.js +6 -0
  236. package/dist/runner/loop-contract.d.ts +4 -0
  237. package/dist/runner/main.d.ts +61 -9
  238. package/dist/runner/main.js +144 -20
  239. package/dist/runner/mcp-claim.d.ts +3 -0
  240. package/dist/runner/mcp-claim.js +7 -3
  241. package/dist/runner/mcp-github.d.ts +11 -2
  242. package/dist/runner/mcp-github.js +55 -4
  243. package/dist/runner/mcp-run.d.ts +2 -0
  244. package/dist/runner/mcp-run.js +16 -5
  245. package/dist/runner/memory-claim.d.ts +9 -0
  246. package/dist/runner/memory-claim.js +25 -0
  247. package/dist/runner/metrics.d.ts +46 -1
  248. package/dist/runner/metrics.js +156 -1
  249. package/dist/runner/model-route.d.ts +16 -0
  250. package/dist/runner/model-route.js +134 -10
  251. package/dist/runner/reflect-hook.d.ts +12 -1
  252. package/dist/runner/reflect-hook.js +33 -3
  253. package/dist/runner/runner.d.ts +20 -0
  254. package/dist/runner/runner.js +146 -18
  255. package/dist/runner/spec-holds.d.ts +7 -2
  256. package/dist/runner/spec-holds.js +4 -3
  257. package/dist/runner/store-port.d.ts +1 -1
  258. package/dist/runner/store-secrets.d.ts +3 -3
  259. package/dist/runner/store-secrets.js +8 -12
  260. package/dist/runner/text-tools.d.ts +44 -0
  261. package/dist/runner/text-tools.js +237 -0
  262. package/dist/runner/workflow-host.d.ts +7 -2
  263. package/dist/runner/workflow-host.js +3 -1
  264. package/dist/runner/workflow-loop.d.ts +10 -1
  265. package/dist/runner/workflow-loop.js +14 -6
  266. package/dist/runner/workflow-spec.d.ts +21 -0
  267. package/dist/runner/workflow-spec.js +217 -93
  268. package/dist/runs-over-store.d.ts +14 -3
  269. package/dist/runs-over-store.js +100 -23
  270. package/dist/seal-key.d.ts +0 -2
  271. package/dist/seal-key.js +5 -45
  272. package/dist/sealed-settings-store.d.ts +19 -4
  273. package/dist/sealed-settings-store.js +9 -9
  274. package/dist/sealing.d.ts +4 -0
  275. package/dist/sealing.js +20 -0
  276. package/dist/secret-cut.d.ts +1 -1
  277. package/dist/secret-cut.js +1 -1
  278. package/dist/secret-name.d.ts +9 -0
  279. package/dist/secret-name.js +15 -0
  280. package/dist/secret-writes.d.ts +0 -1
  281. package/dist/secret-writes.js +0 -1
  282. package/dist/server-fs.d.ts +4 -0
  283. package/dist/server-fs.js +8 -2
  284. package/dist/server-lock.d.ts +0 -24
  285. package/dist/server-lock.js +5 -85
  286. package/dist/server-secrets-store.d.ts +4 -4
  287. package/dist/server-secrets-store.js +9 -31
  288. package/dist/server-secrets.d.ts +4 -9
  289. package/dist/server-secrets.js +12 -36
  290. package/dist/server.d.ts +37 -56
  291. package/dist/server.js +322 -134
  292. package/dist/sign-ins-store.d.ts +34 -36
  293. package/dist/sign-ins-store.js +27 -38
  294. package/dist/sign-ins.d.ts +2 -119
  295. package/dist/sign-ins.js +5 -311
  296. package/dist/standard-webhooks.d.ts +1 -1
  297. package/dist/standard-webhooks.js +1 -1
  298. package/dist/stats.d.ts +3 -2
  299. package/dist/stats.js +1 -1
  300. package/dist/stop-signals.d.ts +4 -2
  301. package/dist/stop-signals.js +5 -3
  302. package/dist/store/agent-body.d.ts +12 -2
  303. package/dist/store/agent-body.js +22 -4
  304. package/dist/store/deadline.d.ts +18 -0
  305. package/dist/store/deadline.js +45 -0
  306. package/dist/store/index.d.ts +2 -2
  307. package/dist/store/index.js +2 -2
  308. package/dist/store/open.d.ts +6 -3
  309. package/dist/store/open.js +2 -2
  310. package/dist/store/postgres/connection.d.ts +22 -2
  311. package/dist/store/postgres/connection.js +211 -41
  312. package/dist/store/postgres/migrate.d.ts +4 -0
  313. package/dist/store/postgres/migrate.js +9 -2
  314. package/dist/store/postgres/migrations/0003_commands_one_answer.check.sql +19 -0
  315. package/dist/store/postgres/migrations/0003_commands_one_answer.sql +13 -0
  316. package/dist/store/postgres/store.d.ts +9 -2
  317. package/dist/store/postgres/store.js +9 -0
  318. package/dist/store/schema.js +1 -1
  319. package/dist/store/seal.js +2 -2
  320. package/dist/store/sqlite/connection.js +14 -5
  321. package/dist/store/sqlite/run-patch.d.ts +3 -0
  322. package/dist/store/sqlite/run-patch.js +3 -0
  323. package/dist/store/sqlite/store.js +41 -12
  324. package/dist/store/store.d.ts +35 -6
  325. package/dist/store/store.js +12 -2
  326. package/dist/store-reads/cap.d.ts +1 -1
  327. package/dist/store-reads/cap.js +22 -4
  328. package/dist/store-reads/journal.d.ts +9 -6
  329. package/dist/store-reads/journal.js +129 -18
  330. package/dist/store-reads/learning.d.ts +82 -8
  331. package/dist/store-reads/learning.js +184 -11
  332. package/dist/store-reads/workflow.d.ts +1 -1
  333. package/dist/store-reads/workflow.js +1 -1
  334. package/dist/store-view.d.ts +19 -1
  335. package/dist/store-view.js +95 -27
  336. package/dist/template-eval.d.ts +60 -4
  337. package/dist/template-eval.js +120 -54
  338. package/dist/templates.d.ts +33 -14
  339. package/dist/templates.js +82 -46
  340. package/dist/timeline/group.d.ts +33 -0
  341. package/dist/timeline/group.js +77 -0
  342. package/dist/timeline/index.d.ts +7 -0
  343. package/dist/timeline/index.js +7 -0
  344. package/dist/timeline/labels.d.ts +79 -0
  345. package/dist/timeline/labels.js +150 -0
  346. package/dist/timeline/origin.d.ts +56 -0
  347. package/dist/timeline/origin.js +92 -0
  348. package/dist/timeline/render-text.d.ts +11 -0
  349. package/dist/timeline/render-text.js +62 -0
  350. package/dist/timeline/timeline.d.ts +282 -0
  351. package/dist/timeline/timeline.js +1308 -0
  352. package/dist/timeline/util.d.ts +17 -0
  353. package/dist/timeline/util.js +49 -0
  354. package/dist/tool-budget.d.ts +18 -0
  355. package/dist/tool-budget.js +50 -0
  356. package/dist/tool-gate.d.ts +47 -218
  357. package/dist/tool-gate.js +87 -545
  358. package/dist/tool-keys-store.d.ts +11 -12
  359. package/dist/tool-keys-store.js +24 -31
  360. package/dist/tool-keys.d.ts +5 -101
  361. package/dist/tool-keys.js +8 -267
  362. package/dist/tool-plane.d.ts +23 -52
  363. package/dist/tool-plane.js +23 -81
  364. package/dist/tool-settings-store.d.ts +1 -2
  365. package/dist/tool-settings-store.js +5 -8
  366. package/dist/tools.d.ts +67 -25
  367. package/dist/tools.js +170 -119
  368. package/dist/trigger-adapter.d.ts +2 -2
  369. package/dist/trigger-targets.d.ts +13 -1
  370. package/dist/trigger-targets.js +31 -1
  371. package/dist/triggers.d.ts +2 -2
  372. package/dist/triggers.js +3 -3
  373. package/dist/turn-end.d.ts +1 -1
  374. package/dist/turn-end.js +1 -1
  375. package/dist/turns.d.ts +0 -6
  376. package/dist/turns.js +0 -19
  377. package/dist/uploads.d.ts +28 -5
  378. package/dist/uploads.js +83 -10
  379. package/dist/usage.d.ts +1 -49
  380. package/dist/usage.js +3 -84
  381. package/dist/validate.d.ts +4 -0
  382. package/dist/validate.js +33 -14
  383. package/dist/webhooks.d.ts +102 -76
  384. package/dist/webhooks.js +266 -233
  385. package/dist/workflow-run.d.ts +114 -0
  386. package/dist/workflow-run.js +144 -0
  387. package/dist/workspace/archil-claim.d.ts +2 -2
  388. package/dist/workspace/archil-claim.js +4 -3
  389. package/dist/workspace/archil-disk.d.ts +10 -1
  390. package/dist/workspace/archil-disk.js +4 -0
  391. package/dist/workspace/archil-exec.d.ts +12 -2
  392. package/dist/workspace/archil-exec.js +16 -0
  393. package/dist/workspace/archil.d.ts +2 -2
  394. package/dist/workspace/archil.js +25 -5
  395. package/dist/workspace/attach.js +2 -0
  396. package/dist/workspace/beneath.d.ts +19 -0
  397. package/dist/workspace/beneath.js +106 -0
  398. package/dist/workspace/computer-deps.d.ts +26 -9
  399. package/dist/workspace/computer-deps.js +144 -43
  400. package/dist/workspace/computer-for-claim.d.ts +17 -14
  401. package/dist/workspace/computer-for-claim.js +99 -26
  402. package/dist/workspace/computer-hold.d.ts +6 -1
  403. package/dist/workspace/computer-hold.js +6 -1
  404. package/dist/workspace/computer-janitor.d.ts +47 -0
  405. package/dist/workspace/computer-janitor.js +182 -0
  406. package/dist/workspace/computer-ledger.d.ts +1 -8
  407. package/dist/workspace/computer-ledger.js +0 -3
  408. package/dist/workspace/computer-providers.d.ts +5 -3
  409. package/dist/workspace/computer-providers.js +11 -9
  410. package/dist/workspace/grep-worker.d.ts +5 -0
  411. package/dist/workspace/grep-worker.js +9 -6
  412. package/dist/workspace/hands.d.ts +5 -2
  413. package/dist/workspace/hands.js +4 -3
  414. package/dist/workspace/index.d.ts +6 -5
  415. package/dist/workspace/index.js +4 -4
  416. package/dist/workspace/local.d.ts +14 -2
  417. package/dist/workspace/local.js +170 -43
  418. package/dist/workspace/paths.js +3 -2
  419. package/dist/workspace/pi-env.d.ts +4 -0
  420. package/dist/workspace/pi-env.js +3 -2
  421. package/dist/workspace/resolve-computer.d.ts +55 -10
  422. package/dist/workspace/resolve-computer.js +66 -14
  423. package/dist/workspace/run-tools.d.ts +15 -31
  424. package/dist/workspace/run-tools.js +19 -30
  425. package/dist/workspace/workspace.d.ts +5 -0
  426. package/dist/workspace-paths.d.ts +0 -17
  427. package/dist/workspace-paths.js +1 -41
  428. package/dist/workspace.d.ts +0 -17
  429. package/dist/workspace.js +4 -110
  430. package/package.json +14 -14
  431. package/skills/agentrun-serve/SKILL.md +1 -1
  432. package/templates/README.md +11 -5
  433. package/templates/code-review/evals/mentions-defused/case.yaml +15 -0
  434. package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +254 -0
  435. package/templates/code-review/evals/mentions-defused/graders/no-pings.md +16 -0
  436. package/templates/code-review/evals/mentions-defused/graders/posted-a-review.md +5 -0
  437. package/templates/code-review/evals/mentions-defused/graders/schema.md +5 -0
  438. package/templates/code-review/evals/mentions-defused/prompt.md +10 -0
  439. package/templates/kyb/evals/clean-public-company/graders/no-opensanctions.md +5 -0
  440. package/templates/kyb/evals/opensanctions-on/case.yaml +5 -0
  441. package/templates/kyb/evals/opensanctions-on/graders/licence-and-evidence.md +18 -0
  442. package/templates/kyb/evals/opensanctions-on/graders/schema.md +5 -0
  443. package/templates/kyb/evals/opensanctions-on/prompt.md +11 -0
  444. package/templates/market-monitor/agent.md +2 -2
  445. package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
  446. package/templates/release-notes/agent.md +11 -0
  447. package/dist/bound-files.d.ts +0 -4
  448. package/dist/bound-files.js +0 -164
  449. package/dist/coding-tools.d.ts +0 -47
  450. package/dist/coding-tools.js +0 -189
  451. package/dist/computer-adb.d.ts +0 -12
  452. package/dist/computer-adb.js +0 -14
  453. package/dist/console/assets/index-Dn0ngwG9.js +0 -535
  454. package/dist/console/assets/index-DvW6Aled.css +0 -1
  455. package/dist/grade.d.ts +0 -63
  456. package/dist/grade.js +0 -150
  457. package/dist/mcp-servers.d.ts +0 -269
  458. package/dist/mcp-servers.js +0 -456
  459. package/dist/packs.d.ts +0 -71
  460. package/dist/packs.js +0 -180
  461. package/dist/sealed-settings.d.ts +0 -60
  462. package/dist/sealed-settings.js +0 -171
  463. package/dist/sessions.d.ts +0 -6
  464. package/dist/sessions.js +0 -109
  465. package/dist/workspace/computer-serves.d.ts +0 -12
  466. package/dist/workspace/computer-serves.js +0 -15
@@ -0,0 +1,282 @@
1
+ import { type LabelFn } from "./labels.js";
2
+ import { type Obj } from "./util.js";
3
+ import { type TriggerSource } from "./origin.js";
4
+ export type TimelineKind = "thinking" | "text_block" | "tool_use" | "tool_result" | "phase" | "subagent_started" | "subagent_progress" | "subagent_completed" | "final_answer" | "error" | "user_message" | "waiting" | "usage"
5
+ /** A workflow decision: a judge's answers or a route's branch (serve's decision rows). */
6
+ | "decision"
7
+ /** Where a run's learning ended: proposed, merged or dropped (serve's learning row). */
8
+ | "learning"
9
+ /** A tool call that waited for a person's approval, after its result's row (serve's tool gate). */
10
+ | "tool_approval_requested";
11
+ /** Grep's public `TimelineEvent` (its 13 fields) plus the open additions, all optional. */
12
+ export type TimelineEvent = {
13
+ id: string;
14
+ timestamp: string;
15
+ created_at: string;
16
+ kind: TimelineKind;
17
+ summary: string | null;
18
+ agent_label: string | null;
19
+ tool_name: string | null;
20
+ tool_use_id: string | null;
21
+ tool_status: "success" | "failed" | null;
22
+ tool_input_preview: string | null;
23
+ tool_result_preview: string | null;
24
+ tool_result_size_bytes: number | null;
25
+ text: string | null;
26
+ /** Log order inside the run; a page sorts by it, never by time. */
27
+ seq?: number;
28
+ conversation_id?: number;
29
+ /** The assistant entry whose calls these are. */
30
+ round?: number;
31
+ /** A nested call's caller, or a subagent's spawning call. */
32
+ parent_tool_use_id?: string;
33
+ /** The browser session a hand-over is about, as a tag; never a URL. */
34
+ session?: string;
35
+ /** The file a "Saved" phase row is about. */
36
+ path?: string;
37
+ /** `server` on the row of a message the server wrote into the run, `trigger` on a trigger's (origin.ts): a `phase` row,
38
+ * which counts, as a person's `user_message` does, as the message its turn took (`isMessageRow`). */
39
+ origin?: "server" | "trigger";
40
+ /** On a trigger's row (`origin: "trigger"`) alone: its trigger, from the message's origin, so a client labels the row
41
+ * by its source without reading its summary. `name`, the trigger's name as it is now, is serve's to add (this
42
+ * projector writes its id): the one the summary shows, so a client drops exactly that prefix, colons and all. */
43
+ trigger?: {
44
+ id: string;
45
+ source: TriggerSource;
46
+ owner: boolean;
47
+ name?: string;
48
+ };
49
+ /** `true` on the server's `phase` row of a spend cap's refusal for room (serve), "Paused at the run's cap", origin
50
+ * server and its id ending NOTE_SUFFIX: the request was not sent and the run paused for a raise; a pause, never a
51
+ * failure, whether the run waits on its cap now or was raised since. */
52
+ paused?: true;
53
+ /** On the usage row, the run's cost. On a paid tool's charge row (a `phase` naming the tool), that charge alone. On a
54
+ * browser call's `tool_use` row, every browser charge booked under that call (BROWSER_CHARGE): its session's time
55
+ * since its last charge, and its release's when it was the session's last call. `requests` is 0 on all but the usage
56
+ * row. `so_far_usd` and `unpriced` (costsofar/1): while `usd` is null, the sum of every charge whose cost is known, and how
57
+ * many charges have no known cost (model requests cut, stopped, still pending or with no price, and paid tool calls
58
+ * charged an unknown amount or cut). Absent when `usd` is known. */
59
+ usage?: {
60
+ usd: number | null;
61
+ requests: number;
62
+ so_far_usd?: number;
63
+ unpriced?: number;
64
+ not_metered?: number;
65
+ };
66
+ /** On a learned workflow call's `tool_result` row (learned_workflow): each of the workflow's nodes that ran, as the
67
+ * workflow DSL ended it, in order (store-reads/journal.ts withLearnedNodes). This projector writes none. */
68
+ learned_nodes?: {
69
+ label: string;
70
+ kind: string;
71
+ status: string;
72
+ duration_ms: number;
73
+ }[];
74
+ };
75
+ /** A pi conversation entry as stored: `pi.assistant`, `pi.tool-result`, a host's own kind. */
76
+ export type EntryLike = {
77
+ kind: string;
78
+ id?: number;
79
+ conversationId?: number;
80
+ model?: readonly Obj[];
81
+ data?: unknown;
82
+ };
83
+ /** A pi `AgentEvent`, as `watchEvents` yields it and `GET /events` serves it. */
84
+ export type AgentEventLike = {
85
+ type: string;
86
+ [key: string]: unknown;
87
+ };
88
+ /** Grep's caps, so a row is the same on both sides. `thinking` cuts the first sentence of a thinking summary. */
89
+ export declare const CAPS: {
90
+ summary: number;
91
+ preview: number;
92
+ text: number;
93
+ thinking: number;
94
+ };
95
+ /** A host's marks of a model request: as it leaves (written before it does), and as its stream ends aborted. A request
96
+ * that answered or failed has a `pi.assistant` entry; one aborted before its first content has none; a start with no
97
+ * end and no entry is in flight when it is the latest, unless the run is settled, and was cut by a crash when a later
98
+ * one followed it or the run settled without it. A cut request's cost is unknown. */
99
+ export declare const REQUEST_STARTED = "agentrun.request_started";
100
+ /** An end with `unsent: true` withdraws its start: the request was refused after its mark, and never left. */
101
+ export declare const REQUEST_ENDED = "agentrun.request_ended";
102
+ /** What a request with no `pi.assistant` entry of its own cost (a side request, marked with a `request` label: pi's
103
+ * compaction summary, `"compaction"`, or a tool's own model request, such as a web search's): `usd`, or null when
104
+ * unknown. It closes that request, as an entry closes a generation's. `failed`: the request failed, and its counts are
105
+ * taken as they are, as a failed answer's are. */
106
+ export declare const REQUEST_COST = "agentrun.request_cost";
107
+ /** A request the host refused before it left (the run was cancelled): pi answers it with an error entry, which is not a
108
+ * request and not a failure to show, so the timeline skips the error entry that answers each refusal. */
109
+ export declare const REQUEST_REFUSED = "agentrun.request_refused";
110
+ /** The key a host sets in a tool result's `details` (which only a reader of the result sees, never the model) when the
111
+ * call was refused before it ran (a gate's deny, a person's): `{ [CALL_REFUSED]: true }`. Its rows read as refused, the
112
+ * call in plain words ("Refused: write deny.md"), never as a call that ran and failed ("Wrote deny.md failed"). */
113
+ export declare const CALL_REFUSED = "agentrun.refused";
114
+ /** Written right after an answer whose cost was not in when it was written (a harness's proxy books a response after
115
+ * answering it): that answer's cost is still to come, as a REQUEST_COST_LATE. Until it comes the cost is unknown. */
116
+ export declare const REQUEST_COST_PENDING = "agentrun.request_cost_pending";
117
+ /** The cost (`usd`, or null when unknown) of an answer written earlier with its cost pending: it closes one pending cost
118
+ * and adds to the run's cost. It is not a request of its own: the answer already counted that. */
119
+ export declare const REQUEST_COST_LATE = "agentrun.request_cost_late";
120
+ /** What a paid tool's call charged, written apart from any request as the tool reports it: `tool` and `charged_by` name
121
+ * it, `usd` is the charge, or null when the call may have charged and did not say how much. It adds to the run's cost,
122
+ * which is then unknown on a null, and shows as a row of its own; it is no model request. The usage row counts paid
123
+ * tool calls by `call`: a call that books several charges (a browser call, and its session's release under it) is one
124
+ * paid tool call, and one charge not priced when any of them is unknown. A browser charge (BROWSER_CHARGE) shows on its
125
+ * call's row instead. */
126
+ export declare const TOOL_COST = "agentrun.tool_cost";
127
+ /** The `tool` of a browser session's charge (serve's browser-cost.ts: `call`, the call it ran under, or for a release the
128
+ * session's last call; `tag`, the session; `conversation`, the browser's conversation). It makes no row: it folds into
129
+ * that call's `tool_use` row, as its `usage`, else into the last browser call charged for its session, else into its
130
+ * conversation's last browser call; only a charge with none of these (its calls compacted away) keeps a row of its own.
131
+ * A charge booked after the row was shown (a release after the answer) changes that row, by its id. */
132
+ export declare const BROWSER_CHARGE = "browser";
133
+ /** The tool whose charge a row carries, for a host that sums a run's paid tools from its rows: a charge row's tool (a
134
+ * `phase` with `usage`), `browser` for a browser step's call row (`tool_name` in BROWSER_STEPS) with its folded charges;
135
+ * undefined for any other row: another tool's call row, whatever it carries, and the usage row. */
136
+ export declare const chargedTool: (row: TimelineEvent) => string | undefined;
137
+ /** The spend cap's wrap-up (serve's cap.ts): the run's model was told once, near its cap, to finish (`words`, what it was
138
+ * told). A row of its own, the server's ("AgentRun: …"); no request, no cost. */
139
+ export declare const CAP_WRAPUP = "agentrun.cap_wrapup";
140
+ /** A tool call with no price, run outside the run's cost and its cap (an MCP tool its owner set no price for): `tool`,
141
+ * `charged_by` and `call` name it. It shows as a row of its own, "not metered", and the usage row counts it
142
+ * (`not_metered`); it is no charge and never makes the cost unknown. */
143
+ export declare const TOOL_UNMETERED = "agentrun.tool_unmetered";
144
+ /** A paid tool's call marked before it is sent (`call`, and `heldUsd`, the most it is held to charge): the TOOL_COST of
145
+ * the same `call` settles it. Unsettled, it is in flight while the run is; once the run is settled it was cut (a crash),
146
+ * and the cost is unknown, as for a cut model request: what it charged no one knows, and its held figure is the cap's
147
+ * bound (serve's cap.ts), never a charge. */
148
+ export declare const TOOL_STARTED = "agentrun.tool_started";
149
+ /** Written right before a `pi.assistant` that continues the answer before it: a call that answer asked for, written once
150
+ * the answer's own entry was already in (a harness reports each call as it runs it, and its host writes an answer at its
151
+ * first call's end). It shows as that answer's, and is no request: no count, no cost, no tokens. */
152
+ export declare const REQUEST_CONTINUED = "agentrun.request_continued";
153
+ /** A host's own step, in its words (`summary`), such as a box waiting for its image: one `phase` row with that summary,
154
+ * cut at CAPS.summary, at `at` (ms) when the host gave the time it happened, else at the time of the log before it. No
155
+ * request, no cost; one without a summary shows nothing. */
156
+ export declare const HOST_PHASE = "agentrun.phase";
157
+ /** Written on the root as a run's process opens to go on with a run its last process left unfinished: `after` is `crash`
158
+ * (that process died holding the run), `server_stop` (it drained as the server stopped) or `runner_lost` (a runner took
159
+ * the run over once the runner holding it, named by `runner`, let its lease run out), `generation` the new process's,
160
+ * `at` when it opened. A phase row of its own, at that time; no request. */
161
+ export declare const RUN_RESUMED = "agentrun.run_resumed";
162
+ /** The end of a turn on another harness (claude-agent, codex), written on a run's root by serve as the turn's last entry:
163
+ * `{ key, status, ... }`. No row. The turn is over, so the next message is the person's next one, never a steer, even
164
+ * when the turn's last entry was a tool's result (a stop that came after it, before the next model request). */
165
+ export declare const TURN_END = "adapter.turn_end";
166
+ export type TimelineOptions = {
167
+ /** For entries and events that carry no conversation id. */
168
+ conversationId?: number;
169
+ agentLabel?: (conversationId: number) => string | null | undefined;
170
+ /** Labels for this call only; `registerLabel` adds them for every call. */
171
+ labels?: Record<string, LabelFn>;
172
+ caps?: Partial<typeof CAPS>;
173
+ /** Nothing is running: a call with no result is interrupted. */
174
+ settled?: boolean;
175
+ /** The run has ended (completed, failed, cancelled): its usage row says its cost ("Cost: …"), never what it has cost
176
+ * "so far". A run settled and not ended (paused, its process let go) keeps "Cost so far". */
177
+ ended?: boolean;
178
+ /** The clock for retry and poll waits; live only. */
179
+ now?: () => number;
180
+ /** How a row names a file path a call gave (`path`, `file_path`) or saved: a host's name for it, such as one relative
181
+ * to its workspace. The entries, the call's arguments and its input preview, are not changed. Default: as given. */
182
+ path?: (path: string) => string;
183
+ /** What a row shows, made safe by the host before the row is cut (its secrets taken out): an error row's summary and
184
+ * text; a tool's whole output and its details before its label, summary and preview are taken from them; each string
185
+ * of a call's arguments where the call is first seen; a thinking block and a text block whole once settled. So a cut
186
+ * never falls inside what it takes out. Default: as given. */
187
+ redact?: (text: string) => string;
188
+ /** What a thinking or text block shows while it streams, given all of it that has streamed so far: the host's redacted
189
+ * prefix of it. A key whose head has streamed but not its tail cannot be found yet, and one a stream wraps is found
190
+ * only in the whole, so the host redacts the whole stream and holds back a tail as long as a key can take; the
191
+ * settled row replaces the live one whole when the block ends. Default: `redact` over the whole stream, with its
192
+ * trailing word held back until whitespace follows it or the block ends. A host that knows its held values should pass
193
+ * this for the full protection: a key a stream wraps with only part of its tail streamed is covered by a held-back
194
+ * tail as long as a key, not by the word holdback. */
195
+ redactLive?: (text: string) => string;
196
+ };
197
+ /** A tool's calls in a run, and how many failed. */
198
+ export type ToolMetrics = {
199
+ calls: number;
200
+ errors: number;
201
+ };
202
+ /** What a run's entries say it used (`runMetricsOf`). Tokens as pi counts them: `input` is the input neither read from
203
+ * nor written to the cache, so the whole input is `input + cacheRead + cacheWrite`. */
204
+ export type RunMetrics = {
205
+ input: number;
206
+ cacheRead: number;
207
+ cacheWrite: number;
208
+ output: number;
209
+ /** Model requests, as the usage row of a run that ended counts them. */
210
+ requests: number;
211
+ /** Of `requests`, those whose tokens are unknown: in no sum. A request cut before its end, a usage with no input or
212
+ * output count, and one that reports no input at all (a writer's zeros for a request it did not measure). */
213
+ unmetered: number;
214
+ /** Requests by `provider/model`; `model` is the one with the most (the first seen of a tie), absent when none names one. */
215
+ models: Record<string, number>;
216
+ model?: string;
217
+ /** By tool name. A call with no result was interrupted: it counts as failed. */
218
+ tools: Record<string, ToolMetrics>;
219
+ };
220
+ /** How runMetricsOf keeps the names a run's entries hold, which a model writes and may make up: each is one the agent
221
+ * store takes (non-empty, at most `max` UTF-16 units, no lone surrogate), the same name always the same key. A longer
222
+ * one is cut to its first `max - 1` units and "…". A run keeps its `kept` busiest tools and models (the first seen of a
223
+ * tie); the rest are summed under `otherTools` or `otherModels`, and a tool result with no name counts under
224
+ * `unnamedTool`. Those three start with one "…", and no entry's name does: one that starts with "…" gets another. */
225
+ export declare const METRIC_NAMES: Readonly<{
226
+ max: 256;
227
+ kept: 100;
228
+ otherTools: "…other tools";
229
+ otherModels: "…other models";
230
+ unnamedTool: "…unnamed tool";
231
+ }>;
232
+ export declare const PAGE_CHANGED_ROW = "The page changed while you had the browser; the agent takes a new look";
233
+ /** The usage row's label: a run that has ended says its cost, one still going (or paused) what it has cost so far. */
234
+ export declare const COST_SO_FAR = "Cost so far";
235
+ export declare const COST_ENDED = "Cost";
236
+ export declare const costLabel: (ended: boolean) => string;
237
+ /** `row` as an ended run's: a usage row made while it ran ("Cost so far: …") says its cost ("Cost: …"); any other row as
238
+ * it is. For a host that keeps rows read before the run ended. */
239
+ export declare function endedUsage<T extends {
240
+ kind: string;
241
+ summary?: string | null;
242
+ }>(row: T): T;
243
+ /** Rows of a stored conversation, in log order. Pure: the same entries give the same rows. */
244
+ export declare function timelineOf(entries: readonly EntryLike[], options?: TimelineOptions): TimelineEvent[];
245
+ /** The id of the call a run's turn ended waiting on a person by, or undefined: its last meaningful row is a successful tool
246
+ * result for a tool that ends its turn (registerTurnEnding — ask_person is serve's). This is the one rule the view reads a
247
+ * run `input_required` on a question by (the waiting row withAsks appends sits right after this same result), so the
248
+ * runner's loop parks on exactly the turn ends the view would call waiting, and the two can never disagree; the id is the
249
+ * call the park entry names. Truthy when it waits, undefined when it does not. */
250
+ export declare function endedOnTurnEndingTool(entries: readonly EntryLike[]): string | undefined;
251
+ /** A workflow's decision receipt as its run's store keeps it (`@parcha/agentrun-pi/durable`'s DecisionRow): the fields
252
+ * runMetricsOf reads. */
253
+ export type DecisionLike = {
254
+ usage?: unknown;
255
+ model?: unknown;
256
+ provider?: unknown;
257
+ status?: unknown;
258
+ driver_spend?: unknown;
259
+ };
260
+ /** What a run that ended used, from the entries of every conversation of its store, in log order (`SELECT record FROM
261
+ * entries ORDER BY id`): its model requests and their tokens, counted as its usage row counts them (a cut request's
262
+ * tokens are unknown), and its tool calls. One parameter, so `.map(runMetricsOf)` is safe. Pure, like timelineOf. */
263
+ export declare function runMetricsOf(records: readonly EntryLike[]): RunMetrics;
264
+ /** runMetricsOf, with a workflow run's decision receipts beside its entries: each a request, its `usage`
265
+ * (`input_tokens`, `output_tokens`) in the token sums, and one with none, or cancelled, unmetered. */
266
+ export declare function runMetricsWithDecisions(records: readonly EntryLike[], decisions: readonly DecisionLike[]): RunMetrics;
267
+ /** Live rows from `watchEvents` batches. Committed entries go through the same projector `timelineOf` uses. */
268
+ export declare function timelineReducer(options?: TimelineOptions): {
269
+ apply: (events: readonly AgentEventLike[]) => {
270
+ rows: TimelineEvent[];
271
+ drop: string[];
272
+ };
273
+ /** Every row now, in log order. */
274
+ rows: () => TimelineEvent[];
275
+ /** The usage row read with nothing in flight, put in place of the live one: for a host whose turn was stopped and is
276
+ * over, so a request it cut counts as a charge with no price, as a settled read counts it. Undefined with no row. */
277
+ idle: () => TimelineEvent | undefined;
278
+ /** Whether `id` is a live row (one the events made: a stream, a wait, a phase), not one a committed entry made.
279
+ * A live row ends when it is gone; a committed one was shown and stays, though a snapshot of a compacted
280
+ * conversation no longer holds it. */
281
+ isLive: (id: string) => boolean;
282
+ };