@tangle-network/agent-runtime 0.117.0 → 0.119.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.
Files changed (80) hide show
  1. package/README.md +2 -0
  2. package/dist/{activation-BZ2FyX0O.js → activation-DdIpwQ0k.js} +3 -3
  3. package/dist/{activation-BZ2FyX0O.js.map → activation-DdIpwQ0k.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +3 -3
  6. package/dist/candidate-execution/index.d.ts +2 -2
  7. package/dist/candidate-execution/index.js +4 -4
  8. package/dist/{candidate-execution-PX61zXd2.js → candidate-execution-DDkSRPjY.js} +4 -4
  9. package/dist/{candidate-execution-PX61zXd2.js.map → candidate-execution-DDkSRPjY.js.map} +1 -1
  10. package/dist/{environment-provider-CTZjdIUg.d.ts → environment-provider-Bh4nX2qt.d.ts} +9 -1
  11. package/dist/{environment-provider-CzcEyRL7.js → environment-provider-Cr75N-rU.js} +2 -2
  12. package/dist/{environment-provider-CzcEyRL7.js.map → environment-provider-Cr75N-rU.js.map} +1 -1
  13. package/dist/environment-provider.d.ts +1 -1
  14. package/dist/environment-provider.js +1 -1
  15. package/dist/{improvement-cycle-Bcqz8rZI.js → improvement-cycle-zjR-MXwK.js} +7 -7
  16. package/dist/improvement-cycle-zjR-MXwK.js.map +1 -0
  17. package/dist/{index-X2YwyWkc.d.ts → index-B3bHsVLw.d.ts} +2 -2
  18. package/dist/{index-BHSYaWrC.d.ts → index-BLsKcxNd.d.ts} +3 -3
  19. package/dist/{index-DPWJxSRa.d.ts → index-CGADWaa_.d.ts} +20 -165
  20. package/dist/{index-BTUG4Xln.d.ts → index-I35151Fr.d.ts} +9 -9
  21. package/dist/index.d.ts +8 -8
  22. package/dist/index.js +12 -12
  23. package/dist/index.js.map +1 -1
  24. package/dist/intelligence.d.ts +4 -4
  25. package/dist/intelligence.js +6 -6
  26. package/dist/kernel.d.ts +4 -4
  27. package/dist/kernel.js +8 -7
  28. package/dist/{knowledge-CDlrayRc.js → knowledge-I1e9zQGj.js} +5 -5
  29. package/dist/{knowledge-CDlrayRc.js.map → knowledge-I1e9zQGj.js.map} +1 -1
  30. package/dist/knowledge.d.ts +1 -1
  31. package/dist/knowledge.js +1 -1
  32. package/dist/{local-harness-t6cDWDQ2.d.ts → local-harness-BIajef4A.d.ts} +29 -7
  33. package/dist/{loop-runner-bin-oyL7it5O.d.ts → loop-runner-bin-BeG9vTdE.d.ts} +3 -3
  34. package/dist/{loop-runner-bin-BxhhDtmG.js → loop-runner-bin-L996YVPS.js} +3 -3
  35. package/dist/{loop-runner-bin-BxhhDtmG.js.map → loop-runner-bin-L996YVPS.js.map} +1 -1
  36. package/dist/loop-runner-bin.d.ts +1 -1
  37. package/dist/loop-runner-bin.js +1 -1
  38. package/dist/mcp/bin.js +2 -2
  39. package/dist/mcp/bin.js.map +1 -1
  40. package/dist/mcp/index.d.ts +5 -5
  41. package/dist/mcp/index.js +8 -13
  42. package/dist/mcp/index.js.map +1 -1
  43. package/dist/{openai-tools-CO9X36zy.js → openai-tools-CvFEzw6f.js} +2 -2
  44. package/dist/{openai-tools-CO9X36zy.js.map → openai-tools-CvFEzw6f.js.map} +1 -1
  45. package/dist/{prepare-BbI6qGOW.js → prepare-DpV6np9e.js} +44 -34
  46. package/dist/{prepare-BbI6qGOW.js.map → prepare-DpV6np9e.js.map} +1 -1
  47. package/dist/primeintellect/index.d.ts +1 -1
  48. package/dist/{protected-model-port-B0yXMpLL.d.ts → protected-model-port-CoJOiINX.d.ts} +2 -2
  49. package/dist/{protected-model-port-COnyZfML.js → protected-model-port-vQLBRoAQ.js} +2 -2
  50. package/dist/{protected-model-port-COnyZfML.js.map → protected-model-port-vQLBRoAQ.js.map} +1 -1
  51. package/dist/{redact-BEtQtvd6.d.ts → redact-PQzmE1Jn.d.ts} +4 -4
  52. package/dist/run-layout-C2FGmZ3v.js +158 -0
  53. package/dist/run-layout-C2FGmZ3v.js.map +1 -0
  54. package/dist/{runtime-Ce39zfqn.js → runtime-D4e3GP5K.js} +7 -142
  55. package/dist/runtime-D4e3GP5K.js.map +1 -0
  56. package/dist/{spawn-journal-B_mu_oH2.js → spawn-journal-IeXpidO2.js} +2 -2
  57. package/dist/{spawn-journal-B_mu_oH2.js.map → spawn-journal-IeXpidO2.js.map} +1 -1
  58. package/dist/{structural-rollout-DLwW69R4.js → structural-rollout-DQHO3b2Y.js} +3 -3
  59. package/dist/{structural-rollout-DLwW69R4.js.map → structural-rollout-DQHO3b2Y.js.map} +1 -1
  60. package/dist/{supervise-U7_K5yuV.js → supervise-Cq50UT5-.js} +289 -1084
  61. package/dist/supervise-Cq50UT5-.js.map +1 -0
  62. package/dist/{supervisor-CAXiCKnX.js → supervisor-CpT9yAxL.js} +113 -35
  63. package/dist/supervisor-CpT9yAxL.js.map +1 -0
  64. package/dist/testing.js +10 -10
  65. package/dist/top-app-5unxqovu.js +1088 -0
  66. package/dist/top-app-5unxqovu.js.map +1 -0
  67. package/dist/tui/bin.d.ts +1 -0
  68. package/dist/tui/bin.js +19 -0
  69. package/dist/tui/bin.js.map +1 -0
  70. package/dist/tui/index.d.ts +209 -0
  71. package/dist/tui/index.js +2 -0
  72. package/dist/{util-Cc9g9Y-o.js → util-MVgdwuIS.js} +2 -2
  73. package/dist/{util-Cc9g9Y-o.js.map → util-MVgdwuIS.js.map} +1 -1
  74. package/dist/{workspace-archive-CqPIijFA.js → workspace-archive-B4SkNJjw.js} +2 -2
  75. package/dist/{workspace-archive-CqPIijFA.js.map → workspace-archive-B4SkNJjw.js.map} +1 -1
  76. package/package.json +8 -2
  77. package/dist/improvement-cycle-Bcqz8rZI.js.map +0 -1
  78. package/dist/runtime-Ce39zfqn.js.map +0 -1
  79. package/dist/supervise-U7_K5yuV.js.map +0 -1
  80. package/dist/supervisor-CAXiCKnX.js.map +0 -1
package/dist/kernel.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as SuperviseRegistry, $a as LoopDispatchOptions, $i as renderCorpusToInstructions, $n as authoredWorker, $o as Pipeline, $r as strategyAuthorContract, $s as LeaderboardOptions, $t as effectiveConcurrency, A as GitWorkspaceOptions, Aa as AgenticTask, Ac as AuthorizeDownMessage, Ai as extractLlmCallEvent, Al as InboxMessage, An as SupervisorFinalizer, Ao as observe, Ar as AgentTurnUsage, As as DefinedLeaderboard, At as writeWorkerSteer, B as analyzeTrace, Ba as StrategyMessage, Bc as DownMessageEvent, Bi as resolveSandboxClient, Bl as PiMcpMount, Bn as PriorCoordination, Bo as EqualKVerdict, Br as EvolutionCandidate, Bs as defineLeaderboard, Bt as createWorktreeCliExecutor, C as closingWorkerNote, Ca as BenchmarkTaskRow, Cc as renderAnytimeTable, Cf as pendingWaits, Ci as ForkCapableBox, Cl as createExecutorRegistry, Cn as createProgressTracker, Co as HarvestFailure, Cr as officialChecksFromMeta, Cs as PersonaContext, Ct as legacySupervisorRunDir, D as UntrackedCopyStats, Da as AgenticOptions, Dc as createWaterfallCollector, Di as createSandboxLineage, Dl as SteerableSandboxSession, Dn as DeliveredOutput, Do as ObserveInput, Dr as structuralRollout, Ds as ShapeBudget, Dt as supervisorRunsRoot, E as CopyOptions, Ea as runBenchmark, Ec as WaterfallSpan, Ei as SessionCapableBox, El as SteerableSandboxArgs, En as sampleFromSettled, Eo as Observation, Er as selectBestIndex, Es as RunPersonifiedOptions, Et as supervisorRunDir, F as gitWorkspace, Fa as ShotPersona, Fi as SandboxCapabilities, Fl as piExecutor, Fn as runTree, Fo as CorpusFilter, Fr as ChampionPick, Fs as LeaderboardIterationInfo, Ft as createInMemoryRunContext, G as workerTraceAnalysisStore, Ga as breadthStrategy, Gi as trajectoryReport, Gl as piMcpAdapterAvailable, Gn as ReservationTicket, Go as FlatWidenGate, Gr as discriminatingMeans, Gs as completionAuthorizes, Gt as createSupervisorSpanRecorder, H as WorkerToolTraceArtifact, Ha as StrategyShotResult, Hi as PromotionVerdict, Hl as PiMcpPreparation, Hn as BudgetPoolRestore, Ho as FanoutOptions, Hr as EvolutionReport, Hs as CompletionEvidence, Ht as SupervisorSpanOptions, I as jjWorkspace, Ia as ShotSpec, Ic as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Ii as probeSandboxCapabilities, Il as piSeamKey, In as CoordinationDeliveryEvidence, Io as CorpusRecord, Ir as ChampionPolicy, Is as LeaderboardRunContext, It as PatchDeliverableOptions, J as AuthorizedSpawn, Ja as refine, Ji as registerShape, Jl as WorktreeCommandResult, Jn as AuthoredProfile, Jo as LoopUntilState, Jr as selectChampion, Js as stopSentinel, Jt as ConcurrencyCaps, K as createRootHandle, Ka as defineStrategy, Ki as builtinShapes, Kl as preparePiMcp, Kn as createBudgetPool, Ko as LoopUntil, Kr as pickChampion, Ks as deterministicCompletion, Kt as assertModelAllowed, L as localShell, La as Strategy, Lc as DownMessageAuthorizationInput, Li as AcquireOptions, Ll as PI_MCP_ADAPTER, Ln as CoordinationLog, Lo as EqualKArm, Lr as EvolutionArchiveNode, Ls as LeaderboardScenario, Lt as patchDelivered, M as Workspace, Ma as ArtifactHandle, Mc as ContinuationInstruction, Mi as mapSandboxToolEvent, Ml as PI_RUNTIME, Mn as collectDelivered, Mo as AssertTraceDerivedFindings, Mr as StreamAgentTurnOptions, Ms as LeaderboardBenchTask, Mt as InMemoryRunContextOptions, N as WorkspaceCommit, Na as CorpusReadbackOptions, Nc as CoordinationEvent, Ni as sumSandboxUsage, Nl as PiExecutorOutput, Nn as pickBestDelivered, No as CombinatorShape, Nr as collectAgentTurn, Ns as LeaderboardBenchmarkAdapter, Nt as RunContext, O as copyUntrackedIntoClone, Oa as AgenticRunResult, Oc as AnalystFindingEvent, Oi as SandboxToolPartState, Ol as createSteerableSandboxSession, On as FinalizeContext, Oo as ObserveOptions, Or as visibleCheckScore, Os as ShapeContext, Ot as workerInboxFile, P as WorkspaceRun, Pa as RunAgenticOptions, Pi as CriuCapableClient, Pl as PiSeam, Pn as runFinalizer, Po as Corpus, Pr as streamAgentTurn, Ps as LeaderboardFlagSpec, Pt as createFileRunContext, Q as SuperviseOptions, Qa as LoopCampaignDispatchOptions, Qi as InMemoryCorpus, Qn as assessAuthoredProfile, Qo as PanelVerdict, Qr as authorStrategy, Qs as Leaderboard, Qt as RollingDispatchOptions, R as runInWorkspace, Ra as StrategyArtifacts, Rc as DownMessageDeliveryAttempt, Ri as acquireSandbox, Rl as PI_MCP_ADAPTER_ENV, Rn as CoordinationOwnerId, Ro as EqualKOnCost, Rr as EvolutionAuthor, Rs as LeaderboardScore, Rt as WorktreeCliExecutorOptions, S as WorkerEvidenceInput, Sa as BenchmarkStrategySummary, Sc as plateauLength, Sf as materializeTreeView, Si as CheckpointCapableBox, Sl as createExecutor, Sn as anyOf, So as HarvestCorpusOptions, Sr as modelAuthoredChecks, Ss as Persona, St as WorkerSteerRequest, T as settledWorkerOut, Ta as printBenchmarkReport, Tc as WaterfallReport, Tf as contentAddress, Ti as SandboxLineageHandle, Tl as SandboxSteeringOptions, Tn as plateau, To as harvestCorpus, Tr as sandboxCheckRunner, Ts as RunPersonified, Tt as safeWorkerFile, U as captureWorkerTraceEvidence, Ua as SurfaceScore, Ui as promotionGate, Ul as PiMcpReceipt, Un as BudgetReadout, Uo as FanoutSynthesis, Ur as ReproductionCheck, Us as CompletionPolicy, Ut as SupervisorSpanOutcome, V as WORKER_TOOL_TRACE_SCHEMA_VERSION, Va as StrategyResult, Vc as MakeWorkerAgent, Vi as PromotionGateOptions, Vl as PiMcpMountOptions, Vn as BudgetPool, Vo as Fanout, Vr as EvolutionGeneration, Vs as CompletionAnalyst, Vt as SupervisorSpanAttributes, W as parseWorkerToolTraceArtifact, Wa as adaptiveRefine, Wi as equalKOnCost, Wl as buildPiMcpServers, Wn as ReservationRejection, Wo as FanoutWinnerSelector, Wr as StrategyEvolutionConfig, Ws as CompletionVerdict, Wt as SupervisorSpanRecorder, X as DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, Xa as sample, Xc as WorkerSpawnContext, Xi as runPersonified, Xl as WorktreeProfileMaterializationReceipt, Xn as ProfileRichnessThresholds, Xo as PanelJudge, Xr as AuthoredStrategy, Xs as GroupOf, Xt as DispatchStopReason, Y as AuthorizedSpawnContext, Ya as runAgentic, Yi as definePersona, Yl as WorktreeHarnessResult, Yn as ProfileRichness, Yo as Panel, Yr as AuthorStrategyOptions, Ys as AxisScoresOf, Yt as DispatchReport, Z as DeliverableResolutionInput, Za as sampleThenRefine, Zi as FileCorpus, Zn as asAuthoredProfile, Zo as PanelSpec, Zr as assertStrategyContract, Zs as Interval, Zt as DispatchUnit, _ as WorktreeFanoutOptions, _a as sanitizeMcpToolSchema, _c as AnytimeStrategySummary, _f as SpawnForestInDoubtNode, _i as OpenSandboxRunPromptOptions, _l as ProviderSeam, _n as ProgressView, _o as inlineSandboxClient, _r as compareCheckOutcomes, _s as WinnerStrategy, _t as resolveSupervisorProfile, a as SandboxInstance, aa as selectValidWinner, ac as leaderboard, af as createEventBus, ai as naiveDriver, an as delegate, ao as defaultSelectWinner, ar as CheckOutcome, as as ScopeWidenGate, at as DriveHarnessOwnerContext, b as NOTE_MAX_CHARS, ba as BenchmarkLift, bc as areaUnderCurve, bf as SpawnForestTree, bi as TurnResult, bl as SandboxSeam, bn as allOf, bo as InProcessSandboxClientOptions, br as defaultStructuralRolloutPolicy, bs as LoopShape, bt as createScope, c as VerifierEnvironmentOptions, ca as CreateScopeAnalystOptions, cc as renderLeaderboardMarkdown, cf as watchTrace, ci as McpSpawnFault, cn as DriverAgentOptions, co as LocalSandboxClientOptions, cr as CheckSource, cs as TrajectoryReport, ct as ResolveSupervisorTools, d as SuperviseSurfaceResult, da as buildSteerContext, dc as AuditIntentInput, df as FileResultBlobStore, di as StdioMcpServerSpec, dn as AllWorkersStalledOptions, do as ResolvedMcpServerLaunch, dr as StructuralRolloutConfig, ds as Verify, dt as SupervisorNodeContext, ea as fanout, ec as LeaderboardRow, ef as BusEvent, ei as ApplyContinuation, en as freeSlots, eo as LoopOptionsForDispatch, er as canonicalizeAuthoredProfile, es as PipelineStage, et as SuperviseRegistryTable, f as SurfaceWorkerConfig, fa as createScopeAnalyst, fc as AuditIntentOptions, ff as FileSpawnJournal, fi as connectStdioMcp, fl as BridgeSeam, fn as NoProgressForOptions, fo as envKeyProvider, fr as StructuralRolloutMessage, fs as VerifySpec, ft as SupervisorNodeContextSeed, g as AuthoredHarness, ga as createMcpEnvironment, gc as AnytimeReport, gf as SpawnForestEvent, gi as OpenSandboxRunOptions, gl as ExecutorConfig, gn as ProgressTrackerOptions, go as secretEnvOfMcpServer, gr as canDisplace, gs as WidenSpec, gt as assertCoordinationBinding, h as superviseSurface, ha as McpEnvironmentOptions, hc as defaultAuditorInstruction, hf as SpawnForest, hi as OpenSandboxRunBeforeStartContext, hl as CliWorktreeSeam, hn as ProgressTracker, ho as resolveSecretEnv, hr as VisibleCheck, hs as WidenLineage, ht as SupervisorToolInvocationContext, i as SandboxEvent, ia as pipeline, ic as ScoreOf, if as PublishOptions, ii as dumbDriver, in as defaultDelegateBudget, io as RunLoopOptions, ir as CheckExecChannel, is as ScopeAnalyzeInput, it as DriveHarness, j as Shell, ja as AgenticTool, jc as AuthorizedDownMessage, ji as mapSandboxEvent, jl as createInbox, jn as bestDelivered, jo as renderReport, jr as CollectedAgentTurn, js as LeaderboardBenchScore, jt as InMemoryRunContext, k as withUntrackedArtifacts, ka as AgenticSurface, kc as AnalystRegistry, ki as createSandboxToolPartState, kl as Inbox, kn as FinalizerSettled, ko as defaultAnalystInstruction, kr as AgentTurnBackend, ks as ShapeRegistry, kt as workerInboxFileFromEventDir, l as createVerifierEnvironment, la as RegistryAnalyzeProjection, lc as renderLeaderboardSvg, lf as DeliverableSpec, li as McpToolDescriptor, ln as driverAgent, lo as localSandboxClient, lr as CheckSourceCtx, ls as TrajectoryReportFn, lt as ResolvedSupervisorProfile, m as failuresAnalyst, ma as McpEndpoint, mc as auditIntent, mf as InMemorySpawnJournal, mi as Deliverable, ml as CliWorktreeBridgeSeam, mn as ProgressSample, mo as resolveMcpServerLaunch, mr as StructuralRolloutResult, ms as WidenDecision, mt as SupervisorToolDescriptor, n as AnalystFinding, na as loopUntil, nc as PairwiseVerdict, nf as BusStats, ni as NaiveDriverOptions, nn as rollingDispatch, no as loopDispatch, nr as profileRichnessFinding, ns as RenderCorpusToInstructionsOptions, nt as workerFromBackend, o as computeFindingId, oa as verify, oc as pairwiseSignificance, of as WatchTraceOptions, oi as LocalMcpMaterialization, on as CoordinationMcpHandle, oo as runAgentRounds, or as CheckRunContext, os as SteerContext, ot as ObserveSupervisorNodeEvent, p as SurfaceWorkerOut, pa as registryScopeAnalyst, pc as IntentAudit, pf as InMemoryResultBlobStore, pi as materializeLocalMcp, pl as CliSeam, pn as PlateauOptions, po as mcpSecretEnvMetadataKey, pr as StructuralRolloutPolicy, ps as Widen, pt as SupervisorProfile, q as createSupervisor, qa as depthStrategy, qi as createShapeRegistry, ql as WorktreeCheckRunner, qn as spendFromUsageEvents, qo as LoopUntilSpec, qr as runStrategyEvolution, qs as sentinelCompletion, qt as assertProfileModelsAllowed, r as CreateSandboxOptions, ra as panel, rc as ProfileKeyOf, rf as EventBus, ri as SteeringDecision, rn as DelegateOptions, ro as RunAgentRoundsOptions, rr as supervisorInstructions, rs as ScopeAnalyst, rt as CoordinationBinding, s as makeFinding, sa as widen, sc as renderLeaderboardHtml, sf as defaultToolDetectors, si as MaterializeLocalMcpOptions, sn as serveCoordinationMcp, so as runLoop, sr as CheckRunner, ss as TrajectoryNode, st as ResolveDriveHarness, t as AgentProfile, ta as flatWidenGate, tc as PairwiseOptions, tf as BusRecord, ti as DumbDriverOptions, tn as queueOf, to as loopCampaignDispatch, tr as defaultProfileRichnessThresholds, ts as RenderCorpusToInstructions, tt as supervise, u as SuperviseSurfaceOptions, ua as assertTraceDerivedFindings, uc as renderPairwiseMarkdown, uf as gateOnDeliverable, ui as StdioMcpConnection, un as finalizeBestDelivered, uo as KeyProvider, ur as RepairStop, us as TrajectoryReportOptions, ut as SupervisorAgentDeps, v as worktreeFanout, va as BenchmarkCell, vc as AnytimeTaskCurve, vf as SpawnForestMissingTree, vi as SandboxRun, vl as RouterSeam, vn as StopDecision, vo as InProcessOnPrompt, vr as composeCheckSources, vs as DefinePersona, vt as supervisorAgent, w as composeWorkerEvidence, wa as Environment, wc as WaterfallCollector, wf as replaySpawnTree, wi as SandboxLineage, wl as DEFAULT_SANDBOX_STEERING_MAX_TURNS, wn as noProgressFor, wo as HarvestReport, wr as resolveEntrySymbol, ws as PersonaExecutors, wt as readWorkerSteerRequests, x as VERIFY_TAIL_CHARS, xa as BenchmarkReport, xc as bestSoFar, xf as loadSpawnForest, xi as openSandboxRun, xl as cliWorktreeExecutor, xn as allWorkersStalled, xo as inProcessSandboxClient, xr as filterAuthoredAsserts, xs as Outcome, xt as settledToIteration, y as EVIDENCE_MAX_CHARS, ya as BenchmarkConfig, yc as anytimeReport, yf as SpawnForestNode, yi as SandboxRunAbortError, yl as RouterToolsSeam, yn as StopRule, yo as InProcessPromptCtx, yr as defaultExtractCandidate, ys as DefinePersonaInput, yt as ScopeArgs, z as TrajectoryAnalysis, za as StrategyCtx, zc as DownMessageDeliveryOutcome, zi as ResolveSandboxClientOptions, zl as PI_MCP_CONFIG_FLAG, zn as FileCoordinationLog, zo as EqualKOnCostOptions, zr as EvolutionBandInfo, zs as LeaderboardSpec, zt as WorktreePatchArtifact } from "./index-DPWJxSRa.js";
1
+ import { $ as SuperviseRegistry, $a as sample, $c as WorkerSpawnContext, $d as FileResultBlobStore, $i as runPersonified, $n as ProfileRichnessThresholds, $o as PanelJudge, $r as AuthoredStrategy, $s as GroupOf, $t as DispatchStopReason, A as GitWorkspaceOptions, Aa as AgenticOptions, Ac as createWaterfallCollector, Ai as createSandboxLineage, Al as SteerableSandboxSession, An as DeliveredOutput, Ao as ObserveInput, Ar as structuralRollout, As as ShapeBudget, At as workerControlLogFile, B as analyzeTrace, Ba as Strategy, Bc as DownMessageAuthorizationInput, Bi as AcquireOptions, Bn as CoordinationLog, Bo as EqualKArm, Br as EvolutionArchiveNode, Bs as LeaderboardScenario, Bt as patchDelivered, C as closingWorkerNote, Ca as BenchmarkLift, Cc as areaUnderCurve, Ci as TurnResult, Cl as SandboxSeam, Cn as allOf, Co as InProcessSandboxClientOptions, Cr as defaultStructuralRolloutPolicy, Cs as LoopShape, Ct as legacySupervisorRunDir, D as UntrackedCopyStats, Da as Environment, Dc as WaterfallCollector, Di as SandboxLineage, Dl as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Dn as noProgressFor, Do as HarvestReport, Dr as resolveEntrySymbol, Ds as PersonaExecutors, Dt as supervisorRunDir, E as CopyOptions, Ea as BenchmarkTaskRow, Ec as renderAnytimeTable, Ei as ForkCapableBox, El as createExecutorRegistry, En as createProgressTracker, Eo as HarvestFailure, Er as officialChecksFromMeta, Es as PersonaContext, Et as safeWorkerFile, F as gitWorkspace, Fa as ArtifactHandle, Fc as ContinuationInstruction, Fi as mapSandboxToolEvent, Fl as WorktreeCheckRunner, Fn as collectDelivered, Fo as AssertTraceDerivedFindings, Fr as StreamAgentTurnOptions, Fs as LeaderboardBenchTask, Ft as InMemoryRunContextOptions, G as workerTraceAnalysisStore, Ga as StrategyShotResult, Gd as EventBus, Gi as PromotionVerdict, Gn as BudgetPoolRestore, Go as FanoutOptions, Gr as EvolutionReport, Gs as CompletionEvidence, Gt as SupervisorSpanOptions, H as WorkerToolTraceArtifact, Ha as StrategyCtx, Hc as DownMessageDeliveryOutcome, Hd as BusEvent, Hi as ResolveSandboxClientOptions, Hn as FileCoordinationLog, Ho as EqualKOnCostOptions, Hr as EvolutionBandInfo, Hs as LeaderboardSpec, Ht as WorktreePatchArtifact, I as jjWorkspace, Ia as CorpusReadbackOptions, Ic as CoordinationEvent, Ii as sumSandboxUsage, Il as WorktreeCommandResult, In as pickBestDelivered, Io as CombinatorShape, Ir as collectAgentTurn, Is as LeaderboardBenchmarkAdapter, It as RunContext, J as AuthorizedSpawn, Ja as breadthStrategy, Jd as WatchTraceOptions, Ji as trajectoryReport, Jn as ReservationTicket, Jo as FlatWidenGate, Jr as discriminatingMeans, Js as completionAuthorizes, Jt as createSupervisorSpanRecorder, K as createRootHandle, Ka as SurfaceScore, Kd as PublishOptions, Ki as promotionGate, Kn as BudgetReadout, Ko as FanoutSynthesis, Kr as ReproductionCheck, Ks as CompletionPolicy, Kt as SupervisorSpanOutcome, L as localShell, La as RunAgenticOptions, Li as CriuCapableClient, Ll as WorktreeHarnessResult, Ln as runFinalizer, Lo as Corpus, Lr as streamAgentTurn, Ls as LeaderboardFlagSpec, Lt as createFileRunContext, M as Workspace, Ma as AgenticSurface, Mc as AnalystRegistry, Mi as createSandboxToolPartState, Ml as Inbox, Mn as FinalizerSettled, Mo as defaultAnalystInstruction, Mr as AgentTurnBackend, Ms as ShapeRegistry, Mt as workerInboxFileFromEventDir, N as WorkspaceCommit, Na as AgenticTask, Nc as AuthorizeDownMessage, Ni as extractLlmCallEvent, Nl as InboxMessage, Nn as SupervisorFinalizer, No as observe, Nr as AgentTurnUsage, Ns as DefinedLeaderboard, Nt as writeWorkerSteer, O as copyUntrackedIntoClone, Oa as printBenchmarkReport, Oc as WaterfallReport, Oi as SandboxLineageHandle, Ol as SandboxSteeringOptions, On as plateau, Oo as harvestCorpus, Or as sandboxCheckRunner, Os as RunPersonified, Ot as supervisorRunsRoot, P as WorkspaceRun, Pa as AgenticTool, Pc as AuthorizedDownMessage, Pi as mapSandboxEvent, Pl as createInbox, Pn as bestDelivered, Po as renderReport, Pr as CollectedAgentTurn, Ps as LeaderboardBenchScore, Pt as InMemoryRunContext, Q as SuperviseOptions, Qa as runAgentic, Qd as gateOnDeliverable, Qi as definePersona, Qn as ProfileRichness, Qo as Panel, Qr as AuthorStrategyOptions, Qs as AxisScoresOf, Qt as DispatchReport, R as runInWorkspace, Ra as ShotPersona, Ri as SandboxCapabilities, Rl as WorktreeProfileMaterializationReceipt, Rn as runTree, Ro as CorpusFilter, Rr as ChampionPick, Rs as LeaderboardIterationInfo, Rt as createInMemoryRunContext, S as WorkerEvidenceInput, Sa as BenchmarkConfig, Sc as anytimeReport, Si as SandboxRunAbortError, Sl as RouterToolsSeam, Sn as StopRule, So as InProcessPromptCtx, Sr as defaultExtractCandidate, Ss as DefinePersonaInput, St as WorkerSteerRequest, T as settledWorkerOut, Ta as BenchmarkStrategySummary, Tc as plateauLength, Ti as CheckpointCapableBox, Tl as createExecutor, Tn as anyOf, To as HarvestCorpusOptions, Tr as modelAuthoredChecks, Ts as Persona, Tt as readWorkerSteerRequests, U as captureWorkerTraceEvidence, Ua as StrategyMessage, Uc as DownMessageEvent, Ud as BusRecord, Ui as resolveSandboxClient, Un as PriorCoordination, Uo as EqualKVerdict, Ur as EvolutionCandidate, Us as defineLeaderboard, Ut as createWorktreeCliExecutor, V as WORKER_TOOL_TRACE_SCHEMA_VERSION, Va as StrategyArtifacts, Vc as DownMessageDeliveryAttempt, Vi as acquireSandbox, Vn as CoordinationOwnerId, Vo as EqualKOnCost, Vr as EvolutionAuthor, Vs as LeaderboardScore, Vt as WorktreeCliExecutorOptions, W as parseWorkerToolTraceArtifact, Wa as StrategyResult, Wc as MakeWorkerAgent, Wd as BusStats, Wi as PromotionGateOptions, Wn as BudgetPool, Wo as Fanout, Wr as EvolutionGeneration, Ws as CompletionAnalyst, Wt as SupervisorSpanAttributes, X as DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, Xa as depthStrategy, Xd as watchTrace, Xi as createShapeRegistry, Xn as spendFromUsageEvents, Xo as LoopUntilSpec, Xr as runStrategyEvolution, Xs as sentinelCompletion, Xt as assertProfileModelsAllowed, Y as AuthorizedSpawnContext, Ya as defineStrategy, Yd as defaultToolDetectors, Yi as builtinShapes, Yn as createBudgetPool, Yo as LoopUntil, Yr as pickChampion, Ys as deterministicCompletion, Yt as assertModelAllowed, Z as DeliverableResolutionInput, Za as refine, Zd as DeliverableSpec, Zi as registerShape, Zn as AuthoredProfile, Zo as LoopUntilState, Zr as selectChampion, Zs as stopSentinel, Zt as ConcurrencyCaps, _ as WorktreeFanoutOptions, _a as McpEndpoint, _c as auditIntent, _i as Deliverable, _l as CliWorktreeBridgeSeam, _n as ProgressSample, _o as resolveMcpServerLaunch, _r as StructuralRolloutResult, _s as WidenDecision, _t as resolveSupervisorProfile, a as SandboxInstance, aa as loopUntil, ac as PairwiseVerdict, af as SpawnForestInDoubtNode, ai as NaiveDriverOptions, an as rollingDispatch, ao as loopDispatch, ar as profileRichnessFinding, as as RenderCorpusToInstructionsOptions, at as DriveHarnessOwnerContext, b as NOTE_MAX_CHARS, ba as sanitizeMcpToolSchema, bc as AnytimeStrategySummary, bi as OpenSandboxRunPromptOptions, bl as ProviderSeam, bn as ProgressView, bo as inlineSandboxClient, br as compareCheckOutcomes, bs as WinnerStrategy, bt as createScope, c as VerifierEnvironmentOptions, ca as selectValidWinner, cc as leaderboard, cf as SpawnForestTree, ci as naiveDriver, cn as delegate, co as defaultSelectWinner, cr as CheckOutcome, cs as ScopeWidenGate, ct as ResolveSupervisorTools, d as SuperviseSurfaceResult, da as CreateScopeAnalystOptions, dc as renderLeaderboardMarkdown, df as pendingWaits, di as McpSpawnFault, dn as DriverAgentOptions, do as LocalSandboxClientOptions, dr as CheckSource, ds as TrajectoryReport, dt as SupervisorNodeContext, ea as FileCorpus, ec as Interval, ef as FileSpawnJournal, ei as assertStrategyContract, en as DispatchUnit, eo as sampleThenRefine, er as asAuthoredProfile, es as PanelSpec, et as SuperviseRegistryTable, f as SurfaceWorkerConfig, fa as RegistryAnalyzeProjection, fc as renderLeaderboardSvg, ff as replaySpawnTree, fi as McpToolDescriptor, fn as driverAgent, fo as localSandboxClient, fr as CheckSourceCtx, fs as TrajectoryReportFn, ft as SupervisorNodeContextSeed, g as AuthoredHarness, ga as registryScopeAnalyst, gc as IntentAudit, gi as materializeLocalMcp, gl as CliSeam, gn as PlateauOptions, go as mcpSecretEnvMetadataKey, gr as StructuralRolloutPolicy, gs as Widen, gt as assertCoordinationBinding, h as superviseSurface, ha as createScopeAnalyst, hc as AuditIntentOptions, hi as connectStdioMcp, hl as BridgeSeam, hn as NoProgressForOptions, ho as envKeyProvider, hr as StructuralRolloutMessage, hs as VerifySpec, ht as SupervisorToolInvocationContext, i as SandboxEvent, ia as flatWidenGate, ic as PairwiseOptions, if as SpawnForestEvent, ii as DumbDriverOptions, in as queueOf, io as loopCampaignDispatch, ir as defaultProfileRichnessThresholds, is as RenderCorpusToInstructions, it as DriveHarness, j as Shell, ja as AgenticRunResult, jc as AnalystFindingEvent, ji as SandboxToolPartState, jl as createSteerableSandboxSession, jn as FinalizeContext, jo as ObserveOptions, jr as visibleCheckScore, js as ShapeContext, jt as workerInboxFile, k as withUntrackedArtifacts, ka as runBenchmark, kc as WaterfallSpan, ki as SessionCapableBox, kl as SteerableSandboxArgs, kn as sampleFromSettled, ko as Observation, kr as selectBestIndex, ks as RunPersonifiedOptions, kt as supervisorWorkersDir, l as createVerifierEnvironment, la as verify, lc as pairwiseSignificance, lf as loadSpawnForest, li as LocalMcpMaterialization, ln as CoordinationMcpHandle, lo as runAgentRounds, lr as CheckRunContext, ls as SteerContext, lt as ResolvedSupervisorProfile, m as failuresAnalyst, ma as buildSteerContext, mc as AuditIntentInput, mi as StdioMcpServerSpec, mn as AllWorkersStalledOptions, mo as ResolvedMcpServerLaunch, mr as StructuralRolloutConfig, ms as Verify, mt as SupervisorToolDescriptor, n as AnalystFinding, na as renderCorpusToInstructions, nc as LeaderboardOptions, nf as InMemorySpawnJournal, ni as strategyAuthorContract, nn as effectiveConcurrency, no as LoopDispatchOptions, nr as authoredWorker, ns as Pipeline, nt as workerFromBackend, o as computeFindingId, oa as panel, oc as ProfileKeyOf, of as SpawnForestMissingTree, oi as SteeringDecision, on as DelegateOptions, oo as RunAgentRoundsOptions, or as supervisorInstructions, os as ScopeAnalyst, ot as ObserveSupervisorNodeEvent, p as SurfaceWorkerOut, pa as assertTraceDerivedFindings, pc as renderPairwiseMarkdown, pf as contentAddress, pi as StdioMcpConnection, pn as finalizeBestDelivered, po as KeyProvider, pr as RepairStop, ps as TrajectoryReportOptions, pt as SupervisorProfile, q as createSupervisor, qa as adaptiveRefine, qd as createEventBus, qi as equalKOnCost, qn as ReservationRejection, qo as FanoutWinnerSelector, qr as StrategyEvolutionConfig, qs as CompletionVerdict, qt as SupervisorSpanRecorder, r as CreateSandboxOptions, ra as fanout, rc as LeaderboardRow, rf as SpawnForest, ri as ApplyContinuation, rn as freeSlots, ro as LoopOptionsForDispatch, rr as canonicalizeAuthoredProfile, rs as PipelineStage, rt as CoordinationBinding, s as makeFinding, sa as pipeline, sc as ScoreOf, sf as SpawnForestNode, si as dumbDriver, sn as defaultDelegateBudget, so as RunLoopOptions, sr as CheckExecChannel, ss as ScopeAnalyzeInput, st as ResolveDriveHarness, t as AgentProfile, ta as InMemoryCorpus, tc as Leaderboard, tf as InMemoryResultBlobStore, ti as authorStrategy, tn as RollingDispatchOptions, to as LoopCampaignDispatchOptions, tr as assessAuthoredProfile, ts as PanelVerdict, tt as supervise, u as SuperviseSurfaceOptions, ua as widen, uc as renderLeaderboardHtml, uf as materializeTreeView, ui as MaterializeLocalMcpOptions, un as serveCoordinationMcp, uo as runLoop, ur as CheckRunner, us as TrajectoryNode, ut as SupervisorAgentDeps, v as worktreeFanout, va as McpEnvironmentOptions, vc as defaultAuditorInstruction, vi as OpenSandboxRunBeforeStartContext, vl as CliWorktreeSeam, vn as ProgressTracker, vo as resolveSecretEnv, vr as VisibleCheck, vs as WidenLineage, vt as supervisorAgent, w as composeWorkerEvidence, wa as BenchmarkReport, wc as bestSoFar, wi as openSandboxRun, wl as cliWorktreeExecutor, wn as allWorkersStalled, wo as inProcessSandboxClient, wr as filterAuthoredAsserts, ws as Outcome, wt as legacySupervisorRunsRoot, x as VERIFY_TAIL_CHARS, xa as BenchmarkCell, xc as AnytimeTaskCurve, xi as SandboxRun, xl as RouterSeam, xn as StopDecision, xo as InProcessOnPrompt, xr as composeCheckSources, xs as DefinePersona, xt as settledToIteration, y as EVIDENCE_MAX_CHARS, ya as createMcpEnvironment, yc as AnytimeReport, yi as OpenSandboxRunOptions, yl as ExecutorConfig, yn as ProgressTrackerOptions, yo as secretEnvOfMcpServer, yr as canDisplace, ys as WidenSpec, yt as ScopeArgs, z as TrajectoryAnalysis, za as ShotSpec, zc as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, zi as probeSandboxCapabilities, zn as CoordinationDeliveryEvidence, zo as CorpusRecord, zr as ChampionPolicy, zs as LeaderboardRunContext, zt as PatchDeliverableOptions } from "./index-CGADWaa_.js";
2
2
  import { C as MountRecorder, D as SelectionReceipt, E as SandboxClient, O as ValidationCtx, S as MountManifestEntry, T as RunProvenance, _ as LoopTeardownFailedPayload, a as Iteration, b as LoopTraceEvent, c as LoopIterationDispatchPayload, d as LoopLineageOptions, f as LoopPlanDescription, g as LoopStartedPayload, h as LoopSandboxPlacement, i as ExecCtx, k as Validator, l as LoopIterationEndedPayload, m as LoopResult, n as DefaultVerdict, o as LoopDecisionPayload, p as LoopPlanPayload, r as Driver, s as LoopEndedPayload, t as AgentRunSpec, u as LoopIterationStartedPayload, v as LoopTokenUsage, w as OutputAdapter, x as LoopWinner, y as LoopTraceEmitter } from "./types-DnNGJ5Gz.js";
3
- import { $ as MaterializedModelIdentity, A as providerAsSandboxClient, An as validateWaitSpec, At as WidenGate, Bn as ActivityNote, C as ProviderAsSandboxClientOptions, Cn as WaitProbeRegistry, Ct as SupervisedResult, D as WorkspaceRequest, Dn as isWaitOutcome, Dt as UnknownMaterializationReason, E as SandboxClientProviderOptions, En as createWaitProbes, Et as TreeView, F as createTangleSandboxExactProcessProvider, Fn as TraceSource, Ft as readWorkerTraceContext, G as ExecutorExecutionBinding, Gn as createActivityLog, H as Executor, Hn as ExecutorProgress, I as Agent, In as createPushTraceSource, It as workerTraceEnv, J as ExecutorNodeContext, K as ExecutorFactory, Kn as readWorkerProgress, L as AgentExecutionRef, Ln as decodeToolPart, Lt as workerTraceSeamKey, M as sandboxClientAsProvider, Mn as SessionMessageLike, Mt as WorkerTraceUnavailableReason, N as CreateTangleSandboxExactProcessProviderOptions, Nn as SessionTraceBox, Nt as WorkerTraceResolver, O as createAgentEnvironmentProviderRegistry, On as pollFor, Ot as UsageEvent, P as SandboxControlClient, Pn as ToolStepInput, Pt as WorkerTraceSeamCarrier, Q as MaterializedExecutionIdentity, R as AgentSpec, Rn as sandboxSessionTraceSource, S as PlacementInfo, Sn as WaitProbe, St as SteerableRootHandle, T as ResourceRequest, Tn as WaitSpec, Tt as SupervisorOpts, U as ExecutorAccounting, Un as ScopeProgressInput, V as ExecutionBindingReceipt, Vn as DEFAULT_STALL_AFTER_MS, W as ExecutorContext, Wn as WorkerProgress, X as ExecutorResult, Y as ExecutorRegistry, Z as Handle, _ as CheckpointRequest, _t as SpawnJournal, a as AgentEnvironmentProviderRef, at as ProfileMaterializationReceipt, b as ExecResult, bn as PendingWait, bt as SpawnRejection, c as AgentEnvironmentStatus, ct as ResumedKeyState, d as AgentSession, dt as RootMaterialization, et as NoWinnerError, f as AgentSessionRef, ft as RootSignal, g as CheckpointRef, gt as SpawnEvent, h as AgentTurnResult, ht as Settled, i as AgentEnvironmentProvider, it as NodeStatus, j as resolveAgentEnvironmentProvider, jn as waitUntil, jt as WorkerTraceEvidence, k as providerAsExecutor, kn as timerAt, kt as WaitOpts, l as AgentEnvironmentSummary, lt as ResumedWork, m as AgentTurnInput, mt as Scope, n as AgentEnvironmentCapabilities, nn as createOpenInferenceFileExporter, nt as NodeId, o as AgentEnvironmentProviderRegistry, ot as Restart, p as AgentSessionStatus, pt as Runtime, q as ExecutorMaterialization, r as AgentEnvironmentEvent, rn as createOtelExporter, rt as NodeSnapshot, s as AgentEnvironmentQuery, st as ResultBlobStore, t as AgentEnvironment, tt as NodeExecutionIdentity, u as AgentProfileRef, ut as RootHandle, v as CreateAgentEnvironmentInput, vt as SpawnOpts, w as ProviderExecutorOptions, wn as WaitRejection, wt as Supervisor, x as ForkRequest, xn as WaitOutcome, xt as Spend, y as ExecRequest, yt as SpawnPrior, z as Budget, zn as ActivityLog } from "./environment-provider-CTZjdIUg.js";
4
- import { C as ToolLoopMessageRecord, S as ToolLoopCompactionOptions, _ as routerChatWithUsage, b as ToolLoopChat, d as RouterConfig, f as RouterToolCall, g as routerChatWithTools, h as routerBrain, l as RouterChatResult, m as ToolSpec, p as RouterToolLoopResult, u as RouterChatToolsResult, v as routerToolLoop, x as ToolLoopCompaction, y as streamRouterChatWithTools } from "./local-harness-t6cDWDQ2.js";
5
- export { type AcquireOptions, type ActivityLog, type ActivityNote, type Agent, type AgentEnvironment, type AgentEnvironmentCapabilities, type AgentEnvironmentEvent, type AgentEnvironmentProvider, type AgentEnvironmentProviderRef, type AgentEnvironmentProviderRegistry, type AgentEnvironmentQuery, type AgentEnvironmentStatus, type AgentEnvironmentSummary, type AgentExecutionRef, type AgentProfile, type AgentProfileRef, type AgentRunSpec, type AgentSession, type AgentSessionRef, type AgentSessionStatus, type AgentSpec, type AgentTurnBackend, type AgentTurnInput, type AgentTurnResult, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AllWorkersStalledOptions, type AnalystFinding, type AnalystFindingEvent, type AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredHarness, type AuthoredProfile, type AuthoredStrategy, type AuthorizeDownMessage, type AuthorizedDownMessage, type AuthorizedSpawn, type AuthorizedSpawnContext, type AxisScoresOf, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, type Budget, type BudgetPool, type BudgetPoolRestore, type BudgetReadout, type BusEvent, type BusRecord, type BusStats, type ChampionPick, type ChampionPolicy, type CheckExecChannel, type CheckOutcome, type CheckRunContext, type CheckRunner, type CheckSource, type CheckSourceCtx, type CheckpointCapableBox, type CheckpointRef, type CheckpointRequest, type CliSeam, type CliWorktreeBridgeSeam, type CliWorktreeSeam, type CollectedAgentTurn, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type ConcurrencyCaps, type ContinuationInstruction, type CoordinationBinding, type CoordinationDeliveryEvidence, type CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, type CoordinationOwnerId, type CopyOptions, type Corpus, type CorpusFilter, type CorpusReadbackOptions, type CorpusRecord, type CreateAgentEnvironmentInput, type CreateSandboxOptions, type CreateScopeAnalystOptions, type CreateTangleSandboxExactProcessProviderOptions, type CriuCapableClient, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, type DefaultVerdict, type DefinePersona, type DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, type DeliverableResolutionInput, type DeliverableSpec, type DeliveredOutput, type DispatchReport, type DispatchStopReason, type DispatchUnit, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveHarness, type DriveHarnessOwnerContext, type Driver, type DriverAgentOptions, type DumbDriverOptions, EVIDENCE_MAX_CHARS, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EventBus, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, type ExecCtx, type ExecRequest, type ExecResult, type ExecutionBindingReceipt, type Executor, type ExecutorAccounting, type ExecutorConfig, type ExecutorContext, type ExecutorExecutionBinding, type ExecutorFactory, type ExecutorMaterialization, type ExecutorNodeContext, type ExecutorProgress, type ExecutorRegistry, type ExecutorResult, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FinalizeContext, type FinalizerSettled, type FlatWidenGate, type ForkCapableBox, type ForkRequest, type GitWorkspaceOptions, type GroupOf, type Handle, 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, type Iteration, type KeyProvider, 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 LocalMcpMaterialization, type LocalSandboxClientOptions, type LoopCampaignDispatchOptions, type LoopDecisionPayload, type LoopDispatchOptions, type LoopEndedPayload, type LoopIterationDispatchPayload, type LoopIterationEndedPayload, type LoopIterationStartedPayload, type LoopLineageOptions, type LoopOptionsForDispatch, type LoopPlanDescription, type LoopPlanPayload, type LoopResult, type LoopSandboxPlacement, type LoopShape, type LoopStartedPayload, type LoopTeardownFailedPayload, type LoopTokenUsage, type LoopTraceEmitter, type LoopTraceEvent, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type LoopWinner, type MakeWorkerAgent, type MaterializeLocalMcpOptions, type MaterializedExecutionIdentity, type MaterializedModelIdentity, type McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, type MountManifestEntry, type MountRecorder, NOTE_MAX_CHARS, type NaiveDriverOptions, type NoProgressForOptions, type NoWinnerError, type NodeExecutionIdentity, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type ObserveSupervisorNodeEvent, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, PI_MCP_ADAPTER, PI_MCP_ADAPTER_ENV, PI_MCP_CONFIG_FLAG, PI_RUNTIME, type PairwiseOptions, type PairwiseVerdict, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type PatchDeliverableOptions, type PendingWait, type Persona, type PersonaContext, type PersonaExecutors, type PiExecutorOutput, type PiMcpMount, type PiMcpMountOptions, type PiMcpPreparation, type PiMcpReceipt, type PiSeam, type Pipeline, type PipelineStage, type PlacementInfo, type PlateauOptions, type PriorCoordination, type ProfileKeyOf, type ProfileMaterializationReceipt, type ProfileRichness, type ProfileRichnessThresholds, type ProgressSample, type ProgressTracker, type ProgressTrackerOptions, type ProgressView, type PromotionGateOptions, type PromotionVerdict, type ProviderAsSandboxClientOptions, type ProviderExecutorOptions, type ProviderSeam, type PublishOptions, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type RepairStop, type ReproductionCheck, type ReservationRejection, type ReservationTicket, type ResolveDriveHarness, type ResolveSandboxClientOptions, type ResolveSupervisorTools, type ResolvedMcpServerLaunch, type ResolvedSupervisorProfile, type ResourceRequest, type Restart, type ResultBlobStore, type ResumedKeyState, type ResumedWork, type RollingDispatchOptions, type RootHandle, type RootMaterialization, type RootSignal, type RouterChatResult, type RouterChatToolsResult, type RouterConfig, type RouterSeam, type RouterToolCall, type RouterToolLoopResult, type RouterToolsSeam, type RunAgentRoundsOptions, type RunAgenticOptions, type RunContext, type RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type RunProvenance, type Runtime, type SandboxCapabilities, type SandboxClient, type SandboxClientProviderOptions, type SandboxControlClient, type SandboxEvent, type SandboxInstance, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxSeam, type SandboxSteeringOptions, type SandboxToolPartState, type Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeArgs, type ScopeProgressInput, type ScopeWidenGate, type ScoreOf, type SelectionReceipt, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, type Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, type SpawnEvent, type SpawnForest, type SpawnForestEvent, type SpawnForestInDoubtNode, type SpawnForestMissingTree, type SpawnForestNode, type SpawnForestTree, type SpawnJournal, type SpawnOpts, type SpawnPrior, type SpawnRejection, type Spend, type StdioMcpConnection, type StdioMcpServerSpec, type SteerContext, type SteerableRootHandle, type SteerableSandboxArgs, type SteerableSandboxSession, type SteeringDecision, type StopDecision, type StopRule, type Strategy, type StrategyArtifacts, type StrategyCtx, type StrategyEvolutionConfig, type StrategyMessage, type StrategyResult, type StrategyShotResult, type StreamAgentTurnOptions, type StructuralRolloutConfig, type StructuralRolloutMessage, type StructuralRolloutPolicy, type StructuralRolloutResult, type SuperviseOptions, type SuperviseRegistry, type SuperviseRegistryTable, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorNodeContext, type SupervisorNodeContextSeed, type SupervisorOpts, type SupervisorProfile, type SupervisorSpanAttributes, type SupervisorSpanOptions, type SupervisorSpanOutcome, type SupervisorSpanRecorder, type SupervisorToolDescriptor, type SupervisorToolInvocationContext, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, type ToolLoopChat, type ToolLoopCompaction, type ToolLoopCompactionOptions, type ToolLoopMessageRecord, type ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, type TreeView, type TurnResult, type UnknownMaterializationReason, type UntrackedCopyStats, type UsageEvent, VERIFY_TAIL_CHARS, type ValidationCtx, type Validator, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type VisibleCheck, WORKER_TOOL_TRACE_SCHEMA_VERSION, type WaitOpts, type WaitOutcome, type WaitProbe, type WaitProbeRegistry, type WaitRejection, type WaitSpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenGate, type WidenLineage, type WidenSpec, type WinnerStrategy, type WorkerEvidenceInput, type WorkerProgress, type WorkerSpawnContext, type WorkerSteerRequest, type WorkerToolTraceArtifact, type WorkerTraceEvidence, type WorkerTraceResolver, type WorkerTraceSeamCarrier, type WorkerTraceUnavailableReason, type Workspace, type WorkspaceCommit, type WorkspaceRequest, type WorkspaceRun, type WorktreeCheckRunner, type WorktreeCliExecutorOptions, type WorktreeCommandResult, type WorktreeFanoutOptions, type WorktreeHarnessResult, type WorktreePatchArtifact, type WorktreeProfileMaterializationReceipt, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertProfileModelsAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, canonicalizeAuthoredProfile, captureWorkerTraceEvidence, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createOpenInferenceFileExporter, createOtelExporter, createProgressTracker, createPushTraceSource, createRootHandle, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, loadSpawnForest, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, readWorkerTraceContext, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, workerTraceAnalysisStore, workerTraceEnv, workerTraceSeamKey, worktreeFanout, writeWorkerSteer };
3
+ import { $ as MaterializedModelIdentity, A as providerAsSandboxClient, An as validateWaitSpec, At as WidenGate, Bn as ActivityNote, C as ProviderAsSandboxClientOptions, Cn as WaitProbeRegistry, Ct as SupervisedResult, D as WorkspaceRequest, Dn as isWaitOutcome, Dt as UnknownMaterializationReason, E as SandboxClientProviderOptions, En as createWaitProbes, Et as TreeView, F as createTangleSandboxExactProcessProvider, Fn as TraceSource, Ft as readWorkerTraceContext, G as ExecutorExecutionBinding, Gn as createActivityLog, H as Executor, Hn as ExecutorProgress, I as Agent, In as createPushTraceSource, It as workerTraceEnv, J as ExecutorNodeContext, K as ExecutorFactory, Kn as readWorkerProgress, L as AgentExecutionRef, Ln as decodeToolPart, Lt as workerTraceSeamKey, M as sandboxClientAsProvider, Mn as SessionMessageLike, Mt as WorkerTraceUnavailableReason, N as CreateTangleSandboxExactProcessProviderOptions, Nn as SessionTraceBox, Nt as WorkerTraceResolver, O as createAgentEnvironmentProviderRegistry, On as pollFor, Ot as UsageEvent, P as SandboxControlClient, Pn as ToolStepInput, Pt as WorkerTraceSeamCarrier, Q as MaterializedExecutionIdentity, R as AgentSpec, Rn as sandboxSessionTraceSource, S as PlacementInfo, Sn as WaitProbe, St as SteerableRootHandle, T as ResourceRequest, Tn as WaitSpec, Tt as SupervisorOpts, U as ExecutorAccounting, Un as ScopeProgressInput, V as ExecutionBindingReceipt, Vn as DEFAULT_STALL_AFTER_MS, W as ExecutorContext, Wn as WorkerProgress, X as ExecutorResult, Y as ExecutorRegistry, Z as Handle, _ as CheckpointRequest, _t as SpawnJournal, a as AgentEnvironmentProviderRef, at as ProfileMaterializationReceipt, b as ExecResult, bn as PendingWait, bt as SpawnRejection, c as AgentEnvironmentStatus, ct as ResumedKeyState, d as AgentSession, dt as RootMaterialization, et as NoWinnerError, f as AgentSessionRef, ft as RootSignal, g as CheckpointRef, gt as SpawnEvent, h as AgentTurnResult, ht as Settled, i as AgentEnvironmentProvider, it as NodeStatus, j as resolveAgentEnvironmentProvider, jn as waitUntil, jt as WorkerTraceEvidence, k as providerAsExecutor, kn as timerAt, kt as WaitOpts, l as AgentEnvironmentSummary, lt as ResumedWork, m as AgentTurnInput, mt as Scope, n as AgentEnvironmentCapabilities, nn as createOpenInferenceFileExporter, nt as NodeId, o as AgentEnvironmentProviderRegistry, ot as Restart, p as AgentSessionStatus, pt as Runtime, q as ExecutorMaterialization, r as AgentEnvironmentEvent, rn as createOtelExporter, rt as NodeSnapshot, s as AgentEnvironmentQuery, st as ResultBlobStore, t as AgentEnvironment, tt as NodeExecutionIdentity, u as AgentProfileRef, ut as RootHandle, v as CreateAgentEnvironmentInput, vt as SpawnOpts, w as ProviderExecutorOptions, wn as WaitRejection, wt as Supervisor, x as ForkRequest, xn as WaitOutcome, xt as Spend, y as ExecRequest, yt as SpawnPrior, z as Budget, zn as ActivityLog } from "./environment-provider-Bh4nX2qt.js";
4
+ import { C as streamRouterChatWithTools, D as ToolLoopMessageRecord, E as ToolLoopCompactionOptions, S as routerToolLoop, T as ToolLoopCompaction, _ as RouterToolLoopResult, b as routerChatWithTools, g as RouterToolCall, h as RouterConfig, m as RouterChatToolsResult, p as RouterChatResult, v as ToolSpec, w as ToolLoopChat, x as routerChatWithUsage, y as routerBrain } from "./local-harness-BIajef4A.js";
5
+ export { type AcquireOptions, type ActivityLog, type ActivityNote, type Agent, type AgentEnvironment, type AgentEnvironmentCapabilities, type AgentEnvironmentEvent, type AgentEnvironmentProvider, type AgentEnvironmentProviderRef, type AgentEnvironmentProviderRegistry, type AgentEnvironmentQuery, type AgentEnvironmentStatus, type AgentEnvironmentSummary, type AgentExecutionRef, type AgentProfile, type AgentProfileRef, type AgentRunSpec, type AgentSession, type AgentSessionRef, type AgentSessionStatus, type AgentSpec, type AgentTurnBackend, type AgentTurnInput, type AgentTurnResult, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AllWorkersStalledOptions, type AnalystFinding, type AnalystFindingEvent, type AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredHarness, type AuthoredProfile, type AuthoredStrategy, type AuthorizeDownMessage, type AuthorizedDownMessage, type AuthorizedSpawn, type AuthorizedSpawnContext, type AxisScoresOf, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, type Budget, type BudgetPool, type BudgetPoolRestore, type BudgetReadout, type BusEvent, type BusRecord, type BusStats, type ChampionPick, type ChampionPolicy, type CheckExecChannel, type CheckOutcome, type CheckRunContext, type CheckRunner, type CheckSource, type CheckSourceCtx, type CheckpointCapableBox, type CheckpointRef, type CheckpointRequest, type CliSeam, type CliWorktreeBridgeSeam, type CliWorktreeSeam, type CollectedAgentTurn, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type ConcurrencyCaps, type ContinuationInstruction, type CoordinationBinding, type CoordinationDeliveryEvidence, type CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, type CoordinationOwnerId, type CopyOptions, type Corpus, type CorpusFilter, type CorpusReadbackOptions, type CorpusRecord, type CreateAgentEnvironmentInput, type CreateSandboxOptions, type CreateScopeAnalystOptions, type CreateTangleSandboxExactProcessProviderOptions, type CriuCapableClient, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, type DefaultVerdict, type DefinePersona, type DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, type DeliverableResolutionInput, type DeliverableSpec, type DeliveredOutput, type DispatchReport, type DispatchStopReason, type DispatchUnit, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveHarness, type DriveHarnessOwnerContext, type Driver, type DriverAgentOptions, type DumbDriverOptions, EVIDENCE_MAX_CHARS, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EventBus, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, type ExecCtx, type ExecRequest, type ExecResult, type ExecutionBindingReceipt, type Executor, type ExecutorAccounting, type ExecutorConfig, type ExecutorContext, type ExecutorExecutionBinding, type ExecutorFactory, type ExecutorMaterialization, type ExecutorNodeContext, type ExecutorProgress, type ExecutorRegistry, type ExecutorResult, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FinalizeContext, type FinalizerSettled, type FlatWidenGate, type ForkCapableBox, type ForkRequest, type GitWorkspaceOptions, type GroupOf, type Handle, 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, type Iteration, type KeyProvider, 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 LocalMcpMaterialization, type LocalSandboxClientOptions, type LoopCampaignDispatchOptions, type LoopDecisionPayload, type LoopDispatchOptions, type LoopEndedPayload, type LoopIterationDispatchPayload, type LoopIterationEndedPayload, type LoopIterationStartedPayload, type LoopLineageOptions, type LoopOptionsForDispatch, type LoopPlanDescription, type LoopPlanPayload, type LoopResult, type LoopSandboxPlacement, type LoopShape, type LoopStartedPayload, type LoopTeardownFailedPayload, type LoopTokenUsage, type LoopTraceEmitter, type LoopTraceEvent, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type LoopWinner, type MakeWorkerAgent, type MaterializeLocalMcpOptions, type MaterializedExecutionIdentity, type MaterializedModelIdentity, type McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, type MountManifestEntry, type MountRecorder, NOTE_MAX_CHARS, type NaiveDriverOptions, type NoProgressForOptions, type NoWinnerError, type NodeExecutionIdentity, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type ObserveSupervisorNodeEvent, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, type PairwiseOptions, type PairwiseVerdict, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type PatchDeliverableOptions, type PendingWait, type Persona, type PersonaContext, type PersonaExecutors, type Pipeline, type PipelineStage, type PlacementInfo, type PlateauOptions, type PriorCoordination, type ProfileKeyOf, type ProfileMaterializationReceipt, type ProfileRichness, type ProfileRichnessThresholds, type ProgressSample, type ProgressTracker, type ProgressTrackerOptions, type ProgressView, type PromotionGateOptions, type PromotionVerdict, type ProviderAsSandboxClientOptions, type ProviderExecutorOptions, type ProviderSeam, type PublishOptions, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type RepairStop, type ReproductionCheck, type ReservationRejection, type ReservationTicket, type ResolveDriveHarness, type ResolveSandboxClientOptions, type ResolveSupervisorTools, type ResolvedMcpServerLaunch, type ResolvedSupervisorProfile, type ResourceRequest, type Restart, type ResultBlobStore, type ResumedKeyState, type ResumedWork, type RollingDispatchOptions, type RootHandle, type RootMaterialization, type RootSignal, type RouterChatResult, type RouterChatToolsResult, type RouterConfig, type RouterSeam, type RouterToolCall, type RouterToolLoopResult, type RouterToolsSeam, type RunAgentRoundsOptions, type RunAgenticOptions, type RunContext, type RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type RunProvenance, type Runtime, type SandboxCapabilities, type SandboxClient, type SandboxClientProviderOptions, type SandboxControlClient, type SandboxEvent, type SandboxInstance, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxSeam, type SandboxSteeringOptions, type SandboxToolPartState, type Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeArgs, type ScopeProgressInput, type ScopeWidenGate, type ScoreOf, type SelectionReceipt, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, type Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, type SpawnEvent, type SpawnForest, type SpawnForestEvent, type SpawnForestInDoubtNode, type SpawnForestMissingTree, type SpawnForestNode, type SpawnForestTree, type SpawnJournal, type SpawnOpts, type SpawnPrior, type SpawnRejection, type Spend, type StdioMcpConnection, type StdioMcpServerSpec, type SteerContext, type SteerableRootHandle, type SteerableSandboxArgs, type SteerableSandboxSession, type SteeringDecision, type StopDecision, type StopRule, type Strategy, type StrategyArtifacts, type StrategyCtx, type StrategyEvolutionConfig, type StrategyMessage, type StrategyResult, type StrategyShotResult, type StreamAgentTurnOptions, type StructuralRolloutConfig, type StructuralRolloutMessage, type StructuralRolloutPolicy, type StructuralRolloutResult, type SuperviseOptions, type SuperviseRegistry, type SuperviseRegistryTable, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorNodeContext, type SupervisorNodeContextSeed, type SupervisorOpts, type SupervisorProfile, type SupervisorSpanAttributes, type SupervisorSpanOptions, type SupervisorSpanOutcome, type SupervisorSpanRecorder, type SupervisorToolDescriptor, type SupervisorToolInvocationContext, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, type ToolLoopChat, type ToolLoopCompaction, type ToolLoopCompactionOptions, type ToolLoopMessageRecord, type ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, type TreeView, type TurnResult, type UnknownMaterializationReason, type UntrackedCopyStats, type UsageEvent, VERIFY_TAIL_CHARS, type ValidationCtx, type Validator, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type VisibleCheck, WORKER_TOOL_TRACE_SCHEMA_VERSION, type WaitOpts, type WaitOutcome, type WaitProbe, type WaitProbeRegistry, type WaitRejection, type WaitSpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenGate, type WidenLineage, type WidenSpec, type WinnerStrategy, type WorkerEvidenceInput, type WorkerProgress, type WorkerSpawnContext, type WorkerSteerRequest, type WorkerToolTraceArtifact, type WorkerTraceEvidence, type WorkerTraceResolver, type WorkerTraceSeamCarrier, type WorkerTraceUnavailableReason, type Workspace, type WorkspaceCommit, type WorkspaceRequest, type WorkspaceRun, type WorktreeCheckRunner, type WorktreeCliExecutorOptions, type WorktreeCommandResult, type WorktreeFanoutOptions, type WorktreeHarnessResult, type WorktreePatchArtifact, type WorktreeProfileMaterializationReceipt, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertProfileModelsAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildSteerContext, builtinShapes, canDisplace, canonicalizeAuthoredProfile, captureWorkerTraceEvidence, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createOpenInferenceFileExporter, createOtelExporter, createProgressTracker, createPushTraceSource, createRootHandle, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, legacySupervisorRunsRoot, loadSpawnForest, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, patchDelivered, pendingWaits, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, readWorkerTraceContext, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, supervisorWorkersDir, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerControlLogFile, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, workerTraceAnalysisStore, workerTraceEnv, workerTraceSeamKey, worktreeFanout, writeWorkerSteer };
package/dist/kernel.js CHANGED
@@ -1,8 +1,9 @@
1
- import { _ as captureWorkerTraceEvidence, a as loadSpawnForest, b as workerTraceAnalysisStore, c as replaySpawnTree, g as WORKER_TOOL_TRACE_SCHEMA_VERSION, i as InMemorySpawnJournal, n as FileSpawnJournal, o as materializeTreeView, r as InMemoryResultBlobStore, s as pendingWaits, t as FileResultBlobStore, x as contentAddress, y as parseWorkerToolTraceArtifact } from "./spawn-journal-B_mu_oH2.js";
2
- import { $ as createBudgetPool, B as timerAt, E as createOtelExporter, G as readWorkerProgress, H as waitUntil, J as queueOf, K as effectiveConcurrency, L as createWaitProbes, R as isWaitOutcome, T as createOpenInferenceFileExporter, U as DEFAULT_STALL_AFTER_MS, V as validateWaitSpec, W as createActivityLog, Y as rollingDispatch, _ as workerTraceSeamKey, a as pickBestDelivered, ct as routerBrain, dt as routerToolLoop, et as spendFromUsageEvents, ft as streamRouterChatWithTools, g as workerTraceEnv, h as readWorkerTraceContext, i as collectDelivered, lt as routerChatWithTools, m as settledToIteration, n as createSupervisor, o as runFinalizer, q as freeSlots, r as bestDelivered, s as runTree, t as createRootHandle, u as createScope, ut as routerChatWithUsage, z as pollFor } from "./supervisor-CAXiCKnX.js";
3
- import { C as observe, S as defaultAnalystInstruction, _ as depthStrategy, a as defaultStructuralRolloutPolicy, b as sample, c as officialChecksFromMeta, d as selectBestIndex, f as structuralRollout, g as defineStrategy, h as breadthStrategy, i as defaultExtractCandidate, l as resolveEntrySymbol, m as adaptiveRefine, n as compareCheckOutcomes, o as filterAuthoredAsserts, p as visibleCheckScore, r as composeCheckSources, s as modelAuthoredChecks, t as canDisplace, u as sandboxCheckRunner, v as refine, w as renderReport, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-DLwW69R4.js";
4
- import { $ as InMemoryCorpus, At as renderLeaderboardMarkdown, B as SandboxRunAbortError, Bt as envKeyProvider, C as safeWorkerFile, Ct as completionAuthorizes, D as workerInboxFileFromEventDir, Dt as leaderboard, E as workerInboxFile, Et as stopSentinel, F as runStrategyEvolution, Ft as McpSpawnFault, G as equalKOnCost, H as printBenchmarkReport, Ht as resolveMcpServerLaunch, I as selectChampion, It as connectStdioMcp, J as runPersonified, K as trajectoryReport, L as assertStrategyContract, Lt as materializeLocalMcp, M as streamAgentTurn, Mt as renderPairwiseMarkdown, N as discriminatingMeans, Nt as auditIntent, O as writeWorkerSteer, Ot as pairwiseSignificance, P as pickChampion, Pt as defaultAuditorInstruction, Q as FileCorpus, R as authorStrategy, Rt as createMcpEnvironment, S as readWorkerSteerRequests, St as loopDispatch, T as supervisorRunsRoot, Tt as sentinelCompletion, U as runBenchmark, Ut as resolveSecretEnv, V as openSandboxRun, Vt as mcpSecretEnvMetadataKey, W as promotionGate, Wt as secretEnvOfMcpServer, X as createShapeRegistry, Y as builtinShapes, Z as registerShape, _ as settledWorkerOut, _t as naiveDriver, a as localShell, at as pipeline, b as analyzeTrace, bt as inlineSandboxClient, c as createVerifierEnvironment, ct as widen, d as worktreeFanout, dt as createScopeAnalyst, et as renderCorpusToInstructions, f as EVIDENCE_MAX_CHARS, ft as registryScopeAnalyst, g as composeWorkerEvidence, gt as dumbDriver, h as closingWorkerNote, ht as defineLeaderboard, i as jjWorkspace, it as panel, j as collectAgentTurn, jt as renderLeaderboardSvg, k as patchDelivered, kt as renderLeaderboardHtml, l as failuresAnalyst, lt as assertTraceDerivedFindings, m as VERIFY_TAIL_CHARS, mt as harvestCorpus, n as makeFinding, nt as flatWidenGate, o as runInWorkspace, ot as selectValidWinner, p as NOTE_MAX_CHARS, pt as inProcessSandboxClient, q as definePersona, r as gitWorkspace, rt as loopUntil, s as createWaterfallCollector, st as verify, t as computeFindingId, tt as fanout, u as superviseSurface, ut as buildSteerContext, v as copyUntrackedIntoClone, vt as resolveSandboxClient, w as supervisorRunDir, wt as deterministicCompletion, x as legacySupervisorRunDir, xt as loopCampaignDispatch, y as withUntrackedArtifacts, yt as localSandboxClient, z as strategyAuthorContract, zt as sanitizeMcpToolSchema } from "./runtime-Ce39zfqn.js";
1
+ import { _ as captureWorkerTraceEvidence, a as loadSpawnForest, b as workerTraceAnalysisStore, c as replaySpawnTree, g as WORKER_TOOL_TRACE_SCHEMA_VERSION, i as InMemorySpawnJournal, n as FileSpawnJournal, o as materializeTreeView, r as InMemoryResultBlobStore, s as pendingWaits, t as FileResultBlobStore, x as contentAddress, y as parseWorkerToolTraceArtifact } from "./spawn-journal-IeXpidO2.js";
2
+ import { B as timerAt, E as createOtelExporter, H as waitUntil, J as freeSlots, K as readWorkerProgress, L as createWaitProbes, R as isWaitOutcome, T as createOpenInferenceFileExporter, U as DEFAULT_STALL_AFTER_MS, V as validateWaitSpec, W as createActivityLog, X as rollingDispatch, Y as queueOf, _ as workerTraceSeamKey, a as pickBestDelivered, dt as routerBrain, ft as routerChatWithTools, g as workerTraceEnv, h as readWorkerTraceContext, ht as streamRouterChatWithTools, i as collectDelivered, m as settledToIteration, mt as routerToolLoop, n as createSupervisor, nt as createBudgetPool, o as runFinalizer, pt as routerChatWithUsage, q as effectiveConcurrency, r as bestDelivered, rt as spendFromUsageEvents, s as runTree, t as createRootHandle, u as createScope, z as pollFor } from "./supervisor-CpT9yAxL.js";
3
+ import { C as observe, S as defaultAnalystInstruction, _ as depthStrategy, a as defaultStructuralRolloutPolicy, b as sample, c as officialChecksFromMeta, d as selectBestIndex, f as structuralRollout, g as defineStrategy, h as breadthStrategy, i as defaultExtractCandidate, l as resolveEntrySymbol, m as adaptiveRefine, n as compareCheckOutcomes, o as filterAuthoredAsserts, p as visibleCheckScore, r as composeCheckSources, s as modelAuthoredChecks, t as canDisplace, u as sandboxCheckRunner, v as refine, w as renderReport, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-DQHO3b2Y.js";
4
+ import { $ as verify, A as authorStrategy, At as createMcpEnvironment, B as runPersonified, C as collectAgentTurn, Ct as renderLeaderboardSvg, D as runStrategyEvolution, Dt as McpSpawnFault, E as pickChampion, Et as defaultAuditorInstruction, F as runBenchmark, Ft as resolveSecretEnv, G as InMemoryCorpus, H as createShapeRegistry, I as promotionGate, It as secretEnvOfMcpServer, J as flatWidenGate, K as renderCorpusToInstructions, L as equalKOnCost, M as SandboxRunAbortError, Mt as envKeyProvider, N as openSandboxRun, Nt as mcpSecretEnvMetadataKey, O as selectChampion, Ot as connectStdioMcp, P as printBenchmarkReport, Pt as resolveMcpServerLaunch, Q as selectValidWinner, R as trajectoryReport, St as renderLeaderboardMarkdown, T as discriminatingMeans, Tt as auditIntent, U as registerShape, V as builtinShapes, W as FileCorpus, X as panel, Y as loopUntil, Z as pipeline, _ as settledWorkerOut, _t as sentinelCompletion, a as localShell, at as inProcessSandboxClient, b as analyzeTrace, bt as pairwiseSignificance, c as createVerifierEnvironment, ct as dumbDriver, d as worktreeFanout, dt as localSandboxClient, et as widen, f as EVIDENCE_MAX_CHARS, ft as inlineSandboxClient, g as composeWorkerEvidence, gt as deterministicCompletion, h as closingWorkerNote, ht as completionAuthorizes, i as jjWorkspace, it as registryScopeAnalyst, j as strategyAuthorContract, jt as sanitizeMcpToolSchema, k as assertStrategyContract, kt as materializeLocalMcp, l as failuresAnalyst, lt as naiveDriver, m as VERIFY_TAIL_CHARS, mt as loopDispatch, n as makeFinding, nt as buildSteerContext, o as runInWorkspace, ot as harvestCorpus, p as NOTE_MAX_CHARS, pt as loopCampaignDispatch, q as fanout, r as gitWorkspace, rt as createScopeAnalyst, s as createWaterfallCollector, st as defineLeaderboard, t as computeFindingId, tt as assertTraceDerivedFindings, u as superviseSurface, ut as resolveSandboxClient, v as copyUntrackedIntoClone, vt as stopSentinel, w as streamAgentTurn, wt as renderPairwiseMarkdown, x as patchDelivered, xt as renderLeaderboardHtml, y as withUntrackedArtifacts, yt as leaderboard, z as definePersona } from "./runtime-D4e3GP5K.js";
5
5
  import { i as mapSandboxToolEvent, n as extractLlmCallEvent, o as sumSandboxUsage, r as mapSandboxEvent, t as createSandboxToolPartState } from "./sandbox-events-Yhd1GYWl.js";
6
- import { $ as allOf, $t as profileRichnessFinding, At as PI_MCP_ADAPTER, Bt as runLoop, Ct as createSteerableSandboxSession, Dt as createPushTraceSource, Et as piSeamKey, F as defaultDelegateBudget, Ft as preparePiMcp, Gt as createSupervisorSpanRecorder, Ht as probeSandboxCapabilities, I as delegate, It as createInbox, Jt as asAuthoredProfile, Kt as assertModelAllowed, Mt as PI_MCP_CONFIG_FLAG, Nt as buildPiMcpServers, Ot as decodeToolPart, Pt as piMcpAdapterAvailable, Q as finalizeBestDelivered, Qt as defaultProfileRichnessThresholds, Rt as defaultSelectWinner, St as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Tt as piExecutor, Ut as acquireSandbox, Vt as createSandboxLineage, Wt as FileCoordinationLog, Xt as authoredWorker, Yt as assessAuthoredProfile, Z as driverAgent, Zt as canonicalizeAuthoredProfile, _t as createInMemoryRunContext, a as resolveSupervisorProfile, at as sampleFromSettled, bt as createExecutorRegistry, ct as bestSoFar, dt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, en as supervisorInstructions, et as allWorkersStalled, gt as createFileRunContext, ht as watchTrace, i as assertCoordinationBinding, it as plateau, jt as PI_MCP_ADAPTER_ENV, kt as sandboxSessionTraceSource, lt as plateauLength, mt as defaultToolDetectors, n as supervise, nt as createProgressTracker, o as supervisorAgent, ot as anytimeReport, pt as createEventBus, qt as assertProfileModelsAllowed, r as workerFromBackend, rt as noProgressFor, s as serveCoordinationMcp, st as areaUnderCurve, t as DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, tn as gateOnDeliverable, tt as anyOf, ut as renderAnytimeTable, vt as cliWorktreeExecutor, wt as PI_RUNTIME, xt as createWorktreeCliExecutor, yt as createExecutor, zt as runAgentRounds } from "./supervise-U7_K5yuV.js";
7
- import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-CzcEyRL7.js";
8
- export { DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, EVIDENCE_MAX_CHARS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, NOTE_MAX_CHARS, PI_MCP_ADAPTER, PI_MCP_ADAPTER_ENV, PI_MCP_CONFIG_FLAG, PI_RUNTIME, SandboxRunAbortError, VERIFY_TAIL_CHARS, WORKER_TOOL_TRACE_SCHEMA_VERSION, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertProfileModelsAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, canonicalizeAuthoredProfile, captureWorkerTraceEvidence, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createOpenInferenceFileExporter, createOtelExporter, createProgressTracker, createPushTraceSource, createRootHandle, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, loadSpawnForest, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, readWorkerTraceContext, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, workerTraceAnalysisStore, workerTraceEnv, workerTraceSeamKey, worktreeFanout, writeWorkerSteer };
6
+ import { $ as allOf, At as runAgentRounds, Bt as assessAuthoredProfile, Ct as createSteerableSandboxSession, Dt as createInbox, Et as sandboxSessionTraceSource, F as defaultDelegateBudget, Ft as FileCoordinationLog, Gt as supervisorInstructions, Ht as canonicalizeAuthoredProfile, I as delegate, It as createSupervisorSpanRecorder, Kt as gateOnDeliverable, Lt as assertModelAllowed, Mt as createSandboxLineage, Nt as probeSandboxCapabilities, Pt as acquireSandbox, Q as finalizeBestDelivered, Rt as assertProfileModelsAllowed, St as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Tt as decodeToolPart, Ut as defaultProfileRichnessThresholds, Vt as authoredWorker, Wt as profileRichnessFinding, Z as driverAgent, _t as createInMemoryRunContext, a as resolveSupervisorProfile, at as sampleFromSettled, bt as createExecutorRegistry, ct as bestSoFar, dt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, et as allWorkersStalled, gt as createFileRunContext, ht as watchTrace, i as assertCoordinationBinding, it as plateau, jt as runLoop, kt as defaultSelectWinner, lt as plateauLength, mt as defaultToolDetectors, n as supervise, nt as createProgressTracker, o as supervisorAgent, ot as anytimeReport, pt as createEventBus, r as workerFromBackend, rt as noProgressFor, s as serveCoordinationMcp, st as areaUnderCurve, t as DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, tt as anyOf, ut as renderAnytimeTable, vt as cliWorktreeExecutor, wt as createPushTraceSource, xt as createWorktreeCliExecutor, yt as createExecutor, zt as asAuthoredProfile } from "./supervise-Cq50UT5-.js";
7
+ import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-Cr75N-rU.js";
8
+ import { a as supervisorRunDir, c as workerControlLogFile, d as writeWorkerSteer, i as safeWorkerFile, l as workerInboxFile, n as legacySupervisorRunsRoot, o as supervisorRunsRoot, r as readWorkerSteerRequests, s as supervisorWorkersDir, t as legacySupervisorRunDir, u as workerInboxFileFromEventDir } from "./run-layout-C2FGmZ3v.js";
9
+ export { DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, EVIDENCE_MAX_CHARS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, NOTE_MAX_CHARS, SandboxRunAbortError, VERIFY_TAIL_CHARS, WORKER_TOOL_TRACE_SCHEMA_VERSION, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertProfileModelsAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildSteerContext, builtinShapes, canDisplace, canonicalizeAuthoredProfile, captureWorkerTraceEvidence, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createOpenInferenceFileExporter, createOtelExporter, createProgressTracker, createPushTraceSource, createRootHandle, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, legacySupervisorRunsRoot, loadSpawnForest, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, patchDelivered, pendingWaits, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, readWorkerTraceContext, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, supervisorWorkersDir, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerControlLogFile, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, workerTraceAnalysisStore, workerTraceEnv, workerTraceSeamKey, worktreeFanout, writeWorkerSteer };
@@ -1,8 +1,8 @@
1
- import { a as persistCandidateOutputArtifact, ct as omitTopLevelDigest, nt as canonicalCandidateBytes, ot as embeddedCandidateArtifact } from "./prepare-BbI6qGOW.js";
2
- import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-CqPIijFA.js";
3
- import { t as createAgentImprovementActivationResult } from "./activation-BZ2FyX0O.js";
1
+ import { a as persistCandidateOutputArtifact, ct as omitTopLevelDigest, nt as canonicalCandidateBytes, ot as embeddedCandidateArtifact } from "./prepare-DpV6np9e.js";
2
+ import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-B4SkNJjw.js";
3
+ import { t as createAgentImprovementActivationResult } from "./activation-DdIpwQ0k.js";
4
4
  import { r as researcherProfile } from "./researcher-CoVqNhfI.js";
5
- import { n as supervise } from "./supervise-U7_K5yuV.js";
5
+ import { n as supervise } from "./supervise-Cq50UT5-.js";
6
6
  import { agentCandidateKnowledgeSchema, sha256DigestSchema } from "@tangle-network/agent-interface";
7
7
  import { realpath } from "node:fs/promises";
8
8
  import { evaluateKnowledgeBaseReadiness, fromAgentCandidateKnowledgeRef, improveKnowledgeBase, knowledgeImprovementCandidateRef, loadKnowledgeImprovementActivationResult, promoteKnowledgeCandidate, restoreKnowledgeCandidateBaseline, toAgentCandidateKnowledgeRef, withKnowledgeImprovementComparison } from "@tangle-network/agent-knowledge";
@@ -430,4 +430,4 @@ function addSpent(target, result) {
430
430
  //#endregion
431
431
  export { createSupervisedKnowledgeUpdater as a, runSupervisedKnowledgeUpdate as c, RESEARCH_SUPERVISOR_SYSTEM_PROMPT as i, createKnowledgeImprovementActivationExecutor as l, createAgentKnowledgeReadinessCheck as n, formatSupervisedKnowledgeTask as o, runKnowledgeImprovementJob as r, knowledgeReadinessDeliverable as s, buildKnowledgeImprovementExperimentBundles as t };
432
432
 
433
- //# sourceMappingURL=knowledge-CDlrayRc.js.map
433
+ //# sourceMappingURL=knowledge-I1e9zQGj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-CDlrayRc.js","names":[],"sources":["../src/knowledge/activation.ts","../src/knowledge/supervised-update.ts","../src/knowledge/improvement-job.ts"],"sourcesContent":["import type {\n AgentImprovementActivationOutcome,\n AgentImprovementActivationResult,\n AgentImprovementActivationTarget,\n Sha256Digest,\n} from '@tangle-network/agent-interface'\nimport { sha256DigestSchema } from '@tangle-network/agent-interface'\nimport {\n fromAgentCandidateKnowledgeRef,\n type KnowledgeImprovementMutationReceipt,\n loadKnowledgeImprovementActivationResult,\n type PromoteKnowledgeCandidateOptions,\n promoteKnowledgeCandidate,\n restoreKnowledgeCandidateBaseline,\n} from '@tangle-network/agent-knowledge'\n\nimport {\n type AgentImprovementActivationReconciliation,\n type AgentImprovementActivationResultStore,\n type AgentImprovementActivationTransition,\n type AgentImprovementActivationTransitionInput,\n createAgentImprovementActivationResult,\n} from '../intelligence/activation'\n\nexport interface CreateKnowledgeImprovementActivationExecutorOptions\n extends Omit<PromoteKnowledgeCandidateOptions, 'root' | 'candidate'> {\n root: string\n identity: string\n results: AgentImprovementActivationResultStore\n}\n\nexport interface KnowledgeImprovementActivationExecutor {\n transition: AgentImprovementActivationTransition\n reconcile: AgentImprovementActivationReconciliation\n}\n\n/** Apply or restore one local knowledge candidate through the shared activation contract. */\nexport function createKnowledgeImprovementActivationExecutor(\n options: CreateKnowledgeImprovementActivationExecutorOptions,\n): KnowledgeImprovementActivationExecutor {\n if (!options.identity.trim()) throw new Error('knowledge activation identity is required')\n return {\n reconcile: async (transition) => {\n const inspected = await inspectKnowledgeActivation(options, transition)\n return inspected.settled ? inspected.result : undefined\n },\n transition: async (transition) => {\n if (transition.expired) {\n throw new Error('knowledge write transition cannot run after authorization expires')\n }\n const inspected = await inspectKnowledgeActivation(options, transition)\n if (inspected.settled) return inspected.result\n\n const mutationOptions = {\n root: options.root,\n candidate: inspected.candidate,\n activation: {\n activation: transition.activation,\n attemptedAt: transition.attemptedAt,\n identity: options.identity,\n createResult: (receipt: KnowledgeImprovementMutationReceipt) =>\n inspected.create(\n knowledgeMutationOutcome(receipt, inspected, transition.activation.intent),\n ),\n },\n ...(options.ownerId ? { ownerId: options.ownerId } : {}),\n ...(options.leaseTtlMs === undefined ? {} : { leaseTtlMs: options.leaseTtlMs }),\n ...(options.now ? { now: options.now } : {}),\n ...(options.onState ? { onState: options.onState } : {}),\n }\n const improvement =\n transition.activation.intent === 'activate-candidate'\n ? await promoteKnowledgeCandidate(mutationOptions)\n : await restoreKnowledgeCandidateBaseline(mutationOptions)\n if (!improvement.activationResult) {\n throw new Error('knowledge mutation did not persist its shared activation result')\n }\n return options.results.putIfAbsent(improvement.activationResult)\n },\n }\n}\n\ntype CreateKnowledgeActivation = (\n outcome: AgentImprovementActivationOutcome,\n) => AgentImprovementActivationResult\n\ntype InspectedKnowledgeActivation =\n | { settled: true; result: unknown | undefined }\n | {\n settled: false\n target: AgentImprovementActivationTransitionInput['targets'][number]\n candidate: PromoteKnowledgeCandidateOptions['candidate']\n expectedDigest: Sha256Digest\n desiredDigest: Sha256Digest\n create: CreateKnowledgeActivation\n }\n\nasync function inspectKnowledgeActivation(\n options: CreateKnowledgeImprovementActivationExecutorOptions,\n transition: AgentImprovementActivationTransitionInput,\n): Promise<InspectedKnowledgeActivation> {\n const stored = await options.results.load(transition.activation.digest)\n if (stored !== undefined) return { settled: true, result: stored }\n\n const create: CreateKnowledgeActivation = (outcome) =>\n createAgentImprovementActivationResult(transition, {\n completedAt: completionTime(transition, options.now),\n outcome,\n })\n const store = (outcome: AgentImprovementActivationOutcome) =>\n options.results.putIfAbsent(create(outcome))\n if (transition.kind !== 'sealed-candidate') {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_PROFILE_TRANSITION_UNSUPPORTED',\n message: 'The knowledge adapter accepts only sealed knowledge candidates.',\n }),\n }\n }\n const target = supportedKnowledgeTarget(transition, options.identity)\n if (!target) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_TARGET_SET_UNSUPPORTED',\n message: 'The knowledge adapter requires exactly one matching knowledge target.',\n }),\n }\n }\n const knowledge = transition.candidateBundle.knowledge\n if (!knowledge) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_CANDIDATE_MISSING',\n message: 'The measured candidate bundle does not contain a knowledge candidate.',\n }),\n }\n }\n const candidate = fromAgentCandidateKnowledgeRef(knowledge.candidate)\n const expectedDigest =\n transition.activation.intent === 'activate-candidate'\n ? knowledge.candidate.baseHash\n : knowledge.candidate.candidateHash\n const desiredDigest =\n transition.activation.intent === 'activate-candidate'\n ? knowledge.candidate.candidateHash\n : knowledge.candidate.baseHash\n if (target.expectedBaseDigest !== expectedDigest || target.desiredDigest !== desiredDigest) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'failed',\n code: 'KNOWLEDGE_TARGET_MISMATCH',\n message: 'The activation target does not match the measured knowledge candidate.',\n }),\n }\n }\n\n const durable = await loadKnowledgeImprovementActivationResult({\n root: options.root,\n candidate,\n activation: transition.activation,\n identity: options.identity,\n })\n if (durable) {\n return {\n settled: true,\n result: await options.results.putIfAbsent(durable),\n }\n }\n if (transition.expired) return { settled: true, result: undefined }\n return { settled: false, target, candidate, expectedDigest, desiredDigest, create }\n}\n\nfunction supportedKnowledgeTarget(\n transition: AgentImprovementActivationTransitionInput,\n identity: string,\n): AgentImprovementActivationTransitionInput['targets'][number] | undefined {\n if (transition.targets.length !== 1) return undefined\n const target = transition.targets[0]\n return target.surface === 'knowledge' && target.identity === identity ? target : undefined\n}\n\nfunction knowledgeMutationOutcome(\n receipt: KnowledgeImprovementMutationReceipt,\n inspected: Extract<InspectedKnowledgeActivation, { settled: false }>,\n intent: AgentImprovementActivationTransitionInput['activation']['intent'],\n): AgentImprovementActivationOutcome {\n const expectedTarget = intent === 'activate-candidate' ? 'candidate' : 'baseline'\n const beforeDigest = prefixedDigest(receipt.beforeHash)\n const afterDigest = prefixedDigest(receipt.afterHash)\n if (\n receipt.target !== expectedTarget ||\n receipt.changed !== (beforeDigest !== afterDigest) ||\n (!receipt.changed && (receipt.transactionId !== null || receipt.recovered))\n ) {\n throw new Error('knowledge mutation returned inconsistent state evidence')\n }\n if (receipt.changed) {\n if (\n receipt.transactionId === null ||\n beforeDigest !== inspected.expectedDigest ||\n afterDigest !== inspected.desiredDigest\n ) {\n throw new Error('knowledge activation did not apply its authorized content transition')\n }\n return {\n status: 'applied',\n transactionId: receipt.transactionId,\n targets: [\n {\n surface: inspected.target.surface,\n identity: inspected.target.identity,\n beforeDigest,\n afterDigest,\n },\n ],\n }\n }\n if (afterDigest === inspected.desiredDigest) {\n return {\n status: 'already-applied',\n targets: [targetState(inspected.target, afterDigest)],\n }\n }\n if (afterDigest === inspected.expectedDigest) {\n throw new Error('knowledge activation did not attempt its authorized content transition')\n }\n return {\n status: 'conflict',\n targets: [targetState(inspected.target, afterDigest)],\n }\n}\n\nfunction targetState(target: AgentImprovementActivationTarget, currentDigest: Sha256Digest) {\n return {\n surface: target.surface,\n identity: target.identity,\n currentDigest,\n }\n}\n\nfunction prefixedDigest(hash: string): Sha256Digest {\n return sha256DigestSchema.parse(`sha256:${hash}`)\n}\n\nfunction completionTime(\n transition: AgentImprovementActivationTransitionInput,\n now: (() => Date) | undefined,\n): string {\n const completedAt = (now ?? (() => new Date()))().toISOString()\n return Date.parse(completedAt) < Date.parse(transition.attemptedAt)\n ? transition.attemptedAt\n : completedAt\n}\n","import type { RagKnowledgeUpdateResult } from '@tangle-network/agent-knowledge'\nimport { researcherProfile } from '../profiles/researcher'\nimport type { DeliverableSpec } from '../runtime/supervise/completion-gate'\nimport type { ExecutorConfig } from '../runtime/supervise/runtime'\nimport { type SuperviseOptions, supervise } from '../runtime/supervise/supervise'\nimport type { SupervisorProfile } from '../runtime/supervise/supervisor-agent'\nimport type { Budget, SupervisedResult } from '../runtime/supervise/types'\n\n/** Standing prompt for a supervisor that grows a shared knowledge base through spawned researchers. */\nexport const RESEARCH_SUPERVISOR_SYSTEM_PROMPT = [\n 'You are a research supervisor. You do not answer the research question yourself.',\n 'You create and manage researcher workers that improve one shared knowledge base until it is ready.',\n '',\n 'Each round:',\n '1. Read the goal and the gaps the readiness check still reports.',\n '2. Decompose the open work into independent sub-topics.',\n '3. Spawn one researcher per sub-topic; split by sub-topic, never duplicate work.',\n '4. Wait for researchers to settle, steer or re-spawn thin sub-topics, then stop when the check passes.',\n '',\n 'Conserve the shared budget. Prefer a small number of well-scoped researchers over a large fanout that re-covers the same ground.',\n].join('\\n')\n\nexport interface KnowledgeReadinessCheckInput {\n root: string\n goal: string\n readinessSpecs?: readonly unknown[]\n readinessTaskId?: string\n readiness?: unknown\n}\n\nexport type KnowledgeReadinessCheckResult =\n | boolean\n | {\n ready: boolean\n summary?: string\n metadata?: Record<string, unknown>\n }\n\nexport type KnowledgeReadinessCheck = (\n input: KnowledgeReadinessCheckInput,\n) => Promise<KnowledgeReadinessCheckResult> | KnowledgeReadinessCheckResult\n\nexport interface SupervisedKnowledgeUpdateInput {\n goal?: string\n root?: string\n candidateRoot?: string\n findings?: readonly unknown[]\n metadata?: Record<string, unknown>\n}\n\nexport interface SupervisedKnowledgeUpdateResult {\n applied: boolean\n summary: string\n supervised: SupervisedResult<unknown>\n metadata: NonNullable<RagKnowledgeUpdateResult['metadata']>\n}\n\nexport interface SupervisedKnowledgeUpdateOptions {\n root: string\n goal: string\n readiness: KnowledgeReadinessCheck\n readinessSpecs?: readonly unknown[]\n readinessTaskId?: string\n readinessOptions?: unknown\n findings?: readonly unknown[]\n metadata?: Record<string, unknown>\n budget: Budget\n backend?: ExecutorConfig\n makeWorkerAgent?: SuperviseOptions['makeWorkerAgent']\n harness?: string\n supervisorModel?: string\n supervisorSystemPrompt?: string\n superviseOptions?: Partial<\n Omit<\n SuperviseOptions,\n 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'\n >\n >\n allowedModels?: readonly string[]\n runSupervised?: (\n profile: SupervisorProfile,\n task: unknown,\n opts: SuperviseOptions,\n ) => Promise<SupervisedResult<unknown>>\n}\n\nexport type SupervisedKnowledgeUpdater = (\n input: SupervisedKnowledgeUpdateInput,\n) => Promise<SupervisedKnowledgeUpdateResult>\n\n/** Build the completion check a supervised KB update uses to stop only when the KB is ready. */\nexport function knowledgeReadinessDeliverable(\n options: Pick<\n SupervisedKnowledgeUpdateOptions,\n 'root' | 'goal' | 'readiness' | 'readinessSpecs' | 'readinessTaskId' | 'readinessOptions'\n >,\n): DeliverableSpec<unknown> {\n return {\n describe: `knowledge base at ${options.root} is ready for: ${options.goal}`,\n async check() {\n const result = await options.readiness({\n root: options.root,\n goal: options.goal,\n readinessSpecs: options.readinessSpecs,\n readinessTaskId: options.readinessTaskId,\n readiness: options.readinessOptions,\n })\n return typeof result === 'boolean' ? result : result.ready\n },\n }\n}\n\n/** Create an `improveKnowledgeBase` update callback backed by runtime supervision. */\nexport function createSupervisedKnowledgeUpdater(\n options: SupervisedKnowledgeUpdateOptions,\n): SupervisedKnowledgeUpdater {\n return (input) =>\n runSupervisedKnowledgeUpdate({\n ...options,\n root: input.candidateRoot ?? input.root ?? options.root,\n goal: input.goal ?? options.goal,\n findings: input.findings ?? options.findings,\n metadata: { ...options.metadata, ...input.metadata },\n })\n}\n\n/** Run a runtime supervisor that updates one candidate knowledge base and stops on readiness. */\nexport async function runSupervisedKnowledgeUpdate(\n options: SupervisedKnowledgeUpdateOptions,\n): Promise<SupervisedKnowledgeUpdateResult> {\n const { profile: workerProfile } = researcherProfile({ harness: options.harness })\n const baseInstructions = options.supervisorSystemPrompt ?? RESEARCH_SUPERVISOR_SYSTEM_PROMPT\n const workerContract = workerProfile.prompt?.systemPrompt\n const systemPrompt = workerContract\n ? `${baseInstructions}\\n\\nEach researcher worker you spawn follows this contract:\\n${workerContract}`\n : baseInstructions\n\n const profile: SupervisorProfile = {\n name: 'knowledge-research-supervisor',\n ...(options.supervisorModel ? { model: { default: options.supervisorModel } } : {}),\n prompt: { systemPrompt },\n }\n const run = options.runSupervised ?? supervise\n const task = formatSupervisedKnowledgeTask(options)\n const supervised = await run(profile, task, {\n ...options.superviseOptions,\n budget: options.budget,\n backend: options.backend,\n deliverable: knowledgeReadinessDeliverable(options),\n makeWorkerAgent: options.makeWorkerAgent,\n allowedModels: options.allowedModels,\n })\n return {\n applied: supervised.kind === 'winner',\n summary:\n supervised.kind === 'winner'\n ? 'research supervisor completed and the knowledge base passed readiness'\n : `research supervisor stopped without a ready knowledge base: ${supervised.reason}`,\n supervised,\n metadata: {\n supervised: true,\n root: options.root,\n goal: options.goal,\n result: supervised.kind,\n },\n }\n}\n\n/** Format the supervisor task with the KB root, readiness requirements, current findings, and metadata. */\nexport function formatSupervisedKnowledgeTask(\n options: Pick<\n SupervisedKnowledgeUpdateOptions,\n 'root' | 'goal' | 'readinessSpecs' | 'readinessTaskId' | 'findings' | 'metadata'\n >,\n): string {\n const sections = [\n `Goal: ${options.goal}`,\n `Knowledge base root: ${options.root}`,\n options.readinessTaskId ? `Readiness task id: ${options.readinessTaskId}` : undefined,\n options.readinessSpecs?.length\n ? `Readiness specs:\\n${JSON.stringify(options.readinessSpecs, null, 2)}`\n : undefined,\n options.findings?.length\n ? `Current findings:\\n${JSON.stringify(options.findings, null, 2)}`\n : undefined,\n options.metadata && Object.keys(options.metadata).length > 0\n ? `Metadata:\\n${JSON.stringify(options.metadata, null, 2)}`\n : undefined,\n ].filter((section): section is string => Boolean(section))\n return `${sections.join('\\n\\n')}\\n\\nUpdate files under the knowledge base root only. Stop when the readiness check passes.`\n}\n","import { realpath } from 'node:fs/promises'\nimport {\n type AgentCandidateBundle,\n type AgentCandidateCapturedArtifact,\n type AgentCandidateKnowledge,\n agentCandidateKnowledgeSchema,\n} from '@tangle-network/agent-interface'\nimport {\n type BuildEvalKnowledgeBundleOptions,\n evaluateKnowledgeBaseReadiness,\n improveKnowledgeBase,\n type KnowledgeBaseQualityOptions,\n type KnowledgeImprovementOptions,\n type KnowledgeImprovementResult,\n type KnowledgeReadinessSpec,\n knowledgeImprovementCandidateRef,\n toAgentCandidateKnowledgeRef,\n withKnowledgeImprovementComparison,\n} from '@tangle-network/agent-knowledge'\nimport { sealAgentCandidateBundle } from '../candidate-execution/bundle'\nimport {\n canonicalCandidateBytes,\n embeddedCandidateArtifact,\n omitTopLevelDigest,\n} from '../candidate-execution/digest'\nimport { persistCandidateOutputArtifact } from '../candidate-execution/output-artifacts'\nimport type { AgentCandidateOutputArtifactPort } from '../candidate-execution/types'\nimport { captureAgentCandidateWorkspace } from '../candidate-execution/workspace-archive'\nimport type { ExecutorConfig } from '../runtime/supervise/runtime'\nimport type { SuperviseOptions } from '../runtime/supervise/supervise'\nimport type { SupervisorProfile } from '../runtime/supervise/supervisor-agent'\nimport type { Budget, SupervisedResult } from '../runtime/supervise/types'\nimport {\n createSupervisedKnowledgeUpdater,\n type KnowledgeReadinessCheck,\n type KnowledgeReadinessCheckResult,\n type SupervisedKnowledgeUpdateOptions,\n} from './supervised-update'\n\nexport interface RunKnowledgeImprovementJobOptions\n extends Omit<KnowledgeImprovementOptions, 'updateKnowledge'> {\n budget: Budget\n readinessCheck?: KnowledgeReadinessCheck\n backend?: ExecutorConfig\n makeWorkerAgent?: SuperviseOptions['makeWorkerAgent']\n harness?: string\n supervisorModel?: string\n supervisorSystemPrompt?: string\n superviseOptions?: Partial<\n Omit<\n SuperviseOptions,\n 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'\n >\n >\n allowedModels?: readonly string[]\n runSupervised?: (\n profile: SupervisorProfile,\n task: unknown,\n opts: SuperviseOptions,\n ) => Promise<SupervisedResult<unknown>>\n candidateArtifacts?: AgentCandidateOutputArtifactPort\n onMeasurement?: (measurement: KnowledgeImprovementJobMeasurement) => Promise<void> | void\n}\n\nexport interface KnowledgeImprovementJobMeasurement {\n startedAt: string\n finishedAt: string\n durationMs: number\n updateCalls: number\n updateDurationMs: number\n supervisedSpent: {\n iterations: number\n inputTokens: number\n outputTokens: number\n usdKnown: boolean\n usd: number\n ms: number\n }\n}\n\nexport interface KnowledgeImprovementJobResult {\n improvement: KnowledgeImprovementResult\n knowledge?: KnowledgeImprovementCandidatePair\n measurement: KnowledgeImprovementJobMeasurement\n blocked: boolean\n}\n\nexport interface KnowledgeImprovementCandidatePair {\n reference: AgentCandidateKnowledge['candidate']\n evaluation: AgentCandidateCapturedArtifact\n baseline: AgentCandidateKnowledge['snapshot']\n candidate: AgentCandidateKnowledge['snapshot']\n}\n\nexport interface KnowledgeImprovementExperimentBundles {\n baseline: AgentCandidateBundle\n candidate: AgentCandidateBundle\n}\n\nexport interface AgentKnowledgeReadinessCheckOptions {\n goal: string\n readinessSpecs?: readonly KnowledgeReadinessSpec[]\n readinessTaskId?: string\n readiness?: Omit<BuildEvalKnowledgeBundleOptions, 'taskId' | 'index' | 'specs'>\n strict?: boolean\n kbQuality?: KnowledgeBaseQualityOptions\n}\n\n/** Build the default readiness check backed by `@tangle-network/agent-knowledge` validation and scoring. */\nexport function createAgentKnowledgeReadinessCheck(\n options: AgentKnowledgeReadinessCheckOptions,\n): KnowledgeReadinessCheck {\n return async (input): Promise<KnowledgeReadinessCheckResult> => {\n const readiness = await evaluateKnowledgeBaseReadiness({\n root: input.root,\n goal: input.goal ?? options.goal,\n readinessSpecs:\n (input.readinessSpecs as readonly KnowledgeReadinessSpec[] | undefined) ??\n options.readinessSpecs,\n readinessTaskId: input.readinessTaskId ?? options.readinessTaskId,\n readiness:\n (input.readiness as AgentKnowledgeReadinessCheckOptions['readiness'] | undefined) ??\n options.readiness,\n strict: options.strict,\n kbQuality: options.kbQuality,\n })\n return {\n ready: readiness.ready,\n summary: readiness.summary,\n metadata: {\n dimensions: readiness.dimensions,\n validationOk: readiness.validation.ok,\n kbQualityOk: readiness.kbQuality.ok,\n blockingMissing: readiness.readiness?.report.blockingMissingRequirements.length ?? 0,\n },\n }\n }\n}\n\n/** Produce a frozen KB candidate while leaving live knowledge content unchanged. */\nexport async function runKnowledgeImprovementJob(\n options: RunKnowledgeImprovementJobOptions,\n): Promise<KnowledgeImprovementJobResult> {\n const {\n allowedModels,\n backend,\n budget,\n candidateArtifacts,\n harness,\n makeWorkerAgent,\n onMeasurement,\n readinessCheck,\n runSupervised,\n supervisorModel,\n supervisorSystemPrompt,\n superviseOptions,\n ...knowledgeOptions\n } = options\n const startedAtMs = Date.now()\n const startedAt = new Date(startedAtMs).toISOString()\n const supervisedSpent = emptySpent()\n let updateCalls = 0\n let updateDurationMs = 0\n\n const readiness = readinessCheck ?? createAgentKnowledgeReadinessCheck(options)\n const updateKnowledge = createSupervisedKnowledgeUpdater({\n root: options.root,\n goal: options.goal,\n readiness,\n readinessSpecs: options.readinessSpecs,\n readinessTaskId: options.readinessTaskId,\n readinessOptions: options.readiness,\n budget,\n backend,\n makeWorkerAgent,\n harness,\n supervisorModel,\n supervisorSystemPrompt,\n superviseOptions,\n allowedModels,\n runSupervised,\n } satisfies SupervisedKnowledgeUpdateOptions)\n\n const instrumentedUpdateKnowledge: KnowledgeImprovementOptions['updateKnowledge'] = async (\n input,\n ) => {\n const updateStartedAt = Date.now()\n updateCalls += 1\n const result = await updateKnowledge(input)\n updateDurationMs += Date.now() - updateStartedAt\n addSpent(supervisedSpent, result.supervised)\n return result\n }\n const resolvedImprovement = await improveKnowledgeBase({\n ...knowledgeOptions,\n updateKnowledge: instrumentedUpdateKnowledge,\n })\n let knowledge: KnowledgeImprovementCandidatePair | undefined\n if (\n resolvedImprovement.candidate?.status === 'candidate-ready' ||\n resolvedImprovement.candidate?.status === 'promoted'\n ) {\n knowledge = await freezeKnowledgeCandidatePair(\n options.root,\n resolvedImprovement,\n candidateArtifacts,\n knowledgeOptions.signal,\n )\n }\n const finishedAtMs = Date.now()\n const measurement: KnowledgeImprovementJobMeasurement = {\n startedAt,\n finishedAt: new Date(finishedAtMs).toISOString(),\n durationMs: finishedAtMs - startedAtMs,\n updateCalls,\n updateDurationMs,\n supervisedSpent,\n }\n await onMeasurement?.(measurement)\n return {\n improvement: resolvedImprovement,\n ...(knowledge ? { knowledge } : {}),\n measurement,\n blocked: resolvedImprovement.blocked,\n }\n}\n\n/** Attach both frozen knowledge inputs to one otherwise-identical bundle pair. */\nexport function buildKnowledgeImprovementExperimentBundles(\n bundle: AgentCandidateBundle,\n knowledge: KnowledgeImprovementCandidatePair,\n): KnowledgeImprovementExperimentBundles {\n const input = omitTopLevelDigest(bundle)\n const withSnapshot = (snapshot: AgentCandidateKnowledge['snapshot']) =>\n agentCandidateKnowledgeSchema.parse({\n candidate: knowledge.reference,\n snapshot,\n evaluation: knowledge.evaluation,\n })\n return Object.freeze({\n baseline: sealAgentCandidateBundle({ ...input, knowledge: withSnapshot(knowledge.baseline) }),\n candidate: sealAgentCandidateBundle({ ...input, knowledge: withSnapshot(knowledge.candidate) }),\n })\n}\n\nasync function freezeKnowledgeCandidatePair(\n root: string,\n improvement: KnowledgeImprovementResult,\n artifacts: AgentCandidateOutputArtifactPort | undefined,\n signal: AbortSignal | undefined,\n): Promise<KnowledgeImprovementCandidatePair> {\n const candidate = knowledgeImprovementCandidateRef(improvement)\n const candidateRef = toAgentCandidateKnowledgeRef(candidate)\n return withKnowledgeImprovementComparison({ root, candidate }, async (comparison) => {\n const freeze = async (\n target: 'baseline' | 'candidate',\n ): Promise<AgentCandidateKnowledge['snapshot']> => {\n const executionId = `knowledge-${candidate.candidateId}-${target}`\n const captured = await captureAgentCandidateWorkspace(\n await realpath(comparison[target].root),\n {\n ...(artifacts\n ? {\n artifactPersistence: {\n executionId,\n outputArtifacts: artifacts,\n ...(signal ? { signal } : {}),\n },\n }\n : {}),\n },\n )\n return captured.snapshot\n }\n const evaluation = await captureKnowledgeEvidence(\n canonicalCandidateBytes({\n kind: 'agent-knowledge-candidate-evaluation',\n candidate: candidateRef,\n metric: comparison.evaluation,\n }),\n 'knowledge-evaluation',\n `knowledge-${candidate.candidateId}`,\n artifacts,\n signal,\n )\n const baseline = await freeze('baseline')\n const proposed = await freeze('candidate')\n return Object.freeze({\n reference: candidateRef,\n evaluation,\n baseline,\n candidate: proposed,\n })\n })\n}\n\nasync function captureKnowledgeEvidence(\n bytes: Uint8Array,\n purpose: 'knowledge-evaluation',\n executionId: string,\n artifacts: AgentCandidateOutputArtifactPort | undefined,\n signal: AbortSignal | undefined,\n): Promise<AgentCandidateCapturedArtifact> {\n if (!artifacts) return embeddedCandidateArtifact(bytes)\n return persistCandidateOutputArtifact(artifacts, {\n executionId,\n purpose,\n bytes,\n ...(signal ? { signal } : {}),\n })\n}\n\nfunction emptySpent(): KnowledgeImprovementJobMeasurement['supervisedSpent'] {\n return { iterations: 0, inputTokens: 0, outputTokens: 0, usdKnown: true, usd: 0, ms: 0 }\n}\n\nfunction addSpent(\n target: KnowledgeImprovementJobMeasurement['supervisedSpent'],\n result: SupervisedResult<unknown>,\n): void {\n const spent = result.spentTotal\n target.iterations += spent.iterations\n target.inputTokens += spent.tokens.input\n target.outputTokens += spent.tokens.output\n target.usdKnown = target.usdKnown && spent.usdKnown !== false\n target.usd += spent.usd\n target.ms += spent.ms\n}\n"],"mappings":";;;;;;;;;;AAqCA,SAAgB,6CACd,SACwC;CACxC,IAAI,CAAC,QAAQ,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,2CAA2C;CACzF,OAAO;EACL,WAAW,OAAO,eAAe;GAC/B,MAAM,YAAY,MAAM,2BAA2B,SAAS,UAAU;GACtE,OAAO,UAAU,UAAU,UAAU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;AACH;AAEA,eAAe,yBACb,OACA,SACA,aACA,WACA,QACyC;CACzC,IAAI,CAAC,WAAW,OAAO,0BAA0B,KAAK;CACtD,OAAO,+BAA+B,WAAW;EAC/C;EACA;EACA;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;AACH;AAEA,SAAS,aAAoE;CAC3E,OAAO;EAAE,YAAY;EAAG,aAAa;EAAG,cAAc;EAAG,UAAU;EAAM,KAAK;EAAG,IAAI;CAAE;AACzF;AAEA,SAAS,SACP,QACA,QACM;CACN,MAAM,QAAQ,OAAO;CACrB,OAAO,cAAc,MAAM;CAC3B,OAAO,eAAe,MAAM,OAAO;CACnC,OAAO,gBAAgB,MAAM,OAAO;CACpC,OAAO,WAAW,OAAO,YAAY,MAAM,aAAa;CACxD,OAAO,OAAO,MAAM;CACpB,OAAO,MAAM,MAAM;AACrB"}
1
+ {"version":3,"file":"knowledge-I1e9zQGj.js","names":[],"sources":["../src/knowledge/activation.ts","../src/knowledge/supervised-update.ts","../src/knowledge/improvement-job.ts"],"sourcesContent":["import type {\n AgentImprovementActivationOutcome,\n AgentImprovementActivationResult,\n AgentImprovementActivationTarget,\n Sha256Digest,\n} from '@tangle-network/agent-interface'\nimport { sha256DigestSchema } from '@tangle-network/agent-interface'\nimport {\n fromAgentCandidateKnowledgeRef,\n type KnowledgeImprovementMutationReceipt,\n loadKnowledgeImprovementActivationResult,\n type PromoteKnowledgeCandidateOptions,\n promoteKnowledgeCandidate,\n restoreKnowledgeCandidateBaseline,\n} from '@tangle-network/agent-knowledge'\n\nimport {\n type AgentImprovementActivationReconciliation,\n type AgentImprovementActivationResultStore,\n type AgentImprovementActivationTransition,\n type AgentImprovementActivationTransitionInput,\n createAgentImprovementActivationResult,\n} from '../intelligence/activation'\n\nexport interface CreateKnowledgeImprovementActivationExecutorOptions\n extends Omit<PromoteKnowledgeCandidateOptions, 'root' | 'candidate'> {\n root: string\n identity: string\n results: AgentImprovementActivationResultStore\n}\n\nexport interface KnowledgeImprovementActivationExecutor {\n transition: AgentImprovementActivationTransition\n reconcile: AgentImprovementActivationReconciliation\n}\n\n/** Apply or restore one local knowledge candidate through the shared activation contract. */\nexport function createKnowledgeImprovementActivationExecutor(\n options: CreateKnowledgeImprovementActivationExecutorOptions,\n): KnowledgeImprovementActivationExecutor {\n if (!options.identity.trim()) throw new Error('knowledge activation identity is required')\n return {\n reconcile: async (transition) => {\n const inspected = await inspectKnowledgeActivation(options, transition)\n return inspected.settled ? inspected.result : undefined\n },\n transition: async (transition) => {\n if (transition.expired) {\n throw new Error('knowledge write transition cannot run after authorization expires')\n }\n const inspected = await inspectKnowledgeActivation(options, transition)\n if (inspected.settled) return inspected.result\n\n const mutationOptions = {\n root: options.root,\n candidate: inspected.candidate,\n activation: {\n activation: transition.activation,\n attemptedAt: transition.attemptedAt,\n identity: options.identity,\n createResult: (receipt: KnowledgeImprovementMutationReceipt) =>\n inspected.create(\n knowledgeMutationOutcome(receipt, inspected, transition.activation.intent),\n ),\n },\n ...(options.ownerId ? { ownerId: options.ownerId } : {}),\n ...(options.leaseTtlMs === undefined ? {} : { leaseTtlMs: options.leaseTtlMs }),\n ...(options.now ? { now: options.now } : {}),\n ...(options.onState ? { onState: options.onState } : {}),\n }\n const improvement =\n transition.activation.intent === 'activate-candidate'\n ? await promoteKnowledgeCandidate(mutationOptions)\n : await restoreKnowledgeCandidateBaseline(mutationOptions)\n if (!improvement.activationResult) {\n throw new Error('knowledge mutation did not persist its shared activation result')\n }\n return options.results.putIfAbsent(improvement.activationResult)\n },\n }\n}\n\ntype CreateKnowledgeActivation = (\n outcome: AgentImprovementActivationOutcome,\n) => AgentImprovementActivationResult\n\ntype InspectedKnowledgeActivation =\n | { settled: true; result: unknown | undefined }\n | {\n settled: false\n target: AgentImprovementActivationTransitionInput['targets'][number]\n candidate: PromoteKnowledgeCandidateOptions['candidate']\n expectedDigest: Sha256Digest\n desiredDigest: Sha256Digest\n create: CreateKnowledgeActivation\n }\n\nasync function inspectKnowledgeActivation(\n options: CreateKnowledgeImprovementActivationExecutorOptions,\n transition: AgentImprovementActivationTransitionInput,\n): Promise<InspectedKnowledgeActivation> {\n const stored = await options.results.load(transition.activation.digest)\n if (stored !== undefined) return { settled: true, result: stored }\n\n const create: CreateKnowledgeActivation = (outcome) =>\n createAgentImprovementActivationResult(transition, {\n completedAt: completionTime(transition, options.now),\n outcome,\n })\n const store = (outcome: AgentImprovementActivationOutcome) =>\n options.results.putIfAbsent(create(outcome))\n if (transition.kind !== 'sealed-candidate') {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_PROFILE_TRANSITION_UNSUPPORTED',\n message: 'The knowledge adapter accepts only sealed knowledge candidates.',\n }),\n }\n }\n const target = supportedKnowledgeTarget(transition, options.identity)\n if (!target) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_TARGET_SET_UNSUPPORTED',\n message: 'The knowledge adapter requires exactly one matching knowledge target.',\n }),\n }\n }\n const knowledge = transition.candidateBundle.knowledge\n if (!knowledge) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'unsupported',\n code: 'KNOWLEDGE_CANDIDATE_MISSING',\n message: 'The measured candidate bundle does not contain a knowledge candidate.',\n }),\n }\n }\n const candidate = fromAgentCandidateKnowledgeRef(knowledge.candidate)\n const expectedDigest =\n transition.activation.intent === 'activate-candidate'\n ? knowledge.candidate.baseHash\n : knowledge.candidate.candidateHash\n const desiredDigest =\n transition.activation.intent === 'activate-candidate'\n ? knowledge.candidate.candidateHash\n : knowledge.candidate.baseHash\n if (target.expectedBaseDigest !== expectedDigest || target.desiredDigest !== desiredDigest) {\n if (transition.expired) return { settled: true, result: undefined }\n return {\n settled: true,\n result: await store({\n status: 'failed',\n code: 'KNOWLEDGE_TARGET_MISMATCH',\n message: 'The activation target does not match the measured knowledge candidate.',\n }),\n }\n }\n\n const durable = await loadKnowledgeImprovementActivationResult({\n root: options.root,\n candidate,\n activation: transition.activation,\n identity: options.identity,\n })\n if (durable) {\n return {\n settled: true,\n result: await options.results.putIfAbsent(durable),\n }\n }\n if (transition.expired) return { settled: true, result: undefined }\n return { settled: false, target, candidate, expectedDigest, desiredDigest, create }\n}\n\nfunction supportedKnowledgeTarget(\n transition: AgentImprovementActivationTransitionInput,\n identity: string,\n): AgentImprovementActivationTransitionInput['targets'][number] | undefined {\n if (transition.targets.length !== 1) return undefined\n const target = transition.targets[0]\n return target.surface === 'knowledge' && target.identity === identity ? target : undefined\n}\n\nfunction knowledgeMutationOutcome(\n receipt: KnowledgeImprovementMutationReceipt,\n inspected: Extract<InspectedKnowledgeActivation, { settled: false }>,\n intent: AgentImprovementActivationTransitionInput['activation']['intent'],\n): AgentImprovementActivationOutcome {\n const expectedTarget = intent === 'activate-candidate' ? 'candidate' : 'baseline'\n const beforeDigest = prefixedDigest(receipt.beforeHash)\n const afterDigest = prefixedDigest(receipt.afterHash)\n if (\n receipt.target !== expectedTarget ||\n receipt.changed !== (beforeDigest !== afterDigest) ||\n (!receipt.changed && (receipt.transactionId !== null || receipt.recovered))\n ) {\n throw new Error('knowledge mutation returned inconsistent state evidence')\n }\n if (receipt.changed) {\n if (\n receipt.transactionId === null ||\n beforeDigest !== inspected.expectedDigest ||\n afterDigest !== inspected.desiredDigest\n ) {\n throw new Error('knowledge activation did not apply its authorized content transition')\n }\n return {\n status: 'applied',\n transactionId: receipt.transactionId,\n targets: [\n {\n surface: inspected.target.surface,\n identity: inspected.target.identity,\n beforeDigest,\n afterDigest,\n },\n ],\n }\n }\n if (afterDigest === inspected.desiredDigest) {\n return {\n status: 'already-applied',\n targets: [targetState(inspected.target, afterDigest)],\n }\n }\n if (afterDigest === inspected.expectedDigest) {\n throw new Error('knowledge activation did not attempt its authorized content transition')\n }\n return {\n status: 'conflict',\n targets: [targetState(inspected.target, afterDigest)],\n }\n}\n\nfunction targetState(target: AgentImprovementActivationTarget, currentDigest: Sha256Digest) {\n return {\n surface: target.surface,\n identity: target.identity,\n currentDigest,\n }\n}\n\nfunction prefixedDigest(hash: string): Sha256Digest {\n return sha256DigestSchema.parse(`sha256:${hash}`)\n}\n\nfunction completionTime(\n transition: AgentImprovementActivationTransitionInput,\n now: (() => Date) | undefined,\n): string {\n const completedAt = (now ?? (() => new Date()))().toISOString()\n return Date.parse(completedAt) < Date.parse(transition.attemptedAt)\n ? transition.attemptedAt\n : completedAt\n}\n","import type { RagKnowledgeUpdateResult } from '@tangle-network/agent-knowledge'\nimport { researcherProfile } from '../profiles/researcher'\nimport type { DeliverableSpec } from '../runtime/supervise/completion-gate'\nimport type { ExecutorConfig } from '../runtime/supervise/runtime'\nimport { type SuperviseOptions, supervise } from '../runtime/supervise/supervise'\nimport type { SupervisorProfile } from '../runtime/supervise/supervisor-agent'\nimport type { Budget, SupervisedResult } from '../runtime/supervise/types'\n\n/** Standing prompt for a supervisor that grows a shared knowledge base through spawned researchers. */\nexport const RESEARCH_SUPERVISOR_SYSTEM_PROMPT = [\n 'You are a research supervisor. You do not answer the research question yourself.',\n 'You create and manage researcher workers that improve one shared knowledge base until it is ready.',\n '',\n 'Each round:',\n '1. Read the goal and the gaps the readiness check still reports.',\n '2. Decompose the open work into independent sub-topics.',\n '3. Spawn one researcher per sub-topic; split by sub-topic, never duplicate work.',\n '4. Wait for researchers to settle, steer or re-spawn thin sub-topics, then stop when the check passes.',\n '',\n 'Conserve the shared budget. Prefer a small number of well-scoped researchers over a large fanout that re-covers the same ground.',\n].join('\\n')\n\nexport interface KnowledgeReadinessCheckInput {\n root: string\n goal: string\n readinessSpecs?: readonly unknown[]\n readinessTaskId?: string\n readiness?: unknown\n}\n\nexport type KnowledgeReadinessCheckResult =\n | boolean\n | {\n ready: boolean\n summary?: string\n metadata?: Record<string, unknown>\n }\n\nexport type KnowledgeReadinessCheck = (\n input: KnowledgeReadinessCheckInput,\n) => Promise<KnowledgeReadinessCheckResult> | KnowledgeReadinessCheckResult\n\nexport interface SupervisedKnowledgeUpdateInput {\n goal?: string\n root?: string\n candidateRoot?: string\n findings?: readonly unknown[]\n metadata?: Record<string, unknown>\n}\n\nexport interface SupervisedKnowledgeUpdateResult {\n applied: boolean\n summary: string\n supervised: SupervisedResult<unknown>\n metadata: NonNullable<RagKnowledgeUpdateResult['metadata']>\n}\n\nexport interface SupervisedKnowledgeUpdateOptions {\n root: string\n goal: string\n readiness: KnowledgeReadinessCheck\n readinessSpecs?: readonly unknown[]\n readinessTaskId?: string\n readinessOptions?: unknown\n findings?: readonly unknown[]\n metadata?: Record<string, unknown>\n budget: Budget\n backend?: ExecutorConfig\n makeWorkerAgent?: SuperviseOptions['makeWorkerAgent']\n harness?: string\n supervisorModel?: string\n supervisorSystemPrompt?: string\n superviseOptions?: Partial<\n Omit<\n SuperviseOptions,\n 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'\n >\n >\n allowedModels?: readonly string[]\n runSupervised?: (\n profile: SupervisorProfile,\n task: unknown,\n opts: SuperviseOptions,\n ) => Promise<SupervisedResult<unknown>>\n}\n\nexport type SupervisedKnowledgeUpdater = (\n input: SupervisedKnowledgeUpdateInput,\n) => Promise<SupervisedKnowledgeUpdateResult>\n\n/** Build the completion check a supervised KB update uses to stop only when the KB is ready. */\nexport function knowledgeReadinessDeliverable(\n options: Pick<\n SupervisedKnowledgeUpdateOptions,\n 'root' | 'goal' | 'readiness' | 'readinessSpecs' | 'readinessTaskId' | 'readinessOptions'\n >,\n): DeliverableSpec<unknown> {\n return {\n describe: `knowledge base at ${options.root} is ready for: ${options.goal}`,\n async check() {\n const result = await options.readiness({\n root: options.root,\n goal: options.goal,\n readinessSpecs: options.readinessSpecs,\n readinessTaskId: options.readinessTaskId,\n readiness: options.readinessOptions,\n })\n return typeof result === 'boolean' ? result : result.ready\n },\n }\n}\n\n/** Create an `improveKnowledgeBase` update callback backed by runtime supervision. */\nexport function createSupervisedKnowledgeUpdater(\n options: SupervisedKnowledgeUpdateOptions,\n): SupervisedKnowledgeUpdater {\n return (input) =>\n runSupervisedKnowledgeUpdate({\n ...options,\n root: input.candidateRoot ?? input.root ?? options.root,\n goal: input.goal ?? options.goal,\n findings: input.findings ?? options.findings,\n metadata: { ...options.metadata, ...input.metadata },\n })\n}\n\n/** Run a runtime supervisor that updates one candidate knowledge base and stops on readiness. */\nexport async function runSupervisedKnowledgeUpdate(\n options: SupervisedKnowledgeUpdateOptions,\n): Promise<SupervisedKnowledgeUpdateResult> {\n const { profile: workerProfile } = researcherProfile({ harness: options.harness })\n const baseInstructions = options.supervisorSystemPrompt ?? RESEARCH_SUPERVISOR_SYSTEM_PROMPT\n const workerContract = workerProfile.prompt?.systemPrompt\n const systemPrompt = workerContract\n ? `${baseInstructions}\\n\\nEach researcher worker you spawn follows this contract:\\n${workerContract}`\n : baseInstructions\n\n const profile: SupervisorProfile = {\n name: 'knowledge-research-supervisor',\n ...(options.supervisorModel ? { model: { default: options.supervisorModel } } : {}),\n prompt: { systemPrompt },\n }\n const run = options.runSupervised ?? supervise\n const task = formatSupervisedKnowledgeTask(options)\n const supervised = await run(profile, task, {\n ...options.superviseOptions,\n budget: options.budget,\n backend: options.backend,\n deliverable: knowledgeReadinessDeliverable(options),\n makeWorkerAgent: options.makeWorkerAgent,\n allowedModels: options.allowedModels,\n })\n return {\n applied: supervised.kind === 'winner',\n summary:\n supervised.kind === 'winner'\n ? 'research supervisor completed and the knowledge base passed readiness'\n : `research supervisor stopped without a ready knowledge base: ${supervised.reason}`,\n supervised,\n metadata: {\n supervised: true,\n root: options.root,\n goal: options.goal,\n result: supervised.kind,\n },\n }\n}\n\n/** Format the supervisor task with the KB root, readiness requirements, current findings, and metadata. */\nexport function formatSupervisedKnowledgeTask(\n options: Pick<\n SupervisedKnowledgeUpdateOptions,\n 'root' | 'goal' | 'readinessSpecs' | 'readinessTaskId' | 'findings' | 'metadata'\n >,\n): string {\n const sections = [\n `Goal: ${options.goal}`,\n `Knowledge base root: ${options.root}`,\n options.readinessTaskId ? `Readiness task id: ${options.readinessTaskId}` : undefined,\n options.readinessSpecs?.length\n ? `Readiness specs:\\n${JSON.stringify(options.readinessSpecs, null, 2)}`\n : undefined,\n options.findings?.length\n ? `Current findings:\\n${JSON.stringify(options.findings, null, 2)}`\n : undefined,\n options.metadata && Object.keys(options.metadata).length > 0\n ? `Metadata:\\n${JSON.stringify(options.metadata, null, 2)}`\n : undefined,\n ].filter((section): section is string => Boolean(section))\n return `${sections.join('\\n\\n')}\\n\\nUpdate files under the knowledge base root only. Stop when the readiness check passes.`\n}\n","import { realpath } from 'node:fs/promises'\nimport {\n type AgentCandidateBundle,\n type AgentCandidateCapturedArtifact,\n type AgentCandidateKnowledge,\n agentCandidateKnowledgeSchema,\n} from '@tangle-network/agent-interface'\nimport {\n type BuildEvalKnowledgeBundleOptions,\n evaluateKnowledgeBaseReadiness,\n improveKnowledgeBase,\n type KnowledgeBaseQualityOptions,\n type KnowledgeImprovementOptions,\n type KnowledgeImprovementResult,\n type KnowledgeReadinessSpec,\n knowledgeImprovementCandidateRef,\n toAgentCandidateKnowledgeRef,\n withKnowledgeImprovementComparison,\n} from '@tangle-network/agent-knowledge'\nimport { sealAgentCandidateBundle } from '../candidate-execution/bundle'\nimport {\n canonicalCandidateBytes,\n embeddedCandidateArtifact,\n omitTopLevelDigest,\n} from '../candidate-execution/digest'\nimport { persistCandidateOutputArtifact } from '../candidate-execution/output-artifacts'\nimport type { AgentCandidateOutputArtifactPort } from '../candidate-execution/types'\nimport { captureAgentCandidateWorkspace } from '../candidate-execution/workspace-archive'\nimport type { ExecutorConfig } from '../runtime/supervise/runtime'\nimport type { SuperviseOptions } from '../runtime/supervise/supervise'\nimport type { SupervisorProfile } from '../runtime/supervise/supervisor-agent'\nimport type { Budget, SupervisedResult } from '../runtime/supervise/types'\nimport {\n createSupervisedKnowledgeUpdater,\n type KnowledgeReadinessCheck,\n type KnowledgeReadinessCheckResult,\n type SupervisedKnowledgeUpdateOptions,\n} from './supervised-update'\n\nexport interface RunKnowledgeImprovementJobOptions\n extends Omit<KnowledgeImprovementOptions, 'updateKnowledge'> {\n budget: Budget\n readinessCheck?: KnowledgeReadinessCheck\n backend?: ExecutorConfig\n makeWorkerAgent?: SuperviseOptions['makeWorkerAgent']\n harness?: string\n supervisorModel?: string\n supervisorSystemPrompt?: string\n superviseOptions?: Partial<\n Omit<\n SuperviseOptions,\n 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'\n >\n >\n allowedModels?: readonly string[]\n runSupervised?: (\n profile: SupervisorProfile,\n task: unknown,\n opts: SuperviseOptions,\n ) => Promise<SupervisedResult<unknown>>\n candidateArtifacts?: AgentCandidateOutputArtifactPort\n onMeasurement?: (measurement: KnowledgeImprovementJobMeasurement) => Promise<void> | void\n}\n\nexport interface KnowledgeImprovementJobMeasurement {\n startedAt: string\n finishedAt: string\n durationMs: number\n updateCalls: number\n updateDurationMs: number\n supervisedSpent: {\n iterations: number\n inputTokens: number\n outputTokens: number\n usdKnown: boolean\n usd: number\n ms: number\n }\n}\n\nexport interface KnowledgeImprovementJobResult {\n improvement: KnowledgeImprovementResult\n knowledge?: KnowledgeImprovementCandidatePair\n measurement: KnowledgeImprovementJobMeasurement\n blocked: boolean\n}\n\nexport interface KnowledgeImprovementCandidatePair {\n reference: AgentCandidateKnowledge['candidate']\n evaluation: AgentCandidateCapturedArtifact\n baseline: AgentCandidateKnowledge['snapshot']\n candidate: AgentCandidateKnowledge['snapshot']\n}\n\nexport interface KnowledgeImprovementExperimentBundles {\n baseline: AgentCandidateBundle\n candidate: AgentCandidateBundle\n}\n\nexport interface AgentKnowledgeReadinessCheckOptions {\n goal: string\n readinessSpecs?: readonly KnowledgeReadinessSpec[]\n readinessTaskId?: string\n readiness?: Omit<BuildEvalKnowledgeBundleOptions, 'taskId' | 'index' | 'specs'>\n strict?: boolean\n kbQuality?: KnowledgeBaseQualityOptions\n}\n\n/** Build the default readiness check backed by `@tangle-network/agent-knowledge` validation and scoring. */\nexport function createAgentKnowledgeReadinessCheck(\n options: AgentKnowledgeReadinessCheckOptions,\n): KnowledgeReadinessCheck {\n return async (input): Promise<KnowledgeReadinessCheckResult> => {\n const readiness = await evaluateKnowledgeBaseReadiness({\n root: input.root,\n goal: input.goal ?? options.goal,\n readinessSpecs:\n (input.readinessSpecs as readonly KnowledgeReadinessSpec[] | undefined) ??\n options.readinessSpecs,\n readinessTaskId: input.readinessTaskId ?? options.readinessTaskId,\n readiness:\n (input.readiness as AgentKnowledgeReadinessCheckOptions['readiness'] | undefined) ??\n options.readiness,\n strict: options.strict,\n kbQuality: options.kbQuality,\n })\n return {\n ready: readiness.ready,\n summary: readiness.summary,\n metadata: {\n dimensions: readiness.dimensions,\n validationOk: readiness.validation.ok,\n kbQualityOk: readiness.kbQuality.ok,\n blockingMissing: readiness.readiness?.report.blockingMissingRequirements.length ?? 0,\n },\n }\n }\n}\n\n/** Produce a frozen KB candidate while leaving live knowledge content unchanged. */\nexport async function runKnowledgeImprovementJob(\n options: RunKnowledgeImprovementJobOptions,\n): Promise<KnowledgeImprovementJobResult> {\n const {\n allowedModels,\n backend,\n budget,\n candidateArtifacts,\n harness,\n makeWorkerAgent,\n onMeasurement,\n readinessCheck,\n runSupervised,\n supervisorModel,\n supervisorSystemPrompt,\n superviseOptions,\n ...knowledgeOptions\n } = options\n const startedAtMs = Date.now()\n const startedAt = new Date(startedAtMs).toISOString()\n const supervisedSpent = emptySpent()\n let updateCalls = 0\n let updateDurationMs = 0\n\n const readiness = readinessCheck ?? createAgentKnowledgeReadinessCheck(options)\n const updateKnowledge = createSupervisedKnowledgeUpdater({\n root: options.root,\n goal: options.goal,\n readiness,\n readinessSpecs: options.readinessSpecs,\n readinessTaskId: options.readinessTaskId,\n readinessOptions: options.readiness,\n budget,\n backend,\n makeWorkerAgent,\n harness,\n supervisorModel,\n supervisorSystemPrompt,\n superviseOptions,\n allowedModels,\n runSupervised,\n } satisfies SupervisedKnowledgeUpdateOptions)\n\n const instrumentedUpdateKnowledge: KnowledgeImprovementOptions['updateKnowledge'] = async (\n input,\n ) => {\n const updateStartedAt = Date.now()\n updateCalls += 1\n const result = await updateKnowledge(input)\n updateDurationMs += Date.now() - updateStartedAt\n addSpent(supervisedSpent, result.supervised)\n return result\n }\n const resolvedImprovement = await improveKnowledgeBase({\n ...knowledgeOptions,\n updateKnowledge: instrumentedUpdateKnowledge,\n })\n let knowledge: KnowledgeImprovementCandidatePair | undefined\n if (\n resolvedImprovement.candidate?.status === 'candidate-ready' ||\n resolvedImprovement.candidate?.status === 'promoted'\n ) {\n knowledge = await freezeKnowledgeCandidatePair(\n options.root,\n resolvedImprovement,\n candidateArtifacts,\n knowledgeOptions.signal,\n )\n }\n const finishedAtMs = Date.now()\n const measurement: KnowledgeImprovementJobMeasurement = {\n startedAt,\n finishedAt: new Date(finishedAtMs).toISOString(),\n durationMs: finishedAtMs - startedAtMs,\n updateCalls,\n updateDurationMs,\n supervisedSpent,\n }\n await onMeasurement?.(measurement)\n return {\n improvement: resolvedImprovement,\n ...(knowledge ? { knowledge } : {}),\n measurement,\n blocked: resolvedImprovement.blocked,\n }\n}\n\n/** Attach both frozen knowledge inputs to one otherwise-identical bundle pair. */\nexport function buildKnowledgeImprovementExperimentBundles(\n bundle: AgentCandidateBundle,\n knowledge: KnowledgeImprovementCandidatePair,\n): KnowledgeImprovementExperimentBundles {\n const input = omitTopLevelDigest(bundle)\n const withSnapshot = (snapshot: AgentCandidateKnowledge['snapshot']) =>\n agentCandidateKnowledgeSchema.parse({\n candidate: knowledge.reference,\n snapshot,\n evaluation: knowledge.evaluation,\n })\n return Object.freeze({\n baseline: sealAgentCandidateBundle({ ...input, knowledge: withSnapshot(knowledge.baseline) }),\n candidate: sealAgentCandidateBundle({ ...input, knowledge: withSnapshot(knowledge.candidate) }),\n })\n}\n\nasync function freezeKnowledgeCandidatePair(\n root: string,\n improvement: KnowledgeImprovementResult,\n artifacts: AgentCandidateOutputArtifactPort | undefined,\n signal: AbortSignal | undefined,\n): Promise<KnowledgeImprovementCandidatePair> {\n const candidate = knowledgeImprovementCandidateRef(improvement)\n const candidateRef = toAgentCandidateKnowledgeRef(candidate)\n return withKnowledgeImprovementComparison({ root, candidate }, async (comparison) => {\n const freeze = async (\n target: 'baseline' | 'candidate',\n ): Promise<AgentCandidateKnowledge['snapshot']> => {\n const executionId = `knowledge-${candidate.candidateId}-${target}`\n const captured = await captureAgentCandidateWorkspace(\n await realpath(comparison[target].root),\n {\n ...(artifacts\n ? {\n artifactPersistence: {\n executionId,\n outputArtifacts: artifacts,\n ...(signal ? { signal } : {}),\n },\n }\n : {}),\n },\n )\n return captured.snapshot\n }\n const evaluation = await captureKnowledgeEvidence(\n canonicalCandidateBytes({\n kind: 'agent-knowledge-candidate-evaluation',\n candidate: candidateRef,\n metric: comparison.evaluation,\n }),\n 'knowledge-evaluation',\n `knowledge-${candidate.candidateId}`,\n artifacts,\n signal,\n )\n const baseline = await freeze('baseline')\n const proposed = await freeze('candidate')\n return Object.freeze({\n reference: candidateRef,\n evaluation,\n baseline,\n candidate: proposed,\n })\n })\n}\n\nasync function captureKnowledgeEvidence(\n bytes: Uint8Array,\n purpose: 'knowledge-evaluation',\n executionId: string,\n artifacts: AgentCandidateOutputArtifactPort | undefined,\n signal: AbortSignal | undefined,\n): Promise<AgentCandidateCapturedArtifact> {\n if (!artifacts) return embeddedCandidateArtifact(bytes)\n return persistCandidateOutputArtifact(artifacts, {\n executionId,\n purpose,\n bytes,\n ...(signal ? { signal } : {}),\n })\n}\n\nfunction emptySpent(): KnowledgeImprovementJobMeasurement['supervisedSpent'] {\n return { iterations: 0, inputTokens: 0, outputTokens: 0, usdKnown: true, usd: 0, ms: 0 }\n}\n\nfunction addSpent(\n target: KnowledgeImprovementJobMeasurement['supervisedSpent'],\n result: SupervisedResult<unknown>,\n): void {\n const spent = result.spentTotal\n target.iterations += spent.iterations\n target.inputTokens += spent.tokens.input\n target.outputTokens += spent.tokens.output\n target.usdKnown = target.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ClB;EACA,MAAM,aAAa,MAAM,yBACvB,wBAAwB;GACtB,MAAM;GACN,WAAW;GACX,QAAQ,WAAW;EACrB,CAAC,GACD,wBACA,aAAa,UAAU,eACvB,WACA,MACF;EACA,MAAM,WAAW,MAAM,OAAO,UAAU;EACxC,MAAM,WAAW,MAAM,OAAO,WAAW;EACzC,OAAO,OAAO,OAAO;GACnB,WAAW;GACX;GACA;GACA,WAAW;EACb,CAAC;CACH,CAAC;AACH;AAEA,eAAe,yBACb,OACA,SACA,aACA,WACA,QACyC;CACzC,IAAI,CAAC,WAAW,OAAO,0BAA0B,KAAK;CACtD,OAAO,+BAA+B,WAAW;EAC/C;EACA;EACA;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;AACH;AAEA,SAAS,aAAoE;CAC3E,OAAO;EAAE,YAAY;EAAG,aAAa;EAAG,cAAc;EAAG,UAAU;EAAM,KAAK;EAAG,IAAI;CAAE;AACzF;AAEA,SAAS,SACP,QACA,QACM;CACN,MAAM,QAAQ,OAAO;CACrB,OAAO,cAAc,MAAM;CAC3B,OAAO,eAAe,MAAM,OAAO;CACnC,OAAO,gBAAgB,MAAM,OAAO;CACpC,OAAO,WAAW,OAAO,YAAY,MAAM,aAAa;CACxD,OAAO,OAAO,MAAM;CACpB,OAAO,MAAM,MAAM;AACrB"}
@@ -1,2 +1,2 @@
1
- import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-BHSYaWrC.js";
1
+ import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-BLsKcxNd.js";
2
2
  export { type AgentKnowledgeReadinessCheckOptions, type CreateKnowledgeImprovementActivationExecutorOptions, type KnowledgeImprovementActivationExecutor, type KnowledgeImprovementCandidatePair, type KnowledgeImprovementExperimentBundles, type KnowledgeImprovementJobMeasurement, type KnowledgeImprovementJobResult, type KnowledgeReadinessCheck, type KnowledgeReadinessCheckInput, type KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, type RunKnowledgeImprovementJobOptions, type SupervisedKnowledgeUpdateInput, type SupervisedKnowledgeUpdateOptions, type SupervisedKnowledgeUpdateResult, type SupervisedKnowledgeUpdater, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate };
package/dist/knowledge.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-CDlrayRc.js";
1
+ import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-I1e9zQGj.js";
2
2
  export { RESEARCH_SUPERVISOR_SYSTEM_PROMPT, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate };
@@ -1,4 +1,4 @@
1
- import { AgentProfile } from "@tangle-network/agent-interface";
1
+ import { AgentProfile, HarnessType, ReasoningEffort } from "@tangle-network/agent-interface";
2
2
  import { ChildProcess } from "node:child_process";
3
3
  //#region src/runtime/tool-loop.d.ts
4
4
  /** Provider-neutral conversation record accepted by a tool-loop brain. */
@@ -286,8 +286,30 @@ declare function routerBrain(cfg: RouterConfig, opts?: {
286
286
  }): ToolLoopChat;
287
287
  //#endregion
288
288
  //#region src/mcp/local-harness.d.ts
289
- /** Local coding harness available inside the sandbox. */
290
- type LocalHarness = 'claude' | 'codex' | 'opencode';
289
+ /**
290
+ * Local coding harness available inside the sandbox — a narrowing of the shared `HarnessType`
291
+ * vocabulary, NOT a private spelling of it. The harness id is `claude-code`; `claude` is the
292
+ * EXECUTABLE name and lives only in the `command` field below. Keeping one vocabulary is what
293
+ * lets a `LocalHarness` be handed straight to the profile materializer and the capability table
294
+ * with no translation step.
295
+ */
296
+ type LocalHarness = Extract<HarnessType, 'claude-code' | 'codex' | 'opencode'>;
297
+ /** Every local harness, in table order — the one list `AGENT_RUNTIME_LOCAL_HARNESSES` and any
298
+ * other harness enumeration reads, so adding a row above is the only edit a new harness needs. */
299
+ declare const LOCAL_HARNESSES: ReadonlyArray<LocalHarness>;
300
+ /** The harness a caller gets when it expresses no preference. A composition-root default, not a
301
+ * capability claim: one constant so the several entry points cannot drift apart. */
302
+ declare const DEFAULT_LOCAL_HARNESS: LocalHarness;
303
+ /** The CLI binary a harness id runs. The two are NOT the same string (`claude-code` runs `claude`),
304
+ * so anything spawning a harness — a version probe, a login check — reads it from here rather than
305
+ * passing the harness id as a command. */
306
+ declare function localHarnessExecutable(harness: LocalHarness): string;
307
+ /**
308
+ * Whether the harness's native control can express this reasoning effort. Admission checks read
309
+ * this so a profile the invocation would later refuse is rejected BEFORE any workspace state is
310
+ * created, against the same table that emits the argv.
311
+ */
312
+ declare function harnessSupportsReasoningEffort(harness: LocalHarness, reasoningEffort: ReasoningEffort): boolean;
291
313
  /** @experimental */
292
314
  interface RunLocalHarnessOptions {
293
315
  harness: LocalHarness;
@@ -306,8 +328,8 @@ interface RunLocalHarnessOptions {
306
328
  command?: string;
307
329
  args: ReadonlyArray<string>;
308
330
  };
309
- /** Allow autonomous Claude edits without an interactive permission prompt.
310
- * Use only when `cwd` is an isolated candidate worktree. */
331
+ /** Allow autonomous edits without an interactive approval gate, using whichever bypass argv the
332
+ * harness declares. Use only when `cwd` is an isolated candidate worktree. */
311
333
  dangerouslySkipPermissions?: boolean;
312
334
  /** Isolate Codex from ambient configuration/instructions and require JSONL token usage.
313
335
  * The invocation should come from `harnessInvocation(..., { codexReproducible: true })`. */
@@ -439,5 +461,5 @@ declare function runLocalHarness(options: RunLocalHarnessOptions): Promise<Local
439
461
  /** Parse and validate the one terminal usage event emitted by `codex exec --json`. */
440
462
  declare function parseCodexTokenUsage(stdout: string): CodexTokenUsage;
441
463
  //#endregion
442
- export { ToolLoopMessageRecord as C, ToolLoopCompactionOptions as S, routerChatWithUsage as _, LocalHarnessResult as a, ToolLoopChat as b, runLocalHarness as c, RouterConfig as d, RouterToolCall as f, routerChatWithTools as g, routerBrain as h, LocalHarness as i, RouterChatResult as l, ToolSpec as m, CodexExecutionPolicy as n, RunLocalHarnessOptions as o, RouterToolLoopResult as p, CodexTokenUsage as r, parseCodexTokenUsage as s, CodexExecutionEvidence as t, RouterChatToolsResult as u, routerToolLoop as v, ToolLoopCompaction as x, streamRouterChatWithTools as y };
443
- //# sourceMappingURL=local-harness-t6cDWDQ2.d.ts.map
464
+ export { streamRouterChatWithTools as C, ToolLoopMessageRecord as D, ToolLoopCompactionOptions as E, routerToolLoop as S, ToolLoopCompaction as T, RouterToolLoopResult as _, LOCAL_HARNESSES as a, routerChatWithTools as b, RunLocalHarnessOptions as c, parseCodexTokenUsage as d, runLocalHarness as f, RouterToolCall as g, RouterConfig as h, DEFAULT_LOCAL_HARNESS as i, harnessSupportsReasoningEffort as l, RouterChatToolsResult as m, CodexExecutionPolicy as n, LocalHarness as o, RouterChatResult as p, CodexTokenUsage as r, LocalHarnessResult as s, CodexExecutionEvidence as t, localHarnessExecutable as u, ToolSpec as v, ToolLoopChat as w, routerChatWithUsage as x, routerBrain as y };
465
+ //# sourceMappingURL=local-harness-BIajef4A.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { d as RunAnalystLoopOpts, f as RunAnalystLoopResult } from "./types-zWfqDjeL.js";
2
- import { _ as WorktreeFanoutOptions, _s as WinnerStrategy, g as AuthoredHarness, zt as WorktreePatchArtifact } from "./index-DPWJxSRa.js";
3
- import { z as Budget } from "./environment-provider-CTZjdIUg.js";
2
+ import { Ht as WorktreePatchArtifact, _ as WorktreeFanoutOptions, bs as WinnerStrategy, g as AuthoredHarness } from "./index-CGADWaa_.js";
3
+ import { z as Budget } from "./environment-provider-Bh4nX2qt.js";
4
4
  import { n as FactCandidate, t as CreateKbGateOptions } from "./kb-gate-C8z2juK8.js";
5
5
  //#region src/loop-runner.d.ts
6
6
  /** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */
@@ -159,4 +159,4 @@ declare function parseLoopRunnerArgv(argv: string[]): {
159
159
  };
160
160
  //#endregion
161
161
  export { researchLoopRunner as _, DELEGATED_LOOP_MODES as a, DelegatedLoopResult as c, ResearchLoopRunnerOptions as d, RunDelegatedLoopOptions as f, isDelegatedLoopMode as g, auditLoopRunner as h, runLoopRunnerCli as i, DelegatedLoopRunner as l, WorktreeLoopRunnerOptions as m, LoopRunnerCliResult as n, DelegatedLoopMode as o, VetoedFact as p, parseLoopRunnerArgv as r, DelegatedLoopRegistry as s, LoopRunnerCliArgs as t, ResearchLoopResult as u, runDelegatedLoop as v, worktreeLoopRunner as y };
162
- //# sourceMappingURL=loop-runner-bin-oyL7it5O.d.ts.map
162
+ //# sourceMappingURL=loop-runner-bin-BeG9vTdE.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { i as ConfigError } from "./errors-DEAvWQPy.js";
2
- import { J as runPersonified, d as worktreeFanout, q as definePersona } from "./runtime-Ce39zfqn.js";
2
+ import { B as runPersonified, d as worktreeFanout, z as definePersona } from "./runtime-D4e3GP5K.js";
3
3
  import { t as runAnalystLoop } from "./analyst-loop-DvSciOfB.js";
4
- import { bt as createExecutorRegistry } from "./supervise-U7_K5yuV.js";
4
+ import { bt as createExecutorRegistry } from "./supervise-Cq50UT5-.js";
5
5
  import { t as createKbGate } from "./kb-gate-DpaSwXVx.js";
6
6
  //#region src/loop-runner.ts
7
7
  /**
@@ -265,4 +265,4 @@ if (invokedScript && /loop-runner-bin\.(js|ts|mjs)$/.test(invokedScript)) main()
265
265
  //#endregion
266
266
  export { isDelegatedLoopMode as a, worktreeLoopRunner as c, auditLoopRunner as i, runLoopRunnerCli as n, researchLoopRunner as o, DELEGATED_LOOP_MODES as r, runDelegatedLoop as s, parseLoopRunnerArgv as t };
267
267
 
268
- //# sourceMappingURL=loop-runner-bin-BxhhDtmG.js.map
268
+ //# sourceMappingURL=loop-runner-bin-L996YVPS.js.map