@parcha/agentrun-serve 0.1.0-beta.55 → 0.1.0-beta.57

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 (296) hide show
  1. package/CHANGELOG.md +261 -0
  2. package/README.md +228 -45
  3. package/dist/acp-package.d.ts +2 -0
  4. package/dist/adapters.d.ts +18 -5
  5. package/dist/adapters.js +23 -9
  6. package/dist/agent-package.d.ts +3 -3
  7. package/dist/agent-package.js +17 -8
  8. package/dist/answer-json.d.ts +6 -2
  9. package/dist/answer-json.js +22 -4
  10. package/dist/api-keys.d.ts +76 -0
  11. package/dist/api-keys.js +217 -0
  12. package/dist/api-only.d.ts +17 -5
  13. package/dist/api-only.js +36 -8
  14. package/dist/browser-hold.d.ts +23 -0
  15. package/dist/browser-hold.js +48 -0
  16. package/dist/browser-person.d.ts +3 -0
  17. package/dist/browser-person.js +4 -1
  18. package/dist/calendar/tools.js +3 -2
  19. package/dist/chatgpt-plan.d.ts +28 -3
  20. package/dist/chatgpt-plan.js +182 -21
  21. package/dist/claude-login.d.ts +101 -14
  22. package/dist/claude-login.js +232 -49
  23. package/dist/claude-sign-in.d.ts +46 -0
  24. package/dist/claude-sign-in.js +93 -0
  25. package/dist/cli.js +63 -6
  26. package/dist/composio-made.d.ts +4 -0
  27. package/dist/composio-made.js +4 -0
  28. package/dist/composio-preset.d.ts +43 -2
  29. package/dist/composio-preset.js +92 -4
  30. package/dist/computer-held-routes.d.ts +5 -4
  31. package/dist/computer-held-routes.js +29 -8
  32. package/dist/computer-held.d.ts +6 -1
  33. package/dist/computer-held.js +14 -0
  34. package/dist/computer-record.js +4 -2
  35. package/dist/computer-viewer.js +4 -1
  36. package/dist/console/assets/{backend-D5EmB4N3.js → backend-DVhHzJX2.js} +19 -19
  37. package/dist/console/assets/index-Bwn1oTem.css +1 -0
  38. package/dist/console/assets/index-okP-y8PK.js +747 -0
  39. package/dist/console/index.html +2 -2
  40. package/dist/decisions.d.ts +1 -1
  41. package/dist/decisions.js +1 -1
  42. package/dist/docker-host-addresses.d.ts +22 -11
  43. package/dist/docker-host-addresses.js +38 -26
  44. package/dist/env-switch.d.ts +10 -0
  45. package/dist/env-switch.js +33 -2
  46. package/dist/errors.d.ts +1 -0
  47. package/dist/errors.js +2 -0
  48. package/dist/fal-price.d.ts +58 -20
  49. package/dist/fal-price.js +341 -82
  50. package/dist/handed-values.d.ts +43 -1
  51. package/dist/handed-values.js +119 -2
  52. package/dist/harness-archive.d.ts +13 -10
  53. package/dist/harness-archive.js +60 -34
  54. package/dist/harness-check.d.ts +3 -1
  55. package/dist/harness-check.js +25 -46
  56. package/dist/harness-keys.d.ts +73 -27
  57. package/dist/harness-keys.js +194 -61
  58. package/dist/harness-recipe-entry.d.ts +8 -7
  59. package/dist/harness-recipe-entry.js +21 -32
  60. package/dist/harness-recipe.d.ts +38 -25
  61. package/dist/harness-recipe.js +49 -36
  62. package/dist/harness-sign-in.js +12 -23
  63. package/dist/harness-table.d.ts +10 -3
  64. package/dist/harness-table.js +26 -21
  65. package/dist/harness.d.ts +1 -0
  66. package/dist/harness.js +17 -5
  67. package/dist/host-check.d.ts +4 -0
  68. package/dist/host-check.js +4 -0
  69. package/dist/hosted-search.d.ts +1 -1
  70. package/dist/hosted-search.js +1 -2
  71. package/dist/import-worker.d.ts +4 -2
  72. package/dist/import-worker.js +9 -2
  73. package/dist/in-flight.d.ts +26 -0
  74. package/dist/in-flight.js +52 -0
  75. package/dist/key-refusal.d.ts +26 -5
  76. package/dist/key-refusal.js +313 -37
  77. package/dist/learn/secrets.d.ts +31 -11
  78. package/dist/learn/secrets.js +152 -191
  79. package/dist/learning-cost.d.ts +6 -3
  80. package/dist/learning-cost.js +4 -2
  81. package/dist/link-check.js +1 -1
  82. package/dist/llms.txt +2 -2
  83. package/dist/marketplace.d.ts +77 -0
  84. package/dist/marketplace.js +224 -0
  85. package/dist/mcp-api-only-origins.d.ts +30 -0
  86. package/dist/mcp-api-only-origins.js +57 -0
  87. package/dist/mcp-gateway.d.ts +7 -5
  88. package/dist/mcp-gateway.js +9 -12
  89. package/dist/mcp-secret-writes.js +5 -3
  90. package/dist/mcp-servers-store.d.ts +28 -6
  91. package/dist/mcp-servers-store.js +53 -4
  92. package/dist/media-duration.d.ts +3 -0
  93. package/dist/media-duration.js +90 -9
  94. package/dist/model-form.d.ts +5 -4
  95. package/dist/model-form.js +11 -7
  96. package/dist/model.d.ts +5 -2
  97. package/dist/model.js +9 -5
  98. package/dist/ollama-provider.d.ts +7 -1
  99. package/dist/ollama-provider.js +14 -2
  100. package/dist/openapi.d.ts +3 -3
  101. package/dist/openapi.js +245 -42
  102. package/dist/otel/genai.d.ts +65 -0
  103. package/dist/otel/genai.js +116 -0
  104. package/dist/otel/tracer.d.ts +55 -0
  105. package/dist/otel/tracer.js +308 -0
  106. package/dist/page.d.ts +2 -0
  107. package/dist/page.js +3 -1
  108. package/dist/paid-calls.d.ts +1 -32
  109. package/dist/paid-calls.js +4 -39
  110. package/dist/place-offers.d.ts +14 -6
  111. package/dist/place-offers.js +26 -13
  112. package/dist/provider.d.ts +9 -0
  113. package/dist/provider.js +50 -3
  114. package/dist/redact/match.d.ts +101 -0
  115. package/dist/redact/match.js +1152 -0
  116. package/dist/refusal-words.d.ts +11 -0
  117. package/dist/refusal-words.js +11 -0
  118. package/dist/run-census.d.ts +67 -0
  119. package/dist/run-census.js +240 -0
  120. package/dist/run-computer.d.ts +6 -3
  121. package/dist/run-computer.js +4 -1
  122. package/dist/run-cut.d.ts +15 -6
  123. package/dist/run-cut.js +30 -9
  124. package/dist/run-files.d.ts +3 -0
  125. package/dist/run-files.js +3 -0
  126. package/dist/run-launch.d.ts +12 -1
  127. package/dist/run-launch.js +9 -10
  128. package/dist/run-learning-served.d.ts +2 -0
  129. package/dist/run-model-key.d.ts +8 -0
  130. package/dist/run-model-key.js +31 -1
  131. package/dist/run-reads-over-store.d.ts +24 -6
  132. package/dist/run-reads-over-store.js +67 -23
  133. package/dist/run-recordings.d.ts +5 -1
  134. package/dist/run-recordings.js +39 -14
  135. package/dist/run-timeline-served.d.ts +3 -1
  136. package/dist/run-timeline-served.js +4 -4
  137. package/dist/run-usage.d.ts +1 -0
  138. package/dist/runnable.d.ts +10 -1
  139. package/dist/runnable.js +20 -8
  140. package/dist/runner/adapter-loop.d.ts +14 -0
  141. package/dist/runner/adapter-loop.js +56 -11
  142. package/dist/runner/adapter-run-spec.d.ts +45 -8
  143. package/dist/runner/adapter-run-spec.js +154 -29
  144. package/dist/runner/adapters/pi.js +25 -3
  145. package/dist/runner/beside.js +11 -6
  146. package/dist/runner/big-writes.js +1 -10
  147. package/dist/runner/claim-secrets.d.ts +18 -3
  148. package/dist/runner/claim-secrets.js +35 -6
  149. package/dist/runner/cli-run-spec.d.ts +6 -0
  150. package/dist/runner/cli-run-spec.js +85 -36
  151. package/dist/runner/computer-journal.d.ts +9 -1
  152. package/dist/runner/computer-journal.js +26 -0
  153. package/dist/runner/conformance/harness.js +1 -1
  154. package/dist/runner/feedback-round.js +3 -0
  155. package/dist/runner/harness-loops.d.ts +6 -5
  156. package/dist/runner/harness-loops.js +7 -7
  157. package/dist/runner/held.d.ts +11 -5
  158. package/dist/runner/journal-kinds.d.ts +5 -0
  159. package/dist/runner/journal-kinds.js +5 -0
  160. package/dist/runner/loop-contract.d.ts +4 -0
  161. package/dist/runner/main.js +15 -6
  162. package/dist/runner/mcp-claim.js +30 -3
  163. package/dist/runner/mcp-run.d.ts +12 -0
  164. package/dist/runner/mcp-run.js +12 -5
  165. package/dist/runner/model-route.d.ts +17 -0
  166. package/dist/runner/model-route.js +120 -2
  167. package/dist/runner/presence.d.ts +4 -3
  168. package/dist/runner/presence.js +4 -2
  169. package/dist/runner/run-child-host.d.ts +5 -0
  170. package/dist/runner/run-child-host.js +71 -30
  171. package/dist/runner/run-child.js +5 -2
  172. package/dist/runner/runner.d.ts +18 -3
  173. package/dist/runner/runner.js +162 -36
  174. package/dist/runner/store-port.d.ts +1 -1
  175. package/dist/runner/store-secrets.d.ts +6 -0
  176. package/dist/runner/store-secrets.js +49 -7
  177. package/dist/runner/subagent.js +4 -40
  178. package/dist/runner/workflow-first.d.ts +11 -4
  179. package/dist/runner/workflow-first.js +14 -8
  180. package/dist/runner/workflow-spec.js +3 -2
  181. package/dist/runs-over-store.d.ts +15 -6
  182. package/dist/runs-over-store.js +33 -21
  183. package/dist/scrub-command.d.ts +73 -0
  184. package/dist/scrub-command.js +307 -0
  185. package/dist/secret-cut.d.ts +73 -0
  186. package/dist/secret-cut.js +291 -4
  187. package/dist/secret-rules.d.ts +143 -0
  188. package/dist/secret-rules.js +2564 -0
  189. package/dist/secrets.d.ts +7 -0
  190. package/dist/secrets.js +20 -0
  191. package/dist/server-keys.d.ts +20 -0
  192. package/dist/server-keys.js +25 -6
  193. package/dist/server.d.ts +57 -13
  194. package/dist/server.js +371 -113
  195. package/dist/skills/agentrun-serve/SKILL.md +4 -0
  196. package/dist/store/dialect.d.ts +3 -0
  197. package/dist/store/dialect.js +1 -0
  198. package/dist/store/index.d.ts +1 -1
  199. package/dist/store/index.js +1 -1
  200. package/dist/store/journal/storage.js +1 -1
  201. package/dist/store/postgres/dialect.js +3 -0
  202. package/dist/store/postgres/migrations/0027_run_launch_census.sql +31 -0
  203. package/dist/store/schema.d.ts +6 -0
  204. package/dist/store/schema.js +11 -1
  205. package/dist/store/seal.d.ts +6 -1
  206. package/dist/store/seal.js +5 -3
  207. package/dist/store/sqlite/run-launch.d.ts +9 -1
  208. package/dist/store/sqlite/run-launch.js +24 -13
  209. package/dist/store/sqlite/run-patch.d.ts +1 -1
  210. package/dist/store/sqlite/run-patch.js +13 -4
  211. package/dist/store/sqlite/store.js +76 -16
  212. package/dist/store/store.d.ts +53 -3
  213. package/dist/store/store.js +27 -0
  214. package/dist/store-reads/learning.d.ts +6 -3
  215. package/dist/store-reads/learning.js +22 -7
  216. package/dist/store-view.d.ts +3 -0
  217. package/dist/store-view.js +4 -4
  218. package/dist/suggestions.js +3 -2
  219. package/dist/template-eval.d.ts +22 -11
  220. package/dist/template-eval.js +124 -41
  221. package/dist/template-import.d.ts +10 -0
  222. package/dist/template-import.js +16 -7
  223. package/dist/templates.d.ts +10 -2
  224. package/dist/templates.js +28 -8
  225. package/dist/timeline/index.d.ts +1 -1
  226. package/dist/timeline/index.js +1 -1
  227. package/dist/timeline/labels.d.ts +6 -4
  228. package/dist/timeline/labels.js +18 -6
  229. package/dist/timeline/timeline.d.ts +17 -7
  230. package/dist/timeline/timeline.js +28 -14
  231. package/dist/timeline/util.js +1 -1
  232. package/dist/timeline/web-calls.d.ts +26 -9
  233. package/dist/timeline/web-calls.js +124 -37
  234. package/dist/tool-gate.d.ts +42 -3
  235. package/dist/tool-gate.js +69 -6
  236. package/dist/tool-keys-store.d.ts +2 -4
  237. package/dist/tool-keys-store.js +5 -21
  238. package/dist/tool-keys.d.ts +2 -2
  239. package/dist/tool-keys.js +2 -2
  240. package/dist/tool-list.js +1 -1
  241. package/dist/tool-plane.d.ts +2 -2
  242. package/dist/tool-plane.js +35 -33
  243. package/dist/tools.js +13 -7
  244. package/dist/trigger-targets.d.ts +4 -0
  245. package/dist/trigger-targets.js +9 -2
  246. package/dist/triggers.d.ts +67 -4
  247. package/dist/triggers.js +171 -22
  248. package/dist/until.d.ts +3 -0
  249. package/dist/until.js +11 -0
  250. package/dist/validate.js +1 -1
  251. package/dist/web-fake.d.ts +1 -3
  252. package/dist/web-fake.js +7 -18
  253. package/dist/web-fetch.d.ts +6 -72
  254. package/dist/web-fetch.js +11 -265
  255. package/dist/web-run.d.ts +31 -0
  256. package/dist/web-run.js +90 -0
  257. package/dist/web-save.d.ts +6 -4
  258. package/dist/web-save.js +9 -12
  259. package/dist/web-search.d.ts +9 -127
  260. package/dist/web-search.js +23 -259
  261. package/dist/wires.d.ts +13 -0
  262. package/dist/wires.js +11 -0
  263. package/dist/workflow-run.d.ts +5 -4
  264. package/dist/workflow-run.js +5 -4
  265. package/dist/workspace/computer-deps.d.ts +3 -1
  266. package/dist/workspace/computer-deps.js +12 -4
  267. package/dist/workspace/computer-for-claim.d.ts +19 -2
  268. package/dist/workspace/computer-for-claim.js +101 -13
  269. package/dist/workspace/computer-janitor.d.ts +15 -7
  270. package/dist/workspace/computer-janitor.js +33 -8
  271. package/dist/workspace/computer-kept.d.ts +55 -4
  272. package/dist/workspace/computer-kept.js +129 -8
  273. package/dist/workspace/index.d.ts +1 -1
  274. package/dist/workspace/index.js +1 -1
  275. package/dist/workspace/kind-skills.d.ts +4 -0
  276. package/dist/workspace/kind-skills.js +9 -0
  277. package/dist/workspace/run-end-computers.d.ts +5 -1
  278. package/dist/workspace/run-end-computers.js +27 -1
  279. package/dist/workspace/synced-folder.js +3 -4
  280. package/dist/wrapped.d.ts +65 -0
  281. package/dist/wrapped.js +77 -0
  282. package/package.json +17 -11
  283. package/skills/agentrun-serve/SKILL.md +4 -0
  284. package/templates/README.md +38 -15
  285. package/dist/console/assets/index-DUYLaqiR.js +0 -746
  286. package/dist/console/assets/index-DYhU4adm.css +0 -1
  287. package/dist/exa-keyless.d.ts +0 -34
  288. package/dist/exa-keyless.js +0 -118
  289. package/dist/firecrawl-keyless.d.ts +0 -41
  290. package/dist/firecrawl-keyless.js +0 -152
  291. package/dist/keyless-mcp.d.ts +0 -36
  292. package/dist/keyless-mcp.js +0 -127
  293. package/dist/text-urls.d.ts +0 -38
  294. package/dist/text-urls.js +0 -170
  295. package/dist/web-fetch-direct.d.ts +0 -119
  296. package/dist/web-fetch-direct.js +0 -190
package/README.md CHANGED
@@ -139,6 +139,40 @@ An id or a secret given twice, or an entry that is not `id:secret`, stops the st
139
139
  the launcher hands it over its pipe, and no run's process or runner loop gets it. A rotation adds the new token, moves
140
140
  callers, then removes the old one ([deploy/README.md](../../deploy/README.md#rotating-the-api-token)).
141
141
 
142
+ ### API keys for your apps
143
+
144
+ An app that calls this server does not need a token from the server's environment. The owner makes a key for it in the
145
+ console, under Settings → AgentRun API keys, or with `POST /v2/settings/api-keys` and `{"name": "billing app"}` from
146
+ their signed-in session:
147
+
148
+ - **Shown once.** The answer holds the key as `api_key` (`ar_key_` and 32 random bytes in base64url). No read shows it
149
+ again. A lost key is revoked and replaced.
150
+ - **What it opens.** Everything a token opens on `/v2` and `/mcp`, sent as `Authorization: Bearer <key>`. A key is never
151
+ the setup code: only a token the server was started with sets the first password.
152
+ - **What is kept.** A keyed hash of the key (HMAC-SHA-256 under a key derived from the seal key), never the key. A row
153
+ written without the seal key opens nothing.
154
+ - **Who makes and revokes.** Both are secret writes: the owner's signed-in session alone. A token, or a key, gets
155
+ `403 forbidden` with the console page in `details.console_url`, so a key that leaks cannot make another.
156
+ - **Listing and revoking.** `GET /v2/settings/api-keys` answers each key's `name`, `created_at` and `last_used_at`
157
+ (written about once a minute). `DELETE /v2/settings/api-keys/{api_key_id}` revokes one, and the next request that
158
+ carries it is `401`.
159
+ - **Limit.** A server keeps at most 50 keys; the next `POST` is `409 api_keys_full` until one is revoked.
160
+ - **One person's server.** A key is one more caller that starts runs, as a second token is. So a server with Claude
161
+ Code's login on makes no key (`403 forbidden`, in words), and a server with a key refuses to turn that login on until
162
+ the key is revoked. A server started with `--harness-sign-in` makes none, and a key made before opens nothing there.
163
+ Such a key is still listed, so its owner can revoke it, and it still refuses the login. The list says why in
164
+ `refused`.
165
+ - **In the log.** A request a key opened names it by id (`api_key=<id>`), never by value.
166
+
167
+ The server keeps no copy of a key, so it finds one in a text by its shape: `ar_key_` and 43 or more base64url
168
+ characters, a capital or a digit among them, are cut wherever a run's views, a shared transcript or a learned note
169
+ would show them, whatever stands before them. A key cut short, or split across lines, is not found, so keep keys out
170
+ of prompts and files a run reads all the same. A row under the keys' name in the store that is no key's (damaged, or
171
+ another version's) opens nothing and counts toward the limit. The list names it in `unreadable`, the console shows it
172
+ with a Remove button, the log says it at the start, and `DELETE` with its id removes it. An
173
+ [API-only](#api-only) server has no owner and serves none of these routes, so it takes no key at all: only the tokens
174
+ it was started with. Its capabilities say `features.api_keys.routes: false`.
175
+
142
176
  ## Sandbox in 60 seconds
143
177
 
144
178
  An agent with a shell, in a Docker container of its own: on a machine with Docker, in a checkout built as above, with
@@ -209,6 +243,30 @@ whose stored cost was unknown that it read, those whose priced booking it wrote
209
243
  heals on its next read). The rest stay unknown: a charge of no known cost, or a booking with no request to read. It
210
244
  names no run, and a store with no such run says nothing; quiet keeps it too.
211
245
 
246
+ ## Traces (OpenTelemetry)
247
+
248
+ Set `OTEL_EXPORTER_OTLP_ENDPOINT` (or `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) and every run on a pi or CLI harness
249
+ exports a GenAI trace over OTLP/HTTP to any backend that takes one, with the official OpenTelemetry SDK: an
250
+ `invoke_agent {harness}` span per claim of the run, under it a `chat {model}` span per model request (provider, model,
251
+ `server.address` (the host the request goes to, OpenRouter's for a model reached through it; none where not known),
252
+ and tokens with the cache: `gen_ai.usage.input_tokens` includes the cache read and write, which are also given on their
253
+ own) and an `execute_tool {tool}` span per tool call. A run is one trace, sampled whole or not at
254
+ all (`OTEL_TRACES_SAMPLER`, `OTEL_TRACES_SAMPLER_ARG`). A request billed to a plan, and every turn of a plan harness,
255
+ has `agentrun.billing=plan` and no token counts. No span holds content (a prompt, a message, a tool's arguments or
256
+ result), whatever `OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT` says; content capture comes later. Reasoning tokens are
257
+ not on chat spans yet: the usage a run's requests are booked with does not count them apart. Nor is
258
+ `gen_ai.response.model`: the model asked for is `gen_ai.request.model`. The exporter takes the standard
259
+ `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TIMEOUT`, and the resource `OTEL_SERVICE_NAME` and
260
+ `OTEL_RESOURCE_ATTRIBUTES` (put `deployment.environment.name` there); `service.name` is `agentrun` unless set. Runs never
261
+ receive these settings: no `OTEL_*` variable reaches a run's harness, tools or computer, and a run's own process is
262
+ handed them apart from its environment. Spans are sent in the background, so a run's end never waits on the collector;
263
+ a server or runner that stops waits at most 3 s to send what is left, and a collector that is down costs one log line
264
+ and the dropped spans. Unset, or with `OTEL_SDK_DISABLED=true`, no OpenTelemetry code loads and nothing is sent.
265
+
266
+ To send traces to Sentry (two variables: its OTLP endpoint and its `x-sentry-auth` header) or to any other backend
267
+ through an OpenTelemetry Collector, and for what Sentry's Agents view shows of a run, see
268
+ [Send run traces to Sentry or any OpenTelemetry backend](../../docs/traces.md).
269
+
212
270
  ## Anonymous usage counts
213
271
 
214
272
  The server sends six anonymous events: `server_started`, a daily `heartbeat`, `first_run_completed`, and, for
@@ -413,10 +471,22 @@ It names no path, size or version. One route serves as both liveness and readine
413
471
  and a 200 says it can work, and the platforms here take one path.
414
472
 
415
473
  A run's runner renews its claim on the run every 10 s, for a claim of 30 s. A runner that stops, or cannot renew in
416
- time, writes nothing more to the run, and the store refuses any write under a claim the run has moved past. Once the
474
+ time, writes nothing more to the run, and the store refuses any write under a claim the run has moved past. On SQLite
475
+ the runner counts a claim's 30 s from when the store granted it, not from when it asked, so a claim or renew that
476
+ waited for a busy disk keeps the time the store gave it; the runner still stops 5 s before the store's claim runs out.
477
+ On Postgres it counts from when it asked. A renew the store never answers in time still loses the run. Once the
417
478
  claim lapses another runner claims the run and resumes it from its journal. A run's own computer doesn't survive a
418
479
  runner loss, a crash, a server stop or a park (the claim that resumes the run starts a new one, and says so on the
419
- timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does. `agentrun-serve runner --check --data DIR --name N`
480
+ timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does.
481
+ The exception is a park's keep: a desktop, phone or sandbox a park keeps for 10 minutes comes back to the run's resume.
482
+ One that only the runner that kept it can reach again (a Docker container, a machine that dials the server) holds the
483
+ parked run for that runner while it is there under the same process (its word in the last 30 s, not refusing) and the
484
+ keep lasts: no other runner claims the run to resume it, so a runner whose loops are full makes an answer wait until
485
+ then. A stop or a cancel never waits: any runner claims the run at once and ends it without taking the kept machine
486
+ (also when the kept row can't be read then), which the runner that kept it ends at its time, or sooner at its janitor's
487
+ next pass once the run is over; another runner's janitor leaves both the row and the machine. Once that runner
488
+ is gone, any runner claims it, starts a new one, and the timeline says `The desktop wasn't kept: the runner that kept it
489
+ is gone.` `agentrun-serve runner --check --data DIR --name N`
420
490
  (or `AGENTRUN_RUNNER_NAME=N` in place of `--name`) checks the runner's environment by name (its store, its seal key,
421
491
  every run-facing name its server holds, a forwarder on loopback) and whether the runner named `N` has a fresh
422
492
  heartbeat: it exits 0 when both hold, 1 when either does not, and 2 when no name is given. `--check --env` checks the
@@ -1224,7 +1294,7 @@ this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's ke
1224
1294
  [tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
1225
1295
  `openai/gpt-6.1-sol` with `OPENAI_API_KEY`, `particle/particle-1` with `PARTICLE_API_KEY`, then
1226
1296
  `openrouter/openai/gpt-6.1-sol` with `OPENROUTER_API_KEY`. With none of those, pi's default is the first model of this
1227
- machine's Ollama that calls tools ([below](#on-this-machines-ollama)). Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
1297
+ machine's Ollama that calls tools ([below](#on-this-machines-ollama)), and so is claude-agent's and Goose's. Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
1228
1298
  claude-agent takes the Anthropic one and codex the OpenAI one. A workflow revision names no model: each model node names a tier (`fast`, `default`
1229
1299
  or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
1230
1300
  to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
@@ -1511,7 +1581,10 @@ The sign-in is the owner's alone, over the owner's signed-in session (the API to
1511
1581
  sign-in tab ends on a page that won't load: copy its whole address into the console, which sends it as
1512
1582
  `POST /v2/settings/chatgpt/sign-in/finish` `{"redirect_url": "..."}`.
1513
1583
  - `GET /v2/settings/chatgpt` says `state`: `signed_out`, `pending` (with `authorize_url` and `expires_at`), `signed_in`
1514
- (with `email`, `plan` and the plan's `models`) or `expired`.
1584
+ (with `email`, `plan` and the plan's `models`) or `expired`. A `pending` sign-in with no code back after its first
1585
+ minute also carries a `hint`. It names the likely cause first: the ChatGPT workspace's admin has turned off open-source
1586
+ apps (External access → OSS → Use ChatGPT plan). OpenAI shows that refusal on its own page and never sends the browser
1587
+ back.
1515
1588
  - `DELETE /v2/settings/chatgpt` signs out: it removes the sign-in here and revokes it at OpenAI, and answers
1516
1589
  `{"revoked": true}` when OpenAI confirmed it (or nothing was signed in, as when it only cancels a waiting sign-in).
1517
1590
  When OpenAI didn't confirm it, the answer is `{"revoked": false, "message": "Signed out here. OpenAI didn't confirm
@@ -1542,28 +1615,77 @@ run agents on it.
1542
1615
 
1543
1616
  On a server one person runs on their own machine, Claude Agent can run on that person's Claude plan through the Claude
1544
1617
  Code CLI's own login. The CLI holds the login and calls Anthropic itself. AgentRun never reads, copies, stores or relays
1545
- the login. It tells the CLI where the login is and asks it `claude auth status`, nothing else. Settings → Model keys
1618
+ the login's tokens. It tells the CLI where the login is and asks it `claude auth status`, nothing else. Settings → Model keys
1546
1619
  has the row **Use Claude Code's login on this machine**, over these routes:
1547
1620
 
1548
1621
  - `PUT /v2/settings/claude-login` `{"only_me": true, "place": "agentrun"}` turns it on. `only_me` is the owner's word
1549
1622
  that they alone run agents on this server. `place` is where the login is: `agentrun` (the default) is AgentRun's own
1550
- login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login
1551
- (`~/.claude`), which you opt into by name. A server where more than one person can start runs (more than one API
1552
- token, the API-only profile) refuses it with `403` and one line saying why, and a turn-on saved before is dropped
1553
- when such a server starts.
1623
+ login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login, which
1624
+ you opt into by name. Its folder is the one the CLI uses: `CLAUDE_CONFIG_DIR` when the server's environment sets it to
1625
+ an absolute path, else `~/.claude`. A Claude Code that keeps its login in another folder is found only when AgentRun
1626
+ is started with `CLAUDE_CONFIG_DIR` set to that folder. Where the server's environment sets
1627
+ `CLAUDE_SECURESTORAGE_CONFIG_DIR` (an absolute path, or empty), the CLI is asked, signed in and run with it, as the
1628
+ person's own Claude Code with that variable keeps its tokens: in that folder, or, empty, in `~/.claude` and on macOS
1629
+ the Keychain item with no suffix. A server where more than one person can start runs (more than one API token, an
1630
+ [API key made for an app](#api-keys-for-your-apps), the API-only profile) refuses it with `403` and one line saying
1631
+ why, and a turn-on saved before is dropped when such a server starts. The setting names the machine it was turned on
1632
+ for by an id the server makes once in its data folder (`machine-id`, 0600) and reads back on every later start,
1633
+ never by the hostname, which on a laptop changes with the network. Two data folders are two machines. A setting
1634
+ saved before the id reads as `other_machine` until it is turned on again.
1554
1635
  - `GET /v2/settings/claude-login` says `state`: `off`, `signed_in` (with the `account` the CLI names: method, email,
1555
1636
  organization, plan), `signed_out`, `no_cli` (claude-agent's first run installs the pinned CLI), `unknown`, or
1556
- `other_machine`. `command` is the line that signs the CLI in at the login's place, for a terminal on the server's
1557
- machine. Where the console is on that machine (a server on loopback with no public address), `can_start` is true and
1558
- `POST /v2/settings/claude-login/login` starts the pinned CLI's own `auth login`, which opens a browser there.
1637
+ `other_machine`. `folder` is the folder whose login the CLI is asked about, and `machine` is this machine's own
1638
+ login folder (`machine.source`: `CLAUDE_CONFIG_DIR` or `default`; `machine.credentials`: the server's
1639
+ `CLAUDE_SECURESTORAGE_CONFIG_DIR`, when it sets one). `command` is the line that signs the CLI in at
1640
+ the login's place, for a terminal on the server's machine. Where the console is on that machine (a server on loopback
1641
+ with no public address), `can_start` is true and `POST /v2/settings/claude-login/login` starts the pinned CLI's own
1642
+ `auth login`, which opens a browser there. It runs with the same variables as `command`, so it signs in at `folder`,
1643
+ and the status is read there too, since `auth login` writes the account it signed in to its config dir. On
1644
+ `machine` with the default `~/.claude`, the CLI is signed in as the person's own `claude` runs: no
1645
+ `CLAUDE_CONFIG_DIR` or `CLAUDE_SECURESTORAGE_CONFIG_DIR`, in their home, so it writes the account in `~/.claude.json`
1646
+ and the tokens where their Claude Code keeps them (in `~/.claude`; on macOS the Keychain item `Claude Code-credentials`).
1647
+ `command` there is `env -u CLAUDE_CONFIG_DIR -u CLAUDE_SECURESTORAGE_CONFIG_DIR ... auth login`, so a terminal that
1648
+ exports either still signs in at that login. env is a program, so the line runs alike when pasted into sh, bash,
1649
+ zsh, fish or tcsh; a CLI path holding `=`, which env would read as a variable, goes to `sh -c` as its `$0`. env skips
1650
+ a `claude` alias or function of the terminal's shell. A run
1651
+ there reaches the same tokens: on macOS with `CLAUDE_SECURESTORAGE_CONFIG_DIR` set and empty, the CLI's way to name
1652
+ that item while the run has a config dir of its own; elsewhere with it set to `~/.claude`. On every place, the status
1653
+ check never runs the CLI on the login's own account file, which the CLI rewrites on every start whose config version
1654
+ is not its own: each check copies `.claude.json` (`~/.claude.json` on `machine` with the default folder, else the
1655
+ login folder's), opening the original only to read it, into a folder of its own, gives the CLI that folder as its
1656
+ config dir and the tokens as a run reads them, and removes the folder however the check ends. The copy (0600, in a
1657
+ 0700 folder) leaves out the fields that hold secrets: `primaryApiKey` (the API key an older Claude Code signed in
1658
+ with), `env` and every `mcpServers`, whose env and headers hold tokens. Only a regular file of at most 32 MiB is
1659
+ copied: a file that doesn't parse as a JSON object, a bigger one, a FIFO or a device is not copied at all, and the
1660
+ check never waits on one. A run's config dir has none of them either, so the status says what a run gets. A check
1661
+ killed mid-way leaves its folder (`agentrun-claude-status-*` in the temporary folder); a server where the login is
1662
+ allowed removes this user's ones as it starts, once the check has ended by the end it wrote in its folder (its limit,
1663
+ however long, and 2 s) and 15 s more, or, for a folder with none, once older than twice the check's limit. At its
1664
+ limit the check asks the CLI to go (SIGTERM), kills it 1 s later, and waits at most 1 s more for its output, so a CLI
1665
+ that ignores the TERM, or a process it started that holds its output open, never holds the check. The status check
1666
+ runs in the person's home (the server's `HOME` when it is an absolute path, else the OS's home, read once where the
1667
+ server makes the login) on every place, as the sign-in does, and so does a run on the login
1668
+ on macOS: the CLI reads its tokens there from the login keychain, which is under that home. So a run there writes the
1669
+ CLI's cache and logs under the person's `~/Library/Caches/claude-cli-nodejs`, where they stay; removing that folder is
1670
+ safe. `sign_in`
1671
+ says what became of that sign-in while the server runs: `waiting` for the browser since `started_at`, `signed_in`,
1672
+ `timed_out` (no answer from the browser within 10 minutes, so it was ended and a sign-in page still open can't
1673
+ finish), `failed` (the CLI ended without signing in, with its `exit_code`), or `not_started`. A second start ends a
1674
+ sign-in that still waits, and so do turning the mode off, a `PUT` that moves the login to the other `place`, and
1675
+ stopping the server, which waits for that CLI to exit. A `PUT` at the same `place` leaves it waiting.
1676
+ The CLI dies with the server, as a session's CLI does, so a server that is killed outright (SIGKILL, the OOM killer)
1677
+ leaves no sign-in waiting on the browser's port.
1559
1678
  - `DELETE /v2/settings/claude-login` turns it off. The login stays as the CLI keeps it.
1560
1679
 
1561
1680
  While it is on, a claude-agent run on an `anthropic/<model>` model goes on the login: its CLI gets no
1562
1681
  `ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN` or key, no model proxy runs, and the CLI's sandbox denies its commands
1563
1682
  reads of the login. A model named on a gateway or OpenRouter keeps its key, and so does a run started with its own
1564
1683
  `model_key`. With no key at all, claude-agent's default
1565
- model is `anthropic/claude-sonnet-5-5`. A run whose login is signed out fails at its start and says so. It never
1566
- switches to a key. The run books its tokens and no dollars (`cost.plan`, `on: "claude_code"`), and the plan's own limits
1684
+ model is `anthropic/claude-sonnet-5-5`. A run whose login is signed out fails at its start and says so. A status check
1685
+ the CLI outlasts (15 s) is asked once more; still no answer, the run goes on when the same login read signed in within
1686
+ the last 10 minutes in this server process (at a run's check or in Settings), else it fails saying the check timed out.
1687
+ A check where the CLI answered nothing that reads as a status gets the same. Any other failure of the check, such as no CLI at
1688
+ its path, fails the run at once in the check's own words. It never switches to a key. The run books its tokens and no dollars (`cost.plan`, `on: "claude_code"`), and the plan's own limits
1567
1689
  apply. Only a run in a runner place, on the machine the mode was turned on for, goes on the login. A run placed in a
1568
1690
  sandbox, or on another machine, uses the keys. The login is the server's user's, so a run on it needs runs under that
1569
1691
  user: where each run is a user of its own (the image, `run_isolation: "uid"`), a claude-agent run that would go on the
@@ -1580,7 +1702,8 @@ saved earlier is dropped when the server starts, and claude-agent runs on the mo
1580
1702
 
1581
1703
  Start Ollama (`ollama serve`, or its app) beside your own server and it lists Ollama's models itself, with no key, no
1582
1704
  gateway and no restart: `GET /api/tags` for the tags, `POST /api/show` for each one's capabilities and trained context. Each chat model
1583
- is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi, and the console names it
1705
+ is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi and for every harness on a wire the
1706
+ route translates, and the console names it
1584
1707
  `<tag> · local (Ollama)`, on a run's page too (from the run's `tokens` usage line, `provider` `ollama` and `model` the
1585
1708
  tag), so a run on the default says which model it ran on. An embedding model is left out. A model pulled or an Ollama started after the server shows in capabilities
1586
1709
  within half a minute (the listing is kept that long, and asked again behind the next answer). A down or stuck Ollama
@@ -1601,7 +1724,8 @@ seconds), and a run on any other model, a key's default included, never asks Oll
1601
1724
  - Context: each request is Ollama's own `/api/chat`, streamed, with `options.num_ctx` the least of 65,536, the model's
1602
1725
  trained context (where `/api/show` names one) and `OLLAMA_CONTEXT_LENGTH` (where the server's environment sets it to a
1603
1726
  whole number above 0, as a person short of memory does for Ollama itself). The model's context window here is the same
1604
- number, so pi compacts before Ollama would cut the prompt.
1727
+ number, so pi compacts before Ollama would cut the prompt. `agentrun service install --env
1728
+ OLLAMA_CONTEXT_LENGTH=<tokens>` gives the limit to the service.
1605
1729
  - Thinking: a model whose capabilities include `thinking` has its reasoning split out by Ollama. For any other, an
1606
1730
  answer that opens with `<think>` has that part as thinking up to `</think>`, the split Ollama makes for a thinking
1607
1731
  model, so the tags never reach the answer.
@@ -1610,11 +1734,16 @@ seconds), and a run on any other model, a key's default included, never asks Oll
1610
1734
  - Cost: $0, booked as a known cost. Its requests never count toward the server's [limit on free
1611
1735
  requests](#a-limit-on-free-requests): there is no shared quota behind them. An agent's own `max_requests` counts them,
1612
1736
  with its other free requests, so a run on Ollama that keeps calling tools still stops there.
1613
- - Harness: pi alone. claude-agent, codex and opencode never list them.
1737
+ - Harness: pi, and every harness on a wire the route translates. That wire is Anthropic's Messages: claude-agent,
1738
+ Goose, and a harness module on it. Its requests go through the same translation as pi's: the same `/api/chat`,
1739
+ `num_ctx`, tools and cost. A Messages client's token count (`/v1/messages/count_tokens`) is answered there without
1740
+ asking the model, an answer it asks for unstreamed comes back whole (or as a 500 error with words when part of the
1741
+ stream doesn't read), and every model id it sends (Claude Code's small model too) runs the one tag. claude-agent turns its own tool search off on these models. codex and opencode, on
1742
+ OpenAI's Responses, never list them.
1614
1743
  - Cloud models: an Ollama cloud model (a `-cloud` tag, with `remote_host` and `remote_model` in `/api/tags` or
1615
1744
  `/api/show`) runs on ollama.com, not here, so it is never listed: never local, never $0, never the default.
1616
- - Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi runs on the first model Ollama
1617
- lists that calls tools. Any key wins. A model without tools is pickable, never the default. Ollama lists the model
1745
+ - Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi and every harness on a wire the
1746
+ route translates run on the first model Ollama lists that calls tools. Any key wins. A model without tools is pickable, never the default. Ollama lists the model
1618
1747
  pulled last first, so pulling one can change that default, and a saved agent that names no model follows it. Name the
1619
1748
  model (`ollama/<tag>`) to pin it.
1620
1749
 
@@ -1645,7 +1774,7 @@ agent_not_runnable`, with `details.unbound` and `details.missing`).
1645
1774
  | `ask_person` | Ask the person who started the run; the turn ends until a message answers | nothing | no, no |
1646
1775
  | `web_fetch` | Read one web page from a public host through the guarded direct fetch, or through Parallel's extract where Parallel is picked ([search and fetch](#search-and-fetch)), a part at a time: `{url, offset?, max_chars?}` in, a Page out, `{ok, url, status, title, text, chars, truncated?, original_chars?, beyond_read?, offset?, next_offset?, html_chars?, converted?, links, links_omitted?, via, parallel?, refused?, error?}` | nothing (`PARALLEL_API_KEY` for Parallel, one billed extract a page a run) | yes, yes |
1647
1776
  | `web_search` | Search the web, natively where the harness or the model's provider can, else through Parallel where the server holds its key, else keyless through Exa, or through the provider picked ([search and fetch](#search-and-fetch)): `{query, n?}` in, `{provider, query, results: [{url, title, snippet, published?}], text?}` or `{error}` out | nothing (`PARALLEL_API_KEY` for Parallel) | yes, yes |
1648
- | `web_save` | Download one file from a public URL into the run's `work/` and keep it there, for a link that expires (a generated image, audio or video): `{url, path}` in, `path` relative to `work/` and a bare name under `media/`; `{ok: true, path, bytes, content_type, duration_s?, url}` or `{ok: false, url, refused \| error}` out, `duration_s` an mp3, wav, mp4 or m4a's length in seconds read from its bytes. Never overwrites | nothing | no, no |
1777
+ | `web_save` | Download one file from a public URL into the run's `work/` and keep it there, for a link that expires (a generated image, audio or video): `{url, path}` in, `path` relative to `work/` and a bare name under `media/`; `{ok: true, path, bytes, content_type, duration_s?, url}` or `{ok: false, url, refused \| error}` out, `duration_s` its length in seconds when it is audio or video whose bytes give it (below). Never overwrites | nothing | no, no |
1649
1778
  | `browser` | A hosted browser, Browserbase's or Kernel's, on pi-browser's durable adapter: `snapshot`, `run`, `screenshot`, `browser_read`, `browser_release`, `browser_relaunch`, `browser_downloads` and `browser_upload` (into and from the run's `work/`); Kernel keeps no downloads, so a run on Kernel has no `browser_downloads` | `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID`, or `KERNEL_API_KEY` | yes, no |
1650
1779
  | `monid:<provider>/<endpoint>`, `monid:<provider>/*` | One monid endpoint, or every endpoint monid lists for a provider (at most 50), each pinned at the save and run as a tool of its own, paid per call from the monid wallet: `{body?, queryParams?, pathParams?}` in, the run's `output`, `price` and `cost` out ([monid](#monid)) | `MONID_API_KEY` | no, no |
1651
1780
  | `pdf_pages` | A workflow call only: `{path, maxPages?, dpi?}` in, `{name, pageCount, dpi, pages: [{page, image}], text}` out. Draws a document's first pages (3 by default, at 110 dpi) as PNGs under the run's `work/pages/<stem>/<dpi>/` (`<stem>`: the document's path below its directory made one name, with a short hash, so two documents of one file name never share pages), the dpi lowered so a page's long side is at most 1568 px, with its text (`pdftotext`, cut at 20,000 characters). A PNG or JPEG passes through as one page, scaled down to 1568 px. `path` is under `--documents` or the run's `work/`, never outside | `pdftoppm`, `pdftotext` | no, yes |
@@ -1793,14 +1922,15 @@ Each child books on the run's cap, so size the cap for K passes, not one.
1793
1922
 
1794
1923
  `web_search` and `web_fetch` work on every harness with only a model key. Each resolves, for a run, in one order: (1) the
1795
1924
  provider the user picked, optional: the agent's own (`definition.tool_settings`) over the server's
1796
- (`PUT /settings/tools`); (2) the native tool, the harness's own or its model provider's hosted one (on claude-agent
1797
- only where it is picked: `auto` there skips Claude's own search, an explicit `native` pick); (3) for
1925
+ (`PUT /settings/tools`); (2) for
1798
1926
  `web_search`, Parallel, where the server holds a Parallel key (`PARALLEL_API_KEY` in its environment, or one saved on Tool
1799
- keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (4) the keyless
1800
- fallback, Firecrawl's public MCP endpoint (for `web_search` with Exa's behind it). A revision's `tools` (and a pack's grant) names the capability, never a provider. On codex, `auto` is
1801
- Codex's own search, except behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
1802
- counts no searches to price) or under a spend cap (its request has no input bound, which a cap cannot
1803
- admit), where it is Parallel on the server's key, else keyless Firecrawl. `off` turns `web_search` off: nothing is
1927
+ keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (3) the keyless
1928
+ fallback, Firecrawl's public MCP endpoint (for `web_search` with Exa's behind it). A revision's `tools` (and a pack's grant) names the capability, never a provider.
1929
+ `auto` is agentrun's own search on every harness. The native search, the harness's own (Claude's WebSearch, Codex's
1930
+ live search) or on pi one request to the run's own model provider with its hosted search, runs only where `native` is
1931
+ picked; it is unavailable behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
1932
+ counts no searches to price) or under a spend cap (Codex's request has no input bound, and Claude's searches have
1933
+ per-use fees, which a cap cannot reserve yet). `off` turns `web_search` off: nothing is
1804
1934
  searched, and an agent naming it is refused (`409`) until it is turned on again. A pick of `firecrawl-keyless` is keyless
1805
1935
  Firecrawl with keyless Exa behind it, and a pick of `exa-keyless` is keyless Exa alone, the key held or not.
1806
1936
  A workflow's model nodes may each run on another tier's model, so a workflow's `web_search` never searches natively:
@@ -1809,8 +1939,8 @@ unavailable for a workflow.
1809
1939
 
1810
1940
  | | `claude-agent` | `codex` | pi |
1811
1941
  | --- | --- | --- | --- |
1812
- | `web_search`, `auto` (the default) | Parallel on the server's key, else keyless Firecrawl: Claude's own WebSearch is the `native` pick | Codex's own search, each search booked; behind a gateway, on OpenRouter or under a spend cap, Parallel on the server's key, else keyless Firecrawl, a host tool | one request to the run's own model provider with its hosted search (Anthropic, OpenAI direct); behind a gateway (`AGENT_MODEL_BASE_URL`) or on another provider, Parallel on the server's key, else keyless Firecrawl |
1813
- | `web_search`, `native` | Claude's own WebSearch, unavailable on OpenRouter or under a spend cap | the same, unavailable behind a gateway, on OpenRouter or under a spend cap | the same, unavailable where there is none: never a keyless search |
1942
+ | `web_search`, `auto` (the default) | Parallel on the server's key, else keyless Firecrawl, a host tool: Claude's own WebSearch is the `native` pick | the same: Codex's own search is the `native` pick | the same: the model provider's hosted search is the `native` pick |
1943
+ | `web_search`, `native` | Claude's own WebSearch, unavailable on OpenRouter or under a spend cap | Codex's own search, each search booked; unavailable behind a gateway, on OpenRouter or under a spend cap | one request to the run's own model provider with its hosted search (Anthropic, OpenAI direct); unavailable behind a gateway (`AGENT_MODEL_BASE_URL`) or on another provider: never a keyless search |
1814
1944
  | `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
1815
1945
  | `web_search`, `firecrawl-keyless` | Firecrawl's public MCP search, keyless Exa's behind it, a host tool | the same | the same |
1816
1946
  | `web_search`, `exa-keyless` | Exa's public MCP search alone, a host tool | the same | the same |
@@ -2311,7 +2441,8 @@ Composio is an MCP server like any other, so it needs no adapter of its own. Set
2311
2441
  preset: you give your Composio API key, a toolkit (`github`, `slack`...), the actions to grant (picked from the
2312
2442
  toolkit's list) and a server name, and the server has Composio make a managed MCP server for them, then saves it as an
2313
2443
  ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
2314
- `{api_key, toolkit}` lists the actions; `PUT /v2/settings/mcp-servers/{name}/composio` `{api_key, toolkit, tools,
2444
+ `{api_key, toolkit}` lists the actions, and `POST /v2/settings/mcp-servers/composio/toolkits` `{api_key}` lists the
2445
+ toolkits Composio offers (`{toolkits: [{slug, name}]}`, by name) for the console's toolkit picker; `PUT /v2/settings/mcp-servers/{name}/composio` `{api_key, toolkit, tools,
2315
2446
  user_id?, auth_config_id?, price_usd?}` makes and saves the server. In place of `api_key`, `"api_key_env":
2316
2447
  "COMPOSIO_API_KEY"` reads the key from that variable, as the server and each runner were started with it, at each use and keeps no copy: the
2317
2448
  way an [API-only](#api-only) server's token saves one. That key is only ever sent to Composio's own origin, fixed in
@@ -2326,8 +2457,13 @@ server. `price_usd` (0 or more, as a `prices` value) is what each call costs you
2326
2457
  price, so a call is held under its run's cap and booked as the run's tool cost (its trace span's `usd`, the run's
2327
2458
  `cost.usd`), as any priced MCP tool's. A re-save that names no price keeps the server's prices for the actions it still
2328
2459
  lists. Composio's server can leave out an action it was allowed (it did for `HACKERNEWS_GET_FRONTPAGE`), so the answer's
2329
- `not_served` names any chosen action the saved server doesn't list. Both routes are the owner's session alone, and a
2330
- saved Composio server is gated, approved and shown on the Timeline as any MCP server's tools are, "not metered" until
2460
+ `not_served` names any chosen action the saved server doesn't list. These routes are the owner's session alone. A refresh of a saved Composio server also reads its account at Composio,
2461
+ and every read of the server then says it as `composio_account: {state, labels?, checked_at}`: `connected` with each
2462
+ account's label (its alias, else the name Composio shows, else its word id; never its id or a token), `pending` while
2463
+ its connect link is unfinished, `expired`, `none`, or `unknown` when Composio didn't answer. An account Composio answers as
2464
+ another user's is never the server's, and a server whose recorded user is empty or `per_run` is never asked about (`unknown`).
2465
+ The API token sees `composio_account` too, in a server's full read: its label may be the account's email.
2466
+ A saved Composio server is gated, approved and shown on the Timeline as any MCP server's tools are, "not metered" until
2331
2467
  you price them (`price_usd`, or the server's `prices`). Composio's own meta tools stay refused, and the helper actions
2332
2468
  that connect an account are left off the server's address. Deleting the server in Settings deletes what its save made in Composio too, with the saved key: the Composio MCP server, the connected account its connect link started (the link with it) and the auth config it made (Composio's "already gone" is fine). What another saved server uses is kept until the last of them goes, and what was there before the save (an auth config or account you had) is never deleted. The `DELETE` answers `200 {deleted: true, composio: {removed, note}}`: the note says what it removed, what it kept and why, and, when Composio refuses or does not answer, what is left to remove in Composio yourself (`removed: false`; the server is still forgotten here). The console shows it. A save that fails removes in Composio what it made there and never what it found, and its error names what is left when Composio refuses that too (a 422 on a field says it in `details.composio` as well). A save over a preset server removes, once it is saved, the Composio MCP server its earlier save made, and what that save made and the new one no longer stands on (the account of another `user_id`, the auth config of another toolkit), with the key it was made with, unless another saved server uses it, and answers `composio: {removed, note}` saying so. An ordinary `PUT` that moves a preset server to another address makes it another service's server: it removes what the preset made for it in Composio as its delete would, and answers `composio` too. While Composio triggers use the server, that move, and a preset save over it as another `user_id` or auth config, are refused as its delete is (`409 composio_in_use`, naming them). Preset saves and MCP server deletes run one at a time, so a delete never removes what a save in progress reuses; an ordinary save of a preset server lists its tools at once and takes its turn only to write the server and clean up.
2333
2469
  [Connect Composio tools and triggers](../../docs/tutorials/composio.md) walks through the preset and a Composio
@@ -2407,8 +2543,10 @@ its authorization server refused: sign in again), null for `auth.type` none. No
2407
2543
  credential; a server's error text is cut of the values sent before it is shown. `POST .../{name}/refresh` lists the
2408
2544
  tools again with the saved URL and credential, keeps them, and answers `{added, removed, changed, server}`: `changed`
2409
2545
  names a tool whose title, description, schemas or annotations differ. `DELETE .../{name}` forgets the server and its
2410
- credential. Capabilities' `features.mcp_client` says `transports: ["streamable-http"]`, the `auth` types and `at_rest:
2411
- "sealed"`.
2546
+ credential. Capabilities' `features.mcp_client` says `transports: ["streamable-http"]`, the `auth` types, `at_rest:
2547
+ "sealed"`, and `composio_per_run: true`: a per-run Composio server takes each run's own Composio account, named in the
2548
+ run's `mcp_auth`. A backend in front of an API-only server reads it there, since that server does not serve the API
2549
+ document.
2412
2550
 
2413
2551
  ### A credential handed with each run
2414
2552
 
@@ -3214,6 +3352,16 @@ warning, as a github trigger is with GitHub not connected. The first package is
3214
3352
  rules of an apply are in [templates/README.md](https://github.com/Parcha-ai/agentrun/blob/main/packages/serve/templates/README.md);
3215
3353
  `agentrun template validate DIR` checks a folder as the server does.
3216
3354
 
3355
+ `GET /v2/marketplace/templates` lists the templates on [marketplace.agentrun.ai](https://marketplace.agentrun.ai), the
3356
+ list the marketplace publishes (`/search.json`), each with `here`, the id of the package on this server that it is
3357
+ (`x-agentrun-serve: "marketplace/1"`). The server reads the list only when asked, never at its start, keeps it 5
3358
+ minutes, and keeps the last good one through a failed read (`state: "stale"`); with none it answers `unreachable` and an
3359
+ empty list, always with a 200. Nothing on the list is imported or run: an entry that names its `source` installs with
3360
+ `POST /v2/templates/import`, its publisher trusted once, and one that names none from its marketplace page. The
3361
+ console's Templates and Build pages list this server's packages, then the marketplace's others.
3362
+ `AGENTRUN_MARKETPLACE=off` reads none, as does `--faux` unless it names an address; `AGENTRUN_MARKETPLACE=<https
3363
+ address>` reads that site's list.
3364
+
3217
3365
  `agentrun template eval DIR` (`agentrun-serve eval-template DIR`) runs a package's eval cases as real runs of its agent
3218
3366
  and grades each run with the case's graders: by default on a server of its own over a temp data directory, so it never
3219
3367
  touches yours, with each case's fake MCP servers on loopback and its corrections seeded through the learning API. Real
@@ -3238,7 +3386,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
3238
3386
  | `GET /capacity` | This server's own (`capacity/1`): the runs waiting for a runner and held by one, each live runner's version, slots and free slots, and the hand-backs within `?window=` minutes, read from the store ([capacity and health](#capacity-and-health)). Served under `AGENTRUN_API_ONLY=1` too. |
3239
3387
  | `GET /openapi.json` | Without a credential: this API as an OpenAPI 3.1 document, the `agentrun.v2/0` contract (vendored in `src/openapi/`, its source in `info`) with this server's own routes marked `x-agentrun-serve`, the operations it answers `501` marked `x-agentrun-serve-unsupported`, and a contract operation that takes more than the contract gives marked `x-agentrun-serve-changed` with each change named; `links.openapi` in capabilities points at it. |
3240
3388
  | `GET /capabilities` | Without a credential. `backend: local`, every feature flag present and true only when it works; `tools`, the tools an agentic revision may name; `workflows`, what a workflow revision's model nodes get and, in `workflows.decisions.providers`, the decision providers its typed questions run on; `models`, where models come from and the model of each tier. |
3241
- | `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0 ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's last fenced json block meets, which a completed run's `result.output` then holds (null when the answer doesn't meet it), kept by an edit that leaves it out. A template's answer schema is set here at apply, and a run a schedule trigger starts is handed that trigger's last completed `result.output` after its message; no other source's runs are, since each of their firings is a different event. Over 32 KiB, a scheduled run is handed only the fields the producing run's schema names in `x-carried`; carried arrays lose entries from the front until they fit, and the run is told how many. A save refuses an `x-carried` that is not unique root property names. `checkout` (agentic only): `pull_request` has the server check out, before each run's first turn, the pull request the run's GitHub event names, in `repo/` at its head with its base and merge base, using a read-only token of its GitHub App that the agent never holds ([GitHub triggers](#github-triggers-connect-github)); `none` clears it, and an edit that leaves it out keeps it. A field the store does not keep (`input_schema`) is `422 input_invalid` by name, and so is a definition that can never run here; one this host cannot run yet saves with `warnings` ([models](#models)). The ETag (`home_etag`) is the current revision's id. `GET /agents/{id}` adds `tools`, the tools its current revision grants with each one's provider ([search and fetch](#search-and-fetch)). It also adds `run_blockers` (`x-agentrun-serve: "runblockers/1"`): `{message, fields}` as a start with no overrides would be refused now (`409 agent_not_runnable`), or null. It is always null for an archived, native or SDK agent and for a revision whose MCP tools its first run pins, and the read asks no other service, so under the agent's `max_cost_usd` an OpenRouter decision model's missing price is named only once a save or a start has read OpenRouter's catalog: null is no promise that a start is accepted. |
3389
+ | `POST /agents`, `GET /agents`, `GET /agents/{id}` | `POST` takes `{definition, skills?, note?}` and makes the agent with its first revision, current. A definition has `instructions` (an agentic revision) or `workflow` (a workflow revision, checked by the DSL first), and `name`, `description`, `model` and `thinking` (agentic only), `harness` ([harnesses](#harnesses)), `place` ([place](#place)), `tools`, `tool_settings` ([search and fetch](#search-and-fetch)), `skills` (names; each `<name>/SKILL.md` is in `skills`) and `version`, which is the number the revision gets, and `max_cost_usd`, the agent's default cap (an agentic agent's or a workflow's), kept by an edit that leaves it out and cleared only by 0 ([spend cap](#spend-cap)), and `output_schema` (agentic only, at most 64 KiB): the JSON Schema the final answer's json block meets (its last fenced one, or the whole answer when it is one JSON object), which a completed run's `result.output` then holds (null when the answer doesn't meet it), kept by an edit that leaves it out. A template's answer schema is set here at apply, and a run a schedule trigger starts is handed that trigger's last completed `result.output` after its message; no other source's runs are, since each of their firings is a different event. Over 32 KiB, a scheduled run is handed only the fields the producing run's schema names in `x-carried`; carried arrays lose entries from the front until they fit, and the run is told how many. A save refuses an `x-carried` that is not unique root property names. `checkout` (agentic only): `pull_request` has the server check out, before each run's first turn, the pull request the run's GitHub event names, in `repo/` at its head with its base and merge base, using a read-only token of its GitHub App that the agent never holds ([GitHub triggers](#github-triggers-connect-github)); `none` clears it, and an edit that leaves it out keeps it. A field the store does not keep (`input_schema`) is `422 input_invalid` by name, and so is a definition that can never run here; one this host cannot run yet saves with `warnings` ([models](#models)). The ETag (`home_etag`) is the current revision's id. `GET /agents/{id}` adds `tools`, the tools its current revision grants with each one's provider ([search and fetch](#search-and-fetch)). It also adds `run_blockers` (`x-agentrun-serve: "runblockers/1"`): `{message, fields}` as a start with no overrides would be refused now (`409 agent_not_runnable`), or null. It is always null for an archived, native or SDK agent and for a revision whose MCP tools its first run pins, and the read asks no other service, so under the agent's `max_cost_usd` an OpenRouter decision model's missing price is named only once a save or a start has read OpenRouter's catalog: null is no promise that a start is accepted. |
3242
3390
  | `PUT /agents/{id}/definition` | The same body, checked [the same way](#models): a new revision, its parent the current one, made current. Without `skills` the current revision's skill files carry over. A definition that is the current revision already writes nothing, so a PUT sent twice makes one revision. An agent's id and name stay those it was made with (another name is `422` on `definition.name`). Its description is a label kept on the agent, not on a revision: a PUT that names a new one makes the next revision (even when nothing else changed) and writes the description with it in one commit, so a stale or refused edit changes neither; a PUT that leaves it out keeps it. `If-Match` that is not the current ETag is `412 precondition_failed`; the store compares it again inside the commit, so of two edits that read the same revision exactly one lands. The contract's body is taken too: the definition itself, with `If-Match` required (`412` without it) and `definition.version` greater than the current one (`422`). Any such version is taken, and always makes a new revision, the same definition included; the revision is numbered as this server numbers them, the next, and the answer says which; the route reads a body holding `definition` as this one, any other as the contract's. |
3243
3391
  | `GET /agents/{id}/revisions` | The agent's revisions, newest first: `revision`, `version`, `parent`, `kind`, `current`, `note`, `created_at` and the `definition`. |
3244
3392
  | `POST /agents/{id}/current` | `{revision}`: one of the agent's revisions becomes current again. |
@@ -3249,7 +3397,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
3249
3397
  | `POST /agents/{id}/runs`, `GET /agents/{id}/runs` | A run of the current revision, or of `revision`. An agentic run's input is `{content: string}`; a workflow run's is what its workflow's input schema takes. `file_ids` names [uploaded](#uploads) files, copied into the run's `work/inputs/` before it starts and named in its first message. `labels` (this server's own, `runlabels/1`) is the caller's map of its own strings for the run: at most 16 keys, each 1 to 63 letters, digits, `.`, `_`, `-` or `/` starting with a letter or a digit, each value 1 to 256 characters with no control character; kept as given, served as `labels` on every read of the run (`{}` when none), never read by the server otherwise, so no place for a secret. The agent's runs, newest first; `label` filters them as `GET /runs` does. |
3250
3398
  | `GET /runs` | Every agent's runs, newest first, a page of at most 100; `agent`, `revision` and `status` narrow it, `label=<key>:<value>` (`runlabels/1`, split at the first `:`, once per request) keeps the runs holding that label, and `archived=true` lists only archived ones. A failed run's summary carries its `error`, and a waiting run's its `pending`. |
3251
3399
  | `GET /runs/{id}` | The run: its revision, kind, status, state, result, error, `pending` (this server's own, `pending/1`: what a waiting run waits on, by `kind`: `{kind: "question", question, asked_at}` for a question it asked a person; `approval` for a tool call held for a person's approval, with the tool, its arguments and its price; `budget` for a run paused at its cap ([a run paused at its cap](#a-run-paused-at-its-cap)); `{kind: "browser", instruction, completion_condition, asked_at, expires_at}` for its agent's ask for the owner in its browser; or `{kind: "computer", computer: "desktop" \| "phone", instruction, completion_condition, asked_at, expires_at}` for its agent's ask for the owner on its desktop or phone; else null, a stopped turn's included) and cost (`basis` `reported`, `estimate` or `unpriced`, with its model requests' `tokens`: [A run's cost](#a-runs-cost-its-tokens-and-its-basis); $0 before its first model request, a cancelled run's included). |
3252
- | `GET /runs/{id}/timeline` | JSON pages with the change-number cursor (`after`, `next_after`, `reset`, `drop`, `has_more`, `final`, `wait_ms` long poll, and this server's own `limit`, 1 to 500 rows a page, default 500), or server-sent events with `Accept: text/event-stream` (`id` is the cursor, `Last-Event-ID` resumes). Rows sort by `seq`; the usage row (`Cost so far`), the run's running total, is always the last row, and moves to the end when a row comes after it. |
3400
+ | `GET /runs/{id}/timeline` | JSON pages with the change-number cursor (`after`, `next_after`, `reset`, `drop`, `has_more`, `final`, `wait_ms` long poll, and this server's own `limit`, 1 to 500 rows a page, default 500), or server-sent events with `Accept: text/event-stream` (`id` is the cursor, `Last-Event-ID` resumes). Rows sort by `seq`; the usage row (`Cost so far`), the run's running total, is always the last row, and moves to the end when a row comes after it. Beside the rows, `in_flight`: what a live run waits on now, each model request sent and not answered (from its booking's `runner.request`, stamped `at` when it left) and each tool call not returned, from when it was sent; empty once the run is final. A request sent or answered is a change of the page, as a row is. |
3253
3401
  | `POST /runs/{id}/messages` | To an agentic run: `steer` while the agent works, `answer` when it asked the person, `follow_up` after a stop or after it completed: a completed run opens again, the same run on its own session and store, takes a place under `--max-runs` (it waits for one when none is free), and completes again. A failed or cancelled run, an archived run and a run of an archived agent are `409 not_continuable` (a run of an agent [being deleted](#deleting-an-agent-another-system-owns), `409 agent_not_runnable`); a workflow run takes none (`501`). |
3254
3402
  | `POST /runs/{id}/stop`, `POST /runs/{id}/cancel` | Stop ends an agentic run's turn and leaves the run `input_required` and idle. Cancel ends a run `cancelled` once its process has exited. |
3255
3403
  | `POST /runs/{id}/archive`, `POST /runs/{id}/unarchive` | [Archiving](#archiving) one run. Answers the run, with `archived_at`. |
@@ -3269,9 +3417,11 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
3269
3417
  | `GET /runs/{id}/browser` | This server's own (`x-agentrun-serve: "liveview/1"`): the run's live browser view for the owner, `{state: "off", reason}`, `{state: "none"}` or `{state: "live", viewer}` ([the live view](#the-browsers-live-view)). |
3270
3418
  | `POST /runs/{id}/browser/hand-back` | This server's own (`liveview/2`): the owner's answer to the agent's ask for them in its browser, `{outcome: "done" \| "cancelled"}`; the first answer wins, a different one is `409 handoff_answered` ([the live view](#the-browsers-live-view)). |
3271
3419
  | `GET /runs/{id}/computer` | This server's own (`computer/1`): the run's live computer view for the owner, one family for every kind, `{state: "off", hold, why?}`, `{state: "none", kind, hold}` or `{state: "live", kind, viewer, hold}`, its viewer under `/runs/{id}/computer/live/`; the browser is kind `browser` here, beside its own route ([the live view](#the-browsers-live-view)). |
3420
+ | `GET` and `POST /settings/api-keys`, `DELETE /settings/api-keys/{api_key_id}` | [API keys for your apps](#api-keys-for-your-apps), this server's own routes (`x-agentrun-serve: "apikeys/1"`): the keys the owner makes in the console, each shown once and kept as a keyed hash. Making and revoking take the owner's signed-in session. |
3272
3421
  | `GET`, `PUT` and `DELETE /settings/webhook`, `POST /settings/webhook/test`, `GET /settings/webhook/deliveries` and `POST .../deliveries/{webhook_id}/redeliver` | [Webhooks](#webhooks), this server's own routes (`x-agentrun-serve: "webhook/1"`): the URL run notices are POSTed to, signed by the Standard Webhooks spec; never its secret but once. |
3273
3422
  | `GET` and `POST /triggers`, `GET`, `PATCH` and `DELETE /triggers/{id}`, `POST /triggers/{id}/fire`, `GET /triggers/{id}/firings`, `POST /triggers/{id}/secret`, `POST /hooks/{id}` (no token: [signed](#webhook-triggers)) | [Schedules](#schedules), this server's own routes (`x-agentrun-serve: "trigger/1"`): schedules that start an agent's capped runs, each firing once, and their history. |
3274
3423
  | `GET /templates`, `POST /templates/{name}/apply` | [Templates](#templates), this server's own routes (`x-agentrun-serve: "templates/1"`): the template packages it ships, and an apply that makes one's agent and triggers, all or nothing. |
3424
+ | `GET /marketplace/templates` | [Templates](#templates), this server's own route (`x-agentrun-serve: "marketplace/1"`): marketplace.agentrun.ai's templates as this server read them, each with the package here that it is. |
3275
3425
  | `POST /mcp` | This server's own route (`x-agentrun-serve: "mcp/1"`): the [MCP endpoint](#for-coding-agents), Streamable HTTP with one JSON-RPC message per POST (`initialize`, `ping`, `tools/list`, `tools/call`), answered as JSON, stateless. Its ten tools call these routes in process with the caller's token. The Bearer token only, never the page's cookie; a browser `Origin` other than this server's own is `403`; any other method is `405`. |
3276
3426
  | `GET /usage` | The runs' costs, by meter, agent, key, day or region (`key` and `region` are one line, `local`). By meter, `tools` holds the runs' paid tool calls and the workflow decisions Parallel charged on its own API, as `cost.tools_usd` does. A run of unknown cost adds what it is known to have spent so far (its `so_far_usd`: each priced charge, browser time and paid tools included) and is counted in `unpriced_runs` (in the total and in each line it is unknown on), so no sum is ever null, it never passes as $0, and a total is never below a line of its own: with `unpriced_runs` above 0 the total is a lower bound. `basis` says how the costs were reached ([A run's cost](#a-runs-cost-its-tokens-and-its-basis)). |
3277
3427
 
@@ -3437,11 +3587,28 @@ serves these routes alone:
3437
3587
  refused with `412` leaves it the token's), and one that lands while the token's is under way wins: the token's is
3438
3588
  `412`.
3439
3589
 
3440
- The names route above is the listing: there is no list or read of a server's address, auth or tools here, and no
3441
- generic save (`PUT /settings/mcp-servers/{name}`), so the token saves no server at an address or with headers of its
3442
- own. The preview, refresh, sign-in, Composio tool listing and every other MCP settings route stay refused. On the full
3590
+ The names route above is the listing: there is no list or read of a server's address, auth or tools here. The
3591
+ generic save (`PUT /settings/mcp-servers/{name}`) is a `404` unless the operator names the MCP origins it may save at,
3592
+ so by default the token saves no server at an address or with headers of its own. The preview, refresh, sign-in, Composio tool listing and every other MCP settings route stay refused. On the full
3443
3593
  server the token's `api_key_env` is `403`, as `api_key` is: the owner's session saves a Composio server there either
3444
3594
  way;
3595
+ - a per_run MCP server's save at an origin the operator names, for a backend whose runs each bring their own
3596
+ credential for a gateway it runs (such as a loopback forwarder): `AGENTRUN_API_ONLY_MCP_ORIGINS`, comma-separated
3597
+ origins (`https://mcp.example.com`), a plain setting. With it, the token's `PUT /settings/mcp-servers/{name}` saves
3598
+ `"auth": {"type": "per_run"}` at one of those origins, a new name or over a server the token saved that seals no
3599
+ credential, and each run hands its own credential in `mcp_auth`. A body that sends a credential (a bearer token, or
3600
+ headers with any other auth type) is `403`, as is a save over a server saved any other way or one that seals a
3601
+ credential. A per_run body at any other origin, any other auth type, and a Composio server's name (its own route
3602
+ saves it) are this profile's `404`. Each refusal comes before anything is sent to the address.
3603
+ `AGENTRUN_MCP_ALLOW_LOOPBACK=1` is still needed for a loopback origin. Unset or blank, the save is a `404` as before;
3604
+ an entry that is not an http or https origin alone, or a wildcard, stops the start, in words. The list holds past
3605
+ the save: drop an origin and restart, and a per_run server the token saved there is refused at a run's start, at
3606
+ an agent's save and at the next call of a run already going, and nothing is sent to it. Unset, the list is empty, so
3607
+ a per_run server the token saved with API-only off is refused until its origin is listed: list it before upgrading,
3608
+ or re-save it from the owner's signed-in session with API-only off, which makes it the owner's and leaves the save
3609
+ closed. The start logs one line (`api_only_mcp_off_list`) with the count and names of the servers off the list,
3610
+ never their addresses, and nothing when there are none. A server saved from the owner's signed-in session (which an
3611
+ API-only server doesn't serve) is the owner's, whenever it was saved, and the list does not govern it;
3445
3612
  - a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
3446
3613
 
3447
3614
  Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
@@ -3670,7 +3837,9 @@ back.
3670
3837
  `GET /v2/capabilities` lists each in `harnesses`, with `available` and, when not, the `reason`, and `default_model`: the
3671
3838
  model the harness runs when a definition names none (`provider/model-id`, as a save and a run resolve it), or null where
3672
3839
  it runs none (the harness does not run here, or no default model here runs on it: claude-agent never takes a gateway's
3673
- model). A definition naming a
3840
+ model). Its `models` are those a save takes; `ready_models`, those of them a run takes now, their provider connected here
3841
+ (its key set, or the ChatGPT sign-in where that is how the harness runs them). One that lacks only its key is in `models`
3842
+ and not in `ready_models`: a save of it warns, and the console's Model picker lists it only when asked. A definition naming a
3674
3843
  harness this server does not run yet saves with a warning on `definition.harness`, and a run of it is
3675
3844
  `409 agent_not_runnable` with `details.harness`; it never runs on pi instead. This server runs pi always, and
3676
3845
  `claude-agent`, `codex` and `opencode` when each adapter's package, pins and provider endpoint check out; the harness's
@@ -4710,13 +4879,27 @@ not metered and bills its own account outside the cap. fal is counted: a job sen
4710
4879
  toolkit `fal`, or at `mcp.fal.ai`) through `run_model`, `submit_job` or `submit_jobs` is priced before it is sent, at
4711
4880
  fal's unit price for its endpoint (the server's own `get_pricing`, read with the run's credential and kept five
4712
4881
  minutes) times the units the job's input states: its images, their megapixels, its text's characters, the seconds it
4713
- names, or, for dubbing, lip-sync, voice isolation and speech-to-text, which fal bills by the length of the media they
4714
- are given, that length, read from the file first. That price is held under the cap, a
4882
+ names (only on an endpoint whose input sets the length fal bills, such as Kling's or Veo's `duration`, and only in
4883
+ that field), or, for dubbing, lip-sync, voice isolation and speech-to-text, which fal bills by the length of the media they
4884
+ are given, that length, read from the file first. A length fal rounds up is rounded up the same way: a talking head's
4885
+ voice to whole seconds, ElevenLabs Music and dubbing to whole minutes. That price is held under the cap, a
4715
4886
  job the cap can't take is refused before it is submitted, and the job is booked as the run's tool cost, charged by the
4716
4887
  server, with the price and the count it came from. It is an estimate at fal's list price, not fal's invoice: fal
4717
- reports no cost for a job, and a minimum charge, a discount or a rate that depends on a setting `get_pricing` does not
4718
- list are not in it. A job whose units can't be known before it runs (one billed by compute time or tokens, one that
4719
- names no size or length, media whose length can't be read, an endpoint with no listed price) is refused under a cap,
4888
+ reports no cost for a job, and a minimum charge or a discount `get_pricing` does not list is not in it. Where fal's rate
4889
+ depends on a setting and `get_pricing` states one rate (Ideogram v3's and Ideogram character's `rendering_speed`,
4890
+ Veo's audio and resolution, Kling v3's audio and voice control, sync-lipsync's pro model, Nano Banana Pro's and Nano
4891
+ Banana 2's resolution, web search and thinking, Fabric's resolution), a job is priced at `get_pricing`'s rate times the ratio fal's model page gives its
4892
+ settings, a setting it leaves out at its default, plus any charge the page adds per unit (a web search, per image).
4893
+ Where the page and `get_pricing` disagree, the higher is held. The endpoints of those families (Ideogram v3 and
4894
+ character, Nano Banana Pro and 2, each also served as a Gemini image preview, Veo 3 and 3.1, Kling v3, sync-lipsync v2,
4895
+ Fabric 1.0) are each decided: priced by their settings or at one rate. Some of their video endpoints have no reader for
4896
+ the length fal bills (the changelog lists them). These endpoints' rates are decided, but their holds aren't yet: under a cap, a job on one is refused until its length can be read. Ideogram v4, v4.5 and v4.6 and Nano Banana
4897
+ 2.1 are such families with no rate decided, so all of them are refused under a cap. An image job whose `limit_generations` is anything but `true` or
4898
+ left out is refused under a cap too: `false` lets its prompt ask for more images than it names, each billed. A variant fal adds to one of them is refused under a cap until it is decided, in words that
4899
+ name it, never held at `get_pricing`'s one rate. Any other endpoint is priced at `get_pricing`'s one rate, whatever its
4900
+ settings. A job whose units can't be known before it runs (one billed by compute time or tokens,
4901
+ one that names no size or length, media whose length can't be read, an endpoint with no listed price, a setting value
4902
+ the model page names no rate for, a variant whose rate is not decided) is refused under a cap,
4720
4903
  in words that say why; with no cap it runs, booked as an unknown charge. A price saved for a fal tool takes the place
4721
4904
  of this. A request costs its input, plus the output it
4722
4905
  is sent with at the output price, plus any fee its tokens do not show (below). Its input is priced at its worst case:
@@ -51,6 +51,8 @@ export type AcpPackage = {
51
51
  cursorRootOf(binary: string, cmd: string): string | undefined;
52
52
  /** The form a model id an ACP agent lists takes (Cursor's `gpt-5.4-nano[reasoning=medium]` among them). */
53
53
  readonly MODEL_ID: RegExp;
54
+ /** The form a sign-in method's id an ACP agent lists takes (`gemini-api-key`): a recipe's keyMethod is checked by it. */
55
+ readonly AUTH_METHOD: RegExp;
54
56
  acpPlatform(): string | undefined;
55
57
  /** `pin`'s release for `platform` (default this host's) with its binary's digest, and its tree's when `tree`; undefined
56
58
  * where none is pinned so. */
@@ -1,8 +1,8 @@
1
- import type { AdapterFacts, AgentAdapter, SessionSpec } from "@parcha/agentrun-kernel";
1
+ import type { AdapterFacts, AgentAdapter, HarnessWire, SessionSpec } from "@parcha/agentrun-kernel";
2
2
  import { type HarnessPins, type LoadedSdk } from "./harness-install.js";
3
3
  import { type HarnessEntry } from "./harness-table.js";
4
4
  import type { ModelRef } from "./model.js";
5
- import { type InstallFix } from "./provider.js";
5
+ import { type InstallFix, type Provider } from "./provider.js";
6
6
  import type { SkillCheck, SkillFiles } from "./skills.js";
7
7
  /** Whether this server runs from npx's cache (`npx @parcha/agentrun-serve`), where there is no project to install a
8
8
  * package into: npm keeps what npx runs under `<npm cache>/_npx/<hash>/node_modules`. Read from where this file is, not
@@ -23,8 +23,9 @@ export declare function installedHere(name: string, from?: string): string | und
23
23
  */
24
24
  export declare function npxLine(spec: string, env?: NodeJS.ProcessEnv, installed?: (name: string) => string | undefined): string;
25
25
  /**
26
- * A start `npx @parcha/agentrun` made (NPX_PACKAGE_ENV) that a data directory refused because an earlier version wrote it
27
- * (store.ts StoreFromEarlierVersion, or SchemaVersionUnknown on an earlier release's store): the refusal's own first line,
26
+ * A start the agentrun launcher made (NPX_PACKAGE_ENV: by npx, or by the installer's bin/agentrun and its service, the
27
+ * same launcher) that a data directory refused because an earlier version wrote it (store.ts StoreFromEarlierVersion,
28
+ * or SchemaVersionUnknown on an earlier release's store): the refusal's own first line,
28
29
  * then the two ways on as commands to paste. That command keeps its data in ~/.agentrun wherever it is run, so a new
29
30
  * folder alone is not a new AgentRun. First, the old folder moved aside whole, so the same command starts this version
30
31
  * where it was, and the earlier version still opens what it holds; then this version on a new, empty folder: the same
@@ -86,7 +87,8 @@ export type ConfineChild = (child: Readonly<{
86
87
  /** What a run's adapter needs of serve: its model, the catalog that prices it as it prices pi's runs, the run's
87
88
  * confinement for the harness's own process, and the skills it loads itself (claude-agent's, codex's and opencode's,
88
89
  * which its own check took: skills.ts), and the run's clock when a template eval case sets one (claude-agent's turn date
89
- * reads it; absent, the real clock). */
90
+ * reads it; absent, the real clock). `heldRefusal`: the words a held run's model was refused in at its create
91
+ * (run-launch.ts hold.refused): its provider is the stand-in that refuses every request in them (providerOf). */
90
92
  export type AdapterNeeds = {
91
93
  model: ModelRef;
92
94
  models: {
@@ -99,7 +101,12 @@ export type AdapterNeeds = {
99
101
  unpriced?: ReadonlySet<string>;
100
102
  now?: () => Date;
101
103
  zone?: string;
104
+ heldRefusal?: string;
102
105
  };
106
+ /** Where a run's adapter sends its model's requests (providerFor), or, for a held run its model kept from running at its
107
+ * create, the stand-in (heldRefusedProvider): no key is read, and its proxy refuses every request in the create's words,
108
+ * sending none. */
109
+ export declare const providerOf: (wire: HarnessWire, env: NodeJS.ProcessEnv, needs: Pick<AdapterNeeds, "model" | "heldRefusal">, who: string) => Provider;
103
110
  /** The ConfineChild that starts a child under `prefix` (the argv pi's commands start under, ending in "--"); none when
104
111
  * the run confines nothing (macOS), since an adapter refuses a confinement that adds nothing. */
105
112
  export declare function confineOf(prefix: readonly string[]): ConfineChild | undefined;
@@ -138,6 +145,12 @@ export declare function harnessInstalled(harness: HarnessEntry, env: NodeJS.Proc
138
145
  * so its adapter is never handed a skill it throws on. None where the package has no such check: every skill stays
139
146
  * inlined. */
140
147
  export declare function packageSkillCheck(load: () => Promise<unknown>): Promise<SkillCheck | undefined>;
148
+ /** Whether a run's web_search is its harness's own search: the run's plane resolves it native and the harness has a search
149
+ * of its own (its facts' webSearch: claude-agent's, codex's). Its adapter then searches (nativeOptions), and the run is
150
+ * not also handed the host's web_search (cli-run-spec.ts), which would sit beside it. */
151
+ export declare const ownSearchRuns: (facts: Pick<AdapterFacts, "webSearch"> | undefined, plane: {
152
+ readonly web_search?: unknown;
153
+ } | undefined) => boolean;
141
154
  /** What a harness's adapter takes from the run's plane (tool-plane.ts) where web_search resolves native, by its own search
142
155
  * (its facts' webSearch): `native`, the provider's search through its proxy, with the input a search request may read in
143
156
  * beyond its body (cap.ts), which its proxy adds to that request's bound; `live`, its own live search (its adapter books