@parcha/agentrun-serve 0.1.0-beta.56 → 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.
- package/CHANGELOG.md +229 -0
- package/README.md +201 -52
- 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 +17 -5
- package/dist/api-only.js +34 -8
- 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.d.ts +74 -16
- package/dist/claude-login.js +215 -56
- package/dist/claude-sign-in.d.ts +17 -6
- package/dist/claude-sign-in.js +42 -39
- package/dist/cli.js +63 -6
- 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-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/console/assets/{backend-Boh7tC4i.js → backend-DVhHzJX2.js} +19 -19
- package/dist/console/assets/index-Bwn1oTem.css +1 -0
- package/dist/console/assets/index-okP-y8PK.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/docker-host-addresses.d.ts +22 -11
- package/dist/docker-host-addresses.js +38 -26
- package/dist/env-switch.d.ts +10 -0
- package/dist/env-switch.js +33 -2
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fal-price.d.ts +58 -20
- package/dist/fal-price.js +341 -82
- 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/secrets.d.ts +13 -3
- package/dist/learn/secrets.js +118 -17
- package/dist/learning-cost.d.ts +6 -3
- package/dist/learning-cost.js +4 -2
- package/dist/link-check.js +1 -1
- 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 +30 -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/model-form.d.ts +5 -4
- package/dist/model-form.js +11 -7
- package/dist/model.d.ts +5 -2
- package/dist/model.js +9 -5
- package/dist/ollama-provider.d.ts +7 -1
- package/dist/ollama-provider.js +14 -2
- package/dist/openapi.js +178 -27
- 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/provider.d.ts +9 -0
- package/dist/provider.js +50 -3
- 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 +2 -0
- 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/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 +55 -10
- package/dist/runner/adapter-run-spec.d.ts +45 -8
- package/dist/runner/adapter-run-spec.js +150 -28
- package/dist/runner/adapters/pi.js +25 -3
- package/dist/runner/beside.js +4 -3
- package/dist/runner/big-writes.js +1 -10
- package/dist/runner/claim-secrets.d.ts +18 -3
- package/dist/runner/claim-secrets.js +35 -6
- package/dist/runner/cli-run-spec.d.ts +6 -0
- package/dist/runner/cli-run-spec.js +82 -35
- 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 +11 -5
- package/dist/runner/journal-kinds.d.ts +5 -0
- package/dist/runner/journal-kinds.js +5 -0
- package/dist/runner/main.js +7 -2
- package/dist/runner/mcp-claim.js +30 -3
- package/dist/runner/mcp-run.d.ts +12 -0
- package/dist/runner/mcp-run.js +12 -5
- package/dist/runner/model-route.d.ts +17 -0
- package/dist/runner/model-route.js +120 -2
- package/dist/runner/run-child-host.d.ts +3 -0
- package/dist/runner/run-child-host.js +69 -28
- package/dist/runner/run-child.js +5 -2
- package/dist/runner/runner.d.ts +14 -3
- package/dist/runner/runner.js +129 -33
- 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.js +4 -40
- package/dist/runner/workflow-first.d.ts +11 -4
- package/dist/runner/workflow-first.js +14 -8
- package/dist/runner/workflow-spec.js +3 -2
- 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 +52 -11
- package/dist/server.js +345 -118
- package/dist/skills/agentrun-serve/SKILL.md +4 -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/schema.d.ts +6 -0
- package/dist/store/schema.js +11 -1
- 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 +1 -1
- package/dist/store/sqlite/run-patch.js +13 -4
- package/dist/store/sqlite/store.js +34 -4
- package/dist/store/store.d.ts +43 -2
- package/dist/store/store.js +20 -0
- package/dist/store-reads/learning.d.ts +6 -3
- package/dist/store-reads/learning.js +22 -7
- 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 +20 -9
- package/dist/template-eval.js +115 -33
- package/dist/template-import.d.ts +10 -0
- package/dist/template-import.js +16 -7
- 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 +26 -9
- package/dist/timeline/web-calls.js +124 -37
- 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 +6 -4
- package/dist/web-save.js +9 -12
- 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/computer-deps.d.ts +2 -1
- package/dist/workspace/computer-deps.js +9 -2
- package/dist/workspace/computer-for-claim.d.ts +12 -1
- package/dist/workspace/computer-for-claim.js +77 -8
- 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/synced-folder.js +3 -4
- package/dist/wrapped.d.ts +13 -5
- package/dist/wrapped.js +52 -26
- package/package.json +17 -11
- package/skills/agentrun-serve/SKILL.md +4 -0
- package/templates/README.md +30 -8
- 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
|
|
@@ -413,7 +471,10 @@ 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.
|
|
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
480
|
timeline and, once, to the model as an "AgentRun server note"), and the agent's own computer, a persistent setting, does.
|
|
@@ -1233,7 +1294,7 @@ this host's default, `AGENT_MODEL`. With no `AGENT_MODEL`, a model provider's ke
|
|
|
1233
1294
|
[tool key](#tool-keys), gives the default, the first of: `anthropic/claude-sonnet-5-5` with `ANTHROPIC_API_KEY`,
|
|
1234
1295
|
`openai/gpt-6.1-sol` with `OPENAI_API_KEY`, `particle/particle-1` with `PARTICLE_API_KEY`, then
|
|
1235
1296
|
`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;
|
|
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;
|
|
1237
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`
|
|
1238
1299
|
or `strong`), and the host maps it, `fast` to `AGENT_MODEL_FAST` and `strong` to `AGENT_MODEL_STRONG`, each falling back
|
|
1239
1300
|
to `AGENT_MODEL`. Capabilities show the mapping in `models` (`{source, route_prefix, fast, default, strong}`):
|
|
@@ -1520,7 +1581,10 @@ The sign-in is the owner's alone, over the owner's signed-in session (the API to
|
|
|
1520
1581
|
sign-in tab ends on a page that won't load: copy its whole address into the console, which sends it as
|
|
1521
1582
|
`POST /v2/settings/chatgpt/sign-in/finish` `{"redirect_url": "..."}`.
|
|
1522
1583
|
- `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`.
|
|
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.
|
|
1524
1588
|
- `DELETE /v2/settings/chatgpt` signs out: it removes the sign-in here and revokes it at OpenAI, and answers
|
|
1525
1589
|
`{"revoked": true}` when OpenAI confirmed it (or nothing was signed in, as when it only cancels a waiting sign-in).
|
|
1526
1590
|
When OpenAI didn't confirm it, the answer is `{"revoked": false, "message": "Signed out here. OpenAI didn't confirm
|
|
@@ -1559,13 +1623,20 @@ has the row **Use Claude Code's login on this machine**, over these routes:
|
|
|
1559
1623
|
login directory in the data folder, which you sign in once; `machine` is this machine's own Claude Code login, which
|
|
1560
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
|
|
1561
1625
|
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
|
-
|
|
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.
|
|
1565
1635
|
- `GET /v2/settings/claude-login` says `state`: `off`, `signed_in` (with the `account` the CLI names: method, email,
|
|
1566
1636
|
organization, plan), `signed_out`, `no_cli` (claude-agent's first run installs the pinned CLI), `unknown`, or
|
|
1567
1637
|
`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`
|
|
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
|
|
1569
1640
|
the login's place, for a terminal on the server's machine. Where the console is on that machine (a server on loopback
|
|
1570
1641
|
with no public address), `can_start` is true and `POST /v2/settings/claude-login/login` starts the pinned CLI's own
|
|
1571
1642
|
`auth login`, which opens a browser there. It runs with the same variables as `command`, so it signs in at `folder`,
|
|
@@ -1573,31 +1644,48 @@ has the row **Use Claude Code's login on this machine**, over these routes:
|
|
|
1573
1644
|
`machine` with the default `~/.claude`, the CLI is signed in as the person's own `claude` runs: no
|
|
1574
1645
|
`CLAUDE_CONFIG_DIR` or `CLAUDE_SECURESTORAGE_CONFIG_DIR`, in their home, so it writes the account in `~/.claude.json`
|
|
1575
1646
|
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.
|
|
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
|
|
1578
1651
|
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
|
-
|
|
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`
|
|
1589
1671
|
says what became of that sign-in while the server runs: `waiting` for the browser since `started_at`, `signed_in`,
|
|
1590
1672
|
`timed_out` (no answer from the browser within 10 minutes, so it was ended and a sign-in page still open can't
|
|
1591
1673
|
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
|
|
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.
|
|
1593
1678
|
- `DELETE /v2/settings/claude-login` turns it off. The login stays as the CLI keeps it.
|
|
1594
1679
|
|
|
1595
1680
|
While it is on, a claude-agent run on an `anthropic/<model>` model goes on the login: its CLI gets no
|
|
1596
1681
|
`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN` or key, no model proxy runs, and the CLI's sandbox denies its commands
|
|
1597
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
|
|
1598
1683
|
`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
|
-
|
|
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
|
|
1601
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
|
|
1602
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
|
|
1603
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
|
|
@@ -1614,7 +1702,8 @@ saved earlier is dropped when the server starts, and claude-agent runs on the mo
|
|
|
1614
1702
|
|
|
1615
1703
|
Start Ollama (`ollama serve`, or its app) beside your own server and it lists Ollama's models itself, with no key, no
|
|
1616
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
|
|
1617
|
-
is `ollama/<tag>` in `harnesses[].models` and `harnesses[].free_models` for pi
|
|
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
|
|
1618
1707
|
`<tag> · local (Ollama)`, on a run's page too (from the run's `tokens` usage line, `provider` `ollama` and `model` the
|
|
1619
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
|
|
1620
1709
|
within half a minute (the listing is kept that long, and asked again behind the next answer). A down or stuck Ollama
|
|
@@ -1635,7 +1724,8 @@ seconds), and a run on any other model, a key's default included, never asks Oll
|
|
|
1635
1724
|
- Context: each request is Ollama's own `/api/chat`, streamed, with `options.num_ctx` the least of 65,536, the model's
|
|
1636
1725
|
trained context (where `/api/show` names one) and `OLLAMA_CONTEXT_LENGTH` (where the server's environment sets it to a
|
|
1637
1726
|
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.
|
|
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.
|
|
1639
1729
|
- Thinking: a model whose capabilities include `thinking` has its reasoning split out by Ollama. For any other, an
|
|
1640
1730
|
answer that opens with `<think>` has that part as thinking up to `</think>`, the split Ollama makes for a thinking
|
|
1641
1731
|
model, so the tags never reach the answer.
|
|
@@ -1644,11 +1734,16 @@ seconds), and a run on any other model, a key's default included, never asks Oll
|
|
|
1644
1734
|
- Cost: $0, booked as a known cost. Its requests never count toward the server's [limit on free
|
|
1645
1735
|
requests](#a-limit-on-free-requests): there is no shared quota behind them. An agent's own `max_requests` counts them,
|
|
1646
1736
|
with its other free requests, so a run on Ollama that keeps calling tools still stops there.
|
|
1647
|
-
- Harness: pi
|
|
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.
|
|
1648
1743
|
- Cloud models: an Ollama cloud model (a `-cloud` tag, with `remote_host` and `remote_model` in `/api/tags` or
|
|
1649
1744
|
`/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
|
|
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
|
|
1652
1747
|
pulled last first, so pulling one can change that default, and a saved agent that names no model follows it. Name the
|
|
1653
1748
|
model (`ollama/<tag>`) to pin it.
|
|
1654
1749
|
|
|
@@ -1679,7 +1774,7 @@ agent_not_runnable`, with `details.unbound` and `details.missing`).
|
|
|
1679
1774
|
| `ask_person` | Ask the person who started the run; the turn ends until a message answers | nothing | no, no |
|
|
1680
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 |
|
|
1681
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 |
|
|
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`
|
|
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 |
|
|
1683
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 |
|
|
1684
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 |
|
|
1685
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 |
|
|
@@ -1827,14 +1922,15 @@ Each child books on the run's cap, so size the cap for K passes, not one.
|
|
|
1827
1922
|
|
|
1828
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
|
|
1829
1924
|
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
|
|
1925
|
+
(`PUT /settings/tools`); (2) for
|
|
1832
1926
|
`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
|
-
|
|
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
|
|
1838
1934
|
searched, and an agent naming it is refused (`409`) until it is turned on again. A pick of `firecrawl-keyless` is keyless
|
|
1839
1935
|
Firecrawl with keyless Exa behind it, and a pick of `exa-keyless` is keyless Exa alone, the key held or not.
|
|
1840
1936
|
A workflow's model nodes may each run on another tier's model, so a workflow's `web_search` never searches natively:
|
|
@@ -1843,8 +1939,8 @@ unavailable for a workflow.
|
|
|
1843
1939
|
|
|
1844
1940
|
| | `claude-agent` | `codex` | pi |
|
|
1845
1941
|
| --- | --- | --- | --- |
|
|
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 |
|
|
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 |
|
|
1848
1944
|
| `web_search`, `off` | unavailable (`web_search is turned off in settings`): nothing is searched | the same | the same |
|
|
1849
1945
|
| `web_search`, `firecrawl-keyless` | Firecrawl's public MCP search, keyless Exa's behind it, a host tool | the same | the same |
|
|
1850
1946
|
| `web_search`, `exa-keyless` | Exa's public MCP search alone, a host tool | the same | the same |
|
|
@@ -2345,7 +2441,8 @@ Composio is an MCP server like any other, so it needs no adapter of its own. Set
|
|
|
2345
2441
|
preset: you give your Composio API key, a toolkit (`github`, `slack`...), the actions to grant (picked from the
|
|
2346
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
|
|
2347
2443
|
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
|
|
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,
|
|
2349
2446
|
user_id?, auth_config_id?, price_usd?}` makes and saves the server. In place of `api_key`, `"api_key_env":
|
|
2350
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
|
|
2351
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
|
|
@@ -2360,8 +2457,13 @@ server. `price_usd` (0 or more, as a `prices` value) is what each call costs you
|
|
|
2360
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
|
|
2361
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
|
|
2362
2459
|
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
|
-
|
|
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
|
|
2365
2467
|
you price them (`price_usd`, or the server's `prices`). Composio's own meta tools stay refused, and the helper actions
|
|
2366
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.
|
|
2367
2469
|
[Connect Composio tools and triggers](../../docs/tutorials/composio.md) walks through the preset and a Composio
|
|
@@ -2441,8 +2543,10 @@ its authorization server refused: sign in again), null for `auth.type` none. No
|
|
|
2441
2543
|
credential; a server's error text is cut of the values sent before it is shown. `POST .../{name}/refresh` lists the
|
|
2442
2544
|
tools again with the saved URL and credential, keeps them, and answers `{added, removed, changed, server}`: `changed`
|
|
2443
2545
|
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"
|
|
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.
|
|
2446
2550
|
|
|
2447
2551
|
### A credential handed with each run
|
|
2448
2552
|
|
|
@@ -3248,6 +3352,16 @@ warning, as a github trigger is with GitHub not connected. The first package is
|
|
|
3248
3352
|
rules of an apply are in [templates/README.md](https://github.com/Parcha-ai/agentrun/blob/main/packages/serve/templates/README.md);
|
|
3249
3353
|
`agentrun template validate DIR` checks a folder as the server does.
|
|
3250
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
|
+
|
|
3251
3365
|
`agentrun template eval DIR` (`agentrun-serve eval-template DIR`) runs a package's eval cases as real runs of its agent
|
|
3252
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
|
|
3253
3367
|
touches yours, with each case's fake MCP servers on loopback and its corrections seeded through the learning API. Real
|
|
@@ -3283,7 +3397,7 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
3283
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. |
|
|
3284
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`. |
|
|
3285
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). |
|
|
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. |
|
|
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. |
|
|
3287
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`). |
|
|
3288
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. |
|
|
3289
3403
|
| `POST /runs/{id}/archive`, `POST /runs/{id}/unarchive` | [Archiving](#archiving) one run. Answers the run, with `archived_at`. |
|
|
@@ -3303,9 +3417,11 @@ failed, 2 when nothing ran. The runner, the graders and the report are in
|
|
|
3303
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)). |
|
|
3304
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)). |
|
|
3305
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. |
|
|
3306
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. |
|
|
3307
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. |
|
|
3308
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. |
|
|
3309
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`. |
|
|
3310
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)). |
|
|
3311
3427
|
|
|
@@ -3471,11 +3587,28 @@ serves these routes alone:
|
|
|
3471
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
|
|
3472
3588
|
`412`.
|
|
3473
3589
|
|
|
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
|
-
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
|
|
3477
3593
|
server the token's `api_key_env` is `403`, as `api_key` is: the owner's session saves a Composio server there either
|
|
3478
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;
|
|
3479
3612
|
- a run's desktop or phone, for a backend that shows its user the live view and lets them take over: see below.
|
|
3480
3613
|
|
|
3481
3614
|
Here a run's computer routes take the server's token. `POST /runs/{id}/computer/viewer` mints a 5-minute link on
|
|
@@ -3704,7 +3837,9 @@ back.
|
|
|
3704
3837
|
`GET /v2/capabilities` lists each in `harnesses`, with `available` and, when not, the `reason`, and `default_model`: the
|
|
3705
3838
|
model the harness runs when a definition names none (`provider/model-id`, as a save and a run resolve it), or null where
|
|
3706
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
|
|
3707
|
-
model).
|
|
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
|
|
3708
3843
|
harness this server does not run yet saves with a warning on `definition.harness`, and a run of it is
|
|
3709
3844
|
`409 agent_not_runnable` with `details.harness`; it never runs on pi instead. This server runs pi always, and
|
|
3710
3845
|
`claude-agent`, `codex` and `opencode` when each adapter's package, pins and provider endpoint check out; the harness's
|
|
@@ -4744,13 +4879,27 @@ not metered and bills its own account outside the cap. fal is counted: a job sen
|
|
|
4744
4879
|
toolkit `fal`, or at `mcp.fal.ai`) through `run_model`, `submit_job` or `submit_jobs` is priced before it is sent, at
|
|
4745
4880
|
fal's unit price for its endpoint (the server's own `get_pricing`, read with the run's credential and kept five
|
|
4746
4881
|
minutes) times the units the job's input states: its images, their megapixels, its text's characters, the seconds it
|
|
4747
|
-
names
|
|
4748
|
-
|
|
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
|
|
4749
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
|
|
4750
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
|
|
4751
|
-
reports no cost for a job, and a minimum charge
|
|
4752
|
-
|
|
4753
|
-
|
|
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,
|
|
4754
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
|
|
4755
4904
|
of this. A request costs its input, plus the output it
|
|
4756
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:
|
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. */
|
package/dist/adapters.d.ts
CHANGED
|
@@ -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
|
|
@@ -87,7 +87,8 @@ export type ConfineChild = (child: Readonly<{
|
|
|
87
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
|
|
88
88
|
* confinement for the harness's own process, and the skills it loads itself (claude-agent's, codex's and opencode's,
|
|
89
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
|
|
90
|
-
* 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). */
|
|
91
92
|
export type AdapterNeeds = {
|
|
92
93
|
model: ModelRef;
|
|
93
94
|
models: {
|
|
@@ -100,7 +101,12 @@ export type AdapterNeeds = {
|
|
|
100
101
|
unpriced?: ReadonlySet<string>;
|
|
101
102
|
now?: () => Date;
|
|
102
103
|
zone?: string;
|
|
104
|
+
heldRefusal?: string;
|
|
103
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;
|
|
104
110
|
/** The ConfineChild that starts a child under `prefix` (the argv pi's commands start under, ending in "--"); none when
|
|
105
111
|
* the run confines nothing (macOS), since an adapter refuses a confinement that adds nothing. */
|
|
106
112
|
export declare function confineOf(prefix: readonly string[]): ConfineChild | undefined;
|
|
@@ -139,6 +145,12 @@ export declare function harnessInstalled(harness: HarnessEntry, env: NodeJS.Proc
|
|
|
139
145
|
* so its adapter is never handed a skill it throws on. None where the package has no such check: every skill stays
|
|
140
146
|
* inlined. */
|
|
141
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;
|
|
142
154
|
/** What a harness's adapter takes from the run's plane (tool-plane.ts) where web_search resolves native, by its own search
|
|
143
155
|
* (its facts' webSearch): `native`, the provider's search through its proxy, with the input a search request may read in
|
|
144
156
|
* beyond its body (cap.ts), which its proxy adds to that request's bound; `live`, its own live search (its adapter books
|