@tangle-network/agent-runtime 0.44.0 → 0.46.0
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/README.md +95 -203
- package/dist/agent.d.ts +3 -2
- package/dist/agent.js +5 -7
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +28 -2
- package/dist/analyst-loop.js +4 -1
- package/dist/audit.d.ts +93 -0
- package/dist/audit.js +312 -0
- package/dist/audit.js.map +1 -0
- package/dist/chunk-4B6U4CVQ.js +15 -0
- package/dist/chunk-4B6U4CVQ.js.map +1 -0
- package/dist/chunk-65FQLI4V.js +4089 -0
- package/dist/chunk-65FQLI4V.js.map +1 -0
- package/dist/{chunk-GFKVVRQ7.js → chunk-GN75RGM6.js} +13 -12
- package/dist/chunk-GN75RGM6.js.map +1 -0
- package/dist/chunk-GSUO5QS6.js +146 -0
- package/dist/chunk-GSUO5QS6.js.map +1 -0
- package/dist/chunk-HNUXAZIJ.js +580 -0
- package/dist/chunk-HNUXAZIJ.js.map +1 -0
- package/dist/{chunk-SKUZZCHE.js → chunk-I42NHLKX.js} +5 -5
- package/dist/chunk-I42NHLKX.js.map +1 -0
- package/dist/{chunk-HVYOHJHK.js → chunk-JNPK46YH.js} +2 -2
- package/dist/chunk-JNPK46YH.js.map +1 -0
- package/dist/{chunk-3HMHSN22.js → chunk-KADIJAD4.js} +38 -24
- package/dist/chunk-KADIJAD4.js.map +1 -0
- package/dist/{chunk-KDMRUD2P.js → chunk-KPN7OQ64.js} +296 -8
- package/dist/chunk-KPN7OQ64.js.map +1 -0
- package/dist/{chunk-NRZOXCJK.js → chunk-VR4JIC5H.js} +2 -2
- package/dist/chunk-WIR4HOOJ.js +27 -0
- package/dist/chunk-WIR4HOOJ.js.map +1 -0
- package/dist/coder-DCWFQpmJ.d.ts +114 -0
- package/dist/driver-C-mtBo7h.d.ts +221 -0
- package/dist/improvement.d.ts +0 -1
- package/dist/improvement.js +0 -5
- package/dist/improvement.js.map +1 -1
- package/dist/index.d.ts +122 -9
- package/dist/index.js +398 -10
- package/dist/index.js.map +1 -1
- package/dist/{kb-gate-D0ZIhFOU.d.ts → kb-gate-2Gwpz_27.d.ts} +86 -9
- package/dist/{loop-runner-bin-BLMa8He3.d.ts → loop-runner-bin-D-K6bRp3.d.ts} +17 -13
- package/dist/loop-runner-bin.d.ts +8 -6
- package/dist/loop-runner-bin.js +6 -8
- package/dist/loops.d.ts +7 -393
- package/dist/loops.js +96 -27
- package/dist/mcp/bin.js +7 -7
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +286 -13
- package/dist/mcp/index.js +341 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/{otel-export-wFDmmurL.d.ts → otel-export-nurzFwuJ.d.ts} +1 -1
- package/dist/profiles.d.ts +385 -86
- package/dist/profiles.js +549 -4
- package/dist/profiles.js.map +1 -1
- package/dist/{run-loop-C4L1Sted.d.ts → run-loop-CU2Y00Si.d.ts} +36 -13
- package/dist/runtime-hooks-C7JwKb9E.d.ts +70 -0
- package/dist/runtime.d.ts +1964 -0
- package/dist/runtime.js +114 -0
- package/dist/runtime.js.map +1 -0
- package/dist/substrate-CUgk7F7s.d.ts +77 -0
- package/dist/topology.d.ts +73 -0
- package/dist/topology.js +111 -0
- package/dist/topology.js.map +1 -0
- package/dist/types-BfoeiQRZ.d.ts +438 -0
- package/dist/{types-DbJzz2uf.d.ts → types-DnYoHvvZ.d.ts} +110 -4
- package/dist/workflow.d.ts +4 -3
- package/dist/workflow.js +4 -5
- package/dist/workflow.js.map +1 -1
- package/package.json +37 -28
- package/skills/agent-runtime-adoption/SKILL.md +32 -29
- package/skills/generate-eval/SKILL.md +60 -0
- package/dist/chunk-3HMHSN22.js.map +0 -1
- package/dist/chunk-GFKVVRQ7.js.map +0 -1
- package/dist/chunk-HVYOHJHK.js.map +0 -1
- package/dist/chunk-KDMRUD2P.js.map +0 -1
- package/dist/chunk-PY6NMZYX.js +0 -52
- package/dist/chunk-PY6NMZYX.js.map +0 -1
- package/dist/chunk-S7JXV32P.js +0 -947
- package/dist/chunk-S7JXV32P.js.map +0 -1
- package/dist/chunk-SKUZZCHE.js.map +0 -1
- package/dist/chunk-SQSCRJ7U.js +0 -65
- package/dist/chunk-SQSCRJ7U.js.map +0 -1
- package/dist/chunk-VOX6Z3II.js +0 -90
- package/dist/chunk-VOX6Z3II.js.map +0 -1
- package/dist/chunk-XBUG326M.js +0 -261
- package/dist/chunk-XBUG326M.js.map +0 -1
- package/dist/dynamic-wUgp6UKs.d.ts +0 -108
- package/dist/optimize-prompt-D-urF2wW.d.ts +0 -129
- /package/dist/{chunk-NRZOXCJK.js.map → chunk-VR4JIC5H.js.map} +0 -0
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as FleetHandle, d as DelegationExecutor, e as DelegateFeedbackArgs, f as DelegationFeedbackSnapshot, g as DelegationProfile, D as DelegateCodeArgs, h as DelegateResearchArgs, i as
|
|
3
|
-
export {
|
|
1
|
+
import { S as SandboxClient, f as LoopSandboxPlacement, e as LoopTraceEmitter } from '../types-DnYoHvvZ.js';
|
|
2
|
+
import { c as FleetHandle, d as DelegationExecutor, e as DelegateFeedbackArgs, f as DelegationFeedbackSnapshot, g as DelegationProfile, D as DelegateCodeArgs, h as DelegateResearchArgs, i as DelegateUiAuditArgs, j as DelegationStatus, k as DelegationProgress, l as DelegationResultPayload, m as DelegationError, n as DelegationStatusResult, o as DelegationHistoryArgs, p as DelegationHistoryEntry, q as CoderDelegate, R as ResearcherDelegate, U as UiAuditorDelegate, r as DelegateCodeResult, s as DelegateFeedbackResult, t as ResearchSource, u as DelegateResearchResult, v as DelegateUiAuditResult, w as DelegationHistoryResult, x as DelegationStatusArgs } from '../kb-gate-2Gwpz_27.js';
|
|
3
|
+
export { y as CoderReview, C as CoderReviewer, a as CoderWinnerSelection, z as CreateDefaultCoderDelegateOptions, b as CreateKbGateOptions, A as DelegateCodeConfig, B as DelegateResearchConfig, E as DelegateRunCtx, G as DelegateUiAuditConfig, H as DelegateUiAuditRoute, F as FactCandidate, I as FactJudge, J as FactJudgeVerdict, K as FeedbackRating, L as FeedbackRefersTo, M as FleetWorkspaceExecutorOptions, N as KbGateResult, O as ResearchOutputShape, S as SiblingSandboxExecutorOptions, P as UiAuditorDelegationOutput, Q as createDefaultCoderDelegate, T as createFleetWorkspaceExecutor, V as createKbGate, W as createSiblingSandboxExecutor } from '../kb-gate-2Gwpz_27.js';
|
|
4
4
|
export { B as BuildDelegationMcpServerOptions, C as ComposeProductionAgentProfileOptions, D as DELEGATION_MCP_SERVER_KEY, b as buildDelegationMcpServer, c as composeProductionAgentProfile } from '../delegation-profile-1GbW5yA3.js';
|
|
5
5
|
import { L as LocalHarness, r as runLocalHarness } from '../local-harness-KrdFTY5R.js';
|
|
6
6
|
export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-KrdFTY5R.js';
|
|
7
|
-
import { O as OtelExporter } from '../otel-export-
|
|
8
|
-
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../otel-export-
|
|
9
|
-
import '@tangle-network/agent-eval';
|
|
7
|
+
import { O as OtelExporter } from '../otel-export-nurzFwuJ.js';
|
|
8
|
+
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../otel-export-nurzFwuJ.js';
|
|
9
|
+
import { AnalystFinding } from '@tangle-network/agent-eval';
|
|
10
|
+
import { S as Scope, R as ResultBlobStore, A as Agent, B as Budget } from '../types-BfoeiQRZ.js';
|
|
11
|
+
import { a as UiLens } from '../substrate-CUgk7F7s.js';
|
|
10
12
|
import '@tangle-network/sandbox';
|
|
11
|
-
import '../
|
|
13
|
+
import '../runtime-hooks-C7JwKb9E.js';
|
|
14
|
+
import '../coder-DCWFQpmJ.js';
|
|
12
15
|
import 'node:child_process';
|
|
13
16
|
|
|
14
17
|
/**
|
|
@@ -21,7 +24,7 @@ import 'node:child_process';
|
|
|
21
24
|
|
|
22
25
|
/** @experimental */
|
|
23
26
|
interface DetectExecutorArgs {
|
|
24
|
-
sandboxClient:
|
|
27
|
+
sandboxClient: SandboxClient;
|
|
25
28
|
/** Raw env (defaults to `process.env`). Pass an explicit map for tests. */
|
|
26
29
|
env?: Record<string, string | undefined>;
|
|
27
30
|
/**
|
|
@@ -29,7 +32,7 @@ interface DetectExecutorArgs {
|
|
|
29
32
|
* default reads `client.fleets.get(fleetId)` and validates the returned
|
|
30
33
|
* shape against the structural `FleetHandle` contract.
|
|
31
34
|
*/
|
|
32
|
-
resolveFleet?: (client:
|
|
35
|
+
resolveFleet?: (client: SandboxClient, fleetId: string) => Promise<FleetHandle>;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Pick the right executor for an MCP server invocation based on env vars.
|
|
@@ -309,12 +312,13 @@ declare function createInProcessExecutor(options: InProcessExecutorOptions): Del
|
|
|
309
312
|
* pending delegations.
|
|
310
313
|
*/
|
|
311
314
|
|
|
315
|
+
type AnyDelegateArgs = DelegateCodeArgs | DelegateResearchArgs | DelegateUiAuditArgs;
|
|
312
316
|
/** @experimental */
|
|
313
317
|
interface DelegationRecord {
|
|
314
318
|
taskId: string;
|
|
315
319
|
profile: DelegationProfile;
|
|
316
320
|
namespace?: string;
|
|
317
|
-
args:
|
|
321
|
+
args: AnyDelegateArgs;
|
|
318
322
|
status: DelegationStatus;
|
|
319
323
|
progress?: DelegationProgress;
|
|
320
324
|
result?: DelegationResultPayload;
|
|
@@ -328,7 +332,7 @@ interface DelegationRecord {
|
|
|
328
332
|
feedback: DelegationFeedbackSnapshot[];
|
|
329
333
|
}
|
|
330
334
|
/** @experimental */
|
|
331
|
-
interface SubmitInput<Args extends
|
|
335
|
+
interface SubmitInput<Args extends AnyDelegateArgs> {
|
|
332
336
|
profile: DelegationProfile;
|
|
333
337
|
args: Args;
|
|
334
338
|
namespace?: string;
|
|
@@ -369,7 +373,7 @@ declare class DelegationTaskQueue {
|
|
|
369
373
|
* Kick off a delegation in the background. Returns immediately. The
|
|
370
374
|
* `taskId` is queryable via `status` once this method returns.
|
|
371
375
|
*/
|
|
372
|
-
submit<Args extends
|
|
376
|
+
submit<Args extends AnyDelegateArgs>(input: SubmitInput<Args>): SubmitOutput;
|
|
373
377
|
/**
|
|
374
378
|
* Snapshot the current state of a delegation. Returns `undefined` for
|
|
375
379
|
* unknown ids so callers can distinguish missing from terminal.
|
|
@@ -436,10 +440,24 @@ interface McpServerOptions {
|
|
|
436
440
|
* `researcherProfile` / `multiHarnessResearcherFanout`).
|
|
437
441
|
*/
|
|
438
442
|
researcherDelegate?: ResearcherDelegate;
|
|
443
|
+
/**
|
|
444
|
+
* Required to enable delegate_ui_audit. Wire one that closes over your
|
|
445
|
+
* `runLoop` + `uiAuditorProfile` + a `SandboxClient` (the
|
|
446
|
+
* canonical in-process choice is `createInProcessUiAuditClient` from
|
|
447
|
+
* `@tangle-network/agent-runtime/profiles`) + your vision judge.
|
|
448
|
+
*/
|
|
449
|
+
uiAuditorDelegate?: UiAuditorDelegate;
|
|
439
450
|
/** Override the default in-memory feedback store. */
|
|
440
451
|
feedbackStore?: FeedbackStore;
|
|
441
452
|
/** Override the default in-memory task queue. */
|
|
442
453
|
queue?: DelegationTaskQueue;
|
|
454
|
+
/**
|
|
455
|
+
* Extra tools to serve alongside the delegation tools — e.g. the operator toolbox
|
|
456
|
+
* (`createCoordinationTools(...).tools`), which exposes the driver's spawn/observe/steer verbs over
|
|
457
|
+
* MCP so a sandbox agent can BE the driver. Registered after the built-ins; a duplicate name
|
|
458
|
+
* throws (fail loud — no silent shadowing of a delegation tool).
|
|
459
|
+
*/
|
|
460
|
+
extraTools?: McpToolDescriptor[];
|
|
443
461
|
/** Server display name surfaced via `initialize`. Default `'agent-runtime-mcp'`. */
|
|
444
462
|
serverName?: string;
|
|
445
463
|
/** Server version surfaced via `initialize`. Default = the package version baked at build time. */
|
|
@@ -506,6 +524,142 @@ declare function createInProcessTransport(): {
|
|
|
506
524
|
readServer(): Promise<JsonRpcResponse[]>;
|
|
507
525
|
};
|
|
508
526
|
|
|
527
|
+
/**
|
|
528
|
+
* @experimental
|
|
529
|
+
*
|
|
530
|
+
* The trace-analyst KIND directory — the operator's lenses, as composable DATA.
|
|
531
|
+
*
|
|
532
|
+
* An analyst is not one question. A kind is ONE lens (completeness, correctness, policy, efficiency,
|
|
533
|
+
* tool-use, …); each emits `AnalystFinding`s tagged by its `area`. The driver `list_analysts` to see
|
|
534
|
+
* the menu, `run_analyst(kind, worker)` to apply a lens, and `define_analyst` to author a new one —
|
|
535
|
+
* so at test time you compose the exact lenses a domain needs (maximum specificity), not one generic
|
|
536
|
+
* reviewer. The kinds are data, the runner is generic, and the finding shape + firewall are reused
|
|
537
|
+
* from agent-eval / the keystone — never re-derived.
|
|
538
|
+
*
|
|
539
|
+
* A kind here is a lightweight lens (`Check`); it is a deliberate SUBSET of agent-eval's full
|
|
540
|
+
* `TraceAnalystKindSpec`, so a kind that needs the heavy agentic actor (sub-agent recursion, tools,
|
|
541
|
+
* goldens) upgrades to `createTraceAnalystKind` without changing this directory's surface.
|
|
542
|
+
*/
|
|
543
|
+
|
|
544
|
+
/** One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is
|
|
545
|
+
* upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. */
|
|
546
|
+
interface Check {
|
|
547
|
+
readonly id: string;
|
|
548
|
+
readonly description: string;
|
|
549
|
+
/** Coarse classification stamped on every finding this kind emits (the renderer groups by it). */
|
|
550
|
+
readonly area: string;
|
|
551
|
+
readonly version: string;
|
|
552
|
+
/** The lens — what this analyst looks for in the trace. */
|
|
553
|
+
readonly lookFor: string;
|
|
554
|
+
}
|
|
555
|
+
/** The built-in lens directory. Domain-blind (about any agent trace); compose at test time. */
|
|
556
|
+
declare const defaultChecks: Record<string, Check>;
|
|
557
|
+
/** Lift validated raw rows into `AnalystFinding`s (agent-eval `makeFinding` stamps `finding_id`/
|
|
558
|
+
* `produced_at`), then enforce the trace-derived firewall (selector ≠ judge). Pure — no LLM. */
|
|
559
|
+
declare function liftFindings(kind: Check, rows: unknown[], producedAt: string): AnalystFinding[];
|
|
560
|
+
/** Render a worker's trace (tool calls + results) into the text an analyst lens reads. Generic over
|
|
561
|
+
* the trace shape: a `{ messages }` conversation, a bare message array, else stringified. */
|
|
562
|
+
declare function renderTrace(trace: unknown): string;
|
|
563
|
+
interface CheckRunnerOptions {
|
|
564
|
+
routerBaseUrl: string;
|
|
565
|
+
routerKey: string;
|
|
566
|
+
model: string;
|
|
567
|
+
/** Test/override seam — replace the LLM call. Default: a router chat completion. */
|
|
568
|
+
chat?: (system: string, user: string) => Promise<string>;
|
|
569
|
+
}
|
|
570
|
+
/** Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval
|
|
571
|
+
* finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. */
|
|
572
|
+
declare function runCheck(kind: Check, trace: unknown, opts: CheckRunnerOptions, producedAt: string): Promise<AnalystFinding[]>;
|
|
573
|
+
/** Build a `run_analyst` runner over a kind directory — the seam the operator toolbox is wired with.
|
|
574
|
+
* Returns the findings, or a typed error for an unknown kind. `producedAt` is passed in (the runtime
|
|
575
|
+
* forbids `Date.now` in replay-safe paths; the caller stamps it). */
|
|
576
|
+
declare function makeCheckRunner(kinds: Record<string, Check>, opts: CheckRunnerOptions): (kindId: string, trace: unknown, producedAt: string) => Promise<AnalystFinding[] | {
|
|
577
|
+
error: string;
|
|
578
|
+
}>;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* @experimental
|
|
582
|
+
*
|
|
583
|
+
* COORDINATION TOOLS — the verbs a parent agent uses to coordinate the child agents it spawns,
|
|
584
|
+
* exposed as MCP tools backed by a live keystone `Scope`. This is `Scope`-as-MCP.
|
|
585
|
+
*
|
|
586
|
+
* NOT a transport. The cross-org message bus (`docs/agent-bus-protocol.md`) and the SDK's
|
|
587
|
+
* `dispatchPrompt`/`SessionMessage` are the *transports* the `steer` verb rides; THIS file is the
|
|
588
|
+
* verb set (the API). One verb, several bindings: in-process `Scope.send` is a direct call; across
|
|
589
|
+
* sandboxes it rides SDK session-messaging; across orgs it rides the agent-bus protocol.
|
|
590
|
+
*
|
|
591
|
+
* spawn_worker → scope.spawn (budget-bounded, fail-closed — equal-k holds even for an LLM driver)
|
|
592
|
+
* await_next → scope.next (THE wake event: block until the next spawned child settles)
|
|
593
|
+
* observe_worker→ scope.view + the result blob (a child's status, spend, and settled output)
|
|
594
|
+
* steer_worker → scope.send (deliver a next-instruction / interrupt to a RUNNING child)
|
|
595
|
+
* list_analysts → the check menu (the trace lenses the agent can apply — see checks.ts)
|
|
596
|
+
* run_analyst → apply a CHECK (run a kind over a child's trace → trace-derived findings)
|
|
597
|
+
* stop → declare the run complete (the terminal move)
|
|
598
|
+
*
|
|
599
|
+
* The check verbs are present only when the check seam (`analystKinds` + `runAnalyst`) is wired —
|
|
600
|
+
* an agent that does not review traces (a pure dispatcher) omits them. A trace check is a SEPARATE
|
|
601
|
+
* lens (selector ≠ judge: it reads the trace, never the score); authoring a NEW check at runtime is
|
|
602
|
+
* the next addition.
|
|
603
|
+
*
|
|
604
|
+
* A worker the driver spawns may itself carry the driver profile — `spawn_worker` does not care what
|
|
605
|
+
* the profile is, so drivers-of-drivers fall out for free (each sub-driver gets its own sub-scope,
|
|
606
|
+
* bounded by `maxDepth` + the conserved pool).
|
|
607
|
+
*/
|
|
608
|
+
|
|
609
|
+
/** A worker the driver has drained via `await_next` — the operator's running ledger of settled
|
|
610
|
+
* workers + their DEPLOYABLE verdict (the driver IS the selector, so it legitimately reads the
|
|
611
|
+
* verdict; the analyst, which reads only the trace, is the separate selector≠judge lens). The
|
|
612
|
+
* driver picks its deliverable from this ledger at `stop`. */
|
|
613
|
+
interface SettledWorker {
|
|
614
|
+
readonly id: string;
|
|
615
|
+
readonly status: 'done' | 'down';
|
|
616
|
+
/** Deployable score in [0,1] from the worker's verdict (done only). */
|
|
617
|
+
readonly score?: number;
|
|
618
|
+
/** Whether the deployable verdict passed (done only). */
|
|
619
|
+
readonly valid?: boolean;
|
|
620
|
+
/** Result-blob pointer for the worker's output/trace (done only). */
|
|
621
|
+
readonly outRef?: string;
|
|
622
|
+
/** Failure reason (down only). */
|
|
623
|
+
readonly reason?: string;
|
|
624
|
+
}
|
|
625
|
+
/** How a `spawn_worker` profile becomes a spawnable leaf `Agent`. The caller wires this (e.g. the
|
|
626
|
+
* surface registry turns a profile into a shot executor) so the toolbox stays domain-blind. */
|
|
627
|
+
type MakeWorkerAgent = (profile: unknown) => Agent<unknown, unknown>;
|
|
628
|
+
interface CoordinationToolsOptions {
|
|
629
|
+
/** The DRIVER's live scope — spawn/observe/steer all act on this. */
|
|
630
|
+
readonly scope: Scope<unknown>;
|
|
631
|
+
/** Result blobs, so `observe_worker` can rehydrate a settled worker's output. */
|
|
632
|
+
readonly blobs: ResultBlobStore;
|
|
633
|
+
/** Turn a spawn_worker `profile` into a leaf agent (registry-resolved on spawn). */
|
|
634
|
+
readonly makeWorkerAgent: MakeWorkerAgent;
|
|
635
|
+
/** Per-worker conserved budget the driver reserves on each spawn. */
|
|
636
|
+
readonly perWorker: Budget;
|
|
637
|
+
/** The analyst lens menu (for `list_analysts`) — id + one-line + area. Injected so the toolbox
|
|
638
|
+
* stays domain-blind; wire it from `analyst-kinds.ts`'s directory. Omit to disable analyst tools. */
|
|
639
|
+
readonly analystKinds?: ReadonlyArray<{
|
|
640
|
+
id: string;
|
|
641
|
+
description: string;
|
|
642
|
+
area: string;
|
|
643
|
+
}>;
|
|
644
|
+
/** Run a lens over a worker's trace → findings (or a typed error). Wire it from
|
|
645
|
+
* `makeCheckRunner(...)`. `run_analyst` fetches the worker's settled output and passes it here. */
|
|
646
|
+
readonly runAnalyst?: (kindId: string, trace: unknown) => Promise<unknown>;
|
|
647
|
+
}
|
|
648
|
+
interface CoordinationTools {
|
|
649
|
+
/** MCP tools — register on an `McpServer`, or call the handlers directly in-process. */
|
|
650
|
+
readonly tools: McpToolDescriptor[];
|
|
651
|
+
/** True once the driver called `stop` — the operator loop reads this to terminate. */
|
|
652
|
+
isStopped(): boolean;
|
|
653
|
+
/** The reason passed to `stop`, if any. */
|
|
654
|
+
stopReason(): string | undefined;
|
|
655
|
+
/** The workers drained so far via `await_next` (the driver's selection ledger). */
|
|
656
|
+
settled(): ReadonlyArray<SettledWorker>;
|
|
657
|
+
}
|
|
658
|
+
/** Build the operator toolbox over a live scope. The tools are the driver's verbs; their handlers
|
|
659
|
+
* are thin wrappers over the keystone (spawn/view/send), so the budget/journal/abort discipline of
|
|
660
|
+
* the Supervisor applies to a sandbox driver exactly as to the in-process one. */
|
|
661
|
+
declare function createCoordinationTools(opts: CoordinationToolsOptions): CoordinationTools;
|
|
662
|
+
|
|
509
663
|
/**
|
|
510
664
|
* @experimental
|
|
511
665
|
*
|
|
@@ -750,6 +904,125 @@ interface DelegateResearchHandlerOptions {
|
|
|
750
904
|
/** @experimental */
|
|
751
905
|
declare function createDelegateResearchHandler(options: DelegateResearchHandlerOptions): (raw: unknown) => Promise<DelegateResearchResult>;
|
|
752
906
|
|
|
907
|
+
/**
|
|
908
|
+
* @experimental
|
|
909
|
+
*
|
|
910
|
+
* `delegate_ui_audit` MCP tool — async kickoff for UI audit runs. Same
|
|
911
|
+
* async semantics as `delegate_code` / `delegate_research`: validates the
|
|
912
|
+
* input, computes an idempotency key over the canonical fields, hands
|
|
913
|
+
* the task to the queue, and returns a taskId. Identical inputs return
|
|
914
|
+
* the same taskId.
|
|
915
|
+
*
|
|
916
|
+
* The handler does not import the auditor profile directly — consumers
|
|
917
|
+
* inject a `UiAuditorDelegate` via `createMcpServer({ uiAuditorDelegate })`.
|
|
918
|
+
* The delegate is the seam where the consumer chooses the judge (vision
|
|
919
|
+
* model) and the `SandboxClient` (in-process Playwright vs fleet vs
|
|
920
|
+
* remote browser). agent-runtime ships the in-process client under
|
|
921
|
+
* `./profiles` so consumers who want the canonical setup can wire it
|
|
922
|
+
* with a few lines.
|
|
923
|
+
*/
|
|
924
|
+
|
|
925
|
+
/** @experimental */
|
|
926
|
+
declare const DELEGATE_UI_AUDIT_TOOL_NAME = "delegate_ui_audit";
|
|
927
|
+
/** @experimental */
|
|
928
|
+
declare const DELEGATE_UI_AUDIT_DESCRIPTION: string;
|
|
929
|
+
/** @experimental */
|
|
930
|
+
declare const DELEGATE_UI_AUDIT_INPUT_SCHEMA: {
|
|
931
|
+
readonly type: "object";
|
|
932
|
+
readonly properties: {
|
|
933
|
+
readonly workspaceDir: {
|
|
934
|
+
readonly type: "string";
|
|
935
|
+
readonly description: "Absolute path for the audit workspace.";
|
|
936
|
+
};
|
|
937
|
+
readonly routes: {
|
|
938
|
+
readonly type: "array";
|
|
939
|
+
readonly items: {
|
|
940
|
+
readonly type: "object";
|
|
941
|
+
readonly properties: {
|
|
942
|
+
readonly name: {
|
|
943
|
+
readonly type: "string";
|
|
944
|
+
readonly description: "Stable route name (used in screenshot filenames).";
|
|
945
|
+
};
|
|
946
|
+
readonly url: {
|
|
947
|
+
readonly type: "string";
|
|
948
|
+
readonly description: "Fully-qualified URL.";
|
|
949
|
+
};
|
|
950
|
+
readonly viewports: {
|
|
951
|
+
readonly type: "array";
|
|
952
|
+
readonly items: {
|
|
953
|
+
readonly type: "object";
|
|
954
|
+
readonly properties: {
|
|
955
|
+
readonly width: {
|
|
956
|
+
readonly type: "integer";
|
|
957
|
+
readonly minimum: 1;
|
|
958
|
+
};
|
|
959
|
+
readonly height: {
|
|
960
|
+
readonly type: "integer";
|
|
961
|
+
readonly minimum: 1;
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
readonly required: readonly ["width", "height"];
|
|
965
|
+
readonly additionalProperties: false;
|
|
966
|
+
};
|
|
967
|
+
readonly description: "Viewports to capture at. Default [{1280, 800}].";
|
|
968
|
+
};
|
|
969
|
+
readonly fullPage: {
|
|
970
|
+
readonly type: "boolean";
|
|
971
|
+
};
|
|
972
|
+
readonly waitFor: {
|
|
973
|
+
readonly type: "string";
|
|
974
|
+
readonly description: "CSS selector to wait for before capturing.";
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
readonly required: readonly ["name", "url"];
|
|
978
|
+
readonly additionalProperties: false;
|
|
979
|
+
};
|
|
980
|
+
readonly minItems: 1;
|
|
981
|
+
};
|
|
982
|
+
readonly namespace: {
|
|
983
|
+
readonly type: "string";
|
|
984
|
+
readonly description: "Multi-tenant scope.";
|
|
985
|
+
};
|
|
986
|
+
readonly config: {
|
|
987
|
+
readonly type: "object";
|
|
988
|
+
readonly properties: {
|
|
989
|
+
readonly lenses: {
|
|
990
|
+
readonly type: "array";
|
|
991
|
+
readonly items: {
|
|
992
|
+
readonly type: "string";
|
|
993
|
+
readonly enum: readonly UiLens[];
|
|
994
|
+
};
|
|
995
|
+
readonly description: "Lenses to iterate. Default: every lens except \"other\".";
|
|
996
|
+
};
|
|
997
|
+
readonly maxIterations: {
|
|
998
|
+
readonly type: "integer";
|
|
999
|
+
readonly minimum: 1;
|
|
1000
|
+
};
|
|
1001
|
+
readonly maxConcurrency: {
|
|
1002
|
+
readonly type: "integer";
|
|
1003
|
+
readonly minimum: 1;
|
|
1004
|
+
};
|
|
1005
|
+
readonly productContext: {
|
|
1006
|
+
readonly type: "string";
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
readonly additionalProperties: false;
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
readonly required: readonly ["workspaceDir", "routes"];
|
|
1013
|
+
readonly additionalProperties: false;
|
|
1014
|
+
};
|
|
1015
|
+
/** @experimental */
|
|
1016
|
+
declare function validateDelegateUiAuditArgs(raw: unknown): DelegateUiAuditArgs;
|
|
1017
|
+
/** @experimental */
|
|
1018
|
+
interface DelegateUiAuditHandlerOptions {
|
|
1019
|
+
queue: DelegationTaskQueue;
|
|
1020
|
+
delegate: UiAuditorDelegate;
|
|
1021
|
+
estimateDurationMs?: (args: DelegateUiAuditArgs) => number;
|
|
1022
|
+
}
|
|
1023
|
+
/** @experimental */
|
|
1024
|
+
declare function createDelegateUiAuditHandler(options: DelegateUiAuditHandlerOptions): (raw: unknown) => Promise<DelegateUiAuditResult>;
|
|
1025
|
+
|
|
753
1026
|
/**
|
|
754
1027
|
* @experimental
|
|
755
1028
|
*
|
|
@@ -874,4 +1147,4 @@ declare function createPropagatingTraceEmitter(ctx: TraceContext): {
|
|
|
874
1147
|
*/
|
|
875
1148
|
declare function traceContextToEnv(ctx: TraceContext): Record<string, string>;
|
|
876
1149
|
|
|
877
|
-
export { CoderDelegate, type CreateWorktreeOptions, DELEGATE_CODE_DESCRIPTION, DELEGATE_CODE_INPUT_SCHEMA, DELEGATE_CODE_TOOL_NAME, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_RESEARCH_DESCRIPTION, DELEGATE_RESEARCH_INPUT_SCHEMA, DELEGATE_RESEARCH_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DelegateCodeArgs, DelegateCodeResult, DelegateFeedbackArgs, DelegateFeedbackResult, DelegateResearchArgs, DelegateResearchResult, DelegationError, DelegationExecutor, DelegationFeedbackSnapshot, DelegationHistoryArgs, DelegationHistoryEntry, DelegationHistoryResult, DelegationProfile, DelegationProgress, type DelegationRecord, DelegationResultPayload, DelegationStatus, DelegationStatusArgs, DelegationStatusResult, DelegationTaskQueue, type DelegationTaskQueueOptions, type DetectExecutorArgs, type DiffOptions, type DiffResult, type FeedbackEvent, type FeedbackStore, FleetHandle, type GitRunner, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, LocalHarness, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type RemoveWorktreeOptions, ResearchSource, ResearcherDelegate, type SubmitInput, type SubmitOutput, type TraceContext, type WorktreeHandle, captureWorktreeDiff, createDelegateCodeHandler, createDelegateFeedbackHandler, createDelegateResearchHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createInProcessExecutor, createInProcessTransport, createMcpServer, createPropagatingTraceEmitter, createWorktree, detectExecutor, eventToSnapshot, hashIdempotencyInput, readTraceContextFromEnv, removeWorktree, runLocalHarness, traceContextToEnv, validateDelegateCodeArgs, validateDelegateFeedbackArgs, validateDelegateResearchArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
|
|
1150
|
+
export { type Check, type CheckRunnerOptions, CoderDelegate, type CoordinationTools, type CoordinationToolsOptions, type CreateWorktreeOptions, DELEGATE_CODE_DESCRIPTION, DELEGATE_CODE_INPUT_SCHEMA, DELEGATE_CODE_TOOL_NAME, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_RESEARCH_DESCRIPTION, DELEGATE_RESEARCH_INPUT_SCHEMA, DELEGATE_RESEARCH_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DelegateCodeArgs, DelegateCodeResult, DelegateFeedbackArgs, DelegateFeedbackResult, DelegateResearchArgs, DelegateResearchResult, DelegateUiAuditArgs, DelegateUiAuditResult, DelegationError, DelegationExecutor, DelegationFeedbackSnapshot, DelegationHistoryArgs, DelegationHistoryEntry, DelegationHistoryResult, DelegationProfile, DelegationProgress, type DelegationRecord, DelegationResultPayload, DelegationStatus, DelegationStatusArgs, DelegationStatusResult, DelegationTaskQueue, type DelegationTaskQueueOptions, type DetectExecutorArgs, type DiffOptions, type DiffResult, type FeedbackEvent, type FeedbackStore, FleetHandle, type GitRunner, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, LocalHarness, type MakeWorkerAgent, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type RemoveWorktreeOptions, ResearchSource, ResearcherDelegate, type SettledWorker, type SubmitInput, type SubmitOutput, type TraceContext, UiAuditorDelegate, type WorktreeHandle, captureWorktreeDiff, createCoordinationTools, createDelegateCodeHandler, createDelegateFeedbackHandler, createDelegateResearchHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createInProcessExecutor, createInProcessTransport, createMcpServer, createPropagatingTraceEmitter, createWorktree, defaultChecks, detectExecutor, eventToSnapshot, hashIdempotencyInput, liftFindings, makeCheckRunner, readTraceContextFromEnv, removeWorktree, renderTrace, runCheck, runLocalHarness, traceContextToEnv, validateDelegateCodeArgs, validateDelegateFeedbackArgs, validateDelegateResearchArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
|