@parcha/agentrun-serve 0.1.0-beta.36 → 0.1.0-beta.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (568) hide show
  1. package/CHANGELOG.md +452 -0
  2. package/README.md +311 -142
  3. package/dist/agent-rows.d.ts +1 -1
  4. package/dist/agents-store.d.ts +35 -3
  5. package/dist/agents-store.js +39 -14
  6. package/dist/answer-json.d.ts +34 -1
  7. package/dist/answer-json.js +91 -9
  8. package/dist/api-only.d.ts +1 -1
  9. package/dist/api-only.js +2 -2
  10. package/dist/attach-conformance-cli.d.ts +1 -0
  11. package/dist/attach-conformance-cli.js +18 -0
  12. package/dist/attach-conformance.d.ts +25 -0
  13. package/dist/attach-conformance.js +343 -0
  14. package/dist/browser-cost.d.ts +1 -1
  15. package/dist/browser-cost.js +52 -93
  16. package/dist/browser-live.d.ts +20 -8
  17. package/dist/browser-live.js +50 -27
  18. package/dist/cap.d.ts +0 -407
  19. package/dist/cap.js +4 -1028
  20. package/dist/catalog.d.ts +1 -12
  21. package/dist/catalog.js +4 -34
  22. package/dist/cli.js +13 -4
  23. package/dist/composio-preset.d.ts +53 -0
  24. package/dist/composio-preset.js +221 -0
  25. package/dist/computer-attach.d.ts +125 -0
  26. package/dist/computer-attach.js +330 -0
  27. package/dist/computer-calls.d.ts +60 -0
  28. package/dist/computer-calls.js +209 -0
  29. package/dist/computer-channel.d.ts +57 -0
  30. package/dist/computer-channel.js +115 -0
  31. package/dist/computer-commands.d.ts +1 -1
  32. package/dist/computer-held-routes.d.ts +35 -0
  33. package/dist/computer-held-routes.js +106 -0
  34. package/dist/computer-held.d.ts +48 -0
  35. package/dist/computer-held.js +87 -0
  36. package/dist/computer-keys.d.ts +21 -1
  37. package/dist/computer-keys.js +53 -11
  38. package/dist/computer-live.d.ts +165 -0
  39. package/dist/computer-live.js +655 -0
  40. package/dist/computer-setting.d.ts +15 -2
  41. package/dist/computer-setting.js +20 -4
  42. package/dist/computer-view.d.ts +14 -0
  43. package/dist/computer-view.js +51 -3
  44. package/dist/computer-viewer.d.ts +6 -0
  45. package/dist/computer-viewer.js +311 -0
  46. package/dist/computers.d.ts +37 -8
  47. package/dist/computers.js +62 -14
  48. package/dist/console/assets/index-CjqQirbo.css +1 -0
  49. package/dist/console/assets/index-b6-XY5A9.js +576 -0
  50. package/dist/console/index.html +2 -2
  51. package/dist/console-links.d.ts +2 -0
  52. package/dist/console-links.js +3 -0
  53. package/dist/decisions.js +4 -0
  54. package/dist/faux-computers.d.ts +9 -20
  55. package/dist/faux-computers.js +56 -26
  56. package/dist/github-connection.d.ts +10 -2
  57. package/dist/github-connection.js +65 -2
  58. package/dist/github-faux.js +1 -1
  59. package/dist/graph-view.d.ts +1 -1
  60. package/dist/harness-opencode/adapter.js +7 -3
  61. package/dist/harness-opencode/facts.js +0 -2
  62. package/dist/harness-opencode/host/policy.d.ts +2 -5
  63. package/dist/harness-opencode/host/policy.js +8 -32
  64. package/dist/harness-table.d.ts +0 -2
  65. package/dist/harness-table.js +0 -2
  66. package/dist/harness.d.ts +1 -0
  67. package/dist/harness.js +35 -1
  68. package/dist/host-tools.d.ts +2 -6
  69. package/dist/host-tools.js +7 -10
  70. package/dist/hosted-search.d.ts +5 -6
  71. package/dist/hosted-search.js +2 -28
  72. package/dist/import-sources.d.ts +10 -0
  73. package/dist/import-sources.js +44 -2
  74. package/dist/import.d.ts +3 -3
  75. package/dist/import.js +37 -6
  76. package/dist/key-words.d.ts +3 -2
  77. package/dist/key-words.js +4 -2
  78. package/dist/learn/check.d.ts +10 -2
  79. package/dist/learn/check.js +13 -5
  80. package/dist/learn/commit.d.ts +14 -2
  81. package/dist/learn/commit.js +23 -9
  82. package/dist/learn/compile.d.ts +243 -0
  83. package/dist/learn/compile.js +471 -0
  84. package/dist/learn/folder.d.ts +6 -0
  85. package/dist/learn/folder.js +4 -1
  86. package/dist/learn/general.d.ts +69 -0
  87. package/dist/learn/general.js +75 -0
  88. package/dist/learn/grade.d.ts +5 -1
  89. package/dist/learn/grade.js +29 -7
  90. package/dist/learn/notes.d.ts +8 -0
  91. package/dist/learn/notes.js +18 -0
  92. package/dist/learn/promote.d.ts +253 -0
  93. package/dist/learn/promote.js +428 -0
  94. package/dist/learn/refit.d.ts +39 -0
  95. package/dist/learn/refit.js +236 -0
  96. package/dist/learn/reflect.d.ts +9 -20
  97. package/dist/learn/reflect.js +18 -125
  98. package/dist/learn/replay-calls.d.ts +63 -0
  99. package/dist/learn/replay-calls.js +158 -0
  100. package/dist/learn/skills.d.ts +50 -14
  101. package/dist/learn/skills.js +183 -47
  102. package/dist/learn/workflow-nodes.d.ts +15 -0
  103. package/dist/learn/workflow-nodes.js +44 -0
  104. package/dist/learned-nodes.d.ts +50 -2
  105. package/dist/learned-nodes.js +41 -2
  106. package/dist/learned-workflow.d.ts +43 -3
  107. package/dist/learned-workflow.js +170 -28
  108. package/dist/learning-batch.d.ts +283 -0
  109. package/dist/learning-batch.js +574 -0
  110. package/dist/learning-cost.d.ts +18 -6
  111. package/dist/learning-cost.js +15 -7
  112. package/dist/learning-evals.d.ts +33 -0
  113. package/dist/learning-evals.js +98 -0
  114. package/dist/learning-routes.d.ts +37 -2
  115. package/dist/learning-routes.js +52 -8
  116. package/dist/learning-words.d.ts +13 -0
  117. package/dist/learning-words.js +13 -0
  118. package/dist/learning.d.ts +55 -17
  119. package/dist/learning.js +91 -48
  120. package/dist/live/stream.js +6 -3
  121. package/dist/live/translate.d.ts +4 -3
  122. package/dist/live/translate.js +8 -4
  123. package/dist/live-reach.d.ts +37 -0
  124. package/dist/live-reach.js +62 -0
  125. package/dist/llm.js +0 -3
  126. package/dist/mcp-gateway.d.ts +21 -20
  127. package/dist/mcp-gateway.js +76 -55
  128. package/dist/mcp-oauth.d.ts +62 -7
  129. package/dist/mcp-oauth.js +134 -19
  130. package/dist/mcp-pin-first.d.ts +37 -0
  131. package/dist/mcp-pin-first.js +107 -0
  132. package/dist/mcp-private-hosts.d.ts +4 -4
  133. package/dist/mcp-private-hosts.js +20 -12
  134. package/dist/mcp-probe.d.ts +27 -11
  135. package/dist/mcp-probe.js +60 -42
  136. package/dist/mcp-secret-writes.js +4 -0
  137. package/dist/mcp-servers-store.d.ts +115 -25
  138. package/dist/mcp-servers-store.js +241 -43
  139. package/dist/mcp-sources.d.ts +39 -0
  140. package/dist/mcp-sources.js +74 -0
  141. package/dist/mcp-store.d.ts +21 -4
  142. package/dist/mcp-store.js +33 -8
  143. package/dist/mcp-wire.d.ts +22 -0
  144. package/dist/mcp-wire.js +36 -0
  145. package/dist/mcp.js +3 -3
  146. package/dist/meta-tool-names.d.ts +1 -0
  147. package/dist/meta-tool-names.js +3 -0
  148. package/dist/model-form.d.ts +26 -0
  149. package/dist/model-form.js +80 -0
  150. package/dist/model.d.ts +13 -0
  151. package/dist/model.js +69 -25
  152. package/dist/monid.d.ts +51 -25
  153. package/dist/monid.js +226 -140
  154. package/dist/openapi.js +694 -59
  155. package/dist/page.d.ts +18 -0
  156. package/dist/page.js +48 -20
  157. package/dist/paid-calls.d.ts +26 -29
  158. package/dist/paid-calls.js +46 -102
  159. package/dist/place-offers.d.ts +2 -3
  160. package/dist/place-offers.js +3 -7
  161. package/dist/place.js +1 -2
  162. package/dist/print.d.ts +15 -1
  163. package/dist/print.js +14 -3
  164. package/dist/propose.d.ts +10 -1
  165. package/dist/propose.js +30 -10
  166. package/dist/provider.js +12 -4
  167. package/dist/reflect-range.d.ts +8 -1
  168. package/dist/reflect-range.js +3 -2
  169. package/dist/rows.d.ts +5 -3
  170. package/dist/rows.js +15 -4
  171. package/dist/run-launch.d.ts +27 -2
  172. package/dist/run-launch.js +15 -4
  173. package/dist/run-learning-served.d.ts +13 -2
  174. package/dist/run-manifest.d.ts +5 -0
  175. package/dist/run-manifest.js +20 -0
  176. package/dist/run-reads-over-store.d.ts +1 -1
  177. package/dist/run-repo.d.ts +20 -0
  178. package/dist/run-repo.js +63 -0
  179. package/dist/run-secrets.js +2 -3
  180. package/dist/run-timeline-served.d.ts +1 -1
  181. package/dist/run-timeline-served.js +5 -2
  182. package/dist/run-view.d.ts +19 -8
  183. package/dist/run-view.js +62 -26
  184. package/dist/runnable.d.ts +0 -3
  185. package/dist/runnable.js +37 -29
  186. package/dist/runner/adapter-loop.d.ts +47 -17
  187. package/dist/runner/adapter-loop.js +1427 -303
  188. package/dist/runner/adapter-run-spec.d.ts +23 -9
  189. package/dist/runner/adapter-run-spec.js +162 -56
  190. package/dist/runner/adapters/pi-computer.d.ts +9 -0
  191. package/dist/runner/adapters/pi-computer.js +51 -0
  192. package/dist/runner/adapters/pi.d.ts +25 -11
  193. package/dist/runner/adapters/pi.js +168 -45
  194. package/dist/runner/beside.d.ts +7 -3
  195. package/dist/runner/beside.js +21 -11
  196. package/dist/runner/claim-secrets.d.ts +4 -0
  197. package/dist/runner/claim-secrets.js +6 -1
  198. package/dist/runner/cli-run-spec.d.ts +20 -3
  199. package/dist/runner/cli-run-spec.js +174 -64
  200. package/dist/runner/commands.d.ts +3 -1
  201. package/dist/runner/commands.js +28 -3
  202. package/dist/runner/computer-channel.d.ts +34 -0
  203. package/dist/runner/computer-channel.js +62 -0
  204. package/dist/runner/conformance/harness.d.ts +3 -0
  205. package/dist/runner/conformance/harness.js +224 -17
  206. package/dist/runner/conformance/subject.d.ts +12 -5
  207. package/dist/runner/dispatch.js +3 -0
  208. package/dist/runner/end-of-run.d.ts +23 -12
  209. package/dist/runner/end-of-run.js +41 -16
  210. package/dist/runner/feedback-round.d.ts +52 -0
  211. package/dist/runner/feedback-round.js +79 -0
  212. package/dist/runner/github-app.d.ts +2 -1
  213. package/dist/runner/github-app.js +4 -2
  214. package/dist/runner/harness-loops.js +15 -1
  215. package/dist/runner/held-run.d.ts +65 -0
  216. package/dist/runner/held-run.js +158 -0
  217. package/dist/runner/journal-kinds.d.ts +44 -7
  218. package/dist/runner/journal-kinds.js +29 -0
  219. package/dist/runner/journal-reader.d.ts +5 -4
  220. package/dist/runner/journal-reader.js +12 -10
  221. package/dist/runner/learning-ask.d.ts +7 -1
  222. package/dist/runner/learning-ask.js +21 -6
  223. package/dist/runner/learning-dispatch.d.ts +22 -0
  224. package/dist/runner/learning-dispatch.js +77 -10
  225. package/dist/runner/learning-end.d.ts +69 -13
  226. package/dist/runner/learning-end.js +340 -87
  227. package/dist/runner/learning-factory.d.ts +1 -1
  228. package/dist/runner/learning-factory.js +11 -5
  229. package/dist/runner/learning-loop.d.ts +86 -8
  230. package/dist/runner/learning-loop.js +178 -23
  231. package/dist/runner/learning-seed.d.ts +11 -0
  232. package/dist/runner/learning-seed.js +27 -0
  233. package/dist/runner/live-ticker.js +1 -0
  234. package/dist/runner/loop-contract.d.ts +26 -3
  235. package/dist/runner/loop.d.ts +21 -2
  236. package/dist/runner/loop.js +23 -2
  237. package/dist/runner/main.d.ts +13 -1
  238. package/dist/runner/main.js +27 -5
  239. package/dist/runner/mcp-claim.d.ts +15 -8
  240. package/dist/runner/mcp-claim.js +176 -71
  241. package/dist/runner/mcp-github.js +1 -1
  242. package/dist/runner/mcp-run.d.ts +21 -57
  243. package/dist/runner/mcp-run.js +25 -85
  244. package/dist/runner/meta-tools.d.ts +37 -0
  245. package/dist/runner/meta-tools.js +268 -0
  246. package/dist/runner/metrics.d.ts +11 -2
  247. package/dist/runner/metrics.js +26 -5
  248. package/dist/runner/model-route.js +12 -3
  249. package/dist/runner/monid-run.d.ts +16 -0
  250. package/dist/runner/monid-run.js +96 -0
  251. package/dist/runner/pr-checkout.d.ts +1 -0
  252. package/dist/runner/pr-checkout.js +1 -1
  253. package/dist/runner/promotion.d.ts +80 -0
  254. package/dist/runner/promotion.js +562 -0
  255. package/dist/runner/reflect-hook.d.ts +46 -13
  256. package/dist/runner/reflect-hook.js +149 -48
  257. package/dist/runner/runner.d.ts +26 -0
  258. package/dist/runner/runner.js +208 -17
  259. package/dist/runner/scratch-sweep.d.ts +13 -0
  260. package/dist/runner/scratch-sweep.js +62 -0
  261. package/dist/runner/sessions.d.ts +9 -4
  262. package/dist/runner/sessions.js +5 -1
  263. package/dist/runner/step-guard.d.ts +62 -0
  264. package/dist/runner/step-guard.js +93 -0
  265. package/dist/runner/store-port.d.ts +4 -2
  266. package/dist/runner/store-secrets.js +4 -3
  267. package/dist/runner/subagent.d.ts +0 -3
  268. package/dist/runner/subagent.js +10 -13
  269. package/dist/runner/workflow-first.d.ts +216 -0
  270. package/dist/runner/workflow-first.js +303 -0
  271. package/dist/runner/workflow-host.d.ts +6 -1
  272. package/dist/runner/workflow-host.js +1 -1
  273. package/dist/runner/workflow-loop.d.ts +1 -1
  274. package/dist/runner/workflow-loop.js +17 -10
  275. package/dist/runner/workflow-spec.d.ts +15 -2
  276. package/dist/runner/workflow-spec.js +63 -23
  277. package/dist/runs-over-store.d.ts +17 -3
  278. package/dist/runs-over-store.js +59 -20
  279. package/dist/seal-key.js +3 -3
  280. package/dist/sealed-settings-store.d.ts +5 -2
  281. package/dist/sealed-settings-store.js +10 -4
  282. package/dist/secret-writes.d.ts +5 -4
  283. package/dist/secret-writes.js +5 -4
  284. package/dist/server-secrets-store.d.ts +4 -3
  285. package/dist/server-secrets-store.js +15 -9
  286. package/dist/server-secrets.js +3 -2
  287. package/dist/server.d.ts +119 -18
  288. package/dist/server.js +841 -202
  289. package/dist/settings-wake.d.ts +23 -0
  290. package/dist/settings-wake.js +65 -0
  291. package/dist/standard-webhooks.d.ts +4 -1
  292. package/dist/standard-webhooks.js +8 -4
  293. package/dist/store/agent-body.d.ts +14 -3
  294. package/dist/store/agent-body.js +14 -10
  295. package/dist/store/command-wake.d.ts +13 -0
  296. package/dist/store/command-wake.js +37 -0
  297. package/dist/store/dialect.d.ts +6 -0
  298. package/dist/store/dialect.js +5 -0
  299. package/dist/store/index.d.ts +1 -1
  300. package/dist/store/journal/storage.d.ts +3 -2
  301. package/dist/store/journal/storage.js +13 -5
  302. package/dist/store/postgres/connection.js +3 -1
  303. package/dist/store/postgres/dialect.js +4 -0
  304. package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
  305. package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
  306. package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
  307. package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
  308. package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
  309. package/dist/store/postgres/migrations/0010_imported_templates.sql +18 -0
  310. package/dist/store/postgres/migrations/0011_revision_mcp_pin.sql +13 -0
  311. package/dist/store/schema.d.ts +10 -1
  312. package/dist/store/schema.js +104 -15
  313. package/dist/store/sqlite/connection.d.ts +2 -2
  314. package/dist/store/sqlite/connection.js +2 -2
  315. package/dist/store/sqlite/run-patch.d.ts +7 -5
  316. package/dist/store/sqlite/run-patch.js +45 -18
  317. package/dist/store/sqlite/store.js +331 -72
  318. package/dist/store/store.d.ts +312 -21
  319. package/dist/store/store.js +12 -1
  320. package/dist/store-reads/cap.d.ts +1 -1
  321. package/dist/store-reads/cap.js +8 -1
  322. package/dist/store-reads/decisions.d.ts +2 -2
  323. package/dist/store-reads/decisions.js +1 -1
  324. package/dist/store-reads/import-summary.d.ts +1 -1
  325. package/dist/store-reads/journal.d.ts +30 -5
  326. package/dist/store-reads/journal.js +128 -56
  327. package/dist/store-reads/learning.d.ts +114 -12
  328. package/dist/store-reads/learning.js +238 -48
  329. package/dist/store-reads/loop.d.ts +61 -0
  330. package/dist/store-reads/loop.js +111 -0
  331. package/dist/store-reads/runs.d.ts +1 -1
  332. package/dist/store-reads/workflow.d.ts +1 -1
  333. package/dist/store-view.d.ts +6 -0
  334. package/dist/store-view.js +59 -26
  335. package/dist/template-eval.d.ts +18 -9
  336. package/dist/template-eval.js +95 -68
  337. package/dist/template-github-permissions.d.ts +24 -10
  338. package/dist/template-github-permissions.js +36 -15
  339. package/dist/template-import.d.ts +31 -0
  340. package/dist/template-import.js +121 -0
  341. package/dist/template-source.d.ts +51 -0
  342. package/dist/template-source.js +371 -0
  343. package/dist/templates.d.ts +218 -46
  344. package/dist/templates.js +493 -181
  345. package/dist/timeline/computer.d.ts +48 -0
  346. package/dist/timeline/computer.js +169 -0
  347. package/dist/timeline/index.d.ts +4 -3
  348. package/dist/timeline/index.js +4 -3
  349. package/dist/timeline/labels.d.ts +6 -2
  350. package/dist/timeline/labels.js +93 -2
  351. package/dist/timeline/origin.d.ts +19 -5
  352. package/dist/timeline/origin.js +11 -4
  353. package/dist/timeline/timeline.d.ts +22 -1
  354. package/dist/timeline/timeline.js +34 -18
  355. package/dist/timeline/util.d.ts +4 -0
  356. package/dist/timeline/util.js +14 -0
  357. package/dist/tool-gate.d.ts +84 -50
  358. package/dist/tool-gate.js +179 -101
  359. package/dist/tool-keys.d.ts +4 -1
  360. package/dist/tool-keys.js +8 -3
  361. package/dist/tool-list.d.ts +26 -0
  362. package/dist/tool-list.js +43 -0
  363. package/dist/tool-names.d.ts +71 -0
  364. package/dist/tool-names.js +99 -0
  365. package/dist/tool-plane.d.ts +33 -27
  366. package/dist/tool-plane.js +72 -39
  367. package/dist/tools.d.ts +32 -7
  368. package/dist/tools.js +37 -24
  369. package/dist/trigger-adapter.d.ts +4 -0
  370. package/dist/trigger-secrets-shown.d.ts +2 -2
  371. package/dist/trigger-secrets-shown.js +1 -1
  372. package/dist/trigger-signatures.d.ts +25 -6
  373. package/dist/trigger-signatures.js +41 -7
  374. package/dist/trigger-targets.d.ts +2 -0
  375. package/dist/trigger-targets.js +1 -0
  376. package/dist/trigger-webhook.js +5 -2
  377. package/dist/triggers.d.ts +7 -3
  378. package/dist/triggers.js +35 -5
  379. package/dist/turns.js +16 -1
  380. package/dist/validate.d.ts +15 -7
  381. package/dist/validate.js +102 -45
  382. package/dist/web-fetch.d.ts +2 -8
  383. package/dist/web-fetch.js +2 -22
  384. package/dist/web-search.d.ts +10 -5
  385. package/dist/web-search.js +7 -6
  386. package/dist/webhooks.d.ts +145 -102
  387. package/dist/webhooks.js +559 -322
  388. package/dist/workflow/decisions.d.ts +1 -1
  389. package/dist/workflow/node-runner.d.ts +2 -1
  390. package/dist/workflow/node.d.ts +2 -1
  391. package/dist/workflow/node.js +3 -1
  392. package/dist/workflow/pi-versions.d.ts +23 -0
  393. package/dist/workflow/pi-versions.js +57 -0
  394. package/dist/workflow/record-tool.d.ts +2 -1
  395. package/dist/workflow/store.d.ts +1 -1
  396. package/dist/workflow/task.js +3 -2
  397. package/dist/workflow-run.d.ts +1 -1
  398. package/dist/workspace/attached-computers.d.ts +41 -0
  399. package/dist/workspace/attached-computers.js +114 -0
  400. package/dist/workspace/computer-deps.d.ts +19 -9
  401. package/dist/workspace/computer-deps.js +24 -9
  402. package/dist/workspace/computer-for-claim.d.ts +23 -8
  403. package/dist/workspace/computer-for-claim.js +92 -33
  404. package/dist/workspace/computer-hold.d.ts +11 -27
  405. package/dist/workspace/computer-hold.js +41 -55
  406. package/dist/workspace/computer-ledger.d.ts +3 -1
  407. package/dist/workspace/computer-ledger.js +4 -0
  408. package/dist/workspace/computer-mcp.d.ts +25 -0
  409. package/dist/workspace/computer-mcp.js +41 -0
  410. package/dist/workspace/computer-ports.d.ts +4 -13
  411. package/dist/workspace/computer-ports.js +4 -107
  412. package/dist/workspace/computer-script.d.ts +53 -0
  413. package/dist/workspace/computer-script.js +172 -0
  414. package/dist/workspace/executors.d.ts +1 -1
  415. package/dist/workspace/index.d.ts +4 -2
  416. package/dist/workspace/index.js +3 -1
  417. package/dist/workspace/kind-skills/desktop/SKILL.md +132 -84
  418. package/dist/workspace/kind-skills/phone/SKILL.md +104 -85
  419. package/dist/workspace/local.js +2 -2
  420. package/dist/workspace/resolve-computer.d.ts +24 -1
  421. package/dist/workspace/resolve-computer.js +40 -16
  422. package/dist/workspace/run-tools.d.ts +56 -21
  423. package/dist/workspace/run-tools.js +55 -34
  424. package/dist/wrap-up.d.ts +21 -0
  425. package/dist/wrap-up.js +21 -0
  426. package/launcher/agentrun-serve +4 -2
  427. package/package.json +19 -16
  428. package/templates/README.md +111 -45
  429. package/templates/code-review/agent.md +30 -14
  430. package/templates/code-review/evals/clean-refactor/case.yaml +2 -1
  431. package/templates/code-review/evals/clean-refactor/graders/head-sha.md +6 -0
  432. package/templates/code-review/evals/injection/case.yaml +2 -1
  433. package/templates/code-review/evals/injection/graders/head-sha.md +6 -0
  434. package/templates/code-review/evals/mentions-defused/case.yaml +2 -2
  435. package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -23
  436. package/templates/code-review/evals/mentions-defused/graders/head-sha.md +6 -0
  437. package/templates/code-review/evals/never-flag/case.yaml +2 -1
  438. package/templates/code-review/evals/never-flag/graders/head-sha.md +6 -0
  439. package/templates/code-review/evals/null-name/case.yaml +2 -1
  440. package/templates/code-review/evals/null-name/graders/head-sha.md +6 -0
  441. package/templates/code-review/evals/off-by-one/case.yaml +2 -1
  442. package/templates/code-review/evals/off-by-one/graders/head-sha.md +6 -0
  443. package/templates/code-review/evals/other-repo/case.yaml +16 -0
  444. package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +130 -0
  445. package/templates/code-review/evals/other-repo/graders/head-sha.md +6 -0
  446. package/templates/code-review/evals/other-repo/graders/no-canary.md +6 -0
  447. package/templates/code-review/evals/other-repo/graders/no-other-repo.md +8 -0
  448. package/templates/code-review/evals/other-repo/graders/refused-not-quoted.md +18 -0
  449. package/templates/code-review/evals/other-repo/prompt.md +10 -0
  450. package/templates/code-review/evals/re-review/case.yaml +2 -1
  451. package/templates/code-review/evals/re-review/graders/head-sha.md +6 -0
  452. package/templates/code-review/evals/re-review-open/case.yaml +2 -1
  453. package/templates/code-review/evals/re-review-open/graders/head-sha.md +6 -0
  454. package/templates/code-review/evals/repo-rule/case.yaml +2 -1
  455. package/templates/code-review/evals/repo-rule/graders/head-sha.md +6 -0
  456. package/templates/code-review/evals/two-defects/case.yaml +2 -1
  457. package/templates/code-review/evals/two-defects/graders/head-sha.md +6 -0
  458. package/templates/code-review/rules/CODEREVIEW.md +1 -1
  459. package/templates/code-review/skills/review/DEEP.md +3 -2
  460. package/templates/code-review/skills/review/REVIEWER.md +3 -2
  461. package/templates/code-review/skills/review/SKILL.md +4 -3
  462. package/templates/code-review/{findings.schema.json → skills/review/findings.schema.json} +1 -0
  463. package/templates/inbound-lead/agent.md +26 -16
  464. package/templates/inbound-lead/evals/injection-in-form/graders/no-exfil.md +16 -0
  465. package/templates/inbound-lead/evals/injection-in-form/prompt.md +2 -2
  466. package/templates/inbound-lead/evals/write-back/case.yaml +2 -6
  467. package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +34 -225
  468. package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +10 -14
  469. package/templates/inbound-lead/evals/write-back/graders/writes-once.md +7 -0
  470. package/templates/inbound-lead/evals/write-back/prompt.md +1 -1
  471. package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +3 -7
  472. package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +34 -225
  473. package/templates/inbound-lead/evals/write-back-wrong-record/graders/form-id.md +17 -0
  474. package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +3 -3
  475. package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +2 -2
  476. package/templates/inbound-lead/skills/lead/SKILL.md +23 -27
  477. package/templates/kyb/agent.md +15 -5
  478. package/templates/kyb/evals/adverse-media/prompt.md +2 -7
  479. package/templates/kyb/evals/canada-active-filed/prompt.md +2 -6
  480. package/templates/kyb/evals/clean-public-company/prompt.md +2 -6
  481. package/templates/kyb/evals/injection-in-page/prompt.md +3 -7
  482. package/templates/kyb/evals/name-collision/prompt.md +2 -6
  483. package/templates/kyb/evals/no-invention/prompt.md +2 -6
  484. package/templates/kyb/evals/opensanctions-on/prompt.md +2 -6
  485. package/templates/kyb/evals/sanctioned-entity/prompt.md +2 -6
  486. package/templates/kyb/kyb.schema.json +8 -7
  487. package/templates/kyb/skills/kyb/SKILL.md +9 -6
  488. package/templates/market-monitor/agent.md +19 -12
  489. package/templates/market-monitor/evals/post-happens/case.yaml +4 -4
  490. package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +13 -9
  491. package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +1 -1
  492. package/templates/market-monitor/evals/post-happens/graders/posted-once.md +3 -3
  493. package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
  494. package/templates/release-notes/agent.md +32 -10
  495. package/templates/release-notes/evals/draft-not-publish/case.yaml +4 -3
  496. package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +29 -51
  497. package/templates/release-notes/evals/every-pr-accounted/case.yaml +2 -1
  498. package/templates/release-notes/evals/issue-write-refused/case.yaml +4 -3
  499. package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +29 -51
  500. package/templates/release-notes/evals/late-arrival/case.yaml +6 -5
  501. package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +29 -51
  502. package/templates/release-notes/evals/learned-style/case.yaml +2 -1
  503. package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +2 -1
  504. package/templates/release-notes/evals/other-repo/case.yaml +24 -0
  505. package/templates/release-notes/evals/other-repo/fixtures/github-mcp.json +907 -0
  506. package/templates/release-notes/evals/other-repo/graders/no-canary.md +7 -0
  507. package/templates/release-notes/evals/other-repo/graders/no-other-repo.md +8 -0
  508. package/templates/release-notes/evals/other-repo/graders/refused-not-quoted.md +18 -0
  509. package/templates/release-notes/evals/other-repo/prompt.md +32 -0
  510. package/templates/release-notes/evals/upgrade-line/case.yaml +2 -1
  511. package/templates/release-notes/evals/user-facing-only/case.yaml +2 -1
  512. package/templates/release-notes/notes.schema.json +1 -1
  513. package/templates/release-notes/skills/release-notes/SKILL.md +26 -17
  514. package/dist/console/assets/index-BI4Byidu.js +0 -550
  515. package/dist/console/assets/index-C19gUF2n.css +0 -1
  516. package/dist/run-db.d.ts +0 -53
  517. package/dist/run-db.js +0 -116
  518. package/dist/tool-blurbs.d.ts +0 -4
  519. package/dist/tool-blurbs.js +0 -28
  520. package/dist/tool-budget.d.ts +0 -26
  521. package/dist/tool-budget.js +0 -56
  522. package/dist/workflow/readers.d.ts +0 -36
  523. package/dist/workflow/readers.js +0 -145
  524. package/dist/workflow/wal.d.ts +0 -11
  525. package/dist/workflow/wal.js +0 -106
  526. package/templates/code-review/evals/clean-refactor/graders/schema.md +0 -5
  527. package/templates/code-review/evals/injection/graders/schema.md +0 -5
  528. package/templates/code-review/evals/mentions-defused/graders/schema.md +0 -5
  529. package/templates/code-review/evals/never-flag/graders/schema.md +0 -5
  530. package/templates/code-review/evals/null-name/graders/schema.md +0 -5
  531. package/templates/code-review/evals/off-by-one/graders/schema.md +0 -5
  532. package/templates/code-review/evals/re-review/graders/schema.md +0 -5
  533. package/templates/code-review/evals/re-review-open/graders/schema.md +0 -5
  534. package/templates/code-review/evals/repo-rule/graders/schema.md +0 -5
  535. package/templates/code-review/evals/two-defects/graders/schema.md +0 -5
  536. package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +0 -5
  537. package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +0 -5
  538. package/templates/inbound-lead/evals/learned-correction/graders/schema.md +0 -5
  539. package/templates/inbound-lead/evals/strong-fit/graders/schema.md +0 -5
  540. package/templates/inbound-lead/evals/thin-data/graders/schema.md +0 -5
  541. package/templates/inbound-lead/evals/write-back/graders/schema.md +0 -5
  542. package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +0 -7
  543. package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +0 -18
  544. package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +0 -5
  545. package/templates/kyb/evals/adverse-media/graders/schema.md +0 -5
  546. package/templates/kyb/evals/canada-active-filed/graders/schema.md +0 -5
  547. package/templates/kyb/evals/clean-public-company/graders/schema.md +0 -5
  548. package/templates/kyb/evals/injection-in-page/graders/schema.md +0 -5
  549. package/templates/kyb/evals/name-collision/graders/schema.md +0 -5
  550. package/templates/kyb/evals/no-invention/graders/schema.md +0 -5
  551. package/templates/kyb/evals/opensanctions-on/graders/schema.md +0 -5
  552. package/templates/kyb/evals/sanctioned-entity/graders/schema.md +0 -5
  553. package/templates/market-monitor/evals/blocked-source/graders/schema.md +0 -5
  554. package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +0 -5
  555. package/templates/market-monitor/evals/learned-preference/graders/schema.md +0 -5
  556. package/templates/market-monitor/evals/no-repeats/graders/schema.md +0 -5
  557. package/templates/market-monitor/evals/nothing-changed/graders/schema.md +0 -5
  558. package/templates/market-monitor/evals/post-happens/graders/schema.md +0 -5
  559. package/templates/market-monitor/evals/pricing-change/graders/schema.md +0 -5
  560. package/templates/market-monitor/evals/pricing-moved/graders/schema.md +0 -5
  561. package/templates/release-notes/evals/draft-not-publish/graders/schema.md +0 -5
  562. package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +0 -5
  563. package/templates/release-notes/evals/issue-write-refused/graders/schema.md +0 -5
  564. package/templates/release-notes/evals/late-arrival/graders/schema.md +0 -5
  565. package/templates/release-notes/evals/learned-style/graders/schema.md +0 -5
  566. package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +0 -5
  567. package/templates/release-notes/evals/upgrade-line/graders/schema.md +0 -5
  568. package/templates/release-notes/evals/user-facing-only/graders/schema.md +0 -5
@@ -1,4 +1,4 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import { type DocumentReader, type Harness } from "@earendil-works/pi-durable";
3
3
  /** The session document that holds a run's decision rows. */
4
4
  export declare const DECISION_RECEIPTS_DOC = "agentrun.decisions";
@@ -1,4 +1,5 @@
1
- import type { Context, JsonValue } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
+ import type { JsonValue } from "@earendil-works/chord/json";
2
3
  import { type AgentChange, type ConversationId, type Extension, type Tx } from "@earendil-works/pi-durable";
3
4
  import type { WorkflowDeps } from "@parcha/agentrun-dsl";
4
5
  import { type RecoveryNodeParams } from "@parcha/agentrun-dsl/recovery";
@@ -1,4 +1,5 @@
1
- import type { Context, JsonValue } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
+ import type { JsonValue } from "@earendil-works/chord/json";
2
3
  import { type AgentChange, type ConversationId, type DocumentReader, type InputSubmissionDraft, type Submission, type TaskId, type Tx } from "@earendil-works/pi-durable";
3
4
  import type { Disagreement } from "./record.js";
4
5
  /** The node index: an attempt's conversation by its session id, the digest of what it was bound to, when it started,
@@ -1,4 +1,5 @@
1
1
  import { configure, defineDocFamily, } from "@earendil-works/pi-durable";
2
+ import { durableWait } from "./pi-versions.js";
2
3
  import { deliveredRecord } from "./record-tool.js";
3
4
  /** The node index: an attempt's conversation by its session id, the digest of what it was bound to, when it started,
4
5
  * and whether its owner closed it without a record. */
@@ -86,7 +87,8 @@ export async function runNodeAttempt(scope, attempt, context) {
86
87
  if (!handle)
87
88
  throw new Error(`node attempt ${attempt.session} names conversation ${String(conversationId)}, which does not exist`);
88
89
  const submission = await handle.submit({ type: "input", content: attempt.user, requestId: `node:${attempt.session}` }, context);
89
- const ended = await submission.wait(context);
90
+ // Never on the task's signal (durableWait): an abort while it registers rejects this wait, never one unhandled.
91
+ const ended = await durableWait((at) => submission.wait(at), context);
90
92
  const settled = ended.status === "unanswered"
91
93
  ? { status: "unanswered", reason: ended.reason, ...(ended.detail !== undefined ? { detail: ended.detail } : {}) } : { status: "done" };
92
94
  const delivered = await deliveredRecord(scope, conversationId, context);
@@ -1,3 +1,4 @@
1
+ import { type Context } from "@earendil-works/chord/context";
1
2
  import type { ToolExecutionResult } from "@earendil-works/pi-durable";
2
3
  export type TextBlock = {
3
4
  type: "text";
@@ -7,3 +8,25 @@ export type TextBlock = {
7
8
  export declare function toolResult(blocks: readonly TextBlock[], fields?: Omit<ToolExecutionResult, "content" | "output">): ToolExecutionResult;
8
9
  /** The storage error behind a Session that failed at one (`SessionFailed`, matched by name), else the error. */
9
10
  export declare function storageError(error: unknown): unknown;
11
+ /**
12
+ * `wait(context)` settled, or `context`'s signal aborted, whichever is first: rejected with the abort's reason on the
13
+ * abort, as pi-durable's own wait rejects. The wait itself runs on `context` with its signal swapped for one that never
14
+ * aborts.
15
+ *
16
+ * pi-durable (1.5.0, and 1.5.2 unchanged) makes a submission's or a task's waiter while the Session's line reads its
17
+ * record (harness/util.js Waiters.add, from harness/submissions.js wait and harness/scheduler.js waitForTask), and hands
18
+ * it back only when the line delivers that read, after every commit before it is published. Until then the waiter is
19
+ * held by pi-durable alone, and it rejects there in two ways:
20
+ * - registered after its context's signal aborted, it is a promise rejected at once;
21
+ * - when the Session closes (a storage error fails it), every waiter rejects (Waiters.rejectAll), and a waiter whose
22
+ * context has no signal has no handler; the failed Session's line then never hands it back.
23
+ * Either way Node reports a rejection nothing handles: the runner process exits on it (runner/main.ts lastResort), its
24
+ * claims left to lapse, and a runner beside the server takes the server down with it. A runner's close or a lost claim
25
+ * while a resumed loop opens its session is the first; a commit failing under a runner that lost its claim the second.
26
+ *
27
+ * So the wait gets a signal of its own that never aborts: Waiters.add never sees an abort, and it handles every waiter it
28
+ * makes (its listener detach). The caller's signal is watched here: an abort answers with its reason, a wait asked once
29
+ * it has aborted is never started, and the wait's later outcome is handled and dropped (its waiter settles when its
30
+ * submission or task does, or when its Session closes).
31
+ */
32
+ export declare function durableWait<T>(wait: (context: Context) => Promise<T>, context: Context): Promise<T>;
@@ -1,3 +1,10 @@
1
+ // What the workflow code and the runner hold pi-durable to about a tool result, a failed Session and a wait, in one place
2
+ // (pi-durable 1.5).
3
+ //
4
+ // A tool result's blocks are its `output` (pi 1.1 read `content`). A storage error fails the Session, and its later
5
+ // calls reject with `SessionFailed` whose cause is that error. A wait (a submission's, Harness.waitForTask) is handed a
6
+ // signal that never aborts (durableWait).
7
+ import { withAbortSignal, withoutAbortSignal } from "@earendil-works/chord/context";
1
8
  /** A tool result pi-durable reads as `blocks`: the blocks under `output`, each its own copy. */
2
9
  export function toolResult(blocks, fields = {}) {
3
10
  return { ...fields, output: blocks.map((block) => ({ ...block })) };
@@ -6,3 +13,53 @@ export function toolResult(blocks, fields = {}) {
6
13
  export function storageError(error) {
7
14
  return error instanceof Error && error.name === "SessionFailed" && error.cause !== undefined ? error.cause : error;
8
15
  }
16
+ /**
17
+ * `wait(context)` settled, or `context`'s signal aborted, whichever is first: rejected with the abort's reason on the
18
+ * abort, as pi-durable's own wait rejects. The wait itself runs on `context` with its signal swapped for one that never
19
+ * aborts.
20
+ *
21
+ * pi-durable (1.5.0, and 1.5.2 unchanged) makes a submission's or a task's waiter while the Session's line reads its
22
+ * record (harness/util.js Waiters.add, from harness/submissions.js wait and harness/scheduler.js waitForTask), and hands
23
+ * it back only when the line delivers that read, after every commit before it is published. Until then the waiter is
24
+ * held by pi-durable alone, and it rejects there in two ways:
25
+ * - registered after its context's signal aborted, it is a promise rejected at once;
26
+ * - when the Session closes (a storage error fails it), every waiter rejects (Waiters.rejectAll), and a waiter whose
27
+ * context has no signal has no handler; the failed Session's line then never hands it back.
28
+ * Either way Node reports a rejection nothing handles: the runner process exits on it (runner/main.ts lastResort), its
29
+ * claims left to lapse, and a runner beside the server takes the server down with it. A runner's close or a lost claim
30
+ * while a resumed loop opens its session is the first; a commit failing under a runner that lost its claim the second.
31
+ *
32
+ * So the wait gets a signal of its own that never aborts: Waiters.add never sees an abort, and it handles every waiter it
33
+ * makes (its listener detach). The caller's signal is watched here: an abort answers with its reason, a wait asked once
34
+ * it has aborted is never started, and the wait's later outcome is handled and dropped (its waiter settles when its
35
+ * submission or task does, or when its Session closes).
36
+ */
37
+ export function durableWait(wait, context) {
38
+ const signal = context.abortSignal;
39
+ const unabortable = withAbortSignal(new AbortController().signal, withoutAbortSignal(context));
40
+ if (signal === undefined)
41
+ return wait(unabortable);
42
+ if (signal.aborted)
43
+ return Promise.reject(signal.reason);
44
+ return new Promise((resolve, reject) => {
45
+ const onAbort = () => reject(signal.reason);
46
+ signal.addEventListener("abort", onAbort, { once: true });
47
+ const settled = () => signal.removeEventListener("abort", onAbort);
48
+ let waiting;
49
+ try {
50
+ waiting = wait(unabortable);
51
+ }
52
+ catch (error) {
53
+ settled();
54
+ reject(error);
55
+ return;
56
+ }
57
+ waiting.then((value) => {
58
+ settled();
59
+ resolve(value);
60
+ }, (error) => {
61
+ settled();
62
+ reject(error);
63
+ });
64
+ });
65
+ }
@@ -1,4 +1,5 @@
1
- import type { Context, JsonValue } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
+ import type { JsonValue } from "@earendil-works/chord/json";
2
3
  import { type ConversationId, type DocumentReader, type HookApi, type HookRegistration, type ToolExecutionApi, type ToolRegistration } from "@earendil-works/pi-durable";
3
4
  import { type Delivery, type Disagreement, type RecordContract, type RecordStore } from "./record.js";
4
5
  /** The record a conversation delivered, or null while it has not, and the delivery attempts it has spent. */
@@ -1,5 +1,5 @@
1
1
  import type { Harness } from "@earendil-works/pi-durable";
2
- import type { Context } from "@earendil-works/chord";
2
+ import type { Context } from "@earendil-works/chord/context";
3
3
  import { type RecoveryStore } from "@parcha/agentrun-dsl/recovery";
4
4
  /** An effect's key in `agentrun.effects`: its journal key, then its id. The two are joined by NUL, so neither may hold
5
5
  * one: two pairs could otherwise name the same document. */
@@ -15,7 +15,7 @@
15
15
  import { defineDocFamily, defineExtension, defineTask } from "@earendil-works/pi-durable";
16
16
  import { runWorkflow } from "@parcha/agentrun-dsl";
17
17
  import { bindingDigests, bindingMismatch, canonicalHash, isRecoveryError, openRecovery, recoveryBound, RecoveryError, withRecovery } from "@parcha/agentrun-dsl/recovery";
18
- import { storageError } from "./pi-versions.js";
18
+ import { durableWait, storageError } from "./pi-versions.js";
19
19
  import { documentStore } from "./store.js";
20
20
  const RunDoc = defineDocFamily({ kind: "agentrun.task", version: 1, scope: "session", family: true, initial: () => ({ task: null, stop: null }), checkpointWhen: () => false });
21
21
  /** Records a stop on a run's entry. A recorded cancel stands, so the first cancel names the run's source; a recorded
@@ -293,7 +293,8 @@ export function createWorkflowExtension(host) {
293
293
  const failure = uncommittedOf(key, taskId);
294
294
  failure.waits += 1;
295
295
  try {
296
- const settled = await Promise.race([harness.waitForTask(taskId, context), failure.promise]);
296
+ // Never on the caller's signal (durableWait): an abort while it registers rejects this wait, never one unhandled.
297
+ const settled = await Promise.race([durableWait((at) => harness.waitForTask(taskId, at), context), failure.promise]);
297
298
  return (await outcomeOf(harness, settled, key, context));
298
299
  }
299
300
  catch (error) {
@@ -1,4 +1,4 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import type { Storage } from "@earendil-works/pi-durable";
3
3
  import type { Workflow } from "@parcha/agentrun-dsl";
4
4
  import type { GraphDiff, NodeState, WorkflowGraph } from "@parcha/agentrun-dsl/graph";
@@ -0,0 +1,41 @@
1
+ import { type AttachHub, type ComputerProvider, type HelloResult, type PairedComputer } from "@parcha/agentrun-computer";
2
+ import type { PairedComputerRow } from "../store/index.js";
3
+ import type { ComputerSettingKind, KindRegistry, ProviderEntry } from "./resolve-computer.js";
4
+ /** A paired computer's id starts with this; the rest is lowercase letters and digits, so the whole is an id an agent's
5
+ * computer setting takes as its provider (lowercase letters, digits and dashes). */
6
+ export declare const PAIRED_ID_PREFIX = "cmp-";
7
+ /** The image a paired computer's spec names: none is made, so this only says what it is. */
8
+ export declare const ATTACHED_IMAGE = "attached";
9
+ /** The words a run gets when its agent's computer is a paired computer and its runner is not in the server's process. */
10
+ export declare const ONE_PROCESS_WORDS = "a paired computer's socket is held by the serve process it dialed, and this runner runs in a process of its own: start AgentRun as one process (agentrun serve, with its runner beside it, not --no-runner) to use a paired computer";
11
+ /** What the claim reads of the paired computers: the store's rows (removed ones left out), and the server's hub where
12
+ * the runner shares its process (absent: a runner of its own process). */
13
+ export interface AttachedComputers {
14
+ rows(): Promise<readonly PairedComputerRow[]>;
15
+ readonly hub?: AttachHub;
16
+ }
17
+ /** The store's row as the hub and attachedProvider take it. */
18
+ export declare const pairedOf: (row: PairedComputerRow) => PairedComputer;
19
+ /** What a driver's hello lacks to serve `kind`, by the kind registry's rule (the computer package's SETTING_KINDS, which
20
+ * servingRefusals reads): "it says desktop but declares no input.pointer, input.keys", "it says android, which no
21
+ * desktop computer is"; undefined when the hello serves the kind. The one source of a paired computer's words for a
22
+ * kind it cannot serve: at pairing (servesNoKind) and at a run's start (withPaired's unservedWhy). */
23
+ export declare function helloLacks(hello: Partial<HelloResult>, kind: ComputerSettingKind): string | undefined;
24
+ /** Why `name`'s driver may not pair: its hello serves no kind an agent's computer can be, so no agent could pick it; in
25
+ * words that say what it lacks and to update the driver. Undefined when it serves one. */
26
+ export declare function servesNoKind(name: string, hello: Partial<HelloResult>): string | undefined;
27
+ /** A paired computer as a provider of `registry`: named by its name and its os, as an agent's computer picker lists it;
28
+ * the setting kinds its paired hello serves, no keys, no mount, the machine's own network ("open": a run never narrows
29
+ * a person's own machine), never metered. */
30
+ export declare function pairedEntry(row: PairedComputerRow, registry: Pick<KindRegistry, "SETTING_KINDS" | "servingRefusals">): ProviderEntry;
31
+ /** `registry` with each paired computer of `rows` as one more provider (pairedEntry), and the words for one that cannot
32
+ * serve a kind an agent asks of it: it is a computer of the person's own, and either the attach path carries no such
33
+ * kind (ATTACH_CANNOT: a sandbox, which would run the agent's shell there, or a browser), so the agent takes it as the
34
+ * kind it serves, or its driver lacks what the kind needs (helloLacks), so the driver is what to update. */
35
+ export declare function withPaired<R extends KindRegistry>(registry: R, rows: readonly PairedComputerRow[]): R;
36
+ /** The provider of the paired computer `row`: attachedProvider over the hub, or a refusal in ONE_PROCESS_WORDS where this
37
+ * process holds no hub. */
38
+ export declare function pairedProvider(row: PairedComputerRow, hub: AttachHub | undefined): ComputerProvider;
39
+ /** Why the paired computer `row` cannot be had now, in words that say what to do, or undefined: it must be attached (its
40
+ * driver dialed this server). Asked at a run's start, as a vendor's readiness is; another run's hold is the claim's. */
41
+ export declare function pairedRefusal(row: PairedComputerRow, hub: Pick<AttachHub, "online"> | undefined): string | undefined;
@@ -0,0 +1,114 @@
1
+ // A paired computer (a person's own, attached over the attach binding: computer-attach.ts) as the claim and Settings see
2
+ // it: one provider of the kind registry, whose id is the computer's own (cmp-...), whose label is its name, and whose one
3
+ // configuration is the kind and groups it paired as. An agent's computer setting names it as its provider, {kind:
4
+ // "desktop", provider: "cmp-..."}, so a run resolves, checks and claims it on the one path every computer takes
5
+ // (resolve-computer.ts, computer-for-claim.ts), and the computer package's attachedProvider stands in for a vendor's.
6
+ //
7
+ // Its socket is held by the AttachHub of the server's process: a runner in that process (the CLI's start, its runner
8
+ // beside the server) takes it; a runner of its own process cannot reach it and refuses it in ONE_PROCESS_WORDS.
9
+ import { attachedProvider, SETTING_KIND_NAMES, SETTING_KINDS } from "@parcha/agentrun-computer";
10
+ /** A paired computer's id starts with this; the rest is lowercase letters and digits, so the whole is an id an agent's
11
+ * computer setting takes as its provider (lowercase letters, digits and dashes). */
12
+ export const PAIRED_ID_PREFIX = "cmp-";
13
+ /** The image a paired computer's spec names: none is made, so this only says what it is. */
14
+ export const ATTACHED_IMAGE = "attached";
15
+ /** The words a run gets when its agent's computer is a paired computer and its runner is not in the server's process. */
16
+ export const ONE_PROCESS_WORDS = "a paired computer's socket is held by the serve process it dialed, and this runner runs in a process of its own: start AgentRun as one process (agentrun serve, with its runner beside it, not --no-runner) to use a paired computer";
17
+ /** The store's row as the hub and attachedProvider take it. */
18
+ export const pairedOf = (row) => ({
19
+ id: row.id,
20
+ name: row.name,
21
+ hello: row.hello,
22
+ labels: { ...row.labels },
23
+ });
24
+ /** The setting kinds the attach path cannot serve, with why and what to pair instead: a browser session needs a CDP
25
+ * connection, which the attach socket does not carry, and a sandbox needs the run's folder mounted, which a paired
26
+ * computer has no mount for (resolve-computer.ts refuses a sandbox without one). Kind-based, never by OS: a driver whose hello serves one of
27
+ * these and no other kind is refused at pairing, and a paired row of one serves nothing. */
28
+ const ATTACH_CANNOT = {
29
+ browser: "a paired computer can't serve browser sessions yet, so pair a desktop or phone driver",
30
+ sandbox: "a paired computer can't mount a run's folder yet, so no agent could run a sandbox on it: pair a desktop or phone driver",
31
+ };
32
+ /** What a driver's hello lacks to serve `kind`, by the kind registry's rule (the computer package's SETTING_KINDS, which
33
+ * servingRefusals reads): "it says desktop but declares no input.pointer, input.keys", "it says android, which no
34
+ * desktop computer is"; undefined when the hello serves the kind. The one source of a paired computer's words for a
35
+ * kind it cannot serve: at pairing (servesNoKind) and at a run's start (withPaired's unservedWhy). */
36
+ export function helloLacks(hello, kind) {
37
+ const spec = SETTING_KINDS[kind];
38
+ const said = String(hello.kind ?? "nothing");
39
+ if (!spec.machineKinds.some((one) => one === hello.kind))
40
+ return `it says ${said}, which no ${kind} computer is`;
41
+ const groups = Array.isArray(hello.groups) ? hello.groups : [];
42
+ const missing = spec.required.filter((group) => !groups.includes(group));
43
+ return missing.length === 0 ? undefined : `it says ${said} but declares no ${missing.join(", ")}`;
44
+ }
45
+ /** Why `name`'s driver may not pair: its hello serves no kind an agent's computer can be, so no agent could pick it; in
46
+ * words that say what it lacks and to update the driver. Undefined when it serves one. */
47
+ export function servesNoKind(name, hello) {
48
+ const kinds = SETTING_KIND_NAMES.filter((kind) => kind !== "none" && !(kind in ATTACH_CANNOT));
49
+ if (kinds.some((kind) => helloLacks(hello, kind) === undefined))
50
+ return undefined;
51
+ // A hello that is whole for a kind the attach path cannot carry says so, in that kind's words.
52
+ const carried = Object.entries(ATTACH_CANNOT).find(([kind]) => helloLacks(hello, kind) === undefined);
53
+ if (carried !== undefined)
54
+ return `${name}'s driver is a ${carried[0]}: ${carried[1]}`;
55
+ // The kind its machine kind is (a desktop's, a phone's) says what is missing; a machine kind no kind takes says that.
56
+ const near = kinds.find((kind) => SETTING_KINDS[kind].machineKinds.some((one) => one === hello.kind));
57
+ const lack = near === undefined ? `it says ${String(hello.kind ?? "nothing")}, which no kind of computer is` : helloLacks(hello, near);
58
+ return `${name}'s driver serves no kind: ${lack}: update the driver on ${name}`;
59
+ }
60
+ /** A paired computer as a provider of `registry`: named by its name and its os, as an agent's computer picker lists it;
61
+ * the setting kinds its paired hello serves, no keys, no mount, the machine's own network ("open": a run never narrows
62
+ * a person's own machine), never metered. */
63
+ export function pairedEntry(row, registry) {
64
+ const hello = row.hello;
65
+ const configuration = { kind: String(hello.kind ?? ""), groups: Array.isArray(hello.groups) ? [...hello.groups] : [] };
66
+ const kinds = Object.keys(registry.SETTING_KINDS).filter((kind) => kind !== "none" && !(kind in ATTACH_CANNOT) && registry.servingRefusals(configuration, kind).length === 0);
67
+ return {
68
+ id: row.id,
69
+ label: typeof hello.os === "string" ? `${row.name} (${hello.os})` : row.name,
70
+ kinds,
71
+ keys: [],
72
+ mounts: [],
73
+ network: ["open"],
74
+ metered: false,
75
+ capabilities: [configuration],
76
+ defaultImage: Object.fromEntries(kinds.map((kind) => [kind, ATTACHED_IMAGE])),
77
+ };
78
+ }
79
+ /** `registry` with each paired computer of `rows` as one more provider (pairedEntry), and the words for one that cannot
80
+ * serve a kind an agent asks of it: it is a computer of the person's own, and either the attach path carries no such
81
+ * kind (ATTACH_CANNOT: a sandbox, which would run the agent's shell there, or a browser), so the agent takes it as the
82
+ * kind it serves, or its driver lacks what the kind needs (helloLacks), so the driver is what to update. */
83
+ export function withPaired(registry, rows) {
84
+ if (rows.length === 0)
85
+ return registry;
86
+ const byId = new Map(rows.map((row) => [row.id, row]));
87
+ const unservedWhy = (entry, kind) => {
88
+ const row = byId.get(entry.id);
89
+ if (row !== undefined && kind in ATTACH_CANNOT && entry.kinds.length > 0) {
90
+ return `${row.name} is a computer of your own, and a paired computer can't be a ${kind} computer yet: give this agent ${row.name} as a ${entry.kinds.join(" or ")} computer`;
91
+ }
92
+ const lack = row === undefined ? undefined : helloLacks(row.hello, kind);
93
+ if (row === undefined || lack === undefined)
94
+ return registry.unservedWhy?.(entry, kind);
95
+ return `${row.name} is a computer of your own, and its driver gives no ${kind} computer: ${lack}. Update the driver on ${row.name}`;
96
+ };
97
+ return { ...registry, PROVIDERS: [...registry.PROVIDERS, ...rows.map((row) => pairedEntry(row, registry))], unservedWhy };
98
+ }
99
+ /** The provider of the paired computer `row`: attachedProvider over the hub, or a refusal in ONE_PROCESS_WORDS where this
100
+ * process holds no hub. */
101
+ export function pairedProvider(row, hub) {
102
+ if (hub === undefined)
103
+ throw Object.assign(new Error(ONE_PROCESS_WORDS), { code: "computer_unavailable" });
104
+ return attachedProvider(pairedOf(row), hub);
105
+ }
106
+ /** Why the paired computer `row` cannot be had now, in words that say what to do, or undefined: it must be attached (its
107
+ * driver dialed this server). Asked at a run's start, as a vendor's readiness is; another run's hold is the claim's. */
108
+ export function pairedRefusal(row, hub) {
109
+ if (hub === undefined)
110
+ return ONE_PROCESS_WORDS;
111
+ if (!hub.online(row.id))
112
+ return `This agent's computer is ${row.name}, which is not attached now: open its driver on that computer, which dials this server, then start the run again.`;
113
+ return undefined;
114
+ }
@@ -1,7 +1,7 @@
1
- import { type ComputerSpec, type DockerVolume } from "@parcha/agentrun-computer";
1
+ import { type AttachHub, type ComputerSpec, type DockerVolume } from "@parcha/agentrun-computer";
2
2
  import type { DockerPaths } from "../box-paths.js";
3
3
  import { type HostRead } from "../docker-host-addresses.js";
4
- import type { ProviderFactories } from "../computer-keys.js";
4
+ import { type ProviderFactories } from "../computer-keys.js";
5
5
  import type { FauxComputers } from "../faux-computers.js";
6
6
  import { type KeyEnv } from "../key-meta.js";
7
7
  import type { Store } from "../store/index.js";
@@ -48,8 +48,14 @@ export interface ComputerDepsOptions {
48
48
  /** The server's environment: a provider key named here wins over its saved one; AGENTRUN_DOCKER_IMAGE names Docker's
49
49
  * image. Passed in, never read here. */
50
50
  readonly env: KeyEnv;
51
- /** The store: its sealed keys (a provider's saved keys) and its computer ledger (the phone provider's). */
52
- readonly store: Pick<Store, "sealedKeys" | "computerLedger">;
51
+ /** The store: its sealed keys (a provider's saved keys), its computer ledger (the phone provider's) and its paired
52
+ * computers (a test's stand-in may have none). */
53
+ readonly store: Pick<Store, "sealedKeys" | "computerLedger"> & {
54
+ readonly pairedComputers?: Pick<Store["pairedComputers"], "list">;
55
+ };
56
+ /** The server's AttachHub, where this runner shares the server's process (runner/beside.ts): a paired computer's
57
+ * socket is there. Absent: a runner of its own process, which refuses a paired computer in words. */
58
+ readonly hub?: AttachHub;
53
59
  /** The server's seal key: absent, no saved key is opened (a key from the environment still is). */
54
60
  readonly sealKey: Buffer | undefined;
55
61
  /** The kind registry: the computer package's unless given (a test's fixture). */
@@ -66,15 +72,15 @@ export interface ComputerDepsOptions {
66
72
  /** Whether a provider that binds a folder of this machine answers here now (Docker), for the Mode 1 default. */
67
73
  readonly answers?: ComputerForClaimDeps["answers"];
68
74
  /** This machine's Docker daemon, asked when a Docker launch fails (docker-daemon.ts dockerDaemonCheck over `env`
69
- * unless given; none under --faux, whose launch is its own). */
75
+ * unless given). */
70
76
  readonly daemon?: ComputerForClaimDeps["daemon"];
71
77
  /** Why this machine cannot run a provider's computers, by its id (computers.ts hostCommandRefusals over this process's
72
78
  * PATH): the claim refuses such a computer before it rents anything. Absent: not asked. */
73
79
  readonly hostWhy?: Readonly<Record<string, string>>;
74
80
  /** The live view's registration for a desktop or a phone (proxy-only): absent, no view is opened. */
75
81
  readonly openComputerView?: OpenComputerView;
76
- /** --faux's computers (faux-computers.ts), in place of the computer package's: their kind registry, key table, launch
77
- * and factories. */
82
+ /** --faux's computers (faux-computers.ts), beside the computer package's: their providers in the kind registry, their
83
+ * keys and factories with the package's, and their launch for their own providers. */
78
84
  readonly faux?: FauxComputers;
79
85
  }
80
86
  /** The spec a computer of `kind` on `entry` is made with, besides its labels and its mount: its image (a provider that
@@ -92,6 +98,9 @@ export declare function computerSpecOf(env: KeyEnv): ComputerForClaimDeps["spec"
92
98
  /** The run's timeline phase while its claim waits on its computer's image (computerForClaim's onImageWait): main's box
93
99
  * image row, the computer's noun for the box's. */
94
100
  export declare const imageWaitWords: (making: "build" | "pull", image: string) => string;
101
+ /** The run's timeline phase as its claim starts making its computer (computerForClaim's onStarting): a phone takes
102
+ * tens of seconds to boot, and until it is up the run's timeline has nothing else to say. */
103
+ export declare const computerStartingWords: ({ provider, kind }: Pick<ComputerSaid, "provider" | "kind">) => string;
95
104
  /** The run's timeline phase once its claim's computer is connected (computerForClaim's onConnected): what it says it
96
105
  * is, in its hello's own facts, such as "The phone is ready: Android 15 (arm64), from Phone harness." */
97
106
  export declare const computerReadyWords: ({ provider, kind, hello }: ComputerSaid) => string;
@@ -100,8 +109,9 @@ export declare const computerReadyWords: ({ provider, kind, hello }: ComputerSai
100
109
  export declare const claimComputer: (launch: ClaimLaunch, store: Parameters<typeof computerForClaim>[1] & {
101
110
  readonly runs?: Pick<Store["runs"], "launch">;
102
111
  }, deps: ComputerForClaimDeps) => Promise<ClaimComputer>;
103
- /** The kind registry a claim composed with `options` resolves a setting against: --faux's when it is given faux, else a
104
- * test's own, else the computer package's. The one choice: computerDepsFrom makes it, and the server's start check
112
+ /** The kind registry a claim composed with `options` resolves a setting against: a test's own, else the computer
113
+ * package's; given faux, with --faux's providers beside them (so a --faux run takes the faux desktop, and a run on a
114
+ * provider a test loads still gets it). The one choice: computerDepsFrom makes it, and the server's start check
105
115
  * (server.ts computerReady) asks it with what the runner composes with, so a run's start and its claim answer alike. */
106
116
  export declare function claimKinds(options: Pick<ComputerDepsOptions, "faux" | "kinds">): KindRegistry;
107
117
  /** computerForClaim and its process-wide deps, composed once; and Settings → Computers' factories from the same makers. */
@@ -22,13 +22,14 @@ import { DockerProvider } from "@parcha/agentrun-computer/docker";
22
22
  import { DOCKER_IMAGE_ENV } from "../box-image.js";
23
23
  import { dockerDaemonCheck } from "../docker-daemon.js";
24
24
  import { unionOf } from "../docker-host-addresses.js";
25
+ import { KEY_TABLE } from "../computer-keys.js";
25
26
  import { envValue, keyReader } from "../key-meta.js";
26
27
  import { boxAllowOf, boxAllowSetIn } from "../box-settings.js";
27
28
  import { readLaunchBody } from "../run-launch.js";
28
29
  import { computerForClaim } from "./computer-for-claim.js";
29
30
  import { storeLedger } from "./computer-ledger.js";
30
31
  import { computerProviderFactories, computerProviderMakers } from "./computer-providers.js";
31
- import { needsNetwork, noNetworkRefusal, vendorNetworkOnly } from "./resolve-computer.js";
32
+ import { aLabel, needsNetwork, noNetworkRefusal, vendorNetworkOnly } from "./resolve-computer.js";
32
33
  /** How long a run's computer lives whatever happens to the server: a bound on a leaked one, never its clean end (the old
33
34
  * box's lifetime). The clean end is the run's release. */
34
35
  export const COMPUTER_LIFETIME_MS = 24 * 60 * 60_000;
@@ -136,7 +137,7 @@ export function computerSpecOf(env) {
136
137
  if (image !== undefined)
137
138
  return image;
138
139
  if (entry.prepareImage && kind === "desktop")
139
- throw refused(`A ${entry.label} desktop needs an image with an X server; set one for desktops.`);
140
+ throw refused(`${aLabel(entry.label, true)} desktop needs an image with an X server; set one for desktops.`);
140
141
  throw refused(`${entry.label} has no image for a ${kind} computer here: pick another provider for this agent's computer in Settings → Computers.`);
141
142
  };
142
143
  const limits = dockerLimitsOf(env);
@@ -181,6 +182,9 @@ function networkOf(entry, kind, run, current, currentSet) {
181
182
  export const imageWaitWords = (making, image) => making === "build" ? `Preparing the computer's image: building it (${DOCKER_RECIPE_HAS})…` : `Preparing the computer's image: pulling ${image}…`;
182
183
  /** An OS as people write its name. */
183
184
  const OS_NAMES = { linux: "Linux", windows: "Windows", macos: "macOS", android: "Android", ios: "iOS" };
185
+ /** The run's timeline phase as its claim starts making its computer (computerForClaim's onStarting): a phone takes
186
+ * tens of seconds to boot, and until it is up the run's timeline has nothing else to say. */
187
+ export const computerStartingWords = ({ provider, kind }) => `Starting a ${kind} from ${provider}…`;
184
188
  /** The run's timeline phase once its claim's computer is connected (computerForClaim's onConnected): what it says it
185
189
  * is, in its hello's own facts, such as "The phone is ready: Android 15 (arm64), from Phone harness." */
186
190
  export const computerReadyWords = ({ provider, kind, hello }) => `The ${kind} is ready: ${[OS_NAMES[hello.os] ?? hello.os, hello.osVersion].filter(Boolean).join(" ")} (${hello.arch}), from ${provider}.`;
@@ -193,12 +197,17 @@ export const claimComputer = async (launch, store, deps) => {
193
197
  const boxAllow = body?.boxAllow;
194
198
  return computerForClaim(boxAllow === undefined ? launch : { ...launch, boxAllow, ...(body?.boxAllowSet ? { boxAllowSet: true } : {}) }, store, deps);
195
199
  };
196
- /** The kind registry a claim composed with `options` resolves a setting against: --faux's when it is given faux, else a
197
- * test's own, else the computer package's. The one choice: computerDepsFrom makes it, and the server's start check
200
+ /** The kind registry a claim composed with `options` resolves a setting against: a test's own, else the computer
201
+ * package's; given faux, with --faux's providers beside them (so a --faux run takes the faux desktop, and a run on a
202
+ * provider a test loads still gets it). The one choice: computerDepsFrom makes it, and the server's start check
198
203
  * (server.ts computerReady) asks it with what the runner composes with, so a run's start and its claim answer alike. */
199
204
  export function claimKinds(options) {
205
+ const base = options.kinds ?? { SETTING_KINDS, PROVIDERS, servingRefusals };
206
+ if (!options.faux)
207
+ return base;
200
208
  // The faux registry is Settings' shape (computers.ts); the claim reads the same data as resolve-computer.ts's.
201
- return options.faux?.kinds ?? options.kinds ?? { SETTING_KINDS, PROVIDERS, servingRefusals };
209
+ const faux = options.faux.kinds;
210
+ return { ...base, PROVIDERS: [...base.PROVIDERS, ...faux.PROVIDERS] };
202
211
  }
203
212
  /** This machine's Docker daemon as the claim asks it once a Docker launch fails: one check per process (its answer
204
213
  * kept a while, docker-daemon.ts), in `env`. */
@@ -260,13 +269,19 @@ export function computerDepsFrom(options) {
260
269
  spec: computerSpecOf(env),
261
270
  check: { readBackOf },
262
271
  keyOf: keyReader(store, sealKey, env),
263
- // Under --faux, its launch makes the computer, with its key table: no provider of the package is built.
264
- ...(faux ? { keyTable: faux.keyTable, launch: (entry, spec) => faux.launch(entry, spec) } : {}),
272
+ // Under --faux, its launch makes a faux provider's computer, its keys beside the package's: any other provider's is
273
+ // made as without it.
274
+ ...(faux ? {
275
+ keyTable: { keys: { ...KEY_TABLE.keys, ...faux.keyTable.keys }, labels: { ...KEY_TABLE.labels, ...faux.keyTable.labels } },
276
+ launch: (entry, spec) => faux.launch(entry, spec),
277
+ launches: (provider) => faux.owns(provider),
278
+ } : {}),
265
279
  ...(options.answers ? { answers: options.answers } : {}),
266
280
  ...(options.hostWhy ? { hostWhy: (provider) => (Object.hasOwn(options.hostWhy, provider) ? options.hostWhy[provider] : undefined) } : {}),
267
- ...(options.daemon ? { daemon: options.daemon } : faux ? {} : { daemon: dockerDaemonOf(env) }),
281
+ ...(options.daemon ? { daemon: options.daemon } : { daemon: dockerDaemonOf(env) }),
268
282
  ...(options.openComputerView ? { openComputerView: options.openComputerView } : {}),
283
+ ...(store.pairedComputers ? { attached: { rows: () => store.pairedComputers.list(), ...(options.hub ? { hub: options.hub } : {}) } } : {}),
269
284
  };
270
- const factories = faux?.factories ?? computerProviderFactories(providers, (id) => storeLedger(store.computerLedger, id));
285
+ const factories = { ...computerProviderFactories(providers, (id) => storeLedger(store.computerLedger, id)), ...faux?.factories };
271
286
  return { computerForClaim: claimComputer, computerDeps, factories };
272
287
  }
@@ -1,8 +1,9 @@
1
- import type { ComputerProvider, ComputerSpec, HelloResult } from "@parcha/agentrun-computer";
1
+ import type { ComputerProvider, ComputerSpec, HelloResult, Result, ScreenWatch, ScreenWatchHandlers, WatchOptions } from "@parcha/agentrun-computer";
2
2
  import { type PlaceView } from "../computer-setting.js";
3
3
  import { type KeyTable, type ProviderSettings } from "../computer-keys.js";
4
4
  import type { Store } from "../store/index.js";
5
5
  import type { MountCheck } from "./attach.js";
6
+ import { type AttachedComputers } from "./attached-computers.js";
6
7
  import { type HeldComputer } from "./computer-hold.js";
7
8
  import { type ProviderLedger } from "./computer-ledger.js";
8
9
  import { type ClaimBrowser, type ClaimSide, type ComputerSetting, type ComputerSettingKind, type KindRegistry, type ProviderEntry } from "./resolve-computer.js";
@@ -46,9 +47,11 @@ export type ProviderExtras = {
46
47
  };
47
48
  /** Why a live view ends: the computer was released, or the run ended. */
48
49
  export type ViewEnd = "released" | "ended";
49
- /** The live view of a desktop or a phone, proxy-only, as its registration (computer-live.ts
50
- * openComputerView, taken as a dep until it is on the base) opens it at the claim: fenced on the claim, tagged with the
51
- * computer's ref id, fed by the provider's watch, and held by the run's take-over hold. */
50
+ /** A computer's live frames and input: its provider's watch on the computer's ref (ComputerProvider.watch). */
51
+ export type WatchOf = (handlers: ScreenWatchHandlers, options: WatchOptions) => Promise<Result<ScreenWatch>>;
52
+ /** The live view of a desktop or a phone, proxy-only, as its registration (computer-live.ts openClaimView, which the
53
+ * runner composes in) opens it at the claim: fenced on the claim, tagged with the computer's ref id, fed by the
54
+ * provider's watch, and held by the run's take-over hold. */
52
55
  export type OpenComputerView = (args: {
53
56
  readonly store: unknown;
54
57
  readonly sealKey: Buffer | undefined;
@@ -57,8 +60,12 @@ export type OpenComputerView = (args: {
57
60
  /** How the viewer's input is made into actions: a desktop's, or the phone's platform (its machine kind). */
58
61
  readonly input: "desktop" | "android" | "ios";
59
62
  readonly tag: string;
60
- readonly watch: (signal: AbortSignal) => unknown;
63
+ /** The launched computer's watch, bound to its ref: the opener gives the handlers and the signal. */
64
+ readonly watch: WatchOf;
65
+ /** The run's hold (computer-hold.ts ComputerHold). */
61
66
  readonly hold: unknown;
67
+ /** Whether the computer is gone now, its provider no longer having it (goneOf): asked when its watch ends gone. */
68
+ readonly gone?: () => Promise<boolean>;
62
69
  }) => Promise<{
63
70
  readonly ok: true;
64
71
  readonly view: {
@@ -66,7 +73,7 @@ export type OpenComputerView = (args: {
66
73
  };
67
74
  } | {
68
75
  readonly ok: false;
69
- readonly refused: "fenced" | "bad_tag" | "kind";
76
+ readonly refused: "fenced" | "bad_tag" | "kind" | "failed";
70
77
  readonly message: string;
71
78
  }>;
72
79
  export interface ComputerForClaimDeps {
@@ -90,8 +97,10 @@ export interface ComputerForClaimDeps {
90
97
  readonly answers?: (provider: string) => Promise<boolean>;
91
98
  /** Its daemon's answer (docker-daemon.ts), asked when a launch on such a provider fails (ClaimSide.daemon). */
92
99
  readonly daemon?: ClaimSide["daemon"];
93
- /** A launch of the server's own in place of the providers' (--faux's desktop). */
100
+ /** A launch of the server's own in place of the providers' (--faux's desktop), for the providers `launches` takes (by
101
+ * id; absent, every one): any other is made by its provider, as with no launch. */
94
102
  readonly launch?: ClaimSide["launch"];
103
+ readonly launches?: (provider: string) => boolean;
95
104
  /** The run's folder (mounted only where the provider mounts it) and the mount check attach runs. */
96
105
  readonly workspace: Workspace;
97
106
  readonly check: MountCheck;
@@ -108,10 +117,17 @@ export interface ComputerForClaimDeps {
108
117
  * the OS's version and its architecture): the run's caller says it on the run's timeline. A browser session, made
109
118
  * by the run's tool, is never told. Absent: nothing is said. */
110
119
  readonly onConnected?: (said: ComputerSaid) => void;
120
+ /** Told once, as the claim asks its provider for a new computer (never for a browser, or an agent's own computer,
121
+ * whose claim says what became of it in onComputerNote): the run's caller says it on the run's timeline, which
122
+ * otherwise shows nothing while a phone boots. Absent: nothing is said. */
123
+ readonly onStarting?: (said: Pick<ComputerSaid, "provider" | "kind">) => void;
111
124
  /** Why this machine cannot run a provider's computers, by its provider id (computers.ts hostCommandRefusals: the
112
125
  * phone's adb not on PATH), in words that say how to fix it, or undefined: refused with code computer_unavailable
113
126
  * before anything is rented. Absent: not asked. */
114
127
  readonly hostWhy?: (provider: string) => string | undefined;
128
+ /** The paired computers (attached-computers.ts): each one more provider of `kinds` for this claim, claimed through the
129
+ * hub of this process. Absent: none is. */
130
+ readonly attached?: AttachedComputers;
115
131
  /** Why this run's harness takes no computer of `kind`, in words (a CLI harness's of a browser), or undefined: a kind
116
132
  * it refuses is refused with code computer_unavailable before anything is made. Absent: every kind. */
117
133
  readonly refuseKind?: (kind: Exclude<ComputerSettingKind, "none">) => string | undefined;
@@ -131,7 +147,6 @@ export interface ClaimComputer {
131
147
  readonly held?: HeldComputer;
132
148
  release(why?: ViewEnd): Promise<void>;
133
149
  }
134
- /** The provider's watch of a computer's screen (ComputerProvider.watch), where it has one. */
135
150
  /** Told once, before the claim waits on its computer's image being built or pulled; never when the host has it. */
136
151
  export type ImageWait = (making: "build" | "pull", tag: string) => void;
137
152
  /** What a computer the claim made says it is, once it is connected: the provider's name in words, the agent's setting