@tangle-network/agent-runtime 0.115.0 → 0.115.1

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 (39) hide show
  1. package/dist/{activation-BNQQO-bc.js → activation-Bt_XVkjK.js} +2 -2
  2. package/dist/{activation-BNQQO-bc.js.map → activation-Bt_XVkjK.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{improvement-cycle-CBLOgfsQ.js → improvement-cycle-tEswzEPr.js} +3 -3
  6. package/dist/{improvement-cycle-CBLOgfsQ.js.map → improvement-cycle-tEswzEPr.js.map} +1 -1
  7. package/dist/{index-BuzkRsOn.d.ts → index-BUWd8QJq.d.ts} +10 -1
  8. package/dist/{index-I97xACXk.d.ts → index-DZukewLl.d.ts} +2 -2
  9. package/dist/{index-B_vcAAle.d.ts → index-K7nucOmw.d.ts} +4 -4
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.js +7 -7
  12. package/dist/intelligence.js +2 -2
  13. package/dist/kernel.d.ts +1 -1
  14. package/dist/kernel.js +4 -4
  15. package/dist/{knowledge-DcIKJaPd.js → knowledge-CUXQE8Sq.js} +3 -3
  16. package/dist/{knowledge-DcIKJaPd.js.map → knowledge-CUXQE8Sq.js.map} +1 -1
  17. package/dist/knowledge.d.ts +1 -1
  18. package/dist/knowledge.js +1 -1
  19. package/dist/{loop-runner-bin-DgAXgQCI.d.ts → loop-runner-bin-BZl5vp7t.d.ts} +2 -2
  20. package/dist/{loop-runner-bin-C2GIqSUn.js → loop-runner-bin-DzJz48Fb.js} +3 -3
  21. package/dist/{loop-runner-bin-C2GIqSUn.js.map → loop-runner-bin-DzJz48Fb.js.map} +1 -1
  22. package/dist/loop-runner-bin.d.ts +1 -1
  23. package/dist/loop-runner-bin.js +1 -1
  24. package/dist/mcp/bin.js +1 -1
  25. package/dist/mcp/index.d.ts +1 -1
  26. package/dist/mcp/index.js +4 -4
  27. package/dist/{openai-tools-BWAEIHkZ.js → openai-tools-CynwZMZd.js} +2 -2
  28. package/dist/{openai-tools-BWAEIHkZ.js.map → openai-tools-CynwZMZd.js.map} +1 -1
  29. package/dist/primeintellect/index.d.ts +1 -1
  30. package/dist/{runtime-C_g_SsXg.js → runtime-BatQajPB.js} +4 -4
  31. package/dist/{runtime-C_g_SsXg.js.map → runtime-BatQajPB.js.map} +1 -1
  32. package/dist/{structural-rollout-Cqm1dKa7.js → structural-rollout-DEf37yQy.js} +2 -2
  33. package/dist/{structural-rollout-Cqm1dKa7.js.map → structural-rollout-DEf37yQy.js.map} +1 -1
  34. package/dist/{supervise-BcCHhLrz.js → supervise-B7TIJR3D.js} +2 -2
  35. package/dist/{supervise-BcCHhLrz.js.map → supervise-B7TIJR3D.js.map} +1 -1
  36. package/dist/{supervisor-CspDspod.js → supervisor-DzQu5Ydu.js} +16 -7
  37. package/dist/{supervisor-CspDspod.js.map → supervisor-DzQu5Ydu.js.map} +1 -1
  38. package/dist/testing.js +8 -8
  39. package/package.json +1 -1
@@ -6299,6 +6299,15 @@ interface ReservationTicket {
6299
6299
  readonly tokens: number;
6300
6300
  readonly usd: number;
6301
6301
  readonly iterations: number;
6302
+ /**
6303
+ * Whether the child's `Budget` actually declared `maxUsd`. `reserved.usd` is `0` for BOTH a
6304
+ * child that named no dollar ceiling and one that named `$0`, and the two settle differently:
6305
+ * an undeclared ceiling cannot be exceeded, so the child's real dollars are committed as
6306
+ * OBSERVED spend, while a declared ceiling of `$0` is a limit whose breach is fail-loud.
6307
+ * Optional so an externally constructed ticket stays valid; an absent flag is read as
6308
+ * `true` — the strict, fail-closed reading.
6309
+ */
6310
+ readonly usdBudgeted?: boolean;
6302
6311
  };
6303
6312
  }
6304
6313
  /** Post-reservation pool readout — the shape `Scope.budget` exposes. `tokensLeft`,
@@ -7943,4 +7952,4 @@ interface VerifierEnvironmentOptions {
7943
7952
  declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
7944
7953
  //#endregion
7945
7954
  export { safeWorkerFile as $, HarvestCorpusOptions as $a, InboxMessage as $c, defaultToolDetectors as $d, BenchmarkStrategySummary as $i, createSiblingSandboxExecutor as $l, modelAuthoredChecks as $n, Persona as $o, CheckpointCapableBox as $r, plateauLength as $s, StopDecision as $t, readTraceContextFromEnv as $u, GitWorkspaceOptions as A, LoopDispatchOptions as Aa, DelegateArgs as Ac, DelegationPersistenceError as Ad, renderCorpusToInstructions as Ai, JsonRpcResponse as Al, assessAuthoredProfile as An, Pipeline as Ao, strategyAuthorContract as Ar, LeaderboardOptions as As, DelegateOptions as At, DelegateUiAuditArgs as Au, analyzeTrace as B, localSandboxClient as Ba, ProviderSeam as Bc, JudgeError as Bd, RegistryAnalyzeProjection as Bi, DelegateRunCtx as Bl, CheckSourceCtx as Bn, TrajectoryReportFn as Bo, McpToolDescriptor as Br, renderLeaderboardSvg as Bs, supervisorAgent as Bt, DelegationProgress as Bu, closingWorkerNote as C, defineStrategy as Ca, McpServer as Cc, DelegationTraceCaps as Cd, builtinShapes as Ci, GitRunner as Cl, ReservationTicket as Cn, LoopUntil as Co, pickChampion as Cr, deterministicCompletion as Cs, DispatchStopReason as Ct, DelegateCodeConfig as Cu, UntrackedCopyStats as D, sample as Da, DELEGATE_DESCRIPTION as Dc, capDelegationTrace as Dd, runPersonified as Di, createWorktree as Dl, ProfileRichness as Dn, PanelJudge as Do, AuthoredStrategy as Dr, GroupOf as Ds, freeSlots as Dt, DelegateResearchArgs as Du, CopyOptions as E, runAgentic as Ea, createMcpServer as Ec, buildDelegationTraceSpans as Ed, definePersona as Ei, captureWorktreeDiff as El, AuthoredProfile as En, Panel as Eo, AuthorStrategyOptions as Er, AxisScoresOf as Es, effectiveConcurrency as Et, DelegateFeedbackResult as Eu, gitWorkspace as F, RunLoopOptions as Fa, BridgeSeam as Fc, InMemoryDelegationStore as Fd, pipeline as Fi, InMemoryFeedbackStore as Fl, CheckExecChannel as Fn, ScopeAnalyzeInput as Fo, dumbDriver as Fr, ScoreOf as Fs, ResolvedSupervisorProfile as Ft, DelegationFeedbackSnapshot as Fu, supervise as G, resolveMcpServerLaunch as Ga, createExecutor as Gc, CoderOutput as Gd, McpEndpoint as Gi, coderTaskFromArgs as Gl, StructuralRolloutResult as Gn, WidenDecision as Go, Deliverable as Gr, auditIntent as Gs, finalizeBestDelivered as Gt, FeedbackRating as Gu, SuperviseOptions as H, ResolvedMcpServerLaunch as Ha, RouterToolsSeam as Hc, PlannerError as Hd, buildSteerContext as Hi, DetachedWinnerSelection as Hl, StructuralRolloutConfig as Hn, Verify as Ho, StdioMcpServerSpec as Hr, AuditIntentInput as Hs, serveCoordinationMcp as Ht, DelegationStatus as Hu, jjWorkspace as I, defaultSelectWinner as Ia, CliSeam as Ic, AgentEvalError$1 as Id, selectValidWinner as Ii, eventToSnapshot as Il, CheckOutcome as In, ScopeWidenGate as Io, naiveDriver as Ir, leaderboard as Is, SupervisorAgentDeps as It, DelegationHistoryArgs as Iu, createScope as J, inlineSandboxClient as Ja, SandboxSteeringOptions as Jc, BusStats as Jd, sanitizeMcpToolSchema as Ji, DelegationExecutor as Jl, compareCheckOutcomes as Jn, WinnerStrategy as Jo, OpenSandboxRunPromptOptions as Jr, AnytimeStrategySummary as Js, PlateauOptions as Jt, ResearchSource as Ju, workerFromBackend as K, resolveSecretEnv as Ka, createExecutorRegistry as Kc, BusEvent as Kd, McpEnvironmentOptions as Ki, detachedSessionDelegate as Kl, VisibleCheck as Kn, WidenLineage as Ko, OpenSandboxRunBeforeStartContext as Kr, defaultAuditorInstruction as Ks, AllWorkersStalledOptions as Kt, FeedbackRefersTo as Ku, localShell as L, runAgentRounds as La, CliWorktreeBridgeSeam as Lc, AgentEvalErrorCode as Ld, verify as Li, CoderDelegate as Ll, CheckRunContext as Ln, SteerContext as Lo, LocalMcpMaterialization as Lr, pairwiseSignificance as Ls, SupervisorProfile as Lt, DelegationHistoryEntry as Lu, Workspace as M, loopCampaignDispatch as Ma, DelegateResult as Mc, DelegationStore as Md, flatWidenGate as Mi, McpTransport as Ml, defaultProfileRichnessThresholds as Mn, RenderCorpusToInstructions as Mo, DumbDriverOptions as Mr, PairwiseOptions as Ms, delegate as Mt, DelegateUiAuditResult as Mu, WorkspaceCommit as N, loopDispatch as Na, createDelegateHandler as Nc, FileDelegationStore as Nd, loopUntil as Ni, FeedbackEvent as Nl, profileRichnessFinding as Nn, RenderCorpusToInstructionsOptions as No, NaiveDriverOptions as Nr, PairwiseVerdict as Ns, CoordinationBinding as Nt, DelegateUiAuditRoute as Nu, copyUntrackedIntoClone as O, sampleThenRefine as Oa, DELEGATE_INPUT_SCHEMA as Oc, composeLoopTraceEmitters as Od, FileCorpus as Oi, removeWorktree as Ol, ProfileRichnessThresholds as On, PanelSpec as Oo, assertStrategyContract as Or, Interval as Os, queueOf as Ot, DelegateResearchConfig as Ou, WorkspaceRun as P, RunAgentRoundsOptions as Pa, validateDelegateArgs as Pc, FileDelegationStoreOptions as Pd, panel as Pi, FeedbackStore as Pl, supervisorInstructions as Pn, ScopeAnalyst as Po, SteeringDecision as Pr, ProfileKeyOf as Ps, DriveHarness as Pt, DelegationError as Pu, readWorkerSteerRequests as Q, inProcessSandboxClient as Qa, Inbox as Qc, WatchTraceOptions as Qd, BenchmarkReport as Qi, createFleetWorkspaceExecutor as Ql, filterAuthoredAsserts as Qn, Outcome as Qo, openSandboxRun as Qr, bestSoFar as Qs, ProgressView as Qt, createPropagatingTraceEmitter as Qu, runInWorkspace as R, runLoop as Ra, CliWorktreeSeam as Rc, BackendTransportError as Rd, widen as Ri, CoderReview as Rl, CheckRunner as Rn, TrajectoryNode as Ro, MaterializeLocalMcpOptions as Rr, renderLeaderboardHtml as Rs, assertCoordinationBinding as Rt, DelegationHistoryResult as Ru, WorkerEvidenceInput as S, breadthStrategy as Sa, createCoordinationTools as Sc, DELEGATION_TRACE_MAX_SPANS as Sd, trajectoryReport as Si, DiffResult as Sl, ReservationRejection as Sn, FlatWidenGate as So, discriminatingMeans as Sr, completionAuthorizes as Ss, DispatchReport as St, DelegateCodeArgs as Su, settledWorkerOut as T, refine as Ta, createInProcessTransport as Tc, DelegationTraceSpan as Td, registerShape as Ti, WorktreeHandle as Tl, spendFromUsageEvents as Tn, LoopUntilState as To, selectChampion as Tr, stopSentinel as Ts, RollingDispatchOptions as Tt, DelegateFeedbackArgs as Tu, SuperviseRegistry as U, envKeyProvider as Ua, SandboxSeam as Uc, RuntimeRunStateError as Ud, createScopeAnalyst as Ui, SettleDetachedCoderTurnOptions as Ul, StructuralRolloutMessage as Un, VerifySpec as Uo, connectStdioMcp as Ur, AuditIntentOptions as Us, DriverAgentOptions as Ut, DelegationStatusArgs as Uu, createSupervisor as V, KeyProvider as Va, RouterSeam as Vc, NotFoundError as Vd, assertTraceDerivedFindings as Vi, DetachedSessionDelegateOptions as Vl, RepairStop as Vn, TrajectoryReportOptions as Vo, StdioMcpConnection as Vr, renderPairwiseMarkdown as Vs, CoordinationMcpHandle as Vt, DelegationResultPayload as Vu, SuperviseRegistryTable as W, mcpSecretEnvMetadataKey as Wa, cliWorktreeExecutor as Wc, ValidationError as Wd, registryScopeAnalyst as Wi, UiAuditorDelegate as Wl, StructuralRolloutPolicy as Wn, Widen as Wo, materializeLocalMcp as Wr, IntentAudit as Ws, driverAgent as Wt, DelegationStatusResult as Wu, WorkerSteerRequest as X, InProcessPromptCtx as Xa, SteerableSandboxSession as Xc, PublishOptions as Xd, BenchmarkConfig as Xi, FleetWorkspaceExecutorOptions as Xl, defaultExtractCandidate as Xn, DefinePersonaInput as Xo, SandboxRunAbortError as Xr, anytimeReport as Xs, ProgressTracker as Xt, UiAuditorDelegationOutput as Xu, settledToIteration as Y, InProcessOnPrompt as Ya, SteerableSandboxArgs as Yc, EventBus as Yd, BenchmarkCell as Yi, FleetHandle as Yl, composeCheckSources as Yn, DefinePersona as Yo, SandboxRun as Yr, AnytimeTaskCurve as Ys, ProgressSample as Yt, UiAuditLensFilter as Yu, legacySupervisorRunDir as Z, InProcessSandboxClientOptions as Za, createSteerableSandboxSession as Zc, createEventBus as Zd, BenchmarkLift as Zi, SiblingSandboxExecutorOptions as Zl, defaultStructuralRolloutPolicy as Zn, LoopShape as Zo, TurnResult as Zr, areaUnderCurve as Zs, ProgressTrackerOptions as Zt, TraceContext as Zu, WorktreeFanoutOptions as _, StrategyMessage as _a, QuestionPolicy as _c, generateSpanId as _d, resolveSandboxClient as _i, WorktreeCommandResult as _l, CoordinationLog as _n, EqualKVerdict as _o, EvolutionCandidate as _r, defineLeaderboard as _s, SupervisorSpanOutcome as _t, DelegationTaskQueue as _u, SandboxInstance$1 as a, AgenticRunResult as aa, AnalystFindingEvent as ac, INTELLIGENCE_WIRE_VERSION as ad, InMemoryResultBlobStore as af, SandboxToolPartState as ai, piSeamKey as al, noProgressFor as an, ObserveOptions as ao, visibleCheckScore as ar, ShapeContext as as, InMemoryRunContext as at, RunDetachedTurnOptions as au, NOTE_MAX_CHARS as b, SurfaceScore as ba, SettledWorker as bc, CappedDelegationTrace as bd, promotionGate as bi, CreateWorktreeOptions as bl, BudgetPool as bn, FanoutSynthesis as bo, ReproductionCheck as br, CompletionPolicy as bs, assertModelAllowed as bt, SubmitOutput as bu, VerifierEnvironmentOptions as c, AgenticTool as ca, CoordinationTools as cc, OtelExportConfig as cd, materializeTreeView as cf, mapSandboxEvent as ci, PI_MCP_CONFIG_FLAG as cl, DeliveredOutput as cn, renderReport as co, CollectedAgentTurn as cr, LeaderboardBenchScore as cs, createFileRunContext as ct, formatDetachedSessionRef as cu, SuperviseSurfaceResult as d, RunAgenticOptions as da, DownMessageEvent as dc, RuntimeEventOtelOptions as dd, CriuCapableClient as di, PiMcpPreparation as dl, SupervisorFinalizer as dn, Corpus as do, streamAgentTurn as dr, LeaderboardFlagSpec as ds, patchDelivered as dt, DelegationArgs as du, BenchmarkTaskRow as ea, renderAnytimeTable as ec, traceContextToEnv as ed, watchTrace as ef, ForkCapableBox as ei, createInbox as el, StopRule as en, HarvestFailure as eo, officialChecksFromMeta as er, PersonaContext as es, supervisorRunDir as et, DetachedSessionRefParts as eu, SurfaceWorkerConfig as f, ShotPersona as fa, MakeWorkerAgent as fc, buildLoopOtelSpans as fd, SandboxCapabilities as fi, PiMcpReceipt as fl, bestDelivered as fn, CorpusFilter as fo, ChampionPick as fr, LeaderboardIterationInfo as fs, WorktreeCliExecutorOptions as ft, DelegationRecord as fu, AuthoredHarness as g, StrategyCtx as ga, QuestionOption as gc, exportEvalRuns as gd, ResolveSandboxClientOptions as gi, WorktreeCheckRunner as gl, runTree as gn, EqualKOnCostOptions as go, EvolutionBandInfo as gr, LeaderboardSpec as gs, SupervisorSpanOptions as gt, DelegationRunContext as gu, superviseSurface as h, StrategyArtifacts as ha, QuestionLevel as hc, createOtelExporter as hd, acquireSandbox as hi, preparePiMcp as hl, runFinalizer as hn, EqualKOnCost as ho, EvolutionAuthor as hr, LeaderboardScore as hs, SupervisorSpanAttributes as ht, DelegationResumeTick as hu, SandboxEvent$1 as i, AgenticOptions as ia, createWaterfallCollector as ic, EvalRunsExportResult as id, FileSpawnJournal as if, createSandboxLineage as ii, piExecutor as il, createProgressTracker as in, ObserveInput as io, structuralRollout as ir, ShapeBudget as is, writeWorkerSteer as it, DriveTurnTick as iu, Shell as j, LoopOptionsForDispatch as ja, DelegateHandlerOptions as jc, DelegationStateCorruptError as jd, fanout as ji, McpToolDescriptor$1 as jl, authoredWorker as jn, PipelineStage as jo, ApplyContinuation as jr, LeaderboardRow as js, defaultDelegateBudget as jt, DelegateUiAuditConfig as ju, withUntrackedArtifacts as k, LoopCampaignDispatchOptions as ka, DELEGATE_TOOL_NAME as kc, createDelegationTraceCollector as kd, InMemoryCorpus as ki, JsonRpcMessage as kl, asAuthoredProfile as kn, PanelVerdict as ko, authorStrategy as kr, Leaderboard as ks, rollingDispatch as kt, DelegateResearchResult as ku, createVerifierEnvironment as l, ArtifactHandle as la, CoordinationToolsOptions as lc, OtelExporter as ld, pendingWaits as lf, mapSandboxToolEvent as li, PiMcpMount as ll, FinalizeContext as ln, AssertTraceDerivedFindings as lo, StreamAgentTurnOptions as lr, LeaderboardBenchTask as ls, createInMemoryRunContext as lt, parseDetachedSessionRef as lu, failuresAnalyst as m, Strategy as ma, QuestionDecision as mc, buildRuntimeEventOtelSpans as md, AcquireOptions as mi, piMcpAdapterAvailable as ml, pickBestDelivered as mn, EqualKArm as mo, EvolutionArchiveNode as mr, LeaderboardScenario as ms, createWorktreeCliExecutor as mt, DelegationResumeDriver as mu, AnalystFinding$1 as n, printBenchmarkReport as na, WaterfallReport as nc, EvalRunGeneration as nd, gateOnDeliverable as nf, SandboxLineageHandle as ni, PiExecutorOutput as nl, allWorkersStalled as nn, harvestCorpus as no, sandboxCheckRunner as nr, RunPersonified as ns, workerInboxFile as nt, DetachedTurnResumeDriverOptions as nu, computeFindingId$1 as o, AgenticSurface as oa, AnalystRegistry as oc, LoopSpanNode as od, InMemorySpawnJournal as of, createSandboxToolPartState as oi, PI_MCP_ADAPTER as ol, plateau as on, defaultAnalystInstruction as oo, AgentTurnBackend as or, ShapeRegistry as os, InMemoryRunContextOptions as ot, createDetachedTurnResumeDriver as ou, SurfaceWorkerOut as p, ShotSpec as pa, Question as pc, buildLoopSpanNodes as pd, probeSandboxCapabilities as pi, buildPiMcpServers as pl, collectDelivered as pn, CorpusRecord as po, ChampionPolicy as pr, LeaderboardRunContext as ps, WorktreePatchArtifact as pt, DelegationResumeContext as pu, ScopeArgs as q, secretEnvOfMcpServer as qa, DEFAULT_SANDBOX_STEERING_MAX_TURNS as qc, BusRecord as qd, createMcpEnvironment as qi, settleDetachedCoderTurn as ql, canDisplace as qn, WidenSpec as qo, OpenSandboxRunOptions as qr, AnytimeReport as qs, NoProgressForOptions as qt, ResearchOutputShape as qu, CreateSandboxOptions$1 as r, runBenchmark as ra, WaterfallSpan as rc, EvalRunsExportConfig as rd, FileResultBlobStore as rf, SessionCapableBox as ri, PiSeam as rl, anyOf as rn, Observation as ro, selectBestIndex as rr, RunPersonifiedOptions as rs, workerInboxFileFromEventDir as rt, DriveTurnCapableBox as ru, makeFinding$1 as s, AgenticTask as sa, CoordinationEvent as sc, OtelAttribute as sd, contentAddress as sf, extractLlmCallEvent as si, PI_MCP_ADAPTER_ENV as sl, sampleFromSettled as sn, observe as so, AgentTurnUsage as sr, DefinedLeaderboard as ss, RunContext as st, detachedTurnEvents as su, AgentProfile$2 as t, Environment as ta, WaterfallCollector as tc, EvalRunEvent as td, DeliverableSpec as tf, SandboxLineage as ti, PI_RUNTIME as tl, allOf as tn, HarvestReport as to, resolveEntrySymbol as tr, PersonaExecutors as ts, supervisorRunsRoot as tt, DetachedTurn as tu, SuperviseSurfaceOptions as u, CorpusReadbackOptions as ua, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as uc, OtelSpan as ud, replaySpawnTree as uf, sumSandboxUsage as ui, PiMcpMountOptions as ul, FinalizerSettled as un, CombinatorShape as uo, collectAgentTurn as ur, LeaderboardBenchmarkAdapter as us, PatchDeliverableOptions as ut, runDetachedTurn as uu, worktreeFanout as v, StrategyResult as va, QuestionRecord as vc, loopEventToOtelSpan as vd, PromotionGateOptions as vi, WorktreeHarnessResult as vl, FileCoordinationLog as vn, Fanout as vo, EvolutionGeneration as vr, CompletionAnalyst as vs, SupervisorSpanRecorder as vt, DelegationTaskQueueOptions as vu, composeWorkerEvidence as w, depthStrategy as wa, McpServerOptions as wc, DelegationTraceCollector as wd, createShapeRegistry as wi, RemoveWorktreeOptions as wl, createBudgetPool as wn, LoopUntilSpec as wo, runStrategyEvolution as wr, sentinelCompletion as ws, DispatchUnit as wt, DelegateCodeResult as wu, VERIFY_TAIL_CHARS as x, adaptiveRefine as xa, WorkerWatchOptions as xc, DELEGATION_TRACE_MAX_BYTES as xd, equalKOnCost as xi, DiffOptions as xl, BudgetReadout as xn, FanoutWinnerSelector as xo, StrategyEvolutionConfig as xr, CompletionVerdict as xs, ConcurrencyCaps as xt, hashIdempotencyInput as xu, EVIDENCE_MAX_CHARS as y, StrategyShotResult as ya, QuestionUrgency as yc, toOtelAttributes as yd, PromotionVerdict as yi, WorktreeProfileMaterializationReceipt as yl, PriorCoordination as yn, FanoutOptions as yo, EvolutionReport as yr, CompletionEvidence as ys, createSupervisorSpanRecorder as yt, SubmitInput as yu, TrajectoryAnalysis as z, LocalSandboxClientOptions as za, ExecutorConfig as zc, ConfigError as zd, CreateScopeAnalystOptions as zi, CoderReviewer as zl, CheckSource as zn, TrajectoryReport as zo, McpSpawnFault as zr, renderLeaderboardMarkdown as zs, resolveSupervisorProfile as zt, DelegationProfile as zu };
7946
- //# sourceMappingURL=index-BuzkRsOn.d.ts.map
7955
+ //# sourceMappingURL=index-BUWd8QJq.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { R as Budget, dt as SupervisedResult } from "./environment-provider-Cygthiy3.js";
2
- import { H as SuperviseOptions, Lt as SupervisorProfile, tf as DeliverableSpec, zc as ExecutorConfig } from "./index-BuzkRsOn.js";
2
+ import { H as SuperviseOptions, Lt as SupervisorProfile, tf as DeliverableSpec, zc as ExecutorConfig } from "./index-BUWd8QJq.js";
3
3
  import { y as AgentCandidateOutputArtifactPort } from "./types-BaIpb0XT.js";
4
4
  import { i as AgentImprovementActivationTransition, n as AgentImprovementActivationResultStore, t as AgentImprovementActivationReconciliation } from "./activation-DyWB0K6E.js";
5
5
  import { AgentCandidateBundle, AgentCandidateCapturedArtifact, AgentCandidateKnowledge } from "@tangle-network/agent-interface";
@@ -137,4 +137,4 @@ declare function runKnowledgeImprovementJob(options: RunKnowledgeImprovementJobO
137
137
  declare function buildKnowledgeImprovementExperimentBundles(bundle: AgentCandidateBundle, knowledge: KnowledgeImprovementCandidatePair): KnowledgeImprovementExperimentBundles;
138
138
  //#endregion
139
139
  export { KnowledgeImprovementActivationExecutor as C, CreateKnowledgeImprovementActivationExecutorOptions as S, SupervisedKnowledgeUpdater as _, KnowledgeImprovementJobResult as a, knowledgeReadinessDeliverable as b, createAgentKnowledgeReadinessCheck as c, KnowledgeReadinessCheckInput as d, KnowledgeReadinessCheckResult as f, SupervisedKnowledgeUpdateResult as g, SupervisedKnowledgeUpdateOptions as h, KnowledgeImprovementJobMeasurement as i, runKnowledgeImprovementJob as l, SupervisedKnowledgeUpdateInput as m, KnowledgeImprovementCandidatePair as n, RunKnowledgeImprovementJobOptions as o, RESEARCH_SUPERVISOR_SYSTEM_PROMPT as p, KnowledgeImprovementExperimentBundles as r, buildKnowledgeImprovementExperimentBundles as s, AgentKnowledgeReadinessCheckOptions as t, KnowledgeReadinessCheck as u, createSupervisedKnowledgeUpdater as v, createKnowledgeImprovementActivationExecutor as w, runSupervisedKnowledgeUpdate as x, formatSupervisedKnowledgeTask as y };
140
- //# sourceMappingURL=index-I97xACXk.d.ts.map
140
+ //# sourceMappingURL=index-DZukewLl.d.ts.map
@@ -2,13 +2,13 @@ import { _ as RunAgentTaskOptions, b as RuntimeSessionStore, g as OpenAIChatTool
2
2
  import { i as SurfaceImprovementEdit } from "./improvement-adapter-D5gwwoXQ.js";
3
3
  import { o as ImprovementProposalSource } from "./types-zWfqDjeL.js";
4
4
  import "./types-DnNGJ5Gz.js";
5
- import { Wn as StructuralRolloutPolicy, zd as ConfigError } from "./index-BuzkRsOn.js";
5
+ import { Wn as StructuralRolloutPolicy, zd as ConfigError } from "./index-BUWd8QJq.js";
6
6
  import { O as RuntimeTelemetryOptions, b as ToolLoopChat, c as runLocalHarness, i as LocalHarness } from "./local-harness-BnB1E9nM.js";
7
7
  import "./index-C-FYUuFG.js";
8
8
  import "./index-Efjb3nrQ.js";
9
9
  import { H as CandidateGenerator, L as Verifier, a as ImproveCandidateValidationInput, j as ReadonlyAgentProfile, p as ImproveMethodFactory, t as Redactor } from "./redact-BRaHUFMf.js";
10
- import "./index-I97xACXk.js";
11
- import "./loop-runner-bin-DgAXgQCI.js";
10
+ import "./index-DZukewLl.js";
11
+ import "./loop-runner-bin-BZl5vp7t.js";
12
12
  import "./openai-tools-B68JaOCx.js";
13
13
  import { ControlBudget as ControlBudget$1, ControlDecision as ControlDecision$1, ControlEvalResult, ControlEvalResult as ControlEvalResult$1, ControlRunResult as ControlRunResult$1, ControlStep as ControlStep$1, DataAcquisitionPlan as DataAcquisitionPlan$1, KnowledgeReadinessReport, KnowledgeReadinessReport as KnowledgeReadinessReport$1, KnowledgeRequirement as KnowledgeRequirement$1, ProposalFinding, RunRecord, RunRecord as RunRecord$1 } from "@tangle-network/agent-eval";
14
14
  import { GepaOptimizationMethodConfig, SkillOptOptimizationMethodConfig } from "@tangle-network/agent-eval/campaign";
@@ -541,4 +541,4 @@ declare function readinessServerSentEvent(report: KnowledgeReadinessReport, opti
541
541
  declare function runtimeStreamServerSentEvent(event: RuntimeStreamEvent, options?: RuntimeTelemetryOptions & ServerSentEventOptions): string;
542
542
  //#endregion
543
543
  export { McpServeSpec as $, resolveRouterBaseUrl as A, RawTraceDistillerOptions as B, DEFAULT_ROUTER_BASE_URL as C, cleanModelId as D, RouterEnv as E, parseRolloutPolicy as F, strategyAuthorMethod as G, buildDriverSystem as H, serializeRolloutPolicy as I, OfficialOptimizerUnavailableError as J, OfficialGepaOptions as K, structuralRolloutPolicyFromProfile as L, ROLLOUT_POLICY_EXTENSION as M, applyRolloutPolicyToProfile as N, getModels as O, normalizeRolloutPolicy as P, officialSkillOpt as Q, ReflectiveGeneratorOptions as R, ChatModelValidation as S, ResolvedChatModel as T, optimizerMethod as U, rawTraceDistiller as V, researchDriverNote as W, OfficialSkillOptOptions as X, OfficialSensitiveCandidateInput as Y, officialGepa as Z, AgentBackendKind as _, ControlStep$1 as a, mcpBuildPrompt as at, decideKnowledgeReadiness as b, KnowledgeRequirement$1 as c, createIterableBackend as ct, readinessServerSentEvent as d, mcpServeVerifier as et, runtimeStreamServerSentEvent as f, runAgentTaskStream as g, runAgentTask as h, ControlRunResult$1 as i, findingLines as it, validateChatModelId as j, resolveChatModel as k, RunRecord$1 as l, createOpenAICompatibleBackend as lt, applyRunRecordDefaults as m, ControlDecision$1 as n, driverLoopGenerator as nt, DataAcquisitionPlan$1 as o, toolBuildPrompt as ot, InMemoryRuntimeSessionStore as p, OfficialOptimizerContextOptions as q, ControlEvalResult$1 as r, BuildPromptFindingsInput as rt, KnowledgeReadinessReport$1 as s, BackendRetryPolicy as st, ControlBudget$1 as t, DriverLoopGeneratorOptions as tt, ServerSentEventOptions as u, createSandboxPromptBackend as ut, ResolveAgentBackendOptions as v, ModelInfo as w, ChatModelCandidate as x, resolveAgentBackend as y, reflectiveGenerator as z };
544
- //# sourceMappingURL=index-B_vcAAle.d.ts.map
544
+ //# sourceMappingURL=index-K7nucOmw.d.ts.map
package/dist/index.d.ts CHANGED
@@ -2,15 +2,15 @@ import { _ as RunAgentTaskOptions, a as AgentKnowledgeProvider, b as RuntimeSess
2
2
  import { a as RuntimeHookErrorContext, c as RuntimeHookTarget, d as defineRuntimeHooks, f as notifyRuntimeDecisionPoint, i as RuntimeHookContext, l as RuntimeHooks, n as RuntimeDecisionKind, o as RuntimeHookEvent, p as notifyRuntimeHookEvent, r as RuntimeDecisionPoint, s as RuntimeHookPhase, t as RuntimeDecisionEvidenceRef, u as composeRuntimeHooks } from "./runtime-hooks-sbRpjStq.js";
3
3
  import { A as RuntimeRunCompleteInput, F as RuntimeRunRow, I as RuntimeRunStatus, L as startRuntimeRun, M as RuntimeRunHandle, N as RuntimeRunOptions, P as RuntimeRunPersistenceAdapter, j as RuntimeRunCost, m as LoopResult, r as Driver } from "./types-DnNGJ5Gz.js";
4
4
  import { B as Executor, L as AgentSpec, R as Budget, U as ExecutorRegistry, dt as SupervisedResult, ft as Supervisor, it as Settled, rt as Scope, ut as Spend } from "./environment-provider-Cygthiy3.js";
5
- import { Bd as JudgeError, Hd as PlannerError, Id as AgentEvalError, Ld as AgentEvalErrorCode, Rd as BackendTransportError, Ud as RuntimeRunStateError, Vd as NotFoundError, Wd as ValidationError, _d as generateSpanId, ad as INTELLIGENCE_WIRE_VERSION, cd as OtelExportConfig, dd as RuntimeEventOtelOptions, dn as SupervisorFinalizer, fd as buildLoopOtelSpans, gd as exportEvalRuns, gl as WorktreeCheckRunner, hd as createOtelExporter, id as EvalRunsExportResult, ld as OtelExporter, ln as FinalizeContext, md as buildRuntimeEventOtelSpans, nd as EvalRunGeneration, oc as AnalystRegistry, od as LoopSpanNode, pd as buildLoopSpanNodes, rd as EvalRunsExportConfig, sc as CoordinationEvent, sd as OtelAttribute, td as EvalRunEvent, ud as OtelSpan, vd as loopEventToOtelSpan, yd as toOtelAttributes, zd as ConfigError } from "./index-BuzkRsOn.js";
5
+ import { Bd as JudgeError, Hd as PlannerError, Id as AgentEvalError, Ld as AgentEvalErrorCode, Rd as BackendTransportError, Ud as RuntimeRunStateError, Vd as NotFoundError, Wd as ValidationError, _d as generateSpanId, ad as INTELLIGENCE_WIRE_VERSION, cd as OtelExportConfig, dd as RuntimeEventOtelOptions, dn as SupervisorFinalizer, fd as buildLoopOtelSpans, gd as exportEvalRuns, gl as WorktreeCheckRunner, hd as createOtelExporter, id as EvalRunsExportResult, ld as OtelExporter, ln as FinalizeContext, md as buildRuntimeEventOtelSpans, nd as EvalRunGeneration, oc as AnalystRegistry, od as LoopSpanNode, pd as buildLoopSpanNodes, rd as EvalRunsExportConfig, sc as CoordinationEvent, sd as OtelAttribute, td as EvalRunEvent, ud as OtelSpan, vd as loopEventToOtelSpan, yd as toOtelAttributes, zd as ConfigError } from "./index-BUWd8QJq.js";
6
6
  import { A as SanitizedKnowledgeRequirement, D as RuntimeStreamEventSummary, E as RuntimeStreamEventSink, F as sanitizeRuntimeStreamEvent, M as createRuntimeStreamEventCollector, N as sanitizeAgentRuntimeEvent, O as RuntimeTelemetryOptions, P as sanitizeKnowledgeReadinessReport, T as RuntimeStreamEventCollector, j as createRuntimeEventCollector, k as SanitizedKnowledgeReadinessReport, w as RuntimeEventCollector } from "./local-harness-BnB1E9nM.js";
7
7
  import { C as AgentCandidateCodeSurfaceSource, D as AgentCandidateBundleInput, E as buildAgentCandidateBundle, O as sealAgentCandidateBundle, S as AgentCandidateCodeSource, T as BuildAgentCandidateBundleInput, _ as exactProcessProviderAsCandidateExecutor, a as captureAgentCandidateWorkspace, b as FileAgentCandidateExecutionClaimStore, c as AGENT_CANDIDATE_EXECUTION_SUPPORT, d as recoverExpiredAgentCandidateExecution, f as persistCandidateOutputArtifact, g as ExactProcessCandidateExecutorOptions, h as candidateKnowledgeExecutionPaths, i as CreateAgentCandidateWorkspacePortOptions, l as verifyAgentCandidateBundle, m as CANDIDATE_KNOWLEDGE_ROOT_ENV, n as CaptureAgentCandidateWorkspaceOptions, o as captureAgentCandidateWorkspaceFiles, p as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, r as CapturedAgentCandidateWorkspace, s as createAgentCandidateWorkspacePort, t as AgentCandidateWorkspaceArchiveLimits, u as RecoverExpiredAgentCandidateOptions, v as DisposePreparedAgentCandidateOptions, w as AgentCandidateProfileSource, x as FileAgentCandidateExecutionClaimStoreOptions, y as disposePreparedAgentCandidateExecution } from "./index-C-FYUuFG.js";
8
8
  import { A as AgentCandidateExecutionTerminalRecord, C as AgentCandidateExecutionFailureClass, D as AgentCandidateExecutionPhaseResult, E as AgentCandidateExecutionPhase, F as candidateExecutionClaim, I as AgentCandidatePreparationEvidence, M as AgentCandidateRetryRejection, N as InMemoryAgentCandidateExecutionClaimStore, O as AgentCandidateExecutionRecoveryEvidence, P as InMemoryAgentCandidateExecutionClaimStoreOptions, S as AgentCandidateExecutionCleanupHandles, T as AgentCandidateExecutionLease, _ as AgentCandidateExecutionAttemptRecord, a as AgentCandidateModelGrantSettleInput, b as AgentCandidateExecutionClaimResult, c as applyExactAgentProfileDiff, d as parseExactAgentProfile, f as parseExactAgentProfileDiff, g as executePreparedAgentCandidate, h as ExecutePreparedAgentCandidateOptions, i as AgentCandidateModelGrantReserveInput, j as AgentCandidateExecutionTerminalResult, k as AgentCandidateExecutionStageResult, l as assertCandidateProfileBinding, m as prepareAgentCandidateExecution, n as AgentCandidateModelGrantClient, o as CreateProtectedAgentCandidateModelPortOptions, p as PrepareAgentCandidateExecutionOptions, r as AgentCandidateModelGrantReservation, s as createProtectedAgentCandidateModelPort, t as AgentCandidateModelGrantActivateInput, v as AgentCandidateExecutionAttemptRef, w as AgentCandidateExecutionFinishResult, x as AgentCandidateExecutionClaimStore, y as AgentCandidateExecutionClaim } from "./protected-model-port-BP6Z4eau.js";
9
9
  import { A as CANDIDATE_TRACE_ENV, B as VerifiedAgentCandidate, C as AgentCandidateProtectedModelSettlement, D as AgentCandidateTaskExecution, E as AgentCandidateRunFinalization, F as PreparedAgentCandidateInstruction, I as PreparedAgentCandidateKnowledge, L as PreparedAgentCandidateLaunch, M as CanonicalCandidateDocument, N as PersistedTaskOutcomeEvidence, O as AgentCandidateVerificationPorts, P as PreparedAgentCandidateExecution, R as PreparedAgentCandidateTrace, S as AgentCandidateProtectedModelReservation, T as AgentCandidateRepositoryPort, V as VerifiedAgentCandidateTaskOutcome, _ as AgentCandidateModelLimits, a as AgentCandidateExecutionPorts, b as AgentCandidateOutputPurpose, c as AgentCandidateExecutorPort, d as AgentCandidateExecutorStopRequest, f as AgentCandidateExecutorTaskOutcomeCapture, g as AgentCandidateMemoryResetResult, h as AgentCandidateMemoryPort, i as AgentCandidateContainerPort, j as CANDIDATE_TRACE_TAGS, k as AgentCandidateWorkspacePort, l as AgentCandidateExecutorProfileFile, m as AgentCandidateExecutorWorkspaceInput, n as AgentCandidateBenchmarkGraderIdentity, o as AgentCandidateExecutorFinalCapture, p as AgentCandidateExecutorWorkspaceFile, r as AgentCandidateBenchmarkGraderPort, s as AgentCandidateExecutorMemoryCapture, t as AgentCandidateArtifactPort, u as AgentCandidateExecutorRequest, v as AgentCandidateModelPort, w as AgentCandidateProtectedRunCapture, x as AgentCandidateProtectedModelActivation, y as AgentCandidateOutputArtifactPort, z as ResolvedAgentCandidateContainer } from "./types-BaIpb0XT.js";
10
10
  import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-Efjb3nrQ.js";
11
- import { $ as McpServeSpec, A as resolveRouterBaseUrl, B as RawTraceDistillerOptions, C as DEFAULT_ROUTER_BASE_URL, D as cleanModelId, E as RouterEnv, F as parseRolloutPolicy, G as strategyAuthorMethod, H as buildDriverSystem, I as serializeRolloutPolicy, J as OfficialOptimizerUnavailableError, K as OfficialGepaOptions, L as structuralRolloutPolicyFromProfile, M as ROLLOUT_POLICY_EXTENSION, N as applyRolloutPolicyToProfile, O as getModels, P as normalizeRolloutPolicy, Q as officialSkillOpt, R as ReflectiveGeneratorOptions, S as ChatModelValidation, T as ResolvedChatModel, U as optimizerMethod, V as rawTraceDistiller, W as researchDriverNote, X as OfficialSkillOptOptions, Y as OfficialSensitiveCandidateInput, Z as officialGepa, _ as AgentBackendKind, a as ControlStep, at as mcpBuildPrompt, b as decideKnowledgeReadiness, c as KnowledgeRequirement, ct as createIterableBackend, d as readinessServerSentEvent, et as mcpServeVerifier, f as runtimeStreamServerSentEvent, g as runAgentTaskStream, h as runAgentTask, i as ControlRunResult, it as findingLines, j as validateChatModelId, k as resolveChatModel, l as RunRecord, lt as createOpenAICompatibleBackend, m as applyRunRecordDefaults, n as ControlDecision, nt as driverLoopGenerator, o as DataAcquisitionPlan, ot as toolBuildPrompt, p as InMemoryRuntimeSessionStore, q as OfficialOptimizerContextOptions, r as ControlEvalResult, rt as BuildPromptFindingsInput, s as KnowledgeReadinessReport, st as BackendRetryPolicy, t as ControlBudget, tt as DriverLoopGeneratorOptions, u as ServerSentEventOptions, ut as createSandboxPromptBackend, v as ResolveAgentBackendOptions, w as ModelInfo, x as ChatModelCandidate, y as resolveAgentBackend, z as reflectiveGenerator } from "./index-B_vcAAle.js";
11
+ import { $ as McpServeSpec, A as resolveRouterBaseUrl, B as RawTraceDistillerOptions, C as DEFAULT_ROUTER_BASE_URL, D as cleanModelId, E as RouterEnv, F as parseRolloutPolicy, G as strategyAuthorMethod, H as buildDriverSystem, I as serializeRolloutPolicy, J as OfficialOptimizerUnavailableError, K as OfficialGepaOptions, L as structuralRolloutPolicyFromProfile, M as ROLLOUT_POLICY_EXTENSION, N as applyRolloutPolicyToProfile, O as getModels, P as normalizeRolloutPolicy, Q as officialSkillOpt, R as ReflectiveGeneratorOptions, S as ChatModelValidation, T as ResolvedChatModel, U as optimizerMethod, V as rawTraceDistiller, W as researchDriverNote, X as OfficialSkillOptOptions, Y as OfficialSensitiveCandidateInput, Z as officialGepa, _ as AgentBackendKind, a as ControlStep, at as mcpBuildPrompt, b as decideKnowledgeReadiness, c as KnowledgeRequirement, ct as createIterableBackend, d as readinessServerSentEvent, et as mcpServeVerifier, f as runtimeStreamServerSentEvent, g as runAgentTaskStream, h as runAgentTask, i as ControlRunResult, it as findingLines, j as validateChatModelId, k as resolveChatModel, l as RunRecord, lt as createOpenAICompatibleBackend, m as applyRunRecordDefaults, n as ControlDecision, nt as driverLoopGenerator, o as DataAcquisitionPlan, ot as toolBuildPrompt, p as InMemoryRuntimeSessionStore, q as OfficialOptimizerContextOptions, r as ControlEvalResult, rt as BuildPromptFindingsInput, s as KnowledgeReadinessReport, st as BackendRetryPolicy, t as ControlBudget, tt as DriverLoopGeneratorOptions, u as ServerSentEventOptions, ut as createSandboxPromptBackend, v as ResolveAgentBackendOptions, w as ModelInfo, x as ChatModelCandidate, y as resolveAgentBackend, z as reflectiveGenerator } from "./index-K7nucOmw.js";
12
12
  import { A as DeepReadonly, B as commandVerifier, C as ImproveResult, D as ImprovementCandidate, E as ImproveSurface, F as AgenticGeneratorShotExecution, H as CandidateGenerator, I as AgenticGeneratorShotReceipt, L as Verifier, M as AGENTIC_PROFILE_RESOURCE_ROOT, N as AgenticGeneratorOptions, O as ImprovementCodeCandidate, P as AgenticGeneratorShotDisposition, R as VerifyResult, S as ImproveProfileSurface, T as ImproveSkillsOptions, V as defaultBuildPrompt, _ as ImproveMethodSource, a as ImproveCandidateValidationInput, b as ImproveProfileAgent, c as ImproveCodeResult, d as ImproveLineage, f as ImproveMethodContext, g as ImproveMethodResult, h as ImproveMethodOptions, i as improve, j as ReadonlyAgentProfile, k as ImprovementProfileCandidate, l as ImproveCodeRunOptions, m as ImproveMethodLineage, o as ImproveCandidateValidator, p as ImproveMethodFactory, s as ImproveCodeOptions, u as ImproveCost, v as ImproveOptimizationRunOptions, w as ImproveScenarioPartitions, x as ImproveProfileComponents, y as ImproveOptions, z as agenticGenerator } from "./redact-BRaHUFMf.js";
13
- 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-I97xACXk.js";
14
- import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-DgAXgQCI.js";
13
+ 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-DZukewLl.js";
14
+ import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-BZl5vp7t.js";
15
15
  import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-B68JaOCx.js";
16
16
  export { AGENTIC_PROFILE_RESOURCE_ROOT, AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentAdapter, type AgentBackendContext, type AgentBackendInput, type AgentBackendKind, type AgentCandidateArtifactPort, type AgentCandidateBenchmarkGraderIdentity, type AgentCandidateBenchmarkGraderPort, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, type AgentCandidateContainerPort, type AgentCandidateExecutionAttemptRecord, type AgentCandidateExecutionAttemptRef, type AgentCandidateExecutionClaim, type AgentCandidateExecutionClaimResult, type AgentCandidateExecutionClaimStore, type AgentCandidateExecutionCleanupHandles, type AgentCandidateExecutionFailureClass, type AgentCandidateExecutionFinishResult, type AgentCandidateExecutionLease, type AgentCandidateExecutionPhase, type AgentCandidateExecutionPhaseResult, type AgentCandidateExecutionPorts, type AgentCandidateExecutionRecoveryEvidence, type AgentCandidateExecutionStageResult, type AgentCandidateExecutionTerminalRecord, type AgentCandidateExecutionTerminalResult, type AgentCandidateExecutorFinalCapture, type AgentCandidateExecutorMemoryCapture, type AgentCandidateExecutorPort, type AgentCandidateExecutorProfileFile, type AgentCandidateExecutorRequest, type AgentCandidateExecutorStopRequest, type AgentCandidateExecutorTaskOutcomeCapture, type AgentCandidateExecutorWorkspaceFile, type AgentCandidateExecutorWorkspaceInput, type AgentCandidateMemoryPort, type AgentCandidateMemoryResetResult, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, type AgentCandidateWorkspacePort, AgentEvalError, type AgentEvalErrorCode, type AgentExecutionBackend, type AgentKnowledgeProvider, type AgentKnowledgeReadinessCheckOptions, type AgentRuntimeEvent, type AgentRuntimeEventSink, type AgentSpec, type AgentTaskContext, type AgentTaskRunResult, type AgentTaskSpec, type AgentTaskStatus, type AgenticGeneratorOptions, type AgenticGeneratorShotDisposition, type AgenticGeneratorShotExecution, type AgenticGeneratorShotReceipt, type AnalystRegistry, type AuthSource, type BackendCallPolicy, type BackendErrorDetail, type BackendRetryPolicy, BackendTransportError, type Budget, type BuildAgentCandidateBundleInput, type BuildPromptFindingsInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, type CandidateGenerator, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type ChatModelCandidate, type ChatModelValidation, type CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, ConfigError, type ControlBudget, type ControlDecision, type ControlEvalResult, type ControlRunResult, type ControlStep, type Conversation, type ConversationDriveState, type ConversationJournal, type ConversationJournalEntry, type ConversationParticipant, type ConversationPolicy, type ConversationResult, type ConversationStreamEvent, type ConversationTurn, type CoordinationEvent, type CreateAgentCandidateWorkspacePortOptions, type CreateKnowledgeImprovementActivationExecutorOptions, type CreateProtectedAgentCandidateModelPortOptions, type D1DatabaseLike, type D1StmtLike, DEFAULT_MAX_DEPTH, DEFAULT_ROUTER_BASE_URL, DELEGATED_LOOP_MODES, type DataAcquisitionPlan, DeadlineExceededError, type DeepReadonly, type DelegatedLoopMode, type DelegatedLoopRegistry, type DelegatedLoopResult, type DelegatedLoopRunner, type DisposePreparedAgentCandidateOptions, type Driver, type DriverLoopGeneratorOptions, type EvalRunEvent, type EvalRunGeneration, type EvalRunsExportConfig, type EvalRunsExportResult, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, type Executor, type ExecutorRegistry, FORWARD_HEADERS, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, FileConversationJournal, type FinalizeContext, type ForwardHeaderName, type HaltContext, type HaltPredicate, type HaltReason, type HaltSignal, INTELLIGENCE_WIRE_VERSION, type ImproveCandidateValidationInput, type ImproveCandidateValidator, type ImproveCodeOptions, type ImproveCodeResult, type ImproveCodeRunOptions, type ImproveCost, type ImproveLineage, type ImproveMethodContext, type ImproveMethodFactory, type ImproveMethodLineage, type ImproveMethodOptions, type ImproveMethodResult, type ImproveMethodSource, type ImproveOptimizationRunOptions, type ImproveOptions, type ImproveProfileAgent, type ImproveProfileComponents, type ImproveProfileSurface, type ImproveResult, type ImproveScenarioPartitions, type ImproveSkillsOptions, type ImproveSurface, type ImprovementCandidate, type ImprovementCodeCandidate, type ImprovementProfileCandidate, InMemoryAgentCandidateExecutionClaimStore, type InMemoryAgentCandidateExecutionClaimStoreOptions, InMemoryConversationJournal, InMemoryRuntimeSessionStore, JudgeError, type KnowledgeImprovementActivationExecutor, type KnowledgeImprovementCandidatePair, type KnowledgeImprovementExperimentBundles, type KnowledgeImprovementJobMeasurement, type KnowledgeImprovementJobResult, type KnowledgeReadinessCheck, type KnowledgeReadinessCheckInput, type KnowledgeReadinessCheckResult, type KnowledgeReadinessDecision, type KnowledgeReadinessReport, type KnowledgeRequirement, type LoopResult, type LoopRunnerCliArgs, type LoopRunnerCliResult, type LoopSpanNode, type McpServeSpec, type ModelInfo, NotFoundError, type OfficialGepaOptions, type OfficialOptimizerContextOptions, OfficialOptimizerUnavailableError, type OfficialSensitiveCandidateInput, type OfficialSkillOptOptions, type OpenAIChatResponseFormat, type OpenAIChatTool, type OpenAIChatToolChoice, type OtelAttribute, type OtelExportConfig, type OtelExporter, type OtelSpan, type PersistedTaskOutcomeEvidence, type PersonaConversationResult, type PersonaDriver, PlannerError, type PrepareAgentCandidateExecutionOptions, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type PropagatedHeaders, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, ROLLOUT_POLICY_EXTENSION, type RawTraceDistillerOptions, type ReadonlyAgentProfile, type RecoverExpiredAgentCandidateOptions, type ReflectiveGeneratorOptions, type ResearchLoopResult, type ResearchLoopRunnerOptions, type ResolveAgentBackendOptions, type ResolvedAgentCandidateContainer, type ResolvedChatModel, type RetryBackoff, type RetryableErrorPredicate, type RouterEnv, type RunAgentTaskOptions, type RunAgentTaskStreamOptions, type RunConversationOptions, type RunDelegatedLoopOptions, type RunKnowledgeImprovementJobOptions, type RunPersonaConfig, type RunPersonaConversationOptions, type RunRecord, type RuntimeDecisionEvidenceRef, type RuntimeDecisionKind, type RuntimeDecisionPoint, type RuntimeEventCollector, type RuntimeEventOtelOptions, type RuntimeHookContext, type RuntimeHookErrorContext, type RuntimeHookEvent, type RuntimeHookPhase, type RuntimeHookTarget, type RuntimeHooks, type RuntimeRunCompleteInput, type RuntimeRunCost, type RuntimeRunHandle, type RuntimeRunOptions, type RuntimeRunPersistenceAdapter, type RuntimeRunRow, RuntimeRunStateError, type RuntimeRunStatus, type RuntimeSession, type RuntimeSessionStore, type RuntimeStreamEvent, type RuntimeStreamEventCollector, type RuntimeStreamEventSink, type RuntimeStreamEventSummary, type RuntimeTelemetryOptions, type SanitizedKnowledgeReadinessReport, type SanitizedKnowledgeRequirement, type Scope, type ServerSentEventOptions, type Settled, type Spend, type SqlAdapter, SqlConversationJournal, type SupervisedKnowledgeUpdateInput, type SupervisedKnowledgeUpdateOptions, type SupervisedKnowledgeUpdateResult, type SupervisedKnowledgeUpdater, type SupervisedResult, type Supervisor, type SupervisorFinalizer, type TurnOrder, ValidationError, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type Verifier, type VerifyResult, type VetoedFact, type WorktreeCheckRunner, type WorktreeLoopRunnerOptions, agenticGenerator, applyExactAgentProfileDiff, applyRolloutPolicyToProfile, applyRunRecordDefaults, assertCandidateProfileBinding, auditLoopRunner, buildAgentCandidateBundle, buildDriverSystem, buildForwardHeaders, buildKnowledgeImprovementExperimentBundles, buildLoopOtelSpans, buildLoopSpanNodes, buildRuntimeEventOtelSpans, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, cleanModelId, commandVerifier, composeRuntimeHooks, computeBackoff, createAgentCandidateWorkspacePort, createAgentKnowledgeReadinessCheck, createConversationBackend, createIterableBackend, createKnowledgeImprovementActivationExecutor, createOpenAICompatibleBackend, createOtelExporter, createProtectedAgentCandidateModelPort, createRuntimeEventCollector, createRuntimeStreamEventCollector, createSandboxPromptBackend, createSupervisedKnowledgeUpdater, d1ToSqlAdapter, decideKnowledgeReadiness, defaultBuildPrompt, defaultIsRetryable, defineConversation, defineRuntimeHooks, disposePreparedAgentCandidateExecution, driverLoopGenerator, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, exportEvalRuns, findingLines, formatSupervisedKnowledgeTask, generateSpanId, getModels, improve, isDelegatedLoopMode, isDepthExceeded, knowledgeReadinessDeliverable, loopEventToOtelSpan, makePerAttemptSignal, mcpBuildPrompt, mcpServeVerifier, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, normalizeRolloutPolicy, notifyRuntimeDecisionPoint, notifyRuntimeHookEvent, officialGepa, officialSkillOpt, optimizerMethod, parseExactAgentProfile, parseExactAgentProfileDiff, parseLoopRunnerArgv, parseRolloutPolicy, persistCandidateOutputArtifact, prepareAgentCandidateExecution, rawTraceDistiller, readDepth, readinessServerSentEvent, recoverExpiredAgentCandidateExecution, reflectiveGenerator, researchDriverNote, researchLoopRunner, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runConversation, runConversationStream, runDelegatedLoop, runKnowledgeImprovementJob, runLoopRunnerCli, runPersonaConversation, runPersonaDispatch, runSupervisedKnowledgeUpdate, runtimeStreamServerSentEvent, sanitizeAgentRuntimeEvent, sanitizeKnowledgeReadinessReport, sanitizeRuntimeStreamEvent, sealAgentCandidateBundle, serializeRolloutPolicy, sleep, slugifySpeaker, startRuntimeRun, strategyAuthorMethod, structuralRolloutPolicyFromProfile, toOtelAttributes, toolBuildPrompt, turnId, validateChatModelId, verifyAgentCandidateBundle, worktreeLoopRunner };
package/dist/index.js CHANGED
@@ -5,16 +5,16 @@ import { i as sealAgentCandidateBundle, n as captureAgentCandidateWorkspaceFiles
5
5
  import { i as buildAgentCandidateBundle, n as disposePreparedAgentCandidateExecution, r as FileAgentCandidateExecutionClaimStore, t as recoverExpiredAgentCandidateExecution } from "./candidate-execution-CfpJrd3o.js";
6
6
  import { n as exactProcessProviderAsCandidateExecutor, t as createProtectedAgentCandidateModelPort } from "./protected-model-port-DqAH1Z2M.js";
7
7
  import { C as makePerAttemptSignal, S as defaultIsRetryable, _ as readDepth, a as FileConversationJournal, b as DeadlineExceededError, c as createConversationBackend, d as slugifySpeaker, f as turnId, g as isDepthExceeded, h as buildForwardHeaders, i as d1ToSqlAdapter, l as runConversation, m as FORWARD_HEADERS, n as runPersonaDispatch, o as InMemoryConversationJournal, p as DEFAULT_MAX_DEPTH, r as SqlConversationJournal, s as defineConversation, t as runPersonaConversation, u as runConversationStream, v as CircuitBreakerState, w as sleep, x as computeBackoff, y as CircuitOpenError } from "./conversation-BpLQZGPH.js";
8
- import { E as runBrainLoop, F as runLocalHarness } from "./supervisor-CspDspod.js";
9
- import { D as researchDriverNote, E as optimizerMethod, O as strategyAuthorMethod, T as buildDriverSystem } from "./structural-rollout-Cqm1dKa7.js";
10
- import { A as improve, B as agenticGenerator, F as normalizeRolloutPolicy, G as summarizeFindings, H as defaultBuildPrompt, I as parseRolloutPolicy, K as worktreeChangedPaths, L as serializeRolloutPolicy, M as rawTraceDistiller, N as ROLLOUT_POLICY_EXTENSION, P as applyRolloutPolicyToProfile, R as structuralRolloutPolicyFromProfile, U as rawTraceEvidenceProblem, V as commandVerifier, W as requiresRawTraceEvidence, j as withMethodRuntimeControls, z as AGENTIC_PROFILE_RESOURCE_ROOT } from "./improvement-cycle-CBLOgfsQ.js";
8
+ import { E as runBrainLoop, F as runLocalHarness } from "./supervisor-DzQu5Ydu.js";
9
+ import { D as researchDriverNote, E as optimizerMethod, O as strategyAuthorMethod, T as buildDriverSystem } from "./structural-rollout-DEf37yQy.js";
10
+ import { A as improve, B as agenticGenerator, F as normalizeRolloutPolicy, G as summarizeFindings, H as defaultBuildPrompt, I as parseRolloutPolicy, K as worktreeChangedPaths, L as serializeRolloutPolicy, M as rawTraceDistiller, N as ROLLOUT_POLICY_EXTENSION, P as applyRolloutPolicyToProfile, R as structuralRolloutPolicyFromProfile, U as rawTraceEvidenceProblem, V as commandVerifier, W as requiresRawTraceEvidence, j as withMethodRuntimeControls, z as AGENTIC_PROFILE_RESOURCE_ROOT } from "./improvement-cycle-tEswzEPr.js";
11
11
  import { i as notifyRuntimeHookEvent, n as defineRuntimeHooks, r as notifyRuntimeDecisionPoint, t as composeRuntimeHooks } from "./runtime-hooks-C7iJOWm3.js";
12
- import { Ft as McpSpawnFault, It as connectStdioMcp } from "./runtime-C_g_SsXg.js";
12
+ import { Ft as McpSpawnFault, It as connectStdioMcp } from "./runtime-BatQajPB.js";
13
13
  import { n as defaultRedactorIdentityMaterial, r as resolveRedactor, t as defaultRedactor } from "./redact-D-u-rrcn.js";
14
- 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-DcIKJaPd.js";
14
+ 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-CUXQE8Sq.js";
15
15
  import { a as createOtelExporter, c as generateSpanId, d as createRuntimeEventCollector, f as createRuntimeStreamEventCollector, h as sanitizeRuntimeStreamEvent, i as buildRuntimeEventOtelSpans, l as loopEventToOtelSpan, m as sanitizeKnowledgeReadinessReport, n as buildLoopOtelSpans, o as exportEvalRuns, p as sanitizeAgentRuntimeEvent, r as buildLoopSpanNodes, t as INTELLIGENCE_WIRE_VERSION, u as toOtelAttributes } from "./otel-export-CPZTSADj.js";
16
- import { a as isDelegatedLoopMode, c as worktreeLoopRunner, i as auditLoopRunner, n as runLoopRunnerCli, o as researchLoopRunner, r as DELEGATED_LOOP_MODES, s as runDelegatedLoop, t as parseLoopRunnerArgv } from "./loop-runner-bin-C2GIqSUn.js";
17
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-BWAEIHkZ.js";
16
+ import { a as isDelegatedLoopMode, c as worktreeLoopRunner, i as auditLoopRunner, n as runLoopRunnerCli, o as researchLoopRunner, r as DELEGATED_LOOP_MODES, s as runDelegatedLoop, t as parseLoopRunnerArgv } from "./loop-runner-bin-DzJz48Fb.js";
17
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-CynwZMZd.js";
18
18
  import { a as resolveRouterBaseUrl, i as resolveChatModel, n as cleanModelId, o as validateChatModelId, r as getModels, t as DEFAULT_ROUTER_BASE_URL } from "./model-resolution-Btd9iIKV.js";
19
19
  import { FAILURE_CLASSES, acquisitionPlansForKnowledgeGaps, blockingKnowledgeEval, canonicalJson, runAgentControlLoop, scoreKnowledgeReadiness, userQuestionsForKnowledgeGaps } from "@tangle-network/agent-eval";
20
20
  import { gepaOptimizationMethod, skillOptOptimizationMethod } from "@tangle-network/agent-eval/campaign";
@@ -1,8 +1,8 @@
1
1
  import { $ as parseExactAgentProfile, K as applyExactAgentProfileDiff, Q as parseAgentCandidateProfileActivation, Z as omitUndefinedObjectFields, rt as canonicalCandidateDigest$1, st as immutableCandidateValue, u as AGENT_CANDIDATE_EXECUTION_SUPPORT } from "./prepare-BHQBb02e.js";
2
2
  import { n as exactProcessProviderAsCandidateExecutor, t as createProtectedAgentCandidateModelPort } from "./protected-model-port-DqAH1Z2M.js";
3
- import { D as buildAgentImprovementActivationTargets, E as assertProfileImprovementTargetsShareIdentity, O as isAgentImprovementProfileSurface, _ as AGENT_IMPROVEMENT_PROFILE_SURFACES, a as executeAgentCandidateExperimentCell, b as agentImprovementProfileSurfaceDigest, d as verifyAgentImprovementActivation, f as verifyAgentImprovementProposal, g as optimizationActivationReceiptFromMetadata, h as createOptimizationActivationReceipt, i as createAgentImprovementProposal, k as isAgentProfileMeasuredSurface, l as reviewAgentImprovementProposal, m as verifyCandidateExecutionEvidence, n as createAgentImprovementActivation, o as proposeAgentImprovement, p as verifyAgentImprovementReview, r as createAgentImprovementMeasuredComparison, s as proposeAgentProfileImprovement, t as AgentCandidateExperimentCellExecutionError, u as runAgentCandidateExperiment, v as AGENT_PROFILE_MEASURED_SURFACES, w as agentImprovementTargetProfileDiffs, x as agentImprovementProfileSurfaceInput, y as agentImprovementProfileDiffs } from "./improvement-cycle-CBLOgfsQ.js";
3
+ import { D as buildAgentImprovementActivationTargets, E as assertProfileImprovementTargetsShareIdentity, O as isAgentImprovementProfileSurface, _ as AGENT_IMPROVEMENT_PROFILE_SURFACES, a as executeAgentCandidateExperimentCell, b as agentImprovementProfileSurfaceDigest, d as verifyAgentImprovementActivation, f as verifyAgentImprovementProposal, g as optimizationActivationReceiptFromMetadata, h as createOptimizationActivationReceipt, i as createAgentImprovementProposal, k as isAgentProfileMeasuredSurface, l as reviewAgentImprovementProposal, m as verifyCandidateExecutionEvidence, n as createAgentImprovementActivation, o as proposeAgentImprovement, p as verifyAgentImprovementReview, r as createAgentImprovementMeasuredComparison, s as proposeAgentProfileImprovement, t as AgentCandidateExperimentCellExecutionError, u as runAgentCandidateExperiment, v as AGENT_PROFILE_MEASURED_SURFACES, w as agentImprovementTargetProfileDiffs, x as agentImprovementProfileSurfaceInput, y as agentImprovementProfileDiffs } from "./improvement-cycle-tEswzEPr.js";
4
4
  import { r as resolveRedactor, t as defaultRedactor } from "./redact-D-u-rrcn.js";
5
- import { n as executeAgentImprovementActivation, r as verifyAgentImprovementActivationResult, t as createAgentImprovementActivationResult } from "./activation-BNQQO-bc.js";
5
+ import { n as executeAgentImprovementActivation, r as verifyAgentImprovementActivationResult, t as createAgentImprovementActivationResult } from "./activation-Bt_XVkjK.js";
6
6
  import { a as createOtelExporter, i as buildRuntimeEventOtelSpans, n as buildLoopOtelSpans, s as flatOtelSpan } from "./otel-export-CPZTSADj.js";
7
7
  import { i as resolveAgentEnvironmentProvider } from "./environment-provider-CCaEhA-l.js";
8
8
  import { contentHash } from "@tangle-network/agent-eval";
package/dist/kernel.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  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";
2
2
  import { $ as ResumedWork, A as providerAsSandboxClient, At as SessionMessageLike, B as Executor, Bt as ExecutorProgress, C as ProviderAsSandboxClientOptions, Ct as WaitSpec, D as WorkspaceRequest, Dt as timerAt, E as SandboxClientProviderOptions, Et as pollFor, F as createTangleSandboxExactProcessProvider, Ft as decodeToolPart, G as Handle, H as ExecutorFactory, Ht as WorkerProgress, I as Agent, It as sandboxSessionTraceSource, J as NodeSnapshot, K as NoWinnerError, L as AgentSpec, Lt as ActivityLog, M as sandboxClientAsProvider, Mt as ToolStepInput, N as CreateTangleSandboxExactProcessProviderOptions, Nt as TraceSource, O as createAgentEnvironmentProviderRegistry, Ot as validateWaitSpec, P as SandboxControlClient, Pt as createPushTraceSource, Q as ResumedKeyState, R as Budget, Rt as ActivityNote, S as PlacementInfo, St as WaitRejection, T as ResourceRequest, Tt as isWaitOutcome, U as ExecutorRegistry, Ut as createActivityLog, V as ExecutorContext, Vt as ScopeProgressInput, W as ExecutorResult, Wt as readWorkerProgress, X as Restart, Y as NodeStatus, Z as ResultBlobStore, _ as CheckpointRequest, _t as WidenGate, a as AgentEnvironmentProviderRef, at as SpawnEvent, b as ExecResult, bt as WaitProbe, c as AgentEnvironmentStatus, ct as SpawnPrior, d as AgentSession, dt as SupervisedResult, et as RootHandle, f as AgentSessionRef, ft as Supervisor, g as CheckpointRef, gt as WaitOpts, h as AgentTurnResult, ht as UsageEvent, i as AgentEnvironmentProvider, it as Settled, j as resolveAgentEnvironmentProvider, jt as SessionTraceBox, k as providerAsExecutor, kt as waitUntil, l as AgentEnvironmentSummary, lt as SpawnRejection, m as AgentTurnInput, mt as TreeView, n as AgentEnvironmentCapabilities, nt as Runtime, o as AgentEnvironmentProviderRegistry, ot as SpawnJournal, p as AgentSessionStatus, pt as SupervisorOpts, q as NodeId, r as AgentEnvironmentEvent, rt as Scope, s as AgentEnvironmentQuery, st as SpawnOpts, t as AgentEnvironment, tt as RootSignal, u as AgentProfileRef, ut as Spend, v as CreateAgentEnvironmentInput, vt as PendingWait, w as ProviderExecutorOptions, wt as createWaitProbes, x as ForkRequest, xt as WaitProbeRegistry, y as ExecRequest, yt as WaitOutcome, zt as DEFAULT_STALL_AFTER_MS } from "./environment-provider-Cygthiy3.js";
3
- import { $ as safeWorkerFile, $a as HarvestCorpusOptions, $c as InboxMessage, $d as defaultToolDetectors, $i as BenchmarkStrategySummary, $n as modelAuthoredChecks, $o as Persona, $r as CheckpointCapableBox, $s as plateauLength, $t as StopDecision, A as GitWorkspaceOptions, Aa as LoopDispatchOptions, Ai as renderCorpusToInstructions, An as assessAuthoredProfile, Ao as Pipeline, Ar as strategyAuthorContract, As as LeaderboardOptions, At as DelegateOptions, B as analyzeTrace, Ba as localSandboxClient, Bc as ProviderSeam, Bi as RegistryAnalyzeProjection, Bn as CheckSourceCtx, Bo as TrajectoryReportFn, Br as McpToolDescriptor, Bs as renderLeaderboardSvg, Bt as supervisorAgent, C as closingWorkerNote, Ca as defineStrategy, Ci as builtinShapes, Cn as ReservationTicket, Co as LoopUntil, Cr as pickChampion, Cs as deterministicCompletion, Ct as DispatchStopReason, D as UntrackedCopyStats, Da as sample, Di as runPersonified, Dn as ProfileRichness, Do as PanelJudge, Dr as AuthoredStrategy, Ds as GroupOf, Dt as freeSlots, E as CopyOptions, Ea as runAgentic, Ei as definePersona, En as AuthoredProfile, Eo as Panel, Er as AuthorStrategyOptions, Es as AxisScoresOf, Et as effectiveConcurrency, F as gitWorkspace, Fa as RunLoopOptions, Fc as BridgeSeam, Fi as pipeline, Fn as CheckExecChannel, Fo as ScopeAnalyzeInput, Fr as dumbDriver, Fs as ScoreOf, Ft as ResolvedSupervisorProfile, G as supervise, Ga as resolveMcpServerLaunch, Gc as createExecutor, Gi as McpEndpoint, Gn as StructuralRolloutResult, Go as WidenDecision, Gr as Deliverable, Gs as auditIntent, Gt as finalizeBestDelivered, H as SuperviseOptions, Ha as ResolvedMcpServerLaunch, Hc as RouterToolsSeam, Hi as buildSteerContext, Hn as StructuralRolloutConfig, Ho as Verify, Hr as StdioMcpServerSpec, Hs as AuditIntentInput, Ht as serveCoordinationMcp, I as jjWorkspace, Ia as defaultSelectWinner, Ic as CliSeam, Ii as selectValidWinner, In as CheckOutcome, Io as ScopeWidenGate, Ir as naiveDriver, Is as leaderboard, It as SupervisorAgentDeps, J as createScope, Ja as inlineSandboxClient, Jc as SandboxSteeringOptions, Jd as BusStats, Ji as sanitizeMcpToolSchema, Jn as compareCheckOutcomes, Jo as WinnerStrategy, Jr as OpenSandboxRunPromptOptions, Js as AnytimeStrategySummary, Jt as PlateauOptions, K as workerFromBackend, Ka as resolveSecretEnv, Kc as createExecutorRegistry, Kd as BusEvent, Ki as McpEnvironmentOptions, Kn as VisibleCheck, Ko as WidenLineage, Kr as OpenSandboxRunBeforeStartContext, Ks as defaultAuditorInstruction, Kt as AllWorkersStalledOptions, L as localShell, La as runAgentRounds, Lc as CliWorktreeBridgeSeam, Li as verify, Ln as CheckRunContext, Lo as SteerContext, Lr as LocalMcpMaterialization, Ls as pairwiseSignificance, Lt as SupervisorProfile, M as Workspace, Ma as loopCampaignDispatch, Mi as flatWidenGate, Mn as defaultProfileRichnessThresholds, Mo as RenderCorpusToInstructions, Mr as DumbDriverOptions, Ms as PairwiseOptions, Mt as delegate, N as WorkspaceCommit, Na as loopDispatch, Ni as loopUntil, Nn as profileRichnessFinding, No as RenderCorpusToInstructionsOptions, Nr as NaiveDriverOptions, Ns as PairwiseVerdict, Nt as CoordinationBinding, O as copyUntrackedIntoClone, Oa as sampleThenRefine, Oi as FileCorpus, On as ProfileRichnessThresholds, Oo as PanelSpec, Or as assertStrategyContract, Os as Interval, Ot as queueOf, P as WorkspaceRun, Pa as RunAgentRoundsOptions, Pi as panel, Pn as supervisorInstructions, Po as ScopeAnalyst, Pr as SteeringDecision, Ps as ProfileKeyOf, Pt as DriveHarness, Q as readWorkerSteerRequests, Qa as inProcessSandboxClient, Qc as Inbox, Qd as WatchTraceOptions, Qi as BenchmarkReport, Qn as filterAuthoredAsserts, Qo as Outcome, Qr as openSandboxRun, Qs as bestSoFar, Qt as ProgressView, R as runInWorkspace, Ra as runLoop, Rc as CliWorktreeSeam, Ri as widen, Rn as CheckRunner, Ro as TrajectoryNode, Rr as MaterializeLocalMcpOptions, Rs as renderLeaderboardHtml, Rt as assertCoordinationBinding, S as WorkerEvidenceInput, Sa as breadthStrategy, Si as trajectoryReport, Sn as ReservationRejection, So as FlatWidenGate, Sr as discriminatingMeans, Ss as completionAuthorizes, St as DispatchReport, T as settledWorkerOut, Ta as refine, Ti as registerShape, Tn as spendFromUsageEvents, To as LoopUntilState, Tr as selectChampion, Ts as stopSentinel, Tt as RollingDispatchOptions, U as SuperviseRegistry, Ua as envKeyProvider, Uc as SandboxSeam, Ui as createScopeAnalyst, Un as StructuralRolloutMessage, Uo as VerifySpec, Ur as connectStdioMcp, Us as AuditIntentOptions, Ut as DriverAgentOptions, V as createSupervisor, Va as KeyProvider, Vc as RouterSeam, Vi as assertTraceDerivedFindings, Vn as RepairStop, Vo as TrajectoryReportOptions, Vr as StdioMcpConnection, Vs as renderPairwiseMarkdown, Vt as CoordinationMcpHandle, W as SuperviseRegistryTable, Wa as mcpSecretEnvMetadataKey, Wc as cliWorktreeExecutor, Wi as registryScopeAnalyst, Wn as StructuralRolloutPolicy, Wo as Widen, Wr as materializeLocalMcp, Ws as IntentAudit, Wt as driverAgent, X as WorkerSteerRequest, Xa as InProcessPromptCtx, Xc as SteerableSandboxSession, Xd as PublishOptions, Xi as BenchmarkConfig, Xn as defaultExtractCandidate, Xo as DefinePersonaInput, Xr as SandboxRunAbortError, Xs as anytimeReport, Xt as ProgressTracker, Y as settledToIteration, Ya as InProcessOnPrompt, Yc as SteerableSandboxArgs, Yd as EventBus, Yi as BenchmarkCell, Yn as composeCheckSources, Yo as DefinePersona, Yr as SandboxRun, Ys as AnytimeTaskCurve, Yt as ProgressSample, Z as legacySupervisorRunDir, Za as InProcessSandboxClientOptions, Zc as createSteerableSandboxSession, Zd as createEventBus, Zi as BenchmarkLift, Zn as defaultStructuralRolloutPolicy, Zo as LoopShape, Zr as TurnResult, Zs as areaUnderCurve, Zt as ProgressTrackerOptions, _ as WorktreeFanoutOptions, _a as StrategyMessage, _i as resolveSandboxClient, _l as WorktreeCommandResult, _n as CoordinationLog, _o as EqualKVerdict, _r as EvolutionCandidate, _s as defineLeaderboard, _t as SupervisorSpanOutcome, a as SandboxInstance, aa as AgenticRunResult, ac as AnalystFindingEvent, af as InMemoryResultBlobStore, ai as SandboxToolPartState, al as piSeamKey, an as noProgressFor, ao as ObserveOptions, ar as visibleCheckScore, as as ShapeContext, at as InMemoryRunContext, b as NOTE_MAX_CHARS, ba as SurfaceScore, bi as promotionGate, bn as BudgetPool, bo as FanoutSynthesis, br as ReproductionCheck, bs as CompletionPolicy, bt as assertModelAllowed, c as VerifierEnvironmentOptions, ca as AgenticTool, cf as materializeTreeView, ci as mapSandboxEvent, cl as PI_MCP_CONFIG_FLAG, cn as DeliveredOutput, co as renderReport, cr as CollectedAgentTurn, cs as LeaderboardBenchScore, ct as createFileRunContext, d as SuperviseSurfaceResult, da as RunAgenticOptions, dc as DownMessageEvent, di as CriuCapableClient, dl as PiMcpPreparation, dn as SupervisorFinalizer, do as Corpus, dr as streamAgentTurn, ds as LeaderboardFlagSpec, dt as patchDelivered, ea as BenchmarkTaskRow, ec as renderAnytimeTable, ef as watchTrace, ei as ForkCapableBox, el as createInbox, en as StopRule, eo as HarvestFailure, er as officialChecksFromMeta, es as PersonaContext, et as supervisorRunDir, f as SurfaceWorkerConfig, fa as ShotPersona, fc as MakeWorkerAgent, fi as SandboxCapabilities, fl as PiMcpReceipt, fn as bestDelivered, fo as CorpusFilter, fr as ChampionPick, fs as LeaderboardIterationInfo, ft as WorktreeCliExecutorOptions, g as AuthoredHarness, ga as StrategyCtx, gi as ResolveSandboxClientOptions, gl as WorktreeCheckRunner, gn as runTree, go as EqualKOnCostOptions, gr as EvolutionBandInfo, gs as LeaderboardSpec, gt as SupervisorSpanOptions, h as superviseSurface, ha as StrategyArtifacts, hi as acquireSandbox, hl as preparePiMcp, hn as runFinalizer, ho as EqualKOnCost, hr as EvolutionAuthor, hs as LeaderboardScore, ht as SupervisorSpanAttributes, i as SandboxEvent, ia as AgenticOptions, ic as createWaterfallCollector, if as FileSpawnJournal, ii as createSandboxLineage, il as piExecutor, in as createProgressTracker, io as ObserveInput, ir as structuralRollout, is as ShapeBudget, it as writeWorkerSteer, j as Shell, ja as LoopOptionsForDispatch, ji as fanout, jn as authoredWorker, jo as PipelineStage, jr as ApplyContinuation, js as LeaderboardRow, jt as defaultDelegateBudget, k as withUntrackedArtifacts, ka as LoopCampaignDispatchOptions, ki as InMemoryCorpus, kn as asAuthoredProfile, ko as PanelVerdict, kr as authorStrategy, ks as Leaderboard, kt as rollingDispatch, l as createVerifierEnvironment, la as ArtifactHandle, lf as pendingWaits, li as mapSandboxToolEvent, ll as PiMcpMount, ln as FinalizeContext, lo as AssertTraceDerivedFindings, lr as StreamAgentTurnOptions, ls as LeaderboardBenchTask, lt as createInMemoryRunContext, m as failuresAnalyst, ma as Strategy, mi as AcquireOptions, ml as piMcpAdapterAvailable, mn as pickBestDelivered, mo as EqualKArm, mr as EvolutionArchiveNode, ms as LeaderboardScenario, mt as createWorktreeCliExecutor, n as AnalystFinding, na as printBenchmarkReport, nc as WaterfallReport, nf as gateOnDeliverable, ni as SandboxLineageHandle, nl as PiExecutorOutput, nn as allWorkersStalled, no as harvestCorpus, nr as sandboxCheckRunner, ns as RunPersonified, nt as workerInboxFile, o as computeFindingId, oa as AgenticSurface, oc as AnalystRegistry, of as InMemorySpawnJournal, oi as createSandboxToolPartState, ol as PI_MCP_ADAPTER, on as plateau, oo as defaultAnalystInstruction, or as AgentTurnBackend, os as ShapeRegistry, ot as InMemoryRunContextOptions, p as SurfaceWorkerOut, pa as ShotSpec, pi as probeSandboxCapabilities, pl as buildPiMcpServers, pn as collectDelivered, po as CorpusRecord, pr as ChampionPolicy, ps as LeaderboardRunContext, pt as WorktreePatchArtifact, q as ScopeArgs, qa as secretEnvOfMcpServer, qc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, qd as BusRecord, qi as createMcpEnvironment, qn as canDisplace, qo as WidenSpec, qr as OpenSandboxRunOptions, qs as AnytimeReport, qt as NoProgressForOptions, r as CreateSandboxOptions, ra as runBenchmark, rc as WaterfallSpan, rf as FileResultBlobStore, ri as SessionCapableBox, rl as PiSeam, rn as anyOf, ro as Observation, rr as selectBestIndex, rs as RunPersonifiedOptions, rt as workerInboxFileFromEventDir, s as makeFinding, sa as AgenticTask, sc as CoordinationEvent, sf as contentAddress, si as extractLlmCallEvent, sl as PI_MCP_ADAPTER_ENV, sn as sampleFromSettled, so as observe, sr as AgentTurnUsage, ss as DefinedLeaderboard, st as RunContext, t as AgentProfile, ta as Environment, tc as WaterfallCollector, tf as DeliverableSpec, ti as SandboxLineage, tl as PI_RUNTIME, tn as allOf, to as HarvestReport, tr as resolveEntrySymbol, ts as PersonaExecutors, tt as supervisorRunsRoot, u as SuperviseSurfaceOptions, ua as CorpusReadbackOptions, uc as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, uf as replaySpawnTree, ui as sumSandboxUsage, ul as PiMcpMountOptions, un as FinalizerSettled, uo as CombinatorShape, ur as collectAgentTurn, us as LeaderboardBenchmarkAdapter, ut as PatchDeliverableOptions, v as worktreeFanout, va as StrategyResult, vi as PromotionGateOptions, vl as WorktreeHarnessResult, vn as FileCoordinationLog, vo as Fanout, vr as EvolutionGeneration, vs as CompletionAnalyst, vt as SupervisorSpanRecorder, w as composeWorkerEvidence, wa as depthStrategy, wi as createShapeRegistry, wn as createBudgetPool, wo as LoopUntilSpec, wr as runStrategyEvolution, ws as sentinelCompletion, wt as DispatchUnit, x as VERIFY_TAIL_CHARS, xa as adaptiveRefine, xi as equalKOnCost, xn as BudgetReadout, xo as FanoutWinnerSelector, xr as StrategyEvolutionConfig, xs as CompletionVerdict, xt as ConcurrencyCaps, y as EVIDENCE_MAX_CHARS, ya as StrategyShotResult, yi as PromotionVerdict, yl as WorktreeProfileMaterializationReceipt, yn as PriorCoordination, yo as FanoutOptions, yr as EvolutionReport, ys as CompletionEvidence, yt as createSupervisorSpanRecorder, z as TrajectoryAnalysis, za as LocalSandboxClientOptions, zc as ExecutorConfig, zi as CreateScopeAnalystOptions, zn as CheckSource, zo as TrajectoryReport, zr as McpSpawnFault, zs as renderLeaderboardMarkdown, zt as resolveSupervisorProfile } from "./index-BuzkRsOn.js";
3
+ import { $ as safeWorkerFile, $a as HarvestCorpusOptions, $c as InboxMessage, $d as defaultToolDetectors, $i as BenchmarkStrategySummary, $n as modelAuthoredChecks, $o as Persona, $r as CheckpointCapableBox, $s as plateauLength, $t as StopDecision, A as GitWorkspaceOptions, Aa as LoopDispatchOptions, Ai as renderCorpusToInstructions, An as assessAuthoredProfile, Ao as Pipeline, Ar as strategyAuthorContract, As as LeaderboardOptions, At as DelegateOptions, B as analyzeTrace, Ba as localSandboxClient, Bc as ProviderSeam, Bi as RegistryAnalyzeProjection, Bn as CheckSourceCtx, Bo as TrajectoryReportFn, Br as McpToolDescriptor, Bs as renderLeaderboardSvg, Bt as supervisorAgent, C as closingWorkerNote, Ca as defineStrategy, Ci as builtinShapes, Cn as ReservationTicket, Co as LoopUntil, Cr as pickChampion, Cs as deterministicCompletion, Ct as DispatchStopReason, D as UntrackedCopyStats, Da as sample, Di as runPersonified, Dn as ProfileRichness, Do as PanelJudge, Dr as AuthoredStrategy, Ds as GroupOf, Dt as freeSlots, E as CopyOptions, Ea as runAgentic, Ei as definePersona, En as AuthoredProfile, Eo as Panel, Er as AuthorStrategyOptions, Es as AxisScoresOf, Et as effectiveConcurrency, F as gitWorkspace, Fa as RunLoopOptions, Fc as BridgeSeam, Fi as pipeline, Fn as CheckExecChannel, Fo as ScopeAnalyzeInput, Fr as dumbDriver, Fs as ScoreOf, Ft as ResolvedSupervisorProfile, G as supervise, Ga as resolveMcpServerLaunch, Gc as createExecutor, Gi as McpEndpoint, Gn as StructuralRolloutResult, Go as WidenDecision, Gr as Deliverable, Gs as auditIntent, Gt as finalizeBestDelivered, H as SuperviseOptions, Ha as ResolvedMcpServerLaunch, Hc as RouterToolsSeam, Hi as buildSteerContext, Hn as StructuralRolloutConfig, Ho as Verify, Hr as StdioMcpServerSpec, Hs as AuditIntentInput, Ht as serveCoordinationMcp, I as jjWorkspace, Ia as defaultSelectWinner, Ic as CliSeam, Ii as selectValidWinner, In as CheckOutcome, Io as ScopeWidenGate, Ir as naiveDriver, Is as leaderboard, It as SupervisorAgentDeps, J as createScope, Ja as inlineSandboxClient, Jc as SandboxSteeringOptions, Jd as BusStats, Ji as sanitizeMcpToolSchema, Jn as compareCheckOutcomes, Jo as WinnerStrategy, Jr as OpenSandboxRunPromptOptions, Js as AnytimeStrategySummary, Jt as PlateauOptions, K as workerFromBackend, Ka as resolveSecretEnv, Kc as createExecutorRegistry, Kd as BusEvent, Ki as McpEnvironmentOptions, Kn as VisibleCheck, Ko as WidenLineage, Kr as OpenSandboxRunBeforeStartContext, Ks as defaultAuditorInstruction, Kt as AllWorkersStalledOptions, L as localShell, La as runAgentRounds, Lc as CliWorktreeBridgeSeam, Li as verify, Ln as CheckRunContext, Lo as SteerContext, Lr as LocalMcpMaterialization, Ls as pairwiseSignificance, Lt as SupervisorProfile, M as Workspace, Ma as loopCampaignDispatch, Mi as flatWidenGate, Mn as defaultProfileRichnessThresholds, Mo as RenderCorpusToInstructions, Mr as DumbDriverOptions, Ms as PairwiseOptions, Mt as delegate, N as WorkspaceCommit, Na as loopDispatch, Ni as loopUntil, Nn as profileRichnessFinding, No as RenderCorpusToInstructionsOptions, Nr as NaiveDriverOptions, Ns as PairwiseVerdict, Nt as CoordinationBinding, O as copyUntrackedIntoClone, Oa as sampleThenRefine, Oi as FileCorpus, On as ProfileRichnessThresholds, Oo as PanelSpec, Or as assertStrategyContract, Os as Interval, Ot as queueOf, P as WorkspaceRun, Pa as RunAgentRoundsOptions, Pi as panel, Pn as supervisorInstructions, Po as ScopeAnalyst, Pr as SteeringDecision, Ps as ProfileKeyOf, Pt as DriveHarness, Q as readWorkerSteerRequests, Qa as inProcessSandboxClient, Qc as Inbox, Qd as WatchTraceOptions, Qi as BenchmarkReport, Qn as filterAuthoredAsserts, Qo as Outcome, Qr as openSandboxRun, Qs as bestSoFar, Qt as ProgressView, R as runInWorkspace, Ra as runLoop, Rc as CliWorktreeSeam, Ri as widen, Rn as CheckRunner, Ro as TrajectoryNode, Rr as MaterializeLocalMcpOptions, Rs as renderLeaderboardHtml, Rt as assertCoordinationBinding, S as WorkerEvidenceInput, Sa as breadthStrategy, Si as trajectoryReport, Sn as ReservationRejection, So as FlatWidenGate, Sr as discriminatingMeans, Ss as completionAuthorizes, St as DispatchReport, T as settledWorkerOut, Ta as refine, Ti as registerShape, Tn as spendFromUsageEvents, To as LoopUntilState, Tr as selectChampion, Ts as stopSentinel, Tt as RollingDispatchOptions, U as SuperviseRegistry, Ua as envKeyProvider, Uc as SandboxSeam, Ui as createScopeAnalyst, Un as StructuralRolloutMessage, Uo as VerifySpec, Ur as connectStdioMcp, Us as AuditIntentOptions, Ut as DriverAgentOptions, V as createSupervisor, Va as KeyProvider, Vc as RouterSeam, Vi as assertTraceDerivedFindings, Vn as RepairStop, Vo as TrajectoryReportOptions, Vr as StdioMcpConnection, Vs as renderPairwiseMarkdown, Vt as CoordinationMcpHandle, W as SuperviseRegistryTable, Wa as mcpSecretEnvMetadataKey, Wc as cliWorktreeExecutor, Wi as registryScopeAnalyst, Wn as StructuralRolloutPolicy, Wo as Widen, Wr as materializeLocalMcp, Ws as IntentAudit, Wt as driverAgent, X as WorkerSteerRequest, Xa as InProcessPromptCtx, Xc as SteerableSandboxSession, Xd as PublishOptions, Xi as BenchmarkConfig, Xn as defaultExtractCandidate, Xo as DefinePersonaInput, Xr as SandboxRunAbortError, Xs as anytimeReport, Xt as ProgressTracker, Y as settledToIteration, Ya as InProcessOnPrompt, Yc as SteerableSandboxArgs, Yd as EventBus, Yi as BenchmarkCell, Yn as composeCheckSources, Yo as DefinePersona, Yr as SandboxRun, Ys as AnytimeTaskCurve, Yt as ProgressSample, Z as legacySupervisorRunDir, Za as InProcessSandboxClientOptions, Zc as createSteerableSandboxSession, Zd as createEventBus, Zi as BenchmarkLift, Zn as defaultStructuralRolloutPolicy, Zo as LoopShape, Zr as TurnResult, Zs as areaUnderCurve, Zt as ProgressTrackerOptions, _ as WorktreeFanoutOptions, _a as StrategyMessage, _i as resolveSandboxClient, _l as WorktreeCommandResult, _n as CoordinationLog, _o as EqualKVerdict, _r as EvolutionCandidate, _s as defineLeaderboard, _t as SupervisorSpanOutcome, a as SandboxInstance, aa as AgenticRunResult, ac as AnalystFindingEvent, af as InMemoryResultBlobStore, ai as SandboxToolPartState, al as piSeamKey, an as noProgressFor, ao as ObserveOptions, ar as visibleCheckScore, as as ShapeContext, at as InMemoryRunContext, b as NOTE_MAX_CHARS, ba as SurfaceScore, bi as promotionGate, bn as BudgetPool, bo as FanoutSynthesis, br as ReproductionCheck, bs as CompletionPolicy, bt as assertModelAllowed, c as VerifierEnvironmentOptions, ca as AgenticTool, cf as materializeTreeView, ci as mapSandboxEvent, cl as PI_MCP_CONFIG_FLAG, cn as DeliveredOutput, co as renderReport, cr as CollectedAgentTurn, cs as LeaderboardBenchScore, ct as createFileRunContext, d as SuperviseSurfaceResult, da as RunAgenticOptions, dc as DownMessageEvent, di as CriuCapableClient, dl as PiMcpPreparation, dn as SupervisorFinalizer, do as Corpus, dr as streamAgentTurn, ds as LeaderboardFlagSpec, dt as patchDelivered, ea as BenchmarkTaskRow, ec as renderAnytimeTable, ef as watchTrace, ei as ForkCapableBox, el as createInbox, en as StopRule, eo as HarvestFailure, er as officialChecksFromMeta, es as PersonaContext, et as supervisorRunDir, f as SurfaceWorkerConfig, fa as ShotPersona, fc as MakeWorkerAgent, fi as SandboxCapabilities, fl as PiMcpReceipt, fn as bestDelivered, fo as CorpusFilter, fr as ChampionPick, fs as LeaderboardIterationInfo, ft as WorktreeCliExecutorOptions, g as AuthoredHarness, ga as StrategyCtx, gi as ResolveSandboxClientOptions, gl as WorktreeCheckRunner, gn as runTree, go as EqualKOnCostOptions, gr as EvolutionBandInfo, gs as LeaderboardSpec, gt as SupervisorSpanOptions, h as superviseSurface, ha as StrategyArtifacts, hi as acquireSandbox, hl as preparePiMcp, hn as runFinalizer, ho as EqualKOnCost, hr as EvolutionAuthor, hs as LeaderboardScore, ht as SupervisorSpanAttributes, i as SandboxEvent, ia as AgenticOptions, ic as createWaterfallCollector, if as FileSpawnJournal, ii as createSandboxLineage, il as piExecutor, in as createProgressTracker, io as ObserveInput, ir as structuralRollout, is as ShapeBudget, it as writeWorkerSteer, j as Shell, ja as LoopOptionsForDispatch, ji as fanout, jn as authoredWorker, jo as PipelineStage, jr as ApplyContinuation, js as LeaderboardRow, jt as defaultDelegateBudget, k as withUntrackedArtifacts, ka as LoopCampaignDispatchOptions, ki as InMemoryCorpus, kn as asAuthoredProfile, ko as PanelVerdict, kr as authorStrategy, ks as Leaderboard, kt as rollingDispatch, l as createVerifierEnvironment, la as ArtifactHandle, lf as pendingWaits, li as mapSandboxToolEvent, ll as PiMcpMount, ln as FinalizeContext, lo as AssertTraceDerivedFindings, lr as StreamAgentTurnOptions, ls as LeaderboardBenchTask, lt as createInMemoryRunContext, m as failuresAnalyst, ma as Strategy, mi as AcquireOptions, ml as piMcpAdapterAvailable, mn as pickBestDelivered, mo as EqualKArm, mr as EvolutionArchiveNode, ms as LeaderboardScenario, mt as createWorktreeCliExecutor, n as AnalystFinding, na as printBenchmarkReport, nc as WaterfallReport, nf as gateOnDeliverable, ni as SandboxLineageHandle, nl as PiExecutorOutput, nn as allWorkersStalled, no as harvestCorpus, nr as sandboxCheckRunner, ns as RunPersonified, nt as workerInboxFile, o as computeFindingId, oa as AgenticSurface, oc as AnalystRegistry, of as InMemorySpawnJournal, oi as createSandboxToolPartState, ol as PI_MCP_ADAPTER, on as plateau, oo as defaultAnalystInstruction, or as AgentTurnBackend, os as ShapeRegistry, ot as InMemoryRunContextOptions, p as SurfaceWorkerOut, pa as ShotSpec, pi as probeSandboxCapabilities, pl as buildPiMcpServers, pn as collectDelivered, po as CorpusRecord, pr as ChampionPolicy, ps as LeaderboardRunContext, pt as WorktreePatchArtifact, q as ScopeArgs, qa as secretEnvOfMcpServer, qc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, qd as BusRecord, qi as createMcpEnvironment, qn as canDisplace, qo as WidenSpec, qr as OpenSandboxRunOptions, qs as AnytimeReport, qt as NoProgressForOptions, r as CreateSandboxOptions, ra as runBenchmark, rc as WaterfallSpan, rf as FileResultBlobStore, ri as SessionCapableBox, rl as PiSeam, rn as anyOf, ro as Observation, rr as selectBestIndex, rs as RunPersonifiedOptions, rt as workerInboxFileFromEventDir, s as makeFinding, sa as AgenticTask, sc as CoordinationEvent, sf as contentAddress, si as extractLlmCallEvent, sl as PI_MCP_ADAPTER_ENV, sn as sampleFromSettled, so as observe, sr as AgentTurnUsage, ss as DefinedLeaderboard, st as RunContext, t as AgentProfile, ta as Environment, tc as WaterfallCollector, tf as DeliverableSpec, ti as SandboxLineage, tl as PI_RUNTIME, tn as allOf, to as HarvestReport, tr as resolveEntrySymbol, ts as PersonaExecutors, tt as supervisorRunsRoot, u as SuperviseSurfaceOptions, ua as CorpusReadbackOptions, uc as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, uf as replaySpawnTree, ui as sumSandboxUsage, ul as PiMcpMountOptions, un as FinalizerSettled, uo as CombinatorShape, ur as collectAgentTurn, us as LeaderboardBenchmarkAdapter, ut as PatchDeliverableOptions, v as worktreeFanout, va as StrategyResult, vi as PromotionGateOptions, vl as WorktreeHarnessResult, vn as FileCoordinationLog, vo as Fanout, vr as EvolutionGeneration, vs as CompletionAnalyst, vt as SupervisorSpanRecorder, w as composeWorkerEvidence, wa as depthStrategy, wi as createShapeRegistry, wn as createBudgetPool, wo as LoopUntilSpec, wr as runStrategyEvolution, ws as sentinelCompletion, wt as DispatchUnit, x as VERIFY_TAIL_CHARS, xa as adaptiveRefine, xi as equalKOnCost, xn as BudgetReadout, xo as FanoutWinnerSelector, xr as StrategyEvolutionConfig, xs as CompletionVerdict, xt as ConcurrencyCaps, y as EVIDENCE_MAX_CHARS, ya as StrategyShotResult, yi as PromotionVerdict, yl as WorktreeProfileMaterializationReceipt, yn as PriorCoordination, yo as FanoutOptions, yr as EvolutionReport, ys as CompletionEvidence, yt as createSupervisorSpanRecorder, z as TrajectoryAnalysis, za as LocalSandboxClientOptions, zc as ExecutorConfig, zi as CreateScopeAnalystOptions, zn as CheckSource, zo as TrajectoryReport, zr as McpSpawnFault, zs as renderLeaderboardMarkdown, zt as resolveSupervisorProfile } from "./index-BUWd8QJq.js";
4
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-BnB1E9nM.js";
5
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 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 AxisScoresOf, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, type Budget, type BudgetPool, 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 CoordinationBinding, type CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, type CopyOptions, type Corpus, type CorpusFilter, type CorpusReadbackOptions, type CorpusRecord, type CreateAgentEnvironmentInput, type CreateSandboxOptions, type CreateScopeAnalystOptions, type CreateTangleSandboxExactProcessProviderOptions, type CriuCapableClient, 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 DeliverableSpec, type DeliveredOutput, type DispatchReport, type DispatchStopReason, type DispatchUnit, type DownMessageEvent, type DriveHarness, 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 Executor, type ExecutorConfig, type ExecutorContext, type ExecutorFactory, 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 McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, type MountManifestEntry, type MountRecorder, NOTE_MAX_CHARS, type NaiveDriverOptions, type NoProgressForOptions, type NoWinnerError, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, 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 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 ResolveSandboxClientOptions, type ResolvedMcpServerLaunch, type ResolvedSupervisorProfile, type ResourceRequest, type Restart, type ResultBlobStore, type ResumedKeyState, type ResumedWork, type RollingDispatchOptions, type RootHandle, 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 SpawnJournal, type SpawnOpts, type SpawnPrior, type SpawnRejection, type Spend, type StdioMcpConnection, type StdioMcpServerSpec, type SteerContext, 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 SupervisorOpts, type SupervisorProfile, type SupervisorSpanAttributes, type SupervisorSpanOptions, type SupervisorSpanOutcome, type SupervisorSpanRecorder, 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 UntrackedCopyStats, type UsageEvent, VERIFY_TAIL_CHARS, type ValidationCtx, type Validator, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type VisibleCheck, 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 WorkerSteerRequest, 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, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, 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, worktreeFanout, writeWorkerSteer };
package/dist/kernel.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as contentAddress, c as replaySpawnTree, i as InMemorySpawnJournal, n as FileSpawnJournal, o as materializeTreeView, r as InMemoryResultBlobStore, s as pendingWaits, t as FileResultBlobStore } from "./spawn-journal-DCPbicXB.js";
2
- import { C as routerChatWithUsage, S as routerChatWithTools, T as streamRouterChatWithTools, _ as waitUntil, a as runFinalizer, b as readWorkerProgress, c as spendFromUsageEvents, d as settledToIteration, f as createWaitProbes, g as validateWaitSpec, h as timerAt, i as pickBestDelivered, m as pollFor, n as bestDelivered, o as runTree, p as isWaitOutcome, r as collectDelivered, s as createBudgetPool, t as createSupervisor, u as createScope, v as DEFAULT_STALL_AFTER_MS, w as routerToolLoop, x as routerBrain, y as createActivityLog } from "./supervisor-CspDspod.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-Cqm1dKa7.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-C_g_SsXg.js";
2
+ import { C as routerChatWithUsage, S as routerChatWithTools, T as streamRouterChatWithTools, _ as waitUntil, a as runFinalizer, b as readWorkerProgress, c as spendFromUsageEvents, d as settledToIteration, f as createWaitProbes, g as validateWaitSpec, h as timerAt, i as pickBestDelivered, m as pollFor, n as bestDelivered, o as runTree, p as isWaitOutcome, r as collectDelivered, s as createBudgetPool, t as createSupervisor, u as createScope, v as DEFAULT_STALL_AFTER_MS, w as routerToolLoop, x as routerBrain, y as createActivityLog } from "./supervisor-DzQu5Ydu.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-DEf37yQy.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-BatQajPB.js";
5
5
  import { i as mapSandboxToolEvent, n as extractLlmCallEvent, o as sumSandboxUsage, r as mapSandboxEvent, t as createSandboxToolPartState } from "./sandbox-events-DeI5xX8P.js";
6
- import { $t as FileCoordinationLog, At as createWorktreeCliExecutor, B as profileRichnessFinding, Bt as PI_MCP_ADAPTER_ENV, Ct as defaultToolDetectors, Dt as cliWorktreeExecutor, Et as createInMemoryRunContext, F as delegate, Ft as piSeamKey, Gt as createInbox, Ht as buildPiMcpServers, I as asAuthoredProfile, It as createPushTraceSource, Jt as runAgentRounds, L as assessAuthoredProfile, Lt as decodeToolPart, Mt as createSteerableSandboxSession, Nt as PI_RUNTIME, Ot as createExecutor, P as defaultDelegateBudget, Pt as piExecutor, Qt as acquireSandbox, R as authoredWorker, Rt as sandboxSessionTraceSource, St as rollingDispatch, Tt as createFileRunContext, Ut as piMcpAdapterAvailable, V as supervisorInstructions, Vt as PI_MCP_CONFIG_FLAG, Wt as preparePiMcp, Xt as createSandboxLineage, Yt as runLoop, Zt as probeSandboxCapabilities, a as supervisorAgent, at as allWorkersStalled, bt as freeSlots, ct as noProgressFor, dt as anytimeReport, en as createSupervisorSpanRecorder, ft as areaUnderCurve, gt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ht as renderAnytimeTable, i as resolveSupervisorProfile, it as allOf, jt as DEFAULT_SANDBOX_STEERING_MAX_TURNS, kt as createExecutorRegistry, lt as plateau, mt as plateauLength, n as workerFromBackend, nn as gateOnDeliverable, nt as driverAgent, o as serveCoordinationMcp, ot as anyOf, pt as bestSoFar, qt as defaultSelectWinner, r as assertCoordinationBinding, rt as finalizeBestDelivered, st as createProgressTracker, t as supervise, tn as assertModelAllowed, ut as sampleFromSettled, vt as createEventBus, wt as watchTrace, xt as queueOf, yt as effectiveConcurrency, z as defaultProfileRichnessThresholds, zt as PI_MCP_ADAPTER } from "./supervise-BcCHhLrz.js";
6
+ import { $t as FileCoordinationLog, At as createWorktreeCliExecutor, B as profileRichnessFinding, Bt as PI_MCP_ADAPTER_ENV, Ct as defaultToolDetectors, Dt as cliWorktreeExecutor, Et as createInMemoryRunContext, F as delegate, Ft as piSeamKey, Gt as createInbox, Ht as buildPiMcpServers, I as asAuthoredProfile, It as createPushTraceSource, Jt as runAgentRounds, L as assessAuthoredProfile, Lt as decodeToolPart, Mt as createSteerableSandboxSession, Nt as PI_RUNTIME, Ot as createExecutor, P as defaultDelegateBudget, Pt as piExecutor, Qt as acquireSandbox, R as authoredWorker, Rt as sandboxSessionTraceSource, St as rollingDispatch, Tt as createFileRunContext, Ut as piMcpAdapterAvailable, V as supervisorInstructions, Vt as PI_MCP_CONFIG_FLAG, Wt as preparePiMcp, Xt as createSandboxLineage, Yt as runLoop, Zt as probeSandboxCapabilities, a as supervisorAgent, at as allWorkersStalled, bt as freeSlots, ct as noProgressFor, dt as anytimeReport, en as createSupervisorSpanRecorder, ft as areaUnderCurve, gt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ht as renderAnytimeTable, i as resolveSupervisorProfile, it as allOf, jt as DEFAULT_SANDBOX_STEERING_MAX_TURNS, kt as createExecutorRegistry, lt as plateau, mt as plateauLength, n as workerFromBackend, nn as gateOnDeliverable, nt as driverAgent, o as serveCoordinationMcp, ot as anyOf, pt as bestSoFar, qt as defaultSelectWinner, r as assertCoordinationBinding, rt as finalizeBestDelivered, st as createProgressTracker, t as supervise, tn as assertModelAllowed, ut as sampleFromSettled, vt as createEventBus, wt as watchTrace, xt as queueOf, yt as effectiveConcurrency, z as defaultProfileRichnessThresholds, zt as PI_MCP_ADAPTER } from "./supervise-B7TIJR3D.js";
7
7
  import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-CCaEhA-l.js";
8
8
  export { 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, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, 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, worktreeFanout, writeWorkerSteer };
@@ -1,8 +1,8 @@
1
1
  import { a as persistCandidateOutputArtifact, ct as omitTopLevelDigest, nt as canonicalCandidateBytes, ot as embeddedCandidateArtifact } from "./prepare-BHQBb02e.js";
2
2
  import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-DXzJq7WP.js";
3
- import { t as createAgentImprovementActivationResult } from "./activation-BNQQO-bc.js";
3
+ import { t as createAgentImprovementActivationResult } from "./activation-Bt_XVkjK.js";
4
4
  import { r as researcherProfile } from "./researcher-CoVqNhfI.js";
5
- import { t as supervise } from "./supervise-BcCHhLrz.js";
5
+ import { t as supervise } from "./supervise-B7TIJR3D.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-DcIKJaPd.js.map
433
+ //# sourceMappingURL=knowledge-CUXQE8Sq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-DcIKJaPd.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 model: options.supervisorModel,\n 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,QAA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AAO,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
+ {"version":3,"file":"knowledge-CUXQE8Sq.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 model: options.supervisorModel,\n 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,SAAS,KAAA;EAChD;EACA,YAAY,OAAO,eAAe;GAChC,IAAI,WAAW,SACb,MAAM,IAAI,MAAM,mEAAmE;GAErF,MAAM,YAAY,MAAM,2BAA2B,SAAS,UAAU;GACtE,IAAI,UAAU,SAAS,OAAO,UAAU;GAExC,MAAM,kBAAkB;IACtB,MAAM,QAAQ;IACd,WAAW,UAAU;IACrB,YAAY;KACV,YAAY,WAAW;KACvB,aAAa,WAAW;KACxB,UAAU,QAAQ;KAClB,eAAe,YACb,UAAU,OACR,yBAAyB,SAAS,WAAW,WAAW,WAAW,MAAM,CAC3E;IACJ;IACA,GAAI,QAAQ,UAAU,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;IACtD,GAAI,QAAQ,eAAe,KAAA,IAAY,CAAC,IAAI,EAAE,YAAY,QAAQ,WAAW;IAC7E,GAAI,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;IAC1C,GAAI,QAAQ,UAAU,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;GACxD;GACA,MAAM,cACJ,WAAW,WAAW,WAAW,uBAC7B,MAAM,0BAA0B,eAAe,IAC/C,MAAM,kCAAkC,eAAe;GAC7D,IAAI,CAAC,YAAY,kBACf,MAAM,IAAI,MAAM,iEAAiE;GAEnF,OAAO,QAAQ,QAAQ,YAAY,YAAY,gBAAgB;EACjE;CACF;AACF;AAiBA,eAAe,2BACb,SACA,YACuC;CACvC,MAAM,SAAS,MAAM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AAM;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-I97xACXk.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-DZukewLl.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 };