@tangle-network/agent-runtime 0.113.1 → 0.114.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-UZ1JenNv.js → activation-DlKl7-1o.js} +3 -3
- package/dist/{activation-UZ1JenNv.js.map → activation-DlKl7-1o.js.map} +1 -1
- package/dist/agent.d.ts +18 -7
- package/dist/agent.js +123 -64
- package/dist/agent.js.map +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-Co3sRC_7.js → candidate-execution-CfpJrd3o.js} +4 -4
- package/dist/{candidate-execution-Co3sRC_7.js.map → candidate-execution-CfpJrd3o.js.map} +1 -1
- package/dist/{environment-provider-BsHpW4Dp.js → environment-provider-CCaEhA-l.js} +38 -4
- package/dist/environment-provider-CCaEhA-l.js.map +1 -0
- package/dist/{environment-provider-DG-cSx89.d.ts → environment-provider-Cygthiy3.d.ts} +40 -1
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-cycle-C3CrNfcy.js → improvement-cycle-vLye8pYb.js} +4 -4
- package/dist/{improvement-cycle-C3CrNfcy.js.map → improvement-cycle-vLye8pYb.js.map} +1 -1
- package/dist/{index-Cr7QlEUL.d.ts → index-BLf-SZ2b.d.ts} +6 -6
- package/dist/{index-zMAqz53v.d.ts → index-D-lNUfea.d.ts} +147 -9
- package/dist/{index-B6WclhZI.d.ts → index-YpvLKzIX.d.ts} +3 -3
- package/dist/index.d.ts +7 -7
- package/dist/index.js +11 -11
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +5 -5
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-GAJFl_gz.js → knowledge-BTsA9n6L.js} +5 -5
- package/dist/{knowledge-GAJFl_gz.js.map → knowledge-BTsA9n6L.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{local-harness-Ce1emWJE.d.ts → local-harness-BnB1E9nM.d.ts} +82 -2
- package/dist/{loop-runner-bin-Cba5tsdb.d.ts → loop-runner-bin-Cg_8UKZR.d.ts} +3 -3
- package/dist/{loop-runner-bin-DvLdFo38.js → loop-runner-bin-CuBMmlMJ.js} +3 -3
- package/dist/{loop-runner-bin-DvLdFo38.js.map → loop-runner-bin-CuBMmlMJ.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 +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DftmzKLc.js → openai-tools-VAbzps5G.js} +2 -2
- package/dist/{openai-tools-DftmzKLc.js.map → openai-tools-VAbzps5G.js.map} +1 -1
- package/dist/{prepare-BKVdOn0w.js → prepare-BHQBb02e.js} +2 -2
- package/dist/{prepare-BKVdOn0w.js.map → prepare-BHQBb02e.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-BtldAE9j.js → protected-model-port-DqAH1Z2M.js} +2 -2
- package/dist/{protected-model-port-BtldAE9j.js.map → protected-model-port-DqAH1Z2M.js.map} +1 -1
- package/dist/{redact-xZvPu9qe.d.ts → redact-BRaHUFMf.d.ts} +2 -2
- package/dist/{runtime-DlSPFm9o.js → runtime-DQ5seHEu.js} +8 -5
- package/dist/runtime-DQ5seHEu.js.map +1 -0
- package/dist/{spawn-journal-DLhnom3e.js → spawn-journal-DCPbicXB.js} +2 -1
- package/dist/{spawn-journal-DLhnom3e.js.map → spawn-journal-DCPbicXB.js.map} +1 -1
- package/dist/{structural-rollout-R_ZqFaB5.js → structural-rollout-C7vF83fV.js} +3 -3
- package/dist/{structural-rollout-R_ZqFaB5.js.map → structural-rollout-C7vF83fV.js.map} +1 -1
- package/dist/{supervise-BDvAFOTM.js → supervise-tdxMJYem.js} +476 -31
- package/dist/supervise-tdxMJYem.js.map +1 -0
- package/dist/{supervisor-DS278ICs.js → supervisor-DKqolBGI.js} +232 -22
- package/dist/supervisor-DKqolBGI.js.map +1 -0
- package/dist/testing.js +9 -9
- package/dist/{workspace-archive-CYYxZyA7.js → workspace-archive-DXzJq7WP.js} +2 -2
- package/dist/{workspace-archive-CYYxZyA7.js.map → workspace-archive-DXzJq7WP.js.map} +1 -1
- package/package.json +1 -1
- package/dist/environment-provider-BsHpW4Dp.js.map +0 -1
- package/dist/runtime-DlSPFm9o.js.map +0 -1
- package/dist/supervise-BDvAFOTM.js.map +0 -1
- package/dist/supervisor-DS278ICs.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 ResumedWork, A as providerAsSandboxClient, At as SessionMessageLike, B as Executor, Bt as ExecutorProgress, C as ProviderAsSandboxClientOptions, Ct as WaitSpec, D as WorkspaceRequest, Dt as timerAt, E as SandboxClientProviderOptions, Et as pollFor, F as createTangleSandboxExactProcessProvider, Ft as decodeToolPart, G as Handle, H as ExecutorFactory, Ht as WorkerProgress, I as Agent, It as sandboxSessionTraceSource, J as NodeSnapshot, K as NoWinnerError, L as AgentSpec, Lt as ActivityLog, M as sandboxClientAsProvider, Mt as ToolStepInput, N as CreateTangleSandboxExactProcessProviderOptions, Nt as TraceSource, O as createAgentEnvironmentProviderRegistry, Ot as validateWaitSpec, P as SandboxControlClient, Pt as createPushTraceSource, Q as ResumedKeyState, R as Budget, Rt as ActivityNote, S as PlacementInfo, St as WaitRejection, T as ResourceRequest, Tt as isWaitOutcome, U as ExecutorRegistry, Ut as createActivityLog, V as ExecutorContext, Vt as ScopeProgressInput, W as ExecutorResult, Wt as readWorkerProgress, X as Restart, Y as NodeStatus, Z as ResultBlobStore, _ as CheckpointRequest, _t as WidenGate, a as AgentEnvironmentProviderRef, at as SpawnEvent, b as ExecResult, bt as WaitProbe, c as AgentEnvironmentStatus, ct as SpawnPrior, d as AgentSession, dt as SupervisedResult, et as RootHandle, f as AgentSessionRef, ft as Supervisor, g as CheckpointRef, gt as WaitOpts, h as AgentTurnResult, ht as UsageEvent, i as AgentEnvironmentProvider, it as Settled, j as resolveAgentEnvironmentProvider, jt as SessionTraceBox, k as providerAsExecutor, kt as waitUntil, l as AgentEnvironmentSummary, lt as SpawnRejection, m as AgentTurnInput, mt as TreeView, n as AgentEnvironmentCapabilities, nt as Runtime, o as AgentEnvironmentProviderRegistry, ot as SpawnJournal, p as AgentSessionStatus, pt as SupervisorOpts, q as NodeId, r as AgentEnvironmentEvent, rt as Scope, s as AgentEnvironmentQuery, st as SpawnOpts, t as AgentEnvironment, tt as RootSignal, u as AgentProfileRef, ut as Spend, v as CreateAgentEnvironmentInput, vt as PendingWait, w as ProviderExecutorOptions, wt as createWaitProbes, x as ForkRequest, xt as WaitProbeRegistry, y as ExecRequest, yt as WaitOutcome, zt as DEFAULT_STALL_AFTER_MS } from "./environment-provider-
|
|
3
|
-
import { $ as safeWorkerFile, $a as ObserveInput, $c as piSeamKey, $i as AgenticOptions, $n as structuralRollout, $o as ShapeBudget, $r as createSandboxLineage, $s as createWaterfallCollector, $t as createProgressTracker, A as GitWorkspaceOptions, Aa as RunLoopOptions, Ac as BridgeSeam, Ad as BusStats, Ai as pipeline, An as CheckExecChannel, Ao as ScopeAnalyzeInput, Ar as dumbDriver, As as ScoreOf, At as ResolvedSupervisorProfile, B as analyzeTrace, Ba as resolveMcpServerLaunch, Bc as createExecutor, Bd as FileSpawnJournal, Bi as McpEndpoint, Bn as StructuralRolloutResult, Bo as WidenDecision, Br as Deliverable, Bs as auditIntent, Bt as finalizeBestDelivered, C as closingWorkerNote, Ca as sampleThenRefine, Ci as FileCorpus, Cn as ProfileRichnessThresholds, Co as PanelSpec, Cr as assertStrategyContract, Cs as Interval, Ct as queueOf, D as UntrackedCopyStats, Da as loopCampaignDispatch, Di as flatWidenGate, Dn as defaultProfileRichnessThresholds, Do as RenderCorpusToInstructions, Dr as DumbDriverOptions, Ds as PairwiseOptions, Dt as delegate, E as CopyOptions, Ea as LoopOptionsForDispatch, Ei as fanout, En as authoredWorker, Eo as PipelineStage, Er as ApplyContinuation, Es as LeaderboardRow, Et as defaultDelegateBudget, F as gitWorkspace, Fa as localSandboxClient, Fc as ProviderSeam, Fd as defaultToolDetectors, Fi as RegistryAnalyzeProjection, Fn as CheckSourceCtx, Fo as TrajectoryReportFn, Fr as McpToolDescriptor, Fs as renderLeaderboardSvg, Ft as supervisorAgent, G as supervise, Ga as InProcessPromptCtx, Gc as SteerableSandboxSession, Gd as pendingWaits, Gi as BenchmarkConfig, Gn as defaultExtractCandidate, Go as DefinePersonaInput, Gr as SandboxRunAbortError, Gs as anytimeReport, Gt as ProgressTracker, H as SuperviseOptions, Ha as secretEnvOfMcpServer, Hc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Hd as InMemorySpawnJournal, Hi as createMcpEnvironment, Hn as canDisplace, Ho as WidenSpec, Hr as OpenSandboxRunOptions, Hs as AnytimeReport, Ht as NoProgressForOptions, I as jjWorkspace, Ia as KeyProvider, Ic as RouterSeam, Id as watchTrace, Ii as assertTraceDerivedFindings, In as RepairStop, Io as TrajectoryReportOptions, Ir as StdioMcpConnection, Is as renderPairwiseMarkdown, It as CoordinationMcpHandle, J as createScope, Ja as HarvestCorpusOptions, Jc as InboxMessage, Ji as BenchmarkStrategySummary, Jn as modelAuthoredChecks, Jo as Persona, Jr as CheckpointCapableBox, Js as plateauLength, Jt as StopDecision, K as workerFromBackend, Ka as InProcessSandboxClientOptions, Kc as createSteerableSandboxSession, Kd as replaySpawnTree, Ki as BenchmarkLift, Kn as defaultStructuralRolloutPolicy, Ko as LoopShape, Kr as TurnResult, Ks as areaUnderCurve, Kt as ProgressTrackerOptions, L as localShell, La as ResolvedMcpServerLaunch, Lc as RouterToolsSeam, Ld as DeliverableSpec, Li as buildSteerContext, Ln as StructuralRolloutConfig, Lo as Verify, Lr as StdioMcpServerSpec, Ls as AuditIntentInput, Lt as serveCoordinationMcp, M as Workspace, Ma as runAgentRounds, Mc as CliWorktreeBridgeSeam, Md as PublishOptions, Mi as verify, Mn as CheckRunContext, Mo as SteerContext, Mr as LocalMcpMaterialization, Ms as pairwiseSignificance, Mt as SupervisorProfile, N as WorkspaceCommit, Na as runLoop, Nc as CliWorktreeSeam, Nd as createEventBus, Ni as widen, Nn as CheckRunner, No as TrajectoryNode, Nr as MaterializeLocalMcpOptions, Ns as renderLeaderboardHtml, Nt as assertCoordinationBinding, O as copyUntrackedIntoClone, Oa as loopDispatch, Od as BusEvent, Oi as loopUntil, On as profileRichnessFinding, Oo as RenderCorpusToInstructionsOptions, Or as NaiveDriverOptions, Os as PairwiseVerdict, Ot as CoordinationBinding, P as WorkspaceRun, Pa as LocalSandboxClientOptions, Pc as ExecutorConfig, Pd as WatchTraceOptions, Pi as CreateScopeAnalystOptions, Pn as CheckSource, Po as TrajectoryReport, Pr as McpSpawnFault, Ps as renderLeaderboardMarkdown, Pt as resolveSupervisorProfile, Q as readWorkerSteerRequests, Qa as Observation, Qc as piExecutor, Qi as runBenchmark, Qn as selectBestIndex, Qo as RunPersonifiedOptions, Qr as SessionCapableBox, Qs as WaterfallSpan, Qt as anyOf, R as runInWorkspace, Ra as envKeyProvider, Rc as SandboxSeam, Rd as gateOnDeliverable, Ri as createScopeAnalyst, Rn as StructuralRolloutMessage, Ro as VerifySpec, Rr as connectStdioMcp, Rs as AuditIntentOptions, Rt as DriverAgentOptions, S as WorkerEvidenceInput, Sa as sample, Si as runPersonified, Sn as ProfileRichness, So as PanelJudge, Sr as AuthoredStrategy, Ss as GroupOf, St as freeSlots, T as settledWorkerOut, Ta as LoopDispatchOptions, Ti as renderCorpusToInstructions, Tn as assessAuthoredProfile, To as Pipeline, Tr as strategyAuthorContract, Ts as LeaderboardOptions, Tt as DelegateOptions, U as SuperviseRegistry, Ua as inlineSandboxClient, Uc as SandboxSteeringOptions, Ud as contentAddress, Ui as sanitizeMcpToolSchema, Un as compareCheckOutcomes, Uo as WinnerStrategy, Ur as OpenSandboxRunPromptOptions, Us as AnytimeStrategySummary, Ut as PlateauOptions, V as createSupervisor, Va as resolveSecretEnv, Vc as createExecutorRegistry, Vd as InMemoryResultBlobStore, Vi as McpEnvironmentOptions, Vn as VisibleCheck, Vo as WidenLineage, Vr as OpenSandboxRunBeforeStartContext, Vs as defaultAuditorInstruction, Vt as AllWorkersStalledOptions, W as SuperviseRegistryTable, Wa as InProcessOnPrompt, Wc as SteerableSandboxArgs, Wd as materializeTreeView, Wi as BenchmarkCell, Wn as composeCheckSources, Wo as DefinePersona, Wr as SandboxRun, Ws as AnytimeTaskCurve, Wt as ProgressSample, X as WorkerSteerRequest, Xa as HarvestReport, Xc as PI_RUNTIME, Xi as Environment, Xn as resolveEntrySymbol, Xo as PersonaExecutors, Xr as SandboxLineage, Xs as WaterfallCollector, Xt as allOf, Y as settledToIteration, Ya as HarvestFailure, Yc as createInbox, Yi as BenchmarkTaskRow, Yn as officialChecksFromMeta, Yo as PersonaContext, Yr as ForkCapableBox, Ys as renderAnytimeTable, Yt as StopRule, Z as legacySupervisorRunDir, Za as harvestCorpus, Zc as PiSeam, Zi as printBenchmarkReport, Zn as sandboxCheckRunner, Zo as RunPersonified, Zr as SandboxLineageHandle, Zs as WaterfallReport, Zt as allWorkersStalled, _ as WorktreeFanoutOptions, _a as breadthStrategy, _i as trajectoryReport, _n as ReservationRejection, _o as FlatWidenGate, _r as discriminatingMeans, _s as completionAuthorizes, _t as DispatchReport, a as SandboxInstance, aa as CorpusReadbackOptions, ac as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ai as sumSandboxUsage, an as FinalizerSettled, ao as CombinatorShape, ar as collectAgentTurn, as as LeaderboardBenchmarkAdapter, at as InMemoryRunContext, b as NOTE_MAX_CHARS, ba as refine, bi as registerShape, bn as spendFromUsageEvents, bo as LoopUntilState, br as selectChampion, bs as stopSentinel, bt as RollingDispatchOptions, c as VerifierEnvironmentOptions, ca as ShotSpec, ci as probeSandboxCapabilities, cn as collectDelivered, co as CorpusRecord, cr as ChampionPolicy, cs as LeaderboardRunContext, ct as createFileRunContext, d as SuperviseSurfaceResult, da as StrategyCtx, di as ResolveSandboxClientOptions, dn as runTree, do as EqualKOnCostOptions, dr as EvolutionBandInfo, ds as LeaderboardSpec, dt as patchDelivered, ea as AgenticRunResult, ec as AnalystFindingEvent, ei as SandboxToolPartState, el as WorktreeCheckRunner, en as noProgressFor, eo as ObserveOptions, er as visibleCheckScore, es as ShapeContext, et as supervisorRunDir, f as SurfaceWorkerConfig, fa as StrategyMessage, fi as resolveSandboxClient, fn as CoordinationLog, fo as EqualKVerdict, fr as EvolutionCandidate, fs as defineLeaderboard, ft as WorktreeCliExecutorOptions, g as AuthoredHarness, ga as adaptiveRefine, gi as equalKOnCost, gn as BudgetReadout, go as FanoutWinnerSelector, gr as StrategyEvolutionConfig, gs as CompletionVerdict, gt as ConcurrencyCaps, h as superviseSurface, ha as SurfaceScore, hi as promotionGate, hn as BudgetPool, ho as FanoutSynthesis, hr as ReproductionCheck, hs as CompletionPolicy, ht as assertModelAllowed, i as SandboxEvent, ia as ArtifactHandle, ii as mapSandboxToolEvent, in as FinalizeContext, io as AssertTraceDerivedFindings, ir as StreamAgentTurnOptions, is as LeaderboardBenchTask, it as writeWorkerSteer, j as Shell, ja as defaultSelectWinner, jc as CliSeam, jd as EventBus, ji as selectValidWinner, jn as CheckOutcome, jo as ScopeWidenGate, jr as naiveDriver, js as leaderboard, jt as SupervisorAgentDeps, k as withUntrackedArtifacts, ka as RunAgentRoundsOptions, kd as BusRecord, ki as panel, kn as supervisorInstructions, ko as ScopeAnalyst, kr as SteeringDecision, ks as ProfileKeyOf, kt as DriveHarness, l as createVerifierEnvironment, la as Strategy, li as AcquireOptions, ln as pickBestDelivered, lo as EqualKArm, lr as EvolutionArchiveNode, ls as LeaderboardScenario, lt as createInMemoryRunContext, m as failuresAnalyst, ma as StrategyShotResult, mi as PromotionVerdict, mn as PriorCoordination, mo as FanoutOptions, mr as EvolutionReport, ms as CompletionEvidence, mt as createWorktreeCliExecutor, n as AnalystFinding, na as AgenticTask, nc as CoordinationEvent, ni as extractLlmCallEvent, nl as WorktreeHarnessResult, nn as sampleFromSettled, no as observe, nr as AgentTurnUsage, ns as DefinedLeaderboard, nt as workerInboxFile, o as computeFindingId, oa as RunAgenticOptions, oc as DownMessageEvent, oi as CriuCapableClient, on as SupervisorFinalizer, oo as Corpus, or as streamAgentTurn, os as LeaderboardFlagSpec, ot as InMemoryRunContextOptions, p as SurfaceWorkerOut, pa as StrategyResult, pi as PromotionGateOptions, pn as FileCoordinationLog, po as Fanout, pr as EvolutionGeneration, ps as CompletionAnalyst, pt as WorktreePatchArtifact, q as ScopeArgs, qa as inProcessSandboxClient, qc as Inbox, qi as BenchmarkReport, qn as filterAuthoredAsserts, qo as Outcome, qr as openSandboxRun, qs as bestSoFar, qt as ProgressView, r as CreateSandboxOptions, ra as AgenticTool, ri as mapSandboxEvent, rl as WorktreeProfileMaterializationReceipt, rn as DeliveredOutput, ro as renderReport, rr as CollectedAgentTurn, rs as LeaderboardBenchScore, rt as workerInboxFileFromEventDir, s as makeFinding, sa as ShotPersona, sc as MakeWorkerAgent, si as SandboxCapabilities, sn as bestDelivered, so as CorpusFilter, sr as ChampionPick, ss as LeaderboardIterationInfo, st as RunContext, t as AgentProfile, ta as AgenticSurface, tc as AnalystRegistry, ti as createSandboxToolPartState, tl as WorktreeCommandResult, tn as plateau, to as defaultAnalystInstruction, tr as AgentTurnBackend, ts as ShapeRegistry, tt as supervisorRunsRoot, u as SuperviseSurfaceOptions, ua as StrategyArtifacts, ui as acquireSandbox, un as runFinalizer, uo as EqualKOnCost, ur as EvolutionAuthor, us as LeaderboardScore, ut as PatchDeliverableOptions, v as worktreeFanout, va as defineStrategy, vi as builtinShapes, vn as ReservationTicket, vo as LoopUntil, vr as pickChampion, vs as deterministicCompletion, vt as DispatchStopReason, w as composeWorkerEvidence, wa as LoopCampaignDispatchOptions, wi as InMemoryCorpus, wn as asAuthoredProfile, wo as PanelVerdict, wr as authorStrategy, ws as Leaderboard, wt as rollingDispatch, x as VERIFY_TAIL_CHARS, xa as runAgentic, xi as definePersona, xn as AuthoredProfile, xo as Panel, xr as AuthorStrategyOptions, xs as AxisScoresOf, xt as effectiveConcurrency, y as EVIDENCE_MAX_CHARS, ya as depthStrategy, yi as createShapeRegistry, yn as createBudgetPool, yo as LoopUntilSpec, yr as runStrategyEvolution, ys as sentinelCompletion, yt as DispatchUnit, z as TrajectoryAnalysis, za as mcpSecretEnvMetadataKey, zc as cliWorktreeExecutor, zd as FileResultBlobStore, zi as registryScopeAnalyst, zn as StructuralRolloutPolicy, zo as Widen, zr as materializeLocalMcp, zs as IntentAudit, zt as driverAgent } from "./index-zMAqz53v.js";
|
|
4
|
-
import {
|
|
5
|
-
export { type AcquireOptions, type ActivityLog, type ActivityNote, type Agent, type AgentEnvironment, type AgentEnvironmentCapabilities, type AgentEnvironmentEvent, type AgentEnvironmentProvider, type AgentEnvironmentProviderRef, type AgentEnvironmentProviderRegistry, type AgentEnvironmentQuery, type AgentEnvironmentStatus, type AgentEnvironmentSummary, type AgentProfile, type AgentProfileRef, type AgentRunSpec, type AgentSession, type AgentSessionRef, type AgentSessionStatus, type AgentSpec, type AgentTurnBackend, type AgentTurnInput, type AgentTurnResult, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AllWorkersStalledOptions, type AnalystFinding, type AnalystFindingEvent, type AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredHarness, type AuthoredProfile, type AuthoredStrategy, type AxisScoresOf, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, type Budget, type BudgetPool, type BudgetReadout, type BusEvent, type BusRecord, type BusStats, type ChampionPick, type ChampionPolicy, type CheckExecChannel, type CheckOutcome, type CheckRunContext, type CheckRunner, type CheckSource, type CheckSourceCtx, type CheckpointCapableBox, type CheckpointRef, type CheckpointRequest, type CliSeam, type CliWorktreeBridgeSeam, type CliWorktreeSeam, type CollectedAgentTurn, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type ConcurrencyCaps, type CoordinationBinding, type CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, type CopyOptions, type Corpus, type CorpusFilter, type CorpusReadbackOptions, type CorpusRecord, type CreateAgentEnvironmentInput, type CreateSandboxOptions, type CreateScopeAnalystOptions, type CreateTangleSandboxExactProcessProviderOptions, type CriuCapableClient, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, type DefaultVerdict, type DefinePersona, type DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, type DeliverableSpec, type DeliveredOutput, type DispatchReport, type DispatchStopReason, type DispatchUnit, type DownMessageEvent, type DriveHarness, type Driver, type DriverAgentOptions, type DumbDriverOptions, EVIDENCE_MAX_CHARS, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EventBus, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, type ExecCtx, type ExecRequest, type ExecResult, type Executor, type ExecutorConfig, type ExecutorContext, type ExecutorFactory, type ExecutorProgress, type ExecutorRegistry, type ExecutorResult, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FinalizeContext, type FinalizerSettled, type FlatWidenGate, type ForkCapableBox, type ForkRequest, type GitWorkspaceOptions, type GroupOf, type Handle, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, type Iteration, type KeyProvider, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LocalMcpMaterialization, type LocalSandboxClientOptions, type LoopCampaignDispatchOptions, type LoopDecisionPayload, type LoopDispatchOptions, type LoopEndedPayload, type LoopIterationDispatchPayload, type LoopIterationEndedPayload, type LoopIterationStartedPayload, type LoopLineageOptions, type LoopOptionsForDispatch, type LoopPlanDescription, type LoopPlanPayload, type LoopResult, type LoopSandboxPlacement, type LoopShape, type LoopStartedPayload, type LoopTeardownFailedPayload, type LoopTokenUsage, type LoopTraceEmitter, type LoopTraceEvent, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type LoopWinner, type MakeWorkerAgent, type MaterializeLocalMcpOptions, type McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, type MountManifestEntry, type MountRecorder, NOTE_MAX_CHARS, type NaiveDriverOptions, type NoProgressForOptions, type NoWinnerError, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, PI_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 ReservationRejection, type ReservationTicket, type ResolveSandboxClientOptions, type ResolvedMcpServerLaunch, type ResolvedSupervisorProfile, type ResourceRequest, type Restart, type ResultBlobStore, type ResumedKeyState, type ResumedWork, type RollingDispatchOptions, type RootHandle, type RootSignal, type RouterChatResult, type RouterChatToolsResult, type RouterConfig, type RouterSeam, type RouterToolCall, type RouterToolLoopResult, type RouterToolsSeam, type RunAgentRoundsOptions, type RunAgenticOptions, type RunContext, type RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type RunProvenance, type Runtime, type SandboxCapabilities, type SandboxClient, type SandboxClientProviderOptions, type SandboxControlClient, type SandboxEvent, type SandboxInstance, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxSeam, type SandboxSteeringOptions, type SandboxToolPartState, type Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeArgs, type ScopeProgressInput, type ScopeWidenGate, type ScoreOf, type SelectionReceipt, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, type Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, type SpawnEvent, type SpawnJournal, type SpawnOpts, type SpawnPrior, type SpawnRejection, type Spend, type StdioMcpConnection, type StdioMcpServerSpec, type SteerContext, type SteerableSandboxArgs, type SteerableSandboxSession, type SteeringDecision, type StopDecision, type StopRule, type Strategy, type StrategyArtifacts, type StrategyCtx, type StrategyEvolutionConfig, type StrategyMessage, type StrategyResult, type StrategyShotResult, type StreamAgentTurnOptions, type StructuralRolloutConfig, type StructuralRolloutMessage, type StructuralRolloutPolicy, type StructuralRolloutResult, type SuperviseOptions, type SuperviseRegistry, type SuperviseRegistryTable, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorOpts, type SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, type ToolLoopChat, type ToolLoopCompaction, type ToolLoopCompactionOptions, type ToolLoopMessageRecord, type ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, type TreeView, type TurnResult, type UntrackedCopyStats, type UsageEvent, VERIFY_TAIL_CHARS, type ValidationCtx, type Validator, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type VisibleCheck, type WaitOpts, type WaitOutcome, type WaitProbe, type WaitProbeRegistry, type WaitRejection, type WaitSpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenGate, type WidenLineage, type WidenSpec, type WinnerStrategy, type WorkerEvidenceInput, type WorkerProgress, type WorkerSteerRequest, type Workspace, type WorkspaceCommit, type WorkspaceRequest, type WorkspaceRun, type WorktreeCheckRunner, type WorktreeCliExecutorOptions, type WorktreeCommandResult, type WorktreeFanoutOptions, type WorktreeHarnessResult, type WorktreePatchArtifact, type WorktreeProfileMaterializationReceipt, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, 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, legacySupervisorRunDir, 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, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
|
2
|
+
import { $ as ResumedWork, A as providerAsSandboxClient, At as SessionMessageLike, B as Executor, Bt as ExecutorProgress, C as ProviderAsSandboxClientOptions, Ct as WaitSpec, D as WorkspaceRequest, Dt as timerAt, E as SandboxClientProviderOptions, Et as pollFor, F as createTangleSandboxExactProcessProvider, Ft as decodeToolPart, G as Handle, H as ExecutorFactory, Ht as WorkerProgress, I as Agent, It as sandboxSessionTraceSource, J as NodeSnapshot, K as NoWinnerError, L as AgentSpec, Lt as ActivityLog, M as sandboxClientAsProvider, Mt as ToolStepInput, N as CreateTangleSandboxExactProcessProviderOptions, Nt as TraceSource, O as createAgentEnvironmentProviderRegistry, Ot as validateWaitSpec, P as SandboxControlClient, Pt as createPushTraceSource, Q as ResumedKeyState, R as Budget, Rt as ActivityNote, S as PlacementInfo, St as WaitRejection, T as ResourceRequest, Tt as isWaitOutcome, U as ExecutorRegistry, Ut as createActivityLog, V as ExecutorContext, Vt as ScopeProgressInput, W as ExecutorResult, Wt as readWorkerProgress, X as Restart, Y as NodeStatus, Z as ResultBlobStore, _ as CheckpointRequest, _t as WidenGate, a as AgentEnvironmentProviderRef, at as SpawnEvent, b as ExecResult, bt as WaitProbe, c as AgentEnvironmentStatus, ct as SpawnPrior, d as AgentSession, dt as SupervisedResult, et as RootHandle, f as AgentSessionRef, ft as Supervisor, g as CheckpointRef, gt as WaitOpts, h as AgentTurnResult, ht as UsageEvent, i as AgentEnvironmentProvider, it as Settled, j as resolveAgentEnvironmentProvider, jt as SessionTraceBox, k as providerAsExecutor, kt as waitUntil, l as AgentEnvironmentSummary, lt as SpawnRejection, m as AgentTurnInput, mt as TreeView, n as AgentEnvironmentCapabilities, nt as Runtime, o as AgentEnvironmentProviderRegistry, ot as SpawnJournal, p as AgentSessionStatus, pt as SupervisorOpts, q as NodeId, r as AgentEnvironmentEvent, rt as Scope, s as AgentEnvironmentQuery, st as SpawnOpts, t as AgentEnvironment, tt as RootSignal, u as AgentProfileRef, ut as Spend, v as CreateAgentEnvironmentInput, vt as PendingWait, w as ProviderExecutorOptions, wt as createWaitProbes, x as ForkRequest, xt as WaitProbeRegistry, y as ExecRequest, yt as WaitOutcome, zt as DEFAULT_STALL_AFTER_MS } from "./environment-provider-Cygthiy3.js";
|
|
3
|
+
import { $ as safeWorkerFile, $a as ObserveInput, $c as piExecutor, $d as InMemorySpawnJournal, $i as AgenticOptions, $n as structuralRollout, $o as ShapeBudget, $r as createSandboxLineage, $s as createWaterfallCollector, $t as createProgressTracker, A as GitWorkspaceOptions, Aa as RunLoopOptions, Ac as BridgeSeam, Ai as pipeline, An as CheckExecChannel, Ao as ScopeAnalyzeInput, Ar as dumbDriver, As as ScoreOf, At as ResolvedSupervisorProfile, B as analyzeTrace, Ba as resolveMcpServerLaunch, Bc as createExecutor, Bd as BusRecord, Bi as McpEndpoint, Bn as StructuralRolloutResult, Bo as WidenDecision, Br as Deliverable, Bs as auditIntent, Bt as finalizeBestDelivered, C as closingWorkerNote, Ca as sampleThenRefine, Ci as FileCorpus, Cn as ProfileRichnessThresholds, Co as PanelSpec, Cr as assertStrategyContract, Cs as Interval, Ct as queueOf, D as UntrackedCopyStats, Da as loopCampaignDispatch, Di as flatWidenGate, Dn as defaultProfileRichnessThresholds, Do as RenderCorpusToInstructions, Dr as DumbDriverOptions, Ds as PairwiseOptions, Dt as delegate, E as CopyOptions, Ea as LoopOptionsForDispatch, Ei as fanout, En as authoredWorker, Eo as PipelineStage, Er as ApplyContinuation, Es as LeaderboardRow, Et as defaultDelegateBudget, F as gitWorkspace, Fa as localSandboxClient, Fc as ProviderSeam, Fi as RegistryAnalyzeProjection, Fn as CheckSourceCtx, Fo as TrajectoryReportFn, Fr as McpToolDescriptor, Fs as renderLeaderboardSvg, Ft as supervisorAgent, G as supervise, Ga as InProcessPromptCtx, Gc as SteerableSandboxSession, Gd as WatchTraceOptions, Gi as BenchmarkConfig, Gn as defaultExtractCandidate, Go as DefinePersonaInput, Gr as SandboxRunAbortError, Gs as anytimeReport, Gt as ProgressTracker, H as SuperviseOptions, Ha as secretEnvOfMcpServer, Hc as DEFAULT_SANDBOX_STEERING_MAX_TURNS, Hd as EventBus, Hi as createMcpEnvironment, Hn as canDisplace, Ho as WidenSpec, Hr as OpenSandboxRunOptions, Hs as AnytimeReport, Ht as NoProgressForOptions, I as jjWorkspace, Ia as KeyProvider, Ic as RouterSeam, Ii as assertTraceDerivedFindings, In as RepairStop, Io as TrajectoryReportOptions, Ir as StdioMcpConnection, Is as renderPairwiseMarkdown, It as CoordinationMcpHandle, J as createScope, Ja as HarvestCorpusOptions, Jc as InboxMessage, Jd as DeliverableSpec, Ji as BenchmarkStrategySummary, Jn as modelAuthoredChecks, Jo as Persona, Jr as CheckpointCapableBox, Js as plateauLength, Jt as StopDecision, K as workerFromBackend, Ka as InProcessSandboxClientOptions, Kc as createSteerableSandboxSession, Kd as defaultToolDetectors, Ki as BenchmarkLift, Kn as defaultStructuralRolloutPolicy, Ko as LoopShape, Kr as TurnResult, Ks as areaUnderCurve, Kt as ProgressTrackerOptions, L as localShell, La as ResolvedMcpServerLaunch, Lc as RouterToolsSeam, Li as buildSteerContext, Ln as StructuralRolloutConfig, Lo as Verify, Lr as StdioMcpServerSpec, Ls as AuditIntentInput, Lt as serveCoordinationMcp, M as Workspace, Ma as runAgentRounds, Mc as CliWorktreeBridgeSeam, Mi as verify, Mn as CheckRunContext, Mo as SteerContext, Mr as LocalMcpMaterialization, Ms as pairwiseSignificance, Mt as SupervisorProfile, N as WorkspaceCommit, Na as runLoop, Nc as CliWorktreeSeam, Ni as widen, Nn as CheckRunner, No as TrajectoryNode, Nr as MaterializeLocalMcpOptions, Ns as renderLeaderboardHtml, Nt as assertCoordinationBinding, O as copyUntrackedIntoClone, Oa as loopDispatch, Oi as loopUntil, On as profileRichnessFinding, Oo as RenderCorpusToInstructionsOptions, Or as NaiveDriverOptions, Os as PairwiseVerdict, Ot as CoordinationBinding, P as WorkspaceRun, Pa as LocalSandboxClientOptions, Pc as ExecutorConfig, Pi as CreateScopeAnalystOptions, Pn as CheckSource, Po as TrajectoryReport, Pr as McpSpawnFault, Ps as renderLeaderboardMarkdown, Pt as resolveSupervisorProfile, Q as readWorkerSteerRequests, Qa as Observation, Qc as PiSeam, Qd as InMemoryResultBlobStore, Qi as runBenchmark, Qn as selectBestIndex, Qo as RunPersonifiedOptions, Qr as SessionCapableBox, Qs as WaterfallSpan, Qt as anyOf, R as runInWorkspace, Ra as envKeyProvider, Rc as SandboxSeam, Ri as createScopeAnalyst, Rn as StructuralRolloutMessage, Ro as VerifySpec, Rr as connectStdioMcp, Rs as AuditIntentOptions, Rt as DriverAgentOptions, S as WorkerEvidenceInput, Sa as sample, Si as runPersonified, Sn as ProfileRichness, So as PanelJudge, Sr as AuthoredStrategy, Ss as GroupOf, St as freeSlots, T as settledWorkerOut, Ta as LoopDispatchOptions, Ti as renderCorpusToInstructions, Tn as assessAuthoredProfile, To as Pipeline, Tr as strategyAuthorContract, Ts as LeaderboardOptions, Tt as DelegateOptions, U as SuperviseRegistry, Ua as inlineSandboxClient, Uc as SandboxSteeringOptions, Ud as PublishOptions, Ui as sanitizeMcpToolSchema, Un as compareCheckOutcomes, Uo as WinnerStrategy, Ur as OpenSandboxRunPromptOptions, Us as AnytimeStrategySummary, Ut as PlateauOptions, V as createSupervisor, Va as resolveSecretEnv, Vc as createExecutorRegistry, Vd as BusStats, Vi as McpEnvironmentOptions, Vn as VisibleCheck, Vo as WidenLineage, Vr as OpenSandboxRunBeforeStartContext, Vs as defaultAuditorInstruction, Vt as AllWorkersStalledOptions, W as SuperviseRegistryTable, Wa as InProcessOnPrompt, Wc as SteerableSandboxArgs, Wd as createEventBus, Wi as BenchmarkCell, Wn as composeCheckSources, Wo as DefinePersona, Wr as SandboxRun, Ws as AnytimeTaskCurve, Wt as ProgressSample, X as WorkerSteerRequest, Xa as HarvestReport, Xc as PI_RUNTIME, Xd as FileResultBlobStore, Xi as Environment, Xn as resolveEntrySymbol, Xo as PersonaExecutors, Xr as SandboxLineage, Xs as WaterfallCollector, Xt as allOf, Y as settledToIteration, Ya as HarvestFailure, Yc as createInbox, Yd as gateOnDeliverable, Yi as BenchmarkTaskRow, Yn as officialChecksFromMeta, Yo as PersonaContext, Yr as ForkCapableBox, Ys as renderAnytimeTable, Yt as StopRule, Z as legacySupervisorRunDir, Za as harvestCorpus, Zc as PiExecutorOutput, Zd as FileSpawnJournal, Zi as printBenchmarkReport, Zn as sandboxCheckRunner, Zo as RunPersonified, Zr as SandboxLineageHandle, Zs as WaterfallReport, Zt as allWorkersStalled, _ as WorktreeFanoutOptions, _a as breadthStrategy, _i as trajectoryReport, _n as ReservationRejection, _o as FlatWidenGate, _r as discriminatingMeans, _s as completionAuthorizes, _t as DispatchReport, a as SandboxInstance, aa as CorpusReadbackOptions, ac as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ai as sumSandboxUsage, al as PiMcpMountOptions, an as FinalizerSettled, ao as CombinatorShape, ar as collectAgentTurn, as as LeaderboardBenchmarkAdapter, at as InMemoryRunContext, b as NOTE_MAX_CHARS, ba as refine, bi as registerShape, bn as spendFromUsageEvents, bo as LoopUntilState, br as selectChampion, bs as stopSentinel, bt as RollingDispatchOptions, c as VerifierEnvironmentOptions, ca as ShotSpec, ci as probeSandboxCapabilities, cl as buildPiMcpServers, cn as collectDelivered, co as CorpusRecord, cr as ChampionPolicy, cs as LeaderboardRunContext, ct as createFileRunContext, d as SuperviseSurfaceResult, da as StrategyCtx, di as ResolveSandboxClientOptions, dl as WorktreeCheckRunner, dn as runTree, do as EqualKOnCostOptions, dr as EvolutionBandInfo, ds as LeaderboardSpec, dt as patchDelivered, ea as AgenticRunResult, ec as AnalystFindingEvent, ef as contentAddress, ei as SandboxToolPartState, el as piSeamKey, en as noProgressFor, eo as ObserveOptions, er as visibleCheckScore, es as ShapeContext, et as supervisorRunDir, f as SurfaceWorkerConfig, fa as StrategyMessage, fi as resolveSandboxClient, fl as WorktreeCommandResult, fn as CoordinationLog, fo as EqualKVerdict, fr as EvolutionCandidate, fs as defineLeaderboard, ft as WorktreeCliExecutorOptions, g as AuthoredHarness, ga as adaptiveRefine, gi as equalKOnCost, gn as BudgetReadout, go as FanoutWinnerSelector, gr as StrategyEvolutionConfig, gs as CompletionVerdict, gt as ConcurrencyCaps, h as superviseSurface, ha as SurfaceScore, hi as promotionGate, hn as BudgetPool, ho as FanoutSynthesis, hr as ReproductionCheck, hs as CompletionPolicy, ht as assertModelAllowed, i as SandboxEvent, ia as ArtifactHandle, ii as mapSandboxToolEvent, il as PiMcpMount, in as FinalizeContext, io as AssertTraceDerivedFindings, ir as StreamAgentTurnOptions, is as LeaderboardBenchTask, it as writeWorkerSteer, j as Shell, ja as defaultSelectWinner, jc as CliSeam, ji as selectValidWinner, jn as CheckOutcome, jo as ScopeWidenGate, jr as naiveDriver, js as leaderboard, jt as SupervisorAgentDeps, k as withUntrackedArtifacts, ka as RunAgentRoundsOptions, ki as panel, kn as supervisorInstructions, ko as ScopeAnalyst, kr as SteeringDecision, ks as ProfileKeyOf, kt as DriveHarness, l as createVerifierEnvironment, la as Strategy, li as AcquireOptions, ll as piMcpAdapterAvailable, ln as pickBestDelivered, lo as EqualKArm, lr as EvolutionArchiveNode, ls as LeaderboardScenario, lt as createInMemoryRunContext, m as failuresAnalyst, ma as StrategyShotResult, mi as PromotionVerdict, ml as WorktreeProfileMaterializationReceipt, mn as PriorCoordination, mo as FanoutOptions, mr as EvolutionReport, ms as CompletionEvidence, mt as createWorktreeCliExecutor, n as AnalystFinding, na as AgenticTask, nc as CoordinationEvent, nf as pendingWaits, ni as extractLlmCallEvent, nl as PI_MCP_ADAPTER_ENV, nn as sampleFromSettled, no as observe, nr as AgentTurnUsage, ns as DefinedLeaderboard, nt as workerInboxFile, o as computeFindingId, oa as RunAgenticOptions, oc as DownMessageEvent, oi as CriuCapableClient, ol as PiMcpPreparation, on as SupervisorFinalizer, oo as Corpus, or as streamAgentTurn, os as LeaderboardFlagSpec, ot as InMemoryRunContextOptions, p as SurfaceWorkerOut, pa as StrategyResult, pi as PromotionGateOptions, pl as WorktreeHarnessResult, pn as FileCoordinationLog, po as Fanout, pr as EvolutionGeneration, ps as CompletionAnalyst, pt as WorktreePatchArtifact, q as ScopeArgs, qa as inProcessSandboxClient, qc as Inbox, qd as watchTrace, qi as BenchmarkReport, qn as filterAuthoredAsserts, qo as Outcome, qr as openSandboxRun, qs as bestSoFar, qt as ProgressView, r as CreateSandboxOptions, ra as AgenticTool, rf as replaySpawnTree, ri as mapSandboxEvent, rl as PI_MCP_CONFIG_FLAG, rn as DeliveredOutput, ro as renderReport, rr as CollectedAgentTurn, rs as LeaderboardBenchScore, rt as workerInboxFileFromEventDir, s as makeFinding, sa as ShotPersona, sc as MakeWorkerAgent, si as SandboxCapabilities, sl as PiMcpReceipt, sn as bestDelivered, so as CorpusFilter, sr as ChampionPick, ss as LeaderboardIterationInfo, st as RunContext, t as AgentProfile, ta as AgenticSurface, tc as AnalystRegistry, tf as materializeTreeView, ti as createSandboxToolPartState, tl as PI_MCP_ADAPTER, tn as plateau, to as defaultAnalystInstruction, tr as AgentTurnBackend, ts as ShapeRegistry, tt as supervisorRunsRoot, u as SuperviseSurfaceOptions, ua as StrategyArtifacts, ui as acquireSandbox, ul as preparePiMcp, un as runFinalizer, uo as EqualKOnCost, ur as EvolutionAuthor, us as LeaderboardScore, ut as PatchDeliverableOptions, v as worktreeFanout, va as defineStrategy, vi as builtinShapes, vn as ReservationTicket, vo as LoopUntil, vr as pickChampion, vs as deterministicCompletion, vt as DispatchStopReason, w as composeWorkerEvidence, wa as LoopCampaignDispatchOptions, wi as InMemoryCorpus, wn as asAuthoredProfile, wo as PanelVerdict, wr as authorStrategy, ws as Leaderboard, wt as rollingDispatch, x as VERIFY_TAIL_CHARS, xa as runAgentic, xi as definePersona, xn as AuthoredProfile, xo as Panel, xr as AuthorStrategyOptions, xs as AxisScoresOf, xt as effectiveConcurrency, y as EVIDENCE_MAX_CHARS, ya as depthStrategy, yi as createShapeRegistry, yn as createBudgetPool, yo as LoopUntilSpec, yr as runStrategyEvolution, ys as sentinelCompletion, yt as DispatchUnit, z as TrajectoryAnalysis, za as mcpSecretEnvMetadataKey, zc as cliWorktreeExecutor, zd as BusEvent, zi as registryScopeAnalyst, zn as StructuralRolloutPolicy, zo as Widen, zr as materializeLocalMcp, zs as IntentAudit, zt as driverAgent } from "./index-D-lNUfea.js";
|
|
4
|
+
import { C as ToolLoopMessageRecord, S as ToolLoopCompactionOptions, _ as routerChatWithUsage, b as ToolLoopChat, d as RouterConfig, f as RouterToolCall, g as routerChatWithTools, h as routerBrain, l as RouterChatResult, m as ToolSpec, p as RouterToolLoopResult, u as RouterChatToolsResult, v as routerToolLoop, x as ToolLoopCompaction, y as streamRouterChatWithTools } from "./local-harness-BnB1E9nM.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 CoordinationBinding, type CoordinationEvent, type CoordinationLog, type CoordinationMcpHandle, type CopyOptions, type Corpus, type CorpusFilter, type CorpusReadbackOptions, type CorpusRecord, type CreateAgentEnvironmentInput, type CreateSandboxOptions, type CreateScopeAnalystOptions, type CreateTangleSandboxExactProcessProviderOptions, type CriuCapableClient, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, type DefaultVerdict, type DefinePersona, type DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, type DeliverableSpec, type DeliveredOutput, type DispatchReport, type DispatchStopReason, type DispatchUnit, type DownMessageEvent, type DriveHarness, type Driver, type DriverAgentOptions, type DumbDriverOptions, EVIDENCE_MAX_CHARS, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EventBus, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, type ExecCtx, type ExecRequest, type ExecResult, type Executor, type ExecutorConfig, type ExecutorContext, type ExecutorFactory, type ExecutorProgress, type ExecutorRegistry, type ExecutorResult, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FinalizeContext, type FinalizerSettled, type FlatWidenGate, type ForkCapableBox, type ForkRequest, type GitWorkspaceOptions, type GroupOf, type Handle, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, type Iteration, type KeyProvider, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LocalMcpMaterialization, type LocalSandboxClientOptions, type LoopCampaignDispatchOptions, type LoopDecisionPayload, type LoopDispatchOptions, type LoopEndedPayload, type LoopIterationDispatchPayload, type LoopIterationEndedPayload, type LoopIterationStartedPayload, type LoopLineageOptions, type LoopOptionsForDispatch, type LoopPlanDescription, type LoopPlanPayload, type LoopResult, type LoopSandboxPlacement, type LoopShape, type LoopStartedPayload, type LoopTeardownFailedPayload, type LoopTokenUsage, type LoopTraceEmitter, type LoopTraceEvent, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type LoopWinner, type MakeWorkerAgent, type MaterializeLocalMcpOptions, type McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, type MountManifestEntry, type MountRecorder, NOTE_MAX_CHARS, type NaiveDriverOptions, type NoProgressForOptions, type NoWinnerError, type NodeId, type NodeSnapshot, type NodeStatus, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, type Outcome, type OutputAdapter, PI_MCP_ADAPTER, PI_MCP_ADAPTER_ENV, PI_MCP_CONFIG_FLAG, PI_RUNTIME, type PairwiseOptions, type PairwiseVerdict, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type PatchDeliverableOptions, type PendingWait, type Persona, type PersonaContext, type PersonaExecutors, type PiExecutorOutput, type PiMcpMount, type PiMcpMountOptions, type PiMcpPreparation, type PiMcpReceipt, type PiSeam, type Pipeline, type PipelineStage, type PlacementInfo, type PlateauOptions, type PriorCoordination, type ProfileKeyOf, type ProfileRichness, type ProfileRichnessThresholds, type ProgressSample, type ProgressTracker, type ProgressTrackerOptions, type ProgressView, type PromotionGateOptions, type PromotionVerdict, type ProviderAsSandboxClientOptions, type ProviderExecutorOptions, type ProviderSeam, type PublishOptions, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type RepairStop, type ReproductionCheck, type ReservationRejection, type ReservationTicket, type ResolveSandboxClientOptions, type ResolvedMcpServerLaunch, type ResolvedSupervisorProfile, type ResourceRequest, type Restart, type ResultBlobStore, type ResumedKeyState, type ResumedWork, type RollingDispatchOptions, type RootHandle, type RootSignal, type RouterChatResult, type RouterChatToolsResult, type RouterConfig, type RouterSeam, type RouterToolCall, type RouterToolLoopResult, type RouterToolsSeam, type RunAgentRoundsOptions, type RunAgenticOptions, type RunContext, type RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type RunProvenance, type Runtime, type SandboxCapabilities, type SandboxClient, type SandboxClientProviderOptions, type SandboxControlClient, type SandboxEvent, type SandboxInstance, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxSeam, type SandboxSteeringOptions, type SandboxToolPartState, type Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeArgs, type ScopeProgressInput, type ScopeWidenGate, type ScoreOf, type SelectionReceipt, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, type Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, type SpawnEvent, type SpawnJournal, type SpawnOpts, type SpawnPrior, type SpawnRejection, type Spend, type StdioMcpConnection, type StdioMcpServerSpec, type SteerContext, type SteerableSandboxArgs, type SteerableSandboxSession, type SteeringDecision, type StopDecision, type StopRule, type Strategy, type StrategyArtifacts, type StrategyCtx, type StrategyEvolutionConfig, type StrategyMessage, type StrategyResult, type StrategyShotResult, type StreamAgentTurnOptions, type StructuralRolloutConfig, type StructuralRolloutMessage, type StructuralRolloutPolicy, type StructuralRolloutResult, type SuperviseOptions, type SuperviseRegistry, type SuperviseRegistryTable, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, type SupervisedResult, type Supervisor, type SupervisorAgentDeps, type SupervisorFinalizer, type SupervisorOpts, type SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, type ToolLoopChat, type ToolLoopCompaction, type ToolLoopCompactionOptions, type ToolLoopMessageRecord, type ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, type TreeView, type TurnResult, type UntrackedCopyStats, type UsageEvent, VERIFY_TAIL_CHARS, type ValidationCtx, type Validator, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type VisibleCheck, type WaitOpts, type WaitOutcome, type WaitProbe, type WaitProbeRegistry, type WaitRejection, type WaitSpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenGate, type WidenLineage, type WidenSpec, type WinnerStrategy, type WorkerEvidenceInput, type WorkerProgress, type WorkerSteerRequest, type Workspace, type WorkspaceCommit, type WorkspaceRequest, type WorkspaceRun, type WorktreeCheckRunner, type WorktreeCliExecutorOptions, type WorktreeCommandResult, type WorktreeFanoutOptions, type WorktreeHarnessResult, type WorktreePatchArtifact, type WorktreeProfileMaterializationReceipt, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
package/dist/kernel.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
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 InMemoryCorpus, At as renderLeaderboardMarkdown, B as SandboxRunAbortError, Bt as envKeyProvider, C as safeWorkerFile, Ct as completionAuthorizes, D as workerInboxFileFromEventDir, Dt as leaderboard, E as workerInboxFile, Et as stopSentinel, F as runStrategyEvolution, Ft as McpSpawnFault, G as equalKOnCost, H as printBenchmarkReport, Ht as resolveMcpServerLaunch, I as selectChampion, It as connectStdioMcp, J as runPersonified, K as trajectoryReport, L as assertStrategyContract, Lt as materializeLocalMcp, M as streamAgentTurn, Mt as renderPairwiseMarkdown, N as discriminatingMeans, Nt as auditIntent, O as writeWorkerSteer, Ot as pairwiseSignificance, P as pickChampion, Pt as defaultAuditorInstruction, Q as FileCorpus, R as authorStrategy, Rt as createMcpEnvironment, S as readWorkerSteerRequests, St as loopDispatch, T as supervisorRunsRoot, Tt as sentinelCompletion, U as runBenchmark, Ut as resolveSecretEnv, V as openSandboxRun, Vt as mcpSecretEnvMetadataKey, W as promotionGate, Wt as secretEnvOfMcpServer, X as createShapeRegistry, Y as builtinShapes, Z as registerShape, _ as settledWorkerOut, _t as naiveDriver, a as localShell, at as pipeline, b as analyzeTrace, bt as inlineSandboxClient, c as createVerifierEnvironment, ct as widen, d as worktreeFanout, dt as createScopeAnalyst, et as renderCorpusToInstructions, f as EVIDENCE_MAX_CHARS, ft as registryScopeAnalyst, g as composeWorkerEvidence, gt as dumbDriver, h as closingWorkerNote, ht as defineLeaderboard, i as jjWorkspace, it as panel, j as collectAgentTurn, jt as renderLeaderboardSvg, k as patchDelivered, kt as renderLeaderboardHtml, l as failuresAnalyst, lt as assertTraceDerivedFindings, m as VERIFY_TAIL_CHARS, mt as harvestCorpus, n as makeFinding, nt as flatWidenGate, o as runInWorkspace, ot as selectValidWinner, p as NOTE_MAX_CHARS, pt as inProcessSandboxClient, q as definePersona, r as gitWorkspace, rt as loopUntil, s as createWaterfallCollector, st as verify, t as computeFindingId, tt as fanout, u as superviseSurface, ut as buildSteerContext, v as copyUntrackedIntoClone, vt as resolveSandboxClient, w as supervisorRunDir, wt as deterministicCompletion, x as legacySupervisorRunDir, xt as loopCampaignDispatch, y as withUntrackedArtifacts, yt as localSandboxClient, z as strategyAuthorContract, zt as sanitizeMcpToolSchema } from "./runtime-
|
|
1
|
+
import { a as contentAddress, c as replaySpawnTree, i as InMemorySpawnJournal, n as FileSpawnJournal, o as materializeTreeView, r as InMemoryResultBlobStore, s as pendingWaits, t as FileResultBlobStore } from "./spawn-journal-DCPbicXB.js";
|
|
2
|
+
import { C as routerChatWithUsage, S as routerChatWithTools, T as streamRouterChatWithTools, _ as waitUntil, a as runFinalizer, b as readWorkerProgress, c as spendFromUsageEvents, d as settledToIteration, f as createWaitProbes, g as validateWaitSpec, h as timerAt, i as pickBestDelivered, m as pollFor, n as bestDelivered, o as runTree, p as isWaitOutcome, r as collectDelivered, s as createBudgetPool, t as createSupervisor, u as createScope, v as DEFAULT_STALL_AFTER_MS, w as routerToolLoop, x as routerBrain, y as createActivityLog } from "./supervisor-DKqolBGI.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-C7vF83fV.js";
|
|
4
|
+
import { $ as InMemoryCorpus, At as renderLeaderboardMarkdown, B as SandboxRunAbortError, Bt as envKeyProvider, C as safeWorkerFile, Ct as completionAuthorizes, D as workerInboxFileFromEventDir, Dt as leaderboard, E as workerInboxFile, Et as stopSentinel, F as runStrategyEvolution, Ft as McpSpawnFault, G as equalKOnCost, H as printBenchmarkReport, Ht as resolveMcpServerLaunch, I as selectChampion, It as connectStdioMcp, J as runPersonified, K as trajectoryReport, L as assertStrategyContract, Lt as materializeLocalMcp, M as streamAgentTurn, Mt as renderPairwiseMarkdown, N as discriminatingMeans, Nt as auditIntent, O as writeWorkerSteer, Ot as pairwiseSignificance, P as pickChampion, Pt as defaultAuditorInstruction, Q as FileCorpus, R as authorStrategy, Rt as createMcpEnvironment, S as readWorkerSteerRequests, St as loopDispatch, T as supervisorRunsRoot, Tt as sentinelCompletion, U as runBenchmark, Ut as resolveSecretEnv, V as openSandboxRun, Vt as mcpSecretEnvMetadataKey, W as promotionGate, Wt as secretEnvOfMcpServer, X as createShapeRegistry, Y as builtinShapes, Z as registerShape, _ as settledWorkerOut, _t as naiveDriver, a as localShell, at as pipeline, b as analyzeTrace, bt as inlineSandboxClient, c as createVerifierEnvironment, ct as widen, d as worktreeFanout, dt as createScopeAnalyst, et as renderCorpusToInstructions, f as EVIDENCE_MAX_CHARS, ft as registryScopeAnalyst, g as composeWorkerEvidence, gt as dumbDriver, h as closingWorkerNote, ht as defineLeaderboard, i as jjWorkspace, it as panel, j as collectAgentTurn, jt as renderLeaderboardSvg, k as patchDelivered, kt as renderLeaderboardHtml, l as failuresAnalyst, lt as assertTraceDerivedFindings, m as VERIFY_TAIL_CHARS, mt as harvestCorpus, n as makeFinding, nt as flatWidenGate, o as runInWorkspace, ot as selectValidWinner, p as NOTE_MAX_CHARS, pt as inProcessSandboxClient, q as definePersona, r as gitWorkspace, rt as loopUntil, s as createWaterfallCollector, st as verify, t as computeFindingId, tt as fanout, u as superviseSurface, ut as buildSteerContext, v as copyUntrackedIntoClone, vt as resolveSandboxClient, w as supervisorRunDir, wt as deterministicCompletion, x as legacySupervisorRunDir, xt as loopCampaignDispatch, y as withUntrackedArtifacts, yt as localSandboxClient, z as strategyAuthorContract, zt as sanitizeMcpToolSchema } from "./runtime-DQ5seHEu.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 createWorktreeCliExecutor, B as profileRichnessFinding, Ct as defaultToolDetectors, Dt as cliWorktreeExecutor, Et as createInMemoryRunContext, F as delegate, Ft as piSeamKey, Gt as
|
|
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, 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, assertCoordinationBinding, 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, legacySupervisorRunDir, 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, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
|
6
|
+
import { $t as FileCoordinationLog, At as createWorktreeCliExecutor, B as profileRichnessFinding, Bt as PI_MCP_ADAPTER_ENV, Ct as defaultToolDetectors, Dt as cliWorktreeExecutor, Et as createInMemoryRunContext, F as delegate, Ft as piSeamKey, Gt as createInbox, Ht as buildPiMcpServers, I as asAuthoredProfile, It as createPushTraceSource, Jt as runAgentRounds, L as assessAuthoredProfile, Lt as decodeToolPart, Mt as createSteerableSandboxSession, Nt as PI_RUNTIME, Ot as createExecutor, P as defaultDelegateBudget, Pt as piExecutor, Qt as acquireSandbox, R as authoredWorker, Rt as sandboxSessionTraceSource, St as rollingDispatch, Tt as createFileRunContext, Ut as piMcpAdapterAvailable, V as supervisorInstructions, Vt as PI_MCP_CONFIG_FLAG, Wt as preparePiMcp, Xt as createSandboxLineage, Yt as runLoop, Zt as probeSandboxCapabilities, a as supervisorAgent, at as allWorkersStalled, bt as freeSlots, ct as noProgressFor, dt as anytimeReport, en as assertModelAllowed, ft as areaUnderCurve, gt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ht as renderAnytimeTable, i as resolveSupervisorProfile, it as allOf, jt as DEFAULT_SANDBOX_STEERING_MAX_TURNS, kt as createExecutorRegistry, lt as plateau, mt as plateauLength, n as workerFromBackend, nt as driverAgent, o as serveCoordinationMcp, ot as anyOf, pt as bestSoFar, qt as defaultSelectWinner, r as assertCoordinationBinding, rt as finalizeBestDelivered, st as createProgressTracker, t as supervise, tn as gateOnDeliverable, ut as sampleFromSettled, vt as createEventBus, wt as watchTrace, xt as queueOf, yt as effectiveConcurrency, z as defaultProfileRichnessThresholds, zt as PI_MCP_ADAPTER } from "./supervise-tdxMJYem.js";
|
|
7
|
+
import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-CCaEhA-l.js";
|
|
8
|
+
export { DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_STALL_AFTER_MS, EVIDENCE_MAX_CHARS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, NOTE_MAX_CHARS, PI_MCP_ADAPTER, PI_MCP_ADAPTER_ENV, PI_MCP_CONFIG_FLAG, PI_RUNTIME, SandboxRunAbortError, VERIFY_TAIL_CHARS, acquireSandbox, adaptiveRefine, allOf, allWorkersStalled, analyzeTrace, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertCoordinationBinding, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, bestDelivered, bestSoFar, breadthStrategy, buildPiMcpServers, buildSteerContext, builtinShapes, canDisplace, cliWorktreeExecutor, closingWorkerNote, collectAgentTurn, collectDelivered, compareCheckOutcomes, completionAuthorizes, composeCheckSources, composeWorkerEvidence, computeFindingId, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createEventBus, createExecutor, createExecutorRegistry, createFileRunContext, createInMemoryRunContext, createInbox, createMcpEnvironment, createProgressTracker, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSteerableSandboxSession, createSupervisor, createTangleSandboxExactProcessProvider, createVerifierEnvironment, createWaitProbes, createWaterfallCollector, createWorktreeCliExecutor, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, effectiveConcurrency, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, freeSlots, gateOnDeliverable, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, isWaitOutcome, jjWorkspace, leaderboard, legacySupervisorRunDir, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveDriver, noProgressFor, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, patchDelivered, pendingWaits, piExecutor, piMcpAdapterAvailable, piSeamKey, pickBestDelivered, pickChampion, pipeline, plateau, plateauLength, pollFor, preparePiMcp, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, providerAsExecutor, providerAsSandboxClient, queueOf, readWorkerProgress, readWorkerSteerRequests, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveSupervisorProfile, rollingDispatch, routerBrain, routerChatWithTools, routerChatWithUsage, routerToolLoop, runAgentRounds, runAgentic, runBenchmark, runFinalizer, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, runTree, safeWorkerFile, sample, sampleFromSettled, sampleThenRefine, sandboxCheckRunner, sandboxClientAsProvider, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, streamRouterChatWithTools, structuralRollout, sumSandboxUsage, supervise, superviseSurface, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, timerAt, trajectoryReport, validateWaitSpec, verify, visibleCheckScore, waitUntil, watchTrace, widen, withUntrackedArtifacts, workerFromBackend, workerInboxFile, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
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-BHQBb02e.js";
|
|
2
|
+
import { i as sealAgentCandidateBundle, t as captureAgentCandidateWorkspace } from "./workspace-archive-DXzJq7WP.js";
|
|
3
|
+
import { t as createAgentImprovementActivationResult } from "./activation-DlKl7-1o.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-tdxMJYem.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-BTsA9n6L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-GAJFl_gz.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,2B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A,QACyC;CACzC,IAAI,CAAC,WAAW,OAAO,0BAA0B,KAAK;CACtD,OAAO,+BAA+B,WAAW;EAC/C;EACA;EACA;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;AACH;AAEA,SAAS,aAAoE;CAC3E,OAAO;EAAE,YAAY;EAAG,aAAa;EAAG,cAAc;EAAG,UAAU;EAAM,KAAK;EAAG,IAAI;CAAE;AACzF;AAEA,SAAS,SACP,QACA,QACM;CACN,MAAM,QAAQ,OAAO;CACrB,OAAO,cAAc,MAAM;CAC3B,OAAO,eAAe,MAAM,OAAO;CACnC,OAAO,gBAAgB,MAAM,OAAO;CACpC,OAAO,WAAW,OAAO,YAAY,MAAM,aAAa;CACxD,OAAO,OAAO,MAAM;CACpB,OAAO,MAAM,MAAM;AACrB"}
|
|
1
|
+
{"version":3,"file":"knowledge-BTsA9n6L.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":";;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M,OAAO,UAAU;EACxC,MAAM,WAAW,MAAM,OAAO,WAAW;EACzC,OAAO,OAAO,OAAO;GACnB,WAAW;GACX;GACA;GACA,WAAW;EACb,CAAC;CACH,CAAC;AACH;AAEA,eAAe,yBACb,OACA,SACA,aACA,WACA,QACyC;CACzC,IAAI,CAAC,WAAW,OAAO,0BAA0B,KAAK;CACtD,OAAO,+BAA+B,WAAW;EAC/C;EACA;EACA;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;AACH;AAEA,SAAS,aAAoE;CAC3E,OAAO;EAAE,YAAY;EAAG,aAAa;EAAG,cAAc;EAAG,UAAU;EAAM,KAAK;EAAG,IAAI;CAAE;AACzF;AAEA,SAAS,SACP,QACA,QACM;CACN,MAAM,QAAQ,OAAO;CACrB,OAAO,cAAc,MAAM;CAC3B,OAAO,eAAe,MAAM,OAAO;CACnC,OAAO,gBAAgB,MAAM,OAAO;CACpC,OAAO,WAAW,OAAO,YAAY,MAAM,aAAa;CACxD,OAAO,OAAO,MAAM;CACpB,OAAO,MAAM,MAAM;AACrB"}
|
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-YpvLKzIX.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-BTsA9n6L.js";
|
|
2
2
|
export { RESEARCH_SUPERVISOR_SYSTEM_PROMPT, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate };
|
|
@@ -117,6 +117,10 @@ type ToolLoopChat = (messages: ReadonlyArray<ToolLoopMessageRecord>, tools: Read
|
|
|
117
117
|
/** The turn's inference cost (usd) when the provider priced it — for callers that meter usd
|
|
118
118
|
* into a conserved pool (the supervisor brain). `runBrainLoop` itself ignores it. */
|
|
119
119
|
costUsd?: number;
|
|
120
|
+
/** The turn ran but its usage was not reported when the transport EXPECTED one (the streamed
|
|
121
|
+
* router transport asks for usage and this says it never arrived). A metering caller records an
|
|
122
|
+
* unknown turn on it; `runBrainLoop` itself ignores it. */
|
|
123
|
+
usageUnknown?: true;
|
|
120
124
|
}>;
|
|
121
125
|
/** Self-compaction — bound the loop's OWN context window the way a fresh-respawn (dumb-Ralph) loop
|
|
122
126
|
* does, but in place. A stateless chat API re-sends the WHOLE running conversation every turn, so an
|
|
@@ -174,6 +178,31 @@ interface RouterConfig {
|
|
|
174
178
|
* lives here rather than on one call site.
|
|
175
179
|
*/
|
|
176
180
|
maxTokens?: number;
|
|
181
|
+
/**
|
|
182
|
+
* Take the tool-calling completion over SSE instead of one buffered POST. Off by default —
|
|
183
|
+
* `routerChatWithTools` never streams, and every existing caller keeps the buffered transport
|
|
184
|
+
* byte for byte.
|
|
185
|
+
*
|
|
186
|
+
* Why it exists: a buffered POST holds one connection idle for the WHOLE completion, and a
|
|
187
|
+
* supervisor turn is the longest completion in the system. An intermediary gateway with an
|
|
188
|
+
* idle-read timeout kills that connection mid-completion (the 524/503 family). A streamed
|
|
189
|
+
* response puts bytes on the wire from the first generated token on, so the connection is only
|
|
190
|
+
* idle through prefill. It does NOT shorten prefill, so a gateway whose deadline is
|
|
191
|
+
* time-to-FIRST-byte is unaffected; only an idle-timeout gateway is.
|
|
192
|
+
*
|
|
193
|
+
* Mutually exclusive with `complete`: the injected transport returns one parsed JSON body and has
|
|
194
|
+
* no stream to read, so setting both throws rather than silently taking the buffered path.
|
|
195
|
+
*
|
|
196
|
+
* WHICH PATHS CAN OPT IN. This flag is read in exactly one place (the private `chatWithTools` transport switch), so
|
|
197
|
+
* every entry point that takes a caller-supplied `RouterConfig` honors it: `routerBrain`,
|
|
198
|
+
* `routerToolLoop`, and `supervisorAgent` (which spreads `deps.router` into the brain's config —
|
|
199
|
+
* the supervisor turn this exists for). Two production call sites build a `RouterConfig` literal
|
|
200
|
+
* from their own options and therefore CANNOT express it today: the bench strategy's
|
|
201
|
+
* `routerToolLoop` config in `strategy.ts` and the local sandbox client's `routerBrain` config in
|
|
202
|
+
* `local-sandbox-client.ts`. Neither drives a supervisor-length turn; setting `stream` on a
|
|
203
|
+
* config handed to either has no path to reach them, and they stay buffered.
|
|
204
|
+
*/
|
|
205
|
+
stream?: boolean;
|
|
177
206
|
}
|
|
178
207
|
interface RouterChatResult {
|
|
179
208
|
/** The final answer, with any inline `<think>...</think>` block stripped into `reasoning`. */
|
|
@@ -228,6 +257,29 @@ interface RouterChatToolsResult {
|
|
|
228
257
|
output: number;
|
|
229
258
|
};
|
|
230
259
|
costUsd?: number;
|
|
260
|
+
/**
|
|
261
|
+
* Thinking-model reasoning, normalized the way `RouterChatResult.reasoning` is (a separate
|
|
262
|
+
* `reasoning_content`/`reasoning` field, or an inline `<think>` block split out of `content`).
|
|
263
|
+
* Populated by the STREAMED path only — `routerChatWithTools` discards reasoning today and its
|
|
264
|
+
* behavior is preserved unchanged, so a buffered turn still leaves this undefined.
|
|
265
|
+
*/
|
|
266
|
+
reasoning?: string;
|
|
267
|
+
/**
|
|
268
|
+
* The provider's `finish_reason` for the turn (`'stop'`, `'tool_calls'`, `'length'`, …).
|
|
269
|
+
* Populated by the STREAMED path only. `'length'` is the truncation signal the buffered path
|
|
270
|
+
* cannot surface: it says the turn hit `max_tokens`, not that the model chose to stop.
|
|
271
|
+
*/
|
|
272
|
+
finishReason?: string;
|
|
273
|
+
/**
|
|
274
|
+
* The turn happened and its token usage is UNKNOWN — not zero, not free. Set by the STREAMED
|
|
275
|
+
* transport when the stream ran to completion without a single usage-bearing chunk, which means
|
|
276
|
+
* the `stream_options.include_usage` contract was not honored upstream.
|
|
277
|
+
*
|
|
278
|
+
* It exists so a bare `usage: undefined` cannot read as a free turn: a metering caller branches
|
|
279
|
+
* on this marker and records an UNKNOWN turn (see the coordination driver's `meteredBrain`),
|
|
280
|
+
* rather than skipping the turn and letting a conserved budget pool believe it cost nothing.
|
|
281
|
+
*/
|
|
282
|
+
usageUnknown?: true;
|
|
231
283
|
}
|
|
232
284
|
/**
|
|
233
285
|
* A router completion WITH tool-calling — the operator driver's LLM seam. Passes OpenAI-shape
|
|
@@ -248,6 +300,31 @@ declare function routerChatWithTools(cfg: RouterConfig, messages: ReadonlyArray<
|
|
|
248
300
|
toolChoice?: 'auto' | 'required' | 'none';
|
|
249
301
|
maxTokens?: number;
|
|
250
302
|
}): Promise<RouterChatToolsResult>;
|
|
303
|
+
/**
|
|
304
|
+
* The SAME completion as `routerChatWithTools`, taken over SSE (`stream: true`) and reassembled
|
|
305
|
+
* into the identical `RouterChatToolsResult`. Opt in with `RouterConfig.stream` — the buffered
|
|
306
|
+
* function is untouched and stays the default for every existing caller.
|
|
307
|
+
*
|
|
308
|
+
* What it buys: a buffered POST holds one connection idle for the whole completion, and that idle
|
|
309
|
+
* window is what an intermediary gateway kills (524/503). Streaming puts bytes on the wire from the
|
|
310
|
+
* first generated token, so the connection is only idle through prefill.
|
|
311
|
+
*
|
|
312
|
+
* Usage accounting is preserved exactly: `stream_options.include_usage` asks the provider for a
|
|
313
|
+
* terminal usage chunk, and those tokens run through the same `meterTurn` the buffered path uses.
|
|
314
|
+
*
|
|
315
|
+
* When NO chunk reported usage, `usage`/`costUsd` stay undefined (never a fabricated 0) AND
|
|
316
|
+
* `usageUnknown: true` is set. A stream that finishes with no usage chunk means the
|
|
317
|
+
* `include_usage` request was not honored upstream, and returning a quiet `undefined` for it is
|
|
318
|
+
* indistinguishable from a free turn — the marker is what lets a metering caller record an UNKNOWN
|
|
319
|
+
* turn instead. Streaming raises the odds of this (one dropped terminal frame is enough), which is
|
|
320
|
+
* why the streamed transport says so explicitly and the buffered one has no equivalent claim to make.
|
|
321
|
+
*/
|
|
322
|
+
declare function streamRouterChatWithTools(cfg: RouterConfig, messages: ReadonlyArray<Record<string, unknown>>, tools: ReadonlyArray<ToolSpec>, opts?: {
|
|
323
|
+
temperature?: number;
|
|
324
|
+
signal?: AbortSignal;
|
|
325
|
+
toolChoice?: 'auto' | 'required' | 'none';
|
|
326
|
+
maxTokens?: number;
|
|
327
|
+
}): Promise<RouterChatToolsResult>;
|
|
251
328
|
interface ToolSpec {
|
|
252
329
|
type: 'function';
|
|
253
330
|
function: {
|
|
@@ -302,6 +379,9 @@ declare function routerToolLoop(cfg: RouterConfig, system: string, user: string,
|
|
|
302
379
|
* tool-calling. The driver's spawn/observe/steer/await/stop turns become real router tool-calls.
|
|
303
380
|
* The turnkey production brain — tests script a mock `ToolLoopChat`; production passes
|
|
304
381
|
* `routerBrain(cfg)`. No message translation: the loop already speaks the router's OpenAI shape.
|
|
382
|
+
*
|
|
383
|
+
* Transport follows `cfg.stream`: buffered by default, SSE when the caller opts in. A supervisor
|
|
384
|
+
* turn is the longest completion in the system, so it is the call site streaming exists for.
|
|
305
385
|
*/
|
|
306
386
|
declare function routerBrain(cfg: RouterConfig, opts?: {
|
|
307
387
|
temperature?: number;
|
|
@@ -461,5 +541,5 @@ declare function runLocalHarness(options: RunLocalHarnessOptions): Promise<Local
|
|
|
461
541
|
/** Parse and validate the one terminal usage event emitted by `codex exec --json`. */
|
|
462
542
|
declare function parseCodexTokenUsage(stdout: string): CodexTokenUsage;
|
|
463
543
|
//#endregion
|
|
464
|
-
export {
|
|
465
|
-
//# sourceMappingURL=local-harness-
|
|
544
|
+
export { SanitizedKnowledgeRequirement as A, ToolLoopMessageRecord as C, RuntimeStreamEventSummary as D, RuntimeStreamEventSink as E, sanitizeRuntimeStreamEvent as F, createRuntimeStreamEventCollector as M, sanitizeAgentRuntimeEvent as N, RuntimeTelemetryOptions as O, sanitizeKnowledgeReadinessReport as P, ToolLoopCompactionOptions as S, RuntimeStreamEventCollector as T, routerChatWithUsage as _, LocalHarnessResult as a, ToolLoopChat as b, runLocalHarness as c, RouterConfig as d, RouterToolCall as f, routerChatWithTools as g, routerBrain as h, LocalHarness as i, createRuntimeEventCollector as j, SanitizedKnowledgeReadinessReport as k, RouterChatResult as l, ToolSpec as m, CodexExecutionPolicy as n, RunLocalHarnessOptions as o, RouterToolLoopResult as p, CodexTokenUsage as r, parseCodexTokenUsage as s, CodexExecutionEvidence as t, RouterChatToolsResult as u, routerToolLoop as v, RuntimeEventCollector as w, ToolLoopCompaction as x, streamRouterChatWithTools as y };
|
|
545
|
+
//# sourceMappingURL=local-harness-BnB1E9nM.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as RunAnalystLoopOpts, f as RunAnalystLoopResult } from "./types-zWfqDjeL.js";
|
|
2
|
-
import { R as Budget } from "./environment-provider-
|
|
3
|
-
import { Uo as WinnerStrategy, _ as WorktreeFanoutOptions, g as AuthoredHarness, pt as WorktreePatchArtifact } from "./index-
|
|
2
|
+
import { R as Budget } from "./environment-provider-Cygthiy3.js";
|
|
3
|
+
import { Uo as WinnerStrategy, _ as WorktreeFanoutOptions, g as AuthoredHarness, pt as WorktreePatchArtifact } from "./index-D-lNUfea.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-Cg_8UKZR.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ConfigError } from "./errors-DEAvWQPy.js";
|
|
2
|
-
import { J as runPersonified, d as worktreeFanout, q as definePersona } from "./runtime-
|
|
2
|
+
import { J as runPersonified, d as worktreeFanout, q as definePersona } from "./runtime-DQ5seHEu.js";
|
|
3
3
|
import { t as runAnalystLoop } from "./analyst-loop-BoNIG2hA.js";
|
|
4
|
-
import { kt as createExecutorRegistry } from "./supervise-
|
|
4
|
+
import { kt as createExecutorRegistry } from "./supervise-tdxMJYem.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-CuBMmlMJ.js.map
|