@tangle-network/agent-runtime 0.83.0 → 0.85.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-UJ3ONGHR.js";
5
+ } from "./chunk-QSYPMMWS.js";
6
6
  import "./chunk-SGKPNBXE.js";
7
- import "./chunk-QDVLTRCP.js";
8
- import "./chunk-SSA6OERV.js";
7
+ import "./chunk-DLAEEF26.js";
8
+ import "./chunk-XN5TIJGP.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
@@ -1,4 +1,4 @@
1
- import { ChatClient, RunRecord, AnalystFinding, AgentProfile, AnalystRunInputs, ToolSpan, StreamingDetector, DetectorSignal, buildTrajectory } from '@tangle-network/agent-eval';
1
+ import { ChatClient, RunRecord, HarnessType, AgentProfile, AnalystFinding, AnalystRunInputs, ToolSpan, StreamingDetector, DetectorSignal, buildTrajectory } from '@tangle-network/agent-eval';
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';
@@ -6,12 +6,12 @@ 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
+ import { RunProfileMatrixResult, Scenario, ProfileDispatchFn, JudgeConfig, RunProfileMatrixOptions, DispatchFn } from '@tangle-network/agent-eval/campaign';
11
12
  export { AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, ProviderAsSandboxClientOptions, ProviderExecutorOptions, SandboxClientProviderOptions, createAgentEnvironmentProviderRegistry, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider } from './environment-provider.js';
12
13
  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
14
  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
- 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
17
  import { R as RouterConfig, a as ToolLoopChat, b as ToolLoopCompactionOptions } from './router-client-r8y_VFVM.js';
@@ -494,6 +494,158 @@ declare function deterministicCompletion<Task, Output>(check: (output: Output, h
494
494
  reasons?: string;
495
495
  }): CompletionAnalyst<Task, Output>;
496
496
 
497
+ /** Structured per-case verdict a `score` function may return (a bare number is
498
+ * shorthand for `{ composite }`). `composite` is the [0,1] leaderboard score;
499
+ * `dimensions` are recorded as extra judge dimensions. */
500
+ interface LeaderboardScore {
501
+ composite: number;
502
+ dimensions?: Record<string, number>;
503
+ notes?: string;
504
+ }
505
+ /** The campaign scenario a case is wrapped into: the case rides along so
506
+ * judges and hooks can reach the full domain payload, not just its id. */
507
+ interface LeaderboardScenario<TCase> extends Scenario {
508
+ case: TCase;
509
+ }
510
+ /** One extra CLI flag a spec declares. Parsed by `run()` as `--<name> <value>`
511
+ * and surfaced to every hook via `ctx.args`. */
512
+ interface LeaderboardFlagSpec {
513
+ default?: string;
514
+ description: string;
515
+ }
516
+ /** Resolved run configuration handed to `setup` / `teardown` / `export`. */
517
+ interface LeaderboardRunContext {
518
+ name: string;
519
+ /** Execution backend name (`--backend`), a key of `backends`. */
520
+ backend: string;
521
+ runDir: string;
522
+ exportDir: string;
523
+ /** Every parsed flag (standard + `spec.flags`), by name without `--`. */
524
+ args: Record<string, string | undefined>;
525
+ harnesses: readonly HarnessType[];
526
+ /** Snapshot-stamped model ids (`name@snapshot`) — the eval identity models. */
527
+ models: readonly string[];
528
+ caseIds: readonly string[];
529
+ shots: number;
530
+ reps: number;
531
+ }
532
+ /** Structurally `BenchTask` (bench registry shape) — declared locally so this
533
+ * module adds no dependency on a benchmark package. */
534
+ interface LeaderboardBenchTask {
535
+ id: string;
536
+ prompt: string;
537
+ split?: string;
538
+ metadata?: Record<string, unknown>;
539
+ }
540
+ /** Structurally `BenchScore` (bench registry shape). */
541
+ interface LeaderboardBenchScore {
542
+ resolved: boolean;
543
+ score: number;
544
+ detail?: string;
545
+ }
546
+ /** Structurally `BenchmarkAdapter` (bench registry shape): `name`,
547
+ * `preflight()`, `loadTasks()`, deterministic `judge()`, `goldArtifact()`. */
548
+ interface LeaderboardBenchmarkAdapter {
549
+ readonly name: string;
550
+ preflight(): Promise<void>;
551
+ loadTasks(opts?: {
552
+ limit?: number;
553
+ split?: string;
554
+ ids?: string[];
555
+ }): Promise<LeaderboardBenchTask[]>;
556
+ judge(task: LeaderboardBenchTask, artifact: string): Promise<LeaderboardBenchScore>;
557
+ goldArtifact(task: LeaderboardBenchTask): Promise<string | undefined>;
558
+ }
559
+ interface LeaderboardSpec<TCase> {
560
+ /** Leaderboard name — the scenario `kind`, default profile name, and report title. */
561
+ name: string;
562
+ /** The case corpus. Every case needs a stable string id (see `caseId`). */
563
+ cases: TCase[];
564
+ /** Stable id extractor. Default: the case's own `id` property (fail-loud
565
+ * when absent or not a string). */
566
+ caseId?: (c: TCase) => string;
567
+ /** The per-case task prompt. May be async (e.g. built by shelling out to a
568
+ * reference implementation); resolved ONCE per case before dispatch. */
569
+ 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;
574
+ /** Harness × model axes for `expandProfileAxes`. Defaults: the canonical
575
+ * `CODING_HARNESSES` × the base profile's `model.default`. `--harnesses` /
576
+ * `--models` override per run. */
577
+ axis?: {
578
+ harnesses?: readonly HarnessType[];
579
+ models?: readonly string[];
580
+ };
581
+ /** Base profile the axes expand over (prompt/tools/skills held fixed).
582
+ * Default: a minimal `{ name, model: { default: <first model> } }`. */
583
+ baseProfile?: AgentProfile;
584
+ /**
585
+ * Execution-backend registry: `--backend <name>` picks the factory that
586
+ * yields the `SandboxClient` every cell runs on. Merged over the defaults:
587
+ * - `sandbox` — throws with guidance (a product must supply its real
588
+ * Sandbox-backed client; the facade has no credentials).
589
+ * - `cli-bridge` — `resolveSandboxClient({ backend: 'bridge' })` reading
590
+ * `CLI_BRIDGE_URL` + `BRIDGE_BEARER`/`CLI_BRIDGE_BEARER`; the per-cell
591
+ * harness/model ride in via `sandboxOverrides.backend`.
592
+ */
593
+ backends?: Record<string, (() => SandboxClient) | undefined>;
594
+ /** Extra `--flag value` CLI args `run()` parses and surfaces via `ctx.args`. */
595
+ flags?: Record<string, LeaderboardFlagSpec>;
596
+ /** Extra fields merged into each cell's `backend.model` create override —
597
+ * e.g. `{ provider: 'openai-compat', apiKey, baseUrl }` for a router-backed
598
+ * sandbox. The cell's bare model id is set by the facade from the axis. */
599
+ modelBackend?: Record<string, unknown>;
600
+ /** Runs once before the matrix (fetch fixtures, warm caches). */
601
+ setup?: (ctx: LeaderboardRunContext) => Promise<void> | void;
602
+ /** Runs once after the matrix, even on failure (reap boxes, close handles). */
603
+ 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;
612
+ /** Result export. Default: write `matrix-result.json` under the run dir and
613
+ * print (+ write) the ranked leaderboard markdown under the export dir. */
614
+ export?: (result: RunProfileMatrixResult<string, LeaderboardScenario<TCase>>, ctx: LeaderboardRunContext) => Promise<void> | void;
615
+ /** LEVEL 2 — full dispatch replacement (in-process products bring their own).
616
+ * The default is `loopDispatch` + `naiveDriver` over the resolved backend. */
617
+ dispatch?: ProfileDispatchFn<LeaderboardScenario<TCase>, string>;
618
+ /** LEVEL 2 — full judge replacement. Default: `score` wrapped as one judge. */
619
+ judges?: JudgeConfig<string, LeaderboardScenario<TCase>>[];
620
+ /** Naive-retry shot cap per cell (`--shots`). Default 1. */
621
+ shots?: number;
622
+ /** Replicates per cell (`--reps`). Default 1. */
623
+ reps?: number;
624
+ /** Passthrough overrides spread onto the final `runProfileMatrix` call
625
+ * (e.g. `maxConcurrency`, `costCeiling`, `integrity`, `storage`) — spread
626
+ * LAST, so anything the facade wired can be overridden. */
627
+ matrix?: Partial<RunProfileMatrixOptions<LeaderboardScenario<TCase>, string>>;
628
+ }
629
+ interface DefinedLeaderboard<TCase> {
630
+ /**
631
+ * Parse flags, run the matrix, export, and return the raw result.
632
+ *
633
+ * Standard flags: `--backend <name>` (default `sandbox`), `--harnesses a,b`,
634
+ * `--models m1,m2`, `--cases id1,id2`, `--shots N`, `--reps N`,
635
+ * `--model-snapshot <tag>`, `--run-dir <path>`, `--export-dir <path>`,
636
+ * plus every `spec.flags` entry. `argv` defaults to `process.argv.slice(2)`.
637
+ *
638
+ * The default run dir is FRESH per invocation (timestamp+pid under the OS
639
+ * tmpdir). `runProfileMatrix` caches cells by run dir, and a stable default
640
+ * would silently reuse a prior FAILED zero-token cell and skip dispatch —
641
+ * only an explicit `--run-dir` opts into that resume behavior.
642
+ */
643
+ run(argv?: string[]): Promise<RunProfileMatrixResult<string, LeaderboardScenario<TCase>>>;
644
+ /** The same domain surface in the structural `BenchmarkAdapter` shape. */
645
+ toBenchmarkAdapter(): LeaderboardBenchmarkAdapter;
646
+ }
647
+ declare function defineLeaderboard<TCase>(spec: LeaderboardSpec<TCase>): DefinedLeaderboard<TCase>;
648
+
497
649
  /**
498
650
  * The third-person observer — the connective tissue that closes the loop.
499
651
  *
@@ -2593,6 +2745,136 @@ declare function selectChampion(report: BenchmarkReport, fieldOrder: string[], p
2593
2745
  /** 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. */
2594
2746
  declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<EvolutionReport>;
2595
2747
 
2748
+ /**
2749
+ * `streamAgentTurn` — the ONE run-a-turn event-stream contract over every
2750
+ * execution substrate: a sandbox box (`SandboxInstance.streamPrompt`), a
2751
+ * one-shot `Executor` (cli-bridge / router / BYO, via `ExecutorFactory`), and
2752
+ * an in-process `AgentExecutionBackend` (the `resolveAgentBackend` output).
2753
+ *
2754
+ * One function, one vocabulary: every backend kind yields the existing
2755
+ * `RuntimeStreamEvent` union incrementally and ALWAYS terminates with a
2756
+ * `final` event whose `text` is the turn's final text and whose
2757
+ * `metadata.tokenUsage` / `metadata.costUsd` / `metadata.model` carry the
2758
+ * turn's metered usage. `collectAgentTurn` drains a stream into that terminal
2759
+ * summary plus the full event list.
2760
+ *
2761
+ * This is a UNIFICATION seam, not a new stream parser — each kind is a thin
2762
+ * adapter over code that already exists and is already hardened:
2763
+ * - `box` — `mapSandboxEvent` + `extractLlmCallEvent` (sandbox-events.ts)
2764
+ * project the sandbox event stream; nothing is re-mapped here.
2765
+ * - `executor` — `inlineSandboxClient` (the ONE executor→box adapter) turns
2766
+ * the factory into a box, then the box path drives it. The
2767
+ * executor's settle/teardown lifecycle stays in that adapter.
2768
+ * - `chat` — the backend's own `stream()` surface, normalized by
2769
+ * `normalizeBackendStreamEvent` (the same projection
2770
+ * `runAgentTaskStream` applies).
2771
+ *
2772
+ * Distinct from `openSandboxRun` (box-only, session resume over one persistent
2773
+ * artifact, raw `SandboxEvent` deliverables) and from `runAgentTaskStream`
2774
+ * (full task lifecycle: knowledge preflight, session store, resume). This is
2775
+ * the minimal turn primitive underneath both worlds: prompt in, one normalized
2776
+ * event stream out, terminal result+usage guaranteed on every non-thrown path.
2777
+ *
2778
+ * Stream envelope: `backend_start` → incremental events → (`backend_error` on
2779
+ * failure) → `final`. A caller-initiated abort terminates with
2780
+ * `final.status: 'aborted'`; an expired `timeoutMs` deadline with
2781
+ * `final.status: 'failed'` — so cancellation stays distinguishable from a
2782
+ * blown deadline.
2783
+ *
2784
+ * @experimental
2785
+ */
2786
+
2787
+ /**
2788
+ * The execution substrate one turn runs on — a closed discriminated union over
2789
+ * the three stream surfaces the runtime already owns.
2790
+ *
2791
+ * @experimental
2792
+ */
2793
+ type AgentTurnBackend = {
2794
+ /** A live sandbox box: the turn is one `box.streamPrompt(prompt)` call. */
2795
+ kind: 'box';
2796
+ box: SandboxInstance;
2797
+ /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
2798
+ agentRunName?: string;
2799
+ } | {
2800
+ /**
2801
+ * A one-shot `Executor` (cli-bridge / router / BYO): the factory is
2802
+ * instantiated fresh for the turn via `inlineSandboxClient`, run once on
2803
+ * the prompt, and torn down — the same per-spawn lifecycle the supervise
2804
+ * runtime gives it.
2805
+ */
2806
+ kind: 'executor';
2807
+ factory: ExecutorFactory<unknown>;
2808
+ /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
2809
+ agentRunName?: string;
2810
+ } | {
2811
+ /**
2812
+ * An in-process `AgentExecutionBackend` (`resolveAgentBackend` output or
2813
+ * any custom backend): the turn is one `backend.stream()` call.
2814
+ */
2815
+ kind: 'chat';
2816
+ backend: AgentExecutionBackend;
2817
+ };
2818
+ /** @experimental */
2819
+ interface StreamAgentTurnOptions {
2820
+ /** Caller-initiated cancellation. Terminates the stream with `final.status: 'aborted'`. */
2821
+ signal?: AbortSignal;
2822
+ /**
2823
+ * Wall-clock deadline for the whole turn in ms. An expired deadline aborts
2824
+ * the backend and terminates the stream with `final.status: 'failed'`
2825
+ * (a blown deadline is a turn failure, not a caller cancellation).
2826
+ */
2827
+ timeoutMs?: number;
2828
+ }
2829
+ /**
2830
+ * Metered usage of one turn, summed over every cost-bearing event the backend
2831
+ * emitted. `input`/`output` are token counts (0 when the backend reported
2832
+ * none — the honest sum, never a fabricated estimate). `costUsd`/`model` are
2833
+ * present only when the backend actually reported them.
2834
+ *
2835
+ * @experimental
2836
+ */
2837
+ interface AgentTurnUsage {
2838
+ input: number;
2839
+ output: number;
2840
+ costUsd?: number;
2841
+ model?: string;
2842
+ }
2843
+ /**
2844
+ * A drained turn: the terminal summary plus every event the stream yielded.
2845
+ * `status`/`error` mirror the terminal `final` event so a failed or aborted
2846
+ * turn stays inspectable without re-scanning `events`.
2847
+ *
2848
+ * @experimental
2849
+ */
2850
+ interface CollectedAgentTurn {
2851
+ finalText: string;
2852
+ usage: AgentTurnUsage;
2853
+ events: RuntimeStreamEvent[];
2854
+ status: AgentTaskStatus;
2855
+ error?: BackendErrorDetail;
2856
+ }
2857
+ /**
2858
+ * Run ONE agent turn on any backend kind and stream its events. Yields the
2859
+ * `RuntimeStreamEvent` vocabulary incrementally and always ends with a `final`
2860
+ * event carrying the turn's text and usage (`metadata.tokenUsage`,
2861
+ * `metadata.costUsd?`, `metadata.model?`) — on success, failure, abort, and
2862
+ * timeout alike. The generator never throws; failures surface in-band as
2863
+ * `backend_error` + `final` with a typed `error` detail.
2864
+ *
2865
+ * @experimental
2866
+ */
2867
+ declare function streamAgentTurn(backend: AgentTurnBackend, prompt: string, opts?: StreamAgentTurnOptions): AsyncGenerator<RuntimeStreamEvent>;
2868
+ /**
2869
+ * Drain a `streamAgentTurn` stream (or any `RuntimeStreamEvent` stream that
2870
+ * honors its terminal contract) into the turn summary plus the full event
2871
+ * list. Fail-loud: throws when the stream ends without a terminal `final`
2872
+ * event — a stream that violates the contract must not read as an empty turn.
2873
+ *
2874
+ * @experimental
2875
+ */
2876
+ declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
2877
+
2596
2878
  /**
2597
2879
  *
2598
2880
  * The supervisor's intelligence is AUTHORING the agents it spawns — not pressing buttons.
@@ -3626,4 +3908,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
3626
3908
  commitOnInvalid?: boolean;
3627
3909
  }): Promise<WorkspaceRun<T>>;
3628
3910
 
3629
- 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 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 LeaderboardOptions, type LeaderboardRow, 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, 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 };
3911
+ 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 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,
@@ -24,6 +25,7 @@ import {
24
25
  defaultAnalystInstruction,
25
26
  defaultAuditorInstruction,
26
27
  defaultToolDetectors,
28
+ defineLeaderboard,
27
29
  definePersona,
28
30
  defineStrategy,
29
31
  depthStrategy,
@@ -80,13 +82,14 @@ import {
80
82
  sentinelCompletion,
81
83
  stopSentinel,
82
84
  strategyAuthorContract,
85
+ streamAgentTurn,
83
86
  superviseSurface,
84
87
  trajectoryReport,
85
88
  verify,
86
89
  watchTrace,
87
90
  widen,
88
91
  worktreeFanout
89
- } from "./chunk-QDVLTRCP.js";
92
+ } from "./chunk-DLAEEF26.js";
90
93
  import {
91
94
  InMemoryResultBlobStore,
92
95
  InMemorySpawnJournal,
@@ -128,7 +131,7 @@ import {
128
131
  supervisorAgent,
129
132
  supervisorInstructions,
130
133
  workerFromBackend
131
- } from "./chunk-SSA6OERV.js";
134
+ } from "./chunk-XN5TIJGP.js";
132
135
  import "./chunk-UD4BHQMI.js";
133
136
  import {
134
137
  createAgentEnvironmentProviderRegistry,
@@ -168,6 +171,7 @@ export {
168
171
  buildSteerContext,
169
172
  builtinShapes,
170
173
  cliWorktreeExecutor,
174
+ collectAgentTurn,
171
175
  completionAuthorizes,
172
176
  computeFindingId,
173
177
  contentAddress,
@@ -195,6 +199,7 @@ export {
195
199
  defaultProfileRichnessThresholds,
196
200
  defaultSelectWinner,
197
201
  defaultToolDetectors,
202
+ defineLeaderboard,
198
203
  definePersona,
199
204
  defineStrategy,
200
205
  delegate,
@@ -271,6 +276,7 @@ export {
271
276
  spendFromUsageEvents,
272
277
  stopSentinel,
273
278
  strategyAuthorContract,
279
+ streamAgentTurn,
274
280
  sumSandboxUsage,
275
281
  supervise,
276
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-SSA6OERV.js";
12
+ } from "../chunk-XN5TIJGP.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-J3N6GODQ.js";
9
+ } from "../chunk-G7HQI6DB.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-QDVLTRCP.js";
17
+ } from "../chunk-DLAEEF26.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-SSA6OERV.js";
67
+ } from "../chunk-XN5TIJGP.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.83.0",
3
+ "version": "0.85.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": {
@@ -94,7 +94,7 @@
94
94
  },
95
95
  "devDependencies": {
96
96
  "@biomejs/biome": "^2.4.15",
97
- "@tangle-network/agent-eval": ">=0.100.0 <1.0.0",
97
+ "@tangle-network/agent-eval": "^0.103.1",
98
98
  "@tangle-network/agent-interface": ">=0.14.0 <1.0.0",
99
99
  "@tangle-network/sandbox": ">=0.8.0 <1.0.0",
100
100
  "@types/node": "^25.9.3",
@@ -123,7 +123,7 @@
123
123
  "license": "MIT",
124
124
  "packageManager": "pnpm@10.28.0",
125
125
  "peerDependencies": {
126
- "@tangle-network/agent-eval": ">=0.97.0 <1.0.0",
126
+ "@tangle-network/agent-eval": ">=0.101.0 <1.0.0",
127
127
  "@tangle-network/agent-interface": ">=0.14.0 <1.0.0",
128
128
  "@tangle-network/sandbox": ">=0.8.0 <1.0.0",
129
129
  "playwright": "^1.40.0"