@parcha/agentrun-serve 0.1.0-beta.60 → 0.1.0-beta.62
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 +124 -0
- package/README.md +139 -22
- package/dist/acp-package.d.ts +4 -0
- package/dist/api-only.d.ts +23 -1
- package/dist/api-only.js +43 -4
- package/dist/archil-settings.d.ts +9 -0
- package/dist/archil-settings.js +8 -1
- package/dist/bash-read-only.d.ts +3 -0
- package/dist/bash-read-only.js +6 -3
- package/dist/browser-person.d.ts +1 -1
- package/dist/browser-person.js +1 -1
- package/dist/calendar/tools.js +1 -1
- package/dist/chatgpt-plan.d.ts +26 -8
- package/dist/chatgpt-plan.js +89 -21
- package/dist/claude-login.d.ts +12 -5
- package/dist/claude-login.js +28 -3
- package/dist/cli.js +61 -18
- package/dist/composio-triggers.d.ts +9 -3
- package/dist/computers.d.ts +3 -0
- package/dist/computers.js +2 -1
- package/dist/console/assets/{backend-QnwGVBeU.js → backend-DEgVn5lC.js} +1 -1
- package/dist/console/assets/index-CG5tELph.js +639 -0
- package/dist/console/assets/share-CIeFK2Oe.js +6 -0
- package/dist/console/assets/{styles-CcceGcu2.js → styles-BGZxYkky.js} +2 -2
- package/dist/console/assets/{styles-fjQBFfMv.css → styles-D0SufbzK.css} +1 -1
- package/dist/console/index.html +3 -3
- package/dist/console/share.html +3 -3
- package/dist/cut-pool.d.ts +14 -0
- package/dist/cut-pool.js +98 -0
- package/dist/cut-worker.d.ts +14 -0
- package/dist/cut-worker.js +16 -0
- package/dist/decisions.d.ts +4 -0
- package/dist/decisions.js +9 -1
- package/dist/env-switch.d.ts +3 -0
- package/dist/env-switch.js +3 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/harness-check.js +2 -1
- package/dist/harness-recipe.d.ts +13 -2
- package/dist/harness-recipe.js +30 -7
- package/dist/harness-sign-in.js +2 -1
- package/dist/harness-table.d.ts +12 -3
- package/dist/harness-table.js +13 -8
- package/dist/import.d.ts +8 -1
- package/dist/import.js +36 -5
- package/dist/key-check.js +22 -8
- package/dist/key-refusal.js +6 -4
- package/dist/learn/secrets.d.ts +2 -1
- package/dist/learn/secrets.js +2 -2
- package/dist/learned-nodes.d.ts +37 -0
- package/dist/learned-nodes.js +24 -0
- package/dist/local-model.d.ts +144 -0
- package/dist/local-model.js +214 -0
- package/dist/mcp-gateway.d.ts +24 -0
- package/dist/mcp-gateway.js +97 -8
- package/dist/mcp-probe.d.ts +7 -0
- package/dist/mcp-probe.js +7 -0
- package/dist/mcp-servers-store.d.ts +7 -10
- package/dist/mcp-servers-store.js +15 -9
- package/dist/native/cli.js +5 -1
- package/dist/ollama-provider.d.ts +42 -0
- package/dist/ollama-provider.js +118 -2
- package/dist/openapi.js +85 -16
- package/dist/otel/tracer.d.ts +6 -3
- package/dist/otel/tracer.js +24 -6
- package/dist/page.d.ts +7 -0
- package/dist/page.js +17 -4
- package/dist/place.d.ts +28 -11
- package/dist/place.js +43 -14
- package/dist/print.d.ts +3 -2
- package/dist/print.js +8 -6
- package/dist/redact/match.d.ts +17 -4
- package/dist/redact/match.js +57 -15
- package/dist/run-export.js +4 -2
- package/dist/run-launch.js +16 -3
- package/dist/run-model-key.d.ts +2 -1
- package/dist/run-model-key.js +2 -1
- package/dist/run-reads-over-store.d.ts +7 -0
- package/dist/run-reads-over-store.js +32 -4
- package/dist/run-usage.js +3 -2
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +16 -6
- package/dist/runner/adapter-loop.d.ts +8 -1
- package/dist/runner/adapter-loop.js +148 -29
- package/dist/runner/adapter-run-spec.d.ts +9 -6
- package/dist/runner/adapter-run-spec.js +38 -52
- package/dist/runner/adapters/index.d.ts +4 -0
- package/dist/runner/adapters/index.js +2 -1
- package/dist/runner/adapters/pi.d.ts +3 -2
- package/dist/runner/adapters/pi.js +3 -1
- package/dist/runner/audit.d.ts +1 -1
- package/dist/runner/claim-secrets.d.ts +3 -1
- package/dist/runner/claim-secrets.js +18 -7
- package/dist/runner/cli-run-spec.js +24 -17
- package/dist/runner/compare-end.d.ts +1 -1
- package/dist/runner/dispatch.js +4 -2
- package/dist/runner/harness-loops.d.ts +14 -0
- package/dist/runner/harness-loops.js +51 -5
- package/dist/runner/held.d.ts +4 -1
- package/dist/runner/live-ticker.js +5 -4
- package/dist/runner/loop-contract.d.ts +4 -1
- package/dist/runner/mcp-claim.js +3 -2
- package/dist/runner/mcp-run.d.ts +24 -4
- package/dist/runner/mcp-run.js +47 -2
- package/dist/runner/meta-tools.js +4 -4
- package/dist/runner/metrics.d.ts +6 -0
- package/dist/runner/metrics.js +12 -4
- package/dist/runner/monid-run.js +3 -1
- package/dist/runner/native-loop.js +3 -3
- package/dist/runner/redact.d.ts +3 -0
- package/dist/runner/redact.js +7 -0
- package/dist/runner/run-child-host.d.ts +10 -6
- package/dist/runner/run-child-host.js +44 -29
- package/dist/runner/run-child.js +1 -0
- package/dist/runner/runner.js +2 -0
- package/dist/runner/sdk-loop.js +5 -3
- package/dist/runner/workflow-calls.d.ts +5 -1
- package/dist/runner/workflow-calls.js +65 -19
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +3 -1
- package/dist/runner/workflow-spec.d.ts +4 -0
- package/dist/runner/workflow-spec.js +18 -13
- package/dist/runs-over-store.d.ts +2 -2
- package/dist/runs-over-store.js +1 -1
- package/dist/secret-cut.js +7 -4
- package/dist/secret-rules.d.ts +0 -1
- package/dist/secret-rules.js +122 -88
- package/dist/server.d.ts +17 -1
- package/dist/server.js +208 -69
- package/dist/share-host.d.ts +111 -0
- package/dist/share-host.js +666 -0
- package/dist/slack.js +2 -1
- package/dist/store/postgres/migrate.js +3 -1
- package/dist/store-reads/analytics.d.ts +15 -0
- package/dist/store-reads/analytics.js +17 -0
- package/dist/store-reads/learning.d.ts +5 -4
- package/dist/store-reads/learning.js +7 -4
- package/dist/suggestions.js +32 -3
- package/dist/templates.d.ts +3 -1
- package/dist/templates.js +7 -3
- package/dist/tool-gate.d.ts +25 -9
- package/dist/tool-gate.js +58 -19
- package/dist/tool-plane.d.ts +24 -1
- package/dist/tool-plane.js +75 -3
- package/dist/tools.d.ts +12 -2
- package/dist/tools.js +42 -7
- package/dist/trigger-composio.js +1 -1
- package/dist/trigger-launch-hook.d.ts +2 -2
- package/dist/trigger-launch-hook.js +1 -1
- package/dist/triggers.d.ts +7 -4
- package/dist/triggers.js +4 -4
- package/dist/webhooks.d.ts +3 -0
- package/dist/webhooks.js +5 -0
- package/dist/workspace/archil-claim.d.ts +7 -3
- package/dist/workspace/archil-claim.js +13 -5
- package/dist/workspace/archil-mount-credential.d.ts +6 -0
- package/dist/workspace/archil-mount-credential.js +11 -0
- package/dist/workspace/computer-deps.d.ts +5 -3
- package/dist/workspace/computer-deps.js +11 -9
- package/dist/workspace/computer-for-claim.d.ts +6 -2
- package/dist/workspace/computer-for-claim.js +43 -12
- package/dist/workspace/computer-janitor.d.ts +7 -4
- package/dist/workspace/computer-janitor.js +7 -4
- package/dist/workspace/computer-kept.d.ts +7 -1
- package/dist/workspace/computer-kept.js +7 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +12 -3
- package/dist/workspace/mount-revoke-left.d.ts +16 -4
- package/dist/workspace/mount-revoke-left.js +42 -22
- package/dist/workspace/resolve-computer.d.ts +11 -5
- package/dist/workspace/resolve-computer.js +22 -13
- package/dist/workspace/run-end-computers.js +1 -1
- package/dist/workspace/run-tools.d.ts +10 -3
- package/dist/workspace/run-tools.js +5 -4
- package/dist/wrapped.d.ts +29 -2
- package/dist/wrapped.js +20 -3
- package/launcher/agentrun-serve +1 -1
- package/package.json +12 -12
- package/dist/console/assets/index-DZi-muIj.js +0 -629
- package/dist/console/assets/share-pz61zIn9.js +0 -6
package/dist/openapi.js
CHANGED
|
@@ -33,6 +33,8 @@ import { COMPILE_AFTER_MAX } from "./learning-setting.js";
|
|
|
33
33
|
import { LOOP_COMPILES_MAX } from "./store-reads/loop.js";
|
|
34
34
|
import { GRADE_SOURCES, GRADES_KEPT, LABEL_MAX } from "./learn/promote.js";
|
|
35
35
|
import { MODEL_SOURCES, THINKING_LEVELS } from "./model.js";
|
|
36
|
+
// Also registers its operations as the owner's alone (secret-writes.ts).
|
|
37
|
+
import { INKLING, INKLING_OLLAMA, LOCAL_MODEL_TAGS, QWEN3_DEFAULT } from "./local-model.js";
|
|
36
38
|
import { MAX_MODEL_KEY_CHARS } from "./run-model-key.js";
|
|
37
39
|
import { MIN_SECRET } from "./learn/secrets.js";
|
|
38
40
|
import { HANDED_SECRET } from "./handed-secret.js";
|
|
@@ -171,6 +173,8 @@ const closed = (properties, description) => ({ type: "object", additionalPropert
|
|
|
171
173
|
const USD = { type: ["number", "null"], minimum: 0, description: "The sum of the known costs, rounded to 1e-6; null when no run's cost is known, never 0 for unknown." };
|
|
172
174
|
/** wrapped/1: GET /wrapped's answer (wrapped.ts). */
|
|
173
175
|
const WRAPPED_TOKENS = closed({ input: COUNT, output: COUNT, cache_read: COUNT, cache_write: COUNT });
|
|
176
|
+
/** One figure per cache cause (the import package's CACHE_CAUSES), each always there. */
|
|
177
|
+
const CACHE_BY_CAUSE = (value) => closed(Object.fromEntries(["model", "idle", "compaction", "edited", "sidechain", "unknown"].map((cause) => [cause, value])));
|
|
174
178
|
const WRAPPED = closed({
|
|
175
179
|
year: { type: "integer", minimum: 1000, maximum: 9999 },
|
|
176
180
|
sessions: { ...COUNT, description: "Sessions whose first request falls in the year." },
|
|
@@ -188,6 +192,19 @@ const WRAPPED = closed({
|
|
|
188
192
|
sources: { type: "array", items: closed({ source: { type: "string" }, sessions: COUNT, requests: COUNT }), description: "By the tool the sessions were read from." },
|
|
189
193
|
imported: { type: "array", items: closed({ source: { type: "string" }, runs: COUNT }), description: "The runs imported here in the year, by source (never `live`)." },
|
|
190
194
|
unread_files: { ...COUNT, description: "Session files that could not be read (gone since listed, or not openable by this user), so the numbers are short by them. A count only: no path." },
|
|
195
|
+
cache: {
|
|
196
|
+
oneOf: [
|
|
197
|
+
closed({
|
|
198
|
+
runs: { ...COUNT, description: "The year's imported Claude Code, Codex and pi runs whose cache the import analyzed. A session left out of the import, or imported before it analyzed caches, is not among them." },
|
|
199
|
+
hit_rate: { type: ["number", "null"], minimum: 0, maximum: 1, description: "Cache read over the whole prompt (input, cache read and cache write) of those runs' requests and their subagents'; null when they sent none." },
|
|
200
|
+
breaks: { ...CACHE_BY_CAUSE(COUNT), description: "Cache breaks by cause: a turn whose cache read dropped more than 80% against the turn before it." },
|
|
201
|
+
extra_cost_usd: { ...CACHE_BY_CAUSE({ type: "number", minimum: 0 }), description: "By cause, what the breaks' re-sent tokens cost above a cache read, at list prices (USD); unpriced breaks are not in it." },
|
|
202
|
+
unpriced_breaks: { ...COUNT, description: "Breaks on a model with no list price: in `breaks`, not in `extra_cost_usd`." },
|
|
203
|
+
}),
|
|
204
|
+
{ type: "null" },
|
|
205
|
+
],
|
|
206
|
+
description: "The cache of the runs imported here in the year, from what the import kept of each (numbers only); null when none was analyzed.",
|
|
207
|
+
},
|
|
191
208
|
}, "A year of the work under this machine's home, bucketed by each request's time in the server's local zone.");
|
|
192
209
|
/** Runs counted together (AgentStoreReader.analytics's AnalyticsGroup). */
|
|
193
210
|
const GROUP = {
|
|
@@ -367,7 +384,7 @@ const RUN_USAGE_LINE = {
|
|
|
367
384
|
not_metered_calls: { type: "integer", minimum: 1, description: "On `tools`: calls with no price set (an MCP tool its owner set none for), as GET /usage counts them. They ran outside the run's cost and its cap, so they are in neither `quantity` nor `usd`: a line of such calls alone has `quantity` 0 and `usd` 0." },
|
|
368
385
|
resource: { enum: ["vcpu", "memory", "gpu", "disk"], description: "On `compute_time`: the resource the line counts." },
|
|
369
386
|
gpu_type: { type: ["string", "null"], description: "On `compute_time` for `gpu`: the provider's own name for the GPU type. Null on the other resources." },
|
|
370
|
-
unheld_quantity: { type: ["number", "null"], minimum: 0, description: "On `compute_time`: the part of `quantity` no claim of the run held, so no cap held and nothing booked: a computer kept past its claim for a follow-up, one deleted after its run ended, one whose delete failed, one still open. Its cost is in neither `usd` nor `total`. Null when `quantity` is." },
|
|
387
|
+
unheld_quantity: { type: ["number", "null"], minimum: 0, description: "On `compute_time`: the part of `quantity` no claim of the run held, so no cap held and nothing booked: a computer kept past its claim for a follow-up, one deleted after its run ended, one whose delete failed, one still open. Its cost is in neither `usd` nor `total`. Null when `quantity` is, on a provider that bills; 0 on one that bills nothing (Docker), its `quantity` known or not: its time costs nothing, held or not." },
|
|
371
388
|
open_computers: { type: "integer", minimum: 0, description: "On `compute_time`: how many of the line's computers no delete has ended yet (still running, or their delete failed), counted up to `measured_to`." },
|
|
372
389
|
measured_to: { type: "string", format: "date-time", description: "On `compute_time` with an open computer: the moment its time is counted to, this read's." },
|
|
373
390
|
},
|
|
@@ -416,7 +433,7 @@ const COMPUTER_INTERVAL = {
|
|
|
416
433
|
started_at: { type: "string", format: "date-time", description: "When the provider's create answered with the computer, on this server's clock." },
|
|
417
434
|
ended_at: { type: ["string", "null"], format: "date-time", description: "When the provider's delete of the computer answered ok, on this server's clock. Null while none did: the computer may still be running (a run that ended with one open left it behind), or its delete failed or its answer is unknown. Never a guessed end." },
|
|
418
435
|
kept: { type: "boolean", description: "The run's park kept the computer past its claim, for the person's answer (it is deleted once its keep's time passes, or at the run's end)." },
|
|
419
|
-
booked_seconds: { type: "number", minimum: 0, description: "How much of the computer's time a claim of the run held and booked on the run's ledger.
|
|
436
|
+
booked_seconds: { type: "number", minimum: 0, description: "How much of the computer's time a claim of the run held and booked on the run's ledger. On a provider that bills, the rest of its life is time no claim held (`unheld_quantity` on its `compute_time` lines); on one that bills nothing (Docker) both are 0. 0 for one whose provider has no price set.", "x-agentrun-serve": "runusage/4" },
|
|
420
437
|
...ATTEMPT_FIELDS,
|
|
421
438
|
},
|
|
422
439
|
};
|
|
@@ -895,11 +912,11 @@ const MCP_PIN = {
|
|
|
895
912
|
* resolves to on the agent's harness and model; a tool of bash's family its computer leaves out, unavailable. */
|
|
896
913
|
const AGENT_TOOLS = {
|
|
897
914
|
type: "array",
|
|
898
|
-
description: "Each tool the agent's current revision grants, in capabilities.tools' order, with its permission (permission, where it came from as permission_from, default_permission, permissions). A tool with a provider choice (web_search, web_fetch, browser) carries the provider
|
|
915
|
+
description: "Each tool the agent's current revision grants, in capabilities.tools' order, with its permission (permission, where it came from as permission_from, default_permission, permissions). A tool with a provider choice (web_search, web_fetch, browser) carries the provider picked (provider), where it came from (provider_from: agent, its own tool_settings; server, the server's settings; default, the built-in default), the one that applies when the agent sets none (default_provider, the server's), and what it resolves to on the agent's harness and model (resolved), which is what a run uses. Where the server's setting for web_fetch (`kernel`) or web_search (`native`, `off`) is a ceiling over the agent's own pick (a keyless service or Parallel, named or resolved to, or a native search under `off`), `ceiling` names that setting and `resolved` is the server's, not the pick's. A tool of bash's family (bash and the background tools) carries resolved only where the agent's computer gives a run of it no such tool, `unavailable: ` and why: with no computer that mounts the run's folder the background tools are not there, and bash neither unless the server keeps its folders on Archil, whose exec runs it. Only GET /agents/{agent_id} answers it.",
|
|
899
916
|
items: {
|
|
900
917
|
type: "object", additionalProperties: false, required: ["name", "permission", "permission_from", "default_permission", "permissions"],
|
|
901
918
|
properties: {
|
|
902
|
-
name: { type: "string" }, blurb: { type: "string", description: "One short line for people (the editor's Tools grid); the model never sees it. Absent for an MCP server's tool.", "x-agentrun-serve": "tool-blurb/1" }, provider: { type: "string" }, provider_from: { enum: ["agent", "server", "default"] }, default_provider: { type: "string" }, resolved: RESOLUTION,
|
|
919
|
+
name: { type: "string" }, blurb: { type: "string", description: "One short line for people (the editor's Tools grid); the model never sees it. Absent for an MCP server's tool.", "x-agentrun-serve": "tool-blurb/1" }, provider: { type: "string" }, provider_from: { enum: ["agent", "server", "default"] }, default_provider: { type: "string" }, resolved: RESOLUTION, ceiling: { type: "string", description: "The server's setting that is a ceiling over the agent's own pick here (`kernel` for web_fetch; `native` or `off` for web_search), present only where it holds the pick down: a run gets `resolved`, the server's, never the pick.", "x-agentrun-serve": "web-ceiling/1" },
|
|
903
920
|
permission: { ...PERMISSION, description: "The permission in force: a deny set on this server, which is absolute (no setting of the agent's reaches past it); else the agent's own (tool_settings), else the server's, else the owner's default.", "x-agentrun-serve": "approvals/1" },
|
|
904
921
|
permission_from: { enum: ["agent", "server", "default", "unattended"], description: "Where the permission came from: agent, its own tool_settings (the tool's key, or its MCP server's wildcard); server, the server's settings (always, for a deny set on the server, which is absolute); default, the owner's default; unattended, an ask its definition's approvals `never` allowed (permission is then allow).", "x-agentrun-serve": "approvals/1" },
|
|
905
922
|
default_permission: { enum: [...PERMISSIONS], description: "The one that applies when the agent sets none: the server's, else the owner's default.", "x-agentrun-serve": "approvals/1" },
|
|
@@ -1109,6 +1126,35 @@ const MODEL_GATEWAY_VIEW = closed({
|
|
|
1109
1126
|
secret: { ...SECRET_ITEM("\"model:gateway\": the gateway's key, which PUT /settings/model-gateway takes as api_key and AGENT_MODEL_API_KEY sets with AGENT_MODEL_BASE_URL."), description: "The gateway's key as its SecretMeta: never a value." },
|
|
1110
1127
|
problem: { type: ["string", "null"], description: "Why the gateway in force runs no model, in words: an address the one rule refuses (https only, or http to this machine; no user, query, fragment or dot segment). Null when none." },
|
|
1111
1128
|
});
|
|
1129
|
+
/** GET /settings/local-model's answer (local-model.ts localModelView): this machine, its Ollama, the model recommended for
|
|
1130
|
+
* them and the pull here. */
|
|
1131
|
+
const LOCAL_MODEL_VIEW = closed({
|
|
1132
|
+
machine: closed({
|
|
1133
|
+
platform: { type: "string", description: "The operating system as Node names it: `darwin`, `linux`, `win32`." },
|
|
1134
|
+
arch: { type: "string", description: "The CPU architecture as Node names it: `arm64`, `x64`." },
|
|
1135
|
+
ram_bytes: { type: "integer", minimum: 0, description: "Total memory, in bytes (on Apple silicon, its unified memory)." },
|
|
1136
|
+
gpu: { oneOf: [
|
|
1137
|
+
closed({ kind: { const: "apple" }, unified: { const: true } }, "Apple silicon (darwin on arm64): the GPU shares the unified memory."),
|
|
1138
|
+
closed({ kind: { const: "nvidia" }, name: { type: "string" }, memory_bytes: { type: "integer", minimum: 0 } }, "The first NVIDIA GPU nvidia-smi names, with its memory."),
|
|
1139
|
+
closed({ kind: { const: "unknown" } }, "No GPU read cheaply here."),
|
|
1140
|
+
] },
|
|
1141
|
+
}, "This machine, read once when the server started."),
|
|
1142
|
+
ollama: closed({ asked: { type: "boolean", description: "Whether this server asks an Ollama at all: false under the faux model or a model gateway (AGENT_MODEL_BASE_URL), where `reachable` is false, `version` null, and `recommended.why` is the refusal's words." }, reachable: { type: "boolean", description: "Whether the Ollama here answered GET /api/version." }, version: { type: ["string", "null"], description: "The version it says; null when it did not answer." } }),
|
|
1143
|
+
recommended: closed({
|
|
1144
|
+
tag: { type: ["string", "null"], description: `The Ollama tag recommended here: ${INKLING} on Apple silicon with Ollama ${INKLING_OLLAMA} or later, else ${QWEN3_DEFAULT} or a smaller qwen3 that fits in memory (one of ${LOCAL_MODEL_TAGS.join(", ")}). Null where none fits or no Ollama answers.` },
|
|
1145
|
+
why: { type: "string", description: "Why, in words: the memory each tag needs and this machine has, an Ollama to update or install, or that the tag is already pulled." },
|
|
1146
|
+
pulled: { type: "boolean", description: "Whether the Ollama here has the tag already: no pull needed." },
|
|
1147
|
+
}),
|
|
1148
|
+
pull: { oneOf: [{ type: "null" }, closedWith({
|
|
1149
|
+
tag: { type: "string" },
|
|
1150
|
+
state: { enum: ["pulling", "done", "failed"], description: "`done` once the model is in the server's listing too, so the picker has it." },
|
|
1151
|
+
status: { type: "string", description: "Ollama's last status line (`pulling manifest`, `pulling <digest>`, `success`)." },
|
|
1152
|
+
completed_bytes: { type: "integer", minimum: 0 },
|
|
1153
|
+
total_bytes: { type: "integer", minimum: 0, description: "The bytes of every layer Ollama has named so far." },
|
|
1154
|
+
}, { error: { type: "string", description: "With `failed`: why, in Ollama's words." } })], description: "The last pull made here since the server started, or null." },
|
|
1155
|
+
can_pull: { type: "boolean", description: "Whether POST /settings/local-model/pull may pull here." },
|
|
1156
|
+
refused: { type: ["string", "null"], description: "Why not, in words, with `can_pull` false: the faux model or a model gateway takes every model here, or this server is not one owner's own on their own machine. Null with `can_pull` true." },
|
|
1157
|
+
});
|
|
1112
1158
|
/** POST /settings/model-gateway/test's answer: the model ids the gateway lists, or why it could not be asked. */
|
|
1113
1159
|
const MODEL_GATEWAY_TEST = {
|
|
1114
1160
|
oneOf: [
|
|
@@ -1119,11 +1165,11 @@ const MODEL_GATEWAY_TEST = {
|
|
|
1119
1165
|
/** computer/1: an agent's computer kind, as Settings → Computers and the run read name it (computer-setting.ts). */
|
|
1120
1166
|
const COMPUTER_KIND = { enum: ["none", "sandbox", "desktop", "phone", "browser"] };
|
|
1121
1167
|
/** A computer choice's shell (computers.ts ShellChoice): where its runs have their shell, in this server's folder mode. */
|
|
1122
|
-
const CHOICE_SHELL = { enum: ["computer", "local", "none"], description: "Where a run of this choice has its shell, in this server's folder mode: `computer`, in the computer, which mounts the run's folder (bash and the background tools); `local`, no computer mounts it and the folder is on the owner's disk, so bash runs in a fresh container there (bash only); `none`, no computer mounts it and the folder is on this server's own disk,
|
|
1168
|
+
const CHOICE_SHELL = { enum: ["computer", "local", "none"], description: "Where a run of this choice has its shell, in this server's folder mode: `computer`, in the computer, which mounts the run's folder (bash and the background tools); `local`, no computer mounts it and the folder is on the owner's disk, so bash runs in a fresh container there (bash only); `none`, no computer mounts it and the run has no shell (the file tools only): the folder is on this server's own disk, or on Archil in a region with no serverless exec." };
|
|
1123
1169
|
/** The host tools a choice gives, by name: the kernel registry's list for its shell. */
|
|
1124
1170
|
const CHOICE_HOST_TOOLS = { type: "array", items: { type: "string" }, description: "Exactly the host tools a run of this choice gets, by name: the file tools always, bash with a shell (`computer` or `local`), the five background tools on a computer." };
|
|
1125
1171
|
/** What a choice leaves out of the shell, in words. */
|
|
1126
|
-
const CHOICE_SHELL_NOTE = { type: "string", description: "What this choice leaves out of the shell, in plain words; absent when its shell is `computer`. A save that names a tool it leaves out is refused in the same
|
|
1172
|
+
const CHOICE_SHELL_NOTE = { type: "string", description: "What this choice leaves out of the shell, in plain words; absent when its shell is `computer`. A save that names a tool it leaves out is refused, in words that give the same reason and how to get the tool." };
|
|
1127
1173
|
/** A sandbox's GPUs on an agent's computer setting (computer-setting.ts GpuSetting). */
|
|
1128
1174
|
const COMPUTER_GPU = {
|
|
1129
1175
|
type: "object", additionalProperties: false, required: ["type", "count"],
|
|
@@ -1441,7 +1487,7 @@ const TRIGGER_FIELDS = closed({
|
|
|
1441
1487
|
catchup_window_s: { type: "integer", minimum: 0, maximum: MAX_EVERY_S, description: `How late a missed time may still fire, once: of the times that came while the server was down (or its timer was late), the latest fires if it is this recent, under its own key, and the rest are one \`missed\` firing. 0: a missed time never fires. Default ${CATCHUP_WINDOW_S}.` },
|
|
1442
1488
|
max_active_runs: { type: ["integer", "null"], minimum: 1, maximum: MAX_ACTIVE_RUNS, description: `For a \`start_run\` trigger of a pushed source (a webhook, with or without \`accept\`): each event starts its own run, never skipped behind the last, and this is the most of its runs active at once. A firing past it waits due and is tried again; past 20 due an event is 429 \`rate_limited\`. Null: a trigger with \`accept\` takes every run this server has room for, and one without keeps the overlap skip. A schedule or a \`message_run\` target is 422 with it set.` },
|
|
1443
1489
|
failures_in_a_row: { type: "integer", minimum: 0, description: `Failed firings since the last that started a run; at ${FAILURES_TO_PAUSE} the trigger turns itself off (\`disabled\`). Turned on again, it counts from 0.` },
|
|
1444
|
-
disabled: { oneOf: [closed({ at: DATE_TIME, reason: { const: "auto_paused" } }), closed({ at: DATE_TIME, reason: { const: "source_unreadable" }, detail: { type: "string", description: "Why the source no longer reads." } }), closed({ at: DATE_TIME, reason: { const: "agent_archived" }, detail: { type: "string", description: "The agent it runs as, archived." } }), closed({ at: DATE_TIME, reason: { const: "connection_lost" }, detail: { type: "string", description: "Which connection went (GitHub disconnected here, or the App's installation deleted or suspended on GitHub)." } }), closed({ at: DATE_TIME, reason: { const: "sign_in_refused" }, detail: { type: "string", description: "What to fix: the account in Settings → Email." } }), { type: "null" }], description: `Why it is off, when the server turned it off: \`agent_archived\`, the agent it runs as was archived (turning it on is 409 agent_archived until the agent is unarchived); \`auto_paused\`, ${FAILURES_TO_PAUSE} failed firings in a row; \`connection_lost\`, the connection it needs went (GitHub disconnected here, or the App's installation deleted or suspended on GitHub); \`sign_in_refused\`, an email trigger's mail server refused the sign-in 3 times in a row (fix the account in Settings → Email, then turn it on); \`source_unreadable\`, its cron line or zone no longer reads here (a newer cron library or time zone data refuses it) or its every_s is out of range (a hand edit of its row), found at a start or when it came due, and only this trigger is turned off, or every feed a feed trigger reads has stopped (a 410, or a 404 three checks running, each), which turning it on again reads from the start (edit its urls first). Null once it is on again, which for \`source_unreadable\` takes a new source.` },
|
|
1490
|
+
disabled: { oneOf: [closed({ at: DATE_TIME, reason: { const: "auto_paused" } }), closed({ at: DATE_TIME, reason: { const: "source_unreadable" }, detail: { type: "string", description: "Why the source no longer reads." } }), closed({ at: DATE_TIME, reason: { const: "agent_archived" }, detail: { type: "string", description: "The agent it runs as, archived." } }), closed({ at: DATE_TIME, reason: { const: "connection_lost" }, detail: { type: "string", description: "Which connection went (GitHub disconnected here, or the App's installation deleted or suspended on GitHub)." } }), closed({ at: DATE_TIME, reason: { const: "sign_in_refused" }, detail: { type: "string", description: "What to fix: the account in Settings → Email." } }), { type: "null" }], description: `Why it is off, when the server turned it off: \`agent_archived\`, the agent it runs as was archived (turning it on is 409 agent_archived until the agent is unarchived); \`auto_paused\`, ${FAILURES_TO_PAUSE} failed firings in a row (turned on again in the console, or by PATCH /triggers/{trigger_id} with \`{"enabled": true}\`); \`connection_lost\`, the connection it needs went (GitHub disconnected here, or the App's installation deleted or suspended on GitHub); \`sign_in_refused\`, an email trigger's mail server refused the sign-in 3 times in a row (fix the account in Settings → Email, then turn it on); \`source_unreadable\`, its cron line or zone no longer reads here (a newer cron library or time zone data refuses it) or its every_s is out of range (a hand edit of its row), found at a start or when it came due, and only this trigger is turned off, or every feed a feed trigger reads has stopped (a 410, or a 404 three checks running, each), which turning it on again reads from the start (edit its urls first). Null once it is on again, which for \`source_unreadable\` takes a new source.` },
|
|
1445
1491
|
next_at: { type: ["string", "null"], format: "date-time", description: "When it fires next; null while it is off." },
|
|
1446
1492
|
last_run_id: { type: ["string", "null"], description: "The run its last firing that started one started; while that run is active (working, or waiting on a person), each firing is skipped, unless its firings each start their own run (a webhook with `accept`, or a pushed trigger with `max_active_runs`). Null until one starts." },
|
|
1447
1493
|
created_at: DATE_TIME,
|
|
@@ -2540,7 +2586,7 @@ const EXTENSIONS = {
|
|
|
2540
2586
|
"/runs/{run_id}/export": {
|
|
2541
2587
|
get: {
|
|
2542
2588
|
operationId: "getRunExport", tags: ["runs"], summary: "An ended run as a share bundle, every string cut",
|
|
2543
|
-
description: "The run as one `agentrun.share/1` document, the one a share page renders: its view's allowlisted fields, its Timeline rows, a workflow's graph, its UTF-8 text files within the caps, what is left out (`omitted`), and its sha256. Every string in it from the run is cut by the scrubber, with the values this server holds and the sign-ins the run was handed as its held values: a known key format, a held value and a dump (env output, a .env file, ~/.ssh) are cut for good; a value beside a label (`PGPASSWORD=`, `Authorization:`, `--password`) and a personal detail (a home path's user, an email, a private address) are cut and may be restored. Each cut is a record in `cuts`: where it is, its rule and kind, whether it may be restored, and its shape, never its value. The document is the same bytes on every export of the run, and is read back before it is answered: a value the cut left, or a scrub that failed, answers `500` with an empty body. `restore` re-exports with those cuts' values in place, each record moved to `restored`; an id of a cut that may not be restored, or of no cut, is `400`, and nothing is restored. `409 run_not_final` until the run has ended; `403 forbidden` while this server can't read the browser sign-in the run was handed; `413 export_too_large` over 8 MiB, never cut short.",
|
|
2589
|
+
description: "The run as one `agentrun.share/1` document, the one a share page renders: its view's allowlisted fields, its Timeline rows, a workflow's graph, its UTF-8 text files within the caps, what is left out (`omitted`), and its sha256. Every string in it from the run is cut by the scrubber, with the values this server holds and the sign-ins the run was handed as its held values: a known key format, a held value and a dump (env output, a .env file, ~/.ssh) are cut for good; a value beside a label (`PGPASSWORD=`, `Authorization:`, `--password`) and a personal detail (a home path's user, an email, a private address) are cut and may be restored. Each cut is a record in `cuts`: where it is, its rule and kind, whether it may be restored, and its shape, never its value. The document is the same bytes on every export of the run, and is read back before it is answered: a value the cut left, or a scrub that failed, answers `500` with an empty body. `restore` re-exports with those cuts' values in place, each record moved to `restored`; an id of a cut that may not be restored, or of no cut, is `400`, and nothing is restored. `409 run_not_final` until the run has ended; `403 forbidden` while this server can't read the browser sign-in the run was handed; `413 export_too_large` over 8 MiB, never cut short. Served in the API-only profile (`AGENTRUN_API_ONLY=1`) too, with the token: the share page that renders it is the console's, which that profile refuses.",
|
|
2544
2590
|
parameters: [ref("parameters/RunId"), { name: "restore", in: "query", required: false, description: "Cut ids to restore, comma-separated (the parameter may repeat): each a label, personal or jev cut of this run's bundle.", schema: { type: "string" } }],
|
|
2545
2591
|
responses: { "200": json(SHARE_BUNDLE, "The run's share bundle."), "500": { description: "The export failed closed: a scrub failed, or the bundle read back held a value. No body." }, ...errors(400, 401, 403, 404, 409, 413, 429) },
|
|
2546
2592
|
"x-agentrun-serve": "share/1",
|
|
@@ -3069,11 +3115,11 @@ const EXTENSIONS = {
|
|
|
3069
3115
|
"/settings/claude-login/sign-out": {
|
|
3070
3116
|
post: {
|
|
3071
3117
|
operationId: "signOutClaudeLogin", tags: ["local"], summary: "Sign out of Claude Code's login on this machine: AgentRun's own login removed, the mode off",
|
|
3072
|
-
description: "For a person to sign in fresh, or as another account: a turn-off leaves the login as the CLI keeps it, so the next turn-on reads it again. Ends a sign-in that waits, turns the mode off, runs the pinned CLI's own `claude auth logout` on AgentRun's own login folder (`<data>/claude-login`), which removes its credentials file and, on macOS, its Keychain item for that folder, then removes the folder (credentials, account, profiles, refresh locks), the login's signed-in note and the runner's token reader, whatever the CLI said. The next turn-on finds no login (`signed_out`) and the sign-in starts as before. Runs already going on the login are left as a turn-off leaves them: each keeps the token its CLI holds, and fails saying the login is signed out at its next read of it. `confirmed` false: signed out here and the mode off, and `message` says what may remain: the CLI didn't confirm its own sign-out, or its step failed, named (on macOS its Keychain item may remain); a removal failed, each named with its path (the others still happen); or the folder had become a link, which alone is removed, with no CLI run through it and nothing it leads to touched. 403 forbidden, with nothing touched, when the login is this machine's own (`place` `machine`: the person's `~/.claude` or CLAUDE_CONFIG_DIR): AgentRun never signs it out, and the words say to run `claude auth logout` in a terminal there. 404 not_found, naming the operation, when AGENTRUN_CLAUDE_CODE_LOGIN is `off`. A secret write: the owner's signed-in session alone (ownerSession).",
|
|
3118
|
+
description: "For a person to sign in fresh, or as another account: a turn-off leaves the login as the CLI keeps it, so the next turn-on reads it again. Ends a sign-in that waits, turns the mode off, runs the pinned CLI's own `claude auth logout` on AgentRun's own login folder (`<data>/claude-login`), which removes its credentials file and, on macOS, its Keychain item for that folder, then removes the folder (credentials, account, profiles, refresh locks), the login's signed-in note and the runner's token reader, whatever the CLI said. The next turn-on finds no login (`signed_out`) and the sign-in starts as before. Runs already going on the login are left as a turn-off leaves them: each keeps the token its CLI holds, and fails saying the login is signed out at its next read of it. `confirmed` false: signed out here and the mode off, and `message` says what may remain: the CLI didn't confirm its own sign-out, or its step failed, named (on macOS its Keychain item may remain); a removal failed, each named with its path (the others still happen); on macOS, an older Keychain item a sign-in left under the account `unknown`, which holds a refresh token and which the sign-out deletes too, could not be removed, which makes `confirmed` false even where the CLI confirmed its own sign-out, with how to delete that item alone: its exact service, `Claude Code-credentials-` and 8 hex of AgentRun's folder, to search in Keychain Access, or the one `security delete-generic-password -a unknown -s \"<that service>\"` command; or the folder had become a link, which alone is removed, with no CLI run through it and nothing it leads to touched. 403 forbidden, with nothing touched, when the login is this machine's own (`place` `machine`: the person's `~/.claude` or CLAUDE_CONFIG_DIR): AgentRun never signs it out, and the words say to run `claude auth logout` in a terminal there. 404 not_found, naming the operation, when AGENTRUN_CLAUDE_CODE_LOGIN is `off`. A secret write: the owner's signed-in session alone (ownerSession).",
|
|
3073
3119
|
"x-agentrun-secret": true,
|
|
3074
3120
|
security: [{ ownerSession: [] }],
|
|
3075
3121
|
responses: {
|
|
3076
|
-
"200": json({ type: "object", additionalProperties: false, required: ["confirmed", "login"], properties: { confirmed: { type: "boolean", description: "Whether all of the login is gone: the CLI confirmed its own sign-out
|
|
3122
|
+
"200": json({ type: "object", additionalProperties: false, required: ["confirmed", "login"], properties: { confirmed: { type: "boolean", description: "Whether all of the login is gone: the CLI confirmed its own sign-out, every removal landed, and on macOS no older Keychain item a sign-in left under the account `unknown` may remain. So it is false where the CLI confirmed its sign-out but that item could not be removed. The CLI's sign-out runs where the folder is already gone too, so a retry after an unconfirmed sign-out is true only where the CLI confirms." }, message: { type: "string", description: "With `confirmed` false: what may remain, in words (the CLI's step unconfirmed or failed, a removal that failed, on macOS an older Keychain item under the account `unknown` that could not be removed, with its exact service and how to delete that item alone, a link left in place of the folder)." }, login: CLAUDE_LOGIN } }, "Signed out here."),
|
|
3077
3123
|
...errors(401, 403, 404, 429, 500),
|
|
3078
3124
|
},
|
|
3079
3125
|
"x-agentrun-serve": "claudelogin/1",
|
|
@@ -3123,6 +3169,27 @@ const EXTENSIONS = {
|
|
|
3123
3169
|
"x-agentrun-serve": "modelgateway/1",
|
|
3124
3170
|
},
|
|
3125
3171
|
},
|
|
3172
|
+
"/settings/local-model": {
|
|
3173
|
+
get: {
|
|
3174
|
+
operationId: "getLocalModel", tags: ["local"], summary: "This machine, its Ollama, the free local model recommended for them, and the pull here",
|
|
3175
|
+
description: `What the console's Free local model card reads: the machine (platform, arch, memory, a GPU where it is cheap to read), whether the Ollama here answers and its version, the model recommended (${INKLING} on Apple silicon with Ollama ${INKLING_OLLAMA} or later; else ${QWEN3_DEFAULT}, or a smaller qwen3 that fits in memory, or none, with why), and the pull here with its progress. The owner's signed-in session alone (ownerSession), never the token, which is 403 forbidden in words.`,
|
|
3176
|
+
"x-agentrun-secret": true,
|
|
3177
|
+
security: [{ ownerSession: [] }],
|
|
3178
|
+
responses: { "200": json(LOCAL_MODEL_VIEW, "This machine and its model."), ...errors(401, 403, 429, 500) },
|
|
3179
|
+
"x-agentrun-serve": "localmodel/1",
|
|
3180
|
+
},
|
|
3181
|
+
},
|
|
3182
|
+
"/settings/local-model/pull": {
|
|
3183
|
+
post: {
|
|
3184
|
+
operationId: "pullLocalModel", tags: ["local"], summary: "Pull a recommended model into the Ollama here",
|
|
3185
|
+
description: `Starts pulling \`tag\` through this server's own Ollama (POST /api/pull) and answers at once; GET /settings/local-model shows its progress, and once it is \`done\` the model is in capabilities' models with no restart. Only a tag the recommendation can name, ${LOCAL_MODEL_TAGS.join(", ")} (422 input_invalid for any other). Only on one owner's own server on their own machine, and never under the faux model or a model gateway: 403 forbidden in words otherwise. One pull at a time: 409 local_model_pulling while one is under way. The owner's signed-in session alone (ownerSession).`,
|
|
3186
|
+
"x-agentrun-secret": true,
|
|
3187
|
+
security: [{ ownerSession: [] }],
|
|
3188
|
+
requestBody: { required: true, content: { "application/json": { schema: { type: "object", additionalProperties: false, required: ["tag"], properties: { tag: { enum: [...LOCAL_MODEL_TAGS], description: "The tag to pull: the recommendation's (`recommended.tag`), one of the tags a recommendation names (any other: 422)." } } } } } },
|
|
3189
|
+
responses: { "202": json(LOCAL_MODEL_VIEW, "The pull started: `pull` is under way."), ...errors(401, 403, 409, 415, 422, 429, 500) },
|
|
3190
|
+
"x-agentrun-serve": "localmodel/1",
|
|
3191
|
+
},
|
|
3192
|
+
},
|
|
3126
3193
|
"/auth/session": {
|
|
3127
3194
|
get: {
|
|
3128
3195
|
operationId: "getAuthSession", tags: ["local"], summary: "Whether this browser has accounts, is signed in, and may save a secret",
|
|
@@ -3425,7 +3492,7 @@ const EXTENSIONS = {
|
|
|
3425
3492
|
"/settings/tools": {
|
|
3426
3493
|
get: {
|
|
3427
3494
|
operationId: "getToolSettings", tags: ["capabilities"], summary: "The server's tool settings",
|
|
3428
|
-
description: "Each capability that has a choice, and its provider, and each tool's permission that is set (an MCP server's wildcard mcp:<server>/* among them): web_search auto (Parallel where the server holds its key, which bills it, else Firecrawl's keyless search with Exa's behind it, on every harness), native (the harness's own search, claude-agent's or codex's, or on pi the model provider's hosted one: that alone), firecrawl-keyless (Firecrawl's, Exa's behind it), exa-keyless (that alone) or parallel; web_fetch auto (Parallel's extract where the server holds a Parallel key, which bills it, with the guarded direct fetch behind it, else Firecrawl's keyless fetch, which is sent each URL read, never a private or local one, with the guarded direct fetch behind it), firecrawl-keyless (that, whatever the key), kernel (the guarded direct fetch alone) or parallel; browser auto (Browserbase where the server holds its keys, else Kernel where it holds Kernel's), browserbase, kernel (each that alone) or chrome (a Chrome on the server's host, not set up on any server yet: unavailable). An agent's definition.tool_settings is over these, except a permission set to deny here: a server deny is absolute and refuses the tool on this server whatever the agent sets. capabilities.tools say what each resolves to on each harness, and GET /agents/{agent_id} for that agent. An MCP tool's own key may carry its pin, the arguments its calls must carry.",
|
|
3495
|
+
description: "Each capability that has a choice, and its provider, and each tool's permission that is set (an MCP server's wildcard mcp:<server>/* among them): web_search auto (Parallel where the server holds its key, which bills it, else Firecrawl's keyless search with Exa's behind it, on every harness), native (the harness's own search, claude-agent's or codex's, or on pi the model provider's hosted one: that alone), firecrawl-keyless (Firecrawl's, Exa's behind it), exa-keyless (that alone) or parallel; web_fetch auto (Parallel's extract where the server holds a Parallel key, which bills it, with the guarded direct fetch behind it, else Firecrawl's keyless fetch, which is sent each URL read, never a private or local one, with the guarded direct fetch behind it), firecrawl-keyless (that, whatever the key), kernel (the guarded direct fetch alone) or parallel; browser auto (Browserbase where the server holds its keys, else Kernel where it holds Kernel's), browserbase, kernel (each that alone) or chrome (a Chrome on the server's host, not set up on any server yet: unavailable). An agent's definition.tool_settings is over these, except a permission set to deny here: a server deny is absolute and refuses the tool on this server whatever the agent sets; and web_fetch kernel, or web_search native or off, a ceiling: an agent's firecrawl-keyless, exa-keyless, auto or parallel resolves as the setting does, and under off so does its native. Every other provider set here is a default an agent's pick replaces. A setting applies at a run's next claim; a claim keeps the plane it began with to its end, and deny, read at each call, is what stops a claim already running. The ceiling covers web_search and web_fetch alone: browser, bash, MCP and catalog tools, Jev's ranking, a workflow's parallel decision provider and a native job's own CLI reach the web outside it. capabilities.tools say what each resolves to on each harness, and GET /agents/{agent_id} for that agent. An MCP tool's own key may carry its pin, the arguments its calls must carry.",
|
|
3429
3496
|
responses: { "200": json(TOOL_SETTINGS_ANSWER, "Each capability's provider."), ...errors(401, 429, 500) },
|
|
3430
3497
|
"x-agentrun-serve": "providers/1",
|
|
3431
3498
|
},
|
|
@@ -3660,7 +3727,7 @@ const EXTENSIONS = {
|
|
|
3660
3727
|
},
|
|
3661
3728
|
patch: {
|
|
3662
3729
|
operationId: "updateTrigger", tags: ["local"], summary: "Change a trigger, or turn it off and on",
|
|
3663
|
-
description: `Any of its fields. \`enabled: false\` stops its firings; \`enabled: true\` again, or a new source, goes on from now: the time it was off is skipped, never caught up. A firing already due goes on. A new \`target\` is checked as POST /triggers checks one: ${TRIGGER_RUN_KEYS}
|
|
3730
|
+
description: `Any of its fields. \`enabled: false\` stops its firings; \`enabled: true\` again, or a new source, goes on from now: the time it was off is skipped, never caught up. A firing already due goes on. A new \`target\` is checked as POST /triggers checks one: ${TRIGGER_RUN_KEYS} On an API-only server (\`AGENTRUN_API_ONLY=1\`), which has no console, this is how a trigger is turned on again, one auto-paused among them: it takes \`enabled\` alone (any other field is 422 \`not_allowed\`, nothing changed), and turns on a schedule or a feed trigger aimed at an agent (a \`start_run\` target) only with the launch hook set, so its firings go to the backend (else 422 under \`enabled\`: \`not_set_up_here\` without the hook, \`not_an_option\` for any other source, or a \`message_run\` target, whose firings never go to the hook). The triggers' list, a trigger's read and its firings are served there too; making, deleting or firing one and its secret are not.`,
|
|
3664
3731
|
parameters: [TRIGGER_ID],
|
|
3665
3732
|
requestBody: { required: true, content: { "application/json": { schema: { type: "object", additionalProperties: false, properties: TRIGGER_WRITE } } } },
|
|
3666
3733
|
responses: { "200": json({ ...TRIGGER_READ, properties: { ...TRIGGER_READ.properties, composio: COMPOSIO_UNDONE } }, "Changed: the trigger as a read answers it, with its secret's metadata, and for a composio trigger turned on or off whose instance Composio did not turn, `composio`: what to do there by hand."), ...errors(400, 401, 404, 409, 415, 422, 429, 500) },
|
|
@@ -4339,7 +4406,7 @@ const FIELD_EXTENSIONS = {
|
|
|
4339
4406
|
{ type: "object", additionalProperties: false, required: ["mode"], properties: { mode: { const: "runner" } } },
|
|
4340
4407
|
{ type: "object", additionalProperties: false, required: ["mode", "box"], properties: { mode: { const: "sandbox" }, box: { enum: [...BOX_IDS] } } },
|
|
4341
4408
|
],
|
|
4342
|
-
description: "Where the revision's runs execute: `runner` (no box and no shell) or `sandbox` (the agent's file and shell tools run in the box; its loop, its log and every key stay on the server). Absent on a create of an agentic revision, the place this server gives a new agent (capabilities.places.default_place): the Docker box where this server has docker, written on the revision so an answer shows it, with tools [\"bash\", \"bash_background\", \"bash_output\", \"bash_input\", \"bash_signal\", \"bash_list\"] when the definition names no tools (a list it names, an empty one included, is kept as named, and gets the box only when one of its tools runs only there: `bash` or a background tool); where docker is unavailable, where the definition's tools need no shell, or where it names a tool a box refuses (browser), none, so its runs start on the runner with no container. A revision saved with no place runs where this server's capabilities.places.default_place says at each run (the Docker box where docker is available now, else the runner) when one of its tools needs a shell; a workflow, one whose tools need no shell, and one that names a tool a box refuses, on the runner. A revision keeps the place it names, runner included. An edit that names none keeps the agent's. A box this server does not have saves with a warning, and its runs are 409 agent_not_runnable naming it (capabilities.places.boxes). Only an agentic revision in a sandbox place may name `bash` or a background tool (`bash_background`, `bash_output`, `bash_input`, `bash_signal`, `bash_list`); a workflow revision's place is runner or none (a sandbox place is 422).",
|
|
4409
|
+
description: "Where the revision's runs execute: `runner` (no box and no shell) or `sandbox` (the agent's file and shell tools run in the box; its loop, its log and every key stay on the server). Absent on a create of an agentic revision, the place this server gives a new agent (capabilities.places.default_place): the Docker box where this server has docker in Mode 1, written on the revision so an answer shows it, with tools [\"bash\", \"bash_background\", \"bash_output\", \"bash_input\", \"bash_signal\", \"bash_list\"] when the definition names no tools (a list it names, an empty one included, is kept as named, and gets the box only when one of its tools runs only there: `bash` or a background tool); in Mode 2 (Docker's box can't mount Archil's workspaces), where docker is unavailable, where the definition's tools need no shell, or where it names a tool a box refuses (browser), none, so its runs start on the runner with no container. A revision saved with no place runs where this server's capabilities.places.default_place says at each run (the Docker box where docker is available now in Mode 1, else the runner) when one of its tools needs a shell; a workflow, one whose tools need no shell, and one that names a tool a box refuses, on the runner. A revision keeps the place it names, runner included. An edit that names none keeps the agent's. A box this server does not have saves with a warning, and its runs are 409 agent_not_runnable naming it (capabilities.places.boxes). Only an agentic revision in a sandbox place may name `bash` or a background tool (`bash_background`, `bash_output`, `bash_input`, `bash_signal`, `bash_list`); a workflow revision's place is runner or none (a sandbox place is 422).",
|
|
4343
4410
|
"x-agentrun-serve": "place/1",
|
|
4344
4411
|
},
|
|
4345
4412
|
computer: {
|
|
@@ -4358,7 +4425,7 @@ const FIELD_EXTENSIONS = {
|
|
|
4358
4425
|
description: "The computer the revision's runs are given (Settings → Computers): its kind, the provider that serves it, the image it starts from, a sandbox's GPUs, whether the agent keeps it between runs, and, for a desktop or a phone, how the agent drives it, whether it may run programs on it and whether its runs record its screen. `place` is its v2 view where it can say it: `{kind: none}` is `place {mode: runner}`, `{kind: sandbox, provider: X}` is `place {mode: sandbox, box: X}`; a desktop, phone or browser computer leaves the run's folder on the runner, so its place reads runner. Writing either sets both, and both given must agree (422). Absent on a create, the server's default (as `place`); an edit that names neither keeps the agent's.",
|
|
4359
4426
|
"x-agentrun-serve": "computer/1",
|
|
4360
4427
|
},
|
|
4361
|
-
tool_settings: { ...AGENT_TOOL_SETTINGS, description: "The agent's own tool settings (web_search's, web_fetch's and browser's provider, any tool's permission, an MCP server's wildcard mcp:<server>/*, an MCP tool's pin, bash's policy), over the server's (GET /settings/tools), except a deny set on the server, which is absolute: the tool is refused on this server whatever this agent sets; absent, the server's. A pin is not over the server's: both hold. A grant in tools names the capability, never a provider.", "x-agentrun-serve": "providers/1" },
|
|
4428
|
+
tool_settings: { ...AGENT_TOOL_SETTINGS, description: "The agent's own tool settings (web_search's, web_fetch's and browser's provider, any tool's permission, an MCP server's wildcard mcp:<server>/*, an MCP tool's pin, bash's policy), over the server's (GET /settings/tools), except a deny set on the server, which is absolute: the tool is refused on this server whatever this agent sets; and the server's kernel for web_fetch, or native or off for web_search, a ceiling: this agent's pick of firecrawl-keyless, exa-keyless, auto or parallel resolves as the server's setting does, and under off so does its native; every other provider the server sets is a default this agent's pick replaces; absent, the server's. A pin is not over the server's: both hold. A grant in tools names the capability, never a provider.", "x-agentrun-serve": "providers/1" },
|
|
4362
4429
|
approvals: { enum: ["ask", "never"], default: "ask", description: "Whether the agent's runs ask a person or run unattended. `ask`, the default: a tool set to ask parks the run for an approval, as its tool settings say. `never`: the agent runs unattended, and each tool that would ask is allowed instead, decided by the tool gate at each call, so a tool granted later and an MCP tool (`mcp:<server>/<tool>`, which asks by default) are covered on every harness. It never lifts a deny, whether set on this server or in the agent's own tool_settings, nor a pin, nor anything else the gate refuses before it decides between running and asking. A workflow's call node on a tool set to ask runs under `never`. Absent on a request: ask. An edit that leaves it out asks, so no edit makes an agent unattended by saying nothing. Every answer names it.", "x-agentrun-serve": "unattended/1" },
|
|
4363
4430
|
learning: { oneOf: [{ type: "boolean" }, { type: "object", additionalProperties: false, properties: {
|
|
4364
4431
|
compile_after: { type: "integer", minimum: 1, maximum: 200, default: 20, description: "The job compiles into a learned workflow once the agent has this many completed runs of its own." },
|
|
@@ -4588,10 +4655,10 @@ const FIELD_EXTENSIONS = {
|
|
|
4588
4655
|
{ type: "object", additionalProperties: false, required: ["mode", "box"], properties: { mode: { const: "sandbox" }, box: { enum: [...BOX_IDS] } } },
|
|
4589
4656
|
{ type: "null" },
|
|
4590
4657
|
],
|
|
4591
|
-
description: "The place a NEW agentic agent that names none and has a shell is saved with, written on its revision at its create, and where an agentic revision saved with no place and a shell tool runs, resolved at each run.
|
|
4658
|
+
description: "The place a NEW agentic agent that names none and has a shell is saved with, written on its revision at its create, and where an agentic revision saved with no place and a shell tool runs, resolved at each run. In Mode 2, where the runner's shell is Archil's serverless exec, the runner (`{\"mode\": \"runner\"}`), docker or not (Docker's box can't mount Archil's workspaces), and such a create saves with no place. In Mode 2 on an Archil region with no serverless exec (gcp-us-central1), the runner has no shell, so null, docker or not: a create that names no place, no computer and a tool that runs only in a box is refused `422 input_invalid` at field `definition.computer`, reason `missing`, in `default_reason`'s words, naming a sandbox computer; one that names no tools is saved on the runner with none. In Mode 1, where the runner has no shell: the Docker box (`{\"mode\": \"sandbox\", \"box\": \"docker\"}`) where this server has docker, with tools [\"bash\", \"bash_background\", \"bash_output\", \"bash_input\", \"bash_signal\", \"bash_list\"] when the definition names no tools; where it has no docker, null, meaning no default: a new agent names a box or the runner, `default_reason` gives the words, and a create that names no place and no tools, or a tool that runs only in a box, is refused `422 input_invalid` at field `definition.place`, reason `missing`, in those words, no other box picked for it. A client tells the cases apart by `default_place` being null, never by reading `default_reason`. One whose named tools need no shell is saved with no place and runs on the runner, as do a workflow and a revision that names a tool a box refuses. (It replaces `places.default`, which said `runner`.)",
|
|
4592
4659
|
"x-agentrun-serve": "place/5",
|
|
4593
4660
|
},
|
|
4594
|
-
default_reason: { type: "string", description: "There exactly when `default_place` is null
|
|
4661
|
+
default_reason: { type: "string", description: "There exactly when `default_place` is null. In Mode 1 with no Docker box, the words a create that names no place and would get the box is refused in, `name a box: this server has no Docker box for a new agent. Set place to {mode: sandbox, box: <one of: …>}, or to {mode: runner} to run without a shell.`, listing the boxes this server has, or `<none is set up>`. In Mode 2 on an Archil region with no serverless exec, the words a create that names no place, no computer and a shell tool is refused in, `name a sandbox computer: this server's Archil region <region> has no serverless exec, …`. Docker's own reason is on its entry in `boxes`.", "x-agentrun-serve": "place/5" },
|
|
4595
4662
|
allow: { type: "array", items: { type: "string" }, description: "The hosts a box whose `network` is `allowlist` may reach: AGENTRUN_BOX_ALLOW's, else the package registries and GitHub; empty when it is `none`.", "x-agentrun-serve": "place/2" },
|
|
4596
4663
|
},
|
|
4597
4664
|
"Capabilities/workflows": {
|
|
@@ -5034,6 +5101,8 @@ export function openapiDocument(capabilityOf, adapters = TRIGGER_ADAPTERS) {
|
|
|
5034
5101
|
];
|
|
5035
5102
|
readFileOp.responses["413"] = ref("responses/PayloadTooLarge");
|
|
5036
5103
|
readFileOp.responses["415"] = ref("responses/UnsupportedMediaType");
|
|
5104
|
+
// Its cut is made in a worker under a deadline (cut-pool.ts): past it, or when the worker fails, 503, never uncut.
|
|
5105
|
+
readFileOp.responses["503"] = ref("responses/Unavailable");
|
|
5037
5106
|
readFile["x-agentrun-serve-changed"] = { ...readFile["x-agentrun-serve-changed"], parameters: "filecut/1" };
|
|
5038
5107
|
// filecut/2: `?cut=run` on the listing names each file under the run's cut (RunFile.name), so a grader is told of every
|
|
5039
5108
|
// file a run left, media included, without a path that holds a held value.
|
package/dist/otel/tracer.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ export declare const FLUSH_MS = 3000;
|
|
|
10
10
|
* never ends them can't grow its runner's memory without bound. */
|
|
11
11
|
export declare const OPEN_MAX = 512;
|
|
12
12
|
/** The OTLP exporter's settings from `env`, as the spec reads them: the traces endpoint as given, else the endpoint's
|
|
13
|
-
* /v1/traces; the headers (the traces' over the general ones); the timeout.
|
|
13
|
+
* /v1/traces; the headers (the traces' over the general ones); the timeout. The headers go to the endpoint, so it takes
|
|
14
|
+
* the rule of a URL a key goes to (keyBase) over http or https, since OTLP allows both and a collector is often a plain
|
|
15
|
+
* http one beside the server: one with a user, a password, a query or a fragment throws in those words, which name the
|
|
16
|
+
* variable and the origin alone, and tracing is off for it (made). */
|
|
14
17
|
export declare function exporterConfig(env: NodeJS.ProcessEnv): {
|
|
15
18
|
url: string;
|
|
16
19
|
headers: Record<string, string>;
|
|
@@ -74,8 +77,8 @@ export interface TracingTest {
|
|
|
74
77
|
readonly log?: (line: string) => void;
|
|
75
78
|
readonly now?: () => number;
|
|
76
79
|
}
|
|
77
|
-
/** This process's tracing, or undefined while `env` leaves it off
|
|
78
|
-
* once per process; a test's (`test`) is its own. */
|
|
80
|
+
/** This process's tracing, or undefined while `env` leaves it off or its endpoint is refused (made): then no
|
|
81
|
+
* @opentelemetry module is ever loaded. Made once per process; a test's (`test`) is its own. */
|
|
79
82
|
export declare function genAiTracing(env?: NodeJS.ProcessEnv, test?: TracingTest): Promise<GenAiTracing | undefined>;
|
|
80
83
|
/** This process's closing flush (GenAiTracing.flush) of its tracing, when it was made; at once when it never was (off:
|
|
81
84
|
* nothing of OpenTelemetry is loaded for it). Never throws. */
|
package/dist/otel/tracer.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
// most FLUSH_MS.
|
|
22
22
|
import { createHash, randomBytes } from "node:crypto";
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
24
|
+
import { keyBase } from "@parcha/agentrun-computer";
|
|
24
25
|
import { runnerSecrets, secretRedactor } from "../runner/redact.js";
|
|
25
26
|
import { keyValues, otlpHeaderCut } from "../secrets.js";
|
|
26
27
|
import { agentAttributes, chatAttributes, spanName, toolAttributes, tracedAgent, written } from "./genai.js";
|
|
@@ -33,10 +34,18 @@ export const FLUSH_MS = 3_000;
|
|
|
33
34
|
* never ends them can't grow its runner's memory without bound. */
|
|
34
35
|
export const OPEN_MAX = 512;
|
|
35
36
|
/** The OTLP exporter's settings from `env`, as the spec reads them: the traces endpoint as given, else the endpoint's
|
|
36
|
-
* /v1/traces; the headers (the traces' over the general ones); the timeout.
|
|
37
|
+
* /v1/traces; the headers (the traces' over the general ones); the timeout. The headers go to the endpoint, so it takes
|
|
38
|
+
* the rule of a URL a key goes to (keyBase) over http or https, since OTLP allows both and a collector is often a plain
|
|
39
|
+
* http one beside the server: one with a user, a password, a query or a fragment throws in those words, which name the
|
|
40
|
+
* variable and the origin alone, and tracing is off for it (made). */
|
|
37
41
|
export function exporterConfig(env) {
|
|
38
42
|
const traces = env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT?.trim();
|
|
39
|
-
const
|
|
43
|
+
const endpoint = (env.OTEL_EXPORTER_OTLP_ENDPOINT ?? "").trim();
|
|
44
|
+
// A traces endpoint, once checked, is used as given, as the spec says: a collector may tell /ingest/ from /ingest. The
|
|
45
|
+
// general endpoint's /v1/traces is added to the rule's normalized return, never the raw string: a bare ? or # passes
|
|
46
|
+
// the rule, and would put the path in a query.
|
|
47
|
+
const checked = keyBase(traces || endpoint, traces ? "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" : "OTEL_EXPORTER_OTLP_ENDPOINT", ["http:", "https:"]);
|
|
48
|
+
const url = traces || `${checked}/v1/traces`;
|
|
40
49
|
const timeout = Number(env.OTEL_EXPORTER_OTLP_TRACES_TIMEOUT ?? env.OTEL_EXPORTER_OTLP_TIMEOUT);
|
|
41
50
|
return { url, headers: { ...keyValues(env.OTEL_EXPORTER_OTLP_HEADERS), ...keyValues(env.OTEL_EXPORTER_OTLP_TRACES_HEADERS) }, ...(Number.isFinite(timeout) && timeout > 0 ? { timeoutMillis: timeout } : {}) };
|
|
42
51
|
}
|
|
@@ -204,8 +213,8 @@ export function tracePosts(tracing, runId, redact, agent) {
|
|
|
204
213
|
};
|
|
205
214
|
}
|
|
206
215
|
let shared;
|
|
207
|
-
/** This process's tracing, or undefined while `env` leaves it off
|
|
208
|
-
* once per process; a test's (`test`) is its own. */
|
|
216
|
+
/** This process's tracing, or undefined while `env` leaves it off or its endpoint is refused (made): then no
|
|
217
|
+
* @opentelemetry module is ever loaded. Made once per process; a test's (`test`) is its own. */
|
|
209
218
|
export function genAiTracing(env = process.env, test) {
|
|
210
219
|
if (!otelOn(env))
|
|
211
220
|
return Promise.resolve(undefined);
|
|
@@ -237,9 +246,18 @@ function saidOf(env, given) {
|
|
|
237
246
|
return (line) => log(headers(cut(line)));
|
|
238
247
|
}
|
|
239
248
|
async function made(env, test) {
|
|
240
|
-
const [api, sdk, resources] = await Promise.all([import("@opentelemetry/api"), import("@opentelemetry/sdk-trace"), import("@opentelemetry/resources")]);
|
|
241
249
|
const log = saidOf(env, test?.log);
|
|
242
|
-
|
|
250
|
+
let config;
|
|
251
|
+
try {
|
|
252
|
+
config = exporterConfig(env);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
// The endpoint the rule of a URL a key goes to refuses: no exporter is built on it and nothing is sent, never a
|
|
256
|
+
// thrown start or run. Said once (genAiTracing makes this once per process), in keyBase's words.
|
|
257
|
+
log(`[otel] tracing is off: ${error.message}`);
|
|
258
|
+
return undefined;
|
|
259
|
+
}
|
|
260
|
+
const [api, sdk, resources] = await Promise.all([import("@opentelemetry/api"), import("@opentelemetry/sdk-trace"), import("@opentelemetry/resources")]);
|
|
243
261
|
const where = shownEndpoint(config.url);
|
|
244
262
|
const exporter = safeExporter(test?.exporter ?? new (await import("@opentelemetry/exporter-trace-otlp-http")).OTLPTraceExporter(config), log, where, test?.now ?? Date.now);
|
|
245
263
|
// The next root span's trace id (the run's), taken by the one startSpan that asks for it: startSpan is synchronous.
|
package/dist/page.d.ts
CHANGED
|
@@ -69,6 +69,13 @@ type PageServer = {
|
|
|
69
69
|
takesBytes?: (method: string | undefined, path: string) => boolean;
|
|
70
70
|
publicUrl?: string;
|
|
71
71
|
};
|
|
72
|
+
/** A share host's pages' CSP (share-host.ts): the local preview's, so a public page, as the owner's preview of it, makes no
|
|
73
|
+
* outbound fetch (a graph's image URL among them). */
|
|
74
|
+
export declare const SHARE_HOST_CSP = "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'";
|
|
75
|
+
/** A share host's page for a share (the console's share.html), its asset URLs under /r/_assets/, under SHARE_HOST_CSP. */
|
|
76
|
+
export declare const sendHostedSharePage: (req: IncomingMessage, res: ServerResponse, dir: string | undefined) => Promise<void>;
|
|
77
|
+
/** A share host's asset at /r/_assets/`rel`: the console's assets/`rel`, the same rules as /assets/. */
|
|
78
|
+
export declare const sendHostedAsset: (req: IncomingMessage, res: ServerResponse, raw: string, dir: string | undefined, rel: string) => void | Promise<void>;
|
|
72
79
|
/** Whether `req` came from the owner's page under their password session (answerPage). A token, whoever holds it, never
|
|
73
80
|
* did. */
|
|
74
81
|
export declare const byOwnerSession: (req: IncomingMessage) => boolean;
|
package/dist/page.js
CHANGED
|
@@ -130,8 +130,9 @@ export const sendMovedPage = (req, res, to) => send(req, res, 403, HTML, movedPa
|
|
|
130
130
|
const refuse = (req, res, error) => send(req, res, error.status, "application/json", JSON.stringify(error.body(String(res.getHeader("x-request-id") ?? ""))), error.headers);
|
|
131
131
|
const redirect = (res, location, headers = {}) => (res.writeHead(303, { ...SECURITY, location, "content-length": 0, ...headers }), void res.end());
|
|
132
132
|
/** A file of the console: a known type inside `dir`, read through no link that leaves it. Vite's hashed assets are cached
|
|
133
|
-
* for a year; index.html is no-store.
|
|
134
|
-
|
|
133
|
+
* for a year; index.html is no-store. `hosted`: answer headers of its own (a CSP), and for a share host the page's text
|
|
134
|
+
* rewritten. */
|
|
135
|
+
async function file(req, res, raw, dir, rel, status = 200, hosted) {
|
|
135
136
|
const missing = () => refuse(req, res, new ApiError("not_found", `no file ${raw} in the console`));
|
|
136
137
|
const type = CONSOLE_TYPES[extname(rel).toLowerCase()];
|
|
137
138
|
if (!type || !rel.split("/").every((segment) => CONSOLE_SEGMENT.test(segment)))
|
|
@@ -143,8 +144,20 @@ async function file(req, res, raw, dir, rel, status = 200, headers = {}) {
|
|
|
143
144
|
}
|
|
144
145
|
if (!real.startsWith(root + sep) || !(await stat(real)).isFile())
|
|
145
146
|
return missing();
|
|
146
|
-
|
|
147
|
+
const bytes = await readFile(real);
|
|
148
|
+
send(req, res, status, type, hosted?.rewrite ? hosted.rewrite(bytes.toString("utf8")) : bytes, { "cache-control": rel.startsWith("assets/") ? "public, max-age=31536000, immutable" : "no-store", ...hosted?.headers });
|
|
147
149
|
}
|
|
150
|
+
/** A share host's pages' CSP (share-host.ts): the local preview's, so a public page, as the owner's preview of it, makes no
|
|
151
|
+
* outbound fetch (a graph's image URL among them). */
|
|
152
|
+
export const SHARE_HOST_CSP = SHARE_PAGE_CSP;
|
|
153
|
+
const HOSTED = { "content-security-policy": SHARE_HOST_CSP, "x-robots-tag": "noindex" };
|
|
154
|
+
/** The page's asset URLs as Vite writes them with base "./" (`./assets/x`), moved under the share host's /r/_assets/: the
|
|
155
|
+
* page answers at /r/<id> and /r/<id>/, where a relative URL would land elsewhere. */
|
|
156
|
+
const hostedAssets = (text) => text.replace(/(\s(?:src|href)=["'])\.\/assets\//g, "$1/r/_assets/");
|
|
157
|
+
/** A share host's page for a share (the console's share.html), its asset URLs under /r/_assets/, under SHARE_HOST_CSP. */
|
|
158
|
+
export const sendHostedSharePage = (req, res, dir) => file(req, res, "/r/<id>", dir ?? CONSOLE_DIR, "share.html", 200, { headers: HOSTED, rewrite: hostedAssets });
|
|
159
|
+
/** A share host's asset at /r/_assets/`rel`: the console's assets/`rel`, the same rules as /assets/. */
|
|
160
|
+
export const sendHostedAsset = (req, res, raw, dir, rel) => rel.endsWith(".html") ? refuse(req, res, new ApiError("not_found", `no file ${raw} in the console`)) : file(req, res, raw, dir ?? CONSOLE_DIR, `assets/${rel}`, 200, { headers: HOSTED });
|
|
148
161
|
async function answer(req, res, raw, server, held) {
|
|
149
162
|
if (req.method !== "GET" && req.method !== "HEAD")
|
|
150
163
|
return refuse(req, res, new ApiError("method_not_allowed", `the console answers GET and HEAD; ${req.method} is not one`, {}, { allow: "GET, HEAD" }));
|
|
@@ -204,7 +217,7 @@ async function share(req, res, raw, dir, server, held) {
|
|
|
204
217
|
server.authFailed?.("/share", "no_session");
|
|
205
218
|
return send(req, res, 401, HTML, SIGN_IN_FIRST);
|
|
206
219
|
}
|
|
207
|
-
return file(req, res, raw, dir, "share.html", 200, { "content-security-policy": SHARE_PAGE_CSP });
|
|
220
|
+
return file(req, res, raw, dir, "share.html", 200, { headers: { "content-security-policy": SHARE_PAGE_CSP } });
|
|
208
221
|
}
|
|
209
222
|
/** The requests the owner's password session sends from the page (a write only from this server's own origin, with a
|
|
210
223
|
* JSON body), never under an accounts-off console session. */
|
package/dist/place.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { type BoxOffer } from "./place-offers.js";
|
|
2
2
|
import { type InputIssue } from "./errors.js";
|
|
3
|
+
/** Where a revision that names no place has a shell, besides a box it names (server.ts runnerShellNow): `true`, on the
|
|
4
|
+
* runner, Archil's serverless exec (Mode 2); `false`, in Docker's box where this server has it (Mode 1); `{ noExec }`,
|
|
5
|
+
* nowhere: Mode 2 on Archil region `noExec`, which has no serverless exec (archil-settings.ts noExecRegionOf), where a
|
|
6
|
+
* run with no computer has no shell and Docker's box can't mount Archil. */
|
|
7
|
+
export type RunnerShell = boolean | {
|
|
8
|
+
readonly noExec: string;
|
|
9
|
+
};
|
|
10
|
+
/** The refusal of a new agent with a shell tool and no computer, at its save or deploy, on a Mode 2 server whose Archil
|
|
11
|
+
* region `region` has no serverless exec (RunnerShell `noExec`): it names a sandbox computer, never Docker's box. */
|
|
12
|
+
export declare const noExecIssue: (region: string) => InputIssue;
|
|
3
13
|
export declare const PLACE_MODES: readonly ["runner", "sandbox"];
|
|
4
14
|
export type PlaceMode = (typeof PLACE_MODES)[number];
|
|
5
15
|
export type Place = {
|
|
@@ -29,8 +39,10 @@ export declare function newAgentPlace(registry: readonly BoxOffer[]): {
|
|
|
29
39
|
* (newAgentPlace) for an agentic revision with a tool that runs only in a box (`flags`, tools.ts: bash and the
|
|
30
40
|
* background tools); the runner for a workflow, which is never given a box, for one whose tools need no shell (none, or
|
|
31
41
|
* only read and write: a container would only hold up its start), and for one that names a tool the box refuses (the
|
|
32
|
-
* browser, runner-only for now).
|
|
33
|
-
|
|
42
|
+
* browser, runner-only for now). In Mode 2 (`runnerShell` not false), the runner for every revision: Docker's box can't
|
|
43
|
+
* mount the folder Mode 2 keeps on Archil. Where the runner has no shell there either (`noExec`), a shell tool's agent
|
|
44
|
+
* is refused at its save (noBoxRefusal) and its run (runnable.ts), never given Docker's box. */
|
|
45
|
+
export declare function defaultPlaceOf(kind: "agentic" | "workflow", tools: readonly unknown[], registry: readonly BoxOffer[], flags: ToolFlags, runnerShell: RunnerShell): Place;
|
|
34
46
|
type ToolFlags = (tool: string) => {
|
|
35
47
|
readonly sandboxOnly?: true;
|
|
36
48
|
readonly runnerOnly?: true;
|
|
@@ -39,8 +51,11 @@ type ToolFlags = (tool: string) => {
|
|
|
39
51
|
* save it, where it would be given the default box (it names no tools, `tools` undefined, so it would get a shell, or a
|
|
40
52
|
* tool that runs only in a box) and this server does not have Docker's box, and where the runner has no shell
|
|
41
53
|
* (`runnerShell` false: Mode 1). On Mode 2 the runner's exec is a shell, and such a definition saves for the runner as
|
|
42
|
-
* it always did, its tools checked there (runnable.ts)
|
|
43
|
-
|
|
54
|
+
* it always did, its tools checked there (runnable.ts); on a Mode 2 region with no exec (`noExec`) there is no shell
|
|
55
|
+
* for a shell tool it names, Docker answering or not: it names a sandbox computer (noExecIssue). One that names no tools
|
|
56
|
+
* is saved on Mode 2's runner with none (server.ts defaultToolsAt), so it has no shell tool to refuse. Undefined for one
|
|
57
|
+
* that saves. */
|
|
58
|
+
export declare function noBoxRefusal(tools: readonly unknown[] | undefined, registry: readonly BoxOffer[], flags: ToolFlags, runnerShell: RunnerShell): InputIssue | undefined;
|
|
44
59
|
/** The refusal of a revision that names no place where Docker's box is not here, at definition.place: its words, and
|
|
45
60
|
* what to set as its fix, so no example of a place is picked for it. */
|
|
46
61
|
export declare const noPlaceIssue: (registry: readonly BoxOffer[]) => InputIssue;
|
|
@@ -56,15 +71,17 @@ export declare function noBoxReason(registry: readonly BoxOffer[], listed: Reado
|
|
|
56
71
|
* AGENTRUN_BOXES lists (`listed`), and, when none is ready, the boxes it does not list, with what to do.
|
|
57
72
|
* `byDefault`, with AGENTRUN_BOXES not set at all: short, the local box alone, said to be on by default, or why it is
|
|
58
73
|
* not, and where a new agent with no place goes then: it names its place, or, where the runner has a shell
|
|
59
|
-
* (`runnerShell`: Mode 2), it runs on the runner (placesOf).
|
|
60
|
-
|
|
74
|
+
* (`runnerShell`: Mode 2), it runs on the runner (placesOf). On a Mode 2 region with no exec (`noExec`), every form says
|
|
75
|
+
* a new agent with bash names a sandbox computer, and why. */
|
|
76
|
+
export declare function boxesLine(registry: readonly BoxOffer[], listed: ReadonlySet<string>, allow?: readonly string[] | "none", byDefault?: boolean, runnerShell?: RunnerShell): string;
|
|
61
77
|
/** `places` in capabilities: the modes a revision may name, the place a new agent is saved with and a revision that
|
|
62
78
|
* names none runs in (`default_place`), each box, and the hosts a box whose `network` is `allowlist` reaches (`allow`,
|
|
63
|
-
* box-settings.ts boxAllowOf; empty for `none`). `default_place` is
|
|
64
|
-
*
|
|
65
|
-
* place, and `default_reason` is the words a no-place create is refused in
|
|
66
|
-
*
|
|
67
|
-
|
|
79
|
+
* box-settings.ts boxAllowOf; empty for `none`). `default_place` is the runner where it has a shell (`runnerShell`:
|
|
80
|
+
* Mode 2's Archil exec), Docker answering or not (defaultPlaceOf); else Docker's box where this server has it; else
|
|
81
|
+
* null, no default: a new agent names its place, and `default_reason` is the words a no-place create is refused in
|
|
82
|
+
* (noBoxRefusal). On a Mode 2 region with no exec (`noExec`) it is null, Docker answering or not, and `default_reason`
|
|
83
|
+
* says to name a sandbox computer (noExecIssue). `default_reason` is there exactly when `default_place` is null. */
|
|
84
|
+
export declare const placesOf: (registry: readonly BoxOffer[], allow?: readonly string[] | "none", runnerShell?: RunnerShell) => {
|
|
68
85
|
boxes: BoxOffer[];
|
|
69
86
|
allow: string[];
|
|
70
87
|
default_place: Place;
|