@parcha/agentrun-serve 0.0.0-bootstrap.0 → 0.1.0-beta.29
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 +560 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +1724 -0
- package/dist/adapters.d.ts +205 -0
- package/dist/adapters.js +459 -0
- package/dist/agents.d.ts +124 -0
- package/dist/agents.js +302 -0
- package/dist/app.d.ts +7 -0
- package/dist/app.js +324 -0
- package/dist/bound-files.d.ts +4 -0
- package/dist/bound-files.js +164 -0
- package/dist/box/record.d.ts +6 -0
- package/dist/box/record.js +41 -0
- package/dist/box/sweep.d.ts +53 -0
- package/dist/box/sweep.js +193 -0
- package/dist/box-image.d.ts +98 -0
- package/dist/box-image.js +283 -0
- package/dist/box-relay.d.ts +42 -0
- package/dist/box-relay.js +222 -0
- package/dist/boxes.d.ts +54 -0
- package/dist/boxes.js +182 -0
- package/dist/cap.d.ts +224 -0
- package/dist/cap.js +721 -0
- package/dist/catalog.d.ts +20 -0
- package/dist/catalog.js +53 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +167 -0
- package/dist/coding-tools.d.ts +31 -0
- package/dist/coding-tools.js +81 -0
- package/dist/console/THIRD-PARTY-NOTICES.txt +1141 -0
- package/dist/console/assets/index-BN7oVcO4.js +445 -0
- package/dist/console/assets/index-By-jkqki.css +1 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-400-normal-CIEtRijs.woff +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-600-normal-BB5xRk30.woff +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-ext-400-normal-BHyURHCj.woff +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-ext-400-normal-C_uLvvQ5.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-ext-600-normal-Dj6eZy5f.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-cyrillic-ext-600-normal-DpeVePZf.woff +0 -0
- package/dist/console/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-greek-400-normal-CNojz0t3.woff +0 -0
- package/dist/console/assets/jetbrains-mono-greek-600-normal-3KAm9r92.woff +0 -0
- package/dist/console/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-latin-400-normal-B11XCQ5g.woff +0 -0
- package/dist/console/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-latin-600-normal-DXv3JcnD.woff +0 -0
- package/dist/console/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-latin-ext-400-normal-DHMOLxAi.woff +0 -0
- package/dist/console/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-latin-ext-600-normal-DiQlUoE6.woff +0 -0
- package/dist/console/assets/jetbrains-mono-vietnamese-400-normal-BeU3T8wf.woff +0 -0
- package/dist/console/assets/jetbrains-mono-vietnamese-400-normal-ByoDsISC.woff2 +0 -0
- package/dist/console/assets/jetbrains-mono-vietnamese-600-normal-CSpzN4cI.woff +0 -0
- package/dist/console/assets/jetbrains-mono-vietnamese-600-normal-Dtizs43-.woff2 +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-400-normal-Cph9ettZ.woff2 +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-400-normal-DfGZKnlb.woff +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-600-normal-BGBUNdzT.woff2 +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-600-normal-COje25QW.woff +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-ext-400-normal-4l4lq8zr.woff2 +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-ext-400-normal-BGzXWJeR.woff +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-ext-600-normal-8_E36CQj.woff2 +0 -0
- package/dist/console/assets/schibsted-grotesk-latin-ext-600-normal-C27an7Zc.woff +0 -0
- package/dist/console/index.html +15 -0
- package/dist/daytona-api.d.ts +21 -0
- package/dist/daytona-api.js +101 -0
- package/dist/decision-rows.d.ts +11 -0
- package/dist/decision-rows.js +116 -0
- package/dist/decisions.d.ts +94 -0
- package/dist/decisions.js +184 -0
- package/dist/effort-guidance.d.ts +5 -0
- package/dist/effort-guidance.js +14 -0
- package/dist/environment.d.ts +5 -0
- package/dist/environment.js +11 -0
- package/dist/errors.d.ts +72 -0
- package/dist/errors.js +66 -0
- package/dist/exa-keyless.d.ts +35 -0
- package/dist/exa-keyless.js +202 -0
- package/dist/fetch-page.d.ts +114 -0
- package/dist/fetch-page.js +182 -0
- package/dist/files.d.ts +60 -0
- package/dist/files.js +153 -0
- package/dist/grade.d.ts +96 -0
- package/dist/grade.js +348 -0
- package/dist/graph-view.d.ts +100 -0
- package/dist/graph-view.js +212 -0
- package/dist/harness-app.d.ts +38 -0
- package/dist/harness-app.js +626 -0
- package/dist/harness.d.ts +53 -0
- package/dist/harness.js +74 -0
- package/dist/home-path.d.ts +27 -0
- package/dist/home-path.js +78 -0
- package/dist/host-tools.d.ts +20 -0
- package/dist/host-tools.js +140 -0
- package/dist/host.d.ts +39 -0
- package/dist/host.js +81 -0
- package/dist/hosted-search.d.ts +27 -0
- package/dist/hosted-search.js +129 -0
- package/dist/import-sources.d.ts +104 -0
- package/dist/import-sources.js +629 -0
- package/dist/import-summary.d.ts +25 -0
- package/dist/import-summary.js +75 -0
- package/dist/import-worker.d.ts +26 -0
- package/dist/import-worker.js +41 -0
- package/dist/import.d.ts +145 -0
- package/dist/import.js +1221 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/key-check.d.ts +36 -0
- package/dist/key-check.js +108 -0
- package/dist/key-refusal.d.ts +51 -0
- package/dist/key-refusal.js +187 -0
- package/dist/learn/check.d.ts +99 -0
- package/dist/learn/check.js +259 -0
- package/dist/learn/grade.d.ts +79 -0
- package/dist/learn/grade.js +433 -0
- package/dist/learn/index.d.ts +7 -0
- package/dist/learn/index.js +11 -0
- package/dist/learn/invisible.d.ts +5 -0
- package/dist/learn/invisible.js +42 -0
- package/dist/learn/notes.d.ts +59 -0
- package/dist/learn/notes.js +146 -0
- package/dist/learn/reflect.d.ts +49 -0
- package/dist/learn/reflect.js +167 -0
- package/dist/learn/secrets.d.ts +18 -0
- package/dist/learn/secrets.js +111 -0
- package/dist/learn/skills.d.ts +84 -0
- package/dist/learn/skills.js +198 -0
- package/dist/learning-routes.d.ts +196 -0
- package/dist/learning-routes.js +609 -0
- package/dist/learning-run.d.ts +304 -0
- package/dist/learning-run.js +797 -0
- package/dist/learning-words.d.ts +73 -0
- package/dist/learning-words.js +171 -0
- package/dist/learning.d.ts +377 -0
- package/dist/learning.js +801 -0
- package/dist/llm.d.ts +40 -0
- package/dist/llm.js +37 -0
- package/dist/llms.txt +37 -0
- package/dist/mcp-servers.d.ts +115 -0
- package/dist/mcp-servers.js +445 -0
- package/dist/mcp.d.ts +51 -0
- package/dist/mcp.js +392 -0
- package/dist/model.d.ts +184 -0
- package/dist/model.js +484 -0
- package/dist/monid.d.ts +74 -0
- package/dist/monid.js +277 -0
- package/dist/openapi/agentrun-v2.openapi.json +4805 -0
- package/dist/openapi.d.ts +10 -0
- package/dist/openapi.js +1417 -0
- package/dist/owner.d.ts +55 -0
- package/dist/owner.js +222 -0
- package/dist/packs.d.ts +71 -0
- package/dist/packs.js +180 -0
- package/dist/page.d.ts +32 -0
- package/dist/page.js +133 -0
- package/dist/paid-calls.d.ts +46 -0
- package/dist/paid-calls.js +110 -0
- package/dist/pause.d.ts +68 -0
- package/dist/pause.js +97 -0
- package/dist/pdf-pages.d.ts +44 -0
- package/dist/pdf-pages.js +147 -0
- package/dist/place.d.ts +46 -0
- package/dist/place.js +105 -0
- package/dist/print.d.ts +20 -0
- package/dist/print.js +29 -0
- package/dist/propose.d.ts +38 -0
- package/dist/propose.js +82 -0
- package/dist/quiet-sqlite-warning.d.ts +1 -0
- package/dist/quiet-sqlite-warning.js +14 -0
- package/dist/request-start.d.ts +14 -0
- package/dist/request-start.js +226 -0
- package/dist/result.d.ts +3 -0
- package/dist/result.js +5 -0
- package/dist/rows.d.ts +46 -0
- package/dist/rows.js +121 -0
- package/dist/run-box.d.ts +134 -0
- package/dist/run-box.js +440 -0
- package/dist/run-manifest.d.ts +27 -0
- package/dist/run-manifest.js +60 -0
- package/dist/runnable.d.ts +80 -0
- package/dist/runnable.js +162 -0
- package/dist/runs.d.ts +840 -0
- package/dist/runs.js +2279 -0
- package/dist/secret-cut.d.ts +27 -0
- package/dist/secret-cut.js +109 -0
- package/dist/secrets.d.ts +50 -0
- package/dist/secrets.js +140 -0
- package/dist/server-lock.d.ts +44 -0
- package/dist/server-lock.js +140 -0
- package/dist/server.d.ts +626 -0
- package/dist/server.js +1756 -0
- package/dist/sessions.d.ts +4 -0
- package/dist/sessions.js +105 -0
- package/dist/skills.d.ts +31 -0
- package/dist/skills.js +68 -0
- package/dist/stats.d.ts +101 -0
- package/dist/stats.js +82 -0
- package/dist/tool-keys.d.ts +151 -0
- package/dist/tool-keys.js +273 -0
- package/dist/tool-plane.d.ts +143 -0
- package/dist/tool-plane.js +242 -0
- package/dist/tools.d.ts +147 -0
- package/dist/tools.js +253 -0
- package/dist/turn-end.d.ts +23 -0
- package/dist/turn-end.js +14 -0
- package/dist/turns.d.ts +34 -0
- package/dist/turns.js +202 -0
- package/dist/uploads.d.ts +104 -0
- package/dist/uploads.js +474 -0
- package/dist/usage.d.ts +29 -0
- package/dist/usage.js +58 -0
- package/dist/validate.d.ts +55 -0
- package/dist/validate.js +175 -0
- package/dist/web-fetch.d.ts +64 -0
- package/dist/web-fetch.js +262 -0
- package/dist/web-search.d.ts +54 -0
- package/dist/web-search.js +136 -0
- package/dist/webhooks.d.ts +182 -0
- package/dist/webhooks.js +487 -0
- package/dist/workspace-paths.d.ts +33 -0
- package/dist/workspace-paths.js +104 -0
- package/dist/workspace.d.ts +88 -0
- package/dist/workspace.js +369 -0
- package/launcher/agentrun-serve +109 -0
- package/package.json +96 -1
- package/skills/agentrun-serve/SKILL.md +128 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { type ModelNeeds } from "./model.js";
|
|
2
|
+
import { type HarnessCapability } from "./harness.js";
|
|
3
|
+
import { type LearningMode } from "./learning.js";
|
|
4
|
+
import { type CarryBackRetry } from "./runs.js";
|
|
5
|
+
import { type BoxHost } from "./box/sweep.js";
|
|
6
|
+
import { type BoxOffer } from "./boxes.js";
|
|
7
|
+
import { type StoredKeys } from "./secrets.js";
|
|
8
|
+
import { type ToolSettingsMap } from "./tool-plane.js";
|
|
9
|
+
export declare const CONTRACT = "agentrun.v2/0";
|
|
10
|
+
export declare const DEFAULT_PORT = 7340;
|
|
11
|
+
export type ServeOptions = {
|
|
12
|
+
/** The data directory: the agent store (`store.sqlite`) and its runs (`runs/<id>/`). */
|
|
13
|
+
data: string;
|
|
14
|
+
/** The owner, signed in with a password (owner.ts): the page asks for it, and the token stays for scripts and the CLI. */
|
|
15
|
+
accounts?: boolean;
|
|
16
|
+
/** With accounts: the first visit sets the password with no setup code (a server with no public address). Off, setup
|
|
17
|
+
* takes the code this server prints, or the token. */
|
|
18
|
+
openSetup?: boolean;
|
|
19
|
+
/** With accounts: the address people open (AGENTRUN_PUBLIC_URL), which the printed setup link uses. */
|
|
20
|
+
publicUrl?: string;
|
|
21
|
+
/** With open setup: the home whose Claude Code, Codex and pi sessions setup offers to import (default this user's),
|
|
22
|
+
* and the temp directory whose projects it leaves out (default the OS's). */
|
|
23
|
+
sessionsHome?: {
|
|
24
|
+
home: string;
|
|
25
|
+
temp?: string;
|
|
26
|
+
};
|
|
27
|
+
/** With open setup on this machine, and no owner yet: count the sessions setup would import as the server starts, so
|
|
28
|
+
* the offer has its numbers by the time the page opens (the CLI sets it). */
|
|
29
|
+
countSessions?: boolean;
|
|
30
|
+
/** With accounts: the most addresses the sign-in limit keeps at once (default 10,000); a new one past it is a 429. */
|
|
31
|
+
signInAddresses?: number;
|
|
32
|
+
/** The address to listen on (default 127.0.0.1). On any other address every `Host` name is served and the token is
|
|
33
|
+
* the only lock: put TLS in front of it. */
|
|
34
|
+
host?: string;
|
|
35
|
+
/** The token to require in place of the one `DIR/.token` keeps: 32 characters or more, no whitespace. */
|
|
36
|
+
token?: string;
|
|
37
|
+
/** Default 7340; 0 is any free port. */
|
|
38
|
+
port?: number;
|
|
39
|
+
/** When the port is taken at the listen, the next one that is not, of the 100 from it: the port is found by listening,
|
|
40
|
+
* so one another process takes at the same moment is passed over. Without it a taken port fails the start. */
|
|
41
|
+
nextFreePort?: boolean;
|
|
42
|
+
/** A read-only directory of documents a workflow's `pdf_pages` calls read by file name (`--documents`); default
|
|
43
|
+
* AGENTRUN_SERVE_DOCUMENTS. */
|
|
44
|
+
documents?: string;
|
|
45
|
+
/** Run workflows' `code` nodes (`--allow-code-nodes`; default AGENTRUN_SERVE_CODE_NODES=1). Off, a workflow with one saves
|
|
46
|
+
* with a warning and its run is 409: a code node runs in the run's process through `new Function`, which is no sandbox. */
|
|
47
|
+
allowCodeNodes?: boolean;
|
|
48
|
+
/** A faux model module (no key, no network): see the README. */
|
|
49
|
+
faux?: string;
|
|
50
|
+
/** With `faux` only: a module whose default export gives the `browser` tool's `{ provider, driver }` (the tests' fake
|
|
51
|
+
* backend), in place of Browserbase's. */
|
|
52
|
+
fauxBrowser?: string;
|
|
53
|
+
/** With `faux` only: a module whose default export gives `fetch_page` its `{ lookup, fetchImpl }` (the tests' fake
|
|
54
|
+
* network), in place of the system's resolver and undici. */
|
|
55
|
+
fauxWeb?: string;
|
|
56
|
+
/** With `faux` only: a module whose default export is the fetch Jev's runner sends through (the tests' fake), in place
|
|
57
|
+
* of TypeSafe's API. */
|
|
58
|
+
fauxJev?: string;
|
|
59
|
+
/** With `faux` only: a module whose default export is the fetch the Parallel provider sends through (the tests' fake),
|
|
60
|
+
* in place of Parallel's API. */
|
|
61
|
+
fauxParallel?: string;
|
|
62
|
+
/** With `faux` only: a module whose default export is the fetch OpenRouter's decision models send through, in place of
|
|
63
|
+
* OpenRouter's System One API (`@parcha/agentrun-decisions/testing/faux-system-one` is one). */
|
|
64
|
+
fauxOpenrouter?: string;
|
|
65
|
+
/** With `faux` only: a module whose default export is the fetch the monid tools send through (the tests' fake), in
|
|
66
|
+
* place of monid's API. */
|
|
67
|
+
fauxMonid?: string;
|
|
68
|
+
/** With `faux` only: a module whose default export is the fetch the Anthropic and OpenAI providers send through, in
|
|
69
|
+
* place of their APIs, for web_search's own request to the provider the revision's model names (model.ts). */
|
|
70
|
+
fauxUpstream?: string;
|
|
71
|
+
/** With `faux` only: a module whose default export is the fetch web_search's keyless Exa search sends through, in place
|
|
72
|
+
* of Exa's MCP endpoint (exa-keyless.ts). */
|
|
73
|
+
fauxExa?: string;
|
|
74
|
+
/** A module scripting the faux harness (`script(spec)`): every harness but pi runs on it (harness.ts). */
|
|
75
|
+
fauxHarness?: string;
|
|
76
|
+
/** With `faux` only: a module whose default export, given the data root, is the box provider runs' Docker boxes come
|
|
77
|
+
* from (the tests' faux box, pi-transport's local box): docker is then available, and nothing asks Docker. */
|
|
78
|
+
fauxBox?: string;
|
|
79
|
+
/** Extra `Host` names to accept besides the loopback ones. */
|
|
80
|
+
allowHosts?: string[];
|
|
81
|
+
/** The console's built files, answered at / (default dist/console beside the server, which this package's build copies
|
|
82
|
+
* from apps/console/dist). */
|
|
83
|
+
console?: string;
|
|
84
|
+
/** How long a run's process may finish its turn after SIGTERM (default 30s): `8s`, `500ms`, `1m`. */
|
|
85
|
+
drainTimeout?: string;
|
|
86
|
+
/** The most runs at once (default: AGENTRUN_MAX_RUNS, else as many pi runs as this host's memory holds: host.ts),
|
|
87
|
+
* beside the memory each run's harness reserves; over either, 429. */
|
|
88
|
+
maxRuns?: number;
|
|
89
|
+
/** Free disk under the data directory below which GET /v2/health fails (default 64 MiB, or AGENTRUN_MIN_FREE_MB). */
|
|
90
|
+
minFreeBytes?: number;
|
|
91
|
+
/** How often a carry back the store refused is tried again while the server lives (default 30 s). */
|
|
92
|
+
settleRetryMs?: number;
|
|
93
|
+
/** Where the log lines go (print.ts); none without it. AGENTRUN_LOG=quiet leaves out the request lines. */
|
|
94
|
+
log?: (line: string) => void;
|
|
95
|
+
/** The lines a person reads about a stop on this data root: this server's, as its close begins and runs' processes are
|
|
96
|
+
* left to finish their turn, and this start's, when it waits for a server that is stopping (server-lock.ts). Default:
|
|
97
|
+
* standard error, after `agentrun-serve: `. */
|
|
98
|
+
notice?: (line: string) => void;
|
|
99
|
+
/** The waits between carry backs that found the store held by another writer (default 0.5, 1, 2, 4 and 8 s), and a
|
|
100
|
+
* hook called at each such refusal. */
|
|
101
|
+
carryBackRetry?: CarryBackRetry;
|
|
102
|
+
/** A test's seam: awaited by a stop between its mark and its abort, so a test can hold a stop in flight there. */
|
|
103
|
+
beforeAbort?: (runId: string) => Promise<void> | void;
|
|
104
|
+
/** A test's seam: awaited by a completed run's reopen for a follow-up, after the run reads open again and before its
|
|
105
|
+
* process is launched, so a test can hold a reopen there. */
|
|
106
|
+
beforeReopenLaunch?: (runId: string) => Promise<void> | void;
|
|
107
|
+
/** A test's seam: awaited by a message before it goes to the run's door, so a test can act while it is in flight. */
|
|
108
|
+
beforeSubmit?: (runId: string, content: string) => Promise<void> | void;
|
|
109
|
+
/** How long a request waits for a run's door, its process coming up or a settle in progress (default 45 s). */
|
|
110
|
+
readyTimeoutMs?: number;
|
|
111
|
+
/** How long a run's end-of-run turn may take before it is aborted and the run finishes without it (default 5 min). */
|
|
112
|
+
reflectTimeoutMs?: number;
|
|
113
|
+
/** How long a run's grader may take before it is cut off and the run's learning dropped (default 3 min). */
|
|
114
|
+
gradeTimeoutMs?: number;
|
|
115
|
+
/** The model the grader runs on (`--grade-model`; default AGENTRUN_SERVE_GRADE_MODEL, else the strong tier,
|
|
116
|
+
* AGENT_MODEL_STRONG, else each run's agent's own model). */
|
|
117
|
+
gradeModel?: string;
|
|
118
|
+
/** Whether runs learn (`--learning`; default AGENTRUN_SERVE_LEARNING, else `on`). `on`: a run of an agent whose
|
|
119
|
+
* definition says `learning: true` starts from what its agent learned. `off`: no run this server starts does, whatever
|
|
120
|
+
* its agent's definition says, and its `learning` is null. */
|
|
121
|
+
learning?: LearningMode;
|
|
122
|
+
/** How much of what a run learned its instructions hold under `# Learned`, in UTF-8 bytes (`--learning-budget`;
|
|
123
|
+
* default AGENTRUN_SERVE_LEARNING_BUDGET, else 8000): every note whole while they fit, else the index and the notes
|
|
124
|
+
* changed last, whole, while they fit (learning.ts learnedOf). */
|
|
125
|
+
learningBudget?: number;
|
|
126
|
+
/** The waits before each try again of a webhook delivery (default 5 s, 5 min, 30 min, 2 h, 5 h and 10 h: webhooks.ts RETRY_MS). */
|
|
127
|
+
webhookRetryMs?: readonly number[];
|
|
128
|
+
/** The box runs' harnesses run in (4a's Box: its reap; on a shared server its run cgroups): the boxes runs leave are
|
|
129
|
+
* swept at start and let go at archive. The quarantine of boxes a reap could not empty is kept in the data directory. */
|
|
130
|
+
box?: BoxHost;
|
|
131
|
+
};
|
|
132
|
+
/** `tokenFile` is null when `options.token` gave the token; `tokenMade` says this start made the token in it. */
|
|
133
|
+
/** `setupUrl`: with accounts and no password yet, the page that sets it (with its code when setup needs one). */
|
|
134
|
+
/** `boxesLine`: what the start's banner says of the boxes, in words (place.ts boxesLine). */
|
|
135
|
+
export type Serve = {
|
|
136
|
+
url: string;
|
|
137
|
+
baseUrl: string;
|
|
138
|
+
port: number;
|
|
139
|
+
token: string;
|
|
140
|
+
tokenFile: string | null;
|
|
141
|
+
tokenMade: boolean;
|
|
142
|
+
setupUrl?: string;
|
|
143
|
+
boxesLine: string;
|
|
144
|
+
close(): Promise<void>;
|
|
145
|
+
};
|
|
146
|
+
/** A route: `name` is its operationId in the OpenAPI document (openapi.ts); `capability`, when this server turns it off;
|
|
147
|
+
* `raw`, a route whose body is bytes and not JSON, which the page's session may send with any content type, still only
|
|
148
|
+
* with the page's own Origin (page.ts). Only a PUT or a POST carries it. The Origin is the lock: a browser sends it with
|
|
149
|
+
* every cross-origin request and every POST and PUT, and a page cannot set it, so a page of another origin, even on this
|
|
150
|
+
* host's other ports (which the cookie's SameSite does not tell apart), never gets the session for a raw write. A PUT
|
|
151
|
+
* from another origin needs a preflight besides, which this server never answers; a raw POST does not, so a raw POST
|
|
152
|
+
* route only stores bytes (`POST /files`): nothing runs until a JSON request names them. */
|
|
153
|
+
export type Route = {
|
|
154
|
+
method: string;
|
|
155
|
+
pattern: RegExp;
|
|
156
|
+
name: string;
|
|
157
|
+
capability?: string;
|
|
158
|
+
raw?: never;
|
|
159
|
+
} | {
|
|
160
|
+
method: "PUT" | "POST";
|
|
161
|
+
pattern: RegExp;
|
|
162
|
+
name: string;
|
|
163
|
+
capability?: string;
|
|
164
|
+
raw: true;
|
|
165
|
+
};
|
|
166
|
+
export declare const ROUTES: readonly Route[];
|
|
167
|
+
/** Whether the request to `path` (under /v2) is a PUT of a route marked `raw`. */
|
|
168
|
+
export declare const takesBytes: (method: string | undefined, path: string) => boolean;
|
|
169
|
+
/** What this server offers. Every flag is present; an off one answers 501 naming it. */
|
|
170
|
+
/** A workflow run's title: its agent's name and a few words of its input, never the input's JSON ("Batch review: 20
|
|
171
|
+
* documents, as_of 2026-10-30"). */
|
|
172
|
+
export declare function workflowTitle(name: string, input: Record<string, unknown>): string;
|
|
173
|
+
/** `env` as the harnesses' offers are made from it: without the tool keys' fields (TOOL_FIELDS), which no harness reads.
|
|
174
|
+
* So the offers never depend on a tool key, and its save or delete leaves them as they are. */
|
|
175
|
+
export declare function offersEnvOf(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
176
|
+
/** The server's reading of `base`, whole: its secrets, saved keys among them (`env`), the harnesses' offers, probed from
|
|
177
|
+
* env without the tool keys (offersEnvOf), and its capabilities made from both under its learning switch (`learning`,
|
|
178
|
+
* AGENTRUN_SERVE_LEARNING's when not given), its tool settings (`toolSettings`, what each web tool resolves to) and the
|
|
179
|
+
* box offers (`boxes`, what the box registry set up at the start, boxes.ts), with whether a revision that names no
|
|
180
|
+
* model runs (needsOf). The server makes it once at its start and then remakes only the parts a write changes
|
|
181
|
+
* (startHolding), so a key saved later can make a harness, a provider or the default model available with no restart.
|
|
182
|
+
* `gradeModel` is its `--grade-model`. */
|
|
183
|
+
export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stored?: StoredKeys, learning?: LearningMode, toolSettings?: ToolSettingsMap, boxes?: readonly BoxOffer[], gradeModel?: string): Promise<{
|
|
184
|
+
env: NodeJS.ProcessEnv;
|
|
185
|
+
offers: HarnessCapability[];
|
|
186
|
+
caps: {
|
|
187
|
+
backend: string;
|
|
188
|
+
contract: string;
|
|
189
|
+
server: {
|
|
190
|
+
name: string;
|
|
191
|
+
version: string;
|
|
192
|
+
platform: NodeJS.Platform;
|
|
193
|
+
};
|
|
194
|
+
runtimes: string[];
|
|
195
|
+
/** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
|
|
196
|
+
harnesses: {
|
|
197
|
+
max_concurrent_runs: number;
|
|
198
|
+
id: import("./harness.js").HarnessId;
|
|
199
|
+
available: boolean;
|
|
200
|
+
steer: boolean;
|
|
201
|
+
reason?: string;
|
|
202
|
+
default_model: string | null;
|
|
203
|
+
run_memory_mib: number;
|
|
204
|
+
}[];
|
|
205
|
+
/** The places a revision may name (`definition.place`), this host's default, and whether this server has each box. */
|
|
206
|
+
places: {
|
|
207
|
+
modes: ("runner" | "sandbox")[];
|
|
208
|
+
default: "runner";
|
|
209
|
+
boxes: BoxOffer[];
|
|
210
|
+
};
|
|
211
|
+
models: {
|
|
212
|
+
ready: boolean;
|
|
213
|
+
needs: ModelNeeds | null;
|
|
214
|
+
source: typeof import("./model.js").MODEL_SOURCES[number];
|
|
215
|
+
route_prefix: string | null;
|
|
216
|
+
default: string | null;
|
|
217
|
+
fast: string | null;
|
|
218
|
+
strong: string | null;
|
|
219
|
+
};
|
|
220
|
+
/** What grades a run's proposed notes: the model this server names for it (learning.ts gradeModelOf), or null when
|
|
221
|
+
* each run is graded on its agent's own model; and `pending`: a risky rule, the user's or the run's own, is kept to
|
|
222
|
+
* wait for its owner's OK, served to no run; `approve`: whether the caller can approve one, which takes the owner's
|
|
223
|
+
* password session (forCaller), and `approve_needs` when not. */
|
|
224
|
+
learning: LearningCaps;
|
|
225
|
+
/** Every tool a revision may name (the closed table in tools.ts): available here, or the variables it is missing; a
|
|
226
|
+
* web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
|
|
227
|
+
* it (tool-keys.ts), when one does. */
|
|
228
|
+
tools: ({
|
|
229
|
+
providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
|
|
230
|
+
provider?: string | undefined;
|
|
231
|
+
default_provider?: "auto" | "kernel" | undefined;
|
|
232
|
+
resolves?: Record<"pi" | "claude-agent" | "codex", import("./tool-plane.js").Resolution> | undefined;
|
|
233
|
+
why?: Record<"pi" | "claude-agent" | "codex", string> | undefined;
|
|
234
|
+
harnesses: ("pi" | "claude-agent" | "codex")[];
|
|
235
|
+
missing?: string[] | undefined;
|
|
236
|
+
reason?: string | undefined;
|
|
237
|
+
available: boolean;
|
|
238
|
+
sandbox_only?: boolean | undefined;
|
|
239
|
+
call_only?: boolean | undefined;
|
|
240
|
+
name: string;
|
|
241
|
+
summary: string;
|
|
242
|
+
nodes: boolean;
|
|
243
|
+
calls: boolean;
|
|
244
|
+
} | {
|
|
245
|
+
key: string | undefined;
|
|
246
|
+
providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
|
|
247
|
+
provider?: string | undefined;
|
|
248
|
+
default_provider?: "auto" | "kernel" | undefined;
|
|
249
|
+
resolves?: Record<"pi" | "claude-agent" | "codex", import("./tool-plane.js").Resolution> | undefined;
|
|
250
|
+
why?: Record<"pi" | "claude-agent" | "codex", string> | undefined;
|
|
251
|
+
harnesses: ("pi" | "claude-agent" | "codex")[];
|
|
252
|
+
missing?: string[] | undefined;
|
|
253
|
+
reason?: string | undefined;
|
|
254
|
+
available: boolean;
|
|
255
|
+
sandbox_only?: boolean | undefined;
|
|
256
|
+
call_only?: boolean | undefined;
|
|
257
|
+
name: string;
|
|
258
|
+
summary: string;
|
|
259
|
+
nodes: boolean;
|
|
260
|
+
calls: boolean;
|
|
261
|
+
})[];
|
|
262
|
+
/** How this server holds its secrets (secrets.ts, the launcher), and what that does not cover. */
|
|
263
|
+
secrets: {
|
|
264
|
+
names: string[];
|
|
265
|
+
handoff: string;
|
|
266
|
+
condition: string;
|
|
267
|
+
limit: string;
|
|
268
|
+
};
|
|
269
|
+
/** What a workflow revision's run gets: each model node runs on the model of its tier (`models.fast`,
|
|
270
|
+
* `models.default`, `models.strong`) with the tools it names of `node_tools`; a node that names no thinking level
|
|
271
|
+
* thinks at the run's effort, or medium. */
|
|
272
|
+
workflows: {
|
|
273
|
+
nodes: ("agent" | "decide" | "extract" | "report")[];
|
|
274
|
+
node_tools: string[];
|
|
275
|
+
adapters: string[];
|
|
276
|
+
decisions: {
|
|
277
|
+
providers: import("./decisions.js").DecisionOffer[];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
/** Each agent's home (its files under `/agents/{id}/home/files`): on this server's disk, the paths in it only the host
|
|
281
|
+
* writes, and the largest file a PUT takes (`limits.max_body_bytes`). */
|
|
282
|
+
home: {
|
|
283
|
+
disk: string;
|
|
284
|
+
host_owned: string[];
|
|
285
|
+
max_file_bytes: number;
|
|
286
|
+
writes: boolean;
|
|
287
|
+
};
|
|
288
|
+
features: {
|
|
289
|
+
agents: {
|
|
290
|
+
create: boolean;
|
|
291
|
+
list: boolean;
|
|
292
|
+
update: boolean;
|
|
293
|
+
revisions: boolean;
|
|
294
|
+
};
|
|
295
|
+
/** This server's own routes, outside the contract: an archived agent or run is hidden from the lists (`?archived=true`
|
|
296
|
+
* lists only those) and kept, with its history; a run of an archived agent is refused. */
|
|
297
|
+
archive: {
|
|
298
|
+
agents: boolean;
|
|
299
|
+
runs: boolean;
|
|
300
|
+
list_param: string;
|
|
301
|
+
routes: string[];
|
|
302
|
+
};
|
|
303
|
+
home: {
|
|
304
|
+
export: boolean;
|
|
305
|
+
import: boolean;
|
|
306
|
+
check: boolean;
|
|
307
|
+
};
|
|
308
|
+
runs: {
|
|
309
|
+
stop: boolean;
|
|
310
|
+
cancel: boolean;
|
|
311
|
+
kill: boolean;
|
|
312
|
+
list: boolean;
|
|
313
|
+
kinds: string[];
|
|
314
|
+
pause_workflow_runs: boolean;
|
|
315
|
+
graph: boolean;
|
|
316
|
+
};
|
|
317
|
+
messages: {
|
|
318
|
+
steer: boolean;
|
|
319
|
+
answer: boolean;
|
|
320
|
+
follow_up: boolean;
|
|
321
|
+
steer_workflow_runs: boolean;
|
|
322
|
+
};
|
|
323
|
+
timeline: {
|
|
324
|
+
long_poll: boolean;
|
|
325
|
+
sse: boolean;
|
|
326
|
+
live_rows: boolean;
|
|
327
|
+
live_workflow_rows: boolean;
|
|
328
|
+
};
|
|
329
|
+
files: {
|
|
330
|
+
upload: boolean;
|
|
331
|
+
read: boolean;
|
|
332
|
+
range: boolean;
|
|
333
|
+
during_run: boolean;
|
|
334
|
+
};
|
|
335
|
+
quotes: boolean;
|
|
336
|
+
usage: {
|
|
337
|
+
basis: string;
|
|
338
|
+
meters: string[];
|
|
339
|
+
};
|
|
340
|
+
efforts: ("low" | "high" | "medium")[];
|
|
341
|
+
thinking: ("low" | "high" | "medium" | "xhigh" | "max")[];
|
|
342
|
+
browser: string;
|
|
343
|
+
/** A tool setting's `permission` (definition.tool_settings, /v2/settings/tools): false until the tool gate lands,
|
|
344
|
+
* and a save that names one is refused. */
|
|
345
|
+
tool_permissions: boolean;
|
|
346
|
+
sign_ins: boolean;
|
|
347
|
+
vault: boolean;
|
|
348
|
+
query: boolean;
|
|
349
|
+
/** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the launcher's seal key
|
|
350
|
+
* (tool-keys.ts); with none handed over, nothing is kept, never in the clear. */
|
|
351
|
+
tool_keys: {
|
|
352
|
+
routes: boolean;
|
|
353
|
+
at_rest: string;
|
|
354
|
+
};
|
|
355
|
+
/** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the same seal key
|
|
356
|
+
* (mcp-servers.ts); with none, only servers that take no credential are kept. */
|
|
357
|
+
mcp_client: {
|
|
358
|
+
routes: boolean;
|
|
359
|
+
transports: string[];
|
|
360
|
+
auth: ("none" | "headers" | "bearer")[];
|
|
361
|
+
at_rest: string;
|
|
362
|
+
};
|
|
363
|
+
/** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
|
|
364
|
+
learning: "off" | "on";
|
|
365
|
+
/** /settings/webhook: one URL POSTed, signed by the Standard Webhooks spec, when a run needs its person and when it
|
|
366
|
+
* ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
|
|
367
|
+
webhooks: {
|
|
368
|
+
routes: boolean;
|
|
369
|
+
events: ("run.needs_input" | "run.ended")[];
|
|
370
|
+
signing: string;
|
|
371
|
+
at_rest: string;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
regions: {
|
|
375
|
+
id: string;
|
|
376
|
+
jurisdiction: null;
|
|
377
|
+
state: string;
|
|
378
|
+
}[];
|
|
379
|
+
/** This server's own: where its OpenAPI document is, beside this one. */
|
|
380
|
+
links: {
|
|
381
|
+
openapi: string;
|
|
382
|
+
};
|
|
383
|
+
limits: {
|
|
384
|
+
max_body_bytes: number;
|
|
385
|
+
max_upload_bytes: number;
|
|
386
|
+
max_files_per_run: number;
|
|
387
|
+
max_message_chars: number;
|
|
388
|
+
max_concurrent_runs: number;
|
|
389
|
+
timeline_max_wait_ms: number;
|
|
390
|
+
timeline_page_rows: number;
|
|
391
|
+
idempotency_ttl_s: number;
|
|
392
|
+
input_wait_s: null;
|
|
393
|
+
max_cost_usd: null;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
}>;
|
|
397
|
+
/** The capabilities document GET /v2/capabilities answers for `env`: each harness's offer resolved, its `default_model`
|
|
398
|
+
* included (harnessOffers), and whether a revision that names no model runs here (`models.ready`, and what it `needs`
|
|
399
|
+
* when not), so what this returns is what the route serves and what the document's schema holds.
|
|
400
|
+
* `learning` is the server's learning switch (`--learning`), AGENTRUN_SERVE_LEARNING's when not given; with this
|
|
401
|
+
* server's tool settings, what each web tool resolves to (tool-plane.ts); `boxes`, the box offers its places show;
|
|
402
|
+
* `gradeModel`, its `--grade-model`. */
|
|
403
|
+
export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number, learning?: LearningMode, toolSettings?: ToolSettingsMap, boxes?: readonly BoxOffer[], gradeModel?: string): Promise<{
|
|
404
|
+
backend: string;
|
|
405
|
+
contract: string;
|
|
406
|
+
server: {
|
|
407
|
+
name: string;
|
|
408
|
+
version: string;
|
|
409
|
+
platform: NodeJS.Platform;
|
|
410
|
+
};
|
|
411
|
+
runtimes: string[];
|
|
412
|
+
/** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
|
|
413
|
+
harnesses: {
|
|
414
|
+
max_concurrent_runs: number;
|
|
415
|
+
id: import("./harness.js").HarnessId;
|
|
416
|
+
available: boolean;
|
|
417
|
+
steer: boolean;
|
|
418
|
+
reason?: string;
|
|
419
|
+
default_model: string | null;
|
|
420
|
+
run_memory_mib: number;
|
|
421
|
+
}[];
|
|
422
|
+
/** The places a revision may name (`definition.place`), this host's default, and whether this server has each box. */
|
|
423
|
+
places: {
|
|
424
|
+
modes: ("runner" | "sandbox")[];
|
|
425
|
+
default: "runner";
|
|
426
|
+
boxes: BoxOffer[];
|
|
427
|
+
};
|
|
428
|
+
models: {
|
|
429
|
+
ready: boolean;
|
|
430
|
+
needs: ModelNeeds | null;
|
|
431
|
+
source: typeof import("./model.js").MODEL_SOURCES[number];
|
|
432
|
+
route_prefix: string | null;
|
|
433
|
+
default: string | null;
|
|
434
|
+
fast: string | null;
|
|
435
|
+
strong: string | null;
|
|
436
|
+
};
|
|
437
|
+
/** What grades a run's proposed notes: the model this server names for it (learning.ts gradeModelOf), or null when
|
|
438
|
+
* each run is graded on its agent's own model; and `pending`: a risky rule, the user's or the run's own, is kept to
|
|
439
|
+
* wait for its owner's OK, served to no run; `approve`: whether the caller can approve one, which takes the owner's
|
|
440
|
+
* password session (forCaller), and `approve_needs` when not. */
|
|
441
|
+
learning: LearningCaps;
|
|
442
|
+
/** Every tool a revision may name (the closed table in tools.ts): available here, or the variables it is missing; a
|
|
443
|
+
* web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
|
|
444
|
+
* it (tool-keys.ts), when one does. */
|
|
445
|
+
tools: ({
|
|
446
|
+
providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
|
|
447
|
+
provider?: string | undefined;
|
|
448
|
+
default_provider?: "auto" | "kernel" | undefined;
|
|
449
|
+
resolves?: Record<"pi" | "claude-agent" | "codex", import("./tool-plane.js").Resolution> | undefined;
|
|
450
|
+
why?: Record<"pi" | "claude-agent" | "codex", string> | undefined;
|
|
451
|
+
harnesses: ("pi" | "claude-agent" | "codex")[];
|
|
452
|
+
missing?: string[] | undefined;
|
|
453
|
+
reason?: string | undefined;
|
|
454
|
+
available: boolean;
|
|
455
|
+
sandbox_only?: boolean | undefined;
|
|
456
|
+
call_only?: boolean | undefined;
|
|
457
|
+
name: string;
|
|
458
|
+
summary: string;
|
|
459
|
+
nodes: boolean;
|
|
460
|
+
calls: boolean;
|
|
461
|
+
} | {
|
|
462
|
+
key: string | undefined;
|
|
463
|
+
providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
|
|
464
|
+
provider?: string | undefined;
|
|
465
|
+
default_provider?: "auto" | "kernel" | undefined;
|
|
466
|
+
resolves?: Record<"pi" | "claude-agent" | "codex", import("./tool-plane.js").Resolution> | undefined;
|
|
467
|
+
why?: Record<"pi" | "claude-agent" | "codex", string> | undefined;
|
|
468
|
+
harnesses: ("pi" | "claude-agent" | "codex")[];
|
|
469
|
+
missing?: string[] | undefined;
|
|
470
|
+
reason?: string | undefined;
|
|
471
|
+
available: boolean;
|
|
472
|
+
sandbox_only?: boolean | undefined;
|
|
473
|
+
call_only?: boolean | undefined;
|
|
474
|
+
name: string;
|
|
475
|
+
summary: string;
|
|
476
|
+
nodes: boolean;
|
|
477
|
+
calls: boolean;
|
|
478
|
+
})[];
|
|
479
|
+
/** How this server holds its secrets (secrets.ts, the launcher), and what that does not cover. */
|
|
480
|
+
secrets: {
|
|
481
|
+
names: string[];
|
|
482
|
+
handoff: string;
|
|
483
|
+
condition: string;
|
|
484
|
+
limit: string;
|
|
485
|
+
};
|
|
486
|
+
/** What a workflow revision's run gets: each model node runs on the model of its tier (`models.fast`,
|
|
487
|
+
* `models.default`, `models.strong`) with the tools it names of `node_tools`; a node that names no thinking level
|
|
488
|
+
* thinks at the run's effort, or medium. */
|
|
489
|
+
workflows: {
|
|
490
|
+
nodes: ("agent" | "decide" | "extract" | "report")[];
|
|
491
|
+
node_tools: string[];
|
|
492
|
+
adapters: string[];
|
|
493
|
+
decisions: {
|
|
494
|
+
providers: import("./decisions.js").DecisionOffer[];
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
/** Each agent's home (its files under `/agents/{id}/home/files`): on this server's disk, the paths in it only the host
|
|
498
|
+
* writes, and the largest file a PUT takes (`limits.max_body_bytes`). */
|
|
499
|
+
home: {
|
|
500
|
+
disk: string;
|
|
501
|
+
host_owned: string[];
|
|
502
|
+
max_file_bytes: number;
|
|
503
|
+
writes: boolean;
|
|
504
|
+
};
|
|
505
|
+
features: {
|
|
506
|
+
agents: {
|
|
507
|
+
create: boolean;
|
|
508
|
+
list: boolean;
|
|
509
|
+
update: boolean;
|
|
510
|
+
revisions: boolean;
|
|
511
|
+
};
|
|
512
|
+
/** This server's own routes, outside the contract: an archived agent or run is hidden from the lists (`?archived=true`
|
|
513
|
+
* lists only those) and kept, with its history; a run of an archived agent is refused. */
|
|
514
|
+
archive: {
|
|
515
|
+
agents: boolean;
|
|
516
|
+
runs: boolean;
|
|
517
|
+
list_param: string;
|
|
518
|
+
routes: string[];
|
|
519
|
+
};
|
|
520
|
+
home: {
|
|
521
|
+
export: boolean;
|
|
522
|
+
import: boolean;
|
|
523
|
+
check: boolean;
|
|
524
|
+
};
|
|
525
|
+
runs: {
|
|
526
|
+
stop: boolean;
|
|
527
|
+
cancel: boolean;
|
|
528
|
+
kill: boolean;
|
|
529
|
+
list: boolean;
|
|
530
|
+
kinds: string[];
|
|
531
|
+
pause_workflow_runs: boolean;
|
|
532
|
+
graph: boolean;
|
|
533
|
+
};
|
|
534
|
+
messages: {
|
|
535
|
+
steer: boolean;
|
|
536
|
+
answer: boolean;
|
|
537
|
+
follow_up: boolean;
|
|
538
|
+
steer_workflow_runs: boolean;
|
|
539
|
+
};
|
|
540
|
+
timeline: {
|
|
541
|
+
long_poll: boolean;
|
|
542
|
+
sse: boolean;
|
|
543
|
+
live_rows: boolean;
|
|
544
|
+
live_workflow_rows: boolean;
|
|
545
|
+
};
|
|
546
|
+
files: {
|
|
547
|
+
upload: boolean;
|
|
548
|
+
read: boolean;
|
|
549
|
+
range: boolean;
|
|
550
|
+
during_run: boolean;
|
|
551
|
+
};
|
|
552
|
+
quotes: boolean;
|
|
553
|
+
usage: {
|
|
554
|
+
basis: string;
|
|
555
|
+
meters: string[];
|
|
556
|
+
};
|
|
557
|
+
efforts: ("low" | "high" | "medium")[];
|
|
558
|
+
thinking: ("low" | "high" | "medium" | "xhigh" | "max")[];
|
|
559
|
+
browser: string;
|
|
560
|
+
/** A tool setting's `permission` (definition.tool_settings, /v2/settings/tools): false until the tool gate lands,
|
|
561
|
+
* and a save that names one is refused. */
|
|
562
|
+
tool_permissions: boolean;
|
|
563
|
+
sign_ins: boolean;
|
|
564
|
+
vault: boolean;
|
|
565
|
+
query: boolean;
|
|
566
|
+
/** GET, PUT and DELETE /settings/tool-keys: a tool's key saved by name, kept sealed under the launcher's seal key
|
|
567
|
+
* (tool-keys.ts); with none handed over, nothing is kept, never in the clear. */
|
|
568
|
+
tool_keys: {
|
|
569
|
+
routes: boolean;
|
|
570
|
+
at_rest: string;
|
|
571
|
+
};
|
|
572
|
+
/** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the same seal key
|
|
573
|
+
* (mcp-servers.ts); with none, only servers that take no credential are kept. */
|
|
574
|
+
mcp_client: {
|
|
575
|
+
routes: boolean;
|
|
576
|
+
transports: string[];
|
|
577
|
+
auth: ("none" | "headers" | "bearer")[];
|
|
578
|
+
at_rest: string;
|
|
579
|
+
};
|
|
580
|
+
/** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
|
|
581
|
+
learning: "off" | "on";
|
|
582
|
+
/** /settings/webhook: one URL POSTed, signed by the Standard Webhooks spec, when a run needs its person and when it
|
|
583
|
+
* ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
|
|
584
|
+
webhooks: {
|
|
585
|
+
routes: boolean;
|
|
586
|
+
events: ("run.needs_input" | "run.ended")[];
|
|
587
|
+
signing: string;
|
|
588
|
+
at_rest: string;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
regions: {
|
|
592
|
+
id: string;
|
|
593
|
+
jurisdiction: null;
|
|
594
|
+
state: string;
|
|
595
|
+
}[];
|
|
596
|
+
/** This server's own: where its OpenAPI document is, beside this one. */
|
|
597
|
+
links: {
|
|
598
|
+
openapi: string;
|
|
599
|
+
};
|
|
600
|
+
limits: {
|
|
601
|
+
max_body_bytes: number;
|
|
602
|
+
max_upload_bytes: number;
|
|
603
|
+
max_files_per_run: number;
|
|
604
|
+
max_message_chars: number;
|
|
605
|
+
max_concurrent_runs: number;
|
|
606
|
+
timeline_max_wait_ms: number;
|
|
607
|
+
timeline_page_rows: number;
|
|
608
|
+
idempotency_ttl_s: number;
|
|
609
|
+
input_wait_s: null;
|
|
610
|
+
max_cost_usd: null;
|
|
611
|
+
};
|
|
612
|
+
}>;
|
|
613
|
+
/** capabilities.learning: whether the caller may approve a note that waits, and what that needs when not. */
|
|
614
|
+
type LearningCaps = {
|
|
615
|
+
grade_model: string | null;
|
|
616
|
+
pending: true;
|
|
617
|
+
approve: boolean;
|
|
618
|
+
approve_needs?: "password";
|
|
619
|
+
};
|
|
620
|
+
/** The capabilities document as `req`'s caller reads it: approving takes the owner's password session alone, so only
|
|
621
|
+
* that caller reads `approve: true`; every other (a token, a run, accounts off) reads `approve_needs: "password"`. */
|
|
622
|
+
export declare function forCaller<T extends {
|
|
623
|
+
learning: LearningCaps;
|
|
624
|
+
}>(caps: T, ownerSession: boolean): T;
|
|
625
|
+
export declare function startServe(options: ServeOptions): Promise<Serve>;
|
|
626
|
+
export {};
|