@tangle-network/agent-runtime 0.109.2 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{activation-CM-L6TtL.js → activation-CsuHCZVN.js} +3 -3
- package/dist/{activation-CM-L6TtL.js.map → activation-CsuHCZVN.js.map} +1 -1
- package/dist/agent.d.ts +4 -4
- package/dist/agent.js +2 -2
- package/dist/agent.js.map +1 -1
- package/dist/{analyst-loop-C8cGThTW.js → analyst-loop-BoNIG2hA.js} +30 -9
- package/dist/analyst-loop-BoNIG2hA.js.map +1 -0
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-nYMa-bc-.js → candidate-execution-Co3sRC_7.js} +4 -4
- package/dist/{candidate-execution-nYMa-bc-.js.map → candidate-execution-Co3sRC_7.js.map} +1 -1
- package/dist/{environment-provider-CfLUmKmf.js → environment-provider-BsHpW4Dp.js} +52 -5
- package/dist/environment-provider-BsHpW4Dp.js.map +1 -0
- package/dist/{environment-provider-CMqSAp-O.d.ts → environment-provider-CTEMEP9u.d.ts} +9 -1
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-adapter-BaAdfJKT.d.ts → improvement-adapter-D5gwwoXQ.d.ts} +2 -2
- package/dist/{improvement-cycle-9O4iVFOA.js → improvement-cycle-ryAyCLKN.js} +5 -5
- package/dist/{improvement-cycle-9O4iVFOA.js.map → improvement-cycle-ryAyCLKN.js.map} +1 -1
- package/dist/{index-BwY61sh3.d.ts → index-C-Zn0VrN.d.ts} +3 -3
- package/dist/{index-CFJ_1m1U.d.ts → index-D_OdNLe0.d.ts} +285 -92
- package/dist/{index-HsQm1Rrr.d.ts → index-WODlt7iz.d.ts} +6 -6
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -11
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +39 -9
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-1a38bcUT.js → knowledge-DBNAteaC.js} +5 -5
- package/dist/{knowledge-1a38bcUT.js.map → knowledge-DBNAteaC.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-DUQF0bYz.d.ts → loop-runner-bin-BUm83y1g.d.ts} +4 -4
- package/dist/{loop-runner-bin-C35m19w0.js → loop-runner-bin-zE7DyGop.js} +4 -4
- package/dist/{loop-runner-bin-C35m19w0.js.map → loop-runner-bin-zE7DyGop.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/{openai-tools-DT9FH2_t.js → openai-tools-st-hERvA.js} +2 -2
- package/dist/{openai-tools-DT9FH2_t.js.map → openai-tools-st-hERvA.js.map} +1 -1
- package/dist/{prepare-Pr19X93k.js → prepare-BKVdOn0w.js} +15 -14
- package/dist/prepare-BKVdOn0w.js.map +1 -0
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-uthtDNqu.js → protected-model-port-BtldAE9j.js} +2 -2
- package/dist/{protected-model-port-uthtDNqu.js.map → protected-model-port-BtldAE9j.js.map} +1 -1
- package/dist/{runtime-dpJZmZtt.js → runtime-DSkMJb_X.js} +404 -15
- package/dist/runtime-DSkMJb_X.js.map +1 -0
- package/dist/{spawn-journal-CwPvKUTa.js → spawn-journal-DLhnom3e.js} +2 -2
- package/dist/{spawn-journal-CwPvKUTa.js.map → spawn-journal-DLhnom3e.js.map} +1 -1
- package/dist/{structural-rollout-ASQLr4-v.js → structural-rollout-CgnNy7_4.js} +3 -3
- package/dist/{structural-rollout-ASQLr4-v.js.map → structural-rollout-CgnNy7_4.js.map} +1 -1
- package/dist/{supervise-DyPmmhJ6.js → supervise-CeZtA1wu.js} +223 -107
- package/dist/supervise-CeZtA1wu.js.map +1 -0
- package/dist/{supervisor-sTJC9psT.js → supervisor-ByCPHcp9.js} +82 -24
- package/dist/supervisor-ByCPHcp9.js.map +1 -0
- package/dist/testing.js +9 -9
- package/dist/{types-CfGKhIuj.d.ts → types-zWfqDjeL.d.ts} +10 -1
- package/dist/{util-MVgdwuIS.js → util-Cc9g9Y-o.js} +2 -2
- package/dist/{util-MVgdwuIS.js.map → util-Cc9g9Y-o.js.map} +1 -1
- package/dist/{workspace-archive-C9w_rxt6.js → workspace-archive-CYYxZyA7.js} +2 -2
- package/dist/{workspace-archive-C9w_rxt6.js.map → workspace-archive-CYYxZyA7.js.map} +1 -1
- package/package.json +7 -7
- package/dist/analyst-loop-C8cGThTW.js.map +0 -1
- package/dist/environment-provider-CfLUmKmf.js.map +0 -1
- package/dist/prepare-Pr19X93k.js.map +0 -1
- package/dist/runtime-dpJZmZtt.js.map +0 -1
- package/dist/supervise-DyPmmhJ6.js.map +0 -1
- package/dist/supervisor-sTJC9psT.js.map +0 -1
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
|
-
import { $ as RootHandle, A as providerAsSandboxClient, At as SessionTraceBox, B as Executor, Bt as ScopeProgressInput, C as ProviderAsSandboxClientOptions, Ct as createWaitProbes, D as WorkspaceRequest, Dt as validateWaitSpec, E as SandboxClientProviderOptions, Et as timerAt, F as createTangleSandboxExactProcessProvider, Ft as sandboxSessionTraceSource, G as Handle, H as ExecutorFactory, Ht as createActivityLog, I as Agent, It as ActivityLog, J as NodeStatus, K as NodeId, L as AgentSpec, Lt as ActivityNote, M as sandboxClientAsProvider, Mt as TraceSource, N as CreateTangleSandboxExactProcessProviderOptions, Nt as createPushTraceSource, O as createAgentEnvironmentProviderRegistry, Ot as waitUntil, P as SandboxControlClient, Pt as decodeToolPart, Q as ResumedWork, R as Budget, Rt as DEFAULT_STALL_AFTER_MS, S as PlacementInfo, St as WaitSpec, T as ResourceRequest, Tt as pollFor, U as ExecutorRegistry, Ut as readWorkerProgress, V as ExecutorContext, Vt as WorkerProgress, W as ExecutorResult, X as ResultBlobStore, Y as Restart, Z as ResumedKeyState, _ as CheckpointRequest, _t as PendingWait, a as AgentEnvironmentProviderRef, at as SpawnJournal, b as ExecResult, bt as WaitProbeRegistry, c as AgentEnvironmentStatus, ct as SpawnRejection, d as AgentSession, dt as Supervisor, et as RootSignal, f as AgentSessionRef, ft as SupervisorOpts, g as CheckpointRef, gt as WidenGate, h as AgentTurnResult, ht as WaitOpts, i as AgentEnvironmentProvider, it as SpawnEvent, j as resolveAgentEnvironmentProvider, jt as ToolStepInput, k as providerAsExecutor, kt as SessionMessageLike, l as AgentEnvironmentSummary, lt as Spend, m as AgentTurnInput, mt as UsageEvent, n as AgentEnvironmentCapabilities, nt as Scope, o as AgentEnvironmentProviderRegistry, ot as SpawnOpts, p as AgentSessionStatus, pt as TreeView, q as NodeSnapshot, r as AgentEnvironmentEvent, rt as Settled, s as AgentEnvironmentQuery, st as SpawnPrior, t as AgentEnvironment, tt as Runtime, u as AgentProfileRef, ut as SupervisedResult, v as CreateAgentEnvironmentInput, vt as WaitOutcome, w as ProviderExecutorOptions, wt as isWaitOutcome, x as ForkRequest, xt as WaitRejection, y as ExecRequest, yt as WaitProbe, zt as ExecutorProgress } from "./environment-provider-
|
|
3
|
-
import { $ as effectiveConcurrency, $a as RenderCorpusToInstructionsOptions, $i as LoopOptionsForDispatch, $n as ApplyContinuation, $o as PairwiseVerdict, $r as fanout, $t as authoredWorker, A as createSupervisor, Aa as CombinatorShape, Ai as AgenticTool, An as CollectedAgentTurn, Ao as LeaderboardBenchmarkAdapter, Ar as mapSandboxEvent, As as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, At as sampleFromSettled, B as createFileRunContext, Ba as FanoutSynthesis, Bi as StrategyResult, Bn as EvolutionGeneration, Bo as CompletionPolicy, Br as PromotionGateOptions, Bt as CoordinationLog, C as failuresAnalyst, Ca as Observation, Cc as piExecutor, Ci as Environment, Cn as resolveEntrySymbol, Co as RunPersonifiedOptions, Cr as SandboxLineage, Cs as WaterfallSpan, Ct as StopRule, D as worktreeFanout, Da as observe, Dc as WorktreeHarnessResult, Di as AgenticRunResult, Dn as visibleCheckScore, Do as DefinedLeaderboard, Dr as SandboxToolPartState, Ds as CoordinationEvent, Dt as createProgressTracker, E as WorktreeFanoutOptions, Ea as defaultAnalystInstruction, Ec as WorktreeCommandResult, Ei as AgenticOptions, En as structuralRollout, Eo as ShapeRegistry, Er as createSandboxLineage, Es as AnalystRegistry, Et as anyOf, F as createScope, Fa as EqualKOnCost, Fi as ShotSpec, Fn as ChampionPolicy, Fo as LeaderboardScore, Fr as probeSandboxCapabilities, Ft as bestDelivered, G as WorktreePatchArtifact, Ga as LoopUntilState, Gi as defineStrategy, Gn as pickChampion, Go as stopSentinel, Gr as builtinShapes, Gt as ReservationTicket, H as PatchDeliverableOptions, Ha as FlatWidenGate, Hi as SurfaceScore, Hn as ReproductionCheck, Ho as completionAuthorizes, Hr as promotionGate, Ht as PriorCoordination, I as settledToIteration, Ia as EqualKOnCostOptions, Ii as Strategy, In as EvolutionArchiveNode, Io as LeaderboardSpec, Ir as AcquireOptions, It as collectDelivered, J as ConcurrencyCaps, Ja as PanelSpec, Ji as runAgentic, Jn as AuthorStrategyOptions, Jo as Interval, Jr as definePersona, Jt as AuthoredProfile, K as createWorktreeCliExecutor, Ka as Panel, Ki as depthStrategy, Kn as runStrategyEvolution, Ko as AxisScoresOf, Kr as createShapeRegistry, Kt as createBudgetPool, L as InMemoryRunContext, La as EqualKVerdict, Li as StrategyArtifacts, Ln as EvolutionAuthor, Lo as defineLeaderboard, Lr as acquireSandbox, Lt as pickBestDelivered, M as supervise, Ma as CorpusFilter, Mi as CorpusReadbackOptions, Mn as collectAgentTurn, Mo as LeaderboardIterationInfo, Mr as sumSandboxUsage, Ms as MakeWorkerAgent, Mt as FinalizeContext, N as workerFromBackend, Na as CorpusRecord, Ni as RunAgenticOptions, Nn as streamAgentTurn, No as LeaderboardRunContext, Nr as CriuCapableClient, Nt as FinalizerSettled, O as TrajectoryAnalysis, Oa as renderReport, Oc as WorktreeProfileMaterializationReceipt, Oi as AgenticSurface, On as AgentTurnBackend, Oo as LeaderboardBenchScore, Or as createSandboxToolPartState, Ot as noProgressFor, P as ScopeArgs, Pa as EqualKArm, Pi as ShotPersona, Pn as ChampionPick, Po as LeaderboardScenario, Pr as SandboxCapabilities, Pt as SupervisorFinalizer, Q as RollingDispatchOptions, Qa as RenderCorpusToInstructions, Qi as LoopDispatchOptions, Qn as strategyAuthorContract, Qo as PairwiseOptions, Qr as renderCorpusToInstructions, Qt as assessAuthoredProfile, R as InMemoryRunContextOptions, Ra as Fanout, Rc as DeliverableSpec, Ri as StrategyCtx, Rn as EvolutionBandInfo, Ro as CompletionAnalyst, Rr as ResolveSandboxClientOptions, Rt as runFinalizer, S as SurfaceWorkerOut, Sa as harvestCorpus, Sc as PiSeam, Si as BenchmarkTaskRow, Sn as officialChecksFromMeta, So as RunPersonified, Sr as ForkCapableBox, Ss as WaterfallReport, St as StopDecision, T as AuthoredHarness, Ta as ObserveOptions, Tc as WorktreeCheckRunner, Ti as runBenchmark, Tn as selectBestIndex, To as ShapeContext, Tr as SessionCapableBox, Ts as AnalystFindingEvent, Tt as allWorkersStalled, U as patchDelivered, Ua as LoopUntil, Ui as adaptiveRefine, Un as StrategyEvolutionConfig, Uo as deterministicCompletion, Ur as equalKOnCost, Ut as BudgetPool, V as createInMemoryRunContext, Va as FanoutWinnerSelector, Vi as StrategyShotResult, Vn as EvolutionReport, Vo as CompletionVerdict, Vr as PromotionVerdict, Vt as FileCoordinationLog, W as WorktreeCliExecutorOptions, Wa as LoopUntilSpec, Wi as breadthStrategy, Wn as discriminatingMeans, Wo as sentinelCompletion, Wr as trajectoryReport, Wt as BudgetReadout, X as DispatchStopReason, Xa as Pipeline, Xi as sampleThenRefine, Xn as assertStrategyContract, Xo as LeaderboardOptions, Xr as FileCorpus, Xt as ProfileRichnessThresholds, Y as DispatchReport, Ya as PanelVerdict, Yi as sample, Yn as AuthoredStrategy, Yo as Leaderboard, Yr as runPersonified, Yt as ProfileRichness, Z as DispatchUnit, Za as PipelineStage, Zi as LoopCampaignDispatchOptions, Zn as authorStrategy, Zo as LeaderboardRow, Zr as InMemoryCorpus, Zt as asAuthoredProfile, _ as VerifierEnvironmentOptions, _a as InProcessSandboxClientOptions, _c as createSteerableSandboxSession, _d as replaySpawnTree, _i as BenchmarkCell, _n as composeCheckSources, _o as LoopShape, _r as SandboxRun, _s as areaUnderCurve, _t as PlateauOptions, a as SandboxInstance, aa as runAgentRounds, ac as ExecutorConfig, ad as PublishOptions, ai as verify, an as CheckRunContext, ao as TrajectoryReport, ar as LocalMcpMaterialization, as as renderLeaderboardMarkdown, at as delegate, b as SuperviseSurfaceResult, ba as HarvestFailure, bc as createInbox, bi as BenchmarkReport, bn as filterAuthoredAsserts, bo as PersonaContext, br as openSandboxRun, bs as renderAnytimeTable, bt as ProgressTrackerOptions, c as GitWorkspaceOptions, ca as localSandboxClient, cc as RouterToolsSeam, cd as defaultToolDetectors, ci as RegistryAnalyzeProjection, cn as CheckSourceCtx, co as Verify, cr as McpToolDescriptor, cs as AuditIntentInput, ct as SupervisorProfile, d as WorkspaceCommit, da as mcpSecretEnvMetadataKey, dc as createExecutor, dd as FileSpawnJournal, di as createScopeAnalyst, dn as StructuralRolloutMessage, do as WidenDecision, dr as connectStdioMcp, ds as auditIntent, dt as serveCoordinationMcp, ea as loopCampaignDispatch, ei as flatWidenGate, en as defaultProfileRichnessThresholds, eo as ScopeAnalyst, er as DumbDriverOptions, es as ProfileKeyOf, et as freeSlots, f as WorkspaceRun, fa as resolveSecretEnv, fc as createExecutorRegistry, fd as InMemoryResultBlobStore, fi as registryScopeAnalyst, fn as StructuralRolloutPolicy, fo as WidenLineage, fr as materializeLocalMcp, fs as defaultAuditorInstruction, ft as DriverAgentOptions, g as runInWorkspace, ga as InProcessPromptCtx, gc as SteerableSandboxSession, gd as pendingWaits, gi as sanitizeMcpToolSchema, gn as compareCheckOutcomes, go as DefinePersonaInput, gr as OpenSandboxRunPromptOptions, gs as anytimeReport, gt as NoProgressForOptions, h as localShell, ha as InProcessOnPrompt, hc as SteerableSandboxArgs, hd as materializeTreeView, hi as createMcpEnvironment, hn as canDisplace, ho as DefinePersona, hr as OpenSandboxRunOptions, hs as AnytimeTaskCurve, ht as AllWorkersStalledOptions, i as SandboxEvent, ia as defaultSelectWinner, ic as CliWorktreeSeam, id as EventBus, ii as selectValidWinner, in as CheckOutcome, io as TrajectoryNode, ir as naiveDriver, is as renderLeaderboardHtml, it as defaultDelegateBudget, j as SuperviseOptions, ja as Corpus, ji as ArtifactHandle, jn as StreamAgentTurnOptions, jo as LeaderboardFlagSpec, jr as mapSandboxToolEvent, js as DownMessageEvent, jt as DeliveredOutput, k as analyzeTrace, ka as AssertTraceDerivedFindings, ki as AgenticTask, kn as AgentTurnUsage, ko as LeaderboardBenchTask, kr as extractLlmCallEvent, kt as plateau, l as Shell, la as KeyProvider, lc as SandboxSeam, ld as watchTrace, li as assertTraceDerivedFindings, ln as RepairStop, lo as VerifySpec, lr as StdioMcpConnection, ls as AuditIntentOptions, lt as supervisorAgent, m as jjWorkspace, ma as inlineSandboxClient, mc as SandboxSteeringOptions, md as contentAddress, mi as McpEnvironmentOptions, mn as VisibleCheck, mo as WinnerStrategy, mr as OpenSandboxRunBeforeStartContext, ms as AnytimeStrategySummary, mt as finalizeBestDelivered, n as AnalystFinding, na as RunAgentRoundsOptions, nc as CliSeam, nd as BusRecord, ni as panel, nn as supervisorInstructions, no as ScopeWidenGate, nr as SteeringDecision, ns as leaderboard, nt as rollingDispatch, o as computeFindingId, oa as runLoop, oc as ProviderSeam, od as createEventBus, oi as widen, on as CheckRunner, oo as TrajectoryReportFn, or as MaterializeLocalMcpOptions, os as renderLeaderboardSvg, ot as DriveHarness, p as gitWorkspace, pa as secretEnvOfMcpServer, pc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, pd as InMemorySpawnJournal, pi as McpEndpoint, pn as StructuralRolloutResult, po as WidenSpec, pr as Deliverable, ps as AnytimeReport, pt as driverAgent, q as assertModelAllowed, qa as PanelJudge, qi as refine, qn as selectChampion, qo as GroupOf, qr as registerShape, qt as spendFromUsageEvents, r as CreateSandboxOptions, ra as RunLoopOptions, rc as CliWorktreeBridgeSeam, rd as BusStats, ri as pipeline, rn as CheckExecChannel, ro as SteerContext, rr as dumbDriver, rs as pairwiseSignificance, rt as DelegateOptions, s as makeFinding, sa as LocalSandboxClientOptions, sc as RouterSeam, sd as WatchTraceOptions, si as CreateScopeAnalystOptions, sn as CheckSource, so as TrajectoryReportOptions, sr as McpSpawnFault, ss as renderPairwiseMarkdown, st as SupervisorAgentDeps, t as AgentProfile, ta as loopDispatch, tc as BridgeSeam, td as BusEvent, ti as loopUntil, tn as profileRichnessFinding, to as ScopeAnalyzeInput, tr as NaiveDriverOptions, ts as ScoreOf, tt as queueOf, u as Workspace, ua as envKeyProvider, uc as cliWorktreeExecutor, ud as FileResultBlobStore, ui as buildSteerContext, un as StructuralRolloutConfig, uo as Widen, ur as StdioMcpServerSpec, us as IntentAudit, ut as CoordinationMcpHandle, v as createVerifierEnvironment, va as inProcessSandboxClient, vc as Inbox, vi as BenchmarkConfig, vn as defaultExtractCandidate, vo as Outcome, vr as SandboxRunAbortError, vs as bestSoFar, vt as ProgressSample, w as superviseSurface, wa as ObserveInput, wc as piSeamKey, wi as printBenchmarkReport, wn as sandboxCheckRunner, wo as ShapeBudget, wr as SandboxLineageHandle, ws as createWaterfallCollector, wt as allOf, x as SurfaceWorkerConfig, xa as HarvestReport, xc as PI_RUNTIME, xi as BenchmarkStrategySummary, xn as modelAuthoredChecks, xo as PersonaExecutors, xr as CheckpointCapableBox, xs as WaterfallCollector, xt as ProgressView, y as SuperviseSurfaceOptions, ya as HarvestCorpusOptions, yc as InboxMessage, yi as BenchmarkLift, yn as defaultStructuralRolloutPolicy, yo as Persona, yr as TurnResult, ys as plateauLength, yt as ProgressTracker, z as RunContext, za as FanoutOptions, zc as gateOnDeliverable, zi as StrategyMessage, zn as EvolutionCandidate, zo as CompletionEvidence, zr as resolveSandboxClient, zt as runTree } from "./index-CFJ_1m1U.js";
|
|
2
|
+
import { $ as RootHandle, A as providerAsSandboxClient, At as SessionTraceBox, B as Executor, Bt as ScopeProgressInput, C as ProviderAsSandboxClientOptions, Ct as createWaitProbes, D as WorkspaceRequest, Dt as validateWaitSpec, E as SandboxClientProviderOptions, Et as timerAt, F as createTangleSandboxExactProcessProvider, Ft as sandboxSessionTraceSource, G as Handle, H as ExecutorFactory, Ht as createActivityLog, I as Agent, It as ActivityLog, J as NodeStatus, K as NodeId, L as AgentSpec, Lt as ActivityNote, M as sandboxClientAsProvider, Mt as TraceSource, N as CreateTangleSandboxExactProcessProviderOptions, Nt as createPushTraceSource, O as createAgentEnvironmentProviderRegistry, Ot as waitUntil, P as SandboxControlClient, Pt as decodeToolPart, Q as ResumedWork, R as Budget, Rt as DEFAULT_STALL_AFTER_MS, S as PlacementInfo, St as WaitSpec, T as ResourceRequest, Tt as pollFor, U as ExecutorRegistry, Ut as readWorkerProgress, V as ExecutorContext, Vt as WorkerProgress, W as ExecutorResult, X as ResultBlobStore, Y as Restart, Z as ResumedKeyState, _ as CheckpointRequest, _t as PendingWait, a as AgentEnvironmentProviderRef, at as SpawnJournal, b as ExecResult, bt as WaitProbeRegistry, c as AgentEnvironmentStatus, ct as SpawnRejection, d as AgentSession, dt as Supervisor, et as RootSignal, f as AgentSessionRef, ft as SupervisorOpts, g as CheckpointRef, gt as WidenGate, h as AgentTurnResult, ht as WaitOpts, i as AgentEnvironmentProvider, it as SpawnEvent, j as resolveAgentEnvironmentProvider, jt as ToolStepInput, k as providerAsExecutor, kt as SessionMessageLike, l as AgentEnvironmentSummary, lt as Spend, m as AgentTurnInput, mt as UsageEvent, n as AgentEnvironmentCapabilities, nt as Scope, o as AgentEnvironmentProviderRegistry, ot as SpawnOpts, p as AgentSessionStatus, pt as TreeView, q as NodeSnapshot, r as AgentEnvironmentEvent, rt as Settled, s as AgentEnvironmentQuery, st as SpawnPrior, t as AgentEnvironment, tt as Runtime, u as AgentProfileRef, ut as SupervisedResult, v as CreateAgentEnvironmentInput, vt as WaitOutcome, w as ProviderExecutorOptions, wt as isWaitOutcome, x as ForkRequest, xt as WaitRejection, y as ExecRequest, yt as WaitProbe, zt as ExecutorProgress } from "./environment-provider-CTEMEP9u.js";
|
|
3
|
+
import { $ as workerInboxFileFromEventDir, $a as CorpusRecord, $i as ShotSpec, $n as ChampionPolicy, $o as LeaderboardRunContext, $r as probeSandboxCapabilities, $t as bestDelivered, A as GitWorkspaceOptions, Aa as mcpSecretEnvMetadataKey, Ac as cliWorktreeExecutor, Ad as FileResultBlobStore, Ai as registryScopeAnalyst, An as StructuralRolloutPolicy, Ao as Widen, Ar as materializeLocalMcp, As as IntentAudit, At as DriverAgentOptions, B as analyzeTrace, Ba as HarvestFailure, Bc as createInbox, Bi as BenchmarkTaskRow, Bn as officialChecksFromMeta, Bo as PersonaContext, Br as ForkCapableBox, Bs as renderAnytimeTable, Bt as StopDecision, C as closingWorkerNote, Ca as runAgentRounds, Cc as CliWorktreeBridgeSeam, Cd as PublishOptions, Ci as verify, Cn as CheckRunContext, Co as SteerContext, Cr as LocalMcpMaterialization, Cs as pairwiseSignificance, Ct as delegate, D as UntrackedCopyStats, Da as KeyProvider, Dc as RouterSeam, Dd as watchTrace, Di as assertTraceDerivedFindings, Dn as RepairStop, Do as TrajectoryReportOptions, Dr as StdioMcpConnection, Ds as renderPairwiseMarkdown, Dt as supervisorAgent, E as CopyOptions, Ea as localSandboxClient, Ec as ProviderSeam, Ed as defaultToolDetectors, Ei as RegistryAnalyzeProjection, En as CheckSourceCtx, Eo as TrajectoryReportFn, Er as McpToolDescriptor, Es as renderLeaderboardSvg, Et as SupervisorProfile, F as gitWorkspace, Fa as InProcessOnPrompt, Fc as SteerableSandboxArgs, Fd as materializeTreeView, Fi as BenchmarkCell, Fn as composeCheckSources, Fo as DefinePersona, Fr as SandboxRun, Fs as AnytimeTaskCurve, Ft as PlateauOptions, G as ScopeArgs, Ga as ObserveOptions, Gc as WorktreeCheckRunner, Gi as AgenticRunResult, Gn as visibleCheckScore, Go as ShapeContext, Gr as SandboxToolPartState, Gs as AnalystFindingEvent, Gt as createProgressTracker, H as SuperviseOptions, Ha as harvestCorpus, Hc as PiSeam, Hi as printBenchmarkReport, Hn as sandboxCheckRunner, Ho as RunPersonified, Hr as SandboxLineageHandle, Hs as WaterfallReport, Ht as allOf, I as jjWorkspace, Ia as InProcessPromptCtx, Ic as SteerableSandboxSession, Id as pendingWaits, Ii as BenchmarkConfig, In as defaultExtractCandidate, Io as DefinePersonaInput, Ir as SandboxRunAbortError, Is as anytimeReport, It as ProgressSample, J as WorkerSteerRequest, Ja as renderReport, Jc as WorktreeProfileMaterializationReceipt, Ji as AgenticTool, Jn as CollectedAgentTurn, Jo as LeaderboardBenchScore, Jr as mapSandboxEvent, Jt as sampleFromSettled, K as createScope, Ka as defaultAnalystInstruction, Kc as WorktreeCommandResult, Ki as AgenticSurface, Kn as AgentTurnBackend, Ko as ShapeRegistry, Kr as createSandboxToolPartState, Ks as AnalystRegistry, Kt as noProgressFor, L as localShell, La as InProcessSandboxClientOptions, Lc as createSteerableSandboxSession, Ld as replaySpawnTree, Li as BenchmarkLift, Ln as defaultStructuralRolloutPolicy, Lo as LoopShape, Lr as TurnResult, Ls as areaUnderCurve, Lt as ProgressTracker, M as Workspace, Ma as resolveSecretEnv, Mc as createExecutorRegistry, Md as InMemoryResultBlobStore, Mi as McpEnvironmentOptions, Mn as VisibleCheck, Mo as WidenLineage, Mr as OpenSandboxRunBeforeStartContext, Ms as defaultAuditorInstruction, Mt as finalizeBestDelivered, N as WorkspaceCommit, Na as secretEnvOfMcpServer, Nc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Nd as InMemorySpawnJournal, Ni as createMcpEnvironment, Nn as canDisplace, No as WidenSpec, Nr as OpenSandboxRunOptions, Ns as AnytimeReport, Nt as AllWorkersStalledOptions, O as copyUntrackedIntoClone, Oa as ResolvedMcpServerLaunch, Oc as RouterToolsSeam, Od as DeliverableSpec, Oi as buildSteerContext, On as StructuralRolloutConfig, Oo as Verify, Or as StdioMcpServerSpec, Os as AuditIntentInput, Ot as CoordinationMcpHandle, P as WorkspaceRun, Pa as inlineSandboxClient, Pc as SandboxSteeringOptions, Pd as contentAddress, Pi as sanitizeMcpToolSchema, Pn as compareCheckOutcomes, Po as WinnerStrategy, Pr as OpenSandboxRunPromptOptions, Ps as AnytimeStrategySummary, Pt as NoProgressForOptions, Q as workerInboxFile, Qa as CorpusFilter, Qi as ShotPersona, Qn as ChampionPick, Qo as LeaderboardIterationInfo, Qr as SandboxCapabilities, Qs as MakeWorkerAgent, Qt as SupervisorFinalizer, R as runInWorkspace, Ra as inProcessSandboxClient, Rc as Inbox, Ri as BenchmarkReport, Rn as filterAuthoredAsserts, Ro as Outcome, Rr as openSandboxRun, Rs as bestSoFar, Rt as ProgressTrackerOptions, S as WorkerEvidenceInput, Sa as defaultSelectWinner, Sc as CliSeam, Sd as EventBus, Si as selectValidWinner, Sn as CheckOutcome, So as ScopeWidenGate, Sr as naiveDriver, Ss as leaderboard, St as defaultDelegateBudget, T as settledWorkerOut, Ta as LocalSandboxClientOptions, Tc as ExecutorConfig, Td as WatchTraceOptions, Ti as CreateScopeAnalystOptions, Tn as CheckSource, To as TrajectoryReport, Tr as McpSpawnFault, Ts as renderLeaderboardMarkdown, Tt as SupervisorAgentDeps, U as supervise, Ua as Observation, Uc as piExecutor, Ui as runBenchmark, Un as selectBestIndex, Uo as RunPersonifiedOptions, Ur as SessionCapableBox, Us as WaterfallSpan, Ut as allWorkersStalled, V as createSupervisor, Va as HarvestReport, Vc as PI_RUNTIME, Vi as Environment, Vn as resolveEntrySymbol, Vo as PersonaExecutors, Vr as SandboxLineage, Vs as WaterfallCollector, Vt as StopRule, W as workerFromBackend, Wa as ObserveInput, Wc as piSeamKey, Wi as AgenticOptions, Wn as structuralRollout, Wo as ShapeBudget, Wr as createSandboxLineage, Ws as createWaterfallCollector, Wt as anyOf, X as safeWorkerFile, Xa as CombinatorShape, Xi as CorpusReadbackOptions, Xn as collectAgentTurn, Xo as LeaderboardBenchmarkAdapter, Xr as sumSandboxUsage, Xs as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Xt as FinalizeContext, Y as readWorkerSteerRequests, Ya as AssertTraceDerivedFindings, Yi as ArtifactHandle, Yn as StreamAgentTurnOptions, Yo as LeaderboardBenchTask, Yr as mapSandboxToolEvent, Yt as DeliveredOutput, Z as supervisorRunDir, Za as Corpus, Zi as RunAgenticOptions, Zn as streamAgentTurn, Zo as LeaderboardFlagSpec, Zr as CriuCapableClient, Zs as DownMessageEvent, Zt as FinalizerSettled, _ as WorktreeFanoutOptions, _a as LoopOptionsForDispatch, _i as fanout, _n as authoredWorker, _o as PipelineStage, _r as ApplyContinuation, _s as LeaderboardRow, _t as effectiveConcurrency, a as SandboxInstance, aa as StrategyShotResult, ai as PromotionVerdict, an as FileCoordinationLog, ao as FanoutOptions, ar as EvolutionReport, as as CompletionEvidence, at as createInMemoryRunContext, b as NOTE_MAX_CHARS, ba as RunAgentRoundsOptions, bd as BusRecord, bi as panel, bn as supervisorInstructions, bo as ScopeAnalyst, br as SteeringDecision, bs as ProfileKeyOf, bt as rollingDispatch, c as VerifierEnvironmentOptions, ca as breadthStrategy, ci as trajectoryReport, cn as BudgetReadout, co as FlatWidenGate, cr as discriminatingMeans, cs as completionAuthorizes, ct as WorktreeCliExecutorOptions, d as SuperviseSurfaceResult, da as refine, di as registerShape, dn as spendFromUsageEvents, do as LoopUntilState, dr as selectChampion, ds as stopSentinel, dt as assertModelAllowed, ea as Strategy, ei as AcquireOptions, en as collectDelivered, eo as EqualKArm, er as EvolutionArchiveNode, es as LeaderboardScenario, et as writeWorkerSteer, f as SurfaceWorkerConfig, fa as runAgentic, fi as definePersona, fn as AuthoredProfile, fo as Panel, fr as AuthorStrategyOptions, fs as AxisScoresOf, ft as ConcurrencyCaps, g as AuthoredHarness, ga as LoopDispatchOptions, gi as renderCorpusToInstructions, gn as assessAuthoredProfile, go as Pipeline, gr as strategyAuthorContract, gs as LeaderboardOptions, gt as RollingDispatchOptions, h as superviseSurface, ha as LoopCampaignDispatchOptions, hi as InMemoryCorpus, hn as asAuthoredProfile, ho as PanelVerdict, hr as authorStrategy, hs as Leaderboard, ht as DispatchUnit, i as SandboxEvent, ia as StrategyResult, ii as PromotionGateOptions, in as CoordinationLog, io as Fanout, ir as EvolutionGeneration, is as CompletionAnalyst, it as createFileRunContext, j as Shell, ja as resolveMcpServerLaunch, jc as createExecutor, jd as FileSpawnJournal, ji as McpEndpoint, jn as StructuralRolloutResult, jo as WidenDecision, jr as Deliverable, js as auditIntent, jt as driverAgent, k as withUntrackedArtifacts, ka as envKeyProvider, kc as SandboxSeam, kd as gateOnDeliverable, ki as createScopeAnalyst, kn as StructuralRolloutMessage, ko as VerifySpec, kr as connectStdioMcp, ks as AuditIntentOptions, kt as serveCoordinationMcp, l as createVerifierEnvironment, la as defineStrategy, li as builtinShapes, ln as ReservationTicket, lo as LoopUntil, lr as pickChampion, ls as deterministicCompletion, lt as WorktreePatchArtifact, m as failuresAnalyst, ma as sampleThenRefine, mi as FileCorpus, mn as ProfileRichnessThresholds, mo as PanelSpec, mr as assertStrategyContract, ms as Interval, mt as DispatchStopReason, n as AnalystFinding, na as StrategyCtx, ni as ResolveSandboxClientOptions, nn as runFinalizer, no as EqualKOnCostOptions, nr as EvolutionBandInfo, ns as LeaderboardSpec, nt as InMemoryRunContextOptions, o as computeFindingId, oa as SurfaceScore, oi as promotionGate, on as PriorCoordination, oo as FanoutSynthesis, or as ReproductionCheck, os as CompletionPolicy, ot as PatchDeliverableOptions, p as SurfaceWorkerOut, pa as sample, pi as runPersonified, pn as ProfileRichness, po as PanelJudge, pr as AuthoredStrategy, ps as GroupOf, pt as DispatchReport, q as settledToIteration, qa as observe, qc as WorktreeHarnessResult, qi as AgenticTask, qn as AgentTurnUsage, qo as DefinedLeaderboard, qr as extractLlmCallEvent, qs as CoordinationEvent, qt as plateau, r as CreateSandboxOptions, ra as StrategyMessage, ri as resolveSandboxClient, rn as runTree, ro as EqualKVerdict, rr as EvolutionCandidate, rs as defineLeaderboard, rt as RunContext, s as makeFinding, sa as adaptiveRefine, si as equalKOnCost, sn as BudgetPool, so as FanoutWinnerSelector, sr as StrategyEvolutionConfig, ss as CompletionVerdict, st as patchDelivered, t as AgentProfile, ta as StrategyArtifacts, ti as acquireSandbox, tn as pickBestDelivered, to as EqualKOnCost, tr as EvolutionAuthor, ts as LeaderboardScore, tt as InMemoryRunContext, u as SuperviseSurfaceOptions, ua as depthStrategy, ui as createShapeRegistry, un as createBudgetPool, uo as LoopUntilSpec, ur as runStrategyEvolution, us as sentinelCompletion, ut as createWorktreeCliExecutor, v as worktreeFanout, va as loopCampaignDispatch, vi as flatWidenGate, vn as defaultProfileRichnessThresholds, vo as RenderCorpusToInstructions, vr as DumbDriverOptions, vs as PairwiseOptions, vt as freeSlots, w as composeWorkerEvidence, wa as runLoop, wc as CliWorktreeSeam, wd as createEventBus, wi as widen, wn as CheckRunner, wo as TrajectoryNode, wr as MaterializeLocalMcpOptions, ws as renderLeaderboardHtml, wt as DriveHarness, x as VERIFY_TAIL_CHARS, xa as RunLoopOptions, xc as BridgeSeam, xd as BusStats, xi as pipeline, xn as CheckExecChannel, xo as ScopeAnalyzeInput, xr as dumbDriver, xs as ScoreOf, xt as DelegateOptions, y as EVIDENCE_MAX_CHARS, ya as loopDispatch, yd as BusEvent, yi as loopUntil, yn as profileRichnessFinding, yo as RenderCorpusToInstructionsOptions, yr as NaiveDriverOptions, ys as PairwiseVerdict, yt as queueOf, z as TrajectoryAnalysis, za as HarvestCorpusOptions, zc as InboxMessage, zi as BenchmarkStrategySummary, zn as modelAuthoredChecks, zo as Persona, zr as CheckpointCapableBox, zs as plateauLength, zt as ProgressView } from "./index-D_OdNLe0.js";
|
|
4
4
|
import { S as ToolLoopMessageRecord, _ as routerChatWithUsage, b as ToolLoopCompaction, 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 ToolLoopCompactionOptions, y as ToolLoopChat } from "./local-harness-Dh8PJ0ot.js";
|
|
5
|
-
export { type AcquireOptions, type ActivityLog, type ActivityNote, type Agent, type AgentEnvironment, type AgentEnvironmentCapabilities, type AgentEnvironmentEvent, type AgentEnvironmentProvider, type AgentEnvironmentProviderRef, type AgentEnvironmentProviderRegistry, type AgentEnvironmentQuery, type AgentEnvironmentStatus, type AgentEnvironmentSummary, type 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 CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, 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, 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, type NaiveDriverOptions, type NoProgressForOptions, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, 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 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 ReservationTicket, type ResolveSandboxClientOptions, 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 SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorOpts, type SupervisorProfile, 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 UsageEvent, 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 WorkerProgress, 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, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, computeFindingId, connectStdioMcp, contentAddress, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveSandboxClient, resolveSecretEnv, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, workerFromBackend, worktreeFanout };
|
|
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 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 NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, 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 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 ReservationTicket, type ResolveSandboxClientOptions, type ResolvedMcpServerLaunch, 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 SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorOpts, type SupervisorProfile, 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, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, 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, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, 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, 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, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
package/dist/kernel.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
2
|
-
import { C as routerChatWithUsage, S as routerChatWithTools, _ 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-
|
|
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-
|
|
4
|
-
import { $ as
|
|
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-DLhnom3e.js";
|
|
2
|
+
import { C as routerChatWithUsage, S as routerChatWithTools, _ 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-ByCPHcp9.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-CgnNy7_4.js";
|
|
4
|
+
import { $ as fanout, A as streamAgentTurn, At as renderPairwiseMarkdown, B as printBenchmarkReport, Bt as resolveMcpServerLaunch, C as supervisorRunDir, Ct as sentinelCompletion, D as patchDelivered, Dt as renderLeaderboardHtml, E as writeWorkerSteer, Et as pairwiseSignificance, F as assertStrategyContract, Ft as materializeLocalMcp, G as definePersona, H as promotionGate, Ht as secretEnvOfMcpServer, I as authorStrategy, It as createMcpEnvironment, J as createShapeRegistry, K as runPersonified, L as strategyAuthorContract, Lt as sanitizeMcpToolSchema, M as pickChampion, Mt as defaultAuditorInstruction, N as runStrategyEvolution, Nt as McpSpawnFault, Ot as renderLeaderboardMarkdown, P as selectChampion, Pt as connectStdioMcp, Q as renderCorpusToInstructions, R as SandboxRunAbortError, Rt as envKeyProvider, S as safeWorkerFile, St as deterministicCompletion, T as workerInboxFileFromEventDir, Tt as leaderboard, U as equalKOnCost, V as runBenchmark, Vt as resolveSecretEnv, W as trajectoryReport, X as FileCorpus, Y as registerShape, Z as InMemoryCorpus, _ as settledWorkerOut, _t as localSandboxClient, a as localShell, at as verify, b as analyzeTrace, bt as loopDispatch, c as createVerifierEnvironment, ct as buildSteerContext, d as worktreeFanout, dt as inProcessSandboxClient, et as flatWidenGate, f as EVIDENCE_MAX_CHARS, ft as harvestCorpus, g as composeWorkerEvidence, gt as resolveSandboxClient, h as closingWorkerNote, ht as naiveDriver, i as jjWorkspace, it as selectValidWinner, j as discriminatingMeans, jt as auditIntent, k as collectAgentTurn, kt as renderLeaderboardSvg, l as failuresAnalyst, lt as createScopeAnalyst, m as VERIFY_TAIL_CHARS, mt as dumbDriver, n as makeFinding, nt as panel, o as runInWorkspace, ot as widen, p as NOTE_MAX_CHARS, pt as defineLeaderboard, q as builtinShapes, r as gitWorkspace, rt as pipeline, s as createWaterfallCollector, st as assertTraceDerivedFindings, t as computeFindingId, tt as loopUntil, u as superviseSurface, ut as registryScopeAnalyst, v as copyUntrackedIntoClone, vt as inlineSandboxClient, w as workerInboxFile, wt as stopSentinel, x as readWorkerSteerRequests, xt as completionAuthorizes, y as withUntrackedArtifacts, yt as loopCampaignDispatch, z as openSandboxRun, zt as mcpSecretEnvMetadataKey } from "./runtime-DSkMJb_X.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 { At as createSteerableSandboxSession, Bt as runAgentRounds, Ct as createFileRunContext, Dt as createExecutorRegistry, Et as createExecutor, F as assessAuthoredProfile, Ft as decodeToolPart, Gt as FileCoordinationLog, Ht as createSandboxLineage, I as authoredWorker, It as sandboxSessionTraceSource, Kt as assertModelAllowed, L as defaultProfileRichnessThresholds, Lt as createInbox, M as defaultDelegateBudget, Mt as piExecutor, N as delegate, Nt as piSeamKey, Ot as createWorktreeCliExecutor, P as asAuthoredProfile, Pt as createPushTraceSource, R as profileRichnessFinding, St as watchTrace, Tt as cliWorktreeExecutor, Ut as probeSandboxCapabilities, Vt as runLoop, Wt as acquireSandbox, _t as effectiveConcurrency, at as createProgressTracker, bt as rollingDispatch, ct as sampleFromSettled, dt as bestSoFar, et as driverAgent, ft as plateauLength, gt as createEventBus, i as serveCoordinationMcp, it as anyOf, jt as PI_RUNTIME, kt as DEFAULT_SANDBOX_STEERING_MAX_TURNS, lt as anytimeReport, mt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, n as workerFromBackend, nt as allOf, ot as noProgressFor, pt as renderAnytimeTable, qt as gateOnDeliverable, r as supervisorAgent, rt as allWorkersStalled, st as plateau, t as supervise, tt as finalizeBestDelivered, ut as areaUnderCurve, vt as freeSlots, wt as createInMemoryRunContext, xt as defaultToolDetectors, yt as queueOf, z as supervisorInstructions, zt as defaultSelectWinner } from "./supervise-
|
|
7
|
-
import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-
|
|
8
|
-
export { DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, PI_RUNTIME, SandboxRunAbortError, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, computeFindingId, connectStdioMcp, contentAddress, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveSandboxClient, resolveSecretEnv, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, workerFromBackend, worktreeFanout };
|
|
6
|
+
import { At as createSteerableSandboxSession, Bt as runAgentRounds, Ct as createFileRunContext, Dt as createExecutorRegistry, Et as createExecutor, F as assessAuthoredProfile, Ft as decodeToolPart, Gt as FileCoordinationLog, Ht as createSandboxLineage, I as authoredWorker, It as sandboxSessionTraceSource, Kt as assertModelAllowed, L as defaultProfileRichnessThresholds, Lt as createInbox, M as defaultDelegateBudget, Mt as piExecutor, N as delegate, Nt as piSeamKey, Ot as createWorktreeCliExecutor, P as asAuthoredProfile, Pt as createPushTraceSource, R as profileRichnessFinding, St as watchTrace, Tt as cliWorktreeExecutor, Ut as probeSandboxCapabilities, Vt as runLoop, Wt as acquireSandbox, _t as effectiveConcurrency, at as createProgressTracker, bt as rollingDispatch, ct as sampleFromSettled, dt as bestSoFar, et as driverAgent, ft as plateauLength, gt as createEventBus, i as serveCoordinationMcp, it as anyOf, jt as PI_RUNTIME, kt as DEFAULT_SANDBOX_STEERING_MAX_TURNS, lt as anytimeReport, mt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, n as workerFromBackend, nt as allOf, ot as noProgressFor, pt as renderAnytimeTable, qt as gateOnDeliverable, r as supervisorAgent, rt as allWorkersStalled, st as plateau, t as supervise, tt as finalizeBestDelivered, ut as areaUnderCurve, vt as freeSlots, wt as createInMemoryRunContext, xt as defaultToolDetectors, yt as queueOf, z as supervisorInstructions, zt as defaultSelectWinner } from "./supervise-CeZtA1wu.js";
|
|
7
|
+
import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-BsHpW4Dp.js";
|
|
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_RUNTIME, SandboxRunAbortError, VERIFY_TAIL_CHARS, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, 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, 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, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, 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, 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, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as persistCandidateOutputArtifact, ct as omitTopLevelDigest, nt as canonicalCandidateBytes, ot as embeddedCandidateArtifact } from "./prepare-
|
|
2
|
-
import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-
|
|
3
|
-
import { t as createAgentImprovementActivationResult } from "./activation-
|
|
1
|
+
import { a as persistCandidateOutputArtifact, ct as omitTopLevelDigest, nt as canonicalCandidateBytes, ot as embeddedCandidateArtifact } from "./prepare-BKVdOn0w.js";
|
|
2
|
+
import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-CYYxZyA7.js";
|
|
3
|
+
import { t as createAgentImprovementActivationResult } from "./activation-CsuHCZVN.js";
|
|
4
4
|
import { r as researcherProfile } from "./researcher-CoVqNhfI.js";
|
|
5
|
-
import { t as supervise } from "./supervise-
|
|
5
|
+
import { t as supervise } from "./supervise-CeZtA1wu.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-
|
|
433
|
+
//# sourceMappingURL=knowledge-DBNAteaC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-1a38bcUT.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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AoE;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-DBNAteaC.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,2BAA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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"}
|
package/dist/knowledge.d.ts
CHANGED
|
@@ -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-
|
|
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-C-Zn0VrN.js";
|
|
2
2
|
export { type AgentKnowledgeReadinessCheckOptions, type CreateKnowledgeImprovementActivationExecutorOptions, type KnowledgeImprovementActivationExecutor, type KnowledgeImprovementCandidatePair, type KnowledgeImprovementExperimentBundles, type KnowledgeImprovementJobMeasurement, type KnowledgeImprovementJobResult, type KnowledgeReadinessCheck, type KnowledgeReadinessCheckInput, type KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, type RunKnowledgeImprovementJobOptions, type SupervisedKnowledgeUpdateInput, type SupervisedKnowledgeUpdateOptions, type SupervisedKnowledgeUpdateResult, type SupervisedKnowledgeUpdater, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate };
|
package/dist/knowledge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-
|
|
1
|
+
import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-DBNAteaC.js";
|
|
2
2
|
export { RESEARCH_SUPERVISOR_SYSTEM_PROMPT, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as RunAnalystLoopOpts, f as RunAnalystLoopResult } from "./types-
|
|
2
|
-
import { R as Budget } from "./environment-provider-
|
|
3
|
-
import {
|
|
1
|
+
import { d as RunAnalystLoopOpts, f as RunAnalystLoopResult } from "./types-zWfqDjeL.js";
|
|
2
|
+
import { R as Budget } from "./environment-provider-CTEMEP9u.js";
|
|
3
|
+
import { Po as WinnerStrategy, _ as WorktreeFanoutOptions, g as AuthoredHarness, lt as WorktreePatchArtifact } from "./index-D_OdNLe0.js";
|
|
4
4
|
import { n as FactCandidate, t as CreateKbGateOptions } from "./kb-gate-C8z2juK8.js";
|
|
5
5
|
//#region src/loop-runner.d.ts
|
|
6
6
|
/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */
|
|
@@ -159,4 +159,4 @@ declare function parseLoopRunnerArgv(argv: string[]): {
|
|
|
159
159
|
};
|
|
160
160
|
//#endregion
|
|
161
161
|
export { researchLoopRunner as _, DELEGATED_LOOP_MODES as a, DelegatedLoopResult as c, ResearchLoopRunnerOptions as d, RunDelegatedLoopOptions as f, isDelegatedLoopMode as g, auditLoopRunner as h, runLoopRunnerCli as i, DelegatedLoopRunner as l, WorktreeLoopRunnerOptions as m, LoopRunnerCliResult as n, DelegatedLoopMode as o, VetoedFact as p, parseLoopRunnerArgv as r, DelegatedLoopRegistry as s, LoopRunnerCliArgs as t, ResearchLoopResult as u, runDelegatedLoop as v, worktreeLoopRunner as y };
|
|
162
|
-
//# sourceMappingURL=loop-runner-bin-
|
|
162
|
+
//# sourceMappingURL=loop-runner-bin-BUm83y1g.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ConfigError } from "./errors-DEAvWQPy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as runAnalystLoop } from "./analyst-loop-
|
|
4
|
-
import { Dt as createExecutorRegistry } from "./supervise-
|
|
2
|
+
import { G as definePersona, K as runPersonified, d as worktreeFanout } from "./runtime-DSkMJb_X.js";
|
|
3
|
+
import { t as runAnalystLoop } from "./analyst-loop-BoNIG2hA.js";
|
|
4
|
+
import { Dt as createExecutorRegistry } from "./supervise-CeZtA1wu.js";
|
|
5
5
|
import { t as createKbGate } from "./kb-gate-DpaSwXVx.js";
|
|
6
6
|
//#region src/loop-runner.ts
|
|
7
7
|
/**
|
|
@@ -265,4 +265,4 @@ if (invokedScript && /loop-runner-bin\.(js|ts|mjs)$/.test(invokedScript)) main()
|
|
|
265
265
|
//#endregion
|
|
266
266
|
export { isDelegatedLoopMode as a, worktreeLoopRunner as c, auditLoopRunner as i, runLoopRunnerCli as n, researchLoopRunner as o, DELEGATED_LOOP_MODES as r, runDelegatedLoop as s, parseLoopRunnerArgv as t };
|
|
267
267
|
|
|
268
|
-
//# sourceMappingURL=loop-runner-bin-
|
|
268
|
+
//# sourceMappingURL=loop-runner-bin-zE7DyGop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-runner-bin-C35m19w0.js","names":[],"sources":["../src/loop-runner.ts","../src/loop-runner-bin.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a {@link DelegatedLoopResult}. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\nexport interface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\nexport interface WorktreeLoopRunnerOptions {\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: { name: 'worktree-coder' }, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\nexport interface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\nexport interface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n","#!/usr/bin/env node\n/**\n *\n * `agent-runtime-loop` — the schedulable entrypoint for the configured\n * delegated loop-runner. A cron job / routine / Makefile target invokes:\n *\n * agent-runtime-loop --mode research --config ./loops.config.js\n *\n * The config module wires the registry (with full access to env / creds —\n * which is why the deps live there, not in this generic bin). It must default-\n * export a `DelegatedLoopRegistry`, or a `() => DelegatedLoopRegistry | Promise<…>`.\n * The bin runs the selected mode, prints the `DelegatedLoopResult` as JSON, and\n * exits 0 on `ok`, 1 on a recorded failure, 2 on a usage/config error.\n *\n * @experimental\n */\n\nimport {\n DELEGATED_LOOP_MODES,\n type DelegatedLoopMode,\n type DelegatedLoopRegistry,\n type DelegatedLoopResult,\n isDelegatedLoopMode,\n runDelegatedLoop,\n} from './loop-runner'\n\n/** @experimental Parsed CLI invocation. */\nexport interface LoopRunnerCliArgs {\n mode: string\n /** Loads the registry — the bin wires this from `--config`; tests inject a stub. */\n loadRegistry: () => Promise<DelegatedLoopRegistry> | DelegatedLoopRegistry\n now?: () => number\n}\n\n/** @experimental */\nexport interface LoopRunnerCliResult {\n exitCode: number\n result?: DelegatedLoopResult\n error?: string\n}\n\n/**\n *\n * Pure CLI core (no process / argv / IO) so it's unit-testable: validate the\n * mode, load the registry, dispatch, map to an exit code (0 ok / 1 failed /\n * 2 usage). Exported for embedding in custom runners + tests.\n *\n * @experimental\n */\nexport async function runLoopRunnerCli(args: LoopRunnerCliArgs): Promise<LoopRunnerCliResult> {\n if (!isDelegatedLoopMode(args.mode)) {\n return {\n exitCode: 2,\n error: `unknown mode '${args.mode}' (expected one of: ${DELEGATED_LOOP_MODES.join(', ')})`,\n }\n }\n let registry: DelegatedLoopRegistry\n try {\n registry = await args.loadRegistry()\n } catch (err) {\n return { exitCode: 2, error: `failed to load registry: ${errMsg(err)}` }\n }\n if (!registry[args.mode]) {\n return {\n exitCode: 2,\n error: `config registers no runner for mode '${args.mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n }\n }\n // runDelegatedLoop throws only on a missing runner (guarded above); a failing\n // engine is captured as { ok: false } → exit 1, not a crash.\n const result = await runDelegatedLoop(args.mode as DelegatedLoopMode, registry, {\n ...(args.now ? { now: args.now } : {}),\n })\n return { exitCode: result.ok ? 0 : 1, result }\n}\n\n/** Parse `--mode X --config Y` from an argv tail (`process.argv.slice(2)`). */\nexport function parseLoopRunnerArgv(argv: string[]): { mode?: string; config?: string } {\n const out: { mode?: string; config?: string } = {}\n for (let i = 0; i < argv.length; i += 1) {\n const a = argv[i]\n if (a === '--mode') out.mode = argv[++i]\n else if (a === '--config') out.config = argv[++i]\n else if (a?.startsWith('--mode=')) out.mode = a.slice('--mode='.length)\n else if (a?.startsWith('--config=')) out.config = a.slice('--config='.length)\n }\n return out\n}\n\n/** Normalize a config module's default export → a registry. */\nfunction resolveRegistry(mod: unknown): DelegatedLoopRegistry {\n const def = (mod as { default?: unknown })?.default ?? mod\n const value = typeof def === 'function' ? (def as () => unknown)() : def\n return value as DelegatedLoopRegistry\n}\n\nfunction errMsg(err: unknown): string {\n return err instanceof Error ? err.message : String(err)\n}\n\n/** The argv → IO → exit shell. Kept thin; logic lives in `runLoopRunnerCli`. */\nasync function main(): Promise<void> {\n const { mode, config } = parseLoopRunnerArgv(process.argv.slice(2))\n if (!mode || !config) {\n process.stderr.write(\n 'usage: agent-runtime-loop --mode <mode> --config <module>\\n' +\n ` modes: ${DELEGATED_LOOP_MODES.join(' | ')}\\n` +\n ' config: a JS/TS module default-exporting a DelegatedLoopRegistry (or a factory)\\n',\n )\n process.exit(2)\n }\n const { pathToFileURL } = await import('node:url')\n const { resolve } = await import('node:path')\n const cli = await runLoopRunnerCli({\n mode,\n loadRegistry: async () => resolveRegistry(await import(pathToFileURL(resolve(config)).href)),\n })\n process.stdout.write(`${JSON.stringify(cli.result ?? { error: cli.error }, null, 2)}\\n`)\n if (cli.error) process.stderr.write(`${cli.error}\\n`)\n process.exit(cli.exitCode)\n}\n\n// Run only when executed as the bin — never when imported for the testable\n// core, and never when bundled into a runtime that has no `process.argv`\n// (e.g. Cloudflare Workers, where `process` is a shim without `argv`). Reading\n// `process.argv[1]` directly would throw at module load there; `process.argv?.`\n// keeps the guard a no-op instead of crashing the Worker on startup.\nconst invokedScript = typeof process !== 'undefined' ? process.argv?.[1] : undefined\nif (invokedScript && /loop-runner-bin\\.(js|ts|mj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aAAa,GACrE,KAAU"}
|
|
1
|
+
{"version":3,"file":"loop-runner-bin-zE7DyGop.js","names":[],"sources":["../src/loop-runner.ts","../src/loop-runner-bin.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a {@link DelegatedLoopResult}. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\nexport interface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\nexport interface WorktreeLoopRunnerOptions {\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: { name: 'worktree-coder' }, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\nexport interface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\nexport interface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n","#!/usr/bin/env node\n/**\n *\n * `agent-runtime-loop` — the schedulable entrypoint for the configured\n * delegated loop-runner. A cron job / routine / Makefile target invokes:\n *\n * agent-runtime-loop --mode research --config ./loops.config.js\n *\n * The config module wires the registry (with full access to env / creds —\n * which is why the deps live there, not in this generic bin). It must default-\n * export a `DelegatedLoopRegistry`, or a `() => DelegatedLoopRegistry | Promise<…>`.\n * The bin runs the selected mode, prints the `DelegatedLoopResult` as JSON, and\n * exits 0 on `ok`, 1 on a recorded failure, 2 on a usage/config error.\n *\n * @experimental\n */\n\nimport {\n DELEGATED_LOOP_MODES,\n type DelegatedLoopMode,\n type DelegatedLoopRegistry,\n type DelegatedLoopResult,\n isDelegatedLoopMode,\n runDelegatedLoop,\n} from './loop-runner'\n\n/** @experimental Parsed CLI invocation. */\nexport interface LoopRunnerCliArgs {\n mode: string\n /** Loads the registry — the bin wires this from `--config`; tests inject a stub. */\n loadRegistry: () => Promise<DelegatedLoopRegistry> | DelegatedLoopRegistry\n now?: () => number\n}\n\n/** @experimental */\nexport interface LoopRunnerCliResult {\n exitCode: number\n result?: DelegatedLoopResult\n error?: string\n}\n\n/**\n *\n * Pure CLI core (no process / argv / IO) so it's unit-testable: validate the\n * mode, load the registry, dispatch, map to an exit code (0 ok / 1 failed /\n * 2 usage). Exported for embedding in custom runners + tests.\n *\n * @experimental\n */\nexport async function runLoopRunnerCli(args: LoopRunnerCliArgs): Promise<LoopRunnerCliResult> {\n if (!isDelegatedLoopMode(args.mode)) {\n return {\n exitCode: 2,\n error: `unknown mode '${args.mode}' (expected one of: ${DELEGATED_LOOP_MODES.join(', ')})`,\n }\n }\n let registry: DelegatedLoopRegistry\n try {\n registry = await args.loadRegistry()\n } catch (err) {\n return { exitCode: 2, error: `failed to load registry: ${errMsg(err)}` }\n }\n if (!registry[args.mode]) {\n return {\n exitCode: 2,\n error: `config registers no runner for mode '${args.mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n }\n }\n // runDelegatedLoop throws only on a missing runner (guarded above); a failing\n // engine is captured as { ok: false } → exit 1, not a crash.\n const result = await runDelegatedLoop(args.mode as DelegatedLoopMode, registry, {\n ...(args.now ? { now: args.now } : {}),\n })\n return { exitCode: result.ok ? 0 : 1, result }\n}\n\n/** Parse `--mode X --config Y` from an argv tail (`process.argv.slice(2)`). */\nexport function parseLoopRunnerArgv(argv: string[]): { mode?: string; config?: string } {\n const out: { mode?: string; config?: string } = {}\n for (let i = 0; i < argv.length; i += 1) {\n const a = argv[i]\n if (a === '--mode') out.mode = argv[++i]\n else if (a === '--config') out.config = argv[++i]\n else if (a?.startsWith('--mode=')) out.mode = a.slice('--mode='.length)\n else if (a?.startsWith('--config=')) out.config = a.slice('--config='.length)\n }\n return out\n}\n\n/** Normalize a config module's default export → a registry. */\nfunction resolveRegistry(mod: unknown): DelegatedLoopRegistry {\n const def = (mod as { default?: unknown })?.default ?? mod\n const value = typeof def === 'function' ? (def as () => unknown)() : def\n return value as DelegatedLoopRegistry\n}\n\nfunction errMsg(err: unknown): string {\n return err instanceof Error ? err.message : String(err)\n}\n\n/** The argv → IO → exit shell. Kept thin; logic lives in `runLoopRunnerCli`. */\nasync function main(): Promise<void> {\n const { mode, config } = parseLoopRunnerArgv(process.argv.slice(2))\n if (!mode || !config) {\n process.stderr.write(\n 'usage: agent-runtime-loop --mode <mode> --config <module>\\n' +\n ` modes: ${DELEGATED_LOOP_MODES.join(' | ')}\\n` +\n ' config: a JS/TS module default-exporting a DelegatedLoopRegistry (or a factory)\\n',\n )\n process.exit(2)\n }\n const { pathToFileURL } = await import('node:url')\n const { resolve } = await import('node:path')\n const cli = await runLoopRunnerCli({\n mode,\n loadRegistry: async () => resolveRegistry(await import(pathToFileURL(resolve(config)).href)),\n })\n process.stdout.write(`${JSON.stringify(cli.result ?? { error: cli.error }, null, 2)}\\n`)\n if (cli.error) process.stderr.write(`${cli.error}\\n`)\n process.exit(cli.exitCode)\n}\n\n// Run only when executed as the bin — never when imported for the testable\n// core, and never when bundled into a runtime that has no `process.argv`\n// (e.g. Cloudflare Workers, where `process` is a shim without `argv`). Reading\n// `process.argv[1]` directly would throw at module load there; `process.argv?.`\n// keeps the guard a no-op instead of crashing the Worker on startup.\nconst invokedScript = typeof process !== 'undefined' ? process.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,KAAK,KAAA;AAC3E,IAAI,iBAAiB,gCAAgC,KAAK,aAAa,GACrE,KAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as runLoopRunnerCli, n as LoopRunnerCliResult, r as parseLoopRunnerArgv, t as LoopRunnerCliArgs } from "./loop-runner-bin-
|
|
1
|
+
import { i as runLoopRunnerCli, n as LoopRunnerCliResult, r as parseLoopRunnerArgv, t as LoopRunnerCliArgs } from "./loop-runner-bin-BUm83y1g.js";
|
|
2
2
|
export { LoopRunnerCliArgs, LoopRunnerCliResult, parseLoopRunnerArgv, runLoopRunnerCli };
|
package/dist/loop-runner-bin.js
CHANGED
package/dist/mcp/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as DelegationTaskQueue, X as FileDelegationStore, o as createMcpServer } from "../supervise-
|
|
2
|
+
import { B as DelegationTaskQueue, X as FileDelegationStore, o as createMcpServer } from "../supervise-CeZtA1wu.js";
|
|
3
3
|
import { a as resolveRouterBaseUrl } from "../model-resolution-Btd9iIKV.js";
|
|
4
4
|
import { n as readTraceContextFromEnv } from "../trace-propagation-CJJC7SVB.js";
|
|
5
5
|
//#region src/mcp/delegate-supervisor-provisioning.ts
|