@parcha/agentrun-serve 0.1.0-beta.56 → 0.1.0-beta.58
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.
- package/CHANGELOG.md +281 -0
- package/README.md +246 -66
- package/dist/acp-package.d.ts +2 -0
- package/dist/adapters.d.ts +15 -3
- package/dist/adapters.js +17 -6
- package/dist/agent-package.d.ts +3 -3
- package/dist/agent-package.js +17 -8
- package/dist/api-keys.d.ts +76 -0
- package/dist/api-keys.js +217 -0
- package/dist/api-only.d.ts +15 -5
- package/dist/api-only.js +32 -8
- package/dist/box-paths.d.ts +4 -3
- package/dist/box-paths.js +7 -4
- package/dist/browser-hold.d.ts +23 -0
- package/dist/browser-hold.js +48 -0
- package/dist/browser-person.d.ts +3 -0
- package/dist/browser-person.js +4 -1
- package/dist/chatgpt-plan.d.ts +18 -8
- package/dist/chatgpt-plan.js +91 -34
- package/dist/claude-login-token.d.ts +117 -0
- package/dist/claude-login-token.js +737 -0
- package/dist/claude-login.d.ts +120 -22
- package/dist/claude-login.js +347 -63
- package/dist/claude-sign-in.d.ts +17 -6
- package/dist/claude-sign-in.js +42 -39
- package/dist/cli.js +33 -10
- package/dist/composio-made.d.ts +4 -0
- package/dist/composio-made.js +4 -0
- package/dist/composio-preset.d.ts +43 -2
- package/dist/composio-preset.js +92 -4
- package/dist/computer-attach.d.ts +35 -17
- package/dist/computer-attach.js +301 -49
- package/dist/computer-held-routes.d.ts +5 -4
- package/dist/computer-held-routes.js +29 -8
- package/dist/computer-held.d.ts +6 -1
- package/dist/computer-held.js +14 -0
- package/dist/computer-record.js +4 -2
- package/dist/computer-viewer.js +4 -1
- package/dist/computers.d.ts +10 -10
- package/dist/computers.js +5 -5
- package/dist/console/assets/{backend-Boh7tC4i.js → backend-CSAWUqtZ.js} +19 -19
- package/dist/console/assets/index-Bwn1oTem.css +1 -0
- package/dist/console/assets/index-DPh29cyz.js +747 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.d.ts +1 -1
- package/dist/decisions.js +1 -1
- package/dist/dial-relay.d.ts +25 -4
- package/dist/dial-relay.js +129 -1
- package/dist/docker-host-addresses.d.ts +22 -11
- package/dist/docker-host-addresses.js +38 -26
- package/dist/env-switch.d.ts +8 -0
- package/dist/env-switch.js +31 -2
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fal-price.d.ts +56 -20
- package/dist/fal-price.js +400 -90
- package/dist/handed-values.d.ts +43 -1
- package/dist/handed-values.js +119 -2
- package/dist/harness-archive.d.ts +13 -10
- package/dist/harness-archive.js +60 -34
- package/dist/harness-check.d.ts +3 -1
- package/dist/harness-check.js +25 -46
- package/dist/harness-keys.d.ts +73 -27
- package/dist/harness-keys.js +194 -61
- package/dist/harness-recipe-entry.d.ts +8 -7
- package/dist/harness-recipe-entry.js +21 -32
- package/dist/harness-recipe.d.ts +38 -25
- package/dist/harness-recipe.js +49 -36
- package/dist/harness-sign-in.js +12 -23
- package/dist/harness-table.d.ts +10 -3
- package/dist/harness-table.js +26 -21
- package/dist/harness.d.ts +1 -0
- package/dist/harness.js +17 -5
- package/dist/hosted-search.d.ts +1 -1
- package/dist/hosted-search.js +1 -2
- package/dist/import-worker.d.ts +4 -2
- package/dist/import-worker.js +9 -2
- package/dist/in-flight.d.ts +26 -0
- package/dist/in-flight.js +52 -0
- package/dist/key-refusal.d.ts +9 -4
- package/dist/key-refusal.js +107 -25
- package/dist/learn/ledger.d.ts +170 -0
- package/dist/learn/ledger.js +218 -0
- package/dist/learn/promote.d.ts +3 -3
- package/dist/learn/promote.js +1 -1
- package/dist/learn/secrets.d.ts +13 -3
- package/dist/learn/secrets.js +118 -17
- package/dist/learning-cost.d.ts +28 -23
- package/dist/learning-cost.js +19 -23
- package/dist/link-check.js +1 -1
- package/dist/live-reach.d.ts +2 -0
- package/dist/live-reach.js +2 -0
- package/dist/llms.txt +1 -1
- package/dist/marketplace.d.ts +77 -0
- package/dist/marketplace.js +224 -0
- package/dist/mcp-api-only-origins.d.ts +35 -0
- package/dist/mcp-api-only-origins.js +57 -0
- package/dist/mcp-gateway.d.ts +7 -5
- package/dist/mcp-gateway.js +9 -12
- package/dist/mcp-secret-writes.js +5 -3
- package/dist/mcp-servers-store.d.ts +28 -6
- package/dist/mcp-servers-store.js +53 -4
- package/dist/media-duration.d.ts +3 -0
- package/dist/media-duration.js +90 -9
- package/dist/micro.d.ts +2 -0
- package/dist/micro.js +2 -0
- package/dist/model-form.d.ts +5 -4
- package/dist/model-form.js +11 -7
- package/dist/model.d.ts +10 -6
- package/dist/model.js +16 -11
- package/dist/monid.d.ts +14 -1
- package/dist/monid.js +103 -26
- package/dist/ollama-provider.d.ts +7 -1
- package/dist/ollama-provider.js +14 -2
- package/dist/openapi.js +210 -37
- package/dist/otel/genai.d.ts +65 -0
- package/dist/otel/genai.js +116 -0
- package/dist/otel/tracer.d.ts +55 -0
- package/dist/otel/tracer.js +308 -0
- package/dist/page.d.ts +2 -0
- package/dist/page.js +3 -1
- package/dist/paid-calls.d.ts +1 -32
- package/dist/paid-calls.js +4 -39
- package/dist/place-offers.d.ts +4 -0
- package/dist/place-offers.js +7 -4
- package/dist/provider.d.ts +11 -2
- package/dist/provider.js +59 -8
- package/dist/redact/match.d.ts +30 -3
- package/dist/redact/match.js +422 -41
- package/dist/refusal-words.d.ts +11 -0
- package/dist/refusal-words.js +11 -0
- package/dist/run-census.d.ts +67 -0
- package/dist/run-census.js +240 -0
- package/dist/run-computer.d.ts +6 -3
- package/dist/run-computer.js +4 -1
- package/dist/run-cut.d.ts +15 -6
- package/dist/run-cut.js +30 -9
- package/dist/run-files.d.ts +3 -0
- package/dist/run-files.js +3 -0
- package/dist/run-launch.d.ts +12 -1
- package/dist/run-launch.js +9 -10
- package/dist/run-learning-served.d.ts +4 -2
- package/dist/run-model-key.d.ts +8 -0
- package/dist/run-model-key.js +31 -1
- package/dist/run-reads-over-store.d.ts +24 -6
- package/dist/run-reads-over-store.js +67 -23
- package/dist/run-recordings.d.ts +5 -1
- package/dist/run-recordings.js +39 -14
- package/dist/run-timeline-served.d.ts +2 -0
- package/dist/run-timeline-served.js +2 -2
- package/dist/run-usage.d.ts +1 -0
- package/dist/run-view.d.ts +1 -2
- package/dist/run-view.js +2 -1
- package/dist/runnable.d.ts +10 -1
- package/dist/runnable.js +20 -8
- package/dist/runner/adapter-loop.d.ts +11 -0
- package/dist/runner/adapter-loop.js +58 -26
- package/dist/runner/adapter-run-spec.d.ts +55 -11
- package/dist/runner/adapter-run-spec.js +183 -52
- package/dist/runner/adapters/pi.js +25 -3
- package/dist/runner/beside.d.ts +9 -2
- package/dist/runner/beside.js +27 -9
- package/dist/runner/big-writes.js +1 -10
- package/dist/runner/claim-secrets.d.ts +27 -10
- package/dist/runner/claim-secrets.js +49 -22
- package/dist/runner/cli-run-spec.d.ts +6 -0
- package/dist/runner/cli-run-spec.js +97 -38
- package/dist/runner/computer-journal.d.ts +9 -1
- package/dist/runner/computer-journal.js +26 -0
- package/dist/runner/conformance/harness.js +1 -1
- package/dist/runner/feedback-round.js +3 -0
- package/dist/runner/harness-loops.d.ts +6 -5
- package/dist/runner/harness-loops.js +7 -7
- package/dist/runner/held.d.ts +24 -6
- package/dist/runner/journal-kinds.d.ts +5 -0
- package/dist/runner/journal-kinds.js +5 -0
- package/dist/runner/main.d.ts +11 -6
- package/dist/runner/main.js +19 -9
- package/dist/runner/mcp-claim.js +31 -3
- package/dist/runner/mcp-run.d.ts +9 -0
- package/dist/runner/mcp-run.js +11 -5
- package/dist/runner/model-route.d.ts +17 -0
- package/dist/runner/model-route.js +120 -2
- package/dist/runner/presence.d.ts +11 -1
- package/dist/runner/presence.js +7 -0
- package/dist/runner/reflect-hook.js +1 -1
- package/dist/runner/run-child-host.d.ts +22 -8
- package/dist/runner/run-child-host.js +128 -41
- package/dist/runner/run-child.js +5 -2
- package/dist/runner/runner.d.ts +17 -3
- package/dist/runner/runner.js +130 -34
- package/dist/runner/save-slots.js +2 -1
- package/dist/runner/store-port.d.ts +1 -1
- package/dist/runner/store-secrets.d.ts +6 -0
- package/dist/runner/store-secrets.js +49 -7
- package/dist/runner/subagent.d.ts +11 -0
- package/dist/runner/subagent.js +16 -38
- package/dist/runner/workflow-first.d.ts +35 -15
- package/dist/runner/workflow-first.js +38 -25
- package/dist/runner/workflow-spec.js +4 -3
- package/dist/runs-over-store.d.ts +15 -6
- package/dist/runs-over-store.js +33 -21
- package/dist/scrub-command.d.ts +73 -0
- package/dist/scrub-command.js +307 -0
- package/dist/secret-cut.d.ts +73 -0
- package/dist/secret-cut.js +291 -4
- package/dist/secret-rules.d.ts +143 -0
- package/dist/secret-rules.js +2564 -0
- package/dist/secrets.d.ts +7 -0
- package/dist/secrets.js +20 -0
- package/dist/server-keys.d.ts +20 -0
- package/dist/server-keys.js +25 -6
- package/dist/server.d.ts +65 -13
- package/dist/server.js +470 -157
- package/dist/skills/agentrun-serve/SKILL.md +4 -0
- package/dist/slots.d.ts +9 -0
- package/dist/slots.js +45 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/journal/storage.js +1 -1
- package/dist/store/postgres/migrations/0027_run_launch_census.sql +31 -0
- package/dist/store/postgres/migrations/0028_learning_ledger.sql +44 -0
- package/dist/store/schema.d.ts +23 -0
- package/dist/store/schema.js +58 -2
- package/dist/store/seal.d.ts +6 -1
- package/dist/store/seal.js +5 -3
- package/dist/store/sqlite/run-launch.d.ts +9 -1
- package/dist/store/sqlite/run-launch.js +24 -13
- package/dist/store/sqlite/run-patch.d.ts +12 -2
- package/dist/store/sqlite/run-patch.js +42 -5
- package/dist/store/sqlite/store.js +105 -12
- package/dist/store/store.d.ts +57 -2
- package/dist/store/store.js +20 -0
- package/dist/store-reads/learning.d.ts +84 -124
- package/dist/store-reads/learning.js +210 -274
- package/dist/store-view.d.ts +3 -0
- package/dist/store-view.js +3 -3
- package/dist/suggestions.js +3 -2
- package/dist/template-eval.d.ts +39 -9
- package/dist/template-eval.js +191 -60
- package/dist/template-import.js +6 -2
- package/dist/templates.d.ts +10 -2
- package/dist/templates.js +28 -8
- package/dist/timeline/labels.d.ts +6 -4
- package/dist/timeline/labels.js +18 -6
- package/dist/timeline/timeline.d.ts +5 -0
- package/dist/timeline/timeline.js +14 -8
- package/dist/timeline/util.js +1 -1
- package/dist/timeline/web-calls.d.ts +22 -7
- package/dist/timeline/web-calls.js +106 -35
- package/dist/tool-gate.d.ts +42 -3
- package/dist/tool-gate.js +66 -5
- package/dist/tool-keys-store.d.ts +2 -4
- package/dist/tool-keys-store.js +5 -21
- package/dist/tool-keys.d.ts +2 -2
- package/dist/tool-keys.js +2 -2
- package/dist/tool-list.js +1 -1
- package/dist/tool-plane.d.ts +2 -2
- package/dist/tool-plane.js +35 -33
- package/dist/tools.js +13 -7
- package/dist/trigger-targets.d.ts +4 -0
- package/dist/trigger-targets.js +9 -2
- package/dist/triggers.d.ts +67 -4
- package/dist/triggers.js +171 -22
- package/dist/until.d.ts +3 -0
- package/dist/until.js +11 -0
- package/dist/web-fake.d.ts +1 -3
- package/dist/web-fake.js +7 -18
- package/dist/web-fetch.d.ts +6 -72
- package/dist/web-fetch.js +11 -265
- package/dist/web-run.d.ts +31 -0
- package/dist/web-run.js +90 -0
- package/dist/web-save.d.ts +10 -13
- package/dist/web-save.js +13 -55
- package/dist/web-search.d.ts +9 -127
- package/dist/web-search.js +23 -259
- package/dist/wires.d.ts +13 -0
- package/dist/wires.js +11 -0
- package/dist/workflow-run.d.ts +5 -4
- package/dist/workflow-run.js +5 -4
- package/dist/workspace/attached-computers.d.ts +32 -9
- package/dist/workspace/attached-computers.js +77 -13
- package/dist/workspace/computer-deps.d.ts +8 -2
- package/dist/workspace/computer-deps.js +10 -3
- package/dist/workspace/computer-for-claim.d.ts +12 -1
- package/dist/workspace/computer-for-claim.js +83 -11
- package/dist/workspace/computer-kept.d.ts +3 -0
- package/dist/workspace/computer-kept.js +11 -2
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/kind-skills.d.ts +4 -0
- package/dist/workspace/kind-skills.js +9 -0
- package/dist/workspace/paired-route.d.ts +91 -0
- package/dist/workspace/paired-route.js +153 -0
- package/dist/workspace/synced-folder.js +3 -4
- package/dist/wrapped.d.ts +20 -6
- package/dist/wrapped.js +66 -25
- package/package.json +17 -11
- package/skills/agentrun-serve/SKILL.md +4 -0
- package/templates/README.md +32 -10
- package/dist/console/assets/index-CQ3cJRzI.js +0 -746
- package/dist/console/assets/index-DKkaS3a0.css +0 -1
- package/dist/exa-keyless.d.ts +0 -34
- package/dist/exa-keyless.js +0 -118
- package/dist/firecrawl-keyless.d.ts +0 -41
- package/dist/firecrawl-keyless.js +0 -152
- package/dist/keyless-mcp.d.ts +0 -36
- package/dist/keyless-mcp.js +0 -127
- package/dist/text-urls.d.ts +0 -38
- package/dist/text-urls.js +0 -170
- package/dist/web-fetch-direct.d.ts +0 -119
- 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
|
|
@@ -271,7 +329,8 @@ two processes in the container: the server with `--no-runner`, and one runner on
|
|
|
271
329
|
`GET /v2/health`. Each has its own store connection, so a busy runner never holds up the API. If either exits, the other
|
|
272
330
|
stops and the container exits non-zero. Give the image other arguments and it runs that one command, as given:
|
|
273
331
|
`runner --data /data --name runner-1` is a runner, and server options alone (no `server-and-runner`) are a server with
|
|
274
|
-
its runner in its own process
|
|
332
|
+
its runner in its own process. A [paired computer](#a-persons-own-computer) works under either once the runner relays,
|
|
333
|
+
below.
|
|
275
334
|
|
|
276
335
|
A computer provider whose machines dial the server (Fly Machines and Cloudflare; the computer package's `connectOf`,
|
|
277
336
|
which also says dial for E2B, Daytona or Modal made with `connect: "dial"`) works under a runner apart that knows the
|
|
@@ -287,6 +346,15 @@ and the server says it sooner: in `GET /v2/computers`, each dial provider's row
|
|
|
287
346
|
and its Test connection in Settings → Computers fails in the same words. With a runner that relays, `runs_refused` is
|
|
288
347
|
null.
|
|
289
348
|
|
|
349
|
+
A [paired computer](#a-persons-own-computer) takes the same relay. A run's claim on a runner that relays writes the
|
|
350
|
+
computer's route (a settings row: the runner, its process, the run and the hold's end), refused while a live run on a
|
|
351
|
+
live runner holds it, and taken from a runner that is gone or restarted, or a run that is over. Once a second the server
|
|
352
|
+
closes a paired computer's socket that is not where its route says (close 1001), and the driver's redial lands there:
|
|
353
|
+
relayed to the run's runner, or back on the server once the run releases it. The run's create waits for it about 80 s
|
|
354
|
+
(the driver's longest redial, a relay's connect and a hello) and fails in words naming the runner when it does not
|
|
355
|
+
come. `GET /v2/computers` lists the runner the hold is on (`held_on`), and the server's note when a relay was refused
|
|
356
|
+
(`hold_note`), each shown on the computer's row in Settings → Computers.
|
|
357
|
+
|
|
290
358
|
The token is in the log of the start that made it. A `docker stop` reaches both processes. The runner gives a busy run
|
|
291
359
|
6 s (`--drain-timeout 6s`) to finish its turn, so a busy `docker stop` ends in about 7.5 s, inside Docker's default 10 s
|
|
292
360
|
grace, and Compose's `stop_grace_period` is 15 s; a turn cut off resumes at the next start. Compose publishes the port
|
|
@@ -413,7 +481,10 @@ It names no path, size or version. One route serves as both liveness and readine
|
|
|
413
481
|
and a 200 says it can work, and the platforms here take one path.
|
|
414
482
|
|
|
415
483
|
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.
|
|
484
|
+
time, writes nothing more to the run, and the store refuses any write under a claim the run has moved past. On SQLite
|
|
485
|
+
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
|
|
486
|
+
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.
|
|
487
|
+
On Postgres it counts from when it asked. A renew the store never answers in time still loses the run. Once the
|
|
417
488
|
claim lapses another runner claims the run and resumes it from its journal. A run's own computer doesn't survive a
|
|
418
489
|
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
490
|
timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does.
|
|
@@ -1034,13 +1105,16 @@ passes the binding's conformance cases (below) needs no change here.
|
|
|
1034
1105
|
refused at its start, saying to open its driver. A run uses what the hello's groups and features allow.
|
|
1035
1106
|
- **Remove it.** Remove on its row (`DELETE /v2/computers/{computer_id}`) ends its token and closes its connection; a
|
|
1036
1107
|
run holding it loses it. Pairing it again gives it a new id.
|
|
1037
|
-
- **One process.** A computer's connection lands on
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1108
|
+
- **One process, or a relay.** A computer's connection lands on the server process it dials. A run of the runner
|
|
1109
|
+
beside the server (`agentrun-serve start`, the default) uses it there. A runner started apart (`agentrun-serve
|
|
1110
|
+
runner`, beside a server started with `--no-runner`; the image's default command) uses it through the server's relay
|
|
1111
|
+
when it knows the server's public address, `AGENTRUN_PUBLIC_URL`: its run's claim routes the computer's next dial to
|
|
1112
|
+
that runner, and its release routes it back (above). One that does not refuses a paired computer at the claim,
|
|
1113
|
+
naming both fixes. Such a server says it sooner: while no runner relays, its pairing code, the pair answer and each
|
|
1114
|
+
paired computer carry `runs_refused`, which the console shows with the code and on the computer's row. Give the
|
|
1115
|
+
runner `AGENTRUN_PUBLIC_URL`, or give the image the server's options alone (`--data /data --listen 0.0.0.0 --port
|
|
1116
|
+
7340 --drain-timeout 6s`) to keep the runner in the server's process. A second server on one store is already
|
|
1117
|
+
refused by the store's owner lock, on SQLite and Postgres alike.
|
|
1044
1118
|
- **Conformance.** `node dist/attach-conformance-cli.js [--port 7392] [--listen 127.0.0.1]` runs the binding's cases
|
|
1045
1119
|
against whatever driver pairs with the code it prints: pair, a wrong or used code, ping, a quiet minute, a redial
|
|
1046
1120
|
after each close it must redial after (4408, 1000, 1001, 4409) and after a drop, a binary frame (1003), a frame over
|
|
@@ -1233,7 +1307,7 @@ this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's ke
|
|
|
1233
1307
|
[tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
|
|
1234
1308
|
`openai/gpt-6.1-sol` with `OPENAI_API_KEY`, `particle/particle-1` with `PARTICLE_API_KEY`, then
|
|
1235
1309
|
`openrouter/openai/gpt-6.1-sol` with `OPENROUTER_API_KEY`. With none of those, pi's default is the first model of this
|
|
1236
|
-
machine's Ollama that calls tools ([below](#on-this-machines-ollama)). Set `AGENT_MODEL` for another. Direct Particle runs on Pi;
|
|
1310
|
+
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;
|
|
1237
1311
|
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`
|
|
1238
1312
|
or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
|
|
1239
1313
|
to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
|
|
@@ -1520,7 +1594,10 @@ The sign-in is the owner's alone, over the owner's signed-in session (the API to
|
|
|
1520
1594
|
sign-in tab ends on a page that won't load: copy its whole address into the console, which sends it as
|
|
1521
1595
|
`POST /v2/settings/chatgpt/sign-in/finish` `{"redirect_url": "..."}`.
|
|
1522
1596
|
- `GET /v2/settings/chatgpt` says `state`: `signed_out`, `pending` (with `authorize_url` and `expires_at`), `signed_in`
|
|
1523
|
-
(with `email`, `plan` and the plan's `models`) or `expired`.
|
|
1597
|
+
(with `email`, `plan` and the plan's `models`) or `expired`. A `pending` sign-in with no code back after its first
|
|
1598
|
+
minute also carries a `hint`. It names the likely cause first: the ChatGPT workspace's admin has turned off open-source
|
|
1599
|
+
apps (External access → OSS → Use ChatGPT plan). OpenAI shows that refusal on its own page and never sends the browser
|
|
1600
|
+
back.
|
|
1524
1601
|
- `DELETE /v2/settings/chatgpt` signs out: it removes the sign-in here and revokes it at OpenAI, and answers
|
|
1525
1602
|
`{"revoked": true}` when OpenAI confirmed it (or nothing was signed in, as when it only cancels a waiting sign-in).
|
|
1526
1603
|
When OpenAI didn't confirm it, the answer is `{"revoked": false, "message": "Signed out here. OpenAI didn't confirm
|
|
@@ -1559,13 +1636,20 @@ has the row **Use Claude Code's login on this machine**, over these routes:
|
|
|
1559
1636
|
login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login, which
|
|
1560
1637
|
you opt into by name. Its folder is the one the CLI uses: `CLAUDE_CONFIG_DIR` when the server's environment sets it to
|
|
1561
1638
|
an absolute path, else `~/.claude`. A Claude Code that keeps its login in another folder is found only when AgentRun
|
|
1562
|
-
is started with `CLAUDE_CONFIG_DIR` set to that folder.
|
|
1563
|
-
|
|
1564
|
-
|
|
1639
|
+
is started with `CLAUDE_CONFIG_DIR` set to that folder. Where the server's environment sets
|
|
1640
|
+
`CLAUDE_SECURESTORAGE_CONFIG_DIR` (an absolute path, or empty), the CLI is asked, signed in and run with it, as the
|
|
1641
|
+
person's own Claude Code with that variable keeps its tokens: in that folder, or, empty, in `~/.claude` and on macOS
|
|
1642
|
+
the Keychain item with no suffix. A server where more than one person can start runs (more than one API token, an
|
|
1643
|
+
[API key made for an app](#api-keys-for-your-apps), the API-only profile) refuses it with `403` and one line saying
|
|
1644
|
+
why, and a turn-on saved before is dropped when such a server starts. The setting names the machine it was turned on
|
|
1645
|
+
for by an id the server makes once in its data folder (`machine-id`, 0600) and reads back on every later start,
|
|
1646
|
+
never by the hostname, which on a laptop changes with the network. Two data folders are two machines. A setting
|
|
1647
|
+
saved before the id reads as `other_machine` until it is turned on again.
|
|
1565
1648
|
- `GET /v2/settings/claude-login` says `state`: `off`, `signed_in` (with the `account` the CLI names: method, email,
|
|
1566
1649
|
organization, plan), `signed_out`, `no_cli` (claude-agent's first run installs the pinned CLI), `unknown`, or
|
|
1567
1650
|
`other_machine`. `folder` is the folder whose login the CLI is asked about, and `machine` is this machine's own
|
|
1568
|
-
login folder (`machine.source`: `CLAUDE_CONFIG_DIR` or `default`
|
|
1651
|
+
login folder (`machine.source`: `CLAUDE_CONFIG_DIR` or `default`; `machine.credentials`: the server's
|
|
1652
|
+
`CLAUDE_SECURESTORAGE_CONFIG_DIR`, when it sets one). `command` is the line that signs the CLI in at
|
|
1569
1653
|
the login's place, for a terminal on the server's machine. Where the console is on that machine (a server on loopback
|
|
1570
1654
|
with no public address), `can_start` is true and `POST /v2/settings/claude-login/login` starts the pinned CLI's own
|
|
1571
1655
|
`auth login`, which opens a browser there. It runs with the same variables as `command`, so it signs in at `folder`,
|
|
@@ -1573,35 +1657,76 @@ has the row **Use Claude Code's login on this machine**, over these routes:
|
|
|
1573
1657
|
`machine` with the default `~/.claude`, the CLI is signed in as the person's own `claude` runs: no
|
|
1574
1658
|
`CLAUDE_CONFIG_DIR` or `CLAUDE_SECURESTORAGE_CONFIG_DIR`, in their home, so it writes the account in `~/.claude.json`
|
|
1575
1659
|
and the tokens where their Claude Code keeps them (in `~/.claude`; on macOS the Keychain item `Claude Code-credentials`).
|
|
1576
|
-
`command` there
|
|
1577
|
-
either still signs in at that login.
|
|
1660
|
+
`command` there is `env -u CLAUDE_CONFIG_DIR -u CLAUDE_SECURESTORAGE_CONFIG_DIR ... auth login`, so a terminal that
|
|
1661
|
+
exports either still signs in at that login. env is a program, so the line runs alike when pasted into sh, bash,
|
|
1662
|
+
zsh, fish or tcsh; a CLI path holding `=`, which env would read as a variable, goes to `sh -c` as its `$0`. env skips
|
|
1663
|
+
a `claude` alias or function of the terminal's shell. A run
|
|
1578
1664
|
there reaches the same tokens: on macOS with `CLAUDE_SECURESTORAGE_CONFIG_DIR` set and empty, the CLI's way to name
|
|
1579
|
-
that item while the run has a config dir of its own; elsewhere with it set to `~/.claude`. On
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
folder's), opening the original only to read it, into a folder of its own, gives the CLI that folder as its
|
|
1583
|
-
dir and the tokens as a run reads them, and removes the folder however the check ends. The copy (0600, in a
|
|
1584
|
-
folder) leaves out the fields that hold secrets: `primaryApiKey` (the API key an older Claude Code signed in
|
|
1585
|
-
`env` and every `mcpServers`, whose env and headers hold tokens
|
|
1586
|
-
copied
|
|
1587
|
-
|
|
1588
|
-
|
|
1665
|
+
that item while the run has a config dir of its own; elsewhere with it set to `~/.claude`. On every place, the status
|
|
1666
|
+
check never runs the CLI on the login's own account file, which the CLI rewrites on every start whose config version
|
|
1667
|
+
is not its own: each check copies `.claude.json` (`~/.claude.json` on `machine` with the default folder, else the
|
|
1668
|
+
login folder's), opening the original only to read it, into a folder of its own, gives the CLI that folder as its
|
|
1669
|
+
config dir and the tokens as a run reads them, and removes the folder however the check ends. The copy (0600, in a
|
|
1670
|
+
0700 folder) leaves out the fields that hold secrets: `primaryApiKey` (the API key an older Claude Code signed in
|
|
1671
|
+
with), `env` and every `mcpServers`, whose env and headers hold tokens. Only a regular file of at most 32 MiB is
|
|
1672
|
+
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
|
|
1673
|
+
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
|
|
1674
|
+
killed mid-way leaves its folder (`agentrun-claude-status-*` in the temporary folder); a server where the login is
|
|
1675
|
+
allowed removes this user's ones as it starts, once the check has ended by the end it wrote in its folder (its limit,
|
|
1676
|
+
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
|
|
1677
|
+
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
|
|
1678
|
+
that ignores the TERM, or a process it started that holds its output open, never holds the check. The status check
|
|
1679
|
+
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
|
|
1680
|
+
server makes the login) on every place, as the sign-in does, and so does a run on the login
|
|
1681
|
+
on macOS: the CLI reads its tokens there from the login keychain, which is under that home. So a run there writes the
|
|
1682
|
+
CLI's cache and logs under the person's `~/Library/Caches/claude-cli-nodejs`, where they stay; removing that folder is
|
|
1683
|
+
safe. `sign_in`
|
|
1589
1684
|
says what became of that sign-in while the server runs: `waiting` for the browser since `started_at`, `signed_in`,
|
|
1590
1685
|
`timed_out` (no answer from the browser within 10 minutes, so it was ended and a sign-in page still open can't
|
|
1591
1686
|
finish), `failed` (the CLI ended without signing in, with its `exit_code`), or `not_started`. A second start ends a
|
|
1592
|
-
sign-in that still waits, and so do turning the mode off
|
|
1687
|
+
sign-in that still waits, and so do turning the mode off, a `PUT` that moves the login to the other `place`, and
|
|
1688
|
+
stopping the server, which waits for that CLI to exit. A `PUT` at the same `place` leaves it waiting.
|
|
1689
|
+
The CLI dies with the server, as a session's CLI does, so a server that is killed outright (SIGKILL, the OOM killer)
|
|
1690
|
+
leaves no sign-in waiting on the browser's port.
|
|
1593
1691
|
- `DELETE /v2/settings/claude-login` turns it off. The login stays as the CLI keeps it.
|
|
1594
1692
|
|
|
1595
1693
|
While it is on, a claude-agent run on an `anthropic/<model>` model goes on the login: its CLI gets no
|
|
1596
1694
|
`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN` or key, no model proxy runs, and the CLI's sandbox denies its commands
|
|
1597
1695
|
reads of the login. A model named on a gateway or OpenRouter keeps its key, and so does a run started with its own
|
|
1598
1696
|
`model_key`. With no key at all, claude-agent's default
|
|
1599
|
-
model is `anthropic/claude-sonnet-5-5`. A run whose login is signed out fails at its start and says so.
|
|
1600
|
-
|
|
1697
|
+
model is `anthropic/claude-sonnet-5-5`. A run whose login is signed out fails at its start and says so. A status check
|
|
1698
|
+
the CLI outlasts (15 s) is asked once more; still no answer, the run goes on when the same login read signed in within
|
|
1699
|
+
the last 10 minutes on this machine (at a run's check or in Settings, in the server or in a runner process of its own on
|
|
1700
|
+
the same data folder, which keeps that time alone per login in `claude-login-answers/`, 0600), else it fails saying the
|
|
1701
|
+
check timed out. Being on disk, a signed-in answer outlives a restart of the server, and a turn-off and turn-on, for up to
|
|
1702
|
+
those 10 minutes; a signed-out answer removes it, and a new machine id (`machine-id` made again) leaves it standing for
|
|
1703
|
+
nothing.
|
|
1704
|
+
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
|
|
1705
|
+
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
|
|
1601
1706
|
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
|
|
1602
|
-
sandbox, or on another machine, uses the keys. The login is the server's user's
|
|
1603
|
-
|
|
1604
|
-
|
|
1707
|
+
sandbox, or on another machine, uses the keys. The login is the server's user's. Where each run is a user of its own
|
|
1708
|
+
(the image, `run_isolation: "uid"`), a run on AgentRun's own login folder gets the login's access token alone in
|
|
1709
|
+
`CLAUDE_CODE_OAUTH_TOKEN`: never the folder and never the refresh token, so its CLI never renews the login. The runner
|
|
1710
|
+
reads the token from the folder at the run's start and again whenever Anthropic refuses it mid-run, so a renewal the
|
|
1711
|
+
person's own Claude Code wrote there is picked up. The runner renews the login itself, in the CLI's place: when a token
|
|
1712
|
+
has less than five minutes left, and after Anthropic refuses one mid-run. It sends the pinned CLI's own refresh request,
|
|
1713
|
+
holds the CLI's own refresh lock on the folder (so a renewal by the CLI or another runner is taken and nothing is sent
|
|
1714
|
+
twice), and writes the answer back to the folder's `.credentials.json` alone, atomically at mode 0600, every other field
|
|
1715
|
+
kept. It holds that lock as the CLI does, by the mtime it set: a lock another holder took over while the runner was
|
|
1716
|
+
paused is never touched or removed, and the runner sends nothing under it. If the write back fails, the runner keeps the
|
|
1717
|
+
new pair in memory: each later ask gets its token, sends nothing (the old refresh token is spent and is never sent
|
|
1718
|
+
again) and tries the write again, under the same refresh lock and after reading the file again, so a newer pair another
|
|
1719
|
+
holder wrote there is kept. Once that token has less than five minutes left and is still unsaved, the run fails
|
|
1720
|
+
in words that say the renewal could not be saved and what to fix. A held token Anthropic refuses is never handed again:
|
|
1721
|
+
the ask fails while the pair is unsaved, and once it is saved the runner renews from it. One ask sends at most one renewal and nothing retries it. A renewal that fails, a refresh token Anthropic refused
|
|
1722
|
+
included, fails the run at its start in words that say to open Claude Code once to renew it, and mid-run ends the turn
|
|
1723
|
+
in the same words (or, with no failure to tell, words that say to run the claude CLI once on this login to renew it).
|
|
1724
|
+
No token is in the runner's log or in any error, and each token handed is cut from the run's journal, messages and rows
|
|
1725
|
+
as the runner writes them. A command the run's CLI starts can read the token,
|
|
1726
|
+
as the run's own user can. Under per-run users, a run on this machine's own Claude Code login (`~/.claude`, or the `CLAUDE_CONFIG_DIR` AgentRun was started with) fails at its
|
|
1727
|
+
claim and says so, and so does any login run while another runner on the same data folder runs its login runs under
|
|
1728
|
+
the server's user (its CLI renews the folder's login itself), naming that runner. Set `AGENTRUN_RUN_USER=same`, or give
|
|
1729
|
+
the run a `model_key`.
|
|
1605
1730
|
|
|
1606
1731
|
The mode exists only on a server that listens on loopback (a local install, or one behind a local proxy). A server
|
|
1607
1732
|
bound to any other address, such as all interfaces in a container or on a hosting service, has it off
|
|
@@ -1614,7 +1739,8 @@ saved earlier is dropped when the server starts, and claude-agent runs on the mo
|
|
|
1614
1739
|
|
|
1615
1740
|
Start Ollama (`ollama serve`, or its app) beside your own server and it lists Ollama's models itself, with no key, no
|
|
1616
1741
|
gateway and no restart: `GET /api/tags` for the tags, `POST /api/show` for each one's capabilities and trained context. Each chat model
|
|
1617
|
-
is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi
|
|
1742
|
+
is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi and for every harness on a wire the
|
|
1743
|
+
route translates, and the console names it
|
|
1618
1744
|
`<tag> · local (Ollama)`, on a run's page too (from the run's `tokens` usage line, `provider` `ollama` and `model` the
|
|
1619
1745
|
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
|
|
1620
1746
|
within half a minute (the listing is kept that long, and asked again behind the next answer). A down or stuck Ollama
|
|
@@ -1635,7 +1761,8 @@ seconds), and a run on any other model, a key's default included, never asks Oll
|
|
|
1635
1761
|
- Context: each request is Ollama's own `/api/chat`, streamed, with `options.num_ctx` the least of 65,536, the model's
|
|
1636
1762
|
trained context (where `/api/show` names one) and `OLLAMA_CONTEXT_LENGTH` (where the server's environment sets it to a
|
|
1637
1763
|
whole number above 0, as a person short of memory does for Ollama itself). The model's context window here is the same
|
|
1638
|
-
number, so pi compacts before Ollama would cut the prompt.
|
|
1764
|
+
number, so pi compacts before Ollama would cut the prompt. `agentrun service install --env
|
|
1765
|
+
OLLAMA_CONTEXT_LENGTH=<tokens>` gives the limit to the service.
|
|
1639
1766
|
- Thinking: a model whose capabilities include `thinking` has its reasoning split out by Ollama. For any other, an
|
|
1640
1767
|
answer that opens with `<think>` has that part as thinking up to `</think>`, the split Ollama makes for a thinking
|
|
1641
1768
|
model, so the tags never reach the answer.
|
|
@@ -1644,11 +1771,16 @@ seconds), and a run on any other model, a key's default included, never asks Oll
|
|
|
1644
1771
|
- Cost: $0, booked as a known cost. Its requests never count toward the server's [limit on free
|
|
1645
1772
|
requests](#a-limit-on-free-requests): there is no shared quota behind them. An agent's own `max_requests` counts them,
|
|
1646
1773
|
with its other free requests, so a run on Ollama that keeps calling tools still stops there.
|
|
1647
|
-
- Harness: pi
|
|
1774
|
+
- Harness: pi, and every harness on a wire the route translates. That wire is Anthropic's Messages: claude-agent,
|
|
1775
|
+
Goose, and a harness module on it. Its requests go through the same translation as pi's: the same `/api/chat`,
|
|
1776
|
+
`num_ctx`, tools and cost. A Messages client's token count (`/v1/messages/count_tokens`) is answered there without
|
|
1777
|
+
asking the model, an answer it asks for unstreamed comes back whole (or as a 500 error with words when part of the
|
|
1778
|
+
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
|
|
1779
|
+
OpenAI's Responses, never list them.
|
|
1648
1780
|
- Cloud models: an Ollama cloud model (a `-cloud` tag, with `remote_host` and `remote_model` in `/api/tags` or
|
|
1649
1781
|
`/api/show`) runs on ollama.com, not here, so it is never listed: never local, never $0, never the default.
|
|
1650
|
-
- Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi
|
|
1651
|
-
lists that calls tools. Any key wins. A model without tools is pickable, never the default. Ollama lists the model
|
|
1782
|
+
- Default: with no model key held (and no `AGENT_MODEL`, ChatGPT sign-in or gateway), pi and every harness on a wire the
|
|
1783
|
+
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
|
|
1652
1784
|
pulled last first, so pulling one can change that default, and a saved agent that names no model follows it. Name the
|
|
1653
1785
|
model (`ollama/<tag>`) to pin it.
|
|
1654
1786
|
|
|
@@ -1679,7 +1811,7 @@ agent_not_runnable`, with `details.unbound` and `details.missing`).
|
|
|
1679
1811
|
| `ask_person` | Ask the person who started the run; the turn ends until a message answers | nothing | no, no |
|
|
1680
1812
|
| `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 |
|
|
1681
1813
|
| `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 |
|
|
1682
|
-
| `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`
|
|
1814
|
+
| `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 |
|
|
1683
1815
|
| `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 |
|
|
1684
1816
|
| `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 |
|
|
1685
1817
|
| `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 |
|
|
@@ -1827,14 +1959,15 @@ Each child books on the run's cap, so size the cap for K passes, not one.
|
|
|
1827
1959
|
|
|
1828
1960
|
`web_search` and `web_fetch` work on every harness with only a model key. Each resolves, for a run, in one order: (1) the
|
|
1829
1961
|
provider the user picked, optional: the agent's own (`definition.tool_settings`) over the server's
|
|
1830
|
-
(`PUT /settings/tools`); (2)
|
|
1831
|
-
only where it is picked: `auto` there skips Claude's own search, an explicit `native` pick); (3) for
|
|
1962
|
+
(`PUT /settings/tools`); (2) for
|
|
1832
1963
|
`web_search`, Parallel, where the server holds a Parallel key (`PARALLEL_API_KEY` in its environment, or one saved on Tool
|
|
1833
|
-
keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (
|
|
1834
|
-
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.
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1964
|
+
keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (3) the keyless
|
|
1965
|
+
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.
|
|
1966
|
+
`auto` is agentrun's own search on every harness. The native search, the harness's own (Claude's WebSearch, Codex's
|
|
1967
|
+
live search) or on pi one request to the run's own model provider with its hosted search, runs only where `native` is
|
|
1968
|
+
picked; it is unavailable behind a gateway, on OpenRouter (which runs neither Codex's nor Claude's own search, and
|
|
1969
|
+
counts no searches to price) or under a spend cap (Codex's request has no input bound, and Claude's searches have
|
|
1970
|
+
per-use fees, which a cap cannot reserve yet). `off` turns `web_search` off: nothing is
|
|
1838
1971
|
searched, and an agent naming it is refused (`409`) until it is turned on again. A pick of `firecrawl-keyless` is keyless
|
|
1839
1972
|
Firecrawl with keyless Exa behind it, and a pick of `exa-keyless` is keyless Exa alone, the key held or not.
|
|
1840
1973
|
A workflow's model nodes may each run on another tier's model, so a workflow's `web_search` never searches natively:
|
|
@@ -1843,8 +1976,8 @@ unavailable for a workflow.
|
|
|
1843
1976
|
|
|
1844
1977
|
| | `claude-agent` | `codex` | pi |
|
|
1845
1978
|
| --- | --- | --- | --- |
|
|
1846
|
-
| `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
|
|
1847
|
-
| `web_search`, `native` | Claude's own WebSearch, unavailable on OpenRouter or under a spend cap |
|
|
1979
|
+
| `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 |
|
|
1980
|
+
| `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 |
|
|
1848
1981
|
| `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
|
|
1849
1982
|
| `web_search`, `firecrawl-keyless` | Firecrawl's public MCP search, keyless Exa's behind it, a host tool | the same | the same |
|
|
1850
1983
|
| `web_search`, `exa-keyless` | Exa's public MCP search alone, a host tool | the same | the same |
|
|
@@ -2345,7 +2478,8 @@ Composio is an MCP server like any other, so it needs no adapter of its own. Set
|
|
|
2345
2478
|
preset: you give your Composio API key, a toolkit (`github`, `slack`...), the actions to grant (picked from the
|
|
2346
2479
|
toolkit's list) and a server name, and the server has Composio make a managed MCP server for them, then saves it as an
|
|
2347
2480
|
ordinary MCP server with the key sealed as an `x-api-key` header. `POST /v2/settings/mcp-servers/composio/tools`
|
|
2348
|
-
`{api_key, toolkit}` lists the actions
|
|
2481
|
+
`{api_key, toolkit}` lists the actions, and `POST /v2/settings/mcp-servers/composio/toolkits` `{api_key}` lists the
|
|
2482
|
+
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,
|
|
2349
2483
|
user_id?, auth_config_id?, price_usd?}` makes and saves the server. In place of `api_key`, `"api_key_env":
|
|
2350
2484
|
"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
|
|
2351
2485
|
way an [API-only](#api-only) server's token saves one. That key is only ever sent to Composio's own origin, fixed in
|
|
@@ -2360,8 +2494,13 @@ server. `price_usd` (0 or more, as a `prices` value) is what each call costs you
|
|
|
2360
2494
|
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
|
|
2361
2495
|
`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
|
|
2362
2496
|
lists. Composio's server can leave out an action it was allowed (it did for `HACKERNEWS_GET_FRONTPAGE`), so the answer's
|
|
2363
|
-
`not_served` names any chosen action the saved server doesn't list.
|
|
2364
|
-
|
|
2497
|
+
`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,
|
|
2498
|
+
and every read of the server then says it as `composio_account: {state, labels?, checked_at}`: `connected` with each
|
|
2499
|
+
account's label (its alias, else the name Composio shows, else its word id; never its id or a token), `pending` while
|
|
2500
|
+
its connect link is unfinished, `expired`, `none`, or `unknown` when Composio didn't answer. An account Composio answers as
|
|
2501
|
+
another user's is never the server's, and a server whose recorded user is empty or `per_run` is never asked about (`unknown`).
|
|
2502
|
+
The API token sees `composio_account` too, in a server's full read: its label may be the account's email.
|
|
2503
|
+
A saved Composio server is gated, approved and shown on the Timeline as any MCP server's tools are, "not metered" until
|
|
2365
2504
|
you price them (`price_usd`, or the server's `prices`). Composio's own meta tools stay refused, and the helper actions
|
|
2366
2505
|
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.
|
|
2367
2506
|
[Connect Composio tools and triggers](../../docs/tutorials/composio.md) walks through the preset and a Composio
|
|
@@ -2441,8 +2580,10 @@ its authorization server refused: sign in again), null for `auth.type` none. No
|
|
|
2441
2580
|
credential; a server's error text is cut of the values sent before it is shown. `POST .../{name}/refresh` lists the
|
|
2442
2581
|
tools again with the saved URL and credential, keeps them, and answers `{added, removed, changed, server}`: `changed`
|
|
2443
2582
|
names a tool whose title, description, schemas or annotations differ. `DELETE .../{name}` forgets the server and its
|
|
2444
|
-
credential. Capabilities' `features.mcp_client` says `transports: ["streamable-http"]`, the `auth` types
|
|
2445
|
-
"sealed"
|
|
2583
|
+
credential. Capabilities' `features.mcp_client` says `transports: ["streamable-http"]`, the `auth` types, `at_rest:
|
|
2584
|
+
"sealed"`, and `composio_per_run: true`: a per-run Composio server takes each run's own Composio account, named in the
|
|
2585
|
+
run's `mcp_auth`. A backend in front of an API-only server reads it there, since that server does not serve the API
|
|
2586
|
+
document.
|
|
2446
2587
|
|
|
2447
2588
|
### A credential handed with each run
|
|
2448
2589
|
|
|
@@ -3248,6 +3389,16 @@ warning, as a github trigger is with GitHub not connected. The first package is
|
|
|
3248
3389
|
rules of an apply are in [templates/README.md](https://github.com/Parcha-ai/agentrun/blob/main/packages/serve/templates/README.md);
|
|
3249
3390
|
`agentrun template validate DIR` checks a folder as the server does.
|
|
3250
3391
|
|
|
3392
|
+
`GET /v2/marketplace/templates` lists the templates on [marketplace.agentrun.ai](https://marketplace.agentrun.ai), the
|
|
3393
|
+
list the marketplace publishes (`/search.json`), each with `here`, the id of the package on this server that it is
|
|
3394
|
+
(`x-agentrun-serve: "marketplace/1"`). The server reads the list only when asked, never at its start, keeps it 5
|
|
3395
|
+
minutes, and keeps the last good one through a failed read (`state: "stale"`); with none it answers `unreachable` and an
|
|
3396
|
+
empty list, always with a 200. Nothing on the list is imported or run: an entry that names its `source` installs with
|
|
3397
|
+
`POST /v2/templates/import`, its publisher trusted once, and one that names none from its marketplace page. The
|
|
3398
|
+
console's Templates and Build pages list this server's packages, then the marketplace's others.
|
|
3399
|
+
`AGENTRUN_MARKETPLACE=off` reads none, as does `--faux` unless it names an address; `AGENTRUN_MARKETPLACE=<https
|
|
3400
|
+
address>` reads that site's list.
|
|
3401
|
+
|
|
3251
3402
|
`agentrun template eval DIR` (`agentrun-serve eval-template DIR`) runs a package's eval cases as real runs of its agent
|
|
3252
3403
|
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
|
|
3253
3404
|
touches yours, with each case's fake MCP servers on loopback and its corrections seeded through the learning API. Real
|
|
@@ -3281,9 +3432,9 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
3281
3432
|
| `DELETE /runs/{id}` | This server's own route (`x-agentrun-serve: "purge/1"`): [purges](#purging-a-run-or-an-agent-made-here) a run that is not live, its cost kept in every total. `204`, again on a second `DELETE`; a live run is `409 run_not_final`, and every route of a purged run is `410 purged`. |
|
|
3282
3433
|
| `DELETE /agents/{id}/sign-ins/{key}` | This server's own route (`x-agentrun-serve: "signins/1"`): forgets one of the agent's [saved sign-ins](#saved-sign-ins), at its vendor and here. `409 sign_in_held` while a run holds its save lease, or while a run it was handed is still going. |
|
|
3283
3434
|
| `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. |
|
|
3284
|
-
| `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`. |
|
|
3435
|
+
| `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, `source=<name>` (`runsource/1`, once per request) keeps the runs imported from that source (its name as `imported_from.source` holds it: `claude-code`, `codex`, ...) and `source=live` the runs made here, not imported, and `archived=true` lists only archived ones. A failed run's summary carries its `error`, and a waiting run's its `pending`. |
|
|
3285
3436
|
| `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). |
|
|
3286
|
-
| `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. |
|
|
3437
|
+
| `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. |
|
|
3287
3438
|
| `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`). |
|
|
3288
3439
|
| `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. |
|
|
3289
3440
|
| `POST /runs/{id}/archive`, `POST /runs/{id}/unarchive` | [Archiving](#archiving) one run. Answers the run, with `archived_at`. |
|
|
@@ -3303,9 +3454,11 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
3303
3454
|
| `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)). |
|
|
3304
3455
|
| `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)). |
|
|
3305
3456
|
| `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)). |
|
|
3457
|
+
| `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. |
|
|
3306
3458
|
| `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. |
|
|
3307
3459
|
| `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. |
|
|
3308
3460
|
| `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. |
|
|
3461
|
+
| `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. |
|
|
3309
3462
|
| `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`. |
|
|
3310
3463
|
| `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)). |
|
|
3311
3464
|
|
|
@@ -3471,11 +3624,22 @@ serves these routes alone:
|
|
|
3471
3624
|
refused with `412` leaves it the token's), and one that lands while the token's is under way wins: the token's is
|
|
3472
3625
|
`412`.
|
|
3473
3626
|
|
|
3474
|
-
The names route above is the listing: there is no list or read of a server's address, auth or tools here
|
|
3475
|
-
generic save (`PUT /settings/mcp-servers/{name}`)
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
way;
|
|
3627
|
+
The names route above is the listing: there is no list or read of a server's address, auth or tools here. The
|
|
3628
|
+
generic save (`PUT /settings/mcp-servers/{name}`) is a `404` unless the operator names the MCP origins it may save at,
|
|
3629
|
+
so by default the token saves no server at an address or with headers of its own. The preview, refresh, sign-in,
|
|
3630
|
+
Composio tool listing and every other MCP settings route stay refused. On the full server the token's `api_key_env`
|
|
3631
|
+
is `403`, as `api_key` is: the owner's session saves a Composio server there either way;
|
|
3632
|
+
- a per_run MCP server's save at an origin the operator names: `AGENTRUN_API_ONLY_MCP_ORIGINS`, comma-separated
|
|
3633
|
+
http(s) origins (`https://mcp.example.com`), a plain setting. With it, the token's `PUT /settings/mcp-servers/{name}`
|
|
3634
|
+
saves `"auth": {"type": "per_run"}` at a listed origin, and each run hands its own credential in `mcp_auth`. A body
|
|
3635
|
+
that carries a credential, or a save over a server the token did not save or one that seals a credential, is `403`;
|
|
3636
|
+
any other origin or auth type, or a Composio server's name, is `404`. A wildcard or an entry that is not an http(s)
|
|
3637
|
+
origin alone stops the start, and a loopback origin also needs `AGENTRUN_MCP_ALLOW_LOOPBACK=1`. The list holds past
|
|
3638
|
+
the save: a per_run server the token saved at an origin not listed is refused, and nothing is sent to it. Unset, the
|
|
3639
|
+
list is empty, so on an upgrade list each such server's origin first, or re-save it from the owner's signed-in
|
|
3640
|
+
session with API-only off; the start names the servers off the list in one log line (`api_only_mcp_off_list`), never
|
|
3641
|
+
their addresses. A server the owner's session saved is not governed by the list, and its runs' `mcp_auth` still
|
|
3642
|
+
goes there;
|
|
3479
3643
|
- a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
|
|
3480
3644
|
|
|
3481
3645
|
Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
|
|
@@ -3704,7 +3868,9 @@ back.
|
|
|
3704
3868
|
`GET /v2/capabilities` lists each in `harnesses`, with `available` and, when not, the `reason`, and `default_model`: the
|
|
3705
3869
|
model the harness runs when a definition names none (`provider/model-id`, as a save and a run resolve it), or null where
|
|
3706
3870
|
it runs none (the harness does not run here, or no default model here runs on it: claude-agent never takes a gateway's
|
|
3707
|
-
model).
|
|
3871
|
+
model). Its `models` are those a save takes; `ready_models`, those of them a run takes now, their provider connected here
|
|
3872
|
+
(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`
|
|
3873
|
+
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
|
|
3708
3874
|
harness this server does not run yet saves with a warning on `definition.harness`, and a run of it is
|
|
3709
3875
|
`409 agent_not_runnable` with `details.harness`; it never runs on pi instead. This server runs pi always, and
|
|
3710
3876
|
`claude-agent`, `codex` and `opencode` when each adapter's package, pins and provider endpoint check out; the harness's
|
|
@@ -4744,13 +4910,27 @@ not metered and bills its own account outside the cap. fal is counted: a job sen
|
|
|
4744
4910
|
toolkit `fal`, or at `mcp.fal.ai`) through `run_model`, `submit_job` or `submit_jobs` is priced before it is sent, at
|
|
4745
4911
|
fal's unit price for its endpoint (the server's own `get_pricing`, read with the run's credential and kept five
|
|
4746
4912
|
minutes) times the units the job's input states: its images, their megapixels, its text's characters, the seconds it
|
|
4747
|
-
names
|
|
4748
|
-
|
|
4913
|
+
names (only on an endpoint whose input sets the length fal bills, such as Kling's or Veo's `duration`, and only in
|
|
4914
|
+
that field), or, for dubbing, lip-sync, voice isolation and speech-to-text, which fal bills by the length of the media they
|
|
4915
|
+
are given, that length, read from the file first. A length fal rounds up is rounded up the same way: a talking head's
|
|
4916
|
+
voice to whole seconds, ElevenLabs Music and dubbing to whole minutes. That price is held under the cap, a
|
|
4749
4917
|
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
|
|
4750
4918
|
server, with the price and the count it came from. It is an estimate at fal's list price, not fal's invoice: fal
|
|
4751
|
-
reports no cost for a job, and a minimum charge
|
|
4752
|
-
|
|
4753
|
-
|
|
4919
|
+
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
|
|
4920
|
+
depends on a setting and `get_pricing` states one rate (Ideogram v3's and Ideogram character's `rendering_speed`,
|
|
4921
|
+
Veo's audio and resolution, Kling v3's audio and voice control, sync-lipsync's pro model, Nano Banana Pro's and Nano
|
|
4922
|
+
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
|
|
4923
|
+
settings, a setting it leaves out at its default, plus any charge the page adds per unit (a web search, per image).
|
|
4924
|
+
Where the page and `get_pricing` disagree, the higher is held. The endpoints of those families (Ideogram v3 and
|
|
4925
|
+
character, Nano Banana Pro and 2, each also served as a Gemini image preview, Veo 3 and 3.1, Kling v3, sync-lipsync v2,
|
|
4926
|
+
Fabric 1.0) are each decided: priced by their settings or at one rate. Some of their video endpoints have no reader for
|
|
4927
|
+
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
|
|
4928
|
+
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
|
|
4929
|
+
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
|
|
4930
|
+
name it, never held at `get_pricing`'s one rate. Any other endpoint is priced at `get_pricing`'s one rate, whatever its
|
|
4931
|
+
settings. A job whose units can't be known before it runs (one billed by compute time or tokens,
|
|
4932
|
+
one that names no size or length, media whose length can't be read, an endpoint with no listed price, a setting value
|
|
4933
|
+
the model page names no rate for, a variant whose rate is not decided) is refused under a cap,
|
|
4754
4934
|
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
|
|
4755
4935
|
of this. A request costs its input, plus the output it
|
|
4756
4936
|
is sent with at the output price, plus any fee its tokens do not show (below). Its input is priced at its worst case:
|
package/dist/acp-package.d.ts
CHANGED
|
@@ -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. */
|