@tangle-network/agent-runtime 0.82.0 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/agent.d.ts +5 -3
- package/dist/agent.js +7 -7
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +3 -2
- package/dist/analyst-loop.js +2 -2
- package/dist/{chunk-A7LZR5DT.js → chunk-4WXGK6GV.js} +2 -2
- package/dist/chunk-4WXGK6GV.js.map +1 -0
- package/dist/{chunk-UZ5SODU7.js → chunk-5IBQAPVB.js} +1 -1
- package/dist/chunk-5IBQAPVB.js.map +1 -0
- package/dist/{chunk-5JAUQZQA.js → chunk-7LO5GMAO.js} +1 -1
- package/dist/chunk-7LO5GMAO.js.map +1 -0
- package/dist/{chunk-H7IBHAFT.js → chunk-BZF3KQ6G.js} +1 -1
- package/dist/chunk-BZF3KQ6G.js.map +1 -0
- package/dist/{chunk-WIR4HOOJ.js → chunk-DPEUKJRO.js} +1 -1
- package/dist/chunk-DPEUKJRO.js.map +1 -0
- package/dist/{chunk-DJQFJEOD.js → chunk-J3N6GODQ.js} +2 -2
- package/dist/chunk-J3N6GODQ.js.map +1 -0
- package/dist/{chunk-GRAGM4MC.js → chunk-NURIQBJQ.js} +1 -1
- package/dist/chunk-NURIQBJQ.js.map +1 -0
- package/dist/{chunk-JYURIKPF.js → chunk-QDVLTRCP.js} +4 -4
- package/dist/chunk-QDVLTRCP.js.map +1 -0
- package/dist/{chunk-FNMGYYSS.js → chunk-SGKPNBXE.js} +1 -1
- package/dist/chunk-SGKPNBXE.js.map +1 -0
- package/dist/{chunk-CO2KBPRE.js → chunk-SSA6OERV.js} +6 -6
- package/dist/chunk-SSA6OERV.js.map +1 -0
- package/dist/{chunk-SRGV56W4.js → chunk-UD4BHQMI.js} +2 -2
- package/dist/{chunk-SRGV56W4.js.map → chunk-UD4BHQMI.js.map} +1 -1
- package/dist/{chunk-KSGHI53L.js → chunk-UJ3ONGHR.js} +6 -6
- package/dist/chunk-UJ3ONGHR.js.map +1 -0
- package/dist/{chunk-LWGVVP2C.js → chunk-VNOOH22O.js} +2 -2
- package/dist/chunk-VNOOH22O.js.map +1 -0
- package/dist/{chunk-NBV35BR6.js → chunk-YEJR7IXO.js} +1 -1
- package/dist/chunk-YEJR7IXO.js.map +1 -0
- package/dist/{chunk-C2FZ6GR6.js → chunk-YPA5MLVE.js} +2 -2
- package/dist/chunk-YPA5MLVE.js.map +1 -0
- package/dist/{coordination-BI9tpcmF.d.ts → coordination-CuDLO8wj.d.ts} +53 -32
- package/dist/environment-provider.d.ts +2 -2
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-adapter-CioiEE2z.d.ts → improvement-adapter-CDR8QNVM.d.ts} +3 -0
- package/dist/index.d.ts +163 -49
- package/dist/index.js +43 -13
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +14 -8
- package/dist/intelligence.js +1 -1
- package/dist/intelligence.js.map +1 -1
- package/dist/{kb-gate-CuzMYGYM.d.ts → kb-gate-CwHO0vz6.d.ts} +4 -2
- package/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.js +3 -3
- package/dist/{local-harness-DU7yV6mG.d.ts → local-harness-sI0S_XNA.d.ts} +2 -1
- package/dist/{loop-runner-bin-CBkLsyFg.d.ts → loop-runner-bin-hQDUL8Ld.d.ts} +28 -13
- package/dist/loop-runner-bin.d.ts +7 -7
- package/dist/loop-runner-bin.js +10 -10
- package/dist/loops.d.ts +102 -45
- package/dist/loops.js +7 -7
- package/dist/mcp/bin.js +8 -8
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +44 -38
- package/dist/mcp/index.js +11 -11
- package/dist/mcp/index.js.map +1 -1
- package/dist/{mcp-serve-verifier-BvMAV_8U.d.ts → mcp-serve-verifier-FL7-ZEb_.d.ts} +8 -3
- package/dist/{openai-tools-B-3v06BE.d.ts → openai-tools-BnrOmGjN.d.ts} +7 -4
- package/dist/platform.d.ts +4 -0
- package/dist/platform.js.map +1 -1
- package/dist/profiles.d.ts +36 -23
- package/dist/profiles.js +2 -2
- package/dist/profiles.js.map +1 -1
- package/dist/{router-client-D6Ocf4jG.d.ts → router-client-r8y_VFVM.d.ts} +1 -0
- package/dist/{substrate-rNj6TDc3.d.ts → substrate-DO2GHNg2.d.ts} +5 -3
- package/dist/{types-By9LXllv.d.ts → types-Driepl87.d.ts} +3 -2
- package/dist/{types-BF-MEsQB.d.ts → types-ESeMOj94.d.ts} +26 -11
- package/dist/{worktree-fanout-D9Z2dMS9.d.ts → worktree-fanout-D6xR2CIA.d.ts} +16 -10
- package/dist/{worktree-harness-Dx8XULW3.d.ts → worktree-harness-CX_McRLp.d.ts} +11 -8
- package/package.json +1 -1
- package/dist/chunk-5JAUQZQA.js.map +0 -1
- package/dist/chunk-A7LZR5DT.js.map +0 -1
- package/dist/chunk-C2FZ6GR6.js.map +0 -1
- package/dist/chunk-CO2KBPRE.js.map +0 -1
- package/dist/chunk-DJQFJEOD.js.map +0 -1
- package/dist/chunk-FNMGYYSS.js.map +0 -1
- package/dist/chunk-GRAGM4MC.js.map +0 -1
- package/dist/chunk-H7IBHAFT.js.map +0 -1
- package/dist/chunk-JYURIKPF.js.map +0 -1
- package/dist/chunk-KSGHI53L.js.map +0 -1
- package/dist/chunk-LWGVVP2C.js.map +0 -1
- package/dist/chunk-NBV35BR6.js.map +0 -1
- package/dist/chunk-UZ5SODU7.js.map +0 -1
- package/dist/chunk-WIR4HOOJ.js.map +0 -1
package/dist/loops.d.ts
CHANGED
|
@@ -2,31 +2,30 @@ import { ChatClient, RunRecord, AnalystFinding, AgentProfile, AnalystRunInputs,
|
|
|
2
2
|
export { AnalystFinding, DefaultVerdict, computeFindingId, makeFinding } from '@tangle-network/agent-eval';
|
|
3
3
|
import { SandboxEvent, SandboxInstance, CreateSandboxOptions } from '@tangle-network/sandbox';
|
|
4
4
|
export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
5
|
-
import { d as ResultBlobStore, S as SpawnJournal, N as NodeId, j as SpawnEvent, E as ExecutorFactory, c as Agent, B as Budget, i as Scope, g as Settled, f as SupervisedResult, h as Spend, U as UsageEvent, b as ExecutorRegistry, k as Supervisor } from './types-
|
|
6
|
-
export { A as AgentSpec, a as Executor, l as ExecutorContext, m as ExecutorResult, R as Runtime, n as SupervisorOpts, T as TreeView, W as WidenGate } from './types-
|
|
7
|
-
import { ak as MakeWorkerAgent, A as AnalystRegistry, o as CoordinationTools, n as CoordinationEvent, ar as QuestionPolicy, a$ as ExecutorConfig } from './coordination-
|
|
8
|
-
export { b0 as BusEvent, b1 as BusRecord, b2 as BusStats, b3 as EventBus, b4 as ProviderSeam, b5 as PublishOptions, b6 as cliWorktreeExecutor, b7 as createEventBus, b8 as createExecutor, b9 as createExecutorRegistry } from './coordination-
|
|
9
|
-
import { R as RuntimeHooks, I as Iteration, S as SandboxClient, W as Driver, A as AgentRunSpec, b as OutputAdapter, V as Validator, E as ExecCtx, X as LoopWinner, Y as LoopLineageOptions, Z as LoopResult, L as LoopTokenUsage, a as RuntimeStreamEvent, _ as MountRecorder } from './types-
|
|
10
|
-
export { $ as LoopDecisionPayload, a0 as LoopEndedPayload, a1 as LoopIterationDispatchPayload, a2 as LoopIterationEndedPayload, a3 as LoopIterationStartedPayload, a4 as LoopPlanDescription, a5 as LoopPlanPayload, d as LoopSandboxPlacement, a6 as LoopStartedPayload, a7 as LoopTeardownFailedPayload, e as LoopTraceEmitter, c as LoopTraceEvent, a8 as MountManifestEntry, a9 as RunProvenance, aa as SelectionReceipt, ab as ValidationCtx } from './types-
|
|
5
|
+
import { d as ResultBlobStore, S as SpawnJournal, N as NodeId, j as SpawnEvent, E as ExecutorFactory, c as Agent, B as Budget, i as Scope, g as Settled, f as SupervisedResult, h as Spend, U as UsageEvent, b as ExecutorRegistry, k as Supervisor } from './types-Driepl87.js';
|
|
6
|
+
export { A as AgentSpec, a as Executor, l as ExecutorContext, m as ExecutorResult, R as Runtime, n as SupervisorOpts, T as TreeView, W as WidenGate } from './types-Driepl87.js';
|
|
7
|
+
import { ak as MakeWorkerAgent, A as AnalystRegistry, o as CoordinationTools, n as CoordinationEvent, ar as QuestionPolicy, a$ as ExecutorConfig } from './coordination-CuDLO8wj.js';
|
|
8
|
+
export { b0 as BusEvent, b1 as BusRecord, b2 as BusStats, b3 as EventBus, b4 as ProviderSeam, b5 as PublishOptions, b6 as cliWorktreeExecutor, b7 as createEventBus, b8 as createExecutor, b9 as createExecutorRegistry } from './coordination-CuDLO8wj.js';
|
|
9
|
+
import { R as RuntimeHooks, I as Iteration, S as SandboxClient, W as Driver, A as AgentRunSpec, b as OutputAdapter, V as Validator, E as ExecCtx, X as LoopWinner, Y as LoopLineageOptions, Z as LoopResult, L as LoopTokenUsage, a as RuntimeStreamEvent, _ as MountRecorder } from './types-ESeMOj94.js';
|
|
10
|
+
export { $ as LoopDecisionPayload, a0 as LoopEndedPayload, a1 as LoopIterationDispatchPayload, a2 as LoopIterationEndedPayload, a3 as LoopIterationStartedPayload, a4 as LoopPlanDescription, a5 as LoopPlanPayload, d as LoopSandboxPlacement, a6 as LoopStartedPayload, a7 as LoopTeardownFailedPayload, e as LoopTraceEmitter, c as LoopTraceEvent, a8 as MountManifestEntry, a9 as RunProvenance, aa as SelectionReceipt, ab as ValidationCtx } from './types-ESeMOj94.js';
|
|
11
11
|
export { AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, ProviderAsSandboxClientOptions, ProviderExecutorOptions, SandboxClientProviderOptions, createAgentEnvironmentProviderRegistry, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider } from './environment-provider.js';
|
|
12
|
-
import { C as CorpusRecord, c as Corpus, O as Outcome, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-
|
|
13
|
-
export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-
|
|
12
|
+
import { C as CorpusRecord, c as Corpus, O as Outcome, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-D6xR2CIA.js';
|
|
13
|
+
export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-D6xR2CIA.js';
|
|
14
14
|
import { Scenario, DispatchFn, ProfileDispatchFn } from '@tangle-network/agent-eval/campaign';
|
|
15
15
|
import { b as AnalystRegistryLike } from './types-BC3bZpH0.js';
|
|
16
16
|
import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
|
|
17
|
-
import { R as RouterConfig, a as ToolLoopChat, b as ToolLoopCompactionOptions } from './router-client-
|
|
18
|
-
export { c as RouterChatResult, d as RouterChatToolsResult, e as RouterToolCall, f as RouterToolLoopResult, g as ToolLoopCompaction, T as ToolSpec, r as routerBrain, h as routerChatWithTools, i as routerChatWithUsage, j as routerToolLoop } from './router-client-
|
|
19
|
-
import { D as DeliverableSpec } from './worktree-harness-
|
|
20
|
-
export { g as WorktreeCommandResult, h as gateOnDeliverable } from './worktree-harness-
|
|
17
|
+
import { R as RouterConfig, a as ToolLoopChat, b as ToolLoopCompactionOptions } from './router-client-r8y_VFVM.js';
|
|
18
|
+
export { c as RouterChatResult, d as RouterChatToolsResult, e as RouterToolCall, f as RouterToolLoopResult, g as ToolLoopCompaction, T as ToolSpec, r as routerBrain, h as routerChatWithTools, i as routerChatWithUsage, j as routerToolLoop } from './router-client-r8y_VFVM.js';
|
|
19
|
+
import { D as DeliverableSpec } from './worktree-harness-CX_McRLp.js';
|
|
20
|
+
export { g as WorktreeCommandResult, h as gateOnDeliverable } from './worktree-harness-CX_McRLp.js';
|
|
21
21
|
import { stuckLoopView, toolWasteView } from '@tangle-network/agent-eval/pipelines';
|
|
22
22
|
export { AgentEnvironment, AgentEnvironmentCapabilities, AgentEnvironmentEvent, AgentEnvironmentProvider, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentSession, AgentSessionRef, AgentSessionStatus, AgentTurnInput, AgentTurnResult, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from '@tangle-network/agent-interface/environment-provider';
|
|
23
|
-
import './substrate-
|
|
23
|
+
import './substrate-DO2GHNg2.js';
|
|
24
24
|
import './otel-export-BKmNwiCb.js';
|
|
25
|
-
import './local-harness-
|
|
25
|
+
import './local-harness-sI0S_XNA.js';
|
|
26
26
|
import 'node:child_process';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* @experimental
|
|
30
29
|
*
|
|
31
30
|
* Event-sourced spawn journal for the recursive execution atom (build steps 3 + 7).
|
|
32
31
|
*
|
|
@@ -44,6 +43,8 @@ import 'node:child_process';
|
|
|
44
43
|
* each settlement — NOT wall-clock. `replaySpawnTree` sorts strictly by `seq` before
|
|
45
44
|
* touching the blob store, so the order in which rehydration `get`s resolve can never
|
|
46
45
|
* reorder the replayed `Settled[]`; the result is identical regardless of blob latency.
|
|
46
|
+
*
|
|
47
|
+
* @experimental
|
|
47
48
|
*/
|
|
48
49
|
|
|
49
50
|
/**
|
|
@@ -136,6 +137,7 @@ interface WaterfallCollector {
|
|
|
136
137
|
}): string;
|
|
137
138
|
reset(): void;
|
|
138
139
|
}
|
|
140
|
+
/** Build a `WaterfallCollector` that records agent spans and renders them as an ASCII timeline. */
|
|
139
141
|
declare function createWaterfallCollector(): WaterfallCollector;
|
|
140
142
|
|
|
141
143
|
/**
|
|
@@ -273,7 +275,9 @@ interface IntentAudit {
|
|
|
273
275
|
steer?: string;
|
|
274
276
|
confidence: number;
|
|
275
277
|
}
|
|
278
|
+
/** Default system instruction for intent-auditor agents: diagnose diverged/drifting trajectories. */
|
|
276
279
|
declare const defaultAuditorInstruction: string;
|
|
280
|
+
/** The route-rigor analyst: compare declared vs revealed vs user intent over a trajectory and return aligned / drifting / diverged with evidence and one recommended intervention. */
|
|
277
281
|
declare function auditIntent(input: AuditIntentInput, opts: AuditIntentOptions): Promise<IntentAudit>;
|
|
278
282
|
|
|
279
283
|
/**
|
|
@@ -410,7 +414,6 @@ declare function renderLeaderboardSvg(report: Leaderboard): string;
|
|
|
410
414
|
declare function renderLeaderboardHtml(report: Leaderboard): string;
|
|
411
415
|
|
|
412
416
|
/**
|
|
413
|
-
* @experimental
|
|
414
417
|
*
|
|
415
418
|
* Completion / satisfiability — the OTHER output of the pluggable analyst (the steer output
|
|
416
419
|
* is `AnalystFinding[]` via the `analyze` hook; this is the "is it done?" output via the
|
|
@@ -431,6 +434,8 @@ declare function renderLeaderboardHtml(report: Leaderboard): string;
|
|
|
431
434
|
* unguessable + attributable, so it can't be spuriously emitted or confused with content.
|
|
432
435
|
* - deterministic check (compile/test/citation/proof): `deterministicCompletion(check)` —
|
|
433
436
|
* a verifier over the output, never the judge verdict (selector ≠ judge holds).
|
|
437
|
+
*
|
|
438
|
+
* @experimental
|
|
434
439
|
*/
|
|
435
440
|
|
|
436
441
|
/** Trace-derived evidence for a completion claim — an artifact (output) or a verifier metric,
|
|
@@ -464,6 +469,7 @@ interface CompletionPolicy {
|
|
|
464
469
|
/** Minimum confidence a PROBABILISTIC verdict must clear to end. Default 0.8. */
|
|
465
470
|
minConfidence?: number;
|
|
466
471
|
}
|
|
472
|
+
/** Decide whether a `CompletionVerdict` may end the node under the policy: authority scales with the verdict's determinism, and probabilistic verdicts must clear `minConfidence`. */
|
|
467
473
|
declare function completionAuthorizes(v: CompletionVerdict, policy?: CompletionPolicy): boolean;
|
|
468
474
|
/**
|
|
469
475
|
* A unique, attributable stop sentinel for a node (ralph-loop style). Deterministic from the
|
|
@@ -546,6 +552,7 @@ interface Observation {
|
|
|
546
552
|
/** Operator-facing markdown: what the observer noticed + what to change. */
|
|
547
553
|
report: string;
|
|
548
554
|
}
|
|
555
|
+
/** The third-person trace analyst: read a worker's trace and produce steer findings for the next attempt plus durable `learned` facts for the cross-run corpus. */
|
|
549
556
|
declare function observe(input: ObserveInput, opts: ObserveOptions): Promise<Observation>;
|
|
550
557
|
/** Operator-facing report, split by who should act. The agent block is the
|
|
551
558
|
* steer; the operator block is the advice. */
|
|
@@ -605,6 +612,7 @@ interface HarvestReport {
|
|
|
605
612
|
/** Per-run analysis failures — reported, never silently dropped. */
|
|
606
613
|
failures: HarvestFailure[];
|
|
607
614
|
}
|
|
615
|
+
/** Batch the firewalled `observe()` analyst over completed runs and accrete the trace-derived facts into the durable corpus — the production-traces→corpus write side of the flywheel. */
|
|
608
616
|
declare function harvestCorpus(opts: HarvestCorpusOptions): Promise<HarvestReport>;
|
|
609
617
|
|
|
610
618
|
/** Context handed to each `onPrompt` call. */
|
|
@@ -664,7 +672,6 @@ declare function inProcessSandboxClient(options: InProcessSandboxClientOptions):
|
|
|
664
672
|
declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): SandboxClient;
|
|
665
673
|
|
|
666
674
|
/**
|
|
667
|
-
* @experimental
|
|
668
675
|
*
|
|
669
676
|
* `runLoop` — the topology-agnostic kernel built atop the sandbox SDK.
|
|
670
677
|
*
|
|
@@ -686,6 +693,8 @@ declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): Sandbox
|
|
|
686
693
|
* emission. The kernel does NOT own: what the agent runs (sandbox SDK +
|
|
687
694
|
* profile), how outputs are decoded (output adapter), how outputs are
|
|
688
695
|
* scored (validator), or topology (driver).
|
|
696
|
+
*
|
|
697
|
+
* @experimental
|
|
689
698
|
*/
|
|
690
699
|
|
|
691
700
|
/** @experimental */
|
|
@@ -753,7 +762,11 @@ interface RunLoopOptions<Task, Output, Decision> {
|
|
|
753
762
|
*/
|
|
754
763
|
lineage?: LoopLineageOptions;
|
|
755
764
|
}
|
|
756
|
-
/**
|
|
765
|
+
/**
|
|
766
|
+
* The round-synchronous loop kernel: each round `driver.plan()` fans N tasks to sandboxes (bounded concurrency), parses + validates each output, and folds results through `driver.decide`.
|
|
767
|
+
*
|
|
768
|
+
* @experimental
|
|
769
|
+
*/
|
|
757
770
|
declare function runLoop<Task, Output, Decision>(options: RunLoopOptions<Task, Output, Decision>): Promise<LoopResult<Task, Output, Decision>>;
|
|
758
771
|
/**
|
|
759
772
|
* The kernel's winner argmax — best-valid-score, ties broken by earliest index,
|
|
@@ -975,7 +988,9 @@ interface Strategy {
|
|
|
975
988
|
readonly name: string;
|
|
976
989
|
driver(surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, budget: number): Agent<unknown, Outcome<unknown>>;
|
|
977
990
|
}
|
|
991
|
+
/** Built-in `Strategy`: K independent attempts, keep the best-verifying (best-of-N / resample). */
|
|
978
992
|
declare const sample: Strategy;
|
|
993
|
+
/** Built-in `Strategy`: attempt → `observe()` reads the trace → steer the next attempt → repeat (deepen one lineage). */
|
|
979
994
|
declare const refine: Strategy;
|
|
980
995
|
/** A role for one shot — multi-agent loops (researcher + engineer, a panel of k
|
|
981
996
|
* researchers) give each shot its own system prompt and optionally its own model. */
|
|
@@ -1144,6 +1159,7 @@ interface BenchmarkStrategySummary {
|
|
|
1144
1159
|
usd: number;
|
|
1145
1160
|
ms: number;
|
|
1146
1161
|
}
|
|
1162
|
+
/** Benchmark output: per-strategy means plus the full per-task × per-strategy losses table an optimizer mines. */
|
|
1147
1163
|
interface BenchmarkReport {
|
|
1148
1164
|
n: number;
|
|
1149
1165
|
excluded: number;
|
|
@@ -1206,10 +1222,10 @@ interface McpEnvironmentOptions {
|
|
|
1206
1222
|
/** Cap on a tool result's text fed back to the worker. Default 1500 chars. */
|
|
1207
1223
|
maxResultChars?: number;
|
|
1208
1224
|
}
|
|
1225
|
+
/** Wrap any MCP server as an `Environment`: `tools/list` becomes `AgenticTool[]` with provider-safe schemas; the domain supplies only the artifact lifecycle hooks. */
|
|
1209
1226
|
declare function createMcpEnvironment(opts: McpEnvironmentOptions): Environment;
|
|
1210
1227
|
|
|
1211
1228
|
/**
|
|
1212
|
-
* @experimental
|
|
1213
1229
|
*
|
|
1214
1230
|
* Analyst-on-scope (G1) — the analyze→findings→steer wire over the reactive `Scope`.
|
|
1215
1231
|
*
|
|
@@ -1226,6 +1242,8 @@ declare function createMcpEnvironment(opts: McpEnvironmentOptions): Environment;
|
|
|
1226
1242
|
* drains its settlement, then enforces the firewall on the way out — a judge-derived finding
|
|
1227
1243
|
* ABORTS, it is never filtered. Fail loud: a down analyst, a non-array result, or a tainted finding
|
|
1228
1244
|
* throws; there is no silent empty-findings path that would let a combinator steer on nothing.
|
|
1245
|
+
*
|
|
1246
|
+
* @experimental
|
|
1229
1247
|
*/
|
|
1230
1248
|
|
|
1231
1249
|
declare const assertTraceDerivedFindings: AssertTraceDerivedFindings;
|
|
@@ -1303,7 +1321,6 @@ declare function registryScopeAnalyst<D>(registry: AnalystRegistryLike, buildInp
|
|
|
1303
1321
|
declare function buildSteerContext<D>(findings: ReadonlyArray<AnalystFinding>, settledSoFar: ReadonlyArray<Settled<Outcome<D>>>): SteerContext<D>;
|
|
1304
1322
|
|
|
1305
1323
|
/**
|
|
1306
|
-
* @experimental
|
|
1307
1324
|
*
|
|
1308
1325
|
* The generic combinator library — the content-free act-bodies the wave's §1 contract froze.
|
|
1309
1326
|
*
|
|
@@ -1323,6 +1340,8 @@ declare function buildSteerContext<D>(findings: ReadonlyArray<AnalystFinding>, s
|
|
|
1323
1340
|
* Two fail-loud invariants every combinator honors: a child the conserved pool cannot admit is a
|
|
1324
1341
|
* CONCRETE blocker (never an eager over-fan, never a silent drop), and a `blocked` outcome always
|
|
1325
1342
|
* names at least one blocker (a shape that cannot finish MUST say why — `blocked([])` throws).
|
|
1343
|
+
*
|
|
1344
|
+
* @experimental
|
|
1326
1345
|
*/
|
|
1327
1346
|
|
|
1328
1347
|
/**
|
|
@@ -1406,7 +1425,6 @@ declare function widen<Task, Seed, D>(spec: WidenSpec<Seed, D>): CombinatorShape
|
|
|
1406
1425
|
declare function flatWidenGate<D>(): ScopeWidenGate<D>;
|
|
1407
1426
|
|
|
1408
1427
|
/**
|
|
1409
|
-
* @experimental
|
|
1410
1428
|
*
|
|
1411
1429
|
* The cross-run corpus (G2) — the learning-flywheel's durable accreted-fact store.
|
|
1412
1430
|
*
|
|
@@ -1421,6 +1439,8 @@ declare function flatWidenGate<D>(): ScopeWidenGate<D>;
|
|
|
1421
1439
|
* the same `id`. Malformed records — a structurally-invalid `CorpusRecord` from disk or a caller —
|
|
1422
1440
|
* fail loud (the validator throws), since a corpus that silently accepts garbage would poison
|
|
1423
1441
|
* every downstream run that reads it back.
|
|
1442
|
+
*
|
|
1443
|
+
* @experimental
|
|
1424
1444
|
*/
|
|
1425
1445
|
|
|
1426
1446
|
/**
|
|
@@ -1475,7 +1495,6 @@ declare class FileCorpus implements Corpus {
|
|
|
1475
1495
|
declare function renderCorpusToInstructions(opts: RenderCorpusToInstructionsOptions): Promise<AgentProfile$1>;
|
|
1476
1496
|
|
|
1477
1497
|
/**
|
|
1478
|
-
* @experimental
|
|
1479
1498
|
*
|
|
1480
1499
|
* The personify layer impl — `definePersona` (the thin builder) + `runPersonified` (composes
|
|
1481
1500
|
* the persona + chosen shape onto the keystone `Supervisor`), plus `createShapeContext`, the
|
|
@@ -1492,6 +1511,8 @@ declare function renderCorpusToInstructions(opts: RenderCorpusToInstructionsOpti
|
|
|
1492
1511
|
* that supplies raw `seams` is therefore wrapped here into a registry whose resolved factories
|
|
1493
1512
|
* receive a ctx with the persona seams merged in — so a persona never has to pre-close its
|
|
1494
1513
|
* factories by hand. A persona may instead supply a fully-built `registry` and skip the wrap.
|
|
1514
|
+
*
|
|
1515
|
+
* @experimental
|
|
1495
1516
|
*/
|
|
1496
1517
|
|
|
1497
1518
|
/**
|
|
@@ -1510,7 +1531,6 @@ declare function definePersona<D = unknown>(input: DefinePersonaInput<D>): Perso
|
|
|
1510
1531
|
declare function runPersonified<Task, D>(options: RunPersonifiedOptions<Task, D>): Promise<SupervisedResult<Outcome<D>>>;
|
|
1511
1532
|
|
|
1512
1533
|
/**
|
|
1513
|
-
* @experimental
|
|
1514
1534
|
*
|
|
1515
1535
|
* The loop-shape registry — the OPEN, content-free extension point for the personify layer.
|
|
1516
1536
|
*
|
|
@@ -1524,6 +1544,8 @@ declare function runPersonified<Task, D>(options: RunPersonifiedOptions<Task, D>
|
|
|
1524
1544
|
* `verify`/`widen`) take spec arguments, so they are not bare zero-arg factories — a caller that
|
|
1525
1545
|
* wants name-resolution registers its own COMPOSED shape (a combinator already applied to its
|
|
1526
1546
|
* spec) on a registry instance. The registry carries SHAPE only; the domain lives on the persona.
|
|
1547
|
+
*
|
|
1548
|
+
* @experimental
|
|
1527
1549
|
*/
|
|
1528
1550
|
|
|
1529
1551
|
/**
|
|
@@ -1539,7 +1561,6 @@ declare const builtinShapes: ShapeRegistry;
|
|
|
1539
1561
|
declare function registerShape<Task, D>(name: string, factory: LoopShape<Task, D>): void;
|
|
1540
1562
|
|
|
1541
1563
|
/**
|
|
1542
|
-
* @experimental
|
|
1543
1564
|
*
|
|
1544
1565
|
* Trajectory trace + cost ledger — the post-hoc tree reconstructor (§4 of `wave-types`).
|
|
1545
1566
|
*
|
|
@@ -1560,6 +1581,8 @@ declare function registerShape<Task, D>(name: string, factory: LoopShape<Task, D
|
|
|
1560
1581
|
* CROSS-run analogue the pool cannot reach — proving equal compute before any win is claimed.
|
|
1561
1582
|
*
|
|
1562
1583
|
* Pure over the journal/blobs — no live agent calls; safe to run on a finished run's log.
|
|
1584
|
+
*
|
|
1585
|
+
* @experimental
|
|
1563
1586
|
*/
|
|
1564
1587
|
|
|
1565
1588
|
/**
|
|
@@ -1635,6 +1658,7 @@ interface PromotionVerdict {
|
|
|
1635
1658
|
high: number;
|
|
1636
1659
|
};
|
|
1637
1660
|
}
|
|
1661
|
+
/** Statistical promotion decision over a holdout benchmark: a seeded paired bootstrap (`heldoutSignificance`) whose CI lower bound must clear `deltaThreshold`. */
|
|
1638
1662
|
declare function promotionGate(opts: PromotionGateOptions): PromotionVerdict;
|
|
1639
1663
|
|
|
1640
1664
|
/**
|
|
@@ -1720,7 +1744,6 @@ interface ResolveSandboxClientOptions {
|
|
|
1720
1744
|
declare function resolveSandboxClient(opts: ResolveSandboxClientOptions): SandboxClient;
|
|
1721
1745
|
|
|
1722
1746
|
/**
|
|
1723
|
-
* @experimental
|
|
1724
1747
|
*
|
|
1725
1748
|
* `acquireSandbox` — cold-start-resilient sandbox acquisition. Eliminates the
|
|
1726
1749
|
* "create timed out at the proxy" failure mode conceptually by DECOUPLING "the
|
|
@@ -1744,6 +1767,8 @@ declare function resolveSandboxClient(opts: ResolveSandboxClientOptions): Sandbo
|
|
|
1744
1767
|
* but never reaches `running` (abort, terminal status, budget) is torn down
|
|
1745
1768
|
* before the failure propagates, so an abort storm during cold start does not
|
|
1746
1769
|
* leak live sandboxes.
|
|
1770
|
+
*
|
|
1771
|
+
* @experimental
|
|
1747
1772
|
*/
|
|
1748
1773
|
|
|
1749
1774
|
/** @experimental */
|
|
@@ -1765,11 +1790,14 @@ interface AcquireOptions {
|
|
|
1765
1790
|
/** Sleep override for deterministic tests. */
|
|
1766
1791
|
sleep?: (ms: number) => Promise<void>;
|
|
1767
1792
|
}
|
|
1768
|
-
/**
|
|
1793
|
+
/**
|
|
1794
|
+
* Cold-start-resilient sandbox acquisition: create by name, observe readiness from the sandbox's own status (not the create call), and re-attach after gateway timeouts.
|
|
1795
|
+
*
|
|
1796
|
+
* @experimental
|
|
1797
|
+
*/
|
|
1769
1798
|
declare function acquireSandbox(client: SandboxClient, options: CreateSandboxOptions, acquire?: AcquireOptions): Promise<SandboxInstance>;
|
|
1770
1799
|
|
|
1771
1800
|
/**
|
|
1772
|
-
* @experimental
|
|
1773
1801
|
*
|
|
1774
1802
|
* Capability probe for the loop kernel's backend-blind lineage seams. The
|
|
1775
1803
|
* kernel must NEVER ask "is this Docker or Firecracker?"; it asks "can this
|
|
@@ -1781,6 +1809,8 @@ declare function acquireSandbox(client: SandboxClient, options: CreateSandboxOpt
|
|
|
1781
1809
|
* Invariant: a client with no `criuStatus` method (the loop's test fakes, the
|
|
1782
1810
|
* raw SDK before it grew the probe) reports `canFork = false`. The seam is
|
|
1783
1811
|
* fail-CLOSED — never assume forking works, only enable it on a positive probe.
|
|
1812
|
+
*
|
|
1813
|
+
* @experimental
|
|
1784
1814
|
*/
|
|
1785
1815
|
|
|
1786
1816
|
/**
|
|
@@ -1892,7 +1922,6 @@ declare function mapSandboxEvent(event: SandboxEvent, opts?: {
|
|
|
1892
1922
|
}): RuntimeStreamEvent | undefined;
|
|
1893
1923
|
|
|
1894
1924
|
/**
|
|
1895
|
-
* @experimental
|
|
1896
1925
|
*
|
|
1897
1926
|
* `SandboxLineage` — the backend-blind owner of box + session handles for a
|
|
1898
1927
|
* single `runLoop` invocation. It exists so `run-loop.ts` never references a
|
|
@@ -1923,6 +1952,8 @@ declare function mapSandboxEvent(event: SandboxEvent, opts?: {
|
|
|
1923
1952
|
* in `run-loop.ts`; the lineage only hands back the live `streamPrompt` iterable
|
|
1924
1953
|
* so the kernel keeps ownership of event collection, cost accounting, and trace
|
|
1925
1954
|
* emission.
|
|
1955
|
+
*
|
|
1956
|
+
* @experimental
|
|
1926
1957
|
*/
|
|
1927
1958
|
|
|
1928
1959
|
/**
|
|
@@ -2074,12 +2105,13 @@ interface SessionCapableBox {
|
|
|
2074
2105
|
*/
|
|
2075
2106
|
|
|
2076
2107
|
/**
|
|
2077
|
-
* @experimental
|
|
2078
2108
|
* How a typed deliverable `Out` is materialized from a finished turn.
|
|
2079
2109
|
* - `events` — pure parse over the event array (identical to `OutputAdapter`).
|
|
2080
2110
|
* - `artifact` — read a file off the box AFTER the turn drains, then map it (+ the
|
|
2081
2111
|
* events). For diffs/codebases/documents that don't fit the chat
|
|
2082
2112
|
* stream. `path` relative ⇒ workspace root; absolute ⇒ container FS.
|
|
2113
|
+
*
|
|
2114
|
+
* @experimental
|
|
2083
2115
|
*/
|
|
2084
2116
|
type Deliverable<Out> = {
|
|
2085
2117
|
kind: 'events';
|
|
@@ -2090,10 +2122,11 @@ type Deliverable<Out> = {
|
|
|
2090
2122
|
fromArtifact: (raw: string, events: SandboxEvent[]) => Out;
|
|
2091
2123
|
};
|
|
2092
2124
|
/**
|
|
2093
|
-
* @experimental
|
|
2094
2125
|
* One finished turn over the artifact. A failed FS read is surfaced in `readError`
|
|
2095
2126
|
* (never masked as an empty deliverable) so a caller distinguishes "agent produced
|
|
2096
2127
|
* nothing" from a transport/FS fault.
|
|
2128
|
+
*
|
|
2129
|
+
* @experimental
|
|
2097
2130
|
*/
|
|
2098
2131
|
interface TurnResult<Out> {
|
|
2099
2132
|
out: Out;
|
|
@@ -2101,7 +2134,6 @@ interface TurnResult<Out> {
|
|
|
2101
2134
|
readError?: string;
|
|
2102
2135
|
}
|
|
2103
2136
|
/**
|
|
2104
|
-
* @experimental
|
|
2105
2137
|
* Thrown when a turn is aborted/timed-out mid-settle. Carries the events drained
|
|
2106
2138
|
* BEFORE the abort fired (and any in-progress `readError`) so an aborted run is
|
|
2107
2139
|
* DIAGNOSABLE — the caller can tell never-started (`events: []`) from looped
|
|
@@ -2109,6 +2141,8 @@ interface TurnResult<Out> {
|
|
|
2109
2141
|
*
|
|
2110
2142
|
* `name === 'AbortError'`, so existing `err.name === 'AbortError'` callers (the
|
|
2111
2143
|
* loop kernel, scope, supervise runtime) keep matching it unchanged.
|
|
2144
|
+
*
|
|
2145
|
+
* @experimental
|
|
2112
2146
|
*/
|
|
2113
2147
|
declare class SandboxRunAbortError extends Error {
|
|
2114
2148
|
readonly name = "AbortError";
|
|
@@ -2149,15 +2183,15 @@ interface OpenSandboxRunOptions {
|
|
|
2149
2183
|
readRetryDelayMs?: number;
|
|
2150
2184
|
}
|
|
2151
2185
|
/**
|
|
2152
|
-
* @experimental
|
|
2153
2186
|
* Open a sandbox run. Harness-agnostic: the harness lives in
|
|
2154
2187
|
* `options.agentRun.sandboxOverrides.backend.type`, so opencode/codex/claude-code/
|
|
2155
2188
|
* kimi-code all flow through this one entrypoint with identical env/auth wiring.
|
|
2189
|
+
*
|
|
2190
|
+
* @experimental
|
|
2156
2191
|
*/
|
|
2157
2192
|
declare function openSandboxRun<Out>(client: SandboxClient, options: OpenSandboxRunOptions, deliverable: Deliverable<Out>): Promise<SandboxRun<Out>>;
|
|
2158
2193
|
|
|
2159
2194
|
/**
|
|
2160
|
-
* @experimental
|
|
2161
2195
|
*
|
|
2162
2196
|
* Leak-free steering drivers — the non-LLM controls for the driven loop.
|
|
2163
2197
|
*
|
|
@@ -2198,6 +2232,8 @@ declare function openSandboxRun<Out>(client: SandboxClient, options: OpenSandbox
|
|
|
2198
2232
|
* They consume nothing the loop kernel does not already give `plan()`/`decide()`
|
|
2199
2233
|
* — `runLoop` requires no change. A benchmark picks a driver by name and the
|
|
2200
2234
|
* kernel does the rest.
|
|
2235
|
+
*
|
|
2236
|
+
* @experimental
|
|
2201
2237
|
*/
|
|
2202
2238
|
|
|
2203
2239
|
/**
|
|
@@ -2554,10 +2590,10 @@ declare function pickChampion(means: Record<string, {
|
|
|
2554
2590
|
}>, fieldOrder: string[], policy: ChampionPolicy, epsilon: number): ChampionPick;
|
|
2555
2591
|
/** Search-side champion selection over a tournament report. */
|
|
2556
2592
|
declare function selectChampion(report: BenchmarkReport, fieldOrder: string[], policy: ChampionPolicy, epsilon: number): ChampionPick;
|
|
2593
|
+
/** Multi-generation strategy search: author candidates from tournament losses, play them against the incumbent at equal budget, promote via `promotionGate` on an untouched holdout slice. */
|
|
2557
2594
|
declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<EvolutionReport>;
|
|
2558
2595
|
|
|
2559
2596
|
/**
|
|
2560
|
-
* @experimental
|
|
2561
2597
|
*
|
|
2562
2598
|
* The supervisor's intelligence is AUTHORING the agents it spawns — not pressing buttons.
|
|
2563
2599
|
*
|
|
@@ -2569,6 +2605,8 @@ declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<Evo
|
|
|
2569
2605
|
*
|
|
2570
2606
|
* The skill is the single OPTIMIZABLE surface: edit it → the supervisor designs better agents.
|
|
2571
2607
|
* That is the self-improvement lever (the prompt/skill lever), not the execution plumbing.
|
|
2608
|
+
*
|
|
2609
|
+
* @experimental
|
|
2572
2610
|
*/
|
|
2573
2611
|
|
|
2574
2612
|
/** What the supervisor AUTHORS per sub-task — a worker recipe (a partial `AgentProfile`). */
|
|
@@ -2602,6 +2640,7 @@ interface ProfileRichnessThresholds {
|
|
|
2602
2640
|
/** A prompt with fewer than this many non-blank lines is thin (default 6). */
|
|
2603
2641
|
readonly minSystemPromptLines: number;
|
|
2604
2642
|
}
|
|
2643
|
+
/** Default thresholds for `ProfileRichnessThresholds` — 600 chars / 6 lines minimum system prompt. */
|
|
2605
2644
|
declare const defaultProfileRichnessThresholds: ProfileRichnessThresholds;
|
|
2606
2645
|
/** Per-field verdict on one authored profile — the raw material the bench renders + scores. */
|
|
2607
2646
|
interface ProfileRichness {
|
|
@@ -2639,7 +2678,6 @@ declare function profileRichnessFinding(richness: ProfileRichness, opts?: {
|
|
|
2639
2678
|
}): AnalystFinding;
|
|
2640
2679
|
|
|
2641
2680
|
/**
|
|
2642
|
-
* @experimental
|
|
2643
2681
|
*
|
|
2644
2682
|
* The conserved budget reservation pool — the invariant the whole instrument
|
|
2645
2683
|
* rests on (critique M5/B3). One root `Budget` becomes a conserved pool of three
|
|
@@ -2657,6 +2695,8 @@ declare function profileRichnessFinding(richness: ProfileRichness, opts?: {
|
|
|
2657
2695
|
* Pure and deterministic: `now()` is injected, there is no I/O, and no wall-clock or
|
|
2658
2696
|
* RNG read. A `reserve`/`reconcile` ticket is single-use (fail-loud on double or
|
|
2659
2697
|
* unknown reconcile) so a child can never refund twice.
|
|
2698
|
+
*
|
|
2699
|
+
* @experimental
|
|
2660
2700
|
*/
|
|
2661
2701
|
|
|
2662
2702
|
/** Opaque, single-use reservation handle returned by `reserve` and consumed by
|
|
@@ -2735,7 +2775,6 @@ declare function spendFromUsageEvents(events: UsageEvent[]): Spend;
|
|
|
2735
2775
|
declare function createBudgetPool(root: Budget, now?: () => number): BudgetPool;
|
|
2736
2776
|
|
|
2737
2777
|
/**
|
|
2738
|
-
* @experimental
|
|
2739
2778
|
*
|
|
2740
2779
|
* `driverAgent` — the driver's BRAIN.
|
|
2741
2780
|
*
|
|
@@ -2759,6 +2798,8 @@ declare function createBudgetPool(root: Budget, now?: () => number): BudgetPool;
|
|
|
2759
2798
|
* sandboxed harness drives the verbs as MCP tools. The same seam every tool-loop uses.
|
|
2760
2799
|
* - `systemPrompt` — the driver's stance (the agent-eval worker-driver prompt / the prompt
|
|
2761
2800
|
* generator). Injected, never hardcoded — the prompt is a pluggable role.
|
|
2801
|
+
*
|
|
2802
|
+
* @experimental
|
|
2762
2803
|
*/
|
|
2763
2804
|
|
|
2764
2805
|
interface DriverAgentOptions {
|
|
@@ -2835,7 +2876,6 @@ declare function finalizeBestDelivered(settled: ReadonlyArray<{
|
|
|
2835
2876
|
}>, blobs: ResultBlobStore): Promise<unknown>;
|
|
2836
2877
|
|
|
2837
2878
|
/**
|
|
2838
|
-
* @experimental
|
|
2839
2879
|
*
|
|
2840
2880
|
* Serve the coordination verbs (spawn_agent / await_event / observe_agent / steer_agent / stop)
|
|
2841
2881
|
* as a real HTTP MCP server over a LIVE `Scope`. This is the keystone that lets a coding-harness
|
|
@@ -2852,6 +2892,8 @@ declare function finalizeBestDelivered(settled: ReadonlyArray<{
|
|
|
2852
2892
|
* Transport: JSON-RPC over HTTP POST (the MCP streamable-HTTP shape — `application/json` for a
|
|
2853
2893
|
* single response). The server is created INSIDE an agent's `act(task, scope)` so it fronts that
|
|
2854
2894
|
* agent's live scope; tear it down when the act returns.
|
|
2895
|
+
*
|
|
2896
|
+
* @experimental
|
|
2855
2897
|
*/
|
|
2856
2898
|
|
|
2857
2899
|
interface CoordinationMcpHandle {
|
|
@@ -2955,10 +2997,10 @@ interface SupervisorAgentDeps {
|
|
|
2955
2997
|
* instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
|
|
2956
2998
|
readonly compaction?: ToolLoopCompactionOptions;
|
|
2957
2999
|
}
|
|
3000
|
+
/** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness` (backend-as-data), the same resolution rule as every worker. */
|
|
2958
3001
|
declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
|
|
2959
3002
|
|
|
2960
3003
|
/**
|
|
2961
|
-
* @experimental
|
|
2962
3004
|
*
|
|
2963
3005
|
* `delegate` — the one generic delegation verb. You hand it an INTENT (what you want done) and it
|
|
2964
3006
|
* hands that intent to a default AUTHORING supervisor: a router-brained supervisor whose standing
|
|
@@ -2975,6 +3017,8 @@ declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAge
|
|
|
2975
3017
|
* caller on BOTH paths — a `winner` carries the delivered worker's spend, a `no-winner` carries the
|
|
2976
3018
|
* spend incurred before it failed. That cost channel means a `delegate()` caller always learns what
|
|
2977
3019
|
* the delegation actually spent.
|
|
3020
|
+
*
|
|
3021
|
+
* @experimental
|
|
2978
3022
|
*/
|
|
2979
3023
|
|
|
2980
3024
|
/** The conserved pool a `delegate()` call applies when the caller does not pass its own `budget`.
|
|
@@ -3020,7 +3064,6 @@ interface DelegateOptions<Out = unknown> {
|
|
|
3020
3064
|
declare function delegate<Out = unknown>(intent: string, opts?: DelegateOptions<Out>): Promise<SupervisedResult<Out>>;
|
|
3021
3065
|
|
|
3022
3066
|
/**
|
|
3023
|
-
* @experimental
|
|
3024
3067
|
*
|
|
3025
3068
|
* `TraceSource` — the ONE substrate-agnostic source of a worker's tool-call trace. The online
|
|
3026
3069
|
* detectors and the settle-time analyzers consume agent-eval `ToolSpan`s from here, regardless of
|
|
@@ -3036,6 +3079,8 @@ declare function delegate<Out = unknown>(intent: string, opts?: DelegateOptions<
|
|
|
3036
3079
|
*
|
|
3037
3080
|
* This module imports NO substrate SDK — it decodes generic message parts / OpenAI tool-call shapes.
|
|
3038
3081
|
* The sandbox wiring (`sandboxSessionTraceSource`) is the thin adapter that feeds box session parts in.
|
|
3082
|
+
*
|
|
3083
|
+
* @experimental
|
|
3039
3084
|
*/
|
|
3040
3085
|
|
|
3041
3086
|
interface ToolStepInput {
|
|
@@ -3095,13 +3140,14 @@ declare function sandboxSessionTraceSource(box: SessionTraceBox, sessionId: stri
|
|
|
3095
3140
|
}): TraceSource;
|
|
3096
3141
|
|
|
3097
3142
|
/**
|
|
3098
|
-
* @experimental
|
|
3099
3143
|
*
|
|
3100
3144
|
* The ONLINE analyst: watch a `TraceSource` and fold each tool span through agent-eval's published
|
|
3101
3145
|
* streaming detector kernel (`repeatedActionDetector`/`errorStreakDetector` — the SAME kernel the
|
|
3102
3146
|
* control loop folds), firing `onSignal` the moment a worker loops or error-storms. Substrate-
|
|
3103
3147
|
* agnostic: it consumes spans from any source (owned router/bridge loop OR a sandbox box session),
|
|
3104
3148
|
* never the raw tool seam. Detection logic + the failure taxonomy live in agent-eval; not reimplemented.
|
|
3149
|
+
*
|
|
3150
|
+
* @experimental
|
|
3105
3151
|
*/
|
|
3106
3152
|
|
|
3107
3153
|
interface WatchTraceOptions {
|
|
@@ -3124,7 +3170,6 @@ declare function defaultToolDetectors(): StreamingDetector[];
|
|
|
3124
3170
|
declare function watchTrace(source: TraceSource, opts?: WatchTraceOptions): () => void;
|
|
3125
3171
|
|
|
3126
3172
|
/**
|
|
3127
|
-
* @experimental
|
|
3128
3173
|
*
|
|
3129
3174
|
* The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as
|
|
3130
3175
|
* `Executor.deliver`. The driver's `steer_agent` / `answer_question` land here,
|
|
@@ -3138,6 +3183,8 @@ declare function watchTrace(source: TraceSource, opts?: WatchTraceOptions): () =
|
|
|
3138
3183
|
* of a wrong path mid-task instead of waiting for it to finish the step.
|
|
3139
3184
|
*
|
|
3140
3185
|
* `deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract.
|
|
3186
|
+
*
|
|
3187
|
+
* @experimental
|
|
3141
3188
|
*/
|
|
3142
3189
|
interface InboxMessage {
|
|
3143
3190
|
readonly kind: 'steer' | 'answer';
|
|
@@ -3159,6 +3206,7 @@ interface Inbox {
|
|
|
3159
3206
|
/** Render drained messages as ONE operator turn to fold into the worker's conversation. */
|
|
3160
3207
|
fold(messages: ReadonlyArray<InboxMessage>): string;
|
|
3161
3208
|
}
|
|
3209
|
+
/** Create the worker-side inbox for the down-leg: the driver's `steer_agent` / `answer_question` messages queue here and the worker's loop drains them at step boundaries and before settle. */
|
|
3162
3210
|
declare function createInbox(): Inbox;
|
|
3163
3211
|
|
|
3164
3212
|
/**
|
|
@@ -3169,7 +3217,6 @@ declare function createInbox(): Inbox;
|
|
|
3169
3217
|
declare function assertModelAllowed(model: string | undefined, allowed: readonly string[] | undefined): void;
|
|
3170
3218
|
|
|
3171
3219
|
/**
|
|
3172
|
-
* @experimental
|
|
3173
3220
|
*
|
|
3174
3221
|
* `createInMemoryRunContext` — the one-call bundle of the in-memory stores a
|
|
3175
3222
|
* `createSupervisor().run(root, task, opts)` needs: a fresh `InMemorySpawnJournal`
|
|
@@ -3191,6 +3238,8 @@ declare function assertModelAllowed(model: string | undefined, allowed: readonly
|
|
|
3191
3238
|
* The spread shape matches `SupervisorOpts` exactly, so the call site reads:
|
|
3192
3239
|
* const run = createInMemoryRunContext()
|
|
3193
3240
|
* await createSupervisor().run(root, task, { budget, runId, ...run })
|
|
3241
|
+
*
|
|
3242
|
+
* @experimental
|
|
3194
3243
|
*/
|
|
3195
3244
|
|
|
3196
3245
|
/** Options for the in-memory run context. */
|
|
@@ -3219,7 +3268,6 @@ interface InMemoryRunContext {
|
|
|
3219
3268
|
declare function createInMemoryRunContext(opts?: InMemoryRunContextOptions): InMemoryRunContext;
|
|
3220
3269
|
|
|
3221
3270
|
/**
|
|
3222
|
-
* @experimental
|
|
3223
3271
|
*
|
|
3224
3272
|
* The reactive `Scope` impl (KEYSTONE, build step 4 + the step-8 adapter).
|
|
3225
3273
|
*
|
|
@@ -3242,6 +3290,8 @@ declare function createInMemoryRunContext(opts?: InMemoryRunContextOptions): InM
|
|
|
3242
3290
|
* The settle path is the only writer of journal `settled` events; the spawn path the only
|
|
3243
3291
|
* writer of `spawned` events. The result blob is `put` BEFORE the journal `settled` record
|
|
3244
3292
|
* references its `outRef`, so a crash can never leave a journaled ref with no blob.
|
|
3293
|
+
*
|
|
3294
|
+
* @experimental
|
|
3245
3295
|
*/
|
|
3246
3296
|
|
|
3247
3297
|
/** Construction args for `createScope`. The supervisor threads the shared pool, journal,
|
|
@@ -3275,6 +3325,7 @@ interface ScopeArgs {
|
|
|
3275
3325
|
* (the topology viewer reads it). Undefined ⇒ the journal stays the only record. */
|
|
3276
3326
|
readonly hooks?: RuntimeHooks;
|
|
3277
3327
|
}
|
|
3328
|
+
/** 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. */
|
|
3278
3329
|
declare function createScope<Out>(args: ScopeArgs): Scope<Out>;
|
|
3279
3330
|
/**
|
|
3280
3331
|
* The step-8 merge-boundary adapter (M4): rehydrate a `Settled.done` into the kernel's
|
|
@@ -3351,10 +3402,10 @@ interface SuperviseOptions {
|
|
|
3351
3402
|
* or `supervise()` throws a `ConfigError` before any compute is spent. Unset = unrestricted. */
|
|
3352
3403
|
readonly allowedModels?: readonly string[];
|
|
3353
3404
|
}
|
|
3405
|
+
/** One-call supervisor: build + run a supervisor from its profile with sensible defaults; the raw `supervisorAgent` + `createSupervisor().run` seams stay available for power use. */
|
|
3354
3406
|
declare function supervise(profile: SupervisorProfile, task: unknown, opts: SuperviseOptions): Promise<SupervisedResult<unknown>>;
|
|
3355
3407
|
|
|
3356
3408
|
/**
|
|
3357
|
-
* @experimental
|
|
3358
3409
|
*
|
|
3359
3410
|
* The `Supervisor` impl (KEYSTONE, build step 5).
|
|
3360
3411
|
*
|
|
@@ -3386,18 +3437,21 @@ declare function supervise(profile: SupervisorProfile, task: unknown, opts: Supe
|
|
|
3386
3437
|
* winner `Out`. The supervisor content-addresses that `Out` for its replay `outRef`, reads
|
|
3387
3438
|
* `spentTotal` off the journal (`settled` child work + `metered` driver inference), and wraps
|
|
3388
3439
|
* it as a typed `winner` — it does not re-rank children behind the driver's back.
|
|
3440
|
+
*
|
|
3441
|
+
* @experimental
|
|
3389
3442
|
*/
|
|
3390
3443
|
|
|
3391
3444
|
declare function createSupervisor<Task, Out>(): Supervisor<Task, Out>;
|
|
3392
3445
|
|
|
3393
3446
|
/**
|
|
3394
|
-
* @experimental
|
|
3395
3447
|
*
|
|
3396
3448
|
* The SETTLE-time analyst: when a worker finishes, collect its tool spans from a `TraceSource` and run
|
|
3397
3449
|
* agent-eval's PUBLISHED batch analyzers over them — `buildTrajectory` (structured run summary),
|
|
3398
3450
|
* `stuckLoopView` (full-run repeated-call view, complementing the online consecutive detector), and
|
|
3399
3451
|
* `toolWasteView`. Substrate-agnostic: the spans come from any source (an owned loop's buffer OR a
|
|
3400
3452
|
* sandbox box session). No analysis reimplemented — this is the thin bridge into agent-eval's analyzers.
|
|
3453
|
+
*
|
|
3454
|
+
* @experimental
|
|
3401
3455
|
*/
|
|
3402
3456
|
|
|
3403
3457
|
interface TrajectoryAnalysis {
|
|
@@ -3513,6 +3567,7 @@ interface VerifierEnvironmentOptions {
|
|
|
3513
3567
|
/** Executes the extra tools. Required when `extraTools` is set. */
|
|
3514
3568
|
callExtra?(task: AgenticTask, name: string, args: Record<string, unknown>): Promise<string> | string;
|
|
3515
3569
|
}
|
|
3570
|
+
/** 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. */
|
|
3516
3571
|
declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
|
|
3517
3572
|
|
|
3518
3573
|
/** Command runner seam. Host code can use `localShell`; sandbox code can wrap `box.exec`. */
|
|
@@ -3534,6 +3589,7 @@ interface Workspace {
|
|
|
3534
3589
|
commit(dir: string, message: string): Promise<WorkspaceCommit>;
|
|
3535
3590
|
head(): Promise<string>;
|
|
3536
3591
|
}
|
|
3592
|
+
/** Host-process `Shell`: run a command via `execFile`, resolving `{ stdout, stderr, code }` (never throws on non-zero exit). */
|
|
3537
3593
|
declare function localShell(): Shell;
|
|
3538
3594
|
interface GitWorkspaceOptions {
|
|
3539
3595
|
readonly ref: string;
|
|
@@ -3541,6 +3597,7 @@ interface GitWorkspaceOptions {
|
|
|
3541
3597
|
readonly branch?: string;
|
|
3542
3598
|
readonly noHooks?: boolean;
|
|
3543
3599
|
}
|
|
3600
|
+
/** A `Workspace` over a git checkout: materialize an isolated worktree at `ref`, commit produced changes (conflict-aware), and read `head` — hooks disabled, identity pinned. */
|
|
3544
3601
|
declare function gitWorkspace(opts: GitWorkspaceOptions): Workspace;
|
|
3545
3602
|
/** A jj-backed `Workspace` (Jujutsu, colocated with git for the durable remote).
|
|
3546
3603
|
* Same port, same `Shell` — a drop-in for `gitWorkspace`. jj suits agent loops:
|