@tangle-network/agent-runtime 0.121.0 → 0.123.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/dist/{activation-DdIpwQ0k.js → activation-B7sTehZB.js} +3 -3
- package/dist/{activation-DdIpwQ0k.js.map → activation-B7sTehZB.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-DDkSRPjY.js → candidate-execution-BFpq-Xi6.js} +4 -4
- package/dist/{candidate-execution-DDkSRPjY.js.map → candidate-execution-BFpq-Xi6.js.map} +1 -1
- package/dist/{environment-provider-Bh4nX2qt.d.ts → environment-provider-CEjwunXO.d.ts} +105 -11
- package/dist/{environment-provider-DChfYm2-.js → environment-provider-CY22kUQH.js} +4 -85
- package/dist/environment-provider-CY22kUQH.js.map +1 -0
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-cycle-zjR-MXwK.js → improvement-cycle-BcwsSbT-.js} +4 -4
- package/dist/{improvement-cycle-zjR-MXwK.js.map → improvement-cycle-BcwsSbT-.js.map} +1 -1
- package/dist/{index-I35151Fr.d.ts → index-BKSzgMvA.d.ts} +5 -5
- package/dist/{index-BLsKcxNd.d.ts → index-CKply5aj.d.ts} +3 -3
- package/dist/{index-CGADWaa_.d.ts → index-CyXinqJw.d.ts} +1213 -849
- package/dist/index.d.ts +6 -6
- package/dist/index.js +12 -12
- package/dist/intelligence.d.ts +1 -1
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-B1B3BsQZ.js → knowledge-Cuvb21T7.js} +5 -5
- package/dist/{knowledge-B1B3BsQZ.js.map → knowledge-Cuvb21T7.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-BeG9vTdE.d.ts → loop-runner-bin-BjnNpN5m.d.ts} +3 -3
- package/dist/{loop-runner-bin-CXJWdfJ4.js → loop-runner-bin-Clhj8gy5.js} +3 -3
- package/dist/{loop-runner-bin-CXJWdfJ4.js.map → loop-runner-bin-Clhj8gy5.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +5 -5
- package/dist/{openai-tools-CVgLNp04.js → openai-tools-BwTsBfd-.js} +2 -2
- package/dist/{openai-tools-CVgLNp04.js.map → openai-tools-BwTsBfd-.js.map} +1 -1
- package/dist/{prepare-DpV6np9e.js → prepare--8EvLqCr.js} +2 -2
- package/dist/{prepare-DpV6np9e.js.map → prepare--8EvLqCr.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-vQLBRoAQ.js → protected-model-port-CXVfOUu_.js} +2 -2
- package/dist/{protected-model-port-vQLBRoAQ.js.map → protected-model-port-CXVfOUu_.js.map} +1 -1
- package/dist/{runtime-Bp3NwC0A.js → runtime-OI7oLLec.js} +463 -52
- package/dist/runtime-OI7oLLec.js.map +1 -0
- package/dist/{spawn-journal-IeXpidO2.js → spawn-journal-DsZKDqeh.js} +5 -3
- package/dist/spawn-journal-DsZKDqeh.js.map +1 -0
- package/dist/{structural-rollout-DQHO3b2Y.js → structural-rollout-C4Jv_7vt.js} +3 -3
- package/dist/{structural-rollout-DQHO3b2Y.js.map → structural-rollout-C4Jv_7vt.js.map} +1 -1
- package/dist/{supervise-BHHMtwP9.js → supervise-Dwq16u8n.js} +451 -55
- package/dist/supervise-Dwq16u8n.js.map +1 -0
- package/dist/{supervisor-CpT9yAxL.js → supervisor-DjZ82HIB.js} +166 -23
- package/dist/supervisor-DjZ82HIB.js.map +1 -0
- package/dist/testing.js +12 -12
- package/dist/{workspace-archive-B4SkNJjw.js → workspace-archive-BQxvkypI.js} +2 -2
- package/dist/{workspace-archive-B4SkNJjw.js.map → workspace-archive-BQxvkypI.js.map} +1 -1
- package/package.json +10 -9
- package/dist/environment-provider-DChfYm2-.js.map +0 -1
- package/dist/runtime-Bp3NwC0A.js.map +0 -1
- package/dist/spawn-journal-IeXpidO2.js.map +0 -1
- package/dist/supervise-BHHMtwP9.js.map +0 -1
- package/dist/supervisor-CpT9yAxL.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { d as AgentTaskStatus, f as BackendErrorDetail, i as AgentExecutionBacke
|
|
|
2
2
|
import { n as AnalystRegistryLike } from "./types-zWfqDjeL.js";
|
|
3
3
|
import { l as RuntimeHooks } from "./runtime-hooks-sbRpjStq.js";
|
|
4
4
|
import { C as MountRecorder, D as SelectionReceipt, E as SandboxClient, a as Iteration, b as LoopTraceEvent, d as LoopLineageOptions, i as ExecCtx, k as Validator, m as LoopResult, r as Driver, t as AgentRunSpec, w as OutputAdapter, x as LoopWinner, y as LoopTraceEmitter } from "./types-DnNGJ5Gz.js";
|
|
5
|
-
import { B as DefaultVerdict, Cn as
|
|
5
|
+
import { B as DefaultVerdict, Cn as PendingWait, Ct as SupervisedResult, En as WaitProbeRegistry, Et as TreeView, Gn as ExecutorProgress, H as Executor, I as Agent, K as ExecutorFactory, L as AgentExecutionRef, Nt as WorkerTraceResolver, Ot as UsageEvent, R as AgentSpec, Rn as TraceSource, Rt as TraceContext, St as SteerableRootHandle, V as ExecutionBindingReceipt, Xt as OtelExportConfig, Y as ExecutorRegistry, Zt as OtelExporter, _t as SpawnJournal, at as ProfileMaterializationReceipt, ct as ResumedKeyState, gt as SpawnEvent, ht as Settled, i as AgentEnvironmentProvider, jt as WorkerTraceEvidence, mt as Scope, nt as NodeId, o as AgentEnvironmentProviderRegistry, pt as Runtime, qn as WorkerProgress, rt as NodeSnapshot, st as ResultBlobStore, tt as NodeExecutionIdentity, ut as RootHandle, vt as SpawnOpts, w as ProviderExecutorOptions, wt as Supervisor, xt as Spend, z as Budget } from "./environment-provider-CEjwunXO.js";
|
|
6
6
|
import { o as UiLens, r as UiFinding, s as CoderTask } from "./substrate-BcnuSHXm.js";
|
|
7
7
|
import { E as ToolLoopCompactionOptions, f as runLocalHarness, h as RouterConfig, n as CodexExecutionPolicy, o as LocalHarness, r as CodexTokenUsage, v as ToolSpec, w as ToolLoopChat } from "./local-harness-BIajef4A.js";
|
|
8
8
|
import { AgentEvalError, AgentEvalError as AgentEvalError$1, AgentEvalErrorCode, AgentProfile, AnalystFinding, AnalystFinding as AnalystFinding$1, AnalystFinding as AnalystFinding$2, AnalystRunInputs, ChatClient, ConfigError, DetectorSignal, HarnessType, JudgeError, MaximumCharge, NotFoundError, ProposalFinding, RankTestMethod, RunRecord, StreamingDetector, ToolSpan, TraceAnalysisStore, ValidationError, buildTrajectory, computeFindingId as computeFindingId$1, makeFinding as makeFinding$1 } from "@tangle-network/agent-eval";
|
|
@@ -2017,7 +2017,24 @@ interface SandboxSeam {
|
|
|
2017
2017
|
*/
|
|
2018
2018
|
steering?: SandboxSteeringOptions;
|
|
2019
2019
|
}
|
|
2020
|
-
/**
|
|
2020
|
+
/**
|
|
2021
|
+
* UNMETERED CLI subprocess seam. `bin` + `args` describe the process to spawn.
|
|
2022
|
+
*
|
|
2023
|
+
* READ THIS BEFORE CHOOSING `backend: 'cli'`. This backend pipes a prompt to a subprocess's stdin
|
|
2024
|
+
* and reads its stdout. It has no usage receipt of any kind, so it reports its spend with
|
|
2025
|
+
* `Spend.tokensKnown: false`: the work is recorded, its `{0,0}` tokens and `$0` are a FLOOR rather
|
|
2026
|
+
* than a measurement, and a ceiling priced from either is a ceiling that cannot fire. The executor
|
|
2027
|
+
* is also `budgetExempt: true`, which is why `driveHarnessFromBackend` refuses it outright rather
|
|
2028
|
+
* than pretending to budget it.
|
|
2029
|
+
*
|
|
2030
|
+
* If you need a metered harness worker, use `backend: 'bridge'` (a cli-bridge session, which
|
|
2031
|
+
* reports the harness's real per-turn tokens and cost) or `backend: 'cli-worktree'` with
|
|
2032
|
+
* `codexReproducible`. Reach for this seam only when the subprocess genuinely is not an inference
|
|
2033
|
+
* agent, or when you have accepted that its cost is invisible.
|
|
2034
|
+
*
|
|
2035
|
+
* `args` is argv for a LOCAL, in-process spawn under this process's own privileges. It is not a
|
|
2036
|
+
* remote channel and nothing forwards it over a wire.
|
|
2037
|
+
*/
|
|
2021
2038
|
interface CliSeam {
|
|
2022
2039
|
bin: string;
|
|
2023
2040
|
args?: string[];
|
|
@@ -2084,6 +2101,40 @@ interface CliWorktreeBridgeSeam {
|
|
|
2084
2101
|
* harness conversation across turns; each turn also receives its own durable run id.
|
|
2085
2102
|
* A dropped HTTP reader reattaches to that exact run and explicit cancel is the only
|
|
2086
2103
|
* operation allowed to stop it. Omit `sessionId` and the executor mints one per spawn.
|
|
2104
|
+
*
|
|
2105
|
+
* ── HOW TO CONTROL WHAT THE HARNESS LOADS (there is no argv field, by design) ──
|
|
2106
|
+
*
|
|
2107
|
+
* A worker often needs the harness started in a KNOWN state — no ambient extensions, skills,
|
|
2108
|
+
* context files, or prompt templates — because ambient state is how a paired experiment silently
|
|
2109
|
+
* loses its pairing: an installed extension that persists memory across runs carries arm A's state
|
|
2110
|
+
* into arm B, and nothing reports it.
|
|
2111
|
+
*
|
|
2112
|
+
* That is what the `AgentProfile` on this seam (and on the spawn spec) is FOR. `agent_profile`
|
|
2113
|
+
* rides every request verbatim, and cli-bridge maps it onto each harness's own native controls:
|
|
2114
|
+
*
|
|
2115
|
+
* - Materializing any profile at all already starts the harness isolated from ambient
|
|
2116
|
+
* workspace state — for pi that is `--no-context-files --no-skills --no-prompt-templates`,
|
|
2117
|
+
* applied to every request that carries an `agent_profile`.
|
|
2118
|
+
* - `AgentProfile.extensions.<harness>` is the named, per-harness control channel. An explicit
|
|
2119
|
+
* `extensions: { pi: { load: [] } }` disables ambient extension discovery outright
|
|
2120
|
+
* (pi's `--no-extensions`); listing package names loads exactly those and nothing else.
|
|
2121
|
+
* - `permissions` / `tools` / `mcp` map onto the harness's native tool and server controls.
|
|
2122
|
+
*
|
|
2123
|
+
* A caller therefore does NOT need to hand-roll an `Executor` to isolate a harness run, and the
|
|
2124
|
+
* profile expressing it stays portable: the same declaration means the same thing on a different
|
|
2125
|
+
* harness, whereas an argv string means nothing anywhere else.
|
|
2126
|
+
*
|
|
2127
|
+
* WHY NOT A GENERAL ARGV PASSTHROUGH. `bridgeUrl` addresses a process-spawning server. Forwarding
|
|
2128
|
+
* an arbitrary argv array to it would let any caller holding a bearer token choose the flags of a
|
|
2129
|
+
* process on the bridge host — which for real harness CLIs includes flags that load code from a
|
|
2130
|
+
* path, read a file into the prompt, redirect the working directory, or turn off the isolation the
|
|
2131
|
+
* bridge applies. cli-bridge deliberately confines workers (a filesystem jail and deny-by-default
|
|
2132
|
+
* network egress), and every one of those confinements is expressed as spawn configuration, so an
|
|
2133
|
+
* argv channel is a channel for unwinding them. It would also break this executor's own contract:
|
|
2134
|
+
* the durable-run replay protocol, session pinning, and streaming mode are all argv the bridge
|
|
2135
|
+
* owns, and a caller-supplied duplicate silently wins or corrupts the parse. The structured profile
|
|
2136
|
+
* channel is validated, per-harness, portable, and refuses controls it does not understand — keep
|
|
2137
|
+
* new harness capability there.
|
|
2087
2138
|
*/
|
|
2088
2139
|
interface BridgeSeam {
|
|
2089
2140
|
bridgeUrl: string;
|
|
@@ -2418,8 +2469,46 @@ interface AnalystRegistry {
|
|
|
2418
2469
|
interface AnalystFindingEvent {
|
|
2419
2470
|
readonly fromWorker: string;
|
|
2420
2471
|
readonly analyst: string;
|
|
2421
|
-
|
|
2422
|
-
|
|
2472
|
+
/** The analyst's result. ABSENT when the analyst returned `undefined` (no findings); any other
|
|
2473
|
+
* value is canonicalized to finite RFC 8785 JSON at publish (`canonicalFindingEvent`), so
|
|
2474
|
+
* digesting subscribers (the coordination-event id) never throw on analyst-shaped data. */
|
|
2475
|
+
readonly findings?: unknown;
|
|
2476
|
+
}
|
|
2477
|
+
/** Producer-side cleanliness for the `finding` event. The findings payload is arbitrary analyst
|
|
2478
|
+
* output, the digest a subscriber computes (RFC 8785) throws on ANY `undefined` value — nested
|
|
2479
|
+
* included — and a throwing subscriber leaves the event invisible to EVERY subscriber. The
|
|
2480
|
+
* producer, not the digest, owns keeping the event canonical: an `undefined` payload is stripped
|
|
2481
|
+
* to key-absence, everything else is JSON round-tripped (nested `undefined` object values drop,
|
|
2482
|
+
* `undefined` array slots become `null`), and a payload JSON cannot represent at all (cycle,
|
|
2483
|
+
* BigInt, bare function) becomes a record OF that fact — degraded findings beat a vanished
|
|
2484
|
+
* event. */
|
|
2485
|
+
declare function canonicalFindingEvent(finding: AnalystFindingEvent): AnalystFindingEvent;
|
|
2486
|
+
/**
|
|
2487
|
+
* One analyst-on-settle ROUTE: which lens runs (`kind`), over WHICH settled workers (`over`),
|
|
2488
|
+
* delivered to WHOM (`to`), wrapped in WHAT standing instruction (`directive`). The generalized
|
|
2489
|
+
* form of the bare-string entry — a string `k` is exactly `{ kind: k }`: every settle feeds the
|
|
2490
|
+
* lens and the findings go to the driver via the bus. This is the analyzes-edge of an agent
|
|
2491
|
+
* graph expressed at the coordination layer; the finding is ALWAYS also published on the bus
|
|
2492
|
+
* (the audit trail), routing adds delivery, never replaces the record.
|
|
2493
|
+
*/
|
|
2494
|
+
interface AnalyzeOnSettleRoute {
|
|
2495
|
+
/** The analyst lens id (resolved against the `analysts` registry). */
|
|
2496
|
+
readonly kind: string;
|
|
2497
|
+
/** Deliver the findings to this live worker, named by its PROFILE NAME (the stable node
|
|
2498
|
+
* identity a graph pins) or its spawn label. Omit = the driver (bus only). Delivery goes
|
|
2499
|
+
* through the same authorization + steer machinery a driver-authored steer uses and is
|
|
2500
|
+
* recorded as a `steer` event carrying `analyst`, so a routed delivery is observable and a
|
|
2501
|
+
* failed one (`delivered: false`) is a recorded outcome, never a silent drop. */
|
|
2502
|
+
readonly to?: string;
|
|
2503
|
+
/** Standing instruction wrapped around the findings on a routed delivery — what the recipient
|
|
2504
|
+
* should DO with the analysis. Omit = the bare findings JSON. */
|
|
2505
|
+
readonly directive?: string;
|
|
2506
|
+
/** Restrict which settled workers feed this lens, by profile name or spawn label. Omit =
|
|
2507
|
+
* every settled `done` worker. */
|
|
2508
|
+
readonly over?: ReadonlyArray<string>;
|
|
2509
|
+
}
|
|
2510
|
+
/** Normalize the two spellings of an analyst-on-settle entry to the route form. */
|
|
2511
|
+
declare function normalizeAnalyzeOnSettle(entry: string | AnalyzeOnSettleRoute): AnalyzeOnSettleRoute;
|
|
2423
2512
|
/** The exact result of one parent→child delivery attempt. */
|
|
2424
2513
|
type DownMessageDeliveryOutcome = 'delivered' | 'unknown-worker' | 'already-settled' | 'runtime-has-no-inbox' | 'scope-stopped' | 'runtime-error';
|
|
2425
2514
|
/** A durable marker written after authorization and immediately before Runtime calls `Scope.send`.
|
|
@@ -2489,6 +2578,9 @@ type CoordinationEvent = {
|
|
|
2489
2578
|
} | {
|
|
2490
2579
|
readonly type: 'steer';
|
|
2491
2580
|
readonly down: DownMessageEvent;
|
|
2581
|
+
/** Present when this steer DELIVERED an analyst's routed findings (an analyzes-edge
|
|
2582
|
+
* traversal), naming the lens — absent on an ordinary driver-authored steer. */
|
|
2583
|
+
readonly analyst?: string;
|
|
2492
2584
|
} | {
|
|
2493
2585
|
readonly type: 'answer';
|
|
2494
2586
|
readonly down: DownMessageEvent;
|
|
@@ -2542,11 +2634,15 @@ interface CoordinationToolsOptions {
|
|
|
2542
2634
|
* detached, recorded durably through `onEvent`, and only then delivered. */
|
|
2543
2635
|
readonly authorizeDownMessage?: AuthorizeDownMessage;
|
|
2544
2636
|
readonly questionPolicy?: QuestionPolicy;
|
|
2545
|
-
/** Analyst
|
|
2546
|
-
*
|
|
2547
|
-
*
|
|
2548
|
-
*
|
|
2549
|
-
|
|
2637
|
+
/** Analyst lenses run AUTOMATICALLY when a worker settles `done` (the analyst-on-settle hook).
|
|
2638
|
+
* A bare string names a lens whose findings go to THE DRIVER: published as a `finding` event on
|
|
2639
|
+
* the bus — pass-through to subscribers and queued for `await_event`. An
|
|
2640
|
+
* {@link AnalyzeOnSettleRoute} generalizes the DESTINATION: findings can be delivered to a
|
|
2641
|
+
* named live WORKER (wrapped in the route's directive, through the same authorized steer
|
|
2642
|
+
* machinery a driver steer uses) instead of being hardwired to the spawning driver, and `over`
|
|
2643
|
+
* restricts which settled workers feed the lens. Omit/empty = no auto-analysis (default; the
|
|
2644
|
+
* driver can still run lenses on demand via `run_analyst`). Requires `analysts`. */
|
|
2645
|
+
readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
|
|
2550
2646
|
/** Hard cap on how many workers may be LIVE (spawned but not yet settled) at once. `spawn_agent`
|
|
2551
2647
|
* counts the scope's non-terminal nodes and fails closed (`error: 'max-live-workers'`) BEFORE
|
|
2552
2648
|
* reserving from the pool when the cap is already met — a concurrency fence on top of the
|
|
@@ -3159,7 +3255,7 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
|
|
|
3159
3255
|
* print (+ write) the ranked leaderboard markdown under the export dir. */
|
|
3160
3256
|
export?: (result: RunProfileMatrixResult<TArtifact, LeaderboardScenario<TCase>>, ctx: LeaderboardRunContext) => Promise<void> | void;
|
|
3161
3257
|
/** LEVEL 2 — full dispatch replacement (in-process products bring their own).
|
|
3162
|
-
* The default is `loopDispatch` +
|
|
3258
|
+
* The default is `loopDispatch` + the naive steering directive over the resolved backend. */
|
|
3163
3259
|
dispatch?: ProfileDispatchFn<LeaderboardScenario<TCase>, TArtifact>;
|
|
3164
3260
|
/** LEVEL 2 — full judge replacement. Default: `score` wrapped as one judge. */
|
|
3165
3261
|
judges?: JudgeConfig<TArtifact, LeaderboardScenario<TCase>>[];
|
|
@@ -5503,6 +5599,34 @@ declare function materializeLocalMcp(profile: AgentProfile$1, opts?: Materialize
|
|
|
5503
5599
|
* for another round). Identical to the reference refine driver's decision set.
|
|
5504
5600
|
*/
|
|
5505
5601
|
type SteeringDecision = 'refine' | 'pick-winner' | 'fail';
|
|
5602
|
+
/**
|
|
5603
|
+
* A steering POLICY as plain data — the delegates-edge directive form of the two control
|
|
5604
|
+
* drivers. `kind` names how much of the verdict the policy may read (the experimental axis);
|
|
5605
|
+
* the continuation strings are the payload. Because this is JSON-able data, it is versionable
|
|
5606
|
+
* in a prompt registry and attachable to a graph edge — the same policy that used to exist
|
|
5607
|
+
* only as a builder FUNCTION, which made it invisible to any optimizer. Default texts are
|
|
5608
|
+
* seeded in the kernel prompt registry (`delegates/naive-continuation`,
|
|
5609
|
+
* `delegates/dumb-continuation-pass` / `-fail`); a caller may carry its own.
|
|
5610
|
+
*/
|
|
5611
|
+
type SteeringDirectiveData = {
|
|
5612
|
+
/** Reads NOTHING from the verdict: one fixed continuation every round. */
|
|
5613
|
+
readonly kind: 'naive';
|
|
5614
|
+
readonly continuation: string;
|
|
5615
|
+
/** Hard traversal cap: the loop stops refining once history reaches this length. */
|
|
5616
|
+
readonly maxTraversals: number;
|
|
5617
|
+
} | {
|
|
5618
|
+
/** Reads ONLY `verdict.valid` (the boolean): one of two fixed continuations. */
|
|
5619
|
+
readonly kind: 'dumb';
|
|
5620
|
+
readonly onPass: string;
|
|
5621
|
+
readonly onFail: string;
|
|
5622
|
+
readonly maxTraversals: number;
|
|
5623
|
+
};
|
|
5624
|
+
/**
|
|
5625
|
+
* Interpret a {@link SteeringDirectiveData} as a loop `Driver` — the ONE interpreter both
|
|
5626
|
+
* control policies share. The directive is data; only `applyContinuation` (how the caller's
|
|
5627
|
+
* opaque Task carries a steering string) remains code, exactly as `taskToPrompt` does.
|
|
5628
|
+
*/
|
|
5629
|
+
declare function steeringDriver<Task, Output>(directive: SteeringDirectiveData, applyContinuation: ApplyContinuation<Task>, name?: string): Driver<Task, Output, SteeringDecision>;
|
|
5506
5630
|
/**
|
|
5507
5631
|
* Fold a steering string into the caller's Task shape, producing the Task for
|
|
5508
5632
|
* the next shot. The substrate never assumes how a Task carries its prompt, so
|
|
@@ -5538,6 +5662,10 @@ interface NaiveDriverOptions<Task> {
|
|
|
5538
5662
|
* attributable to the pass/fail bit, and any lift of `refine` over `dumb` is
|
|
5539
5663
|
* attributable to the grader's findings.
|
|
5540
5664
|
*/
|
|
5665
|
+
/** Thin compatibility wrapper over {@link steeringDriver} for the naive (no-signal) control.
|
|
5666
|
+
* @deprecated The policy is DATA now — build the directive and interpret it:
|
|
5667
|
+
* `steeringDriver({ kind: 'naive', continuation, maxTraversals }, applyContinuation)`. This
|
|
5668
|
+
* wrapper survives for existing callers and will be removed in the next major. */
|
|
5541
5669
|
declare function naiveDriver<Task, Output>(options: NaiveDriverOptions<Task>): Driver<Task, Output, SteeringDecision>;
|
|
5542
5670
|
/** Options for {@link dumbDriver}. */
|
|
5543
5671
|
interface DumbDriverOptions<Task> {
|
|
@@ -5571,6 +5699,10 @@ interface DumbDriverOptions<Task> {
|
|
|
5571
5699
|
* grader's `notes`, dumb reads only the pass/fail bit, so the difference is
|
|
5572
5700
|
* exactly the value the findings add over a bare boolean.
|
|
5573
5701
|
*/
|
|
5702
|
+
/** Thin compatibility wrapper over {@link steeringDriver} for the dumb (pass/fail-only) control.
|
|
5703
|
+
* @deprecated The policy is DATA now — build the directive and interpret it:
|
|
5704
|
+
* `steeringDriver({ kind: 'dumb', onPass, onFail, maxTraversals }, applyContinuation)`. This
|
|
5705
|
+
* wrapper survives for existing callers and will be removed in the next major. */
|
|
5574
5706
|
declare function dumbDriver<Task, Output>(options: DumbDriverOptions<Task>): Driver<Task, Output, SteeringDecision>;
|
|
5575
5707
|
//#endregion
|
|
5576
5708
|
//#region src/runtime/strategy-author.d.ts
|
|
@@ -6150,7 +6282,12 @@ declare function asAuthoredProfile(raw: unknown): AuthoredProfile | null;
|
|
|
6150
6282
|
*/
|
|
6151
6283
|
declare function canonicalizeAuthoredProfile(raw: unknown): AgentProfile$1;
|
|
6152
6284
|
/** The supervisor SKILL — the how-to the supervisor reads (its system prompt). THE optimizable
|
|
6153
|
-
* surface: editing this changes how the supervisor designs every agent it spawns.
|
|
6285
|
+
* surface: editing this changes how the supervisor designs every agent it spawns.
|
|
6286
|
+
*
|
|
6287
|
+
* The POLICY paragraph is the registry's one `supervisor/policy` entry — the same stance
|
|
6288
|
+
* `defaultSupervisorPrompt` carries — so both front doors run the same work-vs-delegate rule;
|
|
6289
|
+
* this function ADDS the profile-authoring skill (how to WRITE the workers it spawns), which is
|
|
6290
|
+
* additive craft, not a different policy. */
|
|
6154
6291
|
declare function supervisorInstructions(opts?: {
|
|
6155
6292
|
goal?: string;
|
|
6156
6293
|
}): string;
|
|
@@ -6605,7 +6742,7 @@ interface DriverAgentOptions {
|
|
|
6605
6742
|
/** Analyst kind ids run AUTOMATICALLY when a worker settles `done` — each result re-enters as a
|
|
6606
6743
|
* `finding` the driver pulls and composes its next steer from. The UP-leg of the self-improving
|
|
6607
6744
|
* loop. Omit/empty = no auto-analysis (status quo). Requires `analysts`. */
|
|
6608
|
-
readonly analyzeOnSettle?: ReadonlyArray<string>;
|
|
6745
|
+
readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
|
|
6609
6746
|
/** Run the ONLINE detector panel over each worker's LIVE tool trace and raise a `finding` the
|
|
6610
6747
|
* moment it loops/error-storms — mid-run evidence to steer on, not a settle-time post-mortem.
|
|
6611
6748
|
* Omit = no online watching. */
|
|
@@ -6754,7 +6891,7 @@ declare function serveCoordinationMcp(opts: {
|
|
|
6754
6891
|
/** Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. */
|
|
6755
6892
|
analysts?: AnalystRegistry;
|
|
6756
6893
|
/** Analyst kinds to auto-run when a worker settles `done` — findings flow up the bus. */
|
|
6757
|
-
analyzeOnSettle?: ReadonlyArray<string>;
|
|
6894
|
+
analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
|
|
6758
6895
|
/** Run the ONLINE detector panel over each worker's live tool trace (raises `finding` events). */
|
|
6759
6896
|
watchWorkers?: WorkerWatchOptions;
|
|
6760
6897
|
/** Idle time after which `observe_agent` reports a worker as stalled. */
|
|
@@ -6913,16 +7050,90 @@ declare function queueOf<Out>(units: ReadonlyArray<{
|
|
|
6913
7050
|
label: string;
|
|
6914
7051
|
}>, budget: Budget): () => DispatchUnit<Out> | undefined;
|
|
6915
7052
|
//#endregion
|
|
6916
|
-
//#region src/runtime/supervise/
|
|
7053
|
+
//#region src/runtime/supervise/prompt-registry.d.ts
|
|
6917
7054
|
/**
|
|
6918
|
-
*
|
|
6919
|
-
*
|
|
6920
|
-
*
|
|
7055
|
+
*
|
|
7056
|
+
* The kernel prompt registry — versioned prompt text as DATA, addressed by `PromptHandle`.
|
|
7057
|
+
*
|
|
7058
|
+
* A role expressed as a builder FUNCTION is a role that can never improve: the only optimizable
|
|
7059
|
+
* surface it leaves is whatever thin string a caller happens to inject, while the real doctrine
|
|
7060
|
+
* sits hardcoded in TypeScript. This registry is the inverse: every standing instruction is a
|
|
7061
|
+
* versioned entry (`<surface>` + `v<n>`), so a graph edge, a supervisor front door, or an
|
|
7062
|
+
* optimizer names a handle and the TEXT is swappable, sweepable, and diffable without a code
|
|
7063
|
+
* change. Graph edges (`runGraph`) carry handles, never inline prose.
|
|
7064
|
+
*
|
|
7065
|
+
* ONE policy per role, whichever front door builds it: the seeded `supervisor/policy` entry is the
|
|
7066
|
+
* single supervisor stance. The package previously shipped two contradictory defaults — the router
|
|
7067
|
+
* arm's "do small work YOURSELF" (`defaultSupervisorPrompt`) versus the delegate front door's "you
|
|
7068
|
+
* do NOT do the work yourself" (`supervisorInstructions`) — selected by entry point. Both now
|
|
7069
|
+
* derive from the one entry here; which door you enter no longer decides the policy.
|
|
7070
|
+
*
|
|
7071
|
+
* @experimental
|
|
6921
7072
|
*/
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
7073
|
+
/** A versioned reference into a prompt registry: `surface` names the role/edge the text serves,
|
|
7074
|
+
* `version` pins the exact text. The string form is `<surface>/v<n>` (e.g. `delegates/worker-brief/v1`). */
|
|
7075
|
+
interface PromptHandle {
|
|
7076
|
+
readonly surface: string;
|
|
7077
|
+
readonly version: number;
|
|
7078
|
+
}
|
|
7079
|
+
/** One registry entry: the handle plus the text it pins. */
|
|
7080
|
+
interface RegisteredPrompt {
|
|
7081
|
+
readonly surface: string;
|
|
7082
|
+
readonly version: number;
|
|
7083
|
+
readonly text: string;
|
|
7084
|
+
/** What the surface is FOR — shown by `list()`, never sent to a model. */
|
|
7085
|
+
readonly description?: string;
|
|
7086
|
+
}
|
|
7087
|
+
/** Versioned prompt store. `resolve` fails loud on an unknown handle: a directive that silently
|
|
7088
|
+
* resolved to nothing is the unobservable-edge failure this whole design exists to end. */
|
|
7089
|
+
interface PromptRegistry {
|
|
7090
|
+
resolve(handle: PromptHandle): RegisteredPrompt;
|
|
7091
|
+
/** Register a new entry; a duplicate (surface, version) fails loud — versions are immutable. */
|
|
7092
|
+
register(entry: RegisteredPrompt): void;
|
|
7093
|
+
list(): ReadonlyArray<RegisteredPrompt>;
|
|
7094
|
+
}
|
|
7095
|
+
/**
|
|
7096
|
+
* Parse `'<surface>/v<n>'` into a {@link PromptHandle}. The shorthand for authoring a graph edge:
|
|
7097
|
+
* `directive: promptHandle('delegates/worker-brief/v1')`.
|
|
7098
|
+
*/
|
|
7099
|
+
declare function promptHandle(ref: string): PromptHandle;
|
|
7100
|
+
/** The string form of a handle: `<surface>/v<n>`. */
|
|
7101
|
+
declare function formatPromptHandle(handle: PromptHandle): string;
|
|
7102
|
+
/** Create a registry, optionally seeded. Entries are copied; the registry never aliases caller state. */
|
|
7103
|
+
declare function createPromptRegistry(seed?: ReadonlyArray<RegisteredPrompt>): PromptRegistry;
|
|
7104
|
+
/**
|
|
7105
|
+
* THE supervisor policy — one stance, both front doors. The work-vs-delegate rule is conditional
|
|
7106
|
+
* on capability (work tools present or not), which is what dissolves the old contradiction: "do
|
|
7107
|
+
* small work yourself" was written for a supervisor WITH work tools, "you do not do the work" for
|
|
7108
|
+
* one WITHOUT — one policy states both branches explicitly.
|
|
7109
|
+
*/
|
|
7110
|
+
declare const supervisorPolicyPrompt: RegisteredPrompt;
|
|
7111
|
+
/**
|
|
7112
|
+
* Default DELEGATES-edge directive: the standing instruction a worker receives with every
|
|
7113
|
+
* traversal of a delegates edge that names this surface. Seeded from the bounded-brief knowledge
|
|
7114
|
+
* in the supervisor policy, phrased for the RECEIVING side of the edge.
|
|
7115
|
+
*/
|
|
7116
|
+
declare const delegatesWorkerBriefPrompt: RegisteredPrompt;
|
|
7117
|
+
/**
|
|
7118
|
+
* Default ANALYZES-edge directive: what the RECEIVING node should do with an analyst's findings.
|
|
7119
|
+
* Wrapped around the findings payload on every traversal of an analyzes edge naming this surface.
|
|
7120
|
+
*/
|
|
7121
|
+
declare const analyzesFindingsReportPrompt: RegisteredPrompt;
|
|
7122
|
+
/**
|
|
7123
|
+
* Default NAIVE steering continuation — the no-signal control re-expressed as data: the same
|
|
7124
|
+
* fixed continuation every round, reading nothing from any verdict.
|
|
7125
|
+
*/
|
|
7126
|
+
declare const naiveContinuationPrompt: RegisteredPrompt;
|
|
7127
|
+
/**
|
|
7128
|
+
* Default DUMB steering continuations — the pass/fail-only control re-expressed as data: two
|
|
7129
|
+
* fixed texts keyed on the verdict's boolean and nothing else.
|
|
7130
|
+
*/
|
|
7131
|
+
declare const dumbContinuationFailPrompt: RegisteredPrompt;
|
|
7132
|
+
/** The pass branch of the dumb steering control — see {@link dumbContinuationFailPrompt}. */
|
|
7133
|
+
declare const dumbContinuationPassPrompt: RegisteredPrompt;
|
|
7134
|
+
/** The kernel's seeded registry: every surface the runtime's own builders derive from. A caller
|
|
7135
|
+
* may register additional surfaces/versions on the returned registry. */
|
|
7136
|
+
declare function kernelPromptRegistry(): PromptRegistry;
|
|
6926
7137
|
//#endregion
|
|
6927
7138
|
//#region src/runtime/supervise/otel-spans.d.ts
|
|
6928
7139
|
/** OTLP span attribute values. Exported because `SupervisorSpanOptions.attributes` is public and
|
|
@@ -6997,885 +7208,1038 @@ interface SupervisorSpanRecorder {
|
|
|
6997
7208
|
*/
|
|
6998
7209
|
declare function createSupervisorSpanRecorder(opts: SupervisorSpanOptions): SupervisorSpanRecorder | undefined;
|
|
6999
7210
|
//#endregion
|
|
7000
|
-
//#region src/runtime/supervise/
|
|
7001
|
-
/** @experimental The per-task constraints the mechanical gate enforces. */
|
|
7002
|
-
interface CoderCheckConstraints {
|
|
7003
|
-
/** Default 400. Hard cap; gate fails when exceeded. */
|
|
7004
|
-
maxDiffLines?: number;
|
|
7005
|
-
/** Literal path prefixes the patch must not touch. */
|
|
7006
|
-
forbiddenPaths?: string[];
|
|
7007
|
-
}
|
|
7008
|
-
//#endregion
|
|
7009
|
-
//#region src/runtime/supervise/worktree-cli-executor.d.ts
|
|
7010
|
-
/** Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured
|
|
7011
|
-
* diff + the harness's run record + the derived checks). */
|
|
7012
|
-
type WorktreePatchArtifact = WorktreeHarnessResult;
|
|
7013
|
-
/** @experimental */
|
|
7014
|
-
interface WorktreeCliExecutorOptions {
|
|
7015
|
-
/** Absolute path to the git checkout the worktree is cut from. */
|
|
7016
|
-
repoRoot: string;
|
|
7017
|
-
/**
|
|
7018
|
-
* The supervisor-authored prompt/model plus materializable structural resources.
|
|
7019
|
-
* `model.default` selects the one-shot model. Routing-only model hints, placement concerns,
|
|
7020
|
-
* provider extensions, and `resources.failOnError` fail before execution because this path
|
|
7021
|
-
* cannot honor them. Harness-specific values the materializer cannot preserve also fail closed.
|
|
7022
|
-
*/
|
|
7023
|
-
profile: AgentProfile$1;
|
|
7024
|
-
/** Local CLI for this leaf. This explicit choice overrides `profile.harness`. */
|
|
7025
|
-
harness: LocalHarness;
|
|
7026
|
-
/** Default instruction for direct `execute(undefined, signal)` calls. An execution-time task
|
|
7027
|
-
* is authoritative. Omit when the caller always supplies the task to `execute`. */
|
|
7028
|
-
taskPrompt?: string;
|
|
7029
|
-
/** Unique id for the worktree path + branch. Defaults to a fresh UUID. */
|
|
7030
|
-
runId?: string;
|
|
7031
|
-
/** Override the base ref the worktree is cut from (default `HEAD`). */
|
|
7032
|
-
baseRef?: string;
|
|
7033
|
-
/** Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). */
|
|
7034
|
-
harnessTimeoutMs?: number;
|
|
7035
|
-
/** Run Codex with an ephemeral session, isolated config/instructions, network disabled, and
|
|
7036
|
-
* JSONL usage capture. Requires `harness: 'codex'`; metered by default. */
|
|
7037
|
-
codexReproducible?: boolean;
|
|
7038
|
-
/** Absolute host paths denied to reproducible Codex (for benchmark answer copies, credentials,
|
|
7039
|
-
* or other task-specific ambient state). */
|
|
7040
|
-
codexReadDeniedPaths?: ReadonlyArray<string>;
|
|
7041
|
-
/**
|
|
7042
|
-
* Shell command run in the live worktree to derive the tests-PASS signal (e.g. `pnpm test`).
|
|
7043
|
-
* Its exit code becomes `artifact.checks.tests.passed`. Omit to skip (no signal derived).
|
|
7044
|
-
*/
|
|
7045
|
-
testCmd?: string;
|
|
7046
|
-
/** Shell command run in the live worktree to derive the typecheck-PASS signal (e.g. `pnpm typecheck`). */
|
|
7047
|
-
typecheckCmd?: string;
|
|
7048
|
-
/** Wall-clock cap per verification command (ms). Default = `harnessTimeoutMs` or 5 min. */
|
|
7049
|
-
checkTimeoutMs?: number;
|
|
7050
|
-
/** Cap on each check's captured output. Default 16k. */
|
|
7051
|
-
checkOutputCap?: number;
|
|
7052
|
-
/** Test seam — inject a git runner so unit tests drive the worktree helpers without git. */
|
|
7053
|
-
runGit?: GitRunner;
|
|
7054
|
-
/** Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. */
|
|
7055
|
-
runHarness?: typeof runLocalHarness;
|
|
7056
|
-
/** Test seam — inject the verification-command runner so unit tests script test/typecheck
|
|
7057
|
-
* outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. */
|
|
7058
|
-
runCommand?: WorktreeCheckRunner;
|
|
7059
|
-
/**
|
|
7060
|
-
* Exclude this leaf's spend from accounting. Defaults to `true` for ordinary CLI runs and
|
|
7061
|
-
* `false` for `codexReproducible`, which captures real token usage. A metered custom runner must
|
|
7062
|
-
* likewise return `LocalHarnessResult.usage`.
|
|
7063
|
-
*/
|
|
7064
|
-
budgetExempt?: boolean;
|
|
7065
|
-
/** @internal Kernel-minted attempt identity threaded by the built-in registry. */
|
|
7066
|
-
executionAttemptId?: string;
|
|
7067
|
-
}
|
|
7211
|
+
//#region src/runtime/supervise/supervisor-agent.d.ts
|
|
7068
7212
|
/**
|
|
7069
|
-
*
|
|
7070
|
-
*
|
|
7213
|
+
* The supervisor's profile — the subset of an `AgentProfile` that selects + shapes its brain.
|
|
7214
|
+
* `harness` is the backend-as-data discriminant; `systemPrompt` is the standing instruction.
|
|
7071
7215
|
*
|
|
7072
|
-
*
|
|
7073
|
-
*
|
|
7074
|
-
*
|
|
7216
|
+
* A canonical `AgentProfile` from `@tangle-network/agent-interface` satisfies this interface
|
|
7217
|
+
* structurally: its `model` is a hints OBJECT and its system prompt lives at `prompt.systemPrompt`,
|
|
7218
|
+
* so both spellings are accepted here and reduced by {@link resolveSupervisorProfile}. Before that,
|
|
7219
|
+
* a canonical profile's model object reached `RouterConfig.model` (a string) as an object and its
|
|
7220
|
+
* `prompt.systemPrompt` was dropped — a request the provider rejects, and a supervisor running the
|
|
7221
|
+
* default strategy while its profile named another.
|
|
7075
7222
|
*
|
|
7076
|
-
*
|
|
7223
|
+
* WHAT EACH ARM HONORS — the two brains read different amounts of a profile, so state it rather
|
|
7224
|
+
* than let a caller infer that a field took effect:
|
|
7225
|
+
*
|
|
7226
|
+
* - ROUTER arm (`harness` null): only `name`, the resolved model id (`model`, or
|
|
7227
|
+
* `model.default`), and the resolved system prompt (`prompt.systemPrompt`/`systemPrompt` plus
|
|
7228
|
+
* `prompt.instructions` and `resources.instructions`) reach the brain. A full `AgentProfile`'s
|
|
7229
|
+
* `tools`, `mcp`, `permissions`, `resources.skills`/`files`, `hooks`, `modes`, `subagents`,
|
|
7230
|
+
* `model.provider`, `model.small` and `model.reasoningEffort` are NOT honored here: the router
|
|
7231
|
+
* brain is one `ToolLoopChat` over the coordination verbs, and neither of its two tool-calling
|
|
7232
|
+
* transports (`routerChatWithTools` buffered, `streamRouterChatWithTools` when
|
|
7233
|
+
* `RouterConfig.stream` is set) has a parameter for any of them.
|
|
7234
|
+
* - HARNESS arm (`harness` set): the WHOLE profile object is handed to `deps.driveHarness`
|
|
7235
|
+
* untouched, plus the resolved system prompt as a separate argument. Everything the profile
|
|
7236
|
+
* declares is the harness's to materialize; this module changes none of it.
|
|
7077
7237
|
*/
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
/**
|
|
7084
|
-
*
|
|
7085
|
-
*
|
|
7086
|
-
*
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7238
|
+
interface SupervisorProfile {
|
|
7239
|
+
readonly name?: string;
|
|
7240
|
+
/** null/undefined/`cli-base` → router brain (in-process tool-loop); a coding-CLI harness → an
|
|
7241
|
+
* external harness brain. */
|
|
7242
|
+
readonly harness?: string | null;
|
|
7243
|
+
/** The router model when the brain is router-driven: a model id, or a canonical profile's model
|
|
7244
|
+
* hints whose `default` IS the id. Absent (including a hints object with no `default`) → the
|
|
7245
|
+
* deps router config's model applies. Other hints (`small`, `provider`, `reasoningEffort`) are
|
|
7246
|
+
* harness-arm material only. */
|
|
7247
|
+
readonly model?: string | AgentProfileModelHints;
|
|
7248
|
+
/** Canonical `AgentProfile` prompt shaping. `prompt.systemPrompt` and the top-level `systemPrompt`
|
|
7249
|
+
* are the same standing instruction in two spellings; disagreeing values are a fault, not a pick.
|
|
7250
|
+
* `prompt.instructions` lines are appended to the resolved prompt, one per line. */
|
|
7251
|
+
readonly prompt?: AgentProfilePrompt;
|
|
7252
|
+
/** Canonical `AgentProfile` resources. Only `instructions` shapes the brain here (appended to the
|
|
7253
|
+
* resolved system prompt); every other resource is the harness's to materialize. */
|
|
7254
|
+
readonly resources?: AgentProfileResources;
|
|
7255
|
+
/** The standing instructions ("you delegate, you do not solve"). */
|
|
7256
|
+
readonly systemPrompt?: string;
|
|
7090
7257
|
}
|
|
7091
|
-
/**
|
|
7092
|
-
*
|
|
7093
|
-
*
|
|
7094
|
-
* whether the patch is DELIVERED (the `valid` conjunction).
|
|
7258
|
+
/** A `SupervisorProfile` reduced to the scalars the two brain arms consume. `modelId`/`systemPrompt`
|
|
7259
|
+
* stay `undefined` when the profile named none — the caller's fallback (`deps.router.model`,
|
|
7260
|
+
* the built-in default supervisor prompt) then applies, and this type cannot hide which happened.
|
|
7095
7261
|
*
|
|
7096
|
-
*
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
* over a nested `Scope` on the same conserved pool). Leave `false` for a flat tree of
|
|
7107
|
-
* leaf workers. Default `false`.
|
|
7108
|
-
*/
|
|
7109
|
-
readonly withDriver?: boolean;
|
|
7262
|
+
* There is deliberately no `reasoningEffort` here: the router brain runs on `chatWithTools` (the
|
|
7263
|
+
* buffered/streamed switch in the router client), and neither transport has a `reasoning_effort`
|
|
7264
|
+
* parameter — only the chat-only `routerChatWithUsage` does — so a field carrying it would be a
|
|
7265
|
+
* public promise nothing keeps. `model.reasoningEffort` still reaches the harness arm inside the
|
|
7266
|
+
* profile. */
|
|
7267
|
+
interface ResolvedSupervisorProfile {
|
|
7268
|
+
readonly name: string;
|
|
7269
|
+
readonly harness: string | null;
|
|
7270
|
+
readonly modelId?: string;
|
|
7271
|
+
readonly systemPrompt?: string;
|
|
7110
7272
|
}
|
|
7111
7273
|
/**
|
|
7112
|
-
*
|
|
7113
|
-
*
|
|
7274
|
+
* Reduce either profile spelling — a hand-written `SupervisorProfile` or a canonical `AgentProfile`
|
|
7275
|
+
* — to the scalars the brain arms consume:
|
|
7276
|
+
*
|
|
7277
|
+
* - `modelId`: a string `model` verbatim, else `model.default`. Absent or unresolvable → the
|
|
7278
|
+
* router config's own model applies unchanged.
|
|
7279
|
+
* - `systemPrompt`: the system prompt plus the `prompt.instructions` and `resources.instructions`
|
|
7280
|
+
* lines, one per line.
|
|
7281
|
+
*
|
|
7282
|
+
* `supervisorAgent` resolves each piece only where it is consumed (the model id on the router arm
|
|
7283
|
+
* only); this whole-profile reduction is the caller-facing view of the same rules.
|
|
7114
7284
|
*/
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
*
|
|
7123
|
-
|
|
7124
|
-
readonly resume?: boolean;
|
|
7125
|
-
/**
|
|
7126
|
-
* Present only on a DURABLE context: the coordination side-log stores questions, analyst
|
|
7127
|
-
* findings, answer decisions, and authorized continuation receipts that the spawn journal does
|
|
7128
|
-
* not own. `supervise({ runDir })` appends them as they publish and loads them on resume.
|
|
7129
|
-
* Continuation receipts are evidence and are never auto-delivered to a replacement worker.
|
|
7130
|
-
* In-memory contexts have none: nothing outlives the process.
|
|
7131
|
-
*/
|
|
7132
|
-
readonly coordinationLog?: CoordinationLog;
|
|
7285
|
+
declare function resolveSupervisorProfile(profile: SupervisorProfile): ResolvedSupervisorProfile;
|
|
7286
|
+
/** Where the coordination MCP binds. Omit = an ephemeral port on `127.0.0.1` (the local-harness
|
|
7287
|
+
* default); set `host` when the root or the harness runs off-host. */
|
|
7288
|
+
interface CoordinationBinding {
|
|
7289
|
+
readonly host?: string;
|
|
7290
|
+
readonly port?: number;
|
|
7291
|
+
/** Explicit acknowledgment required to bind a NON-loopback host — see
|
|
7292
|
+
* {@link assertCoordinationBinding} for what is being accepted. */
|
|
7293
|
+
readonly allowUnauthenticatedRemote?: boolean;
|
|
7133
7294
|
}
|
|
7134
|
-
/** The stores a supervised run needs, in-memory or file-backed. `InMemoryRunContext` is the
|
|
7135
|
-
* historical name for the same shape. */
|
|
7136
|
-
type RunContext = InMemoryRunContext;
|
|
7137
7295
|
/**
|
|
7138
|
-
*
|
|
7139
|
-
*
|
|
7296
|
+
* Fail closed on a non-loopback coordination bind. `serveCoordinationMcp` mounts spawn_agent /
|
|
7297
|
+
* steer_agent / stop with NO authentication of any kind (it is a bare JSON-RPC-over-HTTP handler),
|
|
7298
|
+
* so a non-loopback bind lets anyone who can reach the port spawn agents and spend the run's
|
|
7299
|
+
* conserved budget. There is no token to require yet, so the only honest options are loopback or an
|
|
7300
|
+
* explicit, recorded acknowledgment — never a silent bind.
|
|
7140
7301
|
*/
|
|
7141
|
-
declare function
|
|
7142
|
-
/**
|
|
7143
|
-
*
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7302
|
+
declare function assertCoordinationBinding(binding: CoordinationBinding | undefined): void;
|
|
7303
|
+
/** Trusted run/node identity Runtime binds to one manager. Model-authored tool arguments cannot
|
|
7304
|
+
* provide or replace any of these fields. */
|
|
7305
|
+
interface SupervisorNodeContext {
|
|
7306
|
+
readonly runId: string;
|
|
7307
|
+
/** Stable across a durable restart; unique per in-memory invocation. */
|
|
7308
|
+
readonly runNamespace: string;
|
|
7309
|
+
/** Concrete Scope node that owns this manager's coordination stream. */
|
|
7310
|
+
readonly nodeId: string;
|
|
7311
|
+
/** Stable identity of this manager's coordination stream. */
|
|
7312
|
+
readonly ownerId: string;
|
|
7313
|
+
readonly depth: number;
|
|
7314
|
+
readonly identity: NodeExecutionIdentity;
|
|
7315
|
+
/** Assignment identity within the parent manager; absent only for the root. */
|
|
7316
|
+
readonly assignmentId?: string;
|
|
7317
|
+
readonly profile: SupervisorProfile;
|
|
7318
|
+
readonly task: unknown;
|
|
7319
|
+
}
|
|
7320
|
+
/** Context known before `Agent.act`; Runtime adds the concrete node, profile, and task. */
|
|
7321
|
+
type SupervisorNodeContextSeed = Omit<SupervisorNodeContext, 'nodeId' | 'profile' | 'task'>;
|
|
7322
|
+
/** Trusted context for one product-tool invocation. The node identity remains the same detached,
|
|
7323
|
+
* immutable snapshot supplied to the resolver; `signal` is the one live control reference Runtime
|
|
7324
|
+
* adds. It aborts when this manager's scope is cancelled by the caller, RootHandle, deadline,
|
|
7325
|
+
* breaker, or a recursive parent. */
|
|
7326
|
+
interface SupervisorToolInvocationContext extends SupervisorNodeContext {
|
|
7327
|
+
readonly signal: AbortSignal;
|
|
7328
|
+
}
|
|
7329
|
+
/** One product-owned tool. It reuses the canonical MCP descriptor fields while Runtime supplies
|
|
7330
|
+
* the trusted invocation context as a separate argument and binds the result for either
|
|
7331
|
+
* transport. Existing handlers remain compatible: the second argument only gains `signal`. */
|
|
7332
|
+
interface SupervisorToolDescriptor extends Omit<McpToolDescriptor$1, 'handler'> {
|
|
7333
|
+
readonly handler: (raw: unknown, context: SupervisorToolInvocationContext) => Promise<unknown>;
|
|
7334
|
+
}
|
|
7335
|
+
/** Product policy for the tools one exact supervisor node may call. Resolved once per node. */
|
|
7336
|
+
type ResolveSupervisorTools = (context: SupervisorNodeContext) => ReadonlyArray<SupervisorToolDescriptor> | Promise<ReadonlyArray<SupervisorToolDescriptor>>;
|
|
7337
|
+
/** Context-aware observer used internally to bind product transactions to the actual live node. */
|
|
7338
|
+
type ObserveSupervisorNodeEvent = (context: SupervisorNodeContext, event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
|
|
7339
|
+
/** How to run an external harness as the DRIVER, with the coordination verbs mounted — the substrate
|
|
7340
|
+
* seam the caller supplies (mirrors `makeWorkerAgent` for spawned children). It runs `profile` on
|
|
7341
|
+
* `task` in its backend (remote sandbox or local CLI bridge) with `coordinationMcpUrl` mounted as an MCP server,
|
|
7342
|
+
* so the harness calls spawn_agent / await_event / stop as native tools over the live scope. */
|
|
7343
|
+
interface DriveHarness {
|
|
7344
|
+
(args: {
|
|
7345
|
+
/** The caller's profile, EXACTLY as passed to `supervisorAgent` — never rewritten. A canonical
|
|
7346
|
+
* `AgentProfile` stays schema-valid here (the canonical schema rejects unknown top-level keys,
|
|
7347
|
+
* so hoisting a resolved prompt onto it would make a profile its own validator refuses). */
|
|
7348
|
+
readonly profile: SupervisorProfile;
|
|
7349
|
+
/** The standing instruction assembled from the profile: its system prompt in either spelling,
|
|
7350
|
+
* plus the `prompt.instructions` and `resources.instructions` lines. Absent when the profile
|
|
7351
|
+
* names none — the harness's own default then applies. This, not `profile.systemPrompt`, is
|
|
7352
|
+
* what the harness should run under. */
|
|
7353
|
+
readonly systemPrompt?: string;
|
|
7354
|
+
readonly task: unknown;
|
|
7355
|
+
readonly scope: Scope<unknown>;
|
|
7356
|
+
readonly coordinationMcpUrl: string;
|
|
7357
|
+
/** Data-only product tool surface mounted on the coordination MCP. Runtime-owned drivers include
|
|
7358
|
+
* this in their materialization evidence without persisting executable handlers. */
|
|
7359
|
+
readonly coordinationTools: ReadonlyArray<Omit<McpToolDescriptor$1, 'handler'>>;
|
|
7360
|
+
}): Promise<void>;
|
|
7361
|
+
/** Optional live inbox for the manager session this adapter currently drives. Return `false`
|
|
7362
|
+
* when no executor inbox is active instead of claiming a message was delivered. */
|
|
7363
|
+
deliver?(message: unknown): boolean;
|
|
7364
|
+
}
|
|
7365
|
+
/** Trusted manager identity available before its external harness starts. A product uses this to
|
|
7366
|
+
* return one independently steerable harness session per recursive manager. */
|
|
7367
|
+
type DriveHarnessOwnerContext = Omit<SupervisorNodeContext, 'nodeId'>;
|
|
7368
|
+
/** Resolve an external harness for one exact Runtime-owned manager identity. */
|
|
7369
|
+
type ResolveDriveHarness = (context: DriveHarnessOwnerContext) => DriveHarness;
|
|
7370
|
+
interface SupervisorAgentDeps {
|
|
7371
|
+
readonly blobs: ResultBlobStore;
|
|
7372
|
+
/** Resolve a spawned worker `profile` to a leaf agent — the recursion seam (same for both arms). */
|
|
7373
|
+
readonly makeWorkerAgent: MakeWorkerAgent;
|
|
7374
|
+
/** Product authorization for every down-leg continuation to a child. */
|
|
7375
|
+
readonly authorizeDownMessage?: AuthorizeDownMessage;
|
|
7376
|
+
/** Per-child budget reserved from the conserved pool on each spawn. */
|
|
7377
|
+
readonly perWorker: Budget;
|
|
7378
|
+
/** Independent completion check for direct driver work (`submit_result`). */
|
|
7379
|
+
readonly deliverable?: DeliverableSpec<unknown>;
|
|
7380
|
+
/** Hard cap on simultaneously-LIVE workers across both arms — `spawn_agent` fails closed once
|
|
7381
|
+
* this many are in flight (a concurrency fence on top of the conserved-pool fence; bounds live
|
|
7382
|
+
* boxes/sandboxes, not total work). Omit/`<= 0` = no cap. */
|
|
7383
|
+
readonly maxLiveWorkers?: number;
|
|
7384
|
+
/** Router substrate for a router-brained supervisor (`harness` omitted or `cli-base`). The
|
|
7385
|
+
* profile's model wins. */
|
|
7386
|
+
readonly router?: RouterConfig;
|
|
7387
|
+
/** Inject the brain directly (tests / advanced) instead of resolving `routerBrain` from the profile. */
|
|
7388
|
+
readonly brain?: ToolLoopChat;
|
|
7389
|
+
/** Required to run an external-harness supervisor: runs the harness as the driver. */
|
|
7390
|
+
readonly driveHarness?: DriveHarness;
|
|
7391
|
+
/** Trusted identity for this manager. Required with node-scoped tools or observation. */
|
|
7392
|
+
readonly nodeContext?: SupervisorNodeContextSeed;
|
|
7393
|
+
/** Resolve product-owned tools for this exact manager. Static `extraTools` remain a router-only
|
|
7394
|
+
* compatibility seam and deliberately receive no new recursive authority. */
|
|
7395
|
+
readonly resolveSupervisorTools?: ResolveSupervisorTools;
|
|
7396
|
+
/** Awaited product observation, enriched with this manager's actual live node context. */
|
|
7397
|
+
readonly observeNodeEvent?: ObserveSupervisorNodeEvent;
|
|
7398
|
+
/** Replay resume-time settlements through `observeNodeEvent` before the manager starts. */
|
|
7399
|
+
readonly replaySettlements?: boolean;
|
|
7400
|
+
/** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
|
|
7401
|
+
* only delegate when it needs parallelism. Pair with `executeExtraTool`. */
|
|
7402
|
+
readonly extraTools?: ReadonlyArray<{
|
|
7403
|
+
readonly name: string;
|
|
7404
|
+
readonly description?: string;
|
|
7405
|
+
readonly parameters: Record<string, unknown>;
|
|
7406
|
+
}>;
|
|
7407
|
+
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
7408
|
+
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
7409
|
+
/** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
|
|
7410
|
+
readonly analysts?: AnalystRegistry;
|
|
7411
|
+
/** Analyst kinds run on each worker-settle → a `finding` the driver composes its next steer from
|
|
7412
|
+
* (the self-improving UP-leg). Unset/empty = status quo (no analyst feed). Requires `analysts`. */
|
|
7413
|
+
readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
|
|
7414
|
+
/** Run the ONLINE detector panel over each worker's LIVE tool trace (both arms) so the driver
|
|
7415
|
+
* learns a worker is looping mid-run instead of at settle. Omit = no online watching. */
|
|
7416
|
+
readonly watchWorkers?: WorkerWatchOptions;
|
|
7417
|
+
/** Idle time after which `observe_agent` reports a worker as stalled. Omit = runtime default. */
|
|
7418
|
+
readonly stallAfterMs?: number;
|
|
7419
|
+
/** PROGRESS-derived stop rule (router arm). Ends a run that has stopped learning BEFORE it
|
|
7420
|
+
* exhausts a ceiling; it can never keep a run alive past one. Build it with `plateau` /
|
|
7421
|
+
* `noProgressFor` / `allWorkersStalled` from `supervise/stop-rules` — the thresholds are the
|
|
7422
|
+
* caller's judgment. Omit = ceilings only. */
|
|
7423
|
+
readonly stopRule?: StopRule;
|
|
7424
|
+
/** One-shot notification of WHY a `stopRule` ended the run. */
|
|
7425
|
+
readonly onProgressStop?: (reason: string) => void;
|
|
7426
|
+
readonly maxTurns?: number;
|
|
7427
|
+
/** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only) — it
|
|
7428
|
+
* distills its coordination transcript to a compact progress note once it exceeds the threshold,
|
|
7429
|
+
* instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
|
|
7430
|
+
readonly compaction?: ToolLoopCompactionOptions;
|
|
7431
|
+
/** Pass-through subscriber for every coordination bus event (both arms) — the seam a durable
|
|
7432
|
+
* caller hooks its coordination log onto. */
|
|
7433
|
+
readonly onEvent?: (event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
|
|
7434
|
+
/** Questions, findings, and authorized continuation receipts loaded from a prior process.
|
|
7435
|
+
* Router arm: questions seed the ledger and all evidence enters the resume brief. External arm:
|
|
7436
|
+
* questions seed the ledger; receipts remain durable evidence and are never auto-delivered. */
|
|
7437
|
+
readonly priorCoordination?: PriorCoordination;
|
|
7438
|
+
/** Deferred owner-scoped replay for a recursive supervisor. Its stable owner is known while the
|
|
7439
|
+
* parent authorizes the child, but loading remains asynchronous; Runtime calls this before the
|
|
7440
|
+
* nested brain can publish or act on coordination state. */
|
|
7441
|
+
readonly loadPriorCoordination?: () => Promise<PriorCoordination>;
|
|
7442
|
+
/** How the settled ledger becomes the run's output (both arms). Default `bestDelivered` — the
|
|
7443
|
+
* exact keep-best every existing caller had. Always runs under the delivered-only invariant. */
|
|
7444
|
+
readonly finalizer?: SupervisorFinalizer;
|
|
7445
|
+
/** Where the coordination MCP binds (external arm). Omit = an ephemeral loopback port, which is
|
|
7446
|
+
* unreachable from an off-host harness. A non-loopback host fails closed — see
|
|
7447
|
+
* {@link assertCoordinationBinding}. */
|
|
7448
|
+
readonly coordination?: CoordinationBinding;
|
|
7449
|
+
}
|
|
7450
|
+
/** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness` (backend-as-data), the same resolution rule as every worker. */
|
|
7451
|
+
declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
|
|
7158
7452
|
//#endregion
|
|
7159
|
-
//#region src/runtime/supervise/
|
|
7453
|
+
//#region src/runtime/supervise/supervise.d.ts
|
|
7160
7454
|
/**
|
|
7161
|
-
*
|
|
7162
|
-
*
|
|
7163
|
-
*
|
|
7164
|
-
* `Inbox` seam in `./inbox`. A run persists its state under one directory so that any OTHER process
|
|
7165
|
-
* can find it after the fact: `@tangle-network/traces` reads exactly this layout via
|
|
7166
|
-
* `traces analyze --supervisor-run-dir`, a restarted host can rehydrate a run it no longer holds
|
|
7167
|
-
* handles to, and a human can steer a live worker by appending one NDJSON line. Until now the
|
|
7168
|
-
* layout was defined only in the unpublished `loops` repo (`src/supervisor-control.ts`) — a
|
|
7169
|
-
* published reader depending on an unpublished writer's convention — so the contract is promoted
|
|
7170
|
-
* here, names preserved.
|
|
7171
|
-
*
|
|
7172
|
-
* `.agent` is the one dot-dir for ALL agent-owned state (skills already write
|
|
7173
|
-
* `.agent/hypotheses/`, `.agent/skill-runs.jsonl`); supervisor runs live beside them rather than
|
|
7174
|
-
* under a product-branded dir. Runs written by older writers used `.loops/supervisor/<id>` —
|
|
7175
|
-
* readers that must see those keep a legacy fallback; this writer never creates `.loops` again.
|
|
7176
|
-
*
|
|
7177
|
-
* Layout, relative to `supervisorRunDir(root, id)`:
|
|
7178
|
-
*
|
|
7179
|
-
* workers/<label>.inbox.ndjson down-leg steer/answer requests for one worker (durable inbox);
|
|
7180
|
-
* each line is a {@link WorkerSteerRequest}
|
|
7181
|
-
* workers/<label>.ndjson best-effort per-worker control-event log (delivery bookkeeping)
|
|
7182
|
-
*
|
|
7183
|
-
* Reads are tolerant by contract: a partial trailing line (a writer mid-append) or a corrupt line
|
|
7184
|
-
* never poisons the rest of the file — later valid lines still matter.
|
|
7185
|
-
*
|
|
7186
|
-
* Promoted from `loops/src/supervisor-control.ts`. The one deliberate difference: the loops version
|
|
7187
|
-
* resolved a worker id to its label through the run journal before writing a steer; that resolution
|
|
7188
|
-
* stays with the caller (it is journal-format-specific), so `writeWorkerSteer` here takes the worker
|
|
7189
|
-
* LABEL directly.
|
|
7455
|
+
* Build the worker seam from a backend (WHERE workers run) + an optional completion oracle (the
|
|
7456
|
+
* deliverable check that makes "settled ⟺ delivered" true — the guard against "ran but didn't
|
|
7457
|
+
* deliver"). The ONE place a backend becomes a spawnable worker.
|
|
7190
7458
|
*
|
|
7191
|
-
*
|
|
7459
|
+
* `seams` exists because this path builds the leaf executor EAGERLY and hands it back as a BYO
|
|
7460
|
+
* `executorSpec.executor`. The registry resolves a BYO executor without ever consulting the
|
|
7461
|
+
* per-child `ExecutorContext` the `Scope` seeds, so anything the scope would have supplied is
|
|
7462
|
+
* invisible here and has to be passed in. It is a FUNCTION because it is resolved once per worker
|
|
7463
|
+
* construction, so a caller may hand back something the run only learns later — which is exactly how
|
|
7464
|
+
* `supervise()` gives a traced run's workers their trace context without ordering the span recorder
|
|
7465
|
+
* ahead of the worker seam.
|
|
7192
7466
|
*/
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
readonly message: string;
|
|
7467
|
+
declare function workerFromBackend(backend: ExecutorConfig, deliverable?: DeliverableSpec<unknown>, seams?: () => Readonly<Record<string, unknown>>): MakeWorkerAgent;
|
|
7468
|
+
/** Manager-authored profiles are untrusted until product policy says otherwise. Remote MCP and
|
|
7469
|
+
* ambient connection grants therefore fail closed by default, in addition to local MCP and hooks. */
|
|
7470
|
+
declare const DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY: AgentProfileSecurityPolicy;
|
|
7471
|
+
/** A name→value table, in this package's resolver-port shape (the same one `WaitProbeRegistry`
|
|
7472
|
+
* uses): construction stays the caller's, lookup stays lazy, and a table backed by a file, a
|
|
7473
|
+
* plugin loader, or a plain object all satisfy one interface. */
|
|
7474
|
+
interface SuperviseRegistryTable<T> {
|
|
7475
|
+
resolve(name: string): T | undefined;
|
|
7203
7476
|
}
|
|
7204
|
-
/** The root every supervisor run of one workspace lives under. */
|
|
7205
|
-
declare function supervisorRunsRoot(rootDir: string): string;
|
|
7206
|
-
/** The run directory every artifact of one supervisor run lives under. */
|
|
7207
|
-
declare function supervisorRunDir(rootDir: string, id: string): string;
|
|
7208
7477
|
/**
|
|
7209
|
-
*
|
|
7210
|
-
* see historical runs check {@link supervisorRunDir} first and fall back to this; nothing writes
|
|
7211
|
-
* here anymore.
|
|
7212
|
-
*/
|
|
7213
|
-
declare function legacySupervisorRunDir(rootDir: string, id: string): string;
|
|
7214
|
-
/**
|
|
7215
|
-
* The pre-rename runs root (`<root>/.loops/supervisor`). Only readers that ENUMERATE historical
|
|
7216
|
-
* runs need this — the per-id form is {@link legacySupervisorRunDir}. Nothing writes here.
|
|
7217
|
-
*/
|
|
7218
|
-
declare function legacySupervisorRunsRoot(rootDir: string): string;
|
|
7219
|
-
/** A worker label reduced to a safe filename stem. Empty labels get a stable fallback. */
|
|
7220
|
-
declare function safeWorkerFile(label: string): string;
|
|
7221
|
-
/** The directory holding every per-worker file of one run (inboxes and control-event logs). */
|
|
7222
|
-
declare function supervisorWorkersDir(eventDir: string): string;
|
|
7223
|
-
/** The durable inbox file for one worker of one run. */
|
|
7224
|
-
declare function workerInboxFile(rootDir: string, supervisorId: string, worker: string): string;
|
|
7225
|
-
/** Same, addressed from an already-known run directory (the reader's usual entry point). */
|
|
7226
|
-
declare function workerInboxFileFromEventDir(eventDir: string, worker: string): string;
|
|
7227
|
-
/**
|
|
7228
|
-
* The best-effort control-event log for one worker (`workers/<label>.ndjson`) — delivery
|
|
7229
|
-
* bookkeeping for steers, plus whatever lifecycle events a writer chooses to append. Distinct from
|
|
7230
|
-
* the inbox: the inbox is the durable down-leg queue, this is the record of what happened to it.
|
|
7231
|
-
*/
|
|
7232
|
-
declare function workerControlLogFile(eventDir: string, worker: string): string;
|
|
7233
|
-
/**
|
|
7234
|
-
* Durably append one steer request to a worker's inbox and log the delivery attempt.
|
|
7478
|
+
* The name→value tables that make the four CODE-valued options expressible as run DATA.
|
|
7235
7479
|
*
|
|
7236
|
-
*
|
|
7237
|
-
*
|
|
7480
|
+
* `deliverable` / `finalizer` / `analysts` / `probes` are functions and registries, so a recorded
|
|
7481
|
+
* run configuration (a JSON row, a campaign spec, a resumed run's options) cannot carry them — and
|
|
7482
|
+
* a run with no `deliverable` cannot return a `winner` at all outside the sandbox backend, because
|
|
7483
|
+
* the finalizer keeps only children whose oracle passed and nothing else writes that verdict. A
|
|
7484
|
+
* caller that owns the code registers it here once and names it from data thereafter.
|
|
7238
7485
|
*/
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
/**
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
readonly
|
|
7254
|
-
/**
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
readonly
|
|
7264
|
-
/**
|
|
7265
|
-
*
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
readonly
|
|
7271
|
-
/**
|
|
7272
|
-
|
|
7273
|
-
|
|
7486
|
+
interface SuperviseRegistry {
|
|
7487
|
+
readonly deliverables?: SuperviseRegistryTable<DeliverableSpec<unknown>>;
|
|
7488
|
+
readonly finalizers?: SuperviseRegistryTable<SupervisorFinalizer>;
|
|
7489
|
+
readonly analysts?: SuperviseRegistryTable<AnalystRegistry>;
|
|
7490
|
+
readonly probes?: SuperviseRegistryTable<WaitProbeRegistry>;
|
|
7491
|
+
}
|
|
7492
|
+
interface SuperviseOptions {
|
|
7493
|
+
/** The conserved compute pool for the whole run. */
|
|
7494
|
+
readonly budget: Budget;
|
|
7495
|
+
/** Caller-created live handle for observing, steering, or cancelling this root manager. Runtime
|
|
7496
|
+
* attaches it before execution and detaches it after the join barrier. */
|
|
7497
|
+
readonly rootHandle?: RootHandle<unknown>;
|
|
7498
|
+
/** Caller-owned cancellation for the complete recursive run. Aborting it cascades through the
|
|
7499
|
+
* root scope and every live child, including acquisition and backend execution. */
|
|
7500
|
+
readonly signal?: AbortSignal;
|
|
7501
|
+
/** Trusted candidate and pursuit attribution for the root. The runtime derives profile/task
|
|
7502
|
+
* digests itself from the exact detached values it executes. */
|
|
7503
|
+
readonly execution?: AgentExecutionRef;
|
|
7504
|
+
/** WHERE workers run — derives the worker seam. Provide this OR an explicit `makeWorkerAgent`. */
|
|
7505
|
+
readonly backend?: ExecutorConfig;
|
|
7506
|
+
/** The independent completion check for backend-derived workers and direct supervisor
|
|
7507
|
+
* submissions. Strongly recommended: without it the supervisor cannot submit its own work and
|
|
7508
|
+
* backend-derived workers fall back to their own validity signal. A `string` names an entry in
|
|
7509
|
+
* `registry.deliverables`. */
|
|
7510
|
+
readonly deliverable?: DeliverableSpec<unknown> | string;
|
|
7511
|
+
/** Resolve the completion check for one exact authorized backend-derived leaf. The callback runs
|
|
7512
|
+
* after spawn authorization and driver classification, receives a detached immutable context,
|
|
7513
|
+
* and may return `undefined` to use the run-wide `deliverable`. Driver profiles never call it. */
|
|
7514
|
+
readonly resolveDeliverable?: (input: DeliverableResolutionInput) => DeliverableSpec<unknown> | undefined;
|
|
7515
|
+
/** Name→value tables for the four code-valued options, so a recorded run configuration can name
|
|
7516
|
+
* them instead of carrying closures. See {@link SuperviseRegistry}. */
|
|
7517
|
+
readonly registry?: SuperviseRegistry;
|
|
7518
|
+
/** Where the coordination MCP binds when the supervisor is harness-driven. Omit = an ephemeral
|
|
7519
|
+
* port on `127.0.0.1`, which an off-host root cannot reach. A non-loopback host is refused
|
|
7520
|
+
* unless `allowUnauthenticatedRemote` acknowledges that the verbs are unauthenticated. */
|
|
7521
|
+
readonly coordination?: CoordinationBinding;
|
|
7522
|
+
/** Override the worker seam directly (tests / advanced) instead of deriving it from `backend`.
|
|
7523
|
+
* This is caller-owned execution: profile security, spawn authorization, and recursive-driver
|
|
7524
|
+
* selection below apply only to the backend-derived worker path. `authorizeMessage` still
|
|
7525
|
+
* governs continuations sent through Runtime's coordination tools. */
|
|
7526
|
+
readonly makeWorkerAgent?: MakeWorkerAgent;
|
|
7527
|
+
/** Run harness-brained supervisors here. Automatic execution supports a local `bridge`; a remote
|
|
7528
|
+
* sandbox requires an explicit `driveHarness` with a reachable coordination relay or tunnel.
|
|
7529
|
+
* Defaults to `backend`; separate it when managers and workers use different services. */
|
|
7530
|
+
readonly driverBackend?: ExecutorConfig;
|
|
7531
|
+
/** Security policy applied to every manager-authored child profile before budget reservation.
|
|
7532
|
+
* The default blocks local and remote MCP, hooks, and connection grants. Pass an explicit
|
|
7533
|
+
* allowlist to grant remote MCP hosts or other author-controlled capabilities. */
|
|
7534
|
+
readonly profileSecurity?: AgentProfileSecurityPolicy;
|
|
7535
|
+
/** Product authority over one complete manager-authored spawn. The callback sees the detached,
|
|
7536
|
+
* immutable profile, task, budget, label, and key together, so approving a profile cannot
|
|
7537
|
+
* authorize a different task. Return the exact allowed profile (which may be narrowed) plus
|
|
7538
|
+
* trusted candidate/pursuit attribution, or throw to refuse the whole spawn before reservation. */
|
|
7539
|
+
readonly authorizeSpawn?: (input: {
|
|
7540
|
+
readonly profile: AgentProfile$1;
|
|
7541
|
+
readonly parent: AgentProfile$1;
|
|
7542
|
+
/** Trusted identity of the manager authorizing this exact child. */
|
|
7543
|
+
readonly parentIdentity: NodeExecutionIdentity;
|
|
7544
|
+
/** Concrete manager node; never accepted from model-authored tool arguments. */
|
|
7545
|
+
readonly parentNodeId: string;
|
|
7546
|
+
/** Stable manager-scoped assignment, including deterministic unkeyed siblings. */
|
|
7547
|
+
readonly assignmentId: string;
|
|
7548
|
+
readonly task: unknown;
|
|
7549
|
+
readonly budget: Budget;
|
|
7550
|
+
readonly label: string;
|
|
7551
|
+
readonly key?: string;
|
|
7552
|
+
readonly depth: number;
|
|
7553
|
+
}) => AuthorizedSpawn;
|
|
7554
|
+
/** Product authority over every continuation sent to a live child. When spawn authorization is
|
|
7555
|
+
* enabled, omitting this refuses steer/answer instructions instead of silently extending the
|
|
7556
|
+
* authorized task. The exact worker identity and detached bytes are recorded before delivery. */
|
|
7557
|
+
readonly authorizeMessage?: (input: DownMessageAuthorizationInput & {
|
|
7558
|
+
readonly parent: AgentProfile$1;
|
|
7559
|
+
readonly depth: number;
|
|
7560
|
+
}) => AuthorizedDownMessage;
|
|
7561
|
+
/** Decide whether an authorized child becomes another supervisor. By default only
|
|
7562
|
+
* `metadata.role === 'driver'` does. Products receive the same frozen post-authorization
|
|
7563
|
+
* context as `resolveDeliverable`, so trusted execution/assignment authority can override
|
|
7564
|
+
* model-authored metadata without a side channel. */
|
|
7565
|
+
readonly isDriverProfile?: (input: AuthorizedSpawnContext) => boolean;
|
|
7566
|
+
/** The supervisor's router substrate (`profile.harness` omitted or `cli-base`). The profile's
|
|
7567
|
+
* model wins. */
|
|
7568
|
+
readonly router?: RouterConfig;
|
|
7569
|
+
/** Inject the supervisor brain directly (tests / advanced). */
|
|
7570
|
+
readonly brain?: ToolLoopChat;
|
|
7571
|
+
/** Run an external-harness supervisor explicitly. Required for a remote sandbox; optional as a
|
|
7572
|
+
* caller-owned override for a local bridge. */
|
|
7573
|
+
readonly driveHarness?: DriveHarness;
|
|
7574
|
+
/** Resolve one custom external-harness session per trusted manager identity. Use this instead of
|
|
7575
|
+
* `driveHarness` when recursive managers must be independently steerable. */
|
|
7576
|
+
readonly resolveDriveHarness?: ResolveDriveHarness;
|
|
7577
|
+
/** Required with a custom `driveHarness` or `resolveDriveHarness`: declares which complete
|
|
7578
|
+
* AgentProfile axes that path really applies. Built-in bridge driving supplies its own
|
|
7579
|
+
* full-profile contract. */
|
|
7580
|
+
readonly driveHarnessMaterialization?: ProfileMaterializationContract;
|
|
7581
|
+
/** Resolve product-owned tools from the exact trusted manager context. The same descriptors and
|
|
7582
|
+
* handlers are bound to router and external-harness managers; resolution happens once per node.
|
|
7583
|
+
* Each handler receives that manager scope's live cancellation signal in its trusted invocation
|
|
7584
|
+
* context, including recursive parent and root cascades. */
|
|
7585
|
+
readonly resolveSupervisorTools?: ResolveSupervisorTools;
|
|
7586
|
+
/** Awaited product transaction hook for every coordination record. `eventId` is stable across a
|
|
7587
|
+
* lost acknowledgement and durable restart; the record is not pull-visible until this commits. */
|
|
7588
|
+
readonly onCoordinationEvent?: (context: SupervisorNodeContext, eventId: Sha256Digest, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
|
|
7589
|
+
/** WORK tools the supervisor may call DIRECTLY — so a recursive atom can ACT (do simple work
|
|
7590
|
+
* itself) OR SPAWN (delegate when it needs parallelism), not be a pure manager. Pair with
|
|
7591
|
+
* `executeExtraTool`. Router arm only (`profile.harness` omitted or `cli-base`). */
|
|
7592
|
+
readonly extraTools?: ReadonlyArray<{
|
|
7593
|
+
readonly name: string;
|
|
7594
|
+
readonly description?: string;
|
|
7595
|
+
readonly parameters: Record<string, unknown>;
|
|
7596
|
+
}>;
|
|
7597
|
+
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
7598
|
+
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
7599
|
+
/** Per-child budget reserved on each spawn. Defaults to a quarter of the pool's tokens. */
|
|
7600
|
+
readonly perWorker?: Budget;
|
|
7601
|
+
/** Hard cap on simultaneously executing spawned workers across the WHOLE recursive tree. The
|
|
7602
|
+
* root is excluded; nested drivers and leaves share one allocation, so recursion cannot multiply
|
|
7603
|
+
* the cap. Omit/`<= 0` = no cap (the conserved pool stays the only bound). */
|
|
7604
|
+
readonly maxLiveWorkers?: number;
|
|
7605
|
+
/** Analyst lenses available to the driver. Required for `analyzeOnSettle`. Unset → status quo
|
|
7606
|
+
* (the driver receives settled worker outputs, no analyst findings). A `string` names an entry in
|
|
7607
|
+
* `registry.analysts`. */
|
|
7608
|
+
readonly analysts?: AnalystRegistry | string;
|
|
7609
|
+
/** Analyst kind ids run AUTOMATICALLY when a worker settles `done` — each re-enters as a `finding`
|
|
7610
|
+
* the driver pulls (`await_event`) and composes its next steer from. The self-improving UP-leg,
|
|
7611
|
+
* threaded to the driver at this level (propagate to sub-drivers via a recursive `makeWorkerAgent`).
|
|
7612
|
+
* Omit/empty = status quo (no analyst feed). Requires `analysts`. */
|
|
7613
|
+
readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
|
|
7614
|
+
/**
|
|
7615
|
+
* Watch every worker's LIVE tool trace with the online detector panel and raise a `finding` the
|
|
7616
|
+
* moment one loops or error-storms — so the supervisor learns it mid-run (via `await_event`)
|
|
7617
|
+
* instead of at settle. Pairs with a steerable worker: the finding is the evidence, `steer_agent`
|
|
7618
|
+
* is the correction. Requires a backend whose executor exposes a trace source (the steerable
|
|
7619
|
+
* sandbox worker and the pi wrapper do); other runtimes are simply not watched.
|
|
7620
|
+
*
|
|
7621
|
+
* Omit = off (status quo — no online watching, no extra events).
|
|
7622
|
+
*/
|
|
7623
|
+
readonly watchWorkers?: WorkerWatchOptions;
|
|
7624
|
+
/** Idle time after which `observe_agent` reports a running worker as `stalled`. A derived read
|
|
7625
|
+
* at observation time — nothing is killed or retried. Omit = the runtime default. */
|
|
7626
|
+
readonly stallAfterMs?: number;
|
|
7627
|
+
/** Worker output store. Defaults to in-memory. */
|
|
7628
|
+
readonly blobs?: ResultBlobStore;
|
|
7629
|
+
/**
|
|
7630
|
+
* Make the run DURABLE: journal + result blobs + the coordination side-log are file-backed under
|
|
7631
|
+
* this directory (`createFileRunContext`), fsynced per write, and the supervisor reads the prior
|
|
7632
|
+
* tree first. Re-running with the same `runDir` AND the same `runId` resumes only when the exact
|
|
7633
|
+
* root profile/task identity and declared budget match. The original absolute deadline and prior
|
|
7634
|
+
* measured spend are restored before new admission. The built-in driver is resume-aware: children
|
|
7635
|
+
* that already settled, including their exact execution identities, are replayed onto
|
|
7636
|
+
* `Scope.resume` (and into the driver's settled ledger + its first context), keyed assignments
|
|
7637
|
+
* (`spawn_agent`'s `key`) resolve to their committed results instead of re-running, pending
|
|
7638
|
+
* waits re-arm on their original deadlines, and the coordination log loads prior questions,
|
|
7639
|
+
* findings, and instruction receipts. The router arm receives all three in its resume brief; the
|
|
7640
|
+
* external arm seeds prior questions while findings and receipts remain in the durable log.
|
|
7641
|
+
* Instruction receipts are evidence and are never delivered automatically to a replacement
|
|
7642
|
+
* worker. The final result spans both processes' work. Unset = in-memory, fresh every call.
|
|
7643
|
+
*
|
|
7644
|
+
* The boundary that remains: work that was IN FLIGHT when the process died is not recovered —
|
|
7645
|
+
* the built-in executors cannot re-attach to a dead process's executions. Each such assignment
|
|
7646
|
+
* resumes as explicitly lost/in-doubt, its full declared reservation is charged conservatively,
|
|
7647
|
+
* and its token/dollar telemetry remains unknown. A retry is admitted only from safely remaining
|
|
7648
|
+
* capacity, so restart cannot mint a fresh budget or slide the original absolute deadline.
|
|
7649
|
+
*
|
|
7650
|
+
* `runId` matters here: it defaults to the constant `'supervise'`, which is fine for a single
|
|
7651
|
+
* resumable run per directory but collides across concurrent runs sharing one `runDir`.
|
|
7652
|
+
*/
|
|
7653
|
+
readonly runDir?: string;
|
|
7654
|
+
/** Override the spawn journal directly (advanced; `runDir` is the ordinary durable path). Pair
|
|
7655
|
+
* with `blobs` — a journal whose result payloads live in a different store cannot replay. */
|
|
7656
|
+
readonly journal?: SpawnJournal;
|
|
7657
|
+
/** Predicate registry for `poll` wait-states (`Scope.wait`). A `poll` names its predicate so the
|
|
7658
|
+
* wait survives a restart; this is what the name resolves against. Unset ⇒ `poll` waits are
|
|
7659
|
+
* refused `unknown-probe` and `timer` waits still work. A `string` names an entry in
|
|
7660
|
+
* `registry.probes`. */
|
|
7661
|
+
readonly probes?: WaitProbeRegistry | string;
|
|
7662
|
+
/**
|
|
7663
|
+
* PROGRESS-derived stop rule (router-brained supervisor). Ends a run that has stopped LEARNING
|
|
7664
|
+
* before it exhausts a ceiling — the answer to "a run should end because it is done or stuck,
|
|
7665
|
+
* not because it ran out". It composes with the budget guards and can never override one.
|
|
7666
|
+
*
|
|
7667
|
+
* Build it from `supervise/stop-rules`: `plateau({window, minDelta})`,
|
|
7668
|
+
* `noProgressFor({ms, settles})`, `allWorkersStalled({...})`, combined with `anyOf`/`allOf`. The
|
|
7669
|
+
* thresholds are policy and stay with you; the enforcement lives in the runtime. Omit = ceilings
|
|
7670
|
+
* only (unchanged behavior).
|
|
7671
|
+
*/
|
|
7672
|
+
readonly stopRule?: StopRule;
|
|
7673
|
+
/** One-shot notification of WHY a `stopRule` ended the run — so a caller records the reason
|
|
7674
|
+
* instead of inferring an early stop from an unexhausted budget. */
|
|
7675
|
+
readonly onProgressStop?: (reason: string) => void;
|
|
7274
7676
|
readonly maxDepth?: number;
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
*
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
readonly
|
|
7282
|
-
|
|
7677
|
+
readonly maxTurns?: number;
|
|
7678
|
+
/** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only): once
|
|
7679
|
+
* its coordination transcript exceeds `thresholdTokens` it distills to a compact progress note and
|
|
7680
|
+
* continues, instead of re-billing the whole transcript every turn (the cost that makes the LLM-brain
|
|
7681
|
+
* front door lose to a dumb-Ralph respawn). The live `Scope` roster is the durable state across
|
|
7682
|
+
* chapters. Default off. `distill` defaults to a brain self-summary + the settled-worker roster. */
|
|
7683
|
+
readonly compaction?: ToolLoopCompactionOptions;
|
|
7684
|
+
readonly runId?: string;
|
|
7283
7685
|
readonly now?: () => number;
|
|
7284
|
-
/**
|
|
7285
|
-
*
|
|
7286
|
-
* (
|
|
7686
|
+
/** Restrict the run to this subset of models. When set, every configured model — the
|
|
7687
|
+
* supervisor router model, the profile's model, and the backend's model — must be a member,
|
|
7688
|
+
* or `supervise()` throws a `ConfigError` before any compute is spent. Unset = unrestricted. */
|
|
7689
|
+
readonly allowedModels?: readonly string[];
|
|
7690
|
+
/** How the settled-worker ledger becomes the run's output. Default `bestDelivered` — the single
|
|
7691
|
+
* highest-scoring DELIVERED child (the exact behavior every existing caller had). Alternatives:
|
|
7692
|
+
* `collectDelivered` (every verified distinct output with provenance — a Pareto set / recorded
|
|
7693
|
+
* disagreement) or a custom `SupervisorFinalizer`. Whatever the finalizer, it operates on
|
|
7694
|
+
* structurally DELIVERED outputs only — an undelivered or invalid child stays ineligible. A
|
|
7695
|
+
* `string` names an entry in `registry.finalizers`. */
|
|
7696
|
+
readonly finalizer?: SupervisorFinalizer | string;
|
|
7697
|
+
/** Lifecycle observers for the whole recursive tree (`Scope` re-seeds them into every nested
|
|
7698
|
+
* scope). Composed with the `otel` recorder below when both are set. Omit = no observers, which
|
|
7699
|
+
* is the behavior every existing caller has. */
|
|
7287
7700
|
readonly hooks?: RuntimeHooks;
|
|
7288
7701
|
/**
|
|
7289
|
-
*
|
|
7290
|
-
*
|
|
7291
|
-
*
|
|
7292
|
-
*
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
readonly runtime: NodeSnapshot['runtime'];
|
|
7298
|
-
readonly authoredProfile?: unknown;
|
|
7299
|
-
readonly attemptId: string;
|
|
7300
|
-
readonly prior?: ProfileMaterializationReceipt;
|
|
7301
|
-
readonly journalRoot?: NodeId;
|
|
7302
|
-
readonly nodeId?: NodeId;
|
|
7303
|
-
readonly requiredKnown?: boolean;
|
|
7304
|
-
readonly onReceipt?: (materialization: ProfileMaterializationReceipt, binding: ExecutionBindingReceipt) => void;
|
|
7305
|
-
};
|
|
7306
|
-
/**
|
|
7307
|
-
* Resume seam — set ONLY by the supervisor when `SupervisorOpts.resume` is on AND a non-empty
|
|
7308
|
-
* journal tree exists for this root. It carries the replayed committed work (so `scope.resume`
|
|
7309
|
-
* exposes it to a resume-aware `act`) and the recorded ordinal/cursor maxima the new counters
|
|
7310
|
-
* continue past, so a freshly-spawned child never reuses a journaled `seq`. Absent ⇒ fresh run.
|
|
7702
|
+
* OPT-IN OTLP tracing: emit one span per supervised node (opened at spawn, closed at settle,
|
|
7703
|
+
* parented to its parent node's span) plus an `LLM` child span per metered driver turn, so the
|
|
7704
|
+
* tree is readable by any trace viewer instead of only by a journal parser. See `otel-spans.ts`.
|
|
7705
|
+
*
|
|
7706
|
+
* Omit and the run emits nothing, allocates no recorder, and installs no hook — telemetry is
|
|
7707
|
+
* never a default. Present with no reachable endpoint (no `exportConfig.endpoint` and no
|
|
7708
|
+
* `OTEL_EXPORTER_OTLP_ENDPOINT`) is also a no-op. The spawn journal is untouched either way:
|
|
7709
|
+
* spans are telemetry, never the replay/resume record.
|
|
7311
7710
|
*/
|
|
7312
|
-
readonly
|
|
7313
|
-
readonly settled: ReadonlyArray<Settled<unknown>>;
|
|
7314
|
-
readonly view: TreeView;
|
|
7315
|
-
/** Highest `spawned` ordinal already journaled; new spawns start at `+1`. */
|
|
7316
|
-
readonly maxSpawnOrdinal: number;
|
|
7317
|
-
/** Highest cursor `seq` already journaled; new settlements start at `+1`. */
|
|
7318
|
-
readonly maxCursorSeq: number;
|
|
7319
|
-
/** Highest `waiting` ordinal already journaled; new waits start at `+1`. */
|
|
7320
|
-
readonly maxWaitOrdinal: number;
|
|
7321
|
-
/** Waits journaled as armed but never woken — re-armed (same node id, same absolute deadline)
|
|
7322
|
-
* when `wait` is called again with the SAME label. */
|
|
7323
|
-
readonly waits: ReadonlyArray<PendingWait>;
|
|
7324
|
-
/** Keyed assignments from the prior journal — what a keyed re-spawn resolves against. */
|
|
7325
|
-
readonly keys: ReadonlyMap<string, ResumedKeyState<unknown>>;
|
|
7326
|
-
/** Prior committed spend summed off the journal (settled child work + metered inference). */
|
|
7327
|
-
readonly priorSpend: {
|
|
7328
|
-
readonly childWork: Spend;
|
|
7329
|
-
readonly driverInference: Spend;
|
|
7330
|
-
};
|
|
7331
|
-
};
|
|
7332
|
-
}
|
|
7333
|
-
/** Mutable only inside Scope admission/release. Every nested scope receives this exact object. */
|
|
7334
|
-
interface LiveWorkerCapacityState {
|
|
7335
|
-
readonly max: number | undefined;
|
|
7336
|
-
live: number;
|
|
7337
|
-
}
|
|
7338
|
-
/** Create the reactive `Scope` a driver's `Agent.act` runs inside: spawn children on an atomically reserved conserved budget, settle via the `next()` cursor, journal for replay. */
|
|
7339
|
-
declare function createScope<Out>(args: ScopeArgs): Scope<Out>;
|
|
7340
|
-
/**
|
|
7341
|
-
* The step-8 merge-boundary adapter (M4): rehydrate a `Settled.done` into the kernel's
|
|
7342
|
-
* `Iteration` shape so `defaultSelectWinner` stays single-sourced — the supervisor selects
|
|
7343
|
-
* across settled children with the SAME argmax the loop kernel uses, not a forked copy.
|
|
7344
|
-
*
|
|
7345
|
-
* `index` is the cursor `seq` (the recorded, replay-stable order); `output`/`verdict`/
|
|
7346
|
-
* `tokenUsage`/`costUsd` are read straight off the settlement (already rehydrated from the
|
|
7347
|
-
* `outRef` blob by `next()`). Events are empty — a settled child is an opaque leaf result,
|
|
7348
|
-
* not a sandbox event stream — and the timing/cost fields project its conserved `Spend`.
|
|
7349
|
-
* Fail loud on a `down` settlement: only a `done` child is an iteration.
|
|
7350
|
-
*/
|
|
7351
|
-
declare function settledToIteration<Out>(settled: Settled<Out>): Iteration<unknown, Out>;
|
|
7352
|
-
//#endregion
|
|
7353
|
-
//#region src/runtime/supervise/supervisor-agent.d.ts
|
|
7354
|
-
/**
|
|
7355
|
-
* The supervisor's profile — the subset of an `AgentProfile` that selects + shapes its brain.
|
|
7356
|
-
* `harness` is the backend-as-data discriminant; `systemPrompt` is the standing instruction.
|
|
7357
|
-
*
|
|
7358
|
-
* A canonical `AgentProfile` from `@tangle-network/agent-interface` satisfies this interface
|
|
7359
|
-
* structurally: its `model` is a hints OBJECT and its system prompt lives at `prompt.systemPrompt`,
|
|
7360
|
-
* so both spellings are accepted here and reduced by {@link resolveSupervisorProfile}. Before that,
|
|
7361
|
-
* a canonical profile's model object reached `RouterConfig.model` (a string) as an object and its
|
|
7362
|
-
* `prompt.systemPrompt` was dropped — a request the provider rejects, and a supervisor running the
|
|
7363
|
-
* default strategy while its profile named another.
|
|
7364
|
-
*
|
|
7365
|
-
* WHAT EACH ARM HONORS — the two brains read different amounts of a profile, so state it rather
|
|
7366
|
-
* than let a caller infer that a field took effect:
|
|
7367
|
-
*
|
|
7368
|
-
* - ROUTER arm (`harness` null): only `name`, the resolved model id (`model`, or
|
|
7369
|
-
* `model.default`), and the resolved system prompt (`prompt.systemPrompt`/`systemPrompt` plus
|
|
7370
|
-
* `prompt.instructions` and `resources.instructions`) reach the brain. A full `AgentProfile`'s
|
|
7371
|
-
* `tools`, `mcp`, `permissions`, `resources.skills`/`files`, `hooks`, `modes`, `subagents`,
|
|
7372
|
-
* `model.provider`, `model.small` and `model.reasoningEffort` are NOT honored here: the router
|
|
7373
|
-
* brain is one `ToolLoopChat` over the coordination verbs, and neither of its two tool-calling
|
|
7374
|
-
* transports (`routerChatWithTools` buffered, `streamRouterChatWithTools` when
|
|
7375
|
-
* `RouterConfig.stream` is set) has a parameter for any of them.
|
|
7376
|
-
* - HARNESS arm (`harness` set): the WHOLE profile object is handed to `deps.driveHarness`
|
|
7377
|
-
* untouched, plus the resolved system prompt as a separate argument. Everything the profile
|
|
7378
|
-
* declares is the harness's to materialize; this module changes none of it.
|
|
7379
|
-
*/
|
|
7380
|
-
interface SupervisorProfile {
|
|
7381
|
-
readonly name?: string;
|
|
7382
|
-
/** null/undefined/`cli-base` → router brain (in-process tool-loop); a coding-CLI harness → an
|
|
7383
|
-
* external harness brain. */
|
|
7384
|
-
readonly harness?: string | null;
|
|
7385
|
-
/** The router model when the brain is router-driven: a model id, or a canonical profile's model
|
|
7386
|
-
* hints whose `default` IS the id. Absent (including a hints object with no `default`) → the
|
|
7387
|
-
* deps router config's model applies. Other hints (`small`, `provider`, `reasoningEffort`) are
|
|
7388
|
-
* harness-arm material only. */
|
|
7389
|
-
readonly model?: string | AgentProfileModelHints;
|
|
7390
|
-
/** Canonical `AgentProfile` prompt shaping. `prompt.systemPrompt` and the top-level `systemPrompt`
|
|
7391
|
-
* are the same standing instruction in two spellings; disagreeing values are a fault, not a pick.
|
|
7392
|
-
* `prompt.instructions` lines are appended to the resolved prompt, one per line. */
|
|
7393
|
-
readonly prompt?: AgentProfilePrompt;
|
|
7394
|
-
/** Canonical `AgentProfile` resources. Only `instructions` shapes the brain here (appended to the
|
|
7395
|
-
* resolved system prompt); every other resource is the harness's to materialize. */
|
|
7396
|
-
readonly resources?: AgentProfileResources;
|
|
7397
|
-
/** The standing instructions ("you delegate, you do not solve"). */
|
|
7398
|
-
readonly systemPrompt?: string;
|
|
7399
|
-
}
|
|
7400
|
-
/** A `SupervisorProfile` reduced to the scalars the two brain arms consume. `modelId`/`systemPrompt`
|
|
7401
|
-
* stay `undefined` when the profile named none — the caller's fallback (`deps.router.model`,
|
|
7402
|
-
* the built-in default supervisor prompt) then applies, and this type cannot hide which happened.
|
|
7403
|
-
*
|
|
7404
|
-
* There is deliberately no `reasoningEffort` here: the router brain runs on `chatWithTools` (the
|
|
7405
|
-
* buffered/streamed switch in the router client), and neither transport has a `reasoning_effort`
|
|
7406
|
-
* parameter — only the chat-only `routerChatWithUsage` does — so a field carrying it would be a
|
|
7407
|
-
* public promise nothing keeps. `model.reasoningEffort` still reaches the harness arm inside the
|
|
7408
|
-
* profile. */
|
|
7409
|
-
interface ResolvedSupervisorProfile {
|
|
7410
|
-
readonly name: string;
|
|
7411
|
-
readonly harness: string | null;
|
|
7412
|
-
readonly modelId?: string;
|
|
7413
|
-
readonly systemPrompt?: string;
|
|
7414
|
-
}
|
|
7415
|
-
/**
|
|
7416
|
-
* Reduce either profile spelling — a hand-written `SupervisorProfile` or a canonical `AgentProfile`
|
|
7417
|
-
* — to the scalars the brain arms consume:
|
|
7418
|
-
*
|
|
7419
|
-
* - `modelId`: a string `model` verbatim, else `model.default`. Absent or unresolvable → the
|
|
7420
|
-
* router config's own model applies unchanged.
|
|
7421
|
-
* - `systemPrompt`: the system prompt plus the `prompt.instructions` and `resources.instructions`
|
|
7422
|
-
* lines, one per line.
|
|
7423
|
-
*
|
|
7424
|
-
* `supervisorAgent` resolves each piece only where it is consumed (the model id on the router arm
|
|
7425
|
-
* only); this whole-profile reduction is the caller-facing view of the same rules.
|
|
7426
|
-
*/
|
|
7427
|
-
declare function resolveSupervisorProfile(profile: SupervisorProfile): ResolvedSupervisorProfile;
|
|
7428
|
-
/** Where the coordination MCP binds. Omit = an ephemeral port on `127.0.0.1` (the local-harness
|
|
7429
|
-
* default); set `host` when the root or the harness runs off-host. */
|
|
7430
|
-
interface CoordinationBinding {
|
|
7431
|
-
readonly host?: string;
|
|
7432
|
-
readonly port?: number;
|
|
7433
|
-
/** Explicit acknowledgment required to bind a NON-loopback host — see
|
|
7434
|
-
* {@link assertCoordinationBinding} for what is being accepted. */
|
|
7435
|
-
readonly allowUnauthenticatedRemote?: boolean;
|
|
7711
|
+
readonly otel?: Omit<SupervisorSpanOptions, 'runId' | 'now'>;
|
|
7436
7712
|
}
|
|
7437
|
-
/**
|
|
7438
|
-
*
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
* explicit, recorded acknowledgment — never a silent bind.
|
|
7443
|
-
*/
|
|
7444
|
-
declare function assertCoordinationBinding(binding: CoordinationBinding | undefined): void;
|
|
7445
|
-
/** Trusted run/node identity Runtime binds to one manager. Model-authored tool arguments cannot
|
|
7446
|
-
* provide or replace any of these fields. */
|
|
7447
|
-
interface SupervisorNodeContext {
|
|
7448
|
-
readonly runId: string;
|
|
7449
|
-
/** Stable across a durable restart; unique per in-memory invocation. */
|
|
7450
|
-
readonly runNamespace: string;
|
|
7451
|
-
/** Concrete Scope node that owns this manager's coordination stream. */
|
|
7452
|
-
readonly nodeId: string;
|
|
7453
|
-
/** Stable identity of this manager's coordination stream. */
|
|
7454
|
-
readonly ownerId: string;
|
|
7455
|
-
readonly depth: number;
|
|
7456
|
-
readonly identity: NodeExecutionIdentity;
|
|
7457
|
-
/** Assignment identity within the parent manager; absent only for the root. */
|
|
7458
|
-
readonly assignmentId?: string;
|
|
7459
|
-
readonly profile: SupervisorProfile;
|
|
7460
|
-
readonly task: unknown;
|
|
7713
|
+
/** The product-authorized result for one complete spawn request. Attribution is never accepted
|
|
7714
|
+
* from the manager itself; it enters only through this trusted callback. */
|
|
7715
|
+
interface AuthorizedSpawn {
|
|
7716
|
+
readonly profile: AgentProfile$1;
|
|
7717
|
+
readonly execution?: AgentExecutionRef;
|
|
7461
7718
|
}
|
|
7462
|
-
/**
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
readonly
|
|
7719
|
+
/** Exact trusted context after a manager-authored spawn has passed product authorization. */
|
|
7720
|
+
interface AuthorizedSpawnContext {
|
|
7721
|
+
readonly profile: AgentProfile$1;
|
|
7722
|
+
readonly parent: AgentProfile$1;
|
|
7723
|
+
readonly parentIdentity: NodeExecutionIdentity;
|
|
7724
|
+
readonly execution: NodeExecutionIdentity;
|
|
7725
|
+
readonly parentNodeId: string;
|
|
7726
|
+
readonly assignmentId: string;
|
|
7727
|
+
readonly task: unknown;
|
|
7728
|
+
readonly budget: Budget;
|
|
7729
|
+
readonly label: string;
|
|
7730
|
+
readonly key?: string;
|
|
7731
|
+
readonly depth: number;
|
|
7470
7732
|
}
|
|
7471
|
-
/**
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7733
|
+
/** Exact trusted context for selecting one backend-derived leaf's completion check. */
|
|
7734
|
+
type DeliverableResolutionInput = AuthorizedSpawnContext;
|
|
7735
|
+
/** One-call supervisor: build + run a supervisor from its profile with sensible defaults; the raw `supervisorAgent` + `createSupervisor().run` seams stay available for power use. */
|
|
7736
|
+
declare function supervise(profile: SupervisorProfile, task: unknown, opts: SuperviseOptions): Promise<SupervisedResult<unknown>>;
|
|
7737
|
+
//#endregion
|
|
7738
|
+
//#region src/runtime/supervise/graph.d.ts
|
|
7739
|
+
/** A graph node: an id and a canonical `AgentProfile`. The profile is the ONLY way a node is
|
|
7740
|
+
* described — its `prompt.systemPrompt` is the standing role (the 0.117 canonical resolution;
|
|
7741
|
+
* never a legacy top-level-only reduction), its tools/mcp/resources are its capabilities. */
|
|
7742
|
+
interface GraphNode {
|
|
7743
|
+
readonly id: NodeId;
|
|
7744
|
+
readonly profile: AgentProfile$1;
|
|
7476
7745
|
}
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7746
|
+
type GraphEdge =
|
|
7747
|
+
/** Work flows down. The delegation directive is DATA → versionable, sweepable, optimizable.
|
|
7748
|
+
* Each spawn of `to` by `from` — and each mid-run steer from `from` to a live `to` worker —
|
|
7749
|
+
* is one traversal. */
|
|
7750
|
+
{
|
|
7751
|
+
readonly kind: 'delegates';
|
|
7752
|
+
readonly from: NodeId;
|
|
7753
|
+
readonly to: NodeId;
|
|
7754
|
+
readonly directive: PromptHandle;
|
|
7755
|
+
/** Cyclic-graph backstop: traversals beyond this REFUSE (fail loud). Default
|
|
7756
|
+
* {@link defaultEdgeTraversalCap}. */
|
|
7757
|
+
readonly maxTraversals?: number;
|
|
7758
|
+
} |
|
|
7759
|
+
/** Findings flow anywhere: an analyst LENS (environment, never a node) over N nodes' settled
|
|
7760
|
+
* traces, delivered to ONE node wrapped in a directive telling the recipient what to do with
|
|
7761
|
+
* the analysis. */
|
|
7762
|
+
{
|
|
7763
|
+
readonly kind: 'analyzes';
|
|
7764
|
+
/** The analyst lens id, resolved against `RunGraphOptions.analysts`. NOT a node id. */
|
|
7765
|
+
readonly analyst: string;
|
|
7766
|
+
readonly over: ReadonlyArray<NodeId>;
|
|
7767
|
+
readonly to: NodeId;
|
|
7768
|
+
readonly directive: PromptHandle;
|
|
7769
|
+
/** Observability cap: traversals beyond this are LEDGERED as exhausted (`unpropagated`).
|
|
7770
|
+
* Only delegates caps refuse traversal — they are what close the spawn cycle. */
|
|
7771
|
+
readonly maxTraversals?: number;
|
|
7772
|
+
};
|
|
7773
|
+
interface AgentGraph {
|
|
7774
|
+
readonly nodes: ReadonlyArray<GraphNode>;
|
|
7775
|
+
readonly edges: ReadonlyArray<GraphEdge>;
|
|
7776
|
+
/** Termination is mandatory, not optional: the independent completion oracle. */
|
|
7777
|
+
readonly deliverable: DeliverableSpec<unknown>;
|
|
7778
|
+
/** One conserved pool across the whole graph — cycles without conservation never terminate. */
|
|
7779
|
+
readonly budget: Budget;
|
|
7506
7780
|
}
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
/**
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
readonly
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
readonly
|
|
7520
|
-
/**
|
|
7521
|
-
readonly
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7781
|
+
type EdgeDeliveryOutcome = 'delivered' | 'stripped' | 'empty' | 'unpropagated';
|
|
7782
|
+
/** One recorded edge traversal — the in-memory row; the journal twin is the `edge` SpawnEvent. */
|
|
7783
|
+
interface EdgeTraversal {
|
|
7784
|
+
/** Stable edge id: `delegates:<from>-><to>` or `analyzes:<analyst>:<over…>-><to>`. */
|
|
7785
|
+
readonly edge: string;
|
|
7786
|
+
readonly kind: 'delegates' | 'analyzes';
|
|
7787
|
+
readonly from: string;
|
|
7788
|
+
readonly to: string;
|
|
7789
|
+
/** The resolved directive reference (`<surface>/v<n>`). */
|
|
7790
|
+
readonly directive: string;
|
|
7791
|
+
/** 1-based per-edge ordinal. */
|
|
7792
|
+
readonly traversal: number;
|
|
7793
|
+
readonly outcome: EdgeDeliveryOutcome;
|
|
7794
|
+
/** Bytes of directive + payload that actually crossed the edge. */
|
|
7795
|
+
readonly bytes: number;
|
|
7796
|
+
readonly reason?: string;
|
|
7797
|
+
/** The concrete worker node id, once known. */
|
|
7798
|
+
readonly workerId?: string;
|
|
7799
|
+
}
|
|
7800
|
+
/** Default per-edge traversal cap — the cyclic-graph backstop when an edge names none. */
|
|
7801
|
+
declare const defaultEdgeTraversalCap = 32;
|
|
7802
|
+
/** A delegates edge exhausted its traversal cap and the run produced no winner: the cap, not the
|
|
7803
|
+
* task, ended it. Carries the full evidence so failing loud loses nothing. */
|
|
7804
|
+
declare class GraphEdgeCapError extends Error {
|
|
7805
|
+
readonly exhaustedEdges: ReadonlyArray<string>;
|
|
7806
|
+
readonly ledger: ReadonlyArray<EdgeTraversal>;
|
|
7807
|
+
readonly result: SupervisedResult<unknown>;
|
|
7808
|
+
constructor(exhaustedEdges: ReadonlyArray<string>, ledger: ReadonlyArray<EdgeTraversal>, result: SupervisedResult<unknown>);
|
|
7809
|
+
}
|
|
7810
|
+
interface RunGraphOptions {
|
|
7811
|
+
/** WHERE worker nodes run — the executor backend. Provide this OR `makeWorkerAgent`. */
|
|
7812
|
+
readonly backend?: ExecutorConfig;
|
|
7813
|
+
/** Leaf-execution override (offline tests / advanced). `runGraph` still owns node pinning,
|
|
7814
|
+
* directive delivery, and the edge ledger AROUND this seam — only the leaf `act` is yours. */
|
|
7815
|
+
readonly makeWorkerAgent?: MakeWorkerAgent;
|
|
7816
|
+
/** The driver brain's router substrate (`profile.harness` omitted or `cli-base`). */
|
|
7528
7817
|
readonly router?: RouterConfig;
|
|
7529
|
-
/**
|
|
7818
|
+
/** Caller-side runtime hooks (telemetry, policy, product extensions). Composed AFTER the
|
|
7819
|
+
* graph's own spawn-binding hook on the SAME event stream — the graph never swallows the
|
|
7820
|
+
* seam supervise() exposes. */
|
|
7821
|
+
readonly hooks?: RuntimeHooks;
|
|
7822
|
+
/** Inject the driver brain directly (offline tests / advanced). */
|
|
7530
7823
|
readonly brain?: ToolLoopChat;
|
|
7531
|
-
/**
|
|
7532
|
-
readonly driveHarness?: DriveHarness;
|
|
7533
|
-
/** Trusted identity for this manager. Required with node-scoped tools or observation. */
|
|
7534
|
-
readonly nodeContext?: SupervisorNodeContextSeed;
|
|
7535
|
-
/** Resolve product-owned tools for this exact manager. Static `extraTools` remain a router-only
|
|
7536
|
-
* compatibility seam and deliberately receive no new recursive authority. */
|
|
7537
|
-
readonly resolveSupervisorTools?: ResolveSupervisorTools;
|
|
7538
|
-
/** Awaited product observation, enriched with this manager's actual live node context. */
|
|
7539
|
-
readonly observeNodeEvent?: ObserveSupervisorNodeEvent;
|
|
7540
|
-
/** Replay resume-time settlements through `observeNodeEvent` before the manager starts. */
|
|
7541
|
-
readonly replaySettlements?: boolean;
|
|
7542
|
-
/** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
|
|
7543
|
-
* only delegate when it needs parallelism. Pair with `executeExtraTool`. */
|
|
7544
|
-
readonly extraTools?: ReadonlyArray<{
|
|
7545
|
-
readonly name: string;
|
|
7546
|
-
readonly description?: string;
|
|
7547
|
-
readonly parameters: Record<string, unknown>;
|
|
7548
|
-
}>;
|
|
7549
|
-
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
7550
|
-
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
7551
|
-
/** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
|
|
7824
|
+
/** The analyst lens registry `analyzes` edges resolve against. ENVIRONMENT, not nodes. */
|
|
7552
7825
|
readonly analysts?: AnalystRegistry;
|
|
7553
|
-
/**
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
readonly
|
|
7559
|
-
/**
|
|
7560
|
-
readonly
|
|
7561
|
-
/** PROGRESS-derived stop rule (router arm). Ends a run that has stopped learning BEFORE it
|
|
7562
|
-
* exhausts a ceiling; it can never keep a run alive past one. Build it with `plateau` /
|
|
7563
|
-
* `noProgressFor` / `allWorkersStalled` from `supervise/stop-rules` — the thresholds are the
|
|
7564
|
-
* caller's judgment. Omit = ceilings only. */
|
|
7565
|
-
readonly stopRule?: StopRule;
|
|
7566
|
-
/** One-shot notification of WHY a `stopRule` ended the run. */
|
|
7567
|
-
readonly onProgressStop?: (reason: string) => void;
|
|
7826
|
+
/** Directive registry. Default: the seeded kernel registry (`kernelPromptRegistry()`). */
|
|
7827
|
+
readonly registry?: PromptRegistry;
|
|
7828
|
+
/** The run journal the edge ledger and every spawn/settle ride. Default: in-memory. */
|
|
7829
|
+
readonly journal?: SpawnJournal;
|
|
7830
|
+
readonly blobs?: ResultBlobStore;
|
|
7831
|
+
readonly runId?: string;
|
|
7832
|
+
/** Per-child budget reserved from the conserved pool on each spawn. */
|
|
7833
|
+
readonly perWorker?: Budget;
|
|
7568
7834
|
readonly maxTurns?: number;
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
*
|
|
7572
|
-
readonly
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
readonly
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
* questions seed the ledger; receipts remain durable evidence and are never auto-delivered. */
|
|
7579
|
-
readonly priorCoordination?: PriorCoordination;
|
|
7580
|
-
/** Deferred owner-scoped replay for a recursive supervisor. Its stable owner is known while the
|
|
7581
|
-
* parent authorizes the child, but loading remains asynchronous; Runtime calls this before the
|
|
7582
|
-
* nested brain can publish or act on coordination state. */
|
|
7583
|
-
readonly loadPriorCoordination?: () => Promise<PriorCoordination>;
|
|
7584
|
-
/** How the settled ledger becomes the run's output (both arms). Default `bestDelivered` — the
|
|
7585
|
-
* exact keep-best every existing caller had. Always runs under the delivered-only invariant. */
|
|
7586
|
-
readonly finalizer?: SupervisorFinalizer;
|
|
7587
|
-
/** Where the coordination MCP binds (external arm). Omit = an ephemeral loopback port, which is
|
|
7588
|
-
* unreachable from an off-host harness. A non-loopback host fails closed — see
|
|
7589
|
-
* {@link assertCoordinationBinding}. */
|
|
7590
|
-
readonly coordination?: CoordinationBinding;
|
|
7835
|
+
readonly maxLiveWorkers?: number;
|
|
7836
|
+
/** Product authority over every steer/answer instruction (the filter seam). `runGraph` observes
|
|
7837
|
+
* what it CHANGES: a narrowed instruction ledgers its steer traversal as `stripped`. */
|
|
7838
|
+
readonly authorizeMessage?: SuperviseOptions['authorizeMessage'];
|
|
7839
|
+
readonly signal?: AbortSignal;
|
|
7840
|
+
readonly now?: () => number;
|
|
7841
|
+
readonly otel?: SuperviseOptions['otel'];
|
|
7842
|
+
readonly stallAfterMs?: number;
|
|
7843
|
+
readonly allowedModels?: readonly string[];
|
|
7591
7844
|
}
|
|
7592
|
-
|
|
7593
|
-
|
|
7845
|
+
interface GraphResult<Out = unknown> {
|
|
7846
|
+
readonly result: SupervisedResult<Out>;
|
|
7847
|
+
/** Every edge traversal, in occurrence order — the observable-edge contract. */
|
|
7848
|
+
readonly ledger: ReadonlyArray<EdgeTraversal>;
|
|
7849
|
+
/** Edge ids whose traversal cap was hit — analyzes exhaustion included (observable here, never
|
|
7850
|
+
* a refusal). A DELEGATES cap paired with a `no-winner` result THROWS
|
|
7851
|
+
* ({@link GraphEdgeCapError}) instead of returning: only delegates caps refuse spawns, so only
|
|
7852
|
+
* they can have ended the run. A LIFECYCLE no-winner (`aborted` / `budget-exhausted`) returns
|
|
7853
|
+
* normally even with an exhausted delegates cap — the abort or the pool, not the cap, ended
|
|
7854
|
+
* that run, and the exhaustion stays observable here. */
|
|
7855
|
+
readonly exhaustedEdges: ReadonlyArray<string>;
|
|
7856
|
+
readonly runId: string;
|
|
7857
|
+
}
|
|
7858
|
+
/**
|
|
7859
|
+
* Execute an {@link AgentGraph}. The root node becomes the supervisor (`supervise()` — the
|
|
7860
|
+
* execution core), each worker node is spawnable BY NODE ID (`spawn_agent` with
|
|
7861
|
+
* `profile: { name: '<node id>' }`; the node's canonical profile is pinned by the graph), each
|
|
7862
|
+
* delegates directive is appended to the worker profile's `prompt.instructions` per traversal,
|
|
7863
|
+
* and each analyzes edge becomes an analyst-on-settle route with a real DESTINATION. Every
|
|
7864
|
+
* traversal is ledgered and journaled.
|
|
7865
|
+
*/
|
|
7866
|
+
declare function runGraph(graph: AgentGraph, opts: RunGraphOptions): Promise<GraphResult>;
|
|
7594
7867
|
//#endregion
|
|
7595
|
-
//#region src/runtime/supervise/
|
|
7868
|
+
//#region src/runtime/supervise/model-policy.d.ts
|
|
7869
|
+
/**
|
|
7870
|
+
* Throw a `ConfigError` when `allowed` is set, `model` is defined, and `model` is not a
|
|
7871
|
+
* member of `allowed`. No-op when `allowed` is unset (the unrestricted default) or when
|
|
7872
|
+
* `model` is undefined (nothing was configured to check).
|
|
7873
|
+
*/
|
|
7874
|
+
declare function assertModelAllowed(model: string | undefined, allowed: readonly string[] | undefined): void;
|
|
7875
|
+
/** Check every canonical model-bearing field in a complete profile, including the models a
|
|
7876
|
+
* backend may select for cheap work, named subagents, or modes. */
|
|
7877
|
+
declare function assertProfileModelsAllowed(profile: AgentProfile$1, allowed: readonly string[] | undefined): void;
|
|
7878
|
+
//#endregion
|
|
7879
|
+
//#region src/runtime/supervise/patch-checks.d.ts
|
|
7880
|
+
/** @experimental The per-task constraints the mechanical gate enforces. */
|
|
7881
|
+
interface CoderCheckConstraints {
|
|
7882
|
+
/** Default 400. Hard cap; gate fails when exceeded. */
|
|
7883
|
+
maxDiffLines?: number;
|
|
7884
|
+
/** Literal path prefixes the patch must not touch. */
|
|
7885
|
+
forbiddenPaths?: string[];
|
|
7886
|
+
}
|
|
7887
|
+
//#endregion
|
|
7888
|
+
//#region src/runtime/supervise/worktree-cli-executor.d.ts
|
|
7889
|
+
/** Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured
|
|
7890
|
+
* diff + the harness's run record + the derived checks). */
|
|
7891
|
+
type WorktreePatchArtifact = WorktreeHarnessResult;
|
|
7892
|
+
/** @experimental */
|
|
7893
|
+
interface WorktreeCliExecutorOptions {
|
|
7894
|
+
/** Absolute path to the git checkout the worktree is cut from. */
|
|
7895
|
+
repoRoot: string;
|
|
7896
|
+
/**
|
|
7897
|
+
* The supervisor-authored prompt/model plus materializable structural resources.
|
|
7898
|
+
* `model.default` selects the one-shot model. Routing-only model hints, placement concerns,
|
|
7899
|
+
* provider extensions, and `resources.failOnError` fail before execution because this path
|
|
7900
|
+
* cannot honor them. Harness-specific values the materializer cannot preserve also fail closed.
|
|
7901
|
+
*/
|
|
7902
|
+
profile: AgentProfile$1;
|
|
7903
|
+
/** Local CLI for this leaf. This explicit choice overrides `profile.harness`. */
|
|
7904
|
+
harness: LocalHarness;
|
|
7905
|
+
/** Default instruction for direct `execute(undefined, signal)` calls. An execution-time task
|
|
7906
|
+
* is authoritative. Omit when the caller always supplies the task to `execute`. */
|
|
7907
|
+
taskPrompt?: string;
|
|
7908
|
+
/** Unique id for the worktree path + branch. Defaults to a fresh UUID. */
|
|
7909
|
+
runId?: string;
|
|
7910
|
+
/** Override the base ref the worktree is cut from (default `HEAD`). */
|
|
7911
|
+
baseRef?: string;
|
|
7912
|
+
/** Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). */
|
|
7913
|
+
harnessTimeoutMs?: number;
|
|
7914
|
+
/** Run Codex with an ephemeral session, isolated config/instructions, network disabled, and
|
|
7915
|
+
* JSONL usage capture. Requires `harness: 'codex'`; metered by default. */
|
|
7916
|
+
codexReproducible?: boolean;
|
|
7917
|
+
/** Absolute host paths denied to reproducible Codex (for benchmark answer copies, credentials,
|
|
7918
|
+
* or other task-specific ambient state). */
|
|
7919
|
+
codexReadDeniedPaths?: ReadonlyArray<string>;
|
|
7920
|
+
/**
|
|
7921
|
+
* Shell command run in the live worktree to derive the tests-PASS signal (e.g. `pnpm test`).
|
|
7922
|
+
* Its exit code becomes `artifact.checks.tests.passed`. Omit to skip (no signal derived).
|
|
7923
|
+
*/
|
|
7924
|
+
testCmd?: string;
|
|
7925
|
+
/** Shell command run in the live worktree to derive the typecheck-PASS signal (e.g. `pnpm typecheck`). */
|
|
7926
|
+
typecheckCmd?: string;
|
|
7927
|
+
/** Wall-clock cap per verification command (ms). Default = `harnessTimeoutMs` or 5 min. */
|
|
7928
|
+
checkTimeoutMs?: number;
|
|
7929
|
+
/** Cap on each check's captured output. Default 16k. */
|
|
7930
|
+
checkOutputCap?: number;
|
|
7931
|
+
/** Test seam — inject a git runner so unit tests drive the worktree helpers without git. */
|
|
7932
|
+
runGit?: GitRunner;
|
|
7933
|
+
/** Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. */
|
|
7934
|
+
runHarness?: typeof runLocalHarness;
|
|
7935
|
+
/** Test seam — inject the verification-command runner so unit tests script test/typecheck
|
|
7936
|
+
* outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. */
|
|
7937
|
+
runCommand?: WorktreeCheckRunner;
|
|
7938
|
+
/**
|
|
7939
|
+
* Exclude this leaf's spend from accounting. Defaults to `true` for ordinary CLI runs and
|
|
7940
|
+
* `false` for `codexReproducible`, which captures real token usage. A metered custom runner must
|
|
7941
|
+
* likewise return `LocalHarnessResult.usage`.
|
|
7942
|
+
*/
|
|
7943
|
+
budgetExempt?: boolean;
|
|
7944
|
+
/** @internal Kernel-minted attempt identity threaded by the built-in registry. */
|
|
7945
|
+
executionAttemptId?: string;
|
|
7946
|
+
}
|
|
7947
|
+
/**
|
|
7948
|
+
* Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a
|
|
7949
|
+
* fanout of N profiles = N parallel worktrees that never clobber each other.
|
|
7950
|
+
*
|
|
7951
|
+
* Fail-loud: an empty `repoRoot`/`harness` or an explicitly empty `taskPrompt` throws at
|
|
7952
|
+
* construction. Calling `execute(undefined, signal)` without a configured prompt throws before a
|
|
7953
|
+
* worktree is created. `resultArtifact()` before `execute()` resolves throws.
|
|
7954
|
+
*
|
|
7955
|
+
* @experimental
|
|
7956
|
+
*/
|
|
7957
|
+
declare function createWorktreeCliExecutor(options: WorktreeCliExecutorOptions): Executor<WorktreePatchArtifact>;
|
|
7958
|
+
//#endregion
|
|
7959
|
+
//#region src/runtime/supervise/patch-deliverable.d.ts
|
|
7960
|
+
/** @experimental */
|
|
7961
|
+
interface PatchDeliverableOptions extends CoderCheckConstraints {
|
|
7962
|
+
/**
|
|
7963
|
+
* Which verification signals the gate REQUIRES to be present-and-passing. A required signal
|
|
7964
|
+
* that the artifact never derived (the command was not configured on the executor) fails the
|
|
7965
|
+
* gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run
|
|
7966
|
+
* that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only.
|
|
7967
|
+
*/
|
|
7968
|
+
require?: ReadonlyArray<'tests' | 'typecheck'>;
|
|
7969
|
+
}
|
|
7596
7970
|
/**
|
|
7597
|
-
* Build the
|
|
7598
|
-
*
|
|
7599
|
-
*
|
|
7971
|
+
* Build the `DeliverableSpec<WorktreePatchArtifact>`: `check(artifact)` runs the shared mechanical
|
|
7972
|
+
* gate (`runCoderChecks`) over the captured patch + the worktree-derived pass signals and returns
|
|
7973
|
+
* whether the patch is DELIVERED (the `valid` conjunction).
|
|
7600
7974
|
*
|
|
7601
|
-
*
|
|
7602
|
-
* `executorSpec.executor`. The registry resolves a BYO executor without ever consulting the
|
|
7603
|
-
* per-child `ExecutorContext` the `Scope` seeds, so anything the scope would have supplied is
|
|
7604
|
-
* invisible here and has to be passed in. It is a FUNCTION because it is resolved once per worker
|
|
7605
|
-
* construction, so a caller may hand back something the run only learns later — which is exactly how
|
|
7606
|
-
* `supervise()` gives a traced run's workers their trace context without ordering the span recorder
|
|
7607
|
-
* ahead of the worker seam.
|
|
7975
|
+
* @experimental
|
|
7608
7976
|
*/
|
|
7609
|
-
declare function
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7977
|
+
declare function patchDelivered(options?: PatchDeliverableOptions): DeliverableSpec<WorktreePatchArtifact>;
|
|
7978
|
+
//#endregion
|
|
7979
|
+
//#region src/runtime/supervise/run-context.d.ts
|
|
7980
|
+
/** Options for a supervised run context. */
|
|
7981
|
+
interface InMemoryRunContextOptions {
|
|
7982
|
+
/**
|
|
7983
|
+
* Wrap the executor registry with `withDriverExecutor` so a spawned child marked
|
|
7984
|
+
* `role: 'driver'` resolves to the recursive driver-executor (agents driving agents
|
|
7985
|
+
* over a nested `Scope` on the same conserved pool). Leave `false` for a flat tree of
|
|
7986
|
+
* leaf workers. Default `false`.
|
|
7987
|
+
*/
|
|
7988
|
+
readonly withDriver?: boolean;
|
|
7618
7989
|
}
|
|
7619
7990
|
/**
|
|
7620
|
-
* The
|
|
7991
|
+
* The bundle of stores a supervised run needs, shaped to spread into `SupervisorOpts`.
|
|
7992
|
+
* The fields are exactly `SupervisorOpts`' `journal` / `blobs` / `executors`.
|
|
7993
|
+
*/
|
|
7994
|
+
interface InMemoryRunContext {
|
|
7995
|
+
readonly journal: SpawnJournal;
|
|
7996
|
+
readonly blobs: ResultBlobStore;
|
|
7997
|
+
readonly executors: ExecutorRegistry;
|
|
7998
|
+
/**
|
|
7999
|
+
* Present (and `true`) only on a DURABLE context (`createFileRunContext`), so spreading the
|
|
8000
|
+
* context into `SupervisorOpts` also opts the run into resume-first. An in-memory context
|
|
8001
|
+
* leaves it undefined: there is never a prior tree to resume, and the default stays fresh-run.
|
|
8002
|
+
*/
|
|
8003
|
+
readonly resume?: boolean;
|
|
8004
|
+
/**
|
|
8005
|
+
* Present only on a DURABLE context: the coordination side-log stores questions, analyst
|
|
8006
|
+
* findings, answer decisions, and authorized continuation receipts that the spawn journal does
|
|
8007
|
+
* not own. `supervise({ runDir })` appends them as they publish and loads them on resume.
|
|
8008
|
+
* Continuation receipts are evidence and are never auto-delivered to a replacement worker.
|
|
8009
|
+
* In-memory contexts have none: nothing outlives the process.
|
|
8010
|
+
*/
|
|
8011
|
+
readonly coordinationLog?: CoordinationLog;
|
|
8012
|
+
}
|
|
8013
|
+
/** The stores a supervised run needs, in-memory or file-backed. `InMemoryRunContext` is the
|
|
8014
|
+
* historical name for the same shape. */
|
|
8015
|
+
type RunContext = InMemoryRunContext;
|
|
8016
|
+
/**
|
|
8017
|
+
* Build a fresh in-memory run context. Every call returns NEW stores (no shared global
|
|
8018
|
+
* state between runs), so two runs never cross-contaminate their journals/blobs.
|
|
8019
|
+
*/
|
|
8020
|
+
declare function createInMemoryRunContext(opts?: InMemoryRunContextOptions): InMemoryRunContext;
|
|
8021
|
+
/**
|
|
8022
|
+
* Build a DURABLE run context: the spawn journal and the result blobs are file-backed (fsynced
|
|
8023
|
+
* per append/write) under `dir`, and the context carries `resume: true` so spreading it into
|
|
8024
|
+
* `SupervisorOpts` makes the supervisor `loadTree`-first. A run that dies mid-flight therefore
|
|
8025
|
+
* resumes when it is re-run with the SAME `runId` and the SAME `dir`: the committed children come
|
|
8026
|
+
* back on `Scope.resume` (rehydrated by `replaySpawnTree`) instead of being re-executed.
|
|
7621
8027
|
*
|
|
7622
|
-
*
|
|
7623
|
-
*
|
|
7624
|
-
*
|
|
7625
|
-
*
|
|
7626
|
-
*
|
|
8028
|
+
* Layout: `${dir}/spawn-journal.jsonl` (one JSONL record per event), `${dir}/blobs/` (one
|
|
8029
|
+
* content-addressed JSON file per settled result), and `${dir}/coordination-log.jsonl`
|
|
8030
|
+
* (questions, findings, answer decisions, and authorized continuation receipts retained as
|
|
8031
|
+
* evidence). The directory is created on first write.
|
|
8032
|
+
*
|
|
8033
|
+
* Opt-in by construction — `createInMemoryRunContext()` is unchanged and stays the default, so no
|
|
8034
|
+
* existing consumer writes to disk or resumes unless it asks for this.
|
|
7627
8035
|
*/
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
8036
|
+
declare function createFileRunContext(dir: string, opts?: InMemoryRunContextOptions): RunContext;
|
|
8037
|
+
//#endregion
|
|
8038
|
+
//#region src/runtime/supervise/run-layout.d.ts
|
|
8039
|
+
/**
|
|
8040
|
+
* The on-disk supervisor-run layout: `<root>/.agent/supervisor/<id>`.
|
|
8041
|
+
*
|
|
8042
|
+
* This is the durable, cross-process face of a supervisor run — the counterpart to the in-process
|
|
8043
|
+
* `Inbox` seam in `./inbox`. A run persists its state under one directory so that any OTHER process
|
|
8044
|
+
* can find it after the fact: `@tangle-network/traces` reads exactly this layout via
|
|
8045
|
+
* `traces analyze --supervisor-run-dir`, a restarted host can rehydrate a run it no longer holds
|
|
8046
|
+
* handles to, and a human can steer a live worker by appending one NDJSON line. Until now the
|
|
8047
|
+
* layout was defined only in the unpublished `loops` repo (`src/supervisor-control.ts`) — a
|
|
8048
|
+
* published reader depending on an unpublished writer's convention — so the contract is promoted
|
|
8049
|
+
* here, names preserved.
|
|
8050
|
+
*
|
|
8051
|
+
* `.agent` is the one dot-dir for ALL agent-owned state (skills already write
|
|
8052
|
+
* `.agent/hypotheses/`, `.agent/skill-runs.jsonl`); supervisor runs live beside them rather than
|
|
8053
|
+
* under a product-branded dir. Runs written by older writers used `.loops/supervisor/<id>` —
|
|
8054
|
+
* readers that must see those keep a legacy fallback; this writer never creates `.loops` again.
|
|
8055
|
+
*
|
|
8056
|
+
* Layout, relative to `supervisorRunDir(root, id)`:
|
|
8057
|
+
*
|
|
8058
|
+
* workers/<label>.inbox.ndjson down-leg steer/answer requests for one worker (durable inbox);
|
|
8059
|
+
* each line is a {@link WorkerSteerRequest}
|
|
8060
|
+
* workers/<label>.ndjson best-effort per-worker control-event log (delivery bookkeeping)
|
|
8061
|
+
*
|
|
8062
|
+
* Reads are tolerant by contract: a partial trailing line (a writer mid-append) or a corrupt line
|
|
8063
|
+
* never poisons the rest of the file — later valid lines still matter.
|
|
8064
|
+
*
|
|
8065
|
+
* Promoted from `loops/src/supervisor-control.ts`. The one deliberate difference: the loops version
|
|
8066
|
+
* resolved a worker id to its label through the run journal before writing a steer; that resolution
|
|
8067
|
+
* stays with the caller (it is journal-format-specific), so `writeWorkerSteer` here takes the worker
|
|
8068
|
+
* LABEL directly.
|
|
8069
|
+
*
|
|
8070
|
+
* @experimental
|
|
8071
|
+
*/
|
|
8072
|
+
/** One durable down-leg request appended to a worker's inbox file. */
|
|
8073
|
+
interface WorkerSteerRequest {
|
|
8074
|
+
readonly id: string;
|
|
8075
|
+
/** ISO timestamp of the append. */
|
|
8076
|
+
readonly at: string;
|
|
8077
|
+
/** Who asked — 'human', a brain label, a tool name. Provenance, not authorization. */
|
|
8078
|
+
readonly source: string;
|
|
8079
|
+
/** The worker LABEL the request targets (already resolved by the caller). */
|
|
8080
|
+
readonly worker: string;
|
|
8081
|
+
readonly message: string;
|
|
7633
8082
|
}
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
/**
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
* model-authored metadata without a side channel. */
|
|
7707
|
-
readonly isDriverProfile?: (input: AuthorizedSpawnContext) => boolean;
|
|
7708
|
-
/** The supervisor's router substrate (`profile.harness` omitted or `cli-base`). The profile's
|
|
7709
|
-
* model wins. */
|
|
7710
|
-
readonly router?: RouterConfig;
|
|
7711
|
-
/** Inject the supervisor brain directly (tests / advanced). */
|
|
7712
|
-
readonly brain?: ToolLoopChat;
|
|
7713
|
-
/** Run an external-harness supervisor explicitly. Required for a remote sandbox; optional as a
|
|
7714
|
-
* caller-owned override for a local bridge. */
|
|
7715
|
-
readonly driveHarness?: DriveHarness;
|
|
7716
|
-
/** Resolve one custom external-harness session per trusted manager identity. Use this instead of
|
|
7717
|
-
* `driveHarness` when recursive managers must be independently steerable. */
|
|
7718
|
-
readonly resolveDriveHarness?: ResolveDriveHarness;
|
|
7719
|
-
/** Required with a custom `driveHarness` or `resolveDriveHarness`: declares which complete
|
|
7720
|
-
* AgentProfile axes that path really applies. Built-in bridge driving supplies its own
|
|
7721
|
-
* full-profile contract. */
|
|
7722
|
-
readonly driveHarnessMaterialization?: ProfileMaterializationContract;
|
|
7723
|
-
/** Resolve product-owned tools from the exact trusted manager context. The same descriptors and
|
|
7724
|
-
* handlers are bound to router and external-harness managers; resolution happens once per node.
|
|
7725
|
-
* Each handler receives that manager scope's live cancellation signal in its trusted invocation
|
|
7726
|
-
* context, including recursive parent and root cascades. */
|
|
7727
|
-
readonly resolveSupervisorTools?: ResolveSupervisorTools;
|
|
7728
|
-
/** Awaited product transaction hook for every coordination record. `eventId` is stable across a
|
|
7729
|
-
* lost acknowledgement and durable restart; the record is not pull-visible until this commits. */
|
|
7730
|
-
readonly onCoordinationEvent?: (context: SupervisorNodeContext, eventId: Sha256Digest, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
|
|
7731
|
-
/** WORK tools the supervisor may call DIRECTLY — so a recursive atom can ACT (do simple work
|
|
7732
|
-
* itself) OR SPAWN (delegate when it needs parallelism), not be a pure manager. Pair with
|
|
7733
|
-
* `executeExtraTool`. Router arm only (`profile.harness` omitted or `cli-base`). */
|
|
7734
|
-
readonly extraTools?: ReadonlyArray<{
|
|
7735
|
-
readonly name: string;
|
|
7736
|
-
readonly description?: string;
|
|
7737
|
-
readonly parameters: Record<string, unknown>;
|
|
7738
|
-
}>;
|
|
7739
|
-
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
7740
|
-
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
7741
|
-
/** Per-child budget reserved on each spawn. Defaults to a quarter of the pool's tokens. */
|
|
7742
|
-
readonly perWorker?: Budget;
|
|
7743
|
-
/** Hard cap on simultaneously executing spawned workers across the WHOLE recursive tree. The
|
|
7744
|
-
* root is excluded; nested drivers and leaves share one allocation, so recursion cannot multiply
|
|
7745
|
-
* the cap. Omit/`<= 0` = no cap (the conserved pool stays the only bound). */
|
|
8083
|
+
/** The root every supervisor run of one workspace lives under. */
|
|
8084
|
+
declare function supervisorRunsRoot(rootDir: string): string;
|
|
8085
|
+
/** The run directory every artifact of one supervisor run lives under. */
|
|
8086
|
+
declare function supervisorRunDir(rootDir: string, id: string): string;
|
|
8087
|
+
/**
|
|
8088
|
+
* Where a pre-rename writer put the same run (`<root>/.loops/supervisor/<id>`). Readers that must
|
|
8089
|
+
* see historical runs check {@link supervisorRunDir} first and fall back to this; nothing writes
|
|
8090
|
+
* here anymore.
|
|
8091
|
+
*/
|
|
8092
|
+
declare function legacySupervisorRunDir(rootDir: string, id: string): string;
|
|
8093
|
+
/**
|
|
8094
|
+
* The pre-rename runs root (`<root>/.loops/supervisor`). Only readers that ENUMERATE historical
|
|
8095
|
+
* runs need this — the per-id form is {@link legacySupervisorRunDir}. Nothing writes here.
|
|
8096
|
+
*/
|
|
8097
|
+
declare function legacySupervisorRunsRoot(rootDir: string): string;
|
|
8098
|
+
/** A worker label reduced to a safe filename stem. Empty labels get a stable fallback. */
|
|
8099
|
+
declare function safeWorkerFile(label: string): string;
|
|
8100
|
+
/** The directory holding every per-worker file of one run (inboxes and control-event logs). */
|
|
8101
|
+
declare function supervisorWorkersDir(eventDir: string): string;
|
|
8102
|
+
/** The durable inbox file for one worker of one run. */
|
|
8103
|
+
declare function workerInboxFile(rootDir: string, supervisorId: string, worker: string): string;
|
|
8104
|
+
/** Same, addressed from an already-known run directory (the reader's usual entry point). */
|
|
8105
|
+
declare function workerInboxFileFromEventDir(eventDir: string, worker: string): string;
|
|
8106
|
+
/**
|
|
8107
|
+
* The best-effort control-event log for one worker (`workers/<label>.ndjson`) — delivery
|
|
8108
|
+
* bookkeeping for steers, plus whatever lifecycle events a writer chooses to append. Distinct from
|
|
8109
|
+
* the inbox: the inbox is the durable down-leg queue, this is the record of what happened to it.
|
|
8110
|
+
*/
|
|
8111
|
+
declare function workerControlLogFile(eventDir: string, worker: string): string;
|
|
8112
|
+
/**
|
|
8113
|
+
* Durably append one steer request to a worker's inbox and log the delivery attempt.
|
|
8114
|
+
*
|
|
8115
|
+
* The inbox append is the durable act; the control-event log is best-effort bookkeeping and may
|
|
8116
|
+
* silently fail without voiding the steer.
|
|
8117
|
+
*/
|
|
8118
|
+
declare function writeWorkerSteer(rootDir: string, supervisorId: string, worker: string, message: string, source?: string): {
|
|
8119
|
+
worker: string;
|
|
8120
|
+
file: string;
|
|
8121
|
+
request: WorkerSteerRequest;
|
|
8122
|
+
};
|
|
8123
|
+
/** Read every valid steer request in a worker's inbox. Corrupt or partial lines are skipped. */
|
|
8124
|
+
declare function readWorkerSteerRequests(eventDir: string, worker: string): WorkerSteerRequest[];
|
|
8125
|
+
//#endregion
|
|
8126
|
+
//#region src/runtime/supervise/scope.d.ts
|
|
8127
|
+
/** Construction args for `createScope`. The supervisor threads the shared pool, journal,
|
|
8128
|
+
* blob store, and executor registry through; `depth`/`maxDepth` pair the runtime
|
|
8129
|
+
* recursion ceiling with the conserved pool (R3). */
|
|
8130
|
+
interface ScopeArgs {
|
|
8131
|
+
/** This scope's owning node id — children get `${parentId}:s${seq}` ids. */
|
|
8132
|
+
readonly parentId: NodeId;
|
|
8133
|
+
/** Journal/blob root key the supervisor `beginTree`'d. */
|
|
8134
|
+
readonly root: NodeId;
|
|
8135
|
+
/** The reservation pool for this scope: the root total or one nested allocated partition. */
|
|
8136
|
+
readonly pool: BudgetPool;
|
|
8137
|
+
/** Append-only spawn journal; this scope writes `spawned` + `settled` records. */
|
|
8138
|
+
readonly journal: SpawnJournal;
|
|
8139
|
+
/** Content-addressed result store backing `outRef` rehydration. */
|
|
8140
|
+
readonly blobs: ResultBlobStore;
|
|
8141
|
+
/** The open executor resolver (BYO → router/inline → registered harness factory). */
|
|
8142
|
+
readonly executors: ExecutorRegistry;
|
|
8143
|
+
/** Predicate resolver for `poll` wait-states. Absent ⇒ `wait` refuses a `poll` with
|
|
8144
|
+
* `unknown-probe`; `timer` waits never touch it. */
|
|
8145
|
+
readonly probes?: WaitProbeRegistry;
|
|
8146
|
+
/** Injected sleeper for wait-states — a test drives a week-long timer in microseconds. */
|
|
8147
|
+
readonly waitSleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
8148
|
+
/** Per-spawn executor-construction seams (sandbox client, router config, cli bin). */
|
|
8149
|
+
readonly seams: Readonly<Record<string, unknown>>;
|
|
8150
|
+
/** This scope's recursion depth (root = 0). */
|
|
8151
|
+
readonly depth: number;
|
|
8152
|
+
/** Runtime recursion-depth ceiling — a spawn past it fails closed `depth-exceeded`. */
|
|
8153
|
+
readonly maxDepth?: number;
|
|
8154
|
+
/** Root-owned limit on live spawned workers across this scope and every nested scope. */
|
|
7746
8155
|
readonly maxLiveWorkers?: number;
|
|
7747
|
-
/**
|
|
7748
|
-
*
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
* moment one loops or error-storms — so the supervisor learns it mid-run (via `await_event`)
|
|
7759
|
-
* instead of at settle. Pairs with a steerable worker: the finding is the evidence, `steer_agent`
|
|
7760
|
-
* is the correction. Requires a backend whose executor exposes a trace source (the steerable
|
|
7761
|
-
* sandbox worker and the pi wrapper do); other runtimes are simply not watched.
|
|
7762
|
-
*
|
|
7763
|
-
* Omit = off (status quo — no online watching, no extra events).
|
|
7764
|
-
*/
|
|
7765
|
-
readonly watchWorkers?: WorkerWatchOptions;
|
|
7766
|
-
/** Idle time after which `observe_agent` reports a running worker as `stalled`. A derived read
|
|
7767
|
-
* at observation time — nothing is killed or retried. Omit = the runtime default. */
|
|
7768
|
-
readonly stallAfterMs?: number;
|
|
7769
|
-
/** Worker output store. Defaults to in-memory. */
|
|
7770
|
-
readonly blobs?: ResultBlobStore;
|
|
8156
|
+
/** @internal Shared counter inherited by nested scopes. Callers set `maxLiveWorkers`; the root
|
|
8157
|
+
* scope creates this state once and passes the same object through its recursion seam. */
|
|
8158
|
+
readonly liveWorkerCapacity?: LiveWorkerCapacityState;
|
|
8159
|
+
/** Abort signal for this scope; an abort cascades into every live child's executor. */
|
|
8160
|
+
readonly signal: AbortSignal;
|
|
8161
|
+
/** Injected clock — keeps the journal `at` timestamp deterministic in tests. */
|
|
8162
|
+
readonly now?: () => number;
|
|
8163
|
+
/** Lifecycle stream sink. `spawn` emits `agent.spawn`, `next` emits `agent.child` — the
|
|
8164
|
+
* SAME stream `runAgentRounds`/`tool-loop` feed, so the recursive tree is ONE observable stream
|
|
8165
|
+
* (the topology viewer reads it). Undefined ⇒ the journal stays the only record. */
|
|
8166
|
+
readonly hooks?: RuntimeHooks;
|
|
7771
8167
|
/**
|
|
7772
|
-
*
|
|
7773
|
-
*
|
|
7774
|
-
*
|
|
7775
|
-
*
|
|
7776
|
-
* measured spend are restored before new admission. The built-in driver is resume-aware: children
|
|
7777
|
-
* that already settled, including their exact execution identities, are replayed onto
|
|
7778
|
-
* `Scope.resume` (and into the driver's settled ledger + its first context), keyed assignments
|
|
7779
|
-
* (`spawn_agent`'s `key`) resolve to their committed results instead of re-running, pending
|
|
7780
|
-
* waits re-arm on their original deadlines, and the coordination log loads prior questions,
|
|
7781
|
-
* findings, and instruction receipts. The router arm receives all three in its resume brief; the
|
|
7782
|
-
* external arm seeds prior questions while findings and receipts remain in the durable log.
|
|
7783
|
-
* Instruction receipts are evidence and are never delivered automatically to a replacement
|
|
7784
|
-
* worker. The final result spans both processes' work. Unset = in-memory, fresh every call.
|
|
7785
|
-
*
|
|
7786
|
-
* The boundary that remains: work that was IN FLIGHT when the process died is not recovered —
|
|
7787
|
-
* the built-in executors cannot re-attach to a dead process's executions. Each such assignment
|
|
7788
|
-
* resumes as explicitly lost/in-doubt, its full declared reservation is charged conservatively,
|
|
7789
|
-
* and its token/dollar telemetry remains unknown. A retry is admitted only from safely remaining
|
|
7790
|
-
* capacity, so restart cannot mint a fresh budget or slide the original absolute deadline.
|
|
7791
|
-
*
|
|
7792
|
-
* `runId` matters here: it defaults to the constant `'supervise'`, which is fine for a single
|
|
7793
|
-
* resumable run per directory but collides across concurrent runs sharing one `runDir`.
|
|
8168
|
+
* Trace context to hand down to each spawned worker (`SupervisorOpts.workerTrace`). Called with
|
|
8169
|
+
* THIS scope's own `parentId` — the node doing the spawning — and the resolved context is seeded
|
|
8170
|
+
* onto each child's `ExecutorContext` under `workerTraceSeamKey`. Absent (the untraced default)
|
|
8171
|
+
* ⇒ no seam is seeded and no worker environment is touched.
|
|
7794
8172
|
*/
|
|
7795
|
-
readonly
|
|
7796
|
-
/** Override the spawn journal directly (advanced; `runDir` is the ordinary durable path). Pair
|
|
7797
|
-
* with `blobs` — a journal whose result payloads live in a different store cannot replay. */
|
|
7798
|
-
readonly journal?: SpawnJournal;
|
|
7799
|
-
/** Predicate registry for `poll` wait-states (`Scope.wait`). A `poll` names its predicate so the
|
|
7800
|
-
* wait survives a restart; this is what the name resolves against. Unset ⇒ `poll` waits are
|
|
7801
|
-
* refused `unknown-probe` and `timer` waits still work. A `string` names an entry in
|
|
7802
|
-
* `registry.probes`. */
|
|
7803
|
-
readonly probes?: WaitProbeRegistry | string;
|
|
8173
|
+
readonly workerTrace?: WorkerTraceResolver;
|
|
7804
8174
|
/**
|
|
7805
|
-
*
|
|
7806
|
-
*
|
|
7807
|
-
*
|
|
7808
|
-
*
|
|
7809
|
-
*
|
|
7810
|
-
*
|
|
7811
|
-
* thresholds are policy and stay with you; the enforcement lives in the runtime. Omit = ceilings
|
|
7812
|
-
* only (unchanged behavior).
|
|
8175
|
+
* Present when this run RECORDS spans but the worker backend has NO channel to carry the trace
|
|
8176
|
+
* context (`WORKER_TRACE_PROPAGATION[backend] === false` — bridge / cli-worktree have no env
|
|
8177
|
+
* channel; router / router-tools / provider have no worker process). Each spawn then journals a
|
|
8178
|
+
* `trace-unpropagated` event naming the severed hop, so a child whose trace shows up as a
|
|
8179
|
+
* disconnected root is a recorded fact rather than a silent stranger. Absent ⇒ either the run
|
|
8180
|
+
* is untraced or the backend propagates; nothing is journaled.
|
|
7813
8181
|
*/
|
|
7814
|
-
readonly
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
readonly
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
* supervisor router model, the profile's model, and the backend's model — must be a member,
|
|
7830
|
-
* or `supervise()` throws a `ConfigError` before any compute is spent. Unset = unrestricted. */
|
|
7831
|
-
readonly allowedModels?: readonly string[];
|
|
7832
|
-
/** How the settled-worker ledger becomes the run's output. Default `bestDelivered` — the single
|
|
7833
|
-
* highest-scoring DELIVERED child (the exact behavior every existing caller had). Alternatives:
|
|
7834
|
-
* `collectDelivered` (every verified distinct output with provenance — a Pareto set / recorded
|
|
7835
|
-
* disagreement) or a custom `SupervisorFinalizer`. Whatever the finalizer, it operates on
|
|
7836
|
-
* structurally DELIVERED outputs only — an undelivered or invalid child stays ineligible. A
|
|
7837
|
-
* `string` names an entry in `registry.finalizers`. */
|
|
7838
|
-
readonly finalizer?: SupervisorFinalizer | string;
|
|
7839
|
-
/** Lifecycle observers for the whole recursive tree (`Scope` re-seeds them into every nested
|
|
7840
|
-
* scope). Composed with the `otel` recorder below when both are set. Omit = no observers, which
|
|
7841
|
-
* is the behavior every existing caller has. */
|
|
7842
|
-
readonly hooks?: RuntimeHooks;
|
|
8182
|
+
readonly workerTraceUnpropagated?: {
|
|
8183
|
+
readonly backend: string;
|
|
8184
|
+
readonly reason: 'no-env-channel' | 'no-worker-process' | 'caller-omitted';
|
|
8185
|
+
};
|
|
8186
|
+
/** @internal Trusted root-adapter publication channel. It is never exposed as a Scope method. */
|
|
8187
|
+
readonly ownerMaterialization?: {
|
|
8188
|
+
readonly runtime: NodeSnapshot['runtime'];
|
|
8189
|
+
readonly authoredProfile?: unknown;
|
|
8190
|
+
readonly attemptId: string;
|
|
8191
|
+
readonly prior?: ProfileMaterializationReceipt;
|
|
8192
|
+
readonly journalRoot?: NodeId;
|
|
8193
|
+
readonly nodeId?: NodeId;
|
|
8194
|
+
readonly requiredKnown?: boolean;
|
|
8195
|
+
readonly onReceipt?: (materialization: ProfileMaterializationReceipt, binding: ExecutionBindingReceipt) => void;
|
|
8196
|
+
};
|
|
7843
8197
|
/**
|
|
7844
|
-
*
|
|
7845
|
-
*
|
|
7846
|
-
*
|
|
7847
|
-
*
|
|
7848
|
-
* Omit and the run emits nothing, allocates no recorder, and installs no hook — telemetry is
|
|
7849
|
-
* never a default. Present with no reachable endpoint (no `exportConfig.endpoint` and no
|
|
7850
|
-
* `OTEL_EXPORTER_OTLP_ENDPOINT`) is also a no-op. The spawn journal is untouched either way:
|
|
7851
|
-
* spans are telemetry, never the replay/resume record.
|
|
8198
|
+
* Resume seam — set ONLY by the supervisor when `SupervisorOpts.resume` is on AND a non-empty
|
|
8199
|
+
* journal tree exists for this root. It carries the replayed committed work (so `scope.resume`
|
|
8200
|
+
* exposes it to a resume-aware `act`) and the recorded ordinal/cursor maxima the new counters
|
|
8201
|
+
* continue past, so a freshly-spawned child never reuses a journaled `seq`. Absent ⇒ fresh run.
|
|
7852
8202
|
*/
|
|
7853
|
-
readonly
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
8203
|
+
readonly resumeFrom?: {
|
|
8204
|
+
readonly settled: ReadonlyArray<Settled<unknown>>;
|
|
8205
|
+
readonly view: TreeView;
|
|
8206
|
+
/** Highest `spawned` ordinal already journaled; new spawns start at `+1`. */
|
|
8207
|
+
readonly maxSpawnOrdinal: number;
|
|
8208
|
+
/** Highest cursor `seq` already journaled; new settlements start at `+1`. */
|
|
8209
|
+
readonly maxCursorSeq: number;
|
|
8210
|
+
/** Highest `waiting` ordinal already journaled; new waits start at `+1`. */
|
|
8211
|
+
readonly maxWaitOrdinal: number;
|
|
8212
|
+
/** Waits journaled as armed but never woken — re-armed (same node id, same absolute deadline)
|
|
8213
|
+
* when `wait` is called again with the SAME label. */
|
|
8214
|
+
readonly waits: ReadonlyArray<PendingWait>;
|
|
8215
|
+
/** Keyed assignments from the prior journal — what a keyed re-spawn resolves against. */
|
|
8216
|
+
readonly keys: ReadonlyMap<string, ResumedKeyState<unknown>>;
|
|
8217
|
+
/** Prior committed spend summed off the journal (settled child work + metered inference). */
|
|
8218
|
+
readonly priorSpend: {
|
|
8219
|
+
readonly childWork: Spend;
|
|
8220
|
+
readonly driverInference: Spend;
|
|
8221
|
+
};
|
|
8222
|
+
};
|
|
7860
8223
|
}
|
|
7861
|
-
/**
|
|
7862
|
-
interface
|
|
7863
|
-
readonly
|
|
7864
|
-
|
|
7865
|
-
readonly parentIdentity: NodeExecutionIdentity;
|
|
7866
|
-
readonly execution: NodeExecutionIdentity;
|
|
7867
|
-
readonly parentNodeId: string;
|
|
7868
|
-
readonly assignmentId: string;
|
|
7869
|
-
readonly task: unknown;
|
|
7870
|
-
readonly budget: Budget;
|
|
7871
|
-
readonly label: string;
|
|
7872
|
-
readonly key?: string;
|
|
7873
|
-
readonly depth: number;
|
|
8224
|
+
/** Mutable only inside Scope admission/release. Every nested scope receives this exact object. */
|
|
8225
|
+
interface LiveWorkerCapacityState {
|
|
8226
|
+
readonly max: number | undefined;
|
|
8227
|
+
live: number;
|
|
7874
8228
|
}
|
|
7875
|
-
/**
|
|
7876
|
-
|
|
7877
|
-
/**
|
|
7878
|
-
|
|
8229
|
+
/** Create the reactive `Scope` a driver's `Agent.act` runs inside: spawn children on an atomically reserved conserved budget, settle via the `next()` cursor, journal for replay. */
|
|
8230
|
+
declare function createScope<Out>(args: ScopeArgs): Scope<Out>;
|
|
8231
|
+
/**
|
|
8232
|
+
* The step-8 merge-boundary adapter (M4): rehydrate a `Settled.done` into the kernel's
|
|
8233
|
+
* `Iteration` shape so `defaultSelectWinner` stays single-sourced — the supervisor selects
|
|
8234
|
+
* across settled children with the SAME argmax the loop kernel uses, not a forked copy.
|
|
8235
|
+
*
|
|
8236
|
+
* `index` is the cursor `seq` (the recorded, replay-stable order); `output`/`verdict`/
|
|
8237
|
+
* `tokenUsage`/`costUsd` are read straight off the settlement (already rehydrated from the
|
|
8238
|
+
* `outRef` blob by `next()`). Events are empty — a settled child is an opaque leaf result,
|
|
8239
|
+
* not a sandbox event stream — and the timing/cost fields project its conserved `Spend`.
|
|
8240
|
+
* Fail loud on a `down` settlement: only a `done` child is an iteration.
|
|
8241
|
+
*/
|
|
8242
|
+
declare function settledToIteration<Out>(settled: Settled<Out>): Iteration<unknown, Out>;
|
|
7879
8243
|
//#endregion
|
|
7880
8244
|
//#region src/runtime/supervise/supervisor.d.ts
|
|
7881
8245
|
/** Create a supervisor that owns one recursive agent execution tree. */
|
|
@@ -8193,5 +8557,5 @@ interface VerifierEnvironmentOptions {
|
|
|
8193
8557
|
/** Any checkable task as an `Environment`, no tool surface required: the artifact is the worker's answer and the domain is one deployable `check` over it. */
|
|
8194
8558
|
declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
|
|
8195
8559
|
//#endregion
|
|
8196
|
-
export { SuperviseRegistry as $, sample as $a, WorkerSpawnContext as $c, FileResultBlobStore as $d, runPersonified as $i, FeedbackStore as $l, ProfileRichnessThresholds as $n, PanelJudge as $o, AuthoredStrategy as $r, GroupOf as $s, DispatchStopReason as $t, DelegationError as $u, GitWorkspaceOptions as A, AgenticOptions as Aa, createWaterfallCollector as Ac, FileDelegationStoreOptions as Ad, promptOnlyProfileMaterialization as Af, createSandboxLineage as Ai, SteerableSandboxSession as Al, DeliveredOutput as An, ObserveInput as Ao, structuralRollout as Ar, ShapeBudget as As, workerControlLogFile as At, DelegationArgs as Au, analyzeTrace as B, Strategy as Ba, DownMessageAuthorizationInput as Bc, ValidationError as Bd, AcquireOptions as Bi, DiffOptions as Bl, CoordinationLog as Bn, EqualKArm as Bo, EvolutionArchiveNode as Br, LeaderboardScenario as Bs, patchDelivered as Bt, hashIdempotencyInput as Bu, closingWorkerNote as C, BenchmarkLift as Ca, areaUnderCurve as Cc, capDelegationTrace as Cd, assertProfileMaterialization as Cf, TurnResult as Ci, SandboxSeam as Cl, allOf as Cn, InProcessSandboxClientOptions as Co, defaultStructuralRolloutPolicy as Cr, LoopShape as Cs, legacySupervisorRunDir as Ct, DriveTurnTick as Cu, UntrackedCopyStats as D, Environment as Da, WaterfallCollector as Dc, DelegationStateCorruptError as Dd, profileMaterializationAxes as Df, SandboxLineage as Di, DEFAULT_SANDBOX_STEERING_MAX_TURNS as Dl, noProgressFor as Dn, HarvestReport as Do, resolveEntrySymbol as Dr, PersonaExecutors as Ds, supervisorRunDir as Dt, formatDetachedSessionRef as Du, CopyOptions as E, BenchmarkTaskRow as Ea, renderAnytimeTable as Ec, DelegationPersistenceError as Ed, fullProfileMaterialization as Ef, ForkCapableBox as Ei, createExecutorRegistry as El, createProgressTracker as En, HarvestFailure as Eo, officialChecksFromMeta as Er, PersonaContext as Es, safeWorkerFile as Et, detachedTurnEvents as Eu, gitWorkspace as F, ArtifactHandle as Fa, ContinuationInstruction as Fc, ConfigError as Fd, worktreeCliProfileMaterialization as Ff, mapSandboxToolEvent as Fi, WorktreeCheckRunner as Fl, collectDelivered as Fn, AssertTraceDerivedFindings as Fo, StreamAgentTurnOptions as Fr, LeaderboardBenchTask as Fs, InMemoryRunContextOptions as Ft, DelegationRunContext as Fu, workerTraceAnalysisStore as G, StrategyShotResult as Ga, Question as Gc, EventBus as Gd, PromotionVerdict as Gi, captureWorktreeDiff as Gl, BudgetPoolRestore as Gn, FanoutOptions as Go, EvolutionReport as Gr, CompletionEvidence as Gs, SupervisorSpanOptions as Gt, DelegateFeedbackResult as Gu, WorkerToolTraceArtifact as H, StrategyCtx as Ha, DownMessageDeliveryOutcome as Hc, BusEvent as Hd, ResolveSandboxClientOptions as Hi, GitRunner as Hl, FileCoordinationLog as Hn, EqualKOnCostOptions as Ho, EvolutionBandInfo as Hr, LeaderboardSpec as Hs, WorktreePatchArtifact as Ht, DelegateCodeConfig as Hu, jjWorkspace as I, CorpusReadbackOptions as Ia, CoordinationEvent as Ic, JudgeError as Id, sumSandboxUsage as Ii, WorktreeCommandResult as Il, pickBestDelivered as In, CombinatorShape as Io, collectAgentTurn as Ir, LeaderboardBenchmarkAdapter as Is, RunContext as It, DelegationTaskQueue as Iu, AuthorizedSpawn as J, breadthStrategy as Ja, QuestionOption as Jc, WatchTraceOptions as Jd, trajectoryReport as Ji, JsonRpcMessage as Jl, ReservationTicket as Jn, FlatWidenGate as Jo, discriminatingMeans as Jr, completionAuthorizes as Js, createSupervisorSpanRecorder as Jt, DelegateResearchResult as Ju, createRootHandle as K, SurfaceScore as Ka, QuestionDecision as Kc, PublishOptions as Kd, promotionGate as Ki, createWorktree as Kl, BudgetReadout as Kn, FanoutSynthesis as Ko, ReproductionCheck as Kr, CompletionPolicy as Ks, SupervisorSpanOutcome as Kt, DelegateResearchArgs as Ku, localShell as L, RunAgenticOptions as La, CoordinationTools as Lc, NotFoundError as Ld, CriuCapableClient as Li, WorktreeHarnessResult as Ll, runFinalizer as Ln, Corpus as Lo, streamAgentTurn as Lr, LeaderboardFlagSpec as Ls, createFileRunContext as Lt, DelegationTaskQueueOptions as Lu, Workspace as M, AgenticSurface as Ma, AnalystRegistry as Mc, AgentEvalError$1 as Md, renderProfileMaterializationIssues as Mf, createSandboxToolPartState as Mi, Inbox as Ml, FinalizerSettled as Mn, defaultAnalystInstruction as Mo, AgentTurnBackend as Mr, ShapeRegistry as Ms, workerInboxFileFromEventDir as Mt, DelegationResumeContext as Mu, WorkspaceCommit as N, AgenticTask as Na, AuthorizeDownMessage as Nc, AgentEvalErrorCode as Nd, sandboxActProfileMaterialization as Nf, extractLlmCallEvent as Ni, InboxMessage as Nl, SupervisorFinalizer as Nn, observe as No, AgentTurnUsage as Nr, DefinedLeaderboard as Ns, writeWorkerSteer as Nt, DelegationResumeDriver as Nu, copyUntrackedIntoClone as O, printBenchmarkReport as Oa, WaterfallReport as Oc, DelegationStore as Od, promptControlProfileMaterialization as Of, SandboxLineageHandle as Oi, SandboxSteeringOptions as Ol, plateau as On, harvestCorpus as Oo, sandboxCheckRunner as Or, RunPersonified as Os, supervisorRunsRoot as Ot, parseDetachedSessionRef as Ou, WorkspaceRun as P, AgenticTool as Pa, AuthorizedDownMessage as Pc, BackendTransportError as Pd, validateProfileMaterialization as Pf, mapSandboxEvent as Pi, createInbox as Pl, bestDelivered as Pn, renderReport as Po, CollectedAgentTurn as Pr, LeaderboardBenchScore as Ps, InMemoryRunContext as Pt, DelegationResumeTick as Pu, SuperviseOptions as Q, runAgentic as Qa, SettledWorker as Qc, gateOnDeliverable as Qd, definePersona as Qi, FeedbackEvent as Ql, ProfileRichness as Qn, Panel as Qo, AuthorStrategyOptions as Qr, AxisScoresOf as Qs, DispatchReport as Qt, DelegateUiAuditRoute as Qu, runInWorkspace as R, ShotPersona as Ra, CoordinationToolsOptions as Rc, PlannerError as Rd, SandboxCapabilities as Ri, WorktreeProfileMaterializationReceipt as Rl, runTree as Rn, CorpusFilter as Ro, ChampionPick as Rr, LeaderboardIterationInfo as Rs, createInMemoryRunContext as Rt, SubmitInput as Ru, WorkerEvidenceInput as S, BenchmarkConfig as Sa, anytimeReport as Sc, buildDelegationTraceSpans as Sd, ValidateProfileMaterializationOptions as Sf, SandboxRunAbortError as Si, RouterToolsSeam as Sl, StopRule as Sn, InProcessPromptCtx as So, defaultExtractCandidate as Sr, DefinePersonaInput as Ss, WorkerSteerRequest as St, DriveTurnCapableBox as Su, settledWorkerOut as T, BenchmarkStrategySummary as Ta, plateauLength as Tc, createDelegationTraceCollector as Td, defineProfileMaterializationContract as Tf, CheckpointCapableBox as Ti, createExecutor as Tl, anyOf as Tn, HarvestCorpusOptions as To, modelAuthoredChecks as Tr, Persona as Ts, readWorkerSteerRequests as Tt, createDetachedTurnResumeDriver as Tu, captureWorkerTraceEvidence as U, StrategyMessage as Ua, DownMessageEvent as Uc, BusRecord as Ud, resolveSandboxClient as Ui, RemoveWorktreeOptions as Ul, PriorCoordination as Un, EqualKVerdict as Uo, EvolutionCandidate as Ur, defineLeaderboard as Us, createWorktreeCliExecutor as Ut, DelegateCodeResult as Uu, WORKER_TOOL_TRACE_SCHEMA_VERSION as V, StrategyArtifacts as Va, DownMessageDeliveryAttempt as Vc, CoderOutput as Vd, acquireSandbox as Vi, DiffResult as Vl, CoordinationOwnerId as Vn, EqualKOnCost as Vo, EvolutionAuthor as Vr, LeaderboardScore as Vs, WorktreeCliExecutorOptions as Vt, DelegateCodeArgs as Vu, parseWorkerToolTraceArtifact as W, StrategyResult as Wa, MakeWorkerAgent as Wc, BusStats as Wd, PromotionGateOptions as Wi, WorktreeHandle as Wl, BudgetPool as Wn, Fanout as Wo, EvolutionGeneration as Wr, CompletionAnalyst as Ws, SupervisorSpanAttributes as Wt, DelegateFeedbackArgs as Wu, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as X, depthStrategy as Xa, QuestionRecord as Xc, watchTrace as Xd, createShapeRegistry as Xi, McpToolDescriptor$1 as Xl, spendFromUsageEvents as Xn, LoopUntilSpec as Xo, runStrategyEvolution as Xr, sentinelCompletion as Xs, assertProfileModelsAllowed as Xt, DelegateUiAuditConfig as Xu, AuthorizedSpawnContext as Y, defineStrategy as Ya, QuestionPolicy as Yc, defaultToolDetectors as Yd, builtinShapes as Yi, JsonRpcResponse as Yl, createBudgetPool as Yn, LoopUntil as Yo, pickChampion as Yr, deterministicCompletion as Ys, assertModelAllowed as Yt, DelegateUiAuditArgs as Yu, DeliverableResolutionInput as Z, refine as Za, QuestionUrgency as Zc, DeliverableSpec as Zd, registerShape as Zi, McpTransport as Zl, AuthoredProfile as Zn, LoopUntilState as Zo, selectChampion as Zr, stopSentinel as Zs, ConcurrencyCaps as Zt, DelegateUiAuditResult as Zu, WorktreeFanoutOptions as _, McpEndpoint as _a, auditIntent as _c, DELEGATION_TRACE_MAX_BYTES as _d, CanonicalAgentProfileMaterializationAxis as _f, Deliverable as _i, CliWorktreeBridgeSeam as _l, ProgressSample as _n, resolveMcpServerLaunch as _o, StructuralRolloutResult as _r, WidenDecision as _s, resolveSupervisorProfile as _t, createFleetWorkspaceExecutor as _u, SandboxInstance$1 as a, loopUntil as aa, PairwiseVerdict as ac, DelegationProgress as ad, SpawnForestInDoubtNode as af, NaiveDriverOptions as ai, createMcpServer as al, rollingDispatch as an, loopDispatch as ao, profileRichnessFinding as ar, RenderCorpusToInstructionsOptions as as, DriveHarnessOwnerContext as at, DelegateRunCtx as au, NOTE_MAX_CHARS as b, sanitizeMcpToolSchema as ba, AnytimeStrategySummary as bc, DelegationTraceCollector as bd, ProfileMaterializationContract as bf, OpenSandboxRunPromptOptions as bi, ProviderSeam as bl, ProgressView as bn, inlineSandboxClient as bo, compareCheckOutcomes as br, WinnerStrategy as bs, createScope as bt, DetachedTurn as bu, VerifierEnvironmentOptions as c, selectValidWinner as ca, leaderboard as cc, DelegationStatusArgs as cd, SpawnForestTree as cf, naiveDriver as ci, DELEGATE_TOOL_NAME as cl, delegate as cn, defaultSelectWinner as co, CheckOutcome as cr, ScopeWidenGate as cs, ResolveSupervisorTools as ct, SettleDetachedCoderTurnOptions as cu, SuperviseSurfaceResult as d, CreateScopeAnalystOptions as da, renderLeaderboardMarkdown as dc, FeedbackRefersTo as dd, pendingWaits as df, McpSpawnFault as di, DelegateHandlerOptions as dl, DriverAgentOptions as dn, LocalSandboxClientOptions as do, CheckSource as dr, TrajectoryReport as ds, SupervisorNodeContext as dt, detachedSessionDelegate as du, FileCorpus as ea, Interval as ec, DelegationFeedbackSnapshot as ed, FileSpawnJournal as ef, assertStrategyContract as ei, WorkerWatchOptions as el, DispatchUnit as en, sampleThenRefine as eo, asAuthoredProfile as er, PanelSpec as es, SuperviseRegistryTable as et, InMemoryFeedbackStore as eu, SurfaceWorkerConfig as f, RegistryAnalyzeProjection as fa, renderLeaderboardSvg as fc, ResearchOutputShape as fd, replaySpawnTree as ff, McpToolDescriptor as fi, DelegateResult as fl, driverAgent as fn, localSandboxClient as fo, CheckSourceCtx as fr, TrajectoryReportFn as fs, SupervisorNodeContextSeed as ft, settleDetachedCoderTurn as fu, AuthoredHarness as g, registryScopeAnalyst as ga, IntentAudit as gc, CappedDelegationTrace as gd, AssertProfileMaterializationOptions as gf, materializeLocalMcp as gi, CliSeam as gl, PlateauOptions as gn, mcpSecretEnvMetadataKey as go, StructuralRolloutPolicy as gr, Widen as gs, assertCoordinationBinding as gt, SiblingSandboxExecutorOptions as gu, superviseSurface as h, createScopeAnalyst as ha, AuditIntentOptions as hc, UiAuditorDelegationOutput as hd, AgentProfileMaterializationAxis as hf, connectStdioMcp as hi, BridgeSeam as hl, NoProgressForOptions as hn, envKeyProvider as ho, StructuralRolloutMessage as hr, VerifySpec as hs, SupervisorToolInvocationContext as ht, FleetWorkspaceExecutorOptions as hu, SandboxEvent$1 as i, flatWidenGate as ia, PairwiseOptions as ic, DelegationProfile as id, SpawnForestEvent as if, DumbDriverOptions as ii, createInProcessTransport as il, queueOf as in, loopCampaignDispatch as io, defaultProfileRichnessThresholds as ir, RenderCorpusToInstructions as is, DriveHarness as it, CoderReviewer as iu, Shell as j, AgenticRunResult as ja, AnalystFindingEvent as jc, InMemoryDelegationStore as jd, promptResourceProfileMaterialization as jf, SandboxToolPartState as ji, createSteerableSandboxSession as jl, FinalizeContext as jn, ObserveOptions as jo, visibleCheckScore as jr, ShapeContext as js, workerInboxFile as jt, DelegationRecord as ju, withUntrackedArtifacts as k, runBenchmark as ka, WaterfallSpan as kc, FileDelegationStore as kd, promptModelProfileMaterialization as kf, SessionCapableBox as ki, SteerableSandboxArgs as kl, sampleFromSettled as kn, Observation as ko, selectBestIndex as kr, RunPersonifiedOptions as ks, supervisorWorkersDir as kt, runDetachedTurn as ku, createVerifierEnvironment as l, verify as la, pairwiseSignificance as lc, DelegationStatusResult as ld, loadSpawnForest as lf, LocalMcpMaterialization as li, DelegateArgs as ll, CoordinationMcpHandle as ln, runAgentRounds as lo, CheckRunContext as lr, SteerContext as ls, ResolvedSupervisorProfile as lt, UiAuditorDelegate as lu, failuresAnalyst as m, buildSteerContext as ma, AuditIntentInput as mc, UiAuditLensFilter as md, AGENT_PROFILE_MATERIALIZATION_AXES as mf, StdioMcpServerSpec as mi, validateDelegateArgs as ml, AllWorkersStalledOptions as mn, ResolvedMcpServerLaunch as mo, StructuralRolloutConfig as mr, Verify as ms, SupervisorToolDescriptor as mt, FleetHandle as mu, AnalystFinding$1 as n, renderCorpusToInstructions as na, LeaderboardOptions as nc, DelegationHistoryEntry as nd, InMemorySpawnJournal as nf, strategyAuthorContract as ni, McpServer as nl, effectiveConcurrency as nn, LoopDispatchOptions as no, authoredWorker as nr, Pipeline as ns, workerFromBackend as nt, CoderDelegate as nu, computeFindingId$1 as o, panel as oa, ProfileKeyOf as oc, DelegationResultPayload as od, SpawnForestMissingTree as of, SteeringDecision as oi, DELEGATE_DESCRIPTION as ol, DelegateOptions as on, RunAgentRoundsOptions as oo, supervisorInstructions as or, ScopeAnalyst as os, ObserveSupervisorNodeEvent as ot, DetachedSessionDelegateOptions as ou, SurfaceWorkerOut as p, assertTraceDerivedFindings as pa, renderPairwiseMarkdown as pc, ResearchSource as pd, contentAddress as pf, StdioMcpConnection as pi, createDelegateHandler as pl, finalizeBestDelivered as pn, KeyProvider as po, RepairStop as pr, TrajectoryReportOptions as ps, SupervisorProfile as pt, DelegationExecutor as pu, createSupervisor as q, adaptiveRefine as qa, QuestionLevel as qc, createEventBus as qd, equalKOnCost as qi, removeWorktree as ql, ReservationRejection as qn, FanoutWinnerSelector as qo, StrategyEvolutionConfig as qr, CompletionVerdict as qs, SupervisorSpanRecorder as qt, DelegateResearchConfig as qu, CreateSandboxOptions$1 as r, fanout as ra, LeaderboardRow as rc, DelegationHistoryResult as rd, SpawnForest as rf, ApplyContinuation as ri, McpServerOptions as rl, freeSlots as rn, LoopOptionsForDispatch as ro, canonicalizeAuthoredProfile as rr, PipelineStage as rs, CoordinationBinding as rt, CoderReview as ru, makeFinding$1 as s, pipeline as sa, ScoreOf as sc, DelegationStatus as sd, SpawnForestNode as sf, dumbDriver as si, DELEGATE_INPUT_SCHEMA as sl, defaultDelegateBudget as sn, RunLoopOptions as so, CheckExecChannel as sr, ScopeAnalyzeInput as ss, ResolveDriveHarness as st, DetachedWinnerSelection as su, AgentProfile$2 as t, InMemoryCorpus as ta, Leaderboard as tc, DelegationHistoryArgs as td, InMemoryResultBlobStore as tf, authorStrategy as ti, createCoordinationTools as tl, RollingDispatchOptions as tn, LoopCampaignDispatchOptions as to, assessAuthoredProfile as tr, PanelVerdict as ts, supervise as tt, eventToSnapshot as tu, SuperviseSurfaceOptions as u, widen as ua, renderLeaderboardHtml as uc, FeedbackRating as ud, materializeTreeView as uf, MaterializeLocalMcpOptions as ui, DelegateError as ul, serveCoordinationMcp as un, runLoop as uo, CheckRunner as ur, TrajectoryNode as us, SupervisorAgentDeps as ut, coderTaskFromArgs as uu, worktreeFanout as v, McpEnvironmentOptions as va, defaultAuditorInstruction as vc, DELEGATION_TRACE_MAX_SPANS as vd, DefineProfileMaterializationContractOptions as vf, OpenSandboxRunBeforeStartContext as vi, CliWorktreeSeam as vl, ProgressTracker as vn, resolveSecretEnv as vo, VisibleCheck as vr, WidenLineage as vs, supervisorAgent as vt, createSiblingSandboxExecutor as vu, composeWorkerEvidence as w, BenchmarkReport as wa, bestSoFar as wc, composeLoopTraceEmitters as wd, controlProfileMaterialization as wf, openSandboxRun as wi, cliWorktreeExecutor as wl, allWorkersStalled as wn, inProcessSandboxClient as wo, filterAuthoredAsserts as wr, Outcome as ws, legacySupervisorRunsRoot as wt, RunDetachedTurnOptions as wu, VERIFY_TAIL_CHARS as x, BenchmarkCell as xa, AnytimeTaskCurve as xc, DelegationTraceSpan as xd, ProfileMaterializationIssue as xf, SandboxRun as xi, RouterSeam as xl, StopDecision as xn, InProcessOnPrompt as xo, composeCheckSources as xr, DefinePersona as xs, settledToIteration as xt, DetachedTurnResumeDriverOptions as xu, EVIDENCE_MAX_CHARS as y, createMcpEnvironment as ya, AnytimeReport as yc, DelegationTraceCaps as yd, KnownAgentProfileMaterializationAxis as yf, OpenSandboxRunOptions as yi, ExecutorConfig as yl, ProgressTrackerOptions as yn, secretEnvOfMcpServer as yo, canDisplace as yr, WidenSpec as ys, ScopeArgs as yt, DetachedSessionRefParts as yu, TrajectoryAnalysis as z, ShotSpec as za, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as zc, RuntimeRunStateError as zd, probeSandboxCapabilities as zi, CreateWorktreeOptions as zl, CoordinationDeliveryEvidence as zn, CorpusRecord as zo, ChampionPolicy as zr, LeaderboardRunContext as zs, PatchDeliverableOptions as zt, SubmitOutput as zu };
|
|
8197
|
-
//# sourceMappingURL=index-
|
|
8560
|
+
export { legacySupervisorRunsRoot as $, printBenchmarkReport as $a, WaterfallReport as $c, createDelegationTraceCollector as $d, defineProfileMaterializationContract as $f, SandboxLineageHandle as $i, createExecutor as $l, DeliveredOutput as $n, harvestCorpus as $o, structuralRollout as $r, RunPersonified as $s, assertCoordinationBinding as $t, createDetachedTurnResumeDriver as $u, GitWorkspaceOptions as A, loopUntil as Aa, PairwiseVerdict as Ac, DelegationHistoryEntry as Ad, InMemorySpawnJournal as Af, SteeringDirectiveData as Ai, McpServer as Al, defaultDelegateBudget as An, loopDispatch as Ao, CheckExecChannel as Ar, RenderCorpusToInstructionsOptions as As, runGraph as At, CoderDelegate as Au, analyzeTrace as B, createScopeAnalyst as Ba, AuditIntentOptions as Bc, ResearchOutputShape as Bd, replaySpawnTree as Bf, connectStdioMcp as Bi, DelegateResult as Bl, ProgressSample as Bn, envKeyProvider as Bo, StructuralRolloutResult as Br, VerifySpec as Bs, CoordinationBinding as Bt, settleDetachedCoderTurn as Bu, closingWorkerNote as C, definePersona as Ca, AxisScoresOf as Cc, DelegateUiAuditArgs as Cd, defaultToolDetectors as Cf, assertStrategyContract as Ci, QuestionUrgency as Cl, DispatchUnit as Cn, runAgentic as Co, asAuthoredProfile as Cr, Panel as Cs, EdgeTraversal as Ct, JsonRpcResponse as Cu, UntrackedCopyStats as D, renderCorpusToInstructions as Da, LeaderboardOptions as Dc, DelegationError as Dd, FileResultBlobStore as Df, DumbDriverOptions as Di, canonicalFindingEvent as Dl, queueOf as Dn, LoopDispatchOptions as Do, defaultProfileRichnessThresholds as Dr, Pipeline as Ds, GraphResult as Dt, FeedbackStore as Du, CopyOptions as E, InMemoryCorpus as Ea, Leaderboard as Ec, DelegateUiAuditRoute as Ed, gateOnDeliverable as Ef, ApplyContinuation as Ei, WorkerWatchOptions as El, freeSlots as En, LoopCampaignDispatchOptions as Eo, canonicalizeAuthoredProfile as Er, PanelVerdict as Es, GraphNode as Et, FeedbackEvent as Eu, gitWorkspace as F, widen as Fa, renderLeaderboardHtml as Fc, DelegationStatus as Fd, SpawnForestNode as Ff, MaterializeLocalMcpOptions as Fi, DELEGATE_INPUT_SCHEMA as Fl, driverAgent as Fn, runLoop as Fo, CheckSourceCtx as Fr, TrajectoryNode as Fs, SuperviseOptions as Ft, DetachedWinnerSelection as Fu, workerTraceAnalysisStore as G, sanitizeMcpToolSchema as Ga, AnytimeStrategySummary as Gc, DELEGATION_TRACE_MAX_BYTES as Gd, CanonicalAgentProfileMaterializationAxis as Gf, OpenSandboxRunPromptOptions as Gi, CliWorktreeBridgeSeam as Gl, StopRule as Gn, inlineSandboxClient as Go, defaultExtractCandidate as Gr, WinnerStrategy as Gs, ResolveSupervisorTools as Gt, createFleetWorkspaceExecutor as Gu, WorkerToolTraceArtifact as H, McpEndpoint as Ha, auditIntent as Hc, UiAuditLensFilter as Hd, AGENT_PROFILE_MATERIALIZATION_AXES as Hf, Deliverable as Hi, validateDelegateArgs as Hl, ProgressTrackerOptions as Hn, resolveMcpServerLaunch as Ho, canDisplace as Hr, WidenDecision as Hs, DriveHarnessOwnerContext as Ht, FleetHandle as Hu, jjWorkspace as I, CreateScopeAnalystOptions as Ia, renderLeaderboardMarkdown as Ic, DelegationStatusArgs as Id, SpawnForestTree as If, McpSpawnFault as Ii, DELEGATE_TOOL_NAME as Il, finalizeBestDelivered as In, LocalSandboxClientOptions as Io, RepairStop as Ir, TrajectoryReport as Is, SuperviseRegistry as It, SettleDetachedCoderTurnOptions as Iu, ScopeArgs as J, BenchmarkLift as Ja, areaUnderCurve as Jc, DelegationTraceCollector as Jd, ProfileMaterializationContract as Jf, TurnResult as Ji, ProviderSeam as Jl, anyOf as Jn, InProcessSandboxClientOptions as Jo, modelAuthoredChecks as Jr, LoopShape as Js, SupervisorNodeContext as Jt, DetachedTurn as Ju, createRootHandle as K, BenchmarkCell as Ka, AnytimeTaskCurve as Kc, DELEGATION_TRACE_MAX_SPANS as Kd, DefineProfileMaterializationContractOptions as Kf, SandboxRun as Ki, CliWorktreeSeam as Kl, allOf as Kn, InProcessOnPrompt as Ko, defaultStructuralRolloutPolicy as Kr, DefinePersona as Ks, ResolvedSupervisorProfile as Kt, createSiblingSandboxExecutor as Ku, localShell as L, RegistryAnalyzeProjection as La, renderLeaderboardSvg as Lc, DelegationStatusResult as Ld, loadSpawnForest as Lf, McpToolDescriptor as Li, DelegateArgs as Ll, AllWorkersStalledOptions as Ln, localSandboxClient as Lo, StructuralRolloutConfig as Lr, TrajectoryReportFn as Ls, SuperviseRegistryTable as Lt, UiAuditorDelegate as Lu, Workspace as M, pipeline as Ma, ScoreOf as Mc, DelegationProfile as Md, SpawnForestEvent as Mf, naiveDriver as Mi, createInProcessTransport as Ml, CoordinationMcpHandle as Mn, RunLoopOptions as Mo, CheckRunContext as Mr, ScopeAnalyzeInput as Ms, AuthorizedSpawnContext as Mt, CoderReviewer as Mu, WorkspaceCommit as N, selectValidWinner as Na, leaderboard as Nc, DelegationProgress as Nd, SpawnForestInDoubtNode as Nf, steeringDriver as Ni, createMcpServer as Nl, serveCoordinationMcp as Nn, defaultSelectWinner as No, CheckRunner as Nr, ScopeWidenGate as Ns, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as Nt, DelegateRunCtx as Nu, copyUntrackedIntoClone as O, fanout as Oa, LeaderboardRow as Oc, DelegationFeedbackSnapshot as Od, FileSpawnJournal as Of, NaiveDriverOptions as Oi, createCoordinationTools as Ol, rollingDispatch as On, LoopOptionsForDispatch as Oo, profileRichnessFinding as Or, PipelineStage as Os, RunGraphOptions as Ot, InMemoryFeedbackStore as Ou, WorkspaceRun as P, verify as Pa, pairwiseSignificance as Pc, DelegationResultPayload as Pd, SpawnForestMissingTree as Pf, LocalMcpMaterialization as Pi, DELEGATE_DESCRIPTION as Pl, DriverAgentOptions as Pn, runAgentRounds as Po, CheckSource as Pr, SteerContext as Ps, DeliverableResolutionInput as Pt, DetachedSessionDelegateOptions as Pu, legacySupervisorRunDir as Q, Environment as Qa, WaterfallCollector as Qc, composeLoopTraceEmitters as Qd, controlProfileMaterialization as Qf, SandboxLineage as Qi, cliWorktreeExecutor as Ql, sampleFromSettled as Qn, HarvestReport as Qo, selectBestIndex as Qr, PersonaExecutors as Qs, SupervisorToolInvocationContext as Qt, RunDetachedTurnOptions as Qu, runInWorkspace as R, assertTraceDerivedFindings as Ra, renderPairwiseMarkdown as Rc, FeedbackRating as Rd, materializeTreeView as Rf, StdioMcpConnection as Ri, DelegateError as Rl, NoProgressForOptions as Rn, KeyProvider as Ro, StructuralRolloutMessage as Rr, TrajectoryReportOptions as Rs, supervise as Rt, coderTaskFromArgs as Ru, WorkerEvidenceInput as S, registerShape as Sa, stopSentinel as Sc, DelegateResearchResult as Sd, WatchTraceOptions as Sf, AuthoredStrategy as Si, QuestionRecord as Sl, DispatchStopReason as Sn, refine as So, ProfileRichnessThresholds as Sr, LoopUntilState as Ss, EdgeDeliveryOutcome as St, JsonRpcMessage as Su, settledWorkerOut as T, FileCorpus as Ta, Interval as Tc, DelegateUiAuditResult as Td, DeliverableSpec as Tf, strategyAuthorContract as Ti, WorkerSpawnContext as Tl, effectiveConcurrency as Tn, sampleThenRefine as To, authoredWorker as Tr, PanelSpec as Ts, GraphEdgeCapError as Tt, McpTransport as Tu, captureWorkerTraceEvidence as U, McpEnvironmentOptions as Ua, defaultAuditorInstruction as Uc, UiAuditorDelegationOutput as Ud, AgentProfileMaterializationAxis as Uf, OpenSandboxRunBeforeStartContext as Ui, BridgeSeam as Ul, ProgressView as Un, resolveSecretEnv as Uo, compareCheckOutcomes as Ur, WidenLineage as Us, ObserveSupervisorNodeEvent as Ut, FleetWorkspaceExecutorOptions as Uu, WORKER_TOOL_TRACE_SCHEMA_VERSION as V, registryScopeAnalyst as Va, IntentAudit as Vc, ResearchSource as Vd, contentAddress as Vf, materializeLocalMcp as Vi, createDelegateHandler as Vl, ProgressTracker as Vn, mcpSecretEnvMetadataKey as Vo, VisibleCheck as Vr, Widen as Vs, DriveHarness as Vt, DelegationExecutor as Vu, parseWorkerToolTraceArtifact as W, createMcpEnvironment as Wa, AnytimeReport as Wc, CappedDelegationTrace as Wd, AssertProfileMaterializationOptions as Wf, OpenSandboxRunOptions as Wi, CliSeam as Wl, StopDecision as Wn, secretEnvOfMcpServer as Wo, composeCheckSources as Wr, WidenSpec as Ws, ResolveDriveHarness as Wt, SiblingSandboxExecutorOptions as Wu, settledToIteration as X, BenchmarkStrategySummary as Xa, plateauLength as Xc, buildDelegationTraceSpans as Xd, ValidateProfileMaterializationOptions as Xf, CheckpointCapableBox as Xi, RouterToolsSeam as Xl, noProgressFor as Xn, HarvestCorpusOptions as Xo, resolveEntrySymbol as Xr, Persona as Xs, SupervisorProfile as Xt, DriveTurnCapableBox as Xu, createScope as Y, BenchmarkReport as Ya, bestSoFar as Yc, DelegationTraceSpan as Yd, ProfileMaterializationIssue as Yf, openSandboxRun as Yi, RouterSeam as Yl, createProgressTracker as Yn, inProcessSandboxClient as Yo, officialChecksFromMeta as Yr, Outcome as Ys, SupervisorNodeContextSeed as Yt, DetachedTurnResumeDriverOptions as Yu, WorkerSteerRequest as Z, BenchmarkTaskRow as Za, renderAnytimeTable as Zc, capDelegationTrace as Zd, assertProfileMaterialization as Zf, ForkCapableBox as Zi, SandboxSeam as Zl, plateau as Zn, HarvestFailure as Zo, sandboxCheckRunner as Zr, PersonaContext as Zs, SupervisorToolDescriptor as Zt, DriveTurnTick as Zu, WorktreeFanoutOptions as _, promotionGate as _a, CompletionPolicy as _c, DelegateCodeResult as _d, BusRecord as _f, discriminatingMeans as _i, Question as _l, naiveContinuationPrompt as _n, SurfaceScore as _o, ReservationTicket as _r, FanoutSynthesis as _s, WorktreePatchArtifact as _t, RemoveWorktreeOptions as _u, SandboxInstance$1 as a, mapSandboxEvent as aa, LeaderboardBenchScore as ac, DelegationRecord as ad, InMemoryDelegationStore as af, collectAgentTurn as ai, AuthorizeDownMessage as al, SupervisorSpanRecorder as an, AgenticTool as ao, promptResourceProfileMaterialization as ap, pickBestDelivered as ar, renderReport as as, workerControlLogFile as at, createSteerableSandboxSession as au, NOTE_MAX_CHARS as b, builtinShapes as ba, deterministicCompletion as bc, DelegateResearchArgs as bd, PublishOptions as bf, selectChampion as bi, QuestionOption as bl, ConcurrencyCaps as bn, defineStrategy as bo, AuthoredProfile as br, LoopUntil as bs, assertProfileModelsAllowed as bt, createWorktree as bu, VerifierEnvironmentOptions as c, CriuCapableClient as ca, LeaderboardFlagSpec as cc, DelegationResumeTick as cd, BackendTransportError as cf, ChampionPolicy as ci, CoordinationEvent as cl, PromptRegistry as cn, RunAgenticOptions as co, validateProfileMaterialization as cp, CoordinationDeliveryEvidence as cr, Corpus as cs, writeWorkerSteer as ct, createInbox as cu, SuperviseSurfaceResult as d, AcquireOptions as da, LeaderboardScenario as dc, DelegationTaskQueueOptions as dd, NotFoundError as df, EvolutionBandInfo as di, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as dl, createPromptRegistry as dn, Strategy as do, FileCoordinationLog as dr, EqualKArm as ds, RunContext as dt, WorktreeHarnessResult as du, SessionCapableBox as ea, RunPersonifiedOptions as ec, detachedTurnEvents as ed, DelegationPersistenceError as ef, visibleCheckScore as ei, WaterfallSpan as el, resolveSupervisorProfile as en, runBenchmark as eo, fullProfileMaterialization as ep, FinalizeContext as er, Observation as es, readWorkerSteerRequests as et, createExecutorRegistry as eu, SurfaceWorkerConfig as f, acquireSandbox as fa, LeaderboardScore as fc, SubmitInput as fd, PlannerError as ff, EvolutionCandidate as fi, DownMessageAuthorizationInput as fl, delegatesWorkerBriefPrompt as fn, StrategyArtifacts as fo, PriorCoordination as fr, EqualKOnCost as fs, createFileRunContext as ft, WorktreeProfileMaterializationReceipt as fu, AuthoredHarness as g, PromotionVerdict as ga, CompletionEvidence as gc, DelegateCodeConfig as gd, BusEvent as gf, StrategyEvolutionConfig as gi, MakeWorkerAgent as gl, kernelPromptRegistry as gn, StrategyShotResult as go, ReservationRejection as gr, FanoutOptions as gs, WorktreeCliExecutorOptions as gt, GitRunner as gu, superviseSurface as h, PromotionGateOptions as ha, CompletionAnalyst as hc, DelegateCodeArgs as hd, CoderOutput as hf, ReproductionCheck as hi, DownMessageEvent as hl, formatPromptHandle as hn, StrategyResult as ho, BudgetReadout as hr, Fanout as hs, patchDelivered as ht, DiffResult as hu, SandboxEvent$1 as i, extractLlmCallEvent as ia, DefinedLeaderboard as ic, DelegationArgs as id, FileDelegationStoreOptions as if, StreamAgentTurnOptions as ii, AnalyzeOnSettleRoute as il, SupervisorSpanOutcome as in, AgenticTask as io, promptOnlyProfileMaterialization as ip, collectDelivered as ir, observe as is, supervisorWorkersDir as it, SteerableSandboxSession as iu, Shell as j, panel as ja, ProfileKeyOf as jc, DelegationHistoryResult as jd, SpawnForest as jf, dumbDriver as ji, McpServerOptions as jl, delegate as jn, RunAgentRoundsOptions as jo, CheckOutcome as jr, ScopeAnalyst as js, AuthorizedSpawn as jt, CoderReview as ju, withUntrackedArtifacts as k, flatWidenGate as ka, PairwiseOptions as kc, DelegationHistoryArgs as kd, InMemoryResultBlobStore as kf, SteeringDecision as ki, normalizeAnalyzeOnSettle as kl, DelegateOptions as kn, loopCampaignDispatch as ko, supervisorInstructions as kr, RenderCorpusToInstructions as ks, defaultEdgeTraversalCap as kt, eventToSnapshot as ku, createVerifierEnvironment as l, SandboxCapabilities as la, LeaderboardIterationInfo as lc, DelegationRunContext as ld, ConfigError as lf, EvolutionArchiveNode as li, CoordinationTools as ll, RegisteredPrompt as ln, ShotPersona as lo, worktreeCliProfileMaterialization as lp, CoordinationLog as lr, CorpusFilter as ls, InMemoryRunContext as lt, WorktreeCheckRunner as lu, failuresAnalyst as m, resolveSandboxClient as ma, defineLeaderboard as mc, hashIdempotencyInput as md, ValidationError as mf, EvolutionReport as mi, DownMessageDeliveryOutcome as ml, dumbContinuationPassPrompt as mn, StrategyMessage as mo, BudgetPoolRestore as mr, EqualKVerdict as ms, PatchDeliverableOptions as mt, DiffOptions as mu, AnalystFinding$1 as n, SandboxToolPartState as na, ShapeContext as nc, parseDetachedSessionRef as nd, DelegationStore as nf, AgentTurnUsage as ni, AnalystFindingEvent as nl, SupervisorSpanAttributes as nn, AgenticRunResult as no, promptControlProfileMaterialization as np, SupervisorFinalizer as nr, ObserveOptions as ns, supervisorRunDir as nt, SandboxSteeringOptions as nu, computeFindingId$1 as o, mapSandboxToolEvent as oa, LeaderboardBenchTask as oc, DelegationResumeContext as od, AgentEvalError$1 as of, streamAgentTurn as oi, AuthorizedDownMessage as ol, createSupervisorSpanRecorder as on, ArtifactHandle as oo, renderProfileMaterializationIssues as op, runFinalizer as or, AssertTraceDerivedFindings as os, workerInboxFile as ot, Inbox as ou, SurfaceWorkerOut as p, ResolveSandboxClientOptions as pa, LeaderboardSpec as pc, SubmitOutput as pd, RuntimeRunStateError as pf, EvolutionGeneration as pi, DownMessageDeliveryAttempt as pl, dumbContinuationFailPrompt as pn, StrategyCtx as po, BudgetPool as pr, EqualKOnCostOptions as ps, createInMemoryRunContext as pt, CreateWorktreeOptions as pu, createSupervisor as q, BenchmarkConfig as qa, anytimeReport as qc, DelegationTraceCaps as qd, KnownAgentProfileMaterializationAxis as qf, SandboxRunAbortError as qi, ExecutorConfig as ql, allWorkersStalled as qn, InProcessPromptCtx as qo, filterAuthoredAsserts as qr, DefinePersonaInput as qs, SupervisorAgentDeps as qt, DetachedSessionRefParts as qu, CreateSandboxOptions$1 as r, createSandboxToolPartState as ra, ShapeRegistry as rc, runDetachedTurn as rd, FileDelegationStore as rf, CollectedAgentTurn as ri, AnalystRegistry as rl, SupervisorSpanOptions as rn, AgenticSurface as ro, promptModelProfileMaterialization as rp, bestDelivered as rr, defaultAnalystInstruction as rs, supervisorRunsRoot as rt, SteerableSandboxArgs as ru, makeFinding$1 as s, sumSandboxUsage as sa, LeaderboardBenchmarkAdapter as sc, DelegationResumeDriver as sd, AgentEvalErrorCode as sf, ChampionPick as si, ContinuationInstruction as sl, PromptHandle as sn, CorpusReadbackOptions as so, sandboxActProfileMaterialization as sp, runTree as sr, CombinatorShape as ss, workerInboxFileFromEventDir as st, InboxMessage as su, AgentProfile$2 as t, createSandboxLineage as ta, ShapeBudget as tc, formatDetachedSessionRef as td, DelegationStateCorruptError as tf, AgentTurnBackend as ti, createWaterfallCollector as tl, supervisorAgent as tn, AgenticOptions as to, profileMaterializationAxes as tp, FinalizerSettled as tr, ObserveInput as ts, safeWorkerFile as tt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as tu, SuperviseSurfaceOptions as u, probeSandboxCapabilities as ua, LeaderboardRunContext as uc, DelegationTaskQueue as ud, JudgeError as uf, EvolutionAuthor as ui, CoordinationToolsOptions as ul, analyzesFindingsReportPrompt as un, ShotSpec as uo, CoordinationOwnerId as ur, CorpusRecord as us, InMemoryRunContextOptions as ut, WorktreeCommandResult as uu, worktreeFanout as v, equalKOnCost as va, CompletionVerdict as vc, DelegateFeedbackArgs as vd, BusStats as vf, pickChampion as vi, QuestionDecision as vl, promptHandle as vn, adaptiveRefine as vo, createBudgetPool as vr, FanoutWinnerSelector as vs, createWorktreeCliExecutor as vt, WorktreeHandle as vu, composeWorkerEvidence as w, runPersonified as wa, GroupOf as wc, DelegateUiAuditConfig as wd, watchTrace as wf, authorStrategy as wi, SettledWorker as wl, RollingDispatchOptions as wn, sample as wo, assessAuthoredProfile as wr, PanelJudge as ws, GraphEdge as wt, McpToolDescriptor$1 as wu, VERIFY_TAIL_CHARS as x, createShapeRegistry as xa, sentinelCompletion as xc, DelegateResearchConfig as xd, createEventBus as xf, AuthorStrategyOptions as xi, QuestionPolicy as xl, DispatchReport as xn, depthStrategy as xo, ProfileRichness as xr, LoopUntilSpec as xs, AgentGraph as xt, removeWorktree as xu, EVIDENCE_MAX_CHARS as y, trajectoryReport as ya, completionAuthorizes as yc, DelegateFeedbackResult as yd, EventBus as yf, runStrategyEvolution as yi, QuestionLevel as yl, supervisorPolicyPrompt as yn, breadthStrategy as yo, spendFromUsageEvents as yr, FlatWidenGate as ys, assertModelAllowed as yt, captureWorktreeDiff as yu, TrajectoryAnalysis as z, buildSteerContext as za, AuditIntentInput as zc, FeedbackRefersTo as zd, pendingWaits as zf, StdioMcpServerSpec as zi, DelegateHandlerOptions as zl, PlateauOptions as zn, ResolvedMcpServerLaunch as zo, StructuralRolloutPolicy as zr, Verify as zs, workerFromBackend as zt, detachedSessionDelegate as zu };
|
|
8561
|
+
//# sourceMappingURL=index-CyXinqJw.d.ts.map
|