@tangle-network/agent-runtime 0.84.0 → 0.86.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.
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  parseLoopRunnerArgv,
4
4
  runLoopRunnerCli
5
- } from "./chunk-XBSWWF6A.js";
5
+ } from "./chunk-EJ7MAQN4.js";
6
6
  import "./chunk-SGKPNBXE.js";
7
- import "./chunk-UJW6EVNY.js";
8
- import "./chunk-XN5TIJGP.js";
7
+ import "./chunk-3TZOXS7B.js";
8
+ import "./chunk-F7OO2SKB.js";
9
9
  import "./chunk-UD4BHQMI.js";
10
10
  import "./chunk-BZF3KQ6G.js";
11
11
  import "./chunk-YPA5MLVE.js";
package/dist/loops.d.ts CHANGED
@@ -6,7 +6,7 @@ import { d as ResultBlobStore, S as SpawnJournal, N as NodeId, j as SpawnEvent,
6
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
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
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';
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, i as AgentExecutionBackend, o as AgentTaskStatus, B as BackendErrorDetail } from './types-ESeMOj94.js';
10
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
  import { RunProfileMatrixResult, Scenario, ProfileDispatchFn, JudgeConfig, RunProfileMatrixOptions, DispatchFn } from '@tangle-network/agent-eval/campaign';
12
12
  export { AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, ProviderAsSandboxClientOptions, ProviderExecutorOptions, SandboxClientProviderOptions, createAgentEnvironmentProviderRegistry, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider } from './environment-provider.js';
@@ -544,8 +544,10 @@ interface LeaderboardBenchScore {
544
544
  detail?: string;
545
545
  }
546
546
  /** Structurally `BenchmarkAdapter` (bench registry shape): `name`,
547
- * `preflight()`, `loadTasks()`, deterministic `judge()`, `goldArtifact()`. */
548
- interface LeaderboardBenchmarkAdapter {
547
+ * `preflight()`, `loadTasks()`, deterministic `judge()`, `goldArtifact()`.
548
+ * Generic over the artifact channel; the `string` default IS the registry
549
+ * shape, so a default-artifact adapter registers unchanged. */
550
+ interface LeaderboardBenchmarkAdapter<TArtifact = string> {
549
551
  readonly name: string;
550
552
  preflight(): Promise<void>;
551
553
  loadTasks(opts?: {
@@ -553,10 +555,29 @@ interface LeaderboardBenchmarkAdapter {
553
555
  split?: string;
554
556
  ids?: string[];
555
557
  }): Promise<LeaderboardBenchTask[]>;
556
- judge(task: LeaderboardBenchTask, artifact: string): Promise<LeaderboardBenchScore>;
558
+ judge(task: LeaderboardBenchTask, artifact: TArtifact): Promise<LeaderboardBenchScore>;
557
559
  goldArtifact(task: LeaderboardBenchTask): Promise<string | undefined>;
558
560
  }
559
- interface LeaderboardSpec<TCase> {
561
+ /** Per-shot outcome context passed as `onCellEvents`'s third argument — how a
562
+ * thrown shot (which never reaches `parseOutput`) stays visible through the
563
+ * facade instead of surfacing only as an empty zero-token cell. */
564
+ interface LeaderboardIterationInfo {
565
+ /** 0-based shot index within the cell. */
566
+ index: number;
567
+ /** The shot's thrown error message, when the shot failed before scoring. */
568
+ error?: string;
569
+ /** The shot's validator verdict, when the shot reached scoring. */
570
+ verdict?: {
571
+ score?: number;
572
+ };
573
+ }
574
+ /**
575
+ * The declarative leaderboard spec. `TArtifact` is the artifact channel the
576
+ * dispatch produces and the judges score — `string` (the default) is the plain
577
+ * agent-response-text path; a structured artifact type flows natively once the
578
+ * spec supplies `parseOutput` (or a LEVEL-2 `dispatch`) producing it.
579
+ */
580
+ interface LeaderboardSpec<TCase, TArtifact = string> {
560
581
  /** Leaderboard name — the scenario `kind`, default profile name, and report title. */
561
582
  name: string;
562
583
  /** The case corpus. Every case needs a stable string id (see `caseId`). */
@@ -567,10 +588,10 @@ interface LeaderboardSpec<TCase> {
567
588
  /** The per-case task prompt. May be async (e.g. built by shelling out to a
568
589
  * reference implementation); resolved ONCE per case before dispatch. */
569
590
  prompt: (c: TCase) => string | Promise<string>;
570
- /** The domain grader: agent output text → score. Used BOTH as the per-shot
571
- * validator (a shot with `composite > 0` stops the naive retry loop) and,
572
- * wrapped as a campaign judge, as the recorded leaderboard score. */
573
- score: (output: string, c: TCase) => number | LeaderboardScore;
591
+ /** The domain grader: agent output artifact → score. Used BOTH as the
592
+ * per-shot validator (a shot with `composite > 0` stops the naive retry
593
+ * loop) and, wrapped as a campaign judge, as the recorded leaderboard score. */
594
+ score: (output: TArtifact, c: TCase) => number | LeaderboardScore;
574
595
  /** Harness × model axes for `expandProfileAxes`. Defaults: the canonical
575
596
  * `CODING_HARNESSES` × the base profile's `model.default`. `--harnesses` /
576
597
  * `--models` override per run. */
@@ -601,22 +622,36 @@ interface LeaderboardSpec<TCase> {
601
622
  setup?: (ctx: LeaderboardRunContext) => Promise<void> | void;
602
623
  /** Runs once after the matrix, even on failure (reap boxes, close handles). */
603
624
  teardown?: (ctx: LeaderboardRunContext) => Promise<void> | void;
604
- /** Per-cell event tap: the raw sandbox events of each parsed iteration,
605
- * with the case — the seam for domain metric capture (search counts,
606
- * citations) without a substrate change. */
607
- onCellEvents?: (events: readonly SandboxEvent[], c: TCase) => void;
608
- /** Output decode override: raw events the scored output text. Default:
609
- * the sandbox SDK's `collectAgentResponseText` (final answer text; empty
610
- * string when the stream carried none which then scores 0). */
611
- parseOutput?: (events: readonly SandboxEvent[], c: TCase) => string;
625
+ /** Per-cell event tap: the raw sandbox events of EVERY shot, with the case —
626
+ * the seam for domain metric capture (search counts, citations) without a
627
+ * substrate change. Fires once per shot after the cell's loop settles, in
628
+ * shot order, including thrown shots (whose events may be partial or empty);
629
+ * the third argument carries the shot's index + error/verdict outcome. */
630
+ onCellEvents?: (events: readonly SandboxEvent[], c: TCase, iteration?: LeaderboardIterationInfo) => void;
631
+ /** Output decode override: raw events the scored artifact. Default: the
632
+ * sandbox SDK's `collectAgentResponseText` (final answer text; empty string
633
+ * when the stream carried none — which then scores 0). The default only
634
+ * produces `string`, so a spec with a structured `TArtifact` MUST supply
635
+ * this (or a LEVEL-2 `dispatch`). */
636
+ parseOutput?: (events: readonly SandboxEvent[], c: TCase) => TArtifact;
637
+ /**
638
+ * Resolve the model the backend ACTUALLY served off a shot's raw events.
639
+ * Required for HARNESS_NATIVE_MODEL-snapped cells (a vendor-locked harness ×
640
+ * an out-of-family model expands to the `default` sentinel): the RunRecord
641
+ * must pin a real snapshot-bearing model id, which only the dispatch —
642
+ * reading the backend's usage/terminal events — can know. When this returns
643
+ * a value the default dispatch reports it via `ctx.cost.observeModel`;
644
+ * in-family cells (concrete declared model) never need it.
645
+ */
646
+ resolveModel?: (events: readonly SandboxEvent[]) => string | undefined;
612
647
  /** Result export. Default: write `matrix-result.json` under the run dir and
613
648
  * print (+ write) the ranked leaderboard markdown under the export dir. */
614
- export?: (result: RunProfileMatrixResult<string, LeaderboardScenario<TCase>>, ctx: LeaderboardRunContext) => Promise<void> | void;
649
+ export?: (result: RunProfileMatrixResult<TArtifact, LeaderboardScenario<TCase>>, ctx: LeaderboardRunContext) => Promise<void> | void;
615
650
  /** LEVEL 2 — full dispatch replacement (in-process products bring their own).
616
651
  * The default is `loopDispatch` + `naiveDriver` over the resolved backend. */
617
- dispatch?: ProfileDispatchFn<LeaderboardScenario<TCase>, string>;
652
+ dispatch?: ProfileDispatchFn<LeaderboardScenario<TCase>, TArtifact>;
618
653
  /** LEVEL 2 — full judge replacement. Default: `score` wrapped as one judge. */
619
- judges?: JudgeConfig<string, LeaderboardScenario<TCase>>[];
654
+ judges?: JudgeConfig<TArtifact, LeaderboardScenario<TCase>>[];
620
655
  /** Naive-retry shot cap per cell (`--shots`). Default 1. */
621
656
  shots?: number;
622
657
  /** Replicates per cell (`--reps`). Default 1. */
@@ -624,9 +659,9 @@ interface LeaderboardSpec<TCase> {
624
659
  /** Passthrough overrides spread onto the final `runProfileMatrix` call
625
660
  * (e.g. `maxConcurrency`, `costCeiling`, `integrity`, `storage`) — spread
626
661
  * LAST, so anything the facade wired can be overridden. */
627
- matrix?: Partial<RunProfileMatrixOptions<LeaderboardScenario<TCase>, string>>;
662
+ matrix?: Partial<RunProfileMatrixOptions<LeaderboardScenario<TCase>, TArtifact>>;
628
663
  }
629
- interface DefinedLeaderboard<TCase> {
664
+ interface DefinedLeaderboard<TCase, TArtifact = string> {
630
665
  /**
631
666
  * Parse flags, run the matrix, export, and return the raw result.
632
667
  *
@@ -640,11 +675,11 @@ interface DefinedLeaderboard<TCase> {
640
675
  * would silently reuse a prior FAILED zero-token cell and skip dispatch —
641
676
  * only an explicit `--run-dir` opts into that resume behavior.
642
677
  */
643
- run(argv?: string[]): Promise<RunProfileMatrixResult<string, LeaderboardScenario<TCase>>>;
678
+ run(argv?: string[]): Promise<RunProfileMatrixResult<TArtifact, LeaderboardScenario<TCase>>>;
644
679
  /** The same domain surface in the structural `BenchmarkAdapter` shape. */
645
- toBenchmarkAdapter(): LeaderboardBenchmarkAdapter;
680
+ toBenchmarkAdapter(): LeaderboardBenchmarkAdapter<TArtifact>;
646
681
  }
647
- declare function defineLeaderboard<TCase>(spec: LeaderboardSpec<TCase>): DefinedLeaderboard<TCase>;
682
+ declare function defineLeaderboard<TCase, TArtifact = string>(spec: LeaderboardSpec<TCase, TArtifact>): DefinedLeaderboard<TCase, TArtifact>;
648
683
 
649
684
  /**
650
685
  * The third-person observer — the connective tissue that closes the loop.
@@ -2745,6 +2780,136 @@ declare function selectChampion(report: BenchmarkReport, fieldOrder: string[], p
2745
2780
  /** 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. */
2746
2781
  declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<EvolutionReport>;
2747
2782
 
2783
+ /**
2784
+ * `streamAgentTurn` — the ONE run-a-turn event-stream contract over every
2785
+ * execution substrate: a sandbox box (`SandboxInstance.streamPrompt`), a
2786
+ * one-shot `Executor` (cli-bridge / router / BYO, via `ExecutorFactory`), and
2787
+ * an in-process `AgentExecutionBackend` (the `resolveAgentBackend` output).
2788
+ *
2789
+ * One function, one vocabulary: every backend kind yields the existing
2790
+ * `RuntimeStreamEvent` union incrementally and ALWAYS terminates with a
2791
+ * `final` event whose `text` is the turn's final text and whose
2792
+ * `metadata.tokenUsage` / `metadata.costUsd` / `metadata.model` carry the
2793
+ * turn's metered usage. `collectAgentTurn` drains a stream into that terminal
2794
+ * summary plus the full event list.
2795
+ *
2796
+ * This is a UNIFICATION seam, not a new stream parser — each kind is a thin
2797
+ * adapter over code that already exists and is already hardened:
2798
+ * - `box` — `mapSandboxEvent` + `extractLlmCallEvent` (sandbox-events.ts)
2799
+ * project the sandbox event stream; nothing is re-mapped here.
2800
+ * - `executor` — `inlineSandboxClient` (the ONE executor→box adapter) turns
2801
+ * the factory into a box, then the box path drives it. The
2802
+ * executor's settle/teardown lifecycle stays in that adapter.
2803
+ * - `chat` — the backend's own `stream()` surface, normalized by
2804
+ * `normalizeBackendStreamEvent` (the same projection
2805
+ * `runAgentTaskStream` applies).
2806
+ *
2807
+ * Distinct from `openSandboxRun` (box-only, session resume over one persistent
2808
+ * artifact, raw `SandboxEvent` deliverables) and from `runAgentTaskStream`
2809
+ * (full task lifecycle: knowledge preflight, session store, resume). This is
2810
+ * the minimal turn primitive underneath both worlds: prompt in, one normalized
2811
+ * event stream out, terminal result+usage guaranteed on every non-thrown path.
2812
+ *
2813
+ * Stream envelope: `backend_start` → incremental events → (`backend_error` on
2814
+ * failure) → `final`. A caller-initiated abort terminates with
2815
+ * `final.status: 'aborted'`; an expired `timeoutMs` deadline with
2816
+ * `final.status: 'failed'` — so cancellation stays distinguishable from a
2817
+ * blown deadline.
2818
+ *
2819
+ * @experimental
2820
+ */
2821
+
2822
+ /**
2823
+ * The execution substrate one turn runs on — a closed discriminated union over
2824
+ * the three stream surfaces the runtime already owns.
2825
+ *
2826
+ * @experimental
2827
+ */
2828
+ type AgentTurnBackend = {
2829
+ /** A live sandbox box: the turn is one `box.streamPrompt(prompt)` call. */
2830
+ kind: 'box';
2831
+ box: SandboxInstance;
2832
+ /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
2833
+ agentRunName?: string;
2834
+ } | {
2835
+ /**
2836
+ * A one-shot `Executor` (cli-bridge / router / BYO): the factory is
2837
+ * instantiated fresh for the turn via `inlineSandboxClient`, run once on
2838
+ * the prompt, and torn down — the same per-spawn lifecycle the supervise
2839
+ * runtime gives it.
2840
+ */
2841
+ kind: 'executor';
2842
+ factory: ExecutorFactory<unknown>;
2843
+ /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
2844
+ agentRunName?: string;
2845
+ } | {
2846
+ /**
2847
+ * An in-process `AgentExecutionBackend` (`resolveAgentBackend` output or
2848
+ * any custom backend): the turn is one `backend.stream()` call.
2849
+ */
2850
+ kind: 'chat';
2851
+ backend: AgentExecutionBackend;
2852
+ };
2853
+ /** @experimental */
2854
+ interface StreamAgentTurnOptions {
2855
+ /** Caller-initiated cancellation. Terminates the stream with `final.status: 'aborted'`. */
2856
+ signal?: AbortSignal;
2857
+ /**
2858
+ * Wall-clock deadline for the whole turn in ms. An expired deadline aborts
2859
+ * the backend and terminates the stream with `final.status: 'failed'`
2860
+ * (a blown deadline is a turn failure, not a caller cancellation).
2861
+ */
2862
+ timeoutMs?: number;
2863
+ }
2864
+ /**
2865
+ * Metered usage of one turn, summed over every cost-bearing event the backend
2866
+ * emitted. `input`/`output` are token counts (0 when the backend reported
2867
+ * none — the honest sum, never a fabricated estimate). `costUsd`/`model` are
2868
+ * present only when the backend actually reported them.
2869
+ *
2870
+ * @experimental
2871
+ */
2872
+ interface AgentTurnUsage {
2873
+ input: number;
2874
+ output: number;
2875
+ costUsd?: number;
2876
+ model?: string;
2877
+ }
2878
+ /**
2879
+ * A drained turn: the terminal summary plus every event the stream yielded.
2880
+ * `status`/`error` mirror the terminal `final` event so a failed or aborted
2881
+ * turn stays inspectable without re-scanning `events`.
2882
+ *
2883
+ * @experimental
2884
+ */
2885
+ interface CollectedAgentTurn {
2886
+ finalText: string;
2887
+ usage: AgentTurnUsage;
2888
+ events: RuntimeStreamEvent[];
2889
+ status: AgentTaskStatus;
2890
+ error?: BackendErrorDetail;
2891
+ }
2892
+ /**
2893
+ * Run ONE agent turn on any backend kind and stream its events. Yields the
2894
+ * `RuntimeStreamEvent` vocabulary incrementally and always ends with a `final`
2895
+ * event carrying the turn's text and usage (`metadata.tokenUsage`,
2896
+ * `metadata.costUsd?`, `metadata.model?`) — on success, failure, abort, and
2897
+ * timeout alike. The generator never throws; failures surface in-band as
2898
+ * `backend_error` + `final` with a typed `error` detail.
2899
+ *
2900
+ * @experimental
2901
+ */
2902
+ declare function streamAgentTurn(backend: AgentTurnBackend, prompt: string, opts?: StreamAgentTurnOptions): AsyncGenerator<RuntimeStreamEvent>;
2903
+ /**
2904
+ * Drain a `streamAgentTurn` stream (or any `RuntimeStreamEvent` stream that
2905
+ * honors its terminal contract) into the turn summary plus the full event
2906
+ * list. Fail-loud: throws when the stream ends without a terminal `final`
2907
+ * event — a stream that violates the contract must not read as an empty turn.
2908
+ *
2909
+ * @experimental
2910
+ */
2911
+ declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
2912
+
2748
2913
  /**
2749
2914
  *
2750
2915
  * The supervisor's intelligence is AUTHORING the agents it spawns — not pressing buttons.
@@ -3778,4 +3943,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
3778
3943
  commitOnInvalid?: boolean;
3779
3944
  }): Promise<WorkspaceRun<T>>;
3780
3945
 
3781
- export { Agent, AgentRunSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, CoordinationEvent, type CoordinationMcpHandle, Corpus, CorpusFilter, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, DeliverableSpec, type DriveHarness, Driver, type DriverAgentOptions, type DumbDriverOptions, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, Iteration, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LoopCampaignDispatchOptions, type LoopDispatchOptions, LoopLineageOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, LoopWinner, MakeWorkerAgent, type McpEndpoint, type McpEnvironmentOptions, MountRecorder, type NaiveDriverOptions, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, Outcome, OutputAdapter, type PairwiseOptions, type PairwiseVerdict, PanelSpec, Persona, PipelineStage, type ProfileRichness, type ProfileRichnessThresholds, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, type ResolveSandboxClientOptions, ResultBlobStore, RouterConfig, type RunAgenticOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, Spend, SteerContext, type SteeringDecision, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, type SuperviseOptions, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, SupervisedResult, Supervisor, type SupervisorAgentDeps, type SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, ToolLoopChat, ToolLoopCompactionOptions, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, type TurnResult, UsageEvent, type UsageSink, Validator, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, breadthStrategy, buildSteerContext, builtinShapes, completionAuthorizes, contentAddress, createBudgetPool, createInMemoryRunContext, createInbox, createMcpEnvironment, createPushTraceSource, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultProfileRichnessThresholds, defaultSelectWinner, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, finalizeBestDelivered, flatWidenGate, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, jjWorkspace, leaderboard, localShell, loopCampaignDispatch, loopDispatch, loopUntil, mapSandboxEvent, naiveDriver, observe, openSandboxRun, pairwiseSignificance, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, reportLoopUsage, resolveSandboxClient, runAgentic, runBenchmark, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, trajectoryReport, verify, watchTrace, widen, workerFromBackend };
3946
+ export { Agent, AgentRunSpec, type AgentTurnBackend, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CollectedAgentTurn, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, CoordinationEvent, type CoordinationMcpHandle, Corpus, CorpusFilter, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, DeliverableSpec, type DriveHarness, Driver, type DriverAgentOptions, type DumbDriverOptions, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, Iteration, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LoopCampaignDispatchOptions, type LoopDispatchOptions, LoopLineageOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, LoopWinner, MakeWorkerAgent, type McpEndpoint, type McpEnvironmentOptions, MountRecorder, type NaiveDriverOptions, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, Outcome, OutputAdapter, type PairwiseOptions, type PairwiseVerdict, PanelSpec, Persona, PipelineStage, type ProfileRichness, type ProfileRichnessThresholds, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, type ResolveSandboxClientOptions, ResultBlobStore, RouterConfig, type RunAgenticOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, Spend, SteerContext, type SteeringDecision, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, type StreamAgentTurnOptions, type SuperviseOptions, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, SupervisedResult, Supervisor, type SupervisorAgentDeps, type SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, ToolLoopChat, ToolLoopCompactionOptions, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, type TurnResult, UsageEvent, type UsageSink, Validator, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, breadthStrategy, buildSteerContext, builtinShapes, collectAgentTurn, completionAuthorizes, contentAddress, createBudgetPool, createInMemoryRunContext, createInbox, createMcpEnvironment, createPushTraceSource, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultProfileRichnessThresholds, defaultSelectWinner, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, finalizeBestDelivered, flatWidenGate, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, jjWorkspace, leaderboard, localShell, loopCampaignDispatch, loopDispatch, loopUntil, mapSandboxEvent, naiveDriver, observe, openSandboxRun, pairwiseSignificance, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, reportLoopUsage, resolveSandboxClient, runAgentic, runBenchmark, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, trajectoryReport, verify, watchTrace, widen, workerFromBackend };
package/dist/loops.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  breadthStrategy,
13
13
  buildSteerContext,
14
14
  builtinShapes,
15
+ collectAgentTurn,
15
16
  completionAuthorizes,
16
17
  computeFindingId,
17
18
  createMcpEnvironment,
@@ -81,13 +82,14 @@ import {
81
82
  sentinelCompletion,
82
83
  stopSentinel,
83
84
  strategyAuthorContract,
85
+ streamAgentTurn,
84
86
  superviseSurface,
85
87
  trajectoryReport,
86
88
  verify,
87
89
  watchTrace,
88
90
  widen,
89
91
  worktreeFanout
90
- } from "./chunk-UJW6EVNY.js";
92
+ } from "./chunk-3TZOXS7B.js";
91
93
  import {
92
94
  InMemoryResultBlobStore,
93
95
  InMemorySpawnJournal,
@@ -129,7 +131,7 @@ import {
129
131
  supervisorAgent,
130
132
  supervisorInstructions,
131
133
  workerFromBackend
132
- } from "./chunk-XN5TIJGP.js";
134
+ } from "./chunk-F7OO2SKB.js";
133
135
  import "./chunk-UD4BHQMI.js";
134
136
  import {
135
137
  createAgentEnvironmentProviderRegistry,
@@ -169,6 +171,7 @@ export {
169
171
  buildSteerContext,
170
172
  builtinShapes,
171
173
  cliWorktreeExecutor,
174
+ collectAgentTurn,
172
175
  completionAuthorizes,
173
176
  computeFindingId,
174
177
  contentAddress,
@@ -273,6 +276,7 @@ export {
273
276
  spendFromUsageEvents,
274
277
  stopSentinel,
275
278
  strategyAuthorContract,
279
+ streamAgentTurn,
276
280
  sumSandboxUsage,
277
281
  supervise,
278
282
  superviseSurface,
package/dist/mcp/bin.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  DelegationTaskQueue,
10
10
  FileDelegationStore,
11
11
  createMcpServer
12
- } from "../chunk-XN5TIJGP.js";
12
+ } from "../chunk-F7OO2SKB.js";
13
13
  import "../chunk-UD4BHQMI.js";
14
14
  import "../chunk-BZF3KQ6G.js";
15
15
  import "../chunk-4J6RBI3K.js";
package/dist/mcp/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  mcpToolsForRuntimeMcp,
8
8
  mcpToolsForRuntimeMcpSubset
9
- } from "../chunk-G7HQI6DB.js";
9
+ } from "../chunk-U4TS65XZ.js";
10
10
  import {
11
11
  createKbGate
12
12
  } from "../chunk-SGKPNBXE.js";
@@ -14,7 +14,7 @@ import {
14
14
  assertTraceDerivedFindings,
15
15
  runCoderChecks,
16
16
  selectValidWinner
17
- } from "../chunk-UJW6EVNY.js";
17
+ } from "../chunk-3TZOXS7B.js";
18
18
  import {
19
19
  DELEGATE_DESCRIPTION,
20
20
  DELEGATE_FEEDBACK_DESCRIPTION,
@@ -64,7 +64,7 @@ import {
64
64
  validateDelegateUiAuditArgs,
65
65
  validateDelegationHistoryArgs,
66
66
  validateDelegationStatusArgs
67
- } from "../chunk-XN5TIJGP.js";
67
+ } from "../chunk-F7OO2SKB.js";
68
68
  import "../chunk-UD4BHQMI.js";
69
69
  import {
70
70
  deleteBoxSafe,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.84.0",
3
+ "version": "0.86.0",
4
4
  "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {