@tangle-network/agent-runtime 0.66.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mcpToolsForRuntimeMcp,
3
3
  mcpToolsForRuntimeMcpSubset
4
- } from "./chunk-E4X4FNQZ.js";
4
+ } from "./chunk-OYU5LR4T.js";
5
5
  import {
6
6
  DEFAULT_ROUTER_BASE_URL,
7
7
  cleanModelId,
@@ -21,9 +21,9 @@ import {
21
21
  runLoopRunnerCli,
22
22
  selfImproveLoopRunner,
23
23
  worktreeLoopRunner
24
- } from "./chunk-YWO4H64E.js";
24
+ } from "./chunk-FCIPUALH.js";
25
25
  import "./chunk-FNMGYYSS.js";
26
- import "./chunk-RYD7ND4A.js";
26
+ import "./chunk-QNUEFNU7.js";
27
27
  import "./chunk-DVQGYDN5.js";
28
28
  import "./chunk-P5OKDSLB.js";
29
29
  import {
@@ -31,7 +31,7 @@ import {
31
31
  defineRuntimeHooks,
32
32
  notifyRuntimeDecisionPoint,
33
33
  notifyRuntimeHookEvent
34
- } from "./chunk-MT4XM3G6.js";
34
+ } from "./chunk-VKUHUFX7.js";
35
35
  import "./chunk-WIR4HOOJ.js";
36
36
  import {
37
37
  AgentEvalError,
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  parseLoopRunnerArgv,
4
4
  runLoopRunnerCli
5
- } from "./chunk-YWO4H64E.js";
5
+ } from "./chunk-FCIPUALH.js";
6
6
  import "./chunk-FNMGYYSS.js";
7
- import "./chunk-RYD7ND4A.js";
7
+ import "./chunk-QNUEFNU7.js";
8
8
  import "./chunk-DVQGYDN5.js";
9
9
  import "./chunk-P5OKDSLB.js";
10
- import "./chunk-MT4XM3G6.js";
10
+ import "./chunk-VKUHUFX7.js";
11
11
  import "./chunk-WIR4HOOJ.js";
12
12
  import "./chunk-VLF5RHEQ.js";
13
13
  import "./chunk-O2UPHN7X.js";
package/dist/loops.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
2
- export { AgenticOptions, AgenticRunResult, AgenticSurface, AgenticTask, AgenticTool, AnytimeReport, AnytimeStrategySummary, AnytimeTaskCurve, ArtifactHandle, AuditIntentInput, AuditIntentOptions, AuthorStrategyOptions, AuthoredProfile, AuthoredStrategy, BenchmarkCell, BenchmarkConfig, BenchmarkLift, BenchmarkReport, BenchmarkStrategySummary, BenchmarkTaskRow, BridgeSeam, BudgetPool, BudgetReadout, ChampionPick, ChampionPolicy, CheckpointCapableBox, CliSeam, CliWorktreeSeam, CompletionAnalyst, CompletionEvidence, CompletionPolicy, CompletionVerdict, CoordinationDriverOptions, CoordinationMcpHandle, CreateScopeAnalystOptions, CriuCapableClient, Deliverable, DriverChat, DriverMessage, DriverToolCall, DriverTurn, Environment, EvolutionArchiveNode, EvolutionAuthor, EvolutionBandInfo, EvolutionCandidate, EvolutionGeneration, EvolutionReport, ExecutorConfig, FileCorpus, FileResultBlobStore, FileSpawnJournal, ForkCapableBox, GitWorkspaceOptions, HarvestCorpusOptions, HarvestFailure, HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, Inbox, InboxMessage, IntentAudit, LoopDispatchOptions, LoopOptionsForDispatch, McpEndpoint, McpEnvironmentOptions, NestedScopeSeam, Observation, ObserveInput, ObserveOptions, OpenSandboxRunOptions, PromotionGateOptions, PromotionVerdict, RegistryAnalyzeProjection, ReservationTicket, RouterSeam, RouterToolsSeam, RunAgenticOptions, SandboxCapabilities, SandboxLineage, SandboxLineageHandle, SandboxRun, SandboxSeam, SessionCapableBox, SessionMessageLike, SessionTraceBox, Shell, ShotPersona, ShotSpec, Strategy, StrategyCtx, StrategyEvolutionConfig, StrategyResult, SurfaceScore, ToolPartDecoder, ToolStepInput, TraceSource, TrajectoryAnalysis, TurnResult, UsageSink, VerifierEnvironmentOptions, WatchTraceOptions, WaterfallCollector, WaterfallReport, WaterfallSpan, Workspace, WorkspaceCommit, WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createInbox, createMcpEnvironment, createPartsTraceSource, createPushTraceSource, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeAnthropicPart, decodeOpenAiPart, decodeOpencodePart, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, routerDriverChat, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, toToolSpan, toolPartDecoders, trajectoryReport, verify, watchTrace, widen, withDriverExecutor } from './runtime.js';
2
+ export { AgenticOptions, AgenticRunResult, AgenticSurface, AgenticTask, AgenticTool, AnytimeReport, AnytimeStrategySummary, AnytimeTaskCurve, ArtifactHandle, AuditIntentInput, AuditIntentOptions, AuthorStrategyOptions, AuthoredProfile, AuthoredStrategy, BenchmarkCell, BenchmarkConfig, BenchmarkLift, BenchmarkReport, BenchmarkStrategySummary, BenchmarkTaskRow, BridgeSeam, BudgetPool, BudgetReadout, ChampionPick, ChampionPolicy, CheckpointCapableBox, CliSeam, CliWorktreeSeam, CompletionAnalyst, CompletionEvidence, CompletionPolicy, CompletionVerdict, CoordinationDriverOptions, CoordinationMcpHandle, CreateScopeAnalystOptions, CriuCapableClient, Deliverable, DriverChat, DriverMessage, DriverToolCall, DriverTurn, Environment, EvolutionArchiveNode, EvolutionAuthor, EvolutionBandInfo, EvolutionCandidate, EvolutionGeneration, EvolutionReport, ExecutorConfig, FileCorpus, FileResultBlobStore, FileSpawnJournal, ForkCapableBox, GitWorkspaceOptions, HarvestCorpusOptions, HarvestFailure, HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemoryRunContext, InMemoryRunContextOptions, InMemorySpawnJournal, Inbox, InboxMessage, IntentAudit, LoopDispatchOptions, LoopOptionsForDispatch, McpEndpoint, McpEnvironmentOptions, NestedScopeSeam, Observation, ObserveInput, ObserveOptions, OpenSandboxRunOptions, PromotionGateOptions, PromotionVerdict, RegistryAnalyzeProjection, ReservationTicket, RouterSeam, RouterToolsSeam, RunAgenticOptions, SandboxCapabilities, SandboxLineage, SandboxLineageHandle, SandboxRun, SandboxSeam, SessionCapableBox, SessionMessageLike, SessionTraceBox, Shell, ShotPersona, ShotSpec, Strategy, StrategyCtx, StrategyEvolutionConfig, StrategyResult, SurfaceScore, ToolPartDecoder, ToolStepInput, TraceSource, TrajectoryAnalysis, TurnResult, UsageSink, VerifierEnvironmentOptions, WatchTraceOptions, WaterfallCollector, WaterfallReport, WaterfallSpan, Workspace, WorkspaceCommit, WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createInMemoryRunContext, createInbox, createMcpEnvironment, createPartsTraceSource, createPushTraceSource, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeAnthropicPart, decodeOpenAiPart, decodeOpencodePart, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, routerDriverChat, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, toToolSpan, toolPartDecoders, trajectoryReport, verify, watchTrace, widen, withDriverExecutor } from './runtime.js';
3
3
  export { d as AssertTraceDerivedFindings, A as AuthoredHarness, u as CoderCheckConstraints, v as CoderCheckInput, g as CombinatorShape, c as Corpus, l as CorpusFilter, C as CorpusRecord, w as DefinePersona, D as DefinePersonaInput, t as DeliverableSpec, E as EqualKArm, x as EqualKOnCost, q as EqualKOnCostOptions, r as EqualKVerdict, y as Fanout, F as FanoutOptions, z as FanoutSynthesis, j as FanoutWinnerSelector, B as FlatWidenGate, p as LoopShape, G as LoopUntil, L as LoopUntilSpec, H as LoopUntilState, O as Outcome, I as Panel, J as PanelJudge, P as PanelSpec, K as PanelVerdict, M as PatchDeliverableOptions, m as Persona, N as PersonaContext, Q as PersonaExecutors, U as Pipeline, i as PipelineStage, X as RenderCorpusToInstructions, R as RenderCorpusToInstructionsOptions, Y as RunPersonified, n as RunPersonifiedOptions, f as ScopeAnalyst, S as ScopeAnalyzeInput, h as ScopeWidenGate, Z as ShapeBudget, _ as ShapeContext, o as ShapeRegistry, e as SteerContext, $ as TrajectoryNode, s as TrajectoryReport, a0 as TrajectoryReportFn, T as TrajectoryReportOptions, a1 as Verify, V as VerifySpec, a2 as Widen, a3 as WidenDecision, a4 as WidenLineage, k as WidenSpec, W as WinnerStrategy, a5 as WorktreeCliExecutorOptions, a6 as WorktreeCommandResult, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a7 as countDiffLines, a8 as createWorktreeCliExecutor, a9 as gateOnDeliverable, aa as isNonEmptyPatch, ab as patchDelivered, ac as runCoderChecks, ad as touchedPathsFromPatch, ae as touchesSecretPath, af as worktreeFanout } from './worktree-fanout-DUiKPApb.js';
4
4
  export { a as RouterChatResult, b as RouterChatToolsResult, R as RouterConfig, c as RouterToolCall, d as RouterToolLoopResult, T as ToolSpec, r as routerChatWithTools, e as routerChatWithUsage, f as routerToolLoop } from './router-client-30Y_pca8.js';
5
5
  export { R as RunLoopOptions, c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } from './run-loop-D3PwlG7J.js';
package/dist/loops.js CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  createEventBus,
28
28
  createExecutor,
29
29
  createExecutorRegistry,
30
+ createInMemoryRunContext,
30
31
  createInbox,
31
32
  createMcpEnvironment,
32
33
  createPartsTraceSource,
@@ -122,7 +123,7 @@ import {
122
123
  widen,
123
124
  withDriverExecutor,
124
125
  worktreeFanout
125
- } from "./chunk-MT4XM3G6.js";
126
+ } from "./chunk-VKUHUFX7.js";
126
127
  import "./chunk-WIR4HOOJ.js";
127
128
  import {
128
129
  extractLlmCallEvent,
@@ -160,6 +161,7 @@ export {
160
161
  createEventBus,
161
162
  createExecutor,
162
163
  createExecutorRegistry,
164
+ createInMemoryRunContext,
163
165
  createInbox,
164
166
  createMcpEnvironment,
165
167
  createPartsTraceSource,
package/dist/mcp/bin.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createPropagatingTraceEmitter,
4
4
  detectExecutor,
5
5
  readTraceContextFromEnv
6
- } from "../chunk-RTNMMHWR.js";
6
+ } from "../chunk-LTEF2LYD.js";
7
7
  import {
8
8
  resolveRouterBaseUrl
9
9
  } from "../chunk-GRAGM4MC.js";
@@ -11,7 +11,7 @@ import {
11
11
  coderTaskFromArgs,
12
12
  detachedSessionDelegate,
13
13
  settleDetachedCoderTurn
14
- } from "../chunk-RYD7ND4A.js";
14
+ } from "../chunk-QNUEFNU7.js";
15
15
  import {
16
16
  coderTaskToPrompt
17
17
  } from "../chunk-DVQGYDN5.js";
@@ -29,7 +29,7 @@ import {
29
29
  parseDetachedSessionRef,
30
30
  runDetachedTurn,
31
31
  runLoop
32
- } from "../chunk-MT4XM3G6.js";
32
+ } from "../chunk-VKUHUFX7.js";
33
33
  import "../chunk-WIR4HOOJ.js";
34
34
  import "../chunk-VLF5RHEQ.js";
35
35
  import "../chunk-O2UPHN7X.js";
package/dist/mcp/index.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  detectExecutor,
5
5
  readTraceContextFromEnv,
6
6
  traceContextToEnv
7
- } from "../chunk-RTNMMHWR.js";
7
+ } from "../chunk-LTEF2LYD.js";
8
8
  import {
9
9
  mcpToolsForRuntimeMcp,
10
10
  mcpToolsForRuntimeMcpSubset
11
- } from "../chunk-E4X4FNQZ.js";
11
+ } from "../chunk-OYU5LR4T.js";
12
12
  import {
13
13
  createKbGate
14
14
  } from "../chunk-FNMGYYSS.js";
@@ -18,7 +18,7 @@ import {
18
18
  createSiblingSandboxExecutor,
19
19
  detachedSessionDelegate,
20
20
  settleDetachedCoderTurn
21
- } from "../chunk-RYD7ND4A.js";
21
+ } from "../chunk-QNUEFNU7.js";
22
22
  import "../chunk-DVQGYDN5.js";
23
23
  import {
24
24
  DELEGATION_MCP_SERVER_KEY,
@@ -82,7 +82,7 @@ import {
82
82
  validateDelegateUiAuditArgs,
83
83
  validateDelegationHistoryArgs,
84
84
  validateDelegationStatusArgs
85
- } from "../chunk-MT4XM3G6.js";
85
+ } from "../chunk-VKUHUFX7.js";
86
86
  import "../chunk-WIR4HOOJ.js";
87
87
  import "../chunk-VLF5RHEQ.js";
88
88
  import {
package/dist/runtime.d.ts CHANGED
@@ -2635,6 +2635,56 @@ declare function routerDriverChat(c: RouterConfig, opts?: {
2635
2635
  temperature?: number;
2636
2636
  }): DriverChat;
2637
2637
 
2638
+ /**
2639
+ * @experimental
2640
+ *
2641
+ * `createInMemoryRunContext` — the one-call bundle of the in-memory stores a
2642
+ * `createSupervisor().run(root, task, opts)` needs: a fresh `InMemorySpawnJournal`
2643
+ * (the event-sourced spawn log), a fresh `InMemoryResultBlobStore` (the
2644
+ * content-addressed `outRef` payload store the driver's `observe`/`finalize` reads
2645
+ * settled outputs through), and a fresh `createExecutorRegistry()` (the open
2646
+ * `AgentSpec → Executor` resolver).
2647
+ *
2648
+ * It exists to kill the boilerplate every offline/local supervised run repeats by
2649
+ * hand — three constructors threaded into `SupervisorOpts` — and to single-source the
2650
+ * ONE wiring invariant that is easy to get wrong: when the root is the recursive
2651
+ * `coordinationDriverAgent` LLM-driver brain AND it may spawn DRIVER children (agents
2652
+ * driving agents), the registry MUST be wrapped with `withDriverExecutor` so a
2653
+ * `role: 'driver'` child resolves to the nested-scope executor — and that SAME blob
2654
+ * store MUST be the one passed to `coordinationDriverAgent({ blobs })`, or the driver
2655
+ * reads from a different store than the scope writes to. Pass `{ withDriver: true }`
2656
+ * and reuse the returned `blobs` for both.
2657
+ *
2658
+ * The spread shape matches `SupervisorOpts` exactly, so the call site reads:
2659
+ * const run = createInMemoryRunContext()
2660
+ * await createSupervisor().run(root, task, { budget, runId, ...run })
2661
+ */
2662
+
2663
+ /** Options for the in-memory run context. */
2664
+ interface InMemoryRunContextOptions {
2665
+ /**
2666
+ * Wrap the executor registry with `withDriverExecutor` so a spawned child marked
2667
+ * `role: 'driver'` resolves to the recursive driver-executor (agents driving agents
2668
+ * over a nested `Scope` on the same conserved pool). Leave `false` for a flat tree of
2669
+ * leaf workers. Default `false`.
2670
+ */
2671
+ readonly withDriver?: boolean;
2672
+ }
2673
+ /**
2674
+ * The bundle of stores a supervised run needs, shaped to spread into `SupervisorOpts`.
2675
+ * The fields are exactly `SupervisorOpts`' `journal` / `blobs` / `executors`.
2676
+ */
2677
+ interface InMemoryRunContext {
2678
+ readonly journal: SpawnJournal;
2679
+ readonly blobs: ResultBlobStore;
2680
+ readonly executors: ExecutorRegistry;
2681
+ }
2682
+ /**
2683
+ * Build a fresh in-memory run context. Every call returns NEW stores (no shared global
2684
+ * state between runs), so two runs never cross-contaminate their journals/blobs.
2685
+ */
2686
+ declare function createInMemoryRunContext(opts?: InMemoryRunContextOptions): InMemoryRunContext;
2687
+
2638
2688
  /**
2639
2689
  * @experimental
2640
2690
  *
@@ -3055,4 +3105,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
3055
3105
  commitOnInvalid?: boolean;
3056
3106
  }): Promise<WorkspaceRun<T>>;
3057
3107
 
3058
- export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, 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, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CliWorktreeSeam, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, Corpus, CorpusFilter, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type Deliverable, DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, FileResultBlobStore, FileSpawnJournal, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, type Inbox, type InboxMessage, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, Outcome, PanelSpec, Persona, PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, type ToolPartDecoder, ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createInbox, createMcpEnvironment, createPartsTraceSource, createPushTraceSource, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeAnthropicPart, decodeOpenAiPart, decodeOpencodePart, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, routerDriverChat, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, toToolSpan, toolPartDecoders, trajectoryReport, verify, watchTrace, widen, withDriverExecutor };
3108
+ export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, 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, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CliWorktreeSeam, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, Corpus, CorpusFilter, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type Deliverable, DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, FileResultBlobStore, FileSpawnJournal, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type Inbox, type InboxMessage, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, Outcome, PanelSpec, Persona, PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, type ToolPartDecoder, ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createInMemoryRunContext, createInbox, createMcpEnvironment, createPartsTraceSource, createPushTraceSource, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeAnthropicPart, decodeOpenAiPart, decodeOpencodePart, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, routerDriverChat, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, toToolSpan, toolPartDecoders, trajectoryReport, verify, watchTrace, widen, withDriverExecutor };
package/dist/runtime.js CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  createEventBus,
28
28
  createExecutor,
29
29
  createExecutorRegistry,
30
+ createInMemoryRunContext,
30
31
  createInbox,
31
32
  createMcpEnvironment,
32
33
  createPartsTraceSource,
@@ -122,7 +123,7 @@ import {
122
123
  widen,
123
124
  withDriverExecutor,
124
125
  worktreeFanout
125
- } from "./chunk-MT4XM3G6.js";
126
+ } from "./chunk-VKUHUFX7.js";
126
127
  import "./chunk-WIR4HOOJ.js";
127
128
  import {
128
129
  extractLlmCallEvent,
@@ -160,6 +161,7 @@ export {
160
161
  createEventBus,
161
162
  createExecutor,
162
163
  createExecutorRegistry,
164
+ createInMemoryRunContext,
163
165
  createInbox,
164
166
  createMcpEnvironment,
165
167
  createPartsTraceSource,
package/dist/workflow.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createSandboxForSpec,
3
3
  describeSandboxPlacement,
4
4
  runLoop
5
- } from "./chunk-MT4XM3G6.js";
5
+ } from "./chunk-VKUHUFX7.js";
6
6
  import "./chunk-WIR4HOOJ.js";
7
7
  import {
8
8
  ValidationError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.66.0",
3
+ "version": "0.68.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": {
@@ -48,6 +48,18 @@ disagrees with source, the **source is right** — fix the map in the *same turn
48
48
  Read the cited `docs/canonical-api.md` row before writing; it carries the live
49
49
  signature + the exact "do NOT build".
50
50
 
51
+ **The §1.5 law, inline:** an agent IS its full authored `AgentProfile`
52
+ (prompt+skills+tools+mcp+subagents+hooks); you change behavior by AUTHORING the
53
+ profile and letting the substrate materialize it into harness shapes —
54
+ self-verification, iteration, and audit are profile levers (hooks/skills/
55
+ subagents), never glue code.
56
+
57
+ `AgentProfile` is now owned by `@tangle-network/agent-interface` (the `/runtime`
58
+ barrel still re-exports the sandbox alias for back-compat), which also owns
59
+ `HarnessType` + `ReasoningEffort` and a capability layer
60
+ (`harnessSupportsModel` / `reasoningEffortsFor`) — so harness/model/reasoning
61
+ compatibility is a queryable contract, not an assumption.
62
+
51
63
  | Altitude — I want to… | Use | Source |
52
64
  |---|---|---|
53
65
  | **Define a genome** (who the agent is + what it can do, ONE surface) | `AgentProfile` (runnable) / `AgentSurfaces` (the editable-coordinate map) — `/runtime`, `/agent` | canonical-api §3.2 |
@@ -61,6 +73,7 @@ signature + the exact "do NOT build".
61
73
  | **Add a stateful tool-using domain** | implement `AgenticSurface` (5 hooks) — `/loops` | canonical-api §3.3 |
62
74
  | **Benchmark: compare strategies + significance + Pareto on a domain** | `runBenchmark({ environment, tasks, worker, strategies })` — `/loops` | canonical-api §3.3 |
63
75
  | **Benchmark: add/run an external benchmark from the harness** | `ADAPTERS`/`resolveAdapter(key)` + a bench gate (`*-gate.mts`) over `openSandboxRun` + `sandboxAgentRun` (`bench/src/sandbox-run.ts`) | canonical-api §3.3 |
76
+ | **Spawn N coding agents on isolated git worktrees, keep the one whose patch passes checks** | `worktreeFanout` + `createWorktreeCliExecutor` + `gateOnDeliverable(DeliverableSpec)` over a raw `WorktreePatchArtifact`, winner via `selectValidWinner` — `/runtime` — NOT a hand-rolled spawn-loop / "coder" role | canonical-api §3.1 / §5 |
64
77
  | **Sandbox coding rollout** (fresh box/round, or persistent+resume) | `runLoop(options)` / `openSandboxRun(client, opts, deliverable)` — `/runtime` | canonical-api §3.1 |
65
78
  | **Optimize a CODE surface** in a gated loop | `improvementDriver({ worktree, generator })` — `/improvement` | canonical-api §3.4 |
66
79
  | **Optimize a PROMPT/config surface** (one call) | `selfImprove({ agent, scenarios, judge, baselineSurface })` — `agent-eval/contract` | canonical-api §3.4 |
@@ -87,6 +100,10 @@ holds the load-bearing invariant the parallel breaks:
87
100
  `AgentProfile` (it IS that bundle) + `definePersona` (the run record);
88
101
  `sandboxAgentRun({ profile })` is the box seam — never pass a router key into
89
102
  the box.
103
+ - "drive N coding agents in worktrees + pick the passing patch" / a "coder" role
104
+ **≈** `worktreeFanout` + `gateOnDeliverable` (each on its own worktree-CLI leaf,
105
+ settled ⟺ delivered, winner via `selectValidWinner` — a hand-rolled spawn-loop
106
+ skips the deliverable gate and the valid-only selection).
90
107
  - `new Sandbox()` + acquire + stream + `box.fs.read` + delete **≈**
91
108
  `openSandboxRun` (persistent + resume) or `runLoop` (fresh box/round).
92
109
  - `Promise.all` over N calls + manual argmax/merge **≈** `fanout` (bypassing the