@parcha/agentrun-serve 0.1.0-beta.29 → 0.1.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/README.md +564 -97
  3. package/dist/adapters.d.ts +35 -6
  4. package/dist/adapters.js +152 -26
  5. package/dist/agents.d.ts +11 -5
  6. package/dist/agents.js +16 -10
  7. package/dist/app.js +80 -20
  8. package/dist/background.d.ts +28 -0
  9. package/dist/background.js +376 -0
  10. package/dist/box-egress.d.ts +98 -0
  11. package/dist/box-egress.js +259 -0
  12. package/dist/box-image.d.ts +1 -1
  13. package/dist/box-image.js +9 -7
  14. package/dist/box-relay-vm.d.ts +80 -0
  15. package/dist/box-relay-vm.js +389 -0
  16. package/dist/box-relay.d.ts +8 -5
  17. package/dist/box-relay.js +14 -9
  18. package/dist/boxes.d.ts +21 -3
  19. package/dist/boxes.js +14 -7
  20. package/dist/browser-cost.d.ts +41 -0
  21. package/dist/browser-cost.js +158 -0
  22. package/dist/cap.d.ts +129 -21
  23. package/dist/cap.js +338 -67
  24. package/dist/coding-tools.d.ts +7 -3
  25. package/dist/coding-tools.js +16 -10
  26. package/dist/console/THIRD-PARTY-NOTICES.txt +580 -0
  27. package/dist/console/assets/index-34jfpIbQ.js +481 -0
  28. package/dist/console/assets/index-DUHbWcIP.css +1 -0
  29. package/dist/console/index.html +2 -2
  30. package/dist/content-filter.d.ts +7 -0
  31. package/dist/content-filter.js +23 -0
  32. package/dist/decision-rows.d.ts +11 -3
  33. package/dist/decision-rows.js +18 -11
  34. package/dist/errors.d.ts +2 -0
  35. package/dist/errors.js +5 -2
  36. package/dist/files.d.ts +6 -1
  37. package/dist/files.js +7 -2
  38. package/dist/grade.d.ts +7 -10
  39. package/dist/grade.js +31 -51
  40. package/dist/graph-served.d.ts +23 -0
  41. package/dist/graph-served.js +75 -0
  42. package/dist/graph-view.d.ts +7 -5
  43. package/dist/graph-view.js +10 -3
  44. package/dist/harness-app.d.ts +4 -2
  45. package/dist/harness-app.js +101 -19
  46. package/dist/harness-opencode/adapter.d.ts +45 -0
  47. package/dist/harness-opencode/adapter.js +272 -0
  48. package/dist/harness-opencode/binary.d.ts +18 -0
  49. package/dist/harness-opencode/binary.js +87 -0
  50. package/dist/harness-opencode/config.d.ts +24 -0
  51. package/dist/harness-opencode/config.js +61 -0
  52. package/dist/harness-opencode/harness.d.ts +77 -0
  53. package/dist/harness-opencode/harness.js +620 -0
  54. package/dist/harness-opencode/host/mcp.d.ts +40 -0
  55. package/dist/harness-opencode/host/mcp.js +208 -0
  56. package/dist/harness-opencode/host/policy.d.ts +71 -0
  57. package/dist/harness-opencode/host/policy.js +419 -0
  58. package/dist/harness-opencode/host/server.d.ts +55 -0
  59. package/dist/harness-opencode/host/server.js +165 -0
  60. package/dist/harness-opencode/index.d.ts +9 -0
  61. package/dist/harness-opencode/index.js +6 -0
  62. package/dist/harness-opencode/verify.d.ts +32 -0
  63. package/dist/harness-opencode/verify.js +75 -0
  64. package/dist/harness-opencode/versions.d.ts +33 -0
  65. package/dist/harness-opencode/versions.js +64 -0
  66. package/dist/harness.d.ts +4 -1
  67. package/dist/harness.js +5 -2
  68. package/dist/host-tools.d.ts +12 -2
  69. package/dist/host-tools.js +26 -12
  70. package/dist/host.js +6 -2
  71. package/dist/hosted-search.js +5 -1
  72. package/dist/import.d.ts +2 -2
  73. package/dist/import.js +4 -3
  74. package/dist/key-check.d.ts +3 -2
  75. package/dist/key-check.js +7 -3
  76. package/dist/key-refusal.js +8 -4
  77. package/dist/learn/check.d.ts +10 -1
  78. package/dist/learn/check.js +19 -1
  79. package/dist/learn/grade.d.ts +3 -2
  80. package/dist/learn/grade.js +25 -13
  81. package/dist/learn/index.d.ts +2 -2
  82. package/dist/learn/index.js +2 -2
  83. package/dist/learn/notes.js +2 -1
  84. package/dist/learn/reflect.d.ts +2 -2
  85. package/dist/learn/reflect.js +51 -5
  86. package/dist/learn/secrets.js +28 -8
  87. package/dist/learn/skills.d.ts +17 -4
  88. package/dist/learn/skills.js +79 -6
  89. package/dist/learned-workflow.d.ts +59 -0
  90. package/dist/learned-workflow.js +191 -0
  91. package/dist/learning-run.d.ts +7 -5
  92. package/dist/learning-run.js +45 -23
  93. package/dist/learning-words.d.ts +6 -3
  94. package/dist/learning-words.js +8 -5
  95. package/dist/learning.d.ts +44 -3
  96. package/dist/learning.js +148 -3
  97. package/dist/mcp-servers.d.ts +7 -4
  98. package/dist/mcp-servers.js +5 -0
  99. package/dist/mcp.js +5 -5
  100. package/dist/model.d.ts +13 -11
  101. package/dist/model.js +11 -10
  102. package/dist/openapi/agentrun-v2.openapi.json +1 -0
  103. package/dist/openapi.js +358 -48
  104. package/dist/paid-calls.d.ts +5 -1
  105. package/dist/paid-calls.js +1 -1
  106. package/dist/pause.d.ts +2 -0
  107. package/dist/place.d.ts +27 -4
  108. package/dist/place.js +42 -10
  109. package/dist/propose.d.ts +2 -0
  110. package/dist/propose.js +38 -8
  111. package/dist/request-start.d.ts +12 -4
  112. package/dist/request-start.js +139 -15
  113. package/dist/run-box.d.ts +56 -4
  114. package/dist/run-box.js +173 -23
  115. package/dist/runnable.d.ts +5 -2
  116. package/dist/runnable.js +12 -4
  117. package/dist/runs.d.ts +258 -36
  118. package/dist/runs.js +830 -89
  119. package/dist/secrets.d.ts +12 -0
  120. package/dist/secrets.js +18 -0
  121. package/dist/server.d.ts +131 -35
  122. package/dist/server.js +467 -105
  123. package/dist/sign-ins.d.ts +99 -0
  124. package/dist/sign-ins.js +288 -0
  125. package/dist/skills.d.ts +16 -4
  126. package/dist/skills.js +35 -7
  127. package/dist/stats.d.ts +7 -2
  128. package/dist/stats.js +28 -7
  129. package/dist/tool-gate.d.ts +266 -0
  130. package/dist/tool-gate.js +554 -0
  131. package/dist/tool-keys.d.ts +46 -10
  132. package/dist/tool-keys.js +44 -2
  133. package/dist/tool-plane.d.ts +112 -27
  134. package/dist/tool-plane.js +205 -47
  135. package/dist/tools.d.ts +69 -14
  136. package/dist/tools.js +143 -24
  137. package/dist/trigger-secrets.d.ts +32 -0
  138. package/dist/trigger-secrets.js +143 -0
  139. package/dist/triggers.d.ts +439 -0
  140. package/dist/triggers.js +863 -0
  141. package/dist/turn-end.d.ts +3 -2
  142. package/dist/turn-end.js +3 -2
  143. package/dist/usage-lines.d.ts +26 -0
  144. package/dist/usage-lines.js +28 -0
  145. package/dist/validate.d.ts +2 -0
  146. package/dist/validate.js +11 -2
  147. package/dist/webhooks.d.ts +11 -4
  148. package/dist/webhooks.js +17 -1
  149. package/launcher/agentrun-serve +1 -1
  150. package/package.json +19 -13
  151. package/dist/console/assets/index-BN7oVcO4.js +0 -445
  152. package/dist/console/assets/index-By-jkqki.css +0 -1
package/dist/secrets.d.ts CHANGED
@@ -38,6 +38,18 @@ export declare const withoutSecrets: (env: NodeJS.ProcessEnv) => NodeJS.ProcessE
38
38
  /** What a run's process is handed: the secrets named `names` that this process holds, or its server saved (`stored`),
39
39
  * as its pipe carries them. */
40
40
  export declare function handover(names: readonly string[], stored?: StoredKeys): Buffer;
41
+ /** A run's saved sign-in as its pipe carries it, after its secrets (handover). */
42
+ export declare const handoverSignIn: (value: {
43
+ provider: string;
44
+ ref: string;
45
+ save: boolean;
46
+ }) => Buffer;
47
+ /** The saved sign-in this run's process was handed over its pipe, if any: read by the browser tool alone. */
48
+ export declare function handedSignIn(): {
49
+ provider: string;
50
+ ref: string;
51
+ save: boolean;
52
+ } | undefined;
41
53
  /** pi-ai's auth context over `env` (one `withSecrets` made): its providers find their keys there, not in process.env. */
42
54
  export declare const authContextOf: (env: NodeJS.ProcessEnv) => {
43
55
  env: (name: string) => Promise<string | undefined>;
package/dist/secrets.js CHANGED
@@ -30,6 +30,10 @@ export const DECISION_KEYS = ["TYPESAFE_API_KEY", "PARALLEL_API_KEY"];
30
30
  const held = new Map();
31
31
  /** Whether this process was handed its secrets over a pipe, and closed it. */
32
32
  let handed;
33
+ /** The pair a run's saved sign-in comes as on the same pipe (sign-ins.ts): JSON `{provider, ref, save}`, held apart from
34
+ * the secrets, so it is no tool's environment and no key a scan looks for by name. */
35
+ const SIGN_IN_PAIR = "AGENTRUN_SIGN_IN";
36
+ let signIn;
33
37
  /** NAME=VALUE pairs, each ended by a NUL. */
34
38
  const encode = (pairs) => Buffer.concat([...pairs].map(([name, value]) => Buffer.from(`${name}=${value}\0`)));
35
39
  function decode(bytes) {
@@ -37,6 +41,8 @@ function decode(bytes) {
37
41
  const at = pair.indexOf("=");
38
42
  if (at > 0 && SECRET_NAMES.includes(pair.slice(0, at)))
39
43
  held.set(pair.slice(0, at), pair.slice(at + 1));
44
+ else if (pair.slice(0, at) === SIGN_IN_PAIR)
45
+ signIn = pair.slice(at + 1);
40
46
  }
41
47
  }
42
48
  /** Exactly `length` bytes of `fd`: the writer keeps its end open (the launcher's FIFO is open read-write), so there is
@@ -131,6 +137,18 @@ export function handover(names, stored) {
131
137
  return value === undefined ? [] : [[name, value]];
132
138
  }));
133
139
  }
140
+ /** A run's saved sign-in as its pipe carries it, after its secrets (handover). */
141
+ export const handoverSignIn = (value) => encode([[SIGN_IN_PAIR, JSON.stringify(value)]]);
142
+ /** The saved sign-in this run's process was handed over its pipe, if any: read by the browser tool alone. */
143
+ export function handedSignIn() {
144
+ try {
145
+ const value = signIn === undefined ? undefined : JSON.parse(signIn);
146
+ return value && typeof value.provider === "string" && typeof value.ref === "string" && value.ref && typeof value.save === "boolean" ? { provider: value.provider, ref: value.ref, save: value.save } : undefined;
147
+ }
148
+ catch {
149
+ return undefined;
150
+ }
151
+ }
134
152
  /** pi-ai's auth context over `env` (one `withSecrets` made): its providers find their keys there, not in process.env. */
135
153
  export const authContextOf = (env) => ({
136
154
  env: async (name) => env[name],
package/dist/server.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { type ModelNeeds } from "./model.js";
2
2
  import { type HarnessCapability } from "./harness.js";
3
+ import type { MessageOrigin } from "@parcha/pi-durable-agent/timeline";
3
4
  import { type LearningMode } from "./learning.js";
5
+ import { type Place } from "./place.js";
4
6
  import { type CarryBackRetry } from "./runs.js";
5
7
  import { type BoxHost } from "./box/sweep.js";
6
8
  import { type BoxOffer } from "./boxes.js";
7
9
  import { type StoredKeys } from "./secrets.js";
10
+ import { type TriggerClock } from "./triggers.js";
8
11
  import { type ToolSettingsMap } from "./tool-plane.js";
9
12
  export declare const CONTRACT = "agentrun.v2/0";
10
13
  export declare const DEFAULT_PORT = 7340;
@@ -48,8 +51,11 @@ export type ServeOptions = {
48
51
  /** A faux model module (no key, no network): see the README. */
49
52
  faux?: string;
50
53
  /** 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. */
54
+ * backend), in place of Browserbase's or Kernel's. */
52
55
  fauxBrowser?: string;
56
+ /** With `faux` only: a module whose default export is the fetch the check of a Kernel key goes through (the tests'
57
+ * fake), in place of Kernel's API. */
58
+ fauxKernel?: string;
53
59
  /** With `faux` only: a module whose default export gives `fetch_page` its `{ lookup, fetchImpl }` (the tests' fake
54
60
  * network), in place of the system's resolver and undici. */
55
61
  fauxWeb?: string;
@@ -65,6 +71,13 @@ export type ServeOptions = {
65
71
  /** With `faux` only: a module whose default export is the fetch the monid tools send through (the tests' fake), in
66
72
  * place of monid's API. */
67
73
  fauxMonid?: string;
74
+ /** With `faux` only: a module whose default export is the fetch the check of a Browserbase key goes through (the
75
+ * tests' fake), in place of Browserbase's API. */
76
+ fauxBrowserbase?: string;
77
+ /** With `faux` only: a module whose default export is the fetch the start's check of a monid key the server is started
78
+ * with goes through (the tests' fake for that check alone), in place of monid's API; the runs' calls go through
79
+ * `fauxMonid`'s. */
80
+ fauxMonidCheck?: string;
68
81
  /** With `faux` only: a module whose default export is the fetch the Anthropic and OpenAI providers send through, in
69
82
  * place of their APIs, for web_search's own request to the provider the revision's model names (model.ts). */
70
83
  fauxUpstream?: string;
@@ -76,6 +89,12 @@ export type ServeOptions = {
76
89
  /** With `faux` only: a module whose default export, given the data root, is the box provider runs' Docker boxes come
77
90
  * from (the tests' faux box, pi-transport's local box): docker is then available, and nothing asks Docker. */
78
91
  fauxBox?: string;
92
+ /** Under `faux` only: a module that stands in for the VM provider's SDK (its client class, by the SDK's name for it),
93
+ * so the VM box runs on the tests' fake, never the provider. */
94
+ fauxVm?: string;
95
+ /** Under `faux`: a module whose default export gives a box's egress proxy its `lookup` and `dial` (box-egress.ts), the
96
+ * tests' fake network. */
97
+ fauxEgress?: string;
79
98
  /** Extra `Host` names to accept besides the loopback ones. */
80
99
  allowHosts?: string[];
81
100
  /** The console's built files, answered at / (default dist/console beside the server, which this package's build copies
@@ -106,6 +125,13 @@ export type ServeOptions = {
106
125
  beforeReopenLaunch?: (runId: string) => Promise<void> | void;
107
126
  /** 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
127
  beforeSubmit?: (runId: string, content: string) => Promise<void> | void;
128
+ /** A test's seam: told each run read in from its store (runs.ts onRunLoad). */
129
+ onRunLoad?: (runId: string) => void;
130
+ /** A test's seam: awaited before a run's serve.json is written (runs.ts beforeMetaSave). */
131
+ beforeMetaSave?: (runId: string, meta: Readonly<Record<string, unknown>>) => Promise<void> | void;
132
+ /** A test's seam: who wrote a message sent to a run through its messages route (`origin`, as a raised cap's follow-up
133
+ * carries it), so a test sends a server-written message down the path a person's message takes. */
134
+ messageOrigin?: (runId: string, content: string) => MessageOrigin | undefined;
109
135
  /** How long a request waits for a run's door, its process coming up or a settle in progress (default 45 s). */
110
136
  readyTimeoutMs?: number;
111
137
  /** How long a run's end-of-run turn may take before it is aborted and the run finishes without it (default 5 min). */
@@ -123,6 +149,8 @@ export type ServeOptions = {
123
149
  * default AGENTRUN_SERVE_LEARNING_BUDGET, else 8000): every note whole while they fit, else the index and the notes
124
150
  * changed last, whole, while they fit (learning.ts learnedOf). */
125
151
  learningBudget?: number;
152
+ /** A test's seam: the triggers' clock and timer (triggers.ts), in place of Date.now and setTimeout. */
153
+ triggerClock?: TriggerClock;
126
154
  /** 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
155
  webhookRetryMs?: readonly number[];
128
156
  /** The box runs' harnesses run in (4a's Box: its reap; on a shared server its run cgroups): the boxes runs leave are
@@ -204,9 +232,18 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
204
232
  }[];
205
233
  /** The places a revision may name (`definition.place`), this host's default, and whether this server has each box. */
206
234
  places: {
235
+ boxes: BoxOffer[];
236
+ allow: string[];
237
+ default_place: Place;
207
238
  modes: ("runner" | "sandbox")[];
208
239
  default: "runner";
240
+ } | {
209
241
  boxes: BoxOffer[];
242
+ allow: string[];
243
+ default_place: Place;
244
+ default_reason: string;
245
+ modes: ("runner" | "sandbox")[];
246
+ default: "runner";
210
247
  };
211
248
  models: {
212
249
  ready: boolean;
@@ -226,12 +263,15 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
226
263
  * web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
227
264
  * it (tool-keys.ts), when one does. */
228
265
  tools: ({
229
- providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
266
+ providers?: ("browserbase" | "kernel" | "chrome" | "auto" | "off" | "parallel" | "native" | "exa-keyless")[] | undefined;
230
267
  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")[];
268
+ default_provider?: "kernel" | "auto" | undefined;
269
+ resolves?: Record<"pi" | "claude-agent" | "codex" | "opencode", import("./tool-plane.js").Resolution> | undefined;
270
+ why?: Record<"pi" | "claude-agent" | "codex" | "opencode", string> | undefined;
271
+ harnesses: ("pi" | "claude-agent" | "codex" | "opencode")[];
272
+ permission: "ask" | "deny" | "allow";
273
+ default_permission: "ask" | "deny" | "allow";
274
+ permissions: ("ask" | "deny" | "allow")[];
235
275
  missing?: string[] | undefined;
236
276
  reason?: string | undefined;
237
277
  available: boolean;
@@ -243,12 +283,15 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
243
283
  calls: boolean;
244
284
  } | {
245
285
  key: string | undefined;
246
- providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
286
+ providers?: ("browserbase" | "kernel" | "chrome" | "auto" | "off" | "parallel" | "native" | "exa-keyless")[] | undefined;
247
287
  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")[];
288
+ default_provider?: "kernel" | "auto" | undefined;
289
+ resolves?: Record<"pi" | "claude-agent" | "codex" | "opencode", import("./tool-plane.js").Resolution> | undefined;
290
+ why?: Record<"pi" | "claude-agent" | "codex" | "opencode", string> | undefined;
291
+ harnesses: ("pi" | "claude-agent" | "codex" | "opencode")[];
292
+ permission: "ask" | "deny" | "allow";
293
+ default_permission: "ask" | "deny" | "allow";
294
+ permissions: ("ask" | "deny" | "allow")[];
252
295
  missing?: string[] | undefined;
253
296
  reason?: string | undefined;
254
297
  available: boolean;
@@ -339,10 +382,14 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
339
382
  };
340
383
  efforts: ("low" | "high" | "medium")[];
341
384
  thinking: ("low" | "high" | "medium" | "xhigh" | "max")[];
385
+ /** The browser a run's `browser` tool drives: the vendor it resolves to under the server's settings when the tool is
386
+ * available here (tools[]), Browserbase's or Kernel's, else none. */
342
387
  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. */
388
+ /** A tool setting's `permission` (definition.tool_settings, /v2/settings/tools): allow, ask or deny, which the tool
389
+ * gate holds every tool call to (tool-gate.ts); an ask is answered at POST /runs/{id}/approvals/{approval_id}. */
345
390
  tool_permissions: boolean;
391
+ /** An agent's browser stays signed in between its runs (sign-ins.ts): with a seal key to keep each pointer under, and a
392
+ * browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
346
393
  sign_ins: boolean;
347
394
  vault: boolean;
348
395
  query: boolean;
@@ -357,7 +404,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
357
404
  mcp_client: {
358
405
  routes: boolean;
359
406
  transports: string[];
360
- auth: ("none" | "headers" | "bearer")[];
407
+ auth: ("headers" | "none" | "bearer")[];
361
408
  at_rest: string;
362
409
  };
363
410
  /** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
@@ -366,10 +413,28 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
366
413
  * ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
367
414
  webhooks: {
368
415
  routes: boolean;
369
- events: ("run.needs_input" | "run.ended")[];
416
+ events: ("run.needs_input" | "run.ended" | "trigger.failed")[];
370
417
  signing: string;
371
418
  at_rest: string;
372
419
  };
420
+ /** /triggers: what starts an agent's capped runs with no caller (triggers.ts). */
421
+ triggers: {
422
+ routes: boolean;
423
+ sources: ("schedule" | "webhook")[];
424
+ targets: ("start_run" | "message_run")[];
425
+ overlap: "skip"[];
426
+ min_every_s: number;
427
+ history_kept: number;
428
+ catchup_window_s: number;
429
+ failures_to_pause: number;
430
+ webhook: {
431
+ signing: string;
432
+ tolerance_s: number;
433
+ max_body_bytes: number;
434
+ payload_kept_bytes: number;
435
+ at_rest: string;
436
+ };
437
+ };
373
438
  };
374
439
  regions: {
375
440
  id: string;
@@ -394,12 +459,6 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
394
459
  };
395
460
  };
396
461
  }>;
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
462
  export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number, learning?: LearningMode, toolSettings?: ToolSettingsMap, boxes?: readonly BoxOffer[], gradeModel?: string): Promise<{
404
463
  backend: string;
405
464
  contract: string;
@@ -421,9 +480,18 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
421
480
  }[];
422
481
  /** The places a revision may name (`definition.place`), this host's default, and whether this server has each box. */
423
482
  places: {
483
+ boxes: BoxOffer[];
484
+ allow: string[];
485
+ default_place: Place;
424
486
  modes: ("runner" | "sandbox")[];
425
487
  default: "runner";
488
+ } | {
426
489
  boxes: BoxOffer[];
490
+ allow: string[];
491
+ default_place: Place;
492
+ default_reason: string;
493
+ modes: ("runner" | "sandbox")[];
494
+ default: "runner";
427
495
  };
428
496
  models: {
429
497
  ready: boolean;
@@ -443,12 +511,15 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
443
511
  * web tool, what it resolves to on each harness under this server's tool settings; `key`, the tool key that unlocks
444
512
  * it (tool-keys.ts), when one does. */
445
513
  tools: ({
446
- providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
514
+ providers?: ("browserbase" | "kernel" | "chrome" | "auto" | "off" | "parallel" | "native" | "exa-keyless")[] | undefined;
447
515
  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")[];
516
+ default_provider?: "kernel" | "auto" | undefined;
517
+ resolves?: Record<"pi" | "claude-agent" | "codex" | "opencode", import("./tool-plane.js").Resolution> | undefined;
518
+ why?: Record<"pi" | "claude-agent" | "codex" | "opencode", string> | undefined;
519
+ harnesses: ("pi" | "claude-agent" | "codex" | "opencode")[];
520
+ permission: "ask" | "deny" | "allow";
521
+ default_permission: "ask" | "deny" | "allow";
522
+ permissions: ("ask" | "deny" | "allow")[];
452
523
  missing?: string[] | undefined;
453
524
  reason?: string | undefined;
454
525
  available: boolean;
@@ -460,12 +531,15 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
460
531
  calls: boolean;
461
532
  } | {
462
533
  key: string | undefined;
463
- providers?: ("auto" | "off" | "parallel" | "native" | "exa-keyless" | "kernel")[] | undefined;
534
+ providers?: ("browserbase" | "kernel" | "chrome" | "auto" | "off" | "parallel" | "native" | "exa-keyless")[] | undefined;
464
535
  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")[];
536
+ default_provider?: "kernel" | "auto" | undefined;
537
+ resolves?: Record<"pi" | "claude-agent" | "codex" | "opencode", import("./tool-plane.js").Resolution> | undefined;
538
+ why?: Record<"pi" | "claude-agent" | "codex" | "opencode", string> | undefined;
539
+ harnesses: ("pi" | "claude-agent" | "codex" | "opencode")[];
540
+ permission: "ask" | "deny" | "allow";
541
+ default_permission: "ask" | "deny" | "allow";
542
+ permissions: ("ask" | "deny" | "allow")[];
469
543
  missing?: string[] | undefined;
470
544
  reason?: string | undefined;
471
545
  available: boolean;
@@ -556,10 +630,14 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
556
630
  };
557
631
  efforts: ("low" | "high" | "medium")[];
558
632
  thinking: ("low" | "high" | "medium" | "xhigh" | "max")[];
633
+ /** The browser a run's `browser` tool drives: the vendor it resolves to under the server's settings when the tool is
634
+ * available here (tools[]), Browserbase's or Kernel's, else none. */
559
635
  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. */
636
+ /** A tool setting's `permission` (definition.tool_settings, /v2/settings/tools): allow, ask or deny, which the tool
637
+ * gate holds every tool call to (tool-gate.ts); an ask is answered at POST /runs/{id}/approvals/{approval_id}. */
562
638
  tool_permissions: boolean;
639
+ /** An agent's browser stays signed in between its runs (sign-ins.ts): with a seal key to keep each pointer under, and a
640
+ * browser vendor here (Browserbase's or Kernel's; local Chrome keeps none). */
563
641
  sign_ins: boolean;
564
642
  vault: boolean;
565
643
  query: boolean;
@@ -574,7 +652,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
574
652
  mcp_client: {
575
653
  routes: boolean;
576
654
  transports: string[];
577
- auth: ("none" | "headers" | "bearer")[];
655
+ auth: ("headers" | "none" | "bearer")[];
578
656
  at_rest: string;
579
657
  };
580
658
  /** This server's learning switch (`--learning`): on, a run learns when its agent says `learning: true`; off, none does. */
@@ -583,10 +661,28 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
583
661
  * ends (webhooks.ts); its secret kept sealed under the same seal key, so with none no webhook is set. */
584
662
  webhooks: {
585
663
  routes: boolean;
586
- events: ("run.needs_input" | "run.ended")[];
664
+ events: ("run.needs_input" | "run.ended" | "trigger.failed")[];
587
665
  signing: string;
588
666
  at_rest: string;
589
667
  };
668
+ /** /triggers: what starts an agent's capped runs with no caller (triggers.ts). */
669
+ triggers: {
670
+ routes: boolean;
671
+ sources: ("schedule" | "webhook")[];
672
+ targets: ("start_run" | "message_run")[];
673
+ overlap: "skip"[];
674
+ min_every_s: number;
675
+ history_kept: number;
676
+ catchup_window_s: number;
677
+ failures_to_pause: number;
678
+ webhook: {
679
+ signing: string;
680
+ tolerance_s: number;
681
+ max_body_bytes: number;
682
+ payload_kept_bytes: number;
683
+ at_rest: string;
684
+ };
685
+ };
590
686
  };
591
687
  regions: {
592
688
  id: string;