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

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 (325) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +158 -52
  3. package/dist/attach-conformance-cli.d.ts +1 -0
  4. package/dist/attach-conformance-cli.js +18 -0
  5. package/dist/attach-conformance.d.ts +25 -0
  6. package/dist/attach-conformance.js +343 -0
  7. package/dist/browser-cost.d.ts +1 -1
  8. package/dist/browser-live.d.ts +20 -8
  9. package/dist/browser-live.js +50 -27
  10. package/dist/cap.d.ts +0 -17
  11. package/dist/cap.js +0 -91
  12. package/dist/catalog.d.ts +1 -12
  13. package/dist/catalog.js +3 -33
  14. package/dist/cli.js +13 -4
  15. package/dist/composio-preset.d.ts +36 -0
  16. package/dist/composio-preset.js +179 -0
  17. package/dist/computer-attach.d.ts +125 -0
  18. package/dist/computer-attach.js +330 -0
  19. package/dist/computer-calls.d.ts +48 -0
  20. package/dist/computer-calls.js +126 -0
  21. package/dist/computer-channel.d.ts +57 -0
  22. package/dist/computer-channel.js +115 -0
  23. package/dist/computer-commands.d.ts +1 -1
  24. package/dist/computer-held-routes.d.ts +35 -0
  25. package/dist/computer-held-routes.js +106 -0
  26. package/dist/computer-held.d.ts +48 -0
  27. package/dist/computer-held.js +87 -0
  28. package/dist/computer-keys.d.ts +21 -1
  29. package/dist/computer-keys.js +53 -11
  30. package/dist/computer-live.d.ts +160 -0
  31. package/dist/computer-live.js +643 -0
  32. package/dist/computer-view.d.ts +13 -0
  33. package/dist/computer-view.js +50 -3
  34. package/dist/computer-viewer.d.ts +6 -0
  35. package/dist/computer-viewer.js +297 -0
  36. package/dist/computers.d.ts +33 -7
  37. package/dist/computers.js +50 -8
  38. package/dist/console/assets/index-Cn6JX1uH.js +563 -0
  39. package/dist/console/assets/index-DRN62V5v.css +1 -0
  40. package/dist/console/index.html +2 -2
  41. package/dist/faux-computers.d.ts +9 -20
  42. package/dist/faux-computers.js +53 -25
  43. package/dist/github-connection.d.ts +10 -2
  44. package/dist/github-connection.js +65 -2
  45. package/dist/github-faux.js +1 -1
  46. package/dist/graph-view.d.ts +1 -1
  47. package/dist/harness.d.ts +1 -0
  48. package/dist/harness.js +35 -1
  49. package/dist/host-tools.d.ts +1 -1
  50. package/dist/hosted-search.d.ts +5 -4
  51. package/dist/hosted-search.js +2 -7
  52. package/dist/import-sources.d.ts +10 -0
  53. package/dist/import-sources.js +44 -2
  54. package/dist/import.d.ts +3 -3
  55. package/dist/import.js +37 -6
  56. package/dist/learn/check.d.ts +4 -1
  57. package/dist/learn/check.js +1 -1
  58. package/dist/learn/commit.d.ts +4 -2
  59. package/dist/learn/commit.js +5 -5
  60. package/dist/learn/folder.d.ts +6 -0
  61. package/dist/learn/folder.js +4 -1
  62. package/dist/learn/general.d.ts +66 -0
  63. package/dist/learn/general.js +73 -0
  64. package/dist/learn/grade.d.ts +4 -0
  65. package/dist/learn/grade.js +22 -1
  66. package/dist/learn/reflect.d.ts +10 -1
  67. package/dist/learn/reflect.js +14 -4
  68. package/dist/learn/skills.d.ts +33 -5
  69. package/dist/learn/skills.js +53 -7
  70. package/dist/learned-workflow.d.ts +24 -0
  71. package/dist/learned-workflow.js +66 -3
  72. package/dist/learning-batch.d.ts +283 -0
  73. package/dist/learning-batch.js +574 -0
  74. package/dist/learning-evals.d.ts +33 -0
  75. package/dist/learning-evals.js +98 -0
  76. package/dist/learning-routes.d.ts +25 -2
  77. package/dist/learning-routes.js +39 -6
  78. package/dist/learning-words.d.ts +6 -0
  79. package/dist/learning-words.js +6 -0
  80. package/dist/learning.d.ts +28 -15
  81. package/dist/learning.js +84 -44
  82. package/dist/live/stream.js +6 -3
  83. package/dist/live/translate.d.ts +4 -3
  84. package/dist/live/translate.js +8 -4
  85. package/dist/live-reach.d.ts +37 -0
  86. package/dist/live-reach.js +62 -0
  87. package/dist/mcp-gateway.d.ts +9 -0
  88. package/dist/mcp-gateway.js +60 -11
  89. package/dist/mcp-oauth.d.ts +57 -7
  90. package/dist/mcp-oauth.js +133 -18
  91. package/dist/mcp-private-hosts.d.ts +4 -4
  92. package/dist/mcp-private-hosts.js +20 -12
  93. package/dist/mcp-probe.d.ts +19 -2
  94. package/dist/mcp-probe.js +44 -9
  95. package/dist/mcp-secret-writes.js +4 -0
  96. package/dist/mcp-servers-store.d.ts +38 -15
  97. package/dist/mcp-servers-store.js +112 -20
  98. package/dist/mcp-store.d.ts +10 -4
  99. package/dist/mcp-store.js +17 -6
  100. package/dist/model-form.d.ts +26 -0
  101. package/dist/model-form.js +80 -0
  102. package/dist/model.js +23 -10
  103. package/dist/openapi.js +386 -21
  104. package/dist/page.d.ts +18 -0
  105. package/dist/page.js +48 -20
  106. package/dist/paid-calls.d.ts +1 -1
  107. package/dist/place-offers.d.ts +2 -3
  108. package/dist/place-offers.js +3 -7
  109. package/dist/place.js +1 -2
  110. package/dist/print.d.ts +15 -1
  111. package/dist/print.js +14 -3
  112. package/dist/propose.d.ts +3 -0
  113. package/dist/propose.js +13 -5
  114. package/dist/provider.js +3 -2
  115. package/dist/reflect-range.d.ts +8 -1
  116. package/dist/reflect-range.js +1 -1
  117. package/dist/run-launch.d.ts +14 -2
  118. package/dist/run-launch.js +9 -4
  119. package/dist/run-learning-served.d.ts +2 -2
  120. package/dist/run-reads-over-store.d.ts +1 -1
  121. package/dist/run-repo.d.ts +20 -0
  122. package/dist/run-repo.js +63 -0
  123. package/dist/run-timeline-served.d.ts +1 -1
  124. package/dist/run-view.d.ts +3 -3
  125. package/dist/run-view.js +14 -7
  126. package/dist/runner/adapter-loop.d.ts +23 -7
  127. package/dist/runner/adapter-loop.js +648 -62
  128. package/dist/runner/adapter-run-spec.d.ts +11 -3
  129. package/dist/runner/adapter-run-spec.js +77 -22
  130. package/dist/runner/adapters/pi-computer.d.ts +7 -0
  131. package/dist/runner/adapters/pi-computer.js +43 -0
  132. package/dist/runner/adapters/pi.d.ts +9 -4
  133. package/dist/runner/adapters/pi.js +76 -14
  134. package/dist/runner/beside.d.ts +7 -3
  135. package/dist/runner/beside.js +21 -11
  136. package/dist/runner/claim-secrets.d.ts +4 -0
  137. package/dist/runner/claim-secrets.js +6 -1
  138. package/dist/runner/cli-run-spec.d.ts +20 -3
  139. package/dist/runner/cli-run-spec.js +113 -43
  140. package/dist/runner/commands.d.ts +3 -1
  141. package/dist/runner/commands.js +28 -3
  142. package/dist/runner/computer-channel.d.ts +34 -0
  143. package/dist/runner/computer-channel.js +61 -0
  144. package/dist/runner/conformance/harness.js +80 -14
  145. package/dist/runner/conformance/subject.d.ts +1 -1
  146. package/dist/runner/dispatch.js +3 -0
  147. package/dist/runner/end-of-run.d.ts +22 -12
  148. package/dist/runner/end-of-run.js +38 -16
  149. package/dist/runner/github-app.d.ts +2 -1
  150. package/dist/runner/github-app.js +4 -2
  151. package/dist/runner/harness-loops.js +15 -1
  152. package/dist/runner/held-run.d.ts +65 -0
  153. package/dist/runner/held-run.js +158 -0
  154. package/dist/runner/journal-kinds.d.ts +20 -1
  155. package/dist/runner/journal-kinds.js +14 -0
  156. package/dist/runner/journal-reader.d.ts +5 -4
  157. package/dist/runner/journal-reader.js +12 -10
  158. package/dist/runner/learning-ask.d.ts +7 -1
  159. package/dist/runner/learning-ask.js +21 -6
  160. package/dist/runner/learning-dispatch.d.ts +22 -0
  161. package/dist/runner/learning-dispatch.js +77 -10
  162. package/dist/runner/learning-end.d.ts +22 -1
  163. package/dist/runner/learning-end.js +92 -12
  164. package/dist/runner/learning-factory.d.ts +1 -1
  165. package/dist/runner/learning-factory.js +11 -5
  166. package/dist/runner/learning-loop.d.ts +67 -7
  167. package/dist/runner/learning-loop.js +173 -21
  168. package/dist/runner/learning-seed.d.ts +7 -0
  169. package/dist/runner/learning-seed.js +13 -0
  170. package/dist/runner/live-ticker.js +1 -0
  171. package/dist/runner/loop-contract.d.ts +8 -1
  172. package/dist/runner/loop.d.ts +5 -1
  173. package/dist/runner/loop.js +2 -1
  174. package/dist/runner/main.d.ts +13 -1
  175. package/dist/runner/main.js +27 -5
  176. package/dist/runner/mcp-claim.d.ts +10 -7
  177. package/dist/runner/mcp-claim.js +113 -24
  178. package/dist/runner/mcp-github.js +1 -1
  179. package/dist/runner/mcp-run.d.ts +5 -5
  180. package/dist/runner/mcp-run.js +15 -3
  181. package/dist/runner/metrics.d.ts +11 -2
  182. package/dist/runner/metrics.js +12 -2
  183. package/dist/runner/pr-checkout.d.ts +1 -0
  184. package/dist/runner/pr-checkout.js +1 -1
  185. package/dist/runner/reflect-hook.d.ts +18 -0
  186. package/dist/runner/reflect-hook.js +20 -8
  187. package/dist/runner/runner.d.ts +26 -0
  188. package/dist/runner/runner.js +184 -15
  189. package/dist/runner/scratch-sweep.d.ts +13 -0
  190. package/dist/runner/scratch-sweep.js +62 -0
  191. package/dist/runner/sessions.d.ts +1 -1
  192. package/dist/runner/store-port.d.ts +4 -2
  193. package/dist/runner/store-secrets.js +4 -3
  194. package/dist/runner/subagent.js +3 -1
  195. package/dist/runner/workflow-host.d.ts +6 -1
  196. package/dist/runner/workflow-host.js +1 -1
  197. package/dist/runner/workflow-loop.d.ts +1 -1
  198. package/dist/runner/workflow-spec.d.ts +14 -2
  199. package/dist/runner/workflow-spec.js +56 -20
  200. package/dist/runs-over-store.d.ts +6 -1
  201. package/dist/runs-over-store.js +38 -9
  202. package/dist/seal-key.js +3 -3
  203. package/dist/sealed-settings-store.d.ts +5 -2
  204. package/dist/sealed-settings-store.js +10 -4
  205. package/dist/secret-writes.d.ts +5 -4
  206. package/dist/secret-writes.js +5 -4
  207. package/dist/server-secrets-store.d.ts +4 -3
  208. package/dist/server-secrets-store.js +15 -9
  209. package/dist/server-secrets.js +3 -2
  210. package/dist/server.d.ts +43 -14
  211. package/dist/server.js +472 -126
  212. package/dist/settings-wake.d.ts +21 -0
  213. package/dist/settings-wake.js +59 -0
  214. package/dist/standard-webhooks.d.ts +4 -1
  215. package/dist/standard-webhooks.js +8 -4
  216. package/dist/store/command-wake.d.ts +12 -0
  217. package/dist/store/command-wake.js +37 -0
  218. package/dist/store/dialect.d.ts +6 -0
  219. package/dist/store/dialect.js +5 -0
  220. package/dist/store/index.d.ts +1 -1
  221. package/dist/store/journal/storage.d.ts +3 -2
  222. package/dist/store/journal/storage.js +13 -5
  223. package/dist/store/postgres/dialect.js +4 -0
  224. package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
  225. package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
  226. package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
  227. package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
  228. package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
  229. package/dist/store/schema.d.ts +1 -1
  230. package/dist/store/schema.js +77 -8
  231. package/dist/store/sqlite/run-patch.d.ts +7 -5
  232. package/dist/store/sqlite/run-patch.js +28 -13
  233. package/dist/store/sqlite/store.js +272 -54
  234. package/dist/store/store.d.ts +268 -9
  235. package/dist/store/store.js +12 -1
  236. package/dist/store-reads/cap.d.ts +1 -1
  237. package/dist/store-reads/cap.js +8 -1
  238. package/dist/store-reads/decisions.d.ts +2 -2
  239. package/dist/store-reads/decisions.js +1 -1
  240. package/dist/store-reads/import-summary.d.ts +1 -1
  241. package/dist/store-reads/journal.d.ts +5 -4
  242. package/dist/store-reads/journal.js +73 -15
  243. package/dist/store-reads/learning.d.ts +20 -4
  244. package/dist/store-reads/learning.js +74 -18
  245. package/dist/store-reads/runs.d.ts +1 -1
  246. package/dist/store-reads/workflow.d.ts +1 -1
  247. package/dist/store-view.d.ts +5 -0
  248. package/dist/store-view.js +26 -11
  249. package/dist/template-eval.js +6 -4
  250. package/dist/template-github-permissions.d.ts +22 -8
  251. package/dist/template-github-permissions.js +35 -15
  252. package/dist/timeline/timeline.d.ts +27 -0
  253. package/dist/timeline/timeline.js +10 -9
  254. package/dist/timeline/util.d.ts +4 -0
  255. package/dist/timeline/util.js +14 -0
  256. package/dist/tool-budget.d.ts +19 -7
  257. package/dist/tool-budget.js +14 -8
  258. package/dist/tool-gate.d.ts +16 -9
  259. package/dist/tool-gate.js +53 -42
  260. package/dist/tool-plane.d.ts +16 -12
  261. package/dist/tool-plane.js +9 -4
  262. package/dist/tools.d.ts +13 -4
  263. package/dist/tools.js +13 -4
  264. package/dist/trigger-adapter.d.ts +4 -0
  265. package/dist/trigger-secrets-shown.d.ts +2 -2
  266. package/dist/trigger-secrets-shown.js +1 -1
  267. package/dist/trigger-signatures.d.ts +25 -6
  268. package/dist/trigger-signatures.js +41 -7
  269. package/dist/trigger-targets.d.ts +2 -0
  270. package/dist/trigger-targets.js +1 -0
  271. package/dist/trigger-webhook.js +5 -2
  272. package/dist/triggers.d.ts +7 -3
  273. package/dist/triggers.js +35 -5
  274. package/dist/turns.js +16 -1
  275. package/dist/validate.js +11 -1
  276. package/dist/web-fetch.d.ts +1 -1
  277. package/dist/web-search.d.ts +10 -5
  278. package/dist/web-search.js +7 -6
  279. package/dist/webhooks.d.ts +145 -102
  280. package/dist/webhooks.js +559 -322
  281. package/dist/workflow/decisions.d.ts +1 -1
  282. package/dist/workflow/node-runner.d.ts +2 -1
  283. package/dist/workflow/node.d.ts +2 -1
  284. package/dist/workflow/node.js +3 -1
  285. package/dist/workflow/pi-versions.d.ts +23 -0
  286. package/dist/workflow/pi-versions.js +57 -0
  287. package/dist/workflow/record-tool.d.ts +2 -1
  288. package/dist/workflow/store.d.ts +1 -1
  289. package/dist/workflow/task.js +3 -2
  290. package/dist/workflow-run.d.ts +1 -1
  291. package/dist/workspace/attached-computers.d.ts +41 -0
  292. package/dist/workspace/attached-computers.js +114 -0
  293. package/dist/workspace/computer-deps.d.ts +16 -9
  294. package/dist/workspace/computer-deps.js +19 -7
  295. package/dist/workspace/computer-for-claim.d.ts +17 -8
  296. package/dist/workspace/computer-for-claim.js +62 -21
  297. package/dist/workspace/computer-hold.d.ts +11 -27
  298. package/dist/workspace/computer-hold.js +36 -56
  299. package/dist/workspace/computer-ledger.d.ts +3 -1
  300. package/dist/workspace/computer-ledger.js +4 -0
  301. package/dist/workspace/computer-mcp.d.ts +25 -0
  302. package/dist/workspace/computer-mcp.js +41 -0
  303. package/dist/workspace/computer-ports.d.ts +4 -13
  304. package/dist/workspace/computer-ports.js +4 -107
  305. package/dist/workspace/computer-script.d.ts +37 -0
  306. package/dist/workspace/computer-script.js +138 -0
  307. package/dist/workspace/executors.d.ts +1 -1
  308. package/dist/workspace/index.d.ts +4 -2
  309. package/dist/workspace/index.js +3 -1
  310. package/dist/workspace/kind-skills/desktop/SKILL.md +119 -84
  311. package/dist/workspace/kind-skills/phone/SKILL.md +100 -85
  312. package/dist/workspace/resolve-computer.d.ts +3 -0
  313. package/dist/workspace/resolve-computer.js +8 -2
  314. package/dist/workspace/run-tools.d.ts +32 -15
  315. package/dist/workspace/run-tools.js +23 -30
  316. package/package.json +19 -16
  317. package/templates/market-monitor/agent.md +1 -1
  318. package/dist/console/assets/index-BI4Byidu.js +0 -550
  319. package/dist/console/assets/index-C19gUF2n.css +0 -1
  320. package/dist/run-db.d.ts +0 -53
  321. package/dist/run-db.js +0 -116
  322. package/dist/workflow/readers.d.ts +0 -36
  323. package/dist/workflow/readers.js +0 -145
  324. package/dist/workflow/wal.d.ts +0 -11
  325. package/dist/workflow/wal.js +0 -106
@@ -1,116 +1,131 @@
1
1
  ---
2
2
  name: phone-computer
3
- description: Use a phone (a cloud Android or an iPhone) through the phone_tree, phone_screen, phone_tap, phone_swipe, phone_type, phone_key, phone_apps and phone_open tools. It covers looking, acting, checking what happened and recovering, and what a phone cannot do. Use when a run has a phone and the task needs its screen or apps.
3
+ description: Use a phone (a cloud Android or an iPhone) through computer_observe, computer_act, computer_screenshot and computer_script. It covers reading the screen's elements, acting on them by ref, running known steps as one script, checking what happened, recovering, and what a phone cannot do. Use when a run has a phone and the task needs its screen or apps.
4
4
  ---
5
5
 
6
6
  # Using a phone
7
7
 
8
- The run has a phone, a real one, rented while the run lives. You read its screen two ways: its structure (what can be
9
- tapped or typed into, with exact positions) and screenshots. You act with one finger, a few keys, and its apps. Every
10
- act answers in words, never with a picture, so you look again to see what an act did.
8
+ The run has a phone, a real one, rented while the run lives. Where it lists its elements (the `ui` group, an Android's
9
+ today), you read the screen as lines of elements and act on them by their refs. Where it doesn't (an iPhone today), you
10
+ see it through screenshots and act with one finger at their pixels. The tools say which one you have.
11
11
 
12
12
  ## The tools
13
13
 
14
- | Tool | What it does |
15
- |---|---|
16
- | `phone_tree` | Lists what on the screen can be tapped or typed into, one line each: its class, its text or label, its id, whether it is a field (and focused), its **center** (to tap) and its bounds. |
17
- | `phone_screen` | A screenshot of the whole screen. Its size in pixels is in the answer. |
18
- | `phone_tap` `{x, y}` | One tap at that point. |
19
- | `phone_swipe` `{from, to, duration_ms?}` | One finger from `from` to `to` (300 ms by default, at most 10 000). |
20
- | `phone_type` `{text}` | Types the text into the field that has focus. |
21
- | `phone_key` `{key}` | Presses `back` (leaves a page, closes a dialog or the keyboard), `home` (the home screen) or `enter` (submits the field in focus). |
22
- | `phone_apps` | The installed apps by id, and which app is in front. |
23
- | `phone_open` `{id}` | Opens an app by its id, on its first screen. |
24
-
25
- **Coordinates are screenshot pixels**, origin top left, `x` to the right and `y` down, in whole numbers.
26
- `phone_tree`'s centers and bounds are in the same pixels as `phone_screen`. A phone's screen is large (for example
27
- 720 x 1280) and its text is small, so tap a center from the tree rather than a point you estimate from a picture.
28
-
29
- ## The loop: look, act, check, recover
30
-
31
- 1. **Look.** Call `phone_tree` first. Find your target by its text, label or id, and note its center. Take
32
- `phone_screen` when the tree doesn't settle it: to see layout, images and colours, or to find a node that has no
33
- name in the tree.
34
- - A list row is often listed with no name, because the row's title is drawn by something inside it. Match the
35
- row's bounds to the screenshot to see which row it is.
36
- - The tree holds at most 150 nodes. Its last line counts any it left out: scroll, or use the screenshot.
37
- 2. **Act.** Do one act that changes the screen (a tap that opens something, a swipe, a key), then look again. Don't
38
- chain taps blind: once the screen changes under you, the second tap lands on something else.
39
- 3. **Check.** Take a screenshot or the tree again, and look for the change the act should have made:
40
- - after a tap on a list row: the list is replaced by that row's page;
41
- - after a swipe up: the rows have moved up;
42
- - after typing: the field holds the text.
43
- 4. **Recover.** If nothing changed, look closer before trying again. A dialog, the keyboard or a banner may cover
44
- your target, or the tap may have landed between two rows. Use the tree's center rather than a guess. After two or
45
- three tries that change nothing, change approach:
46
- - `phone_key` `back` to leave the page or close what covers it;
47
- - then `home`;
48
- - then `phone_open` the app afresh.
49
-
50
- ## What the screen looks like
14
+ **`computer_observe` `{app?, image?, full?}`** shows the app in front as compact lines, one per element:
51
15
 
52
- - **A page's title may not be in the tree.** On current Android a page shows its title as a large heading in a header
53
- that shrinks as you scroll, and the header is a label, not something to tap. The page opened when its own items are
54
- in the tree and the list you tapped is gone. Don't wait for the title as a line in the tree.
55
- - **The status bar** across the top (time, battery) is not the app.
56
- - **The on-screen keyboard** appears when a field has focus and covers the lower part of the screen; what it covers
57
- cannot be tapped. `phone_key` `back` closes it.
58
- - **Loading.** A screen may need a moment after a tap. If the screen hasn't changed yet, look again before acting.
59
- Don't repeat the tap, which may land on the new screen.
16
+ ```
17
+ state s2 · com.android.settings "Settings" · window 360×800 pt
18
+ @e1 generic
19
+ @e3 searchbox "Search settings"
20
+ @e5 button "Network & internet"
21
+ @e9 button "About phone"
22
+ ```
60
23
 
61
- ## Moving around
24
+ Each line is a ref (`@e5`), a role, a name, a value after `=`, what else the element says in parentheses (a row's
25
+ second line: `("Mobile, Wi-Fi, hotspot")`) and flags in brackets. A child is indented under its parent. The head line names the **state**. `image: true` adds a screenshot, for what the elements can't tell you:
26
+ layout, images, colours. Without the `ui` group, observe is the screenshot.
62
27
 
63
- - **Scroll** with a swipe the opposite way to where you want to go. A swipe **up** (from low on the screen to high)
64
- moves a list **down**. Swipe in the middle of the list, from about 75% of its height to about 25%, then look again.
65
- - **Long press**: `phone_swipe` with `from` and `to` the same point and `duration_ms` about 800.
66
- - **Go back**: `phone_key` `back`, or the page's back arrow (in the tree as "Navigate up" on Android).
67
- - **Open an app**: `phone_apps` gives the ids (like `com.android.settings`), then `phone_open` with one of them.
68
- - `phone_open` starts the app on its first screen, not where it was left, which makes it the surest way back to a
69
- known place.
70
- - Check with the tree or `phone_apps` that the app is in front.
71
- - An app may first show another app's screen (a sign-in or a permission prompt). Deal with that screen, then go
72
- on.
28
+ **`computer_act` `{steps, state?, expect?, observe?}`** runs steps in order:
73
29
 
74
- ## Typing
30
+ | Step | What it does |
31
+ |---|---|
32
+ | `{press: "@e9"}` | The element's own tap. The surest step. |
33
+ | `{set: "@e3", value: "wifi"}` | Sets a field's text, or a switch's `"on"` or `"off"`. |
34
+ | `{click: "@e9"}` or `{click: [x, y]}` | A tap; `button: "right"` is a long press. |
35
+ | `{type: "text", into?: "@e3"}` | Types, into the element when named, else into the field in focus. |
36
+ | `{nav: "back"}`, `{nav: "home"}`, `{nav: "app_switch"}` | The system's own navigation. |
37
+ | `{scroll: "@e1", dy: 600}` | Scrolls the element by points: `dy` above 0 shows what is below. |
38
+ | `{drag: [[x1, y1], [x2, y2]], ms?}` | One finger along the path. |
39
+ | `{key: "enter"}` | A key, where the phone has keys. |
40
+
41
+ Each step answers its route and whether a readback verified it; the answer ends with whether the screen changed and its
42
+ new state. `expect: {text: "Android version"}` waits after the steps until that text shows (`gone: true`: until it is
43
+ gone). `observe: true` adds the new outline: one call instead of two. The first refused step stops the rest.
44
+
45
+ Prefer refs. A step at a point is read against a state and refused as **stale** once the screen moved under it:
46
+ observe again and use the new state. Without the `ui` group, points are screenshot pixels and there are no refs,
47
+ states or expects.
48
+
49
+ **`computer_screenshot` `{region?}`** is the whole screen, or `region: [x, y, w, h]` of it, in pixels.
50
+
51
+ **`computer_script` `{code}`** runs JavaScript in an isolate whose only binding is `computer`. Its tool description
52
+ gives the `computer` object's types for this phone. The body is an async function: `await` the calls and `return` what
53
+ you need.
54
+
55
+ ```js
56
+ await computer.apps.open("com.android.settings");
57
+ const settings = computer.app("com.android.settings");
58
+ await settings.observe();
59
+ const about = settings.find({ text: "About phone" })[0];
60
+ const page = await settings.press(about.ref, { expect: { text: "Android version" }, observe: true });
61
+ return { met: page.expect, lines: page.after.outline.split("\n").filter((line) => /version/i.test(line)) };
62
+ ```
63
+
64
+ **Your harness's own code mode.** pi's `codemode` binds `computer` as computer_script does. Codex's `exec` does not:
65
+ there, call the tools, each answering its value as JSON text, or call `tools.computer_script` with the code above.
66
+
67
+ ```js
68
+ const page = JSON.parse(await tools.computer_observe({ app: "com.android.settings" }));
69
+ const about = page.elements.find((node) => node.name === "About phone");
70
+ ```
71
+
72
+ **The screen itself.** Prefer an app's steps. A script's `computer.input.act([...])` is the screen-level way out, at
73
+ screenshot pixels, for what the app's window can't reach: a swipe from the screen's top edge opens the notification
74
+ shade (`{ type: "swipe", path: [[540, 5], [540, 1200]] }`), and anything outside the app.
75
+
76
+ ## How to work: observe, then act by ref, then check
77
+
78
+ 1. **Observe** first. Find your target by its name, role or id, and note its ref. A list row is often an unnamed
79
+ button whose title sits on a child text: the outline shows it indented under the row.
80
+ 2. **Act** by ref. A step that changes the screen (opening a page, a back) ends the call, unless you put an `expect`
81
+ on it for what the next screen shows.
82
+ 3. **Check** the answer's routes, `changed` and the expect. When it doesn't settle it, observe again.
83
+ 4. **Recover.** `stale`: observe again. Nothing changed: a dialog, the keyboard or a banner may cover the target.
84
+ `{nav: "back"}` closes what covers it; `computer.apps.open(id)` in a script starts an app afresh on its first
85
+ screen, the surest way back to a known place.
86
+
87
+ ## When to write a script
88
+
89
+ - **Known steps**: open an app, press through a known path, read one value: one script, an `expect` on each page.
90
+ - **A few facts out of a long screen**: `find()` inside the script and return only those, never whole observations.
91
+ `find({ role, text, id })`: a role is the same name on every phone, a text matches the name, the value or what the
92
+ parentheses say, and an id is the app's own (an Android resource-id).
93
+ - **Loops**: scroll a list until a row shows.
94
+
95
+ When you are unsure what is on the screen, observe before you act, and decide from what it shows.
75
96
 
76
- 1. Tap the field: `phone_tree` marks it "a field", and "focused" once it has focus.
77
- 2. `phone_type` with the text. `phone_key` `enter` submits it, or a line break in the text does.
78
- 3. Look again to read what the field holds now.
97
+ ## What the screen looks like
79
98
 
80
- The phone types plain ASCII (letters, digits, punctuation, spaces) and line breaks; other characters are refused in
81
- words before anything is typed. To clear a field, select its text if the app offers it, or open the page afresh.
99
+ - **A page's title may not be an element.** On current Android the title is drawn in a header that shrinks as you
100
+ scroll. The page opened when its own items show and the list you pressed is gone.
101
+ - **The keyboard** covers the lower part of the screen while a field has focus; `{nav: "back"}` closes it.
102
+ - **The status bar** across the top (time, battery) is not the app.
82
103
 
83
104
  ## What a phone cannot do here
84
105
 
85
106
  - No pinch or zoom, and no gesture with more than one finger.
86
- - No keys beyond `back`, `home` and `enter`: no volume, no key combinations, no arrow keys.
87
107
  - No shell, files or installs.
108
+ - Plain ASCII typing only: other characters are refused in words before anything is typed.
88
109
 
89
- Don't fake any of these with tricks. Say in your answer what the task needed that the phone could not do.
110
+ Say in your answer what the task needed that the phone could not do.
90
111
 
91
112
  ## When a tool answers an error
92
113
 
93
- Errors come in words, and they say what was wrong. Read them, and act on what they say. Don't repeat the same call.
114
+ Errors come in words, and they say what was wrong. Read them, act on what they say, and don't repeat the same call.
94
115
 
95
- - **A wrong argument** (a point outside the screen, an unknown key, a swipe too long): fix it and call again, once.
96
- - **An app id the phone doesn't know**: list the apps with `phone_apps` and use an id from it.
97
- - **"This phone does not offer its UI tree" or "its keys"**: this phone has no structure or keys to give. Work from
98
- screenshots, the page's own back arrows and `phone_open`.
99
- - **"The person had this phone"**: a person took the phone over and has handed it back, and your act was not done.
100
- The screen may have changed, so look again before you act.
101
- - **The phone is gone or unreachable**: the run's phone ended (its time ran out, or it was released). Don't keep
102
- calling. Say what you finished and what you could not.
116
+ - **"The person had this computer"**: a person took the phone over and has handed it back, and your act was not done.
117
+ The screen may have changed: observe again before you act.
118
+ - **A step refused as `unsupported`** names what this phone can't do (an element step without the `ui` group, a key
119
+ on a phone with no keys). Use another step.
120
+ - **The phone is gone or unreachable**: the run's phone ended. Don't keep calling. Say what you finished and what you
121
+ could not.
103
122
 
104
123
  ## Time and cost
105
124
 
106
- The phone may be billed by the minute, and it lives only for the run's lifetime. Work steadily:
107
- - know what you want before each look;
108
- - don't loop on screenshots or the tree just to wait;
109
- - stop once the task is done, or once it can't be done.
110
-
111
- A short plan before the first tap (which app, which screens, what will show success) saves more than fast tapping.
125
+ The phone may be billed by the minute and lives only for the run's lifetime. Plan first (which app, which screens,
126
+ what will show success), script what is certain, and stop once the task is done or can't be done.
112
127
 
113
128
  ## Finishing
114
129
 
115
- Before you call the task done, take a final screenshot that shows the result. Describe what is on it in your answer,
116
- and name anything you could not finish or check.
130
+ Before you call the task done, check the result with an observe (or a screenshot when it is visual). Say what it shows
131
+ in your answer, and name anything you could not finish or check.
@@ -22,6 +22,9 @@ export type KindRegistry = {
22
22
  readonly SETTING_KINDS: Readonly<Record<ComputerSettingKind, unknown>>;
23
23
  servingRefusals(capabilities: KindCapabilities, kind: ComputerSettingKind): string[];
24
24
  readonly PROVIDERS: readonly ProviderEntry[];
25
+ /** A provider's own words for why it gives no computer of `kind`, where they say more than servingRefusals' (a paired
26
+ * computer: its driver is what to update, attached-computers.ts withPaired); undefined, servingRefusals' words. */
27
+ readonly unservedWhy?: (entry: ProviderEntry, kind: ComputerSettingKind) => string | undefined;
25
28
  };
26
29
  /** A computer a provider started for the run: its ref, its computerd client and what it offers (sandbox, desktop,
27
30
  * phone), the hello it answered when the claim connected it (a desktop's or a phone's ports read its groups), the
@@ -22,6 +22,7 @@ import { hostToolDefs } from "@parcha/agentrun-kernel/kernel";
22
22
  import { configurationOf, imagesOf } from "@parcha/agentrun-computer";
23
23
  import { noDockerWords } from "../docker-daemon.js";
24
24
  import { gpuRefused } from "../gpu-words.js";
25
+ import { recordedClient } from "../computer-calls.js";
25
26
  /** A provider's keys as the claim reads them: each key its registry entry declares, by `keyOf` (the server's reader:
26
27
  * key-meta.ts keyReader, the environment's value, else the saved one); a key with no value is left out. */
27
28
  export const providerKeys = (registry, keyOf) => async (provider) => {
@@ -191,6 +192,9 @@ export async function resolveComputer(given, mode, registry, side) {
191
192
  // The configurations of the provider that serve the kind; none, and the registry says why, by its closest one.
192
193
  const serving = servingOf(registry, entry, kind);
193
194
  if (serving.length === 0) {
195
+ const own = registry.unservedWhy?.(entry, kind);
196
+ if (own !== undefined)
197
+ return { refused: `${own}, or pick ${pick}` };
194
198
  const why = entry.capabilities.map((one) => registry.servingRefusals(one, kind)).sort((a, b) => a.length - b.length)[0] ?? [];
195
199
  return { refused: `${entry.label} gives no ${kind} computer${why.length > 0 ? `: ${why.join("; ")}` : ""}. Pick ${pick}` };
196
200
  }
@@ -277,9 +281,11 @@ function runComputerOf(kind, launched, check) {
277
281
  // The run's browser tool opens a browser's sessions through its provider.
278
282
  if (kind === "browser")
279
283
  return launched.browser ? { kind, browser: launched.browser } : "it gave no CDP connection";
280
- const { client, hello } = launched;
281
- if (!client)
284
+ const { hello } = launched;
285
+ if (!launched.client)
282
286
  return "it gave no computer protocol client";
287
+ // Each call the agent's tools make is recorded on the tool call's row (computer-calls.ts): the run's one client.
288
+ const client = recordedClient(launched.client);
283
289
  if (kind === "phone")
284
290
  return hello ? { kind, computer: { client }, hello } : "it gave no hello";
285
291
  if (check && !launched.readBack)
@@ -1,8 +1,10 @@
1
- import type { Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import type { HostTool } from "@parcha/agentrun-kernel";
3
- import { type CapabilityKind, type Registry } from "@parcha/agentrun-kernel/kernel";
3
+ import { type CapabilityKind, type ComputerPort, type Executor, type Registry } from "@parcha/agentrun-kernel/kernel";
4
4
  import type { ComputerClient, HelloResult } from "@parcha/agentrun-computer";
5
+ import { type Card } from "@parcha/agentrun-computer/surface";
5
6
  import type { AttachableComputer, MountCheck } from "./attach.js";
7
+ import { ScriptGuard } from "./computer-script.js";
6
8
  import { type PiAnswer, type PiExecutor } from "./executors.js";
7
9
  import { type Hands } from "./hands.js";
8
10
  import { type ClaimBrowser, type ShellPlace } from "./resolve-computer.js";
@@ -11,12 +13,13 @@ import type { Workspace } from "./workspace.js";
11
13
  * The run's computer, as runTools takes it, by its kind:
12
14
  * - sandbox: the run's folder is mounted in it, always; `check` is the mount check attach runs (the claim's epoch bound
13
15
  * in);
14
- * - desktop: a screen and input; the folder is attached only when its provider mounts it (`check` given) and it offers
15
- * files and exec;
16
- * - phone: a screen, touch and apps; never attached;
16
+ * - desktop: the computer's tools; the folder is attached only when its provider mounts it (`check` given) and it
17
+ * offers files and exec;
18
+ * - phone: the computer's tools; never attached;
17
19
  * - browser: what the run's browser tool drives it by (its CDP URL through its provider); no tools of the registry's,
18
20
  * never attached.
19
- * `hello`: what a desktop or a phone said it is when the claim connected it; its groups fill its kind's ports.
21
+ * `hello`: what a desktop or a phone said it is when the claim connected it; its groups say which of the computer's
22
+ * tools it has, and its surface is made from it.
20
23
  */
21
24
  export type RunComputer = {
22
25
  readonly kind: "sandbox";
@@ -37,10 +40,17 @@ export type RunComputer = {
37
40
  readonly kind: "browser";
38
41
  readonly browser: ClaimBrowser;
39
42
  };
40
- /** A desktop's or a phone's ports as a person's hold on the computer gives them back: each call made while the person
41
- * holds it waits for hand-back; a read then runs, an action then is refused (the take-over's own words). With them, the
42
- * agent's ask for the person (`handoff`, computer_request_handoff's port), through the same hold. */
43
- export type RunHold = (ports: Pick<Hands, "screen" | "input" | "phone">) => Pick<Hands, "screen" | "input" | "phone" | "handoff">;
43
+ /** A desktop's or a phone's port as a person's hold on the computer gives it back: each look or act made while the
44
+ * person holds it waits for hand-back; a look then runs, an act then is refused (the take-over's own words). With it,
45
+ * the agent's ask for the person (`handoff`, computer_request_handoff's port), through the same hold. */
46
+ export type RunHold = (ports: Pick<Hands, "computer">) => Pick<Hands, "computer" | "handoff">;
47
+ /** A desktop's or a phone's surface as a harness's own script runtime binds it (pi's code mode): its card, which the
48
+ * script prelude builds `computer` from, and the run's port, held by the person's take-over as the tools' is. */
49
+ export type ScriptComputer = {
50
+ readonly card: Card;
51
+ readonly port: ComputerPort; /** What the script's shell and files are held to (computer-script.ts ScriptGuard). */
52
+ readonly guard: ScriptGuard;
53
+ };
44
54
  /** The run's scratch in its own folder: bash's TMPDIR. */
45
55
  export declare const TMP_DIR = ".agentrun/tmp";
46
56
  /** What runHands binds for a run. */
@@ -52,8 +62,8 @@ export type RunHands = {
52
62
  readonly shell: ShellPlace;
53
63
  /** The computer's kinds whose tools the run gets, past files and a shell. */
54
64
  readonly kinds: readonly CapabilityKind[];
55
- /** The kinds' tools the computer does not offer (its groups lack them), not listed to the model. */
56
- readonly without: readonly string[];
65
+ /** What the computer offers (its groups): which of the computer's tools are listed to the model. */
66
+ readonly groups: readonly string[];
57
67
  readonly maxExecS: number;
58
68
  /** The name the model knows the run's folder by: /workspace in a computer, the folder's own path otherwise. */
59
69
  readonly cwd: string;
@@ -65,8 +75,11 @@ export type RunHands = {
65
75
  readonly read: PiExecutor;
66
76
  readonly write: PiExecutor;
67
77
  readonly edit: PiExecutor;
68
- readonly bash?: PiExecutor;
78
+ readonly bash?: PiExecutor; /** computer_script's run in serve's isolate, with a desktop or a phone. */
79
+ readonly computer_script?: Executor;
69
80
  };
81
+ /** A desktop's or a phone's surface for a harness's own script runtime; none for any other computer. */
82
+ readonly computer?: ScriptComputer;
70
83
  /** The run's end, after its background processes are ended and before the computer is let go: bash's full outputs
71
84
  * and its TMPDIR swept. */
72
85
  sweep(): Promise<void>;
@@ -123,14 +136,18 @@ export type RunTools = {
123
136
  readonly hands: Hands;
124
137
  /** Where the run's shell is (runHands' shell): its gate reads its defaults by it (tool-gate.ts defaultPermission). */
125
138
  readonly shell: ShellPlace;
126
- /** The tools the claimed computer brings by its kind, as its groups offer them: a desktop's (desktop_screen,
127
- * desktop_input, computer_request_handoff) or a phone's, by the kernel registry's own list. None with no computer, for
139
+ /** The tools the claimed computer brings by its kind, as its groups offer them: a desktop's or a phone's
140
+ * (computer_observe, computer_act, computer_screenshot, computer_script, computer_request_handoff), by the kernel
141
+ * registry's own list. None with no computer, for
128
142
  * a sandbox, or for a browser (its own binding lists its tools). An agent names its computer, never these tools
129
143
  * (definition.tools refuses them), so a run binds them beside what it was granted (withKindTools). */
130
144
  readonly kindTools: readonly string[];
131
145
  /** The registry's tools `names` names, as the kernel's HostTool an adapter's session takes, each call through the
132
146
  * run's gate decided before its intent, each answer kept in `results` (bindTools). */
133
147
  hostTools(names: readonly string[], results?: ToolResults): HostTool[];
148
+ /** A desktop's or a phone's surface for a harness's own script runtime (pi's code mode binds `computer` over it); none
149
+ * for any other computer. */
150
+ readonly computer?: ScriptComputer;
134
151
  /** The run's end, before the computer is let go: its background processes ended (TERM, then KILL 3 s later; none with
135
152
  * no computer), then bash's full outputs and TMPDIR swept. */
136
153
  end(): Promise<void>;
@@ -1,5 +1,7 @@
1
- import { capabilityToolDefs, createRegistry, endBackground } from "@parcha/agentrun-kernel/kernel";
2
- import { inputOf, phoneOf, screenOf } from "./computer-ports.js";
1
+ import { COMPUTER_TOOLS, createRegistry, endBackground } from "@parcha/agentrun-kernel/kernel";
2
+ import { createSurface } from "@parcha/agentrun-computer/surface";
3
+ import { portOf } from "./computer-ports.js";
4
+ import { computerScriptExecutor, ScriptGuard } from "./computer-script.js";
3
5
  import { answerText, piExecutor } from "./executors.js";
4
6
  import { ARCHIL_MAX_EXEC_S, handsOf, MAX_EXEC_S, shellEnv } from "./hands.js";
5
7
  import { policyEnv, policyPrelude } from "../bash-read-only.js";
@@ -15,26 +17,13 @@ function mountedIn(computer) {
15
17
  return { computer: computer.computer, check: computer.check };
16
18
  return undefined;
17
19
  }
18
- /** The kind's ports, as the computer's groups offer them, the kinds whose tools the run gets (a desktop's with a screen
19
- * and input, a phone's with a screen and touch; a browser's none), and the kind's tools its groups do not offer: a
20
- * phone's tree without apps.ui_tree, its keys without input.keys (an iPhone's today). */
21
- function portsOf(computer) {
22
- if (computer?.kind === "desktop") {
23
- const { client } = computer.computer;
24
- const { groups } = computer.hello;
25
- const screen = groups.includes("screen");
26
- const input = groups.includes("input.pointer") || groups.includes("input.keys");
27
- return screen && input ? { ports: { screen: screenOf(client), input: inputOf(client) }, kinds: ["desktop"], without: [] } : { ports: {}, kinds: [], without: [] };
28
- }
29
- if (computer?.kind === "phone") {
30
- const { groups } = computer.hello;
31
- if (!groups.includes("screen") || !groups.includes("input.touch"))
32
- return { ports: {}, kinds: [], without: [] };
33
- const tree = groups.includes("apps.ui_tree");
34
- const keys = groups.includes("input.keys");
35
- return { ports: { phone: phoneOf(computer.computer.client, { tree, keys }) }, kinds: ["phone"], without: [...(tree ? [] : ["phone_tree"]), ...(keys ? [] : ["phone_key"])] };
36
- }
37
- return { ports: {}, kinds: [], without: [] };
20
+ /** A desktop's or a phone's port, over its surface, the kind whose tools the run gets, its groups, and the script's
21
+ * executor for its card; none for any other computer. */
22
+ async function portsOf(computer, guard) {
23
+ if (computer?.kind !== "desktop" && computer?.kind !== "phone")
24
+ return { ports: {}, kinds: [], groups: [] };
25
+ const surface = createSurface(computer.computer.client, computer.hello);
26
+ return { ports: { computer: portOf(surface) }, kinds: [computer.kind], groups: surface.card.groups, script: computerScriptExecutor(surface.card, guard), card: surface.card };
38
27
  }
39
28
  /** The run's scratch in its own folder: bash's TMPDIR. */
40
29
  export const TMP_DIR = ".agentrun/tmp";
@@ -66,9 +55,9 @@ export async function runHands(workspace, computer, options) {
66
55
  const tools = Object.fromEntries([...fileTools(), bashTool()].map((tool) => [tool.name, tool]));
67
56
  const read = mounted === undefined ? tools.read : readAnywhereInComputer(tools.read, attached, names, env);
68
57
  const executor = (tool) => piExecutor(tool, fileEnv, options.context);
69
- const own = portsOf(computer);
70
- const held = options.hold !== undefined && (computer?.kind === "desktop" || computer?.kind === "phone") && own.kinds.length > 0;
71
- const { ports, kinds, without } = held ? { ...own, ports: options.hold(own.ports) } : own;
58
+ const guard = new ScriptGuard({ env: policyEnv(options.bashPolicy), prelude });
59
+ const own = await portsOf(computer, guard);
60
+ const { ports, kinds, groups, script, card } = options.hold !== undefined && own.ports.computer ? { ...own, ports: options.hold(own.ports) } : own;
72
61
  return {
73
62
  workspace: attached,
74
63
  // The computer's processes, for the five background tools: the attached Workspace's own; none when the folder is not
@@ -76,11 +65,12 @@ export async function runHands(workspace, computer, options) {
76
65
  hands: { ...handsOf(attached, { maxExecS, env, ...(prelude ? { prelude } : {}), ...network, ...(mounted === undefined ? {} : { processes: attached.process }) }), ...ports },
77
66
  shell,
78
67
  kinds,
79
- without,
68
+ groups,
80
69
  maxExecS,
81
70
  cwd,
82
71
  names,
83
- executors: { read: executor(read), write: executor(tools.write), edit: executor(tools.edit), ...(shell === "none" ? {} : { bash: executor(tools.bash) }) },
72
+ executors: { read: executor(read), write: executor(tools.write), edit: executor(tools.edit), ...(shell === "none" ? {} : { bash: executor(tools.bash) }), ...(script ? { computer_script: script } : {}) },
73
+ ...(card && ports.computer ? { computer: { card, port: ports.computer, guard } } : {}),
84
74
  async sweep() {
85
75
  // Through the run's own Workspace, not the computer's: the sweep holds whether or not the computer still answers.
86
76
  for (const dir of [OUTPUT_DIR, TMP_DIR])
@@ -124,7 +114,9 @@ export function bindTools(run, registry, names, options = {}) {
124
114
  const isError = given.isError === true || given.error !== undefined;
125
115
  const answer = { text: isError || SAYS_PATH.has(name) ? workspaceRelative(said, works) : said, isError };
126
116
  options.results?.set(callId, answer);
127
- return given.images?.length ? { ...answer, images: given.images } : answer;
117
+ // A computer tool's value beside its words: what a script's nested call reads (Codex's code mode), and an MCP
118
+ // client's structuredContent.
119
+ return { ...answer, ...(given.images?.length ? { images: given.images } : {}), ...(given.structured !== undefined && !isError ? { structured: given.structured } : {}) };
128
120
  },
129
121
  }];
130
122
  });
@@ -140,8 +132,8 @@ export function bindTools(run, registry, names, options = {}) {
140
132
  */
141
133
  export async function runTools(workspace, computer, options) {
142
134
  const run = await runHands(workspace, computer, options);
143
- const registry = createRegistry({ maxExecS: run.maxExecS, shell: run.shell, kinds: run.kinds, without: run.without, executors: run.executors });
144
- const brought = new Set(run.kinds.flatMap((kind) => capabilityToolDefs(kind).map((def) => def.name)));
135
+ const registry = createRegistry({ maxExecS: run.maxExecS, shell: run.shell, kinds: run.kinds, groups: run.groups, executors: run.executors });
136
+ const brought = new Set(COMPUTER_TOOLS);
145
137
  return {
146
138
  workspace: run.workspace,
147
139
  registry,
@@ -149,6 +141,7 @@ export async function runTools(workspace, computer, options) {
149
141
  shell: run.shell,
150
142
  kindTools: registry.list().map((def) => def.name).filter((name) => brought.has(name)),
151
143
  hostTools: (names, results) => bindTools(run, registry, names, results ? { results } : {}),
144
+ ...(run.computer ? { computer: run.computer } : {}),
152
145
  async end() {
153
146
  await endBackground(run.hands);
154
147
  await run.sweep();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-serve",
3
- "version": "0.1.0-beta.36",
3
+ "version": "0.1.0-beta.37",
4
4
  "description": "The AgentRun server: the /v2 API and console over one store, with runners that run your agents; the deployable process of the AgentRun platform.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -49,18 +49,19 @@
49
49
  "test:pg": "node scripts/test-pg.mjs"
50
50
  },
51
51
  "dependencies": {
52
- "@earendil-works/pi-agent-core": "1.5.0",
53
- "@earendil-works/pi-coding-agent": "1.5.0",
52
+ "@earendil-works/pi-agent-core": "1.5.2",
53
+ "@earendil-works/pi-codemode": "1.5.2",
54
+ "@earendil-works/pi-coding-agent": "1.5.2",
54
55
  "@modelcontextprotocol/client": "2.4.0",
55
56
  "@modelcontextprotocol/server": "2.4.0",
56
- "@parcha/agentrun-computer": "0.1.0-beta.36",
57
- "@parcha/agentrun-decisions": "0.1.0-beta.36",
58
- "@parcha/agentrun-dsl": "0.1.0-beta.36",
59
- "@parcha/agentrun-harness-claude": "0.1.0-beta.36",
60
- "@parcha/agentrun-harness-codex": "0.1.0-beta.36",
61
- "@parcha/agentrun-jev": "0.1.0-beta.36",
62
- "@parcha/agentrun-kernel": "0.1.0-beta.36",
63
- "@parcha/pi-browser": "0.1.0-beta.36",
57
+ "@parcha/agentrun-computer": "0.1.0-beta.37",
58
+ "@parcha/agentrun-decisions": "0.1.0-beta.37",
59
+ "@parcha/agentrun-dsl": "0.1.0-beta.37",
60
+ "@parcha/agentrun-harness-claude": "0.1.0-beta.37",
61
+ "@parcha/agentrun-harness-codex": "0.1.0-beta.37",
62
+ "@parcha/agentrun-jev": "0.1.0-beta.37",
63
+ "@parcha/agentrun-kernel": "0.1.0-beta.37",
64
+ "@parcha/pi-browser": "0.1.0-beta.37",
64
65
  "@secretlint/core": "13.1.0",
65
66
  "@secretlint/profiler": "13.1.0",
66
67
  "@secretlint/secretlint-rule-preset-recommend": "13.1.0",
@@ -71,12 +72,13 @@
71
72
  "proxy-addr": "2.0.8",
72
73
  "typebox": "1.3.27",
73
74
  "undici": "^8.12.2",
75
+ "ws": "8.21.0",
74
76
  "yaml": "2.9.0"
75
77
  },
76
78
  "peerDependencies": {
77
- "@earendil-works/chord": "1.5.0",
79
+ "@earendil-works/chord": "1.5.2",
78
80
  "@earendil-works/pi-ai": "*",
79
- "@earendil-works/pi-durable": "1.5.0",
81
+ "@earendil-works/pi-durable": "1.5.2",
80
82
  "opencode-ai": "1.19.5"
81
83
  },
82
84
  "peerDependenciesMeta": {
@@ -85,11 +87,12 @@
85
87
  }
86
88
  },
87
89
  "devDependencies": {
88
- "@earendil-works/chord": "1.5.0",
89
- "@earendil-works/pi-ai": "1.5.0",
90
- "@earendil-works/pi-durable": "1.5.0",
90
+ "@earendil-works/chord": "1.5.2",
91
+ "@earendil-works/pi-ai": "1.5.2",
92
+ "@earendil-works/pi-durable": "1.5.2",
91
93
  "@types/pg": "8.23.1",
92
94
  "@types/proxy-addr": "2.0.3",
95
+ "@types/ws": "8.18.2",
93
96
  "opencode-ai": "1.19.5"
94
97
  },
95
98
  "repository": {
@@ -25,7 +25,7 @@ parameters:
25
25
  competitors: { type: string, required: true, pattern: "^[^\\n]{2,2000}$", description: "the companies to watch, comma-separated, each a name and its domain: \"Acme (acme.com), Globex (globex.io)\"" }
26
26
  topics: { type: string, pattern: "^[^\\n]{0,500}$", description: "optional market keywords, comma-separated (\"payments orchestration, KYB\"): market news on them is in scope too" }
27
27
  channel: { type: string, pattern: "^([CG][A-Z0-9]{8,12}|[^@\\s]+@[^@\\s]+\\.[^@\\s]+)$", description: "where the digest goes, the one destination it is ever posted to: a Slack channel's id (C0123ABCD: in Slack, the channel's details, at the bottom) or an email address. Not a #name. Leave it out to have the digest returned only" }
28
- lookback_days: { type: integer, description: "how many days back a run looks; leave it out for 7, the weekly schedule's gap. Set it to your schedule's gap when you change cron (1 for daily), or runs repeat each other's items" }
28
+ lookback_days: { type: integer, description: "how many days back a run looks for changes; leave it out for 7. Keep it equal to the gap between runs (7 for the weekly default, 1 for daily): longer and runs repeat each other's items, shorter and days between them are missed" }
29
29
  cron: { type: string, format: cron, default: "0 8 * * 1", description: "when the digest runs, as a cron line (minute hour day-of-month month day-of-week): Monday 08:00 unless you set it; set lookback_days to its gap" }
30
30
  timezone: { type: string, format: timezone, default: UTC, description: "the IANA time zone the cron line is read in (Europe/Madrid, America/New_York): UTC unless you set it" }
31
31
  budget: { per_run_usd: 5.00 }