@tangle-network/agent-runtime 10.0.13 → 10.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,12 +9,12 @@ import { n as createAgentImprovementActivationResult } from "./activation-D36iRa
9
9
  import { t as sealAgentCandidateBundle } from "./bundle-9NLb1WO3.js";
10
10
  import { m as captureAgentCandidateWorkspaceFiles } from "./workspace-streams-C7PGLAUd.js";
11
11
  import { t as assertExecutableAgentProfile } from "./model-policy-DTbTFyOG.js";
12
- import { t as supervise } from "./supervise-aJRMwxRm.js";
13
- import { n as auditLoopRunner } from "./loop-runner-TFs-O4vJ.js";
12
+ import { t as supervise } from "./supervise-CJLO16hM.js";
13
+ import { n as auditLoopRunner } from "./loop-runner-D1JzSiLo.js";
14
14
  import { l as sharedBoxLane, o as routerLane, r as dedicatedLane, t as SearchEnvironmentFault, u as subscriptionLane, y as decideSearchImprovement } from "./search-executor-B0NdgH8a.js";
15
15
  import { Et as ROUTER_PRICE_SOURCE, Tt as priceTokens } from "./supervisor-D88YZZKa.js";
16
16
  import { n as runtimeFailureCause } from "./failure-cause-B2TBXIu-.js";
17
- import { a as isolatedCheckBoxEvidenceSchema, o as isolatedCheckResultSchema } from "./graph-CWtb5mlR.js";
17
+ import { a as isolatedCheckBoxEvidenceSchema, o as isolatedCheckResultSchema } from "./graph-CDegLFf5.js";
18
18
  import { n as defineRuntimeHooks, t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
19
19
  import { toW3CSpanId as padSpanId, toW3CTraceId as padTraceId } from "@tangle-network/agent-trace-contract";
20
20
  import { agentCandidateKnowledgeSchema, agentProfileSchema, canonicalAgentProfileDigest, sha256DigestSchema } from "@tangle-network/agent-interface";
package/dist/kernel.js CHANGED
@@ -10,12 +10,12 @@ import { t as FileResultBlobStore } from "./result-blob-store-nBpCKwFg.js";
10
10
  import { _ as sharedWorkerClientName, f as DEFAULT_SHARED_BOX_RESOURCES, g as sharedBoxRefusal, h as ROUTER_CLIENT_HEADER, m as sharedBoxPlacement, p as DEFAULT_SHARED_BOX_WORKERS } from "./search-executor-B0NdgH8a.js";
11
11
  import { u as FileCoordinationLog } from "./supervise-identity-OkAQ-Ekg.js";
12
12
  import { a as defaultToolDetectors, d as createEventBus, f as createFileRunContext, m as withRunContext, o as watchTrace, p as createInMemoryRunContext } from "./driver-control-acknowledgers-DwvOv6Hy.js";
13
- import { B as allWorkersStalled, F as dumbContinuationPassPrompt, G as areaUnderCurve, H as noProgressFor, I as formatPromptHandle, J as renderAnytimeTable, K as bestSoFar, L as kernelPromptRegistry, M as createPromptRegistry, N as delegatesWorkerBriefPrompt, O as defaultEdgeTraversalCap, P as dumbContinuationFailPrompt, R as naiveContinuationPrompt, S as GraphRouteError, U as plateau, V as anyOf, W as anytimeReport, Y as createSupervisorSpanRecorder, _ as graphFlowSpawnProfile, b as serveCoordinationMcp, d as runToolSpans, f as UNPROVEN_CONTINUITY, i as workerFromBackend, j as analyzesFindingsReportPrompt, n as superviseFleetCapabilities, o as supervisorAgent, p as composeReentryTask, q as plateauLength, t as supervise, z as promptHandle } from "./supervise-aJRMwxRm.js";
13
+ import { B as allWorkersStalled, F as dumbContinuationPassPrompt, G as areaUnderCurve, H as noProgressFor, I as formatPromptHandle, J as renderAnytimeTable, K as bestSoFar, L as kernelPromptRegistry, M as createPromptRegistry, N as delegatesWorkerBriefPrompt, O as defaultEdgeTraversalCap, P as dumbContinuationFailPrompt, R as naiveContinuationPrompt, S as GraphRouteError, U as plateau, V as anyOf, W as anytimeReport, Y as createSupervisorSpanRecorder, _ as graphFlowSpawnProfile, b as serveCoordinationMcp, d as runToolSpans, f as UNPROVEN_CONTINUITY, i as workerFromBackend, j as analyzesFindingsReportPrompt, n as superviseFleetCapabilities, o as supervisorAgent, p as composeReentryTask, q as plateauLength, t as supervise, z as promptHandle } from "./supervise-CJLO16hM.js";
14
14
  import { a as readRunCancelRequest, i as cancelRunAsync, o as readRunCancellation, r as cancelRun } from "./run-cancellation-D2fq7jx6.js";
15
15
  import { A as portableContinuationPolicySchema, S as graphRouteWhenSchema, a as graphRegistry, b as graphFileNeedSchema, c as loadGraph, d as recordGraphRun, f as recordStoredGraphRun, i as graphFromStored, k as validateIsolatedCheckOutputs, l as lookupGraph, m as taskShapeDigest, n as graphCorpusSummary, o as graphRunsFor, p as storedGraphDigests, r as graphDigest, s as listGraphRuns, t as digestOfGraph, u as pickBestGraph, x as graphFileSchema } from "./graph-registry-BmghD_VO.js";
16
16
  import { n as readSpawnJournal, t as readRunState } from "./run-state-D-rOe5N8.js";
17
- import { $ as strategyTournament, $t as completionAuthorizes, A as searchPresets, At as readHarnessTranscriptSessions, B as graphFromSessionFacts, Bt as resolveMcpServerLaunch, C as withUntrackedArtifacts, Ct as createScopeAnalyst, D as SEARCH_SPEC_CORRELATION_KEY, Dt as inProcessSandboxClient, E as createFencedSqlRunContext, Et as observationFromRegistry, F as loadProfile, Ft as materializeLocalMcp, G as readGraphStrings, Gt as loopDispatch, H as graphWorkspace, Ht as secretEnvOfMcpServer, I as pickBestProfile, It as createMcpEnvironment, J as graphDesignerExtraTools, Jt as checkProgramDigest, K as setGraphProfile, Kt as superviseDispatch, L as profileRegistry, Lt as sanitizeMcpToolSchema, M as connectRemoteSupervisor, Mt as resolveSandboxClient, N as connectRemoteSupervisorControl, Nt as McpSpawnFault, O as assertSearchSpec, Ot as HarvestError, P as bestProfileFor, Pt as connectStdioMcp, Q as runStrategyEvolution, Qt as readDeclaredCheck, R as profileRunsForName, Rt as envKeyProvider, S as copyUntrackedIntoClone, St as buildSteerContext, T as validateStoredGraph, Tt as measurePairedCommands, U as loadGraphFile, Ut as inlineSandboxClient, V as GraphFileResolutionError, Vt as resolveSecretEnv, W as readGraphProfile, Wt as loopCampaignDispatch, X as chatWorkerSeam, Xt as declaredCheckDigest, Y as chatTransportExecutor, Yt as declaredCheckDeliverable, Z as createChatSessionStore, Zt as declaredCheckJudge, _ as NOTE_MAX_CHARS, _t as pipeline, a as localShell, an as renderLeaderboardHtml, at as createPrivateCasArtifactPort, b as composeWorkerEvidence, bt as widen, c as createVerifierEnvironment, cn as renderPairwiseMarkdown, ct as definePersona, d as harvestSurfaceDiffs, dt as InMemoryCorpus, en as deterministicCompletion, et as SandboxRunAbortError, f as analystsFromRegistry, ft as renderCorpusToInstructions, g as EVIDENCE_MAX_CHARS, gt as panel, ht as loopUntil, i as jjWorkspace, in as pairwiseSignificance, it as runBenchmark, j as searchSpecDigest, jt as defineLeaderboard, k as compileSearchSpec, kt as harvestCorpus, l as boxSurfaceReader, ln as SqlRunOwnershipError, lt as runPersonified, m as worktreeFanout, mt as flatWidenGate, n as makeFinding, nn as stopSentinel, nt as createS3PrivateCasStore, o as runInWorkspace, on as renderLeaderboardMarkdown, ot as equalKOnCost, p as failuresAnalyst, pt as fanout, q as setGraphStrings, qt as assertDeclaredCheck, r as gitWorkspace, rn as leaderboard, rt as printBenchmarkReport, s as createWaterfallCollector, sn as renderLeaderboardSvg, st as trajectoryReport, t as computeFindingId, tn as sentinelCompletion, tt as openSandboxRun, u as fsSurfaceReader, un as openSqlRunStore, ut as FileCorpus, v as VERIFY_TAIL_CHARS, vt as selectValidWinner, w as analyzeTrace, wt as registryScopeAnalyst, x as settledWorkerOut, xt as assertTraceDerivedFindings, y as closingWorkerNote, yt as verify, z as recordProfileRun, zt as mcpSecretEnvMetadataKey } from "./runtime-4UPWxjjq.js";
18
- import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession, n as runGraph, t as GraphEdgeCapError } from "./graph-CWtb5mlR.js";
17
+ import { $ as strategyTournament, $t as completionAuthorizes, A as searchPresets, At as readHarnessTranscriptSessions, B as graphFromSessionFacts, Bt as resolveMcpServerLaunch, C as withUntrackedArtifacts, Ct as createScopeAnalyst, D as SEARCH_SPEC_CORRELATION_KEY, Dt as inProcessSandboxClient, E as createFencedSqlRunContext, Et as observationFromRegistry, F as loadProfile, Ft as materializeLocalMcp, G as readGraphStrings, Gt as loopDispatch, H as graphWorkspace, Ht as secretEnvOfMcpServer, I as pickBestProfile, It as createMcpEnvironment, J as graphDesignerExtraTools, Jt as checkProgramDigest, K as setGraphProfile, Kt as superviseDispatch, L as profileRegistry, Lt as sanitizeMcpToolSchema, M as connectRemoteSupervisor, Mt as resolveSandboxClient, N as connectRemoteSupervisorControl, Nt as McpSpawnFault, O as assertSearchSpec, Ot as HarvestError, P as bestProfileFor, Pt as connectStdioMcp, Q as runStrategyEvolution, Qt as readDeclaredCheck, R as profileRunsForName, Rt as envKeyProvider, S as copyUntrackedIntoClone, St as buildSteerContext, T as validateStoredGraph, Tt as measurePairedCommands, U as loadGraphFile, Ut as inlineSandboxClient, V as GraphFileResolutionError, Vt as resolveSecretEnv, W as readGraphProfile, Wt as loopCampaignDispatch, X as chatWorkerSeam, Xt as declaredCheckDigest, Y as chatTransportExecutor, Yt as declaredCheckDeliverable, Z as createChatSessionStore, Zt as declaredCheckJudge, _ as NOTE_MAX_CHARS, _t as pipeline, a as localShell, an as renderLeaderboardHtml, at as createPrivateCasArtifactPort, b as composeWorkerEvidence, bt as widen, c as createVerifierEnvironment, cn as renderPairwiseMarkdown, ct as definePersona, d as harvestSurfaceDiffs, dt as InMemoryCorpus, en as deterministicCompletion, et as SandboxRunAbortError, f as analystsFromRegistry, ft as renderCorpusToInstructions, g as EVIDENCE_MAX_CHARS, gt as panel, ht as loopUntil, i as jjWorkspace, in as pairwiseSignificance, it as runBenchmark, j as searchSpecDigest, jt as defineLeaderboard, k as compileSearchSpec, kt as harvestCorpus, l as boxSurfaceReader, ln as SqlRunOwnershipError, lt as runPersonified, m as worktreeFanout, mt as flatWidenGate, n as makeFinding, nn as stopSentinel, nt as createS3PrivateCasStore, o as runInWorkspace, on as renderLeaderboardMarkdown, ot as equalKOnCost, p as failuresAnalyst, pt as fanout, q as setGraphStrings, qt as assertDeclaredCheck, r as gitWorkspace, rn as leaderboard, rt as printBenchmarkReport, s as createWaterfallCollector, sn as renderLeaderboardSvg, st as trajectoryReport, t as computeFindingId, tn as sentinelCompletion, tt as openSandboxRun, u as fsSurfaceReader, un as openSqlRunStore, ut as FileCorpus, v as VERIFY_TAIL_CHARS, vt as selectValidWinner, w as analyzeTrace, wt as registryScopeAnalyst, x as settledWorkerOut, xt as assertTraceDerivedFindings, y as closingWorkerNote, yt as verify, z as recordProfileRun, zt as mcpSecretEnvMetadataKey } from "./runtime-_AK9P7qx.js";
18
+ import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession, n as runGraph, t as GraphEdgeCapError } from "./graph-CDegLFf5.js";
19
19
  import { n as workerFromInteractiveProvider, r as claimRetainedInteractiveControl, t as provisionSupervisor } from "./provision-supervisor-DyrYiZOg.js";
20
- import { a as defaultProfileRichnessThresholds, i as assessAuthoredProfile, n as delegate, o as profileRichnessFinding, r as asAuthoredProfile, s as supervisorInstructions, t as defaultDelegateBudget } from "./delegate-BKD8kvLL.js";
20
+ import { a as defaultProfileRichnessThresholds, i as assessAuthoredProfile, n as delegate, o as profileRichnessFinding, r as asAuthoredProfile, s as supervisorInstructions, t as defaultDelegateBudget } from "./delegate-BCilDCSO.js";
21
21
  export { AUTHORITY_MARKERS, CheckUnavailableError, DEFAULT_MAX_DEPTH, DEFAULT_PEER_MAIL_LIMITS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_SHARED_BOX_RESOURCES, DEFAULT_SHARED_BOX_WORKERS, DEFAULT_STALL_AFTER_MS, EVIDENCE_MAX_CHARS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, GraphEdgeCapError, GraphFileResolutionError, GraphRouteError, HARNESS_TRANSCRIPT_READ_LIMITS, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS, HarvestError, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, NOTE_MAX_CHARS, ObservationError, PEER_MAIL_WIRE_KEY, ROUTER_CLIENT_HEADER, RunCancellationReason, RunParkedError, SEARCH_SPEC_CORRELATION_KEY, SandboxRunAbortError, SqlRunOwnershipError, TERMINAL_DECISIONS, TRACE_ROOT_SCHEMA, TRACE_SUMMARY_SCHEMA, UNPROVEN_CONTINUITY, VERIFY_TAIL_CHARS, acquireSandbox, adaptiveRefine, addHarnessUsage, admitContinuationPolicy, allWorkersStalled, analystsFromRegistry, analyzeTrace, analyzesFindingsReportPrompt, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertDeclaredCheck, assertProfileMaterializes, assertSearchSpec, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, attachWorker, authorStrategy, bestDelivered, bestProfileFor, bestSoFar, boxSurfaceReader, breadthStrategy, buildSteerContext, canDisplace, cancelRun, cancelRunAsync, cancelWorker, canonicalObservedModelParts, captureBoundHarnessTranscript, captureHarnessTranscript, chatTransportExecutor, chatWorkerSeam, checkProgramDigest, claimRetainedInteractiveControl, claimsAuthority, closingWorkerNote, collectAgentTurn, compareCheckOutcomes, compileSearchSpec, completionAuthorizes, composeCheckSources, composeReentryTask, composeWorkerEvidence, computeFindingId, connectRemoteSupervisor, connectRemoteSupervisorControl, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createChatSessionStore, createCodeModeTools, createCodexRolloutStoreReader, createEventBus, createExecutor, createExecutorRegistry, createFencedSqlRunContext, createFileRunContext, createInMemoryRunContext, createInPlaceCliExecutor, createIsolatedCheckCpuSession, createMcpEnvironment, createOtelExporter, createPeerMailbox, createPrivateCasArtifactPort, createPromptRegistry, createPushTraceSource, createRootHandle, createS3PrivateCasStore, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createVerifierEnvironment, createWaterfallCollector, createWorkerSlots, createWorktreeCliExecutor, declaredCheckDeliverable, declaredCheckDigest, declaredCheckJudge, decodeHarnessUsage, defaultAnalystInstruction, defaultDelegateBudget, defaultEdgeTraversalCap, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, delegatesWorkerBriefPrompt, depthStrategy, deterministicCompletion, digestOfGraph, dumbContinuationFailPrompt, dumbContinuationPassPrompt, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, fileEscalateQuestion, filterAuthoredAsserts, flatWidenGate, formatPromptHandle, freeSlots, fsSurfaceReader, gateOnDeliverable, gitWorkspace, graphCorpusSummary, graphDesignerExtraTools, graphDigest, graphFileNeedSchema, graphFileSchema, graphFlowSpawnProfile, graphFromSessionFacts, graphFromStored, graphRegistry, graphRouteWhenSchema, graphRunsFor, graphWorkspace, harnessTranscriptArtifact, harnessUsageIsEmpty, harvestCorpus, harvestSurfaceDiffs, inProcessSandboxClient, inlineSandboxClient, isPeerMailEnvelope, jjWorkspace, kernelPromptRegistry, leaderboard, legacySupervisorRunDir, listGraphRuns, loadGraph, loadGraphFile, loadProfile, loadSpawnForest, localShell, lookupGraph, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapExecutorResult, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, measurePairedCommands, modelAuthoredChecks, naiveContinuationPrompt, noProgressFor, observationFromRegistry, observe, observedModelHasSnapshot, observedModelMatchesDeclared, officialChecksFromMeta, openSandboxRun, openSqlRunStore, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, peerMailTools, peerMailVerbNames, persistHarnessTranscript, pickBestGraph, pickBestProfile, pipeline, plateau, plateauLength, portableContinuationPolicySchema, printBenchmarkReport, profileBridgeWireModel, profileChatClient, profileOptimizerModelCall, profileRegistry, profileRichnessFinding, profileRunsForName, promptHandle, providerAsExecutor, providerAsSandboxClient, provisionSupervisor, queueOf, readBoundHarnessSessions, readCodexRolloutSession, readDeclaredCheck, readGraphProfile, readGraphStrings, readHarnessTranscriptSessions, readRunCancelRequest, readRunCancellation, readRunParking, readRunState, readSpawnJournal, readWorkerCancellation, readWorkerInteractiveBinding, readWorkerProgress, readWorkerSteerAcknowledgement, readWorkerSteerRequests, reconnectRetainedInteractiveRun, reconnectRetainedRun, recordGraphRun, recordProfileRun, recordStoredGraphRun, recoverRetainedInteractiveRun, recoverRetainedRun, refine, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveHarnessTranscriptCapture, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, retainHarnessTranscript, rollingDispatch, runAgentRounds, runAgentic, runBenchmark, runCodeMode, runGraph, runInWorkspace, runIsolatedCheck, runPersonified, runStrategyEvolution, runTaskQueue, runToolSpans, safeWorkerFile, sample, sampleThenRefine, sandboxCheckRunner, sanitizeMcpToolSchema, searchPresets, searchSpecDigest, secretEnvOfMcpServer, selectBestIndex, selectValidWinner, sentinelCompletion, serveCoordinationMcp, setGraphProfile, setGraphStrings, settledToIteration, settledWorkerOut, sharedBoxPlacement, sharedBoxRefusal, sharedWorkerClientName, spendFromUsageEvents, startRetainedInteractiveRun, startRetainedRun, startRetainedRunInEnvironment, stopSentinel, storedGraphDigests, strategyAuthorContract, strategyAuthorSystemPrompt, strategyTournament, streamAgentTurn, structuralRollout, subscriptionUsageLimitSignal, sumSandboxUsage, supervise, superviseDispatch, superviseFleetCapabilities, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, taskShapeDigest, trajectoryReport, validateIsolatedCheckOutputs, validateStoredGraph, verdictFromJudgeScore, verify, visibleCheckScore, watchTrace, widen, withRunContext, withUntrackedArtifacts, workerFromBackend, workerFromInteractiveProvider, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer, writeWorkerSteerAsync };
@@ -1,6 +1,6 @@
1
1
  import { t as runAnalystLoop } from "./analyst-loop-BZvXCDKy.js";
2
2
  import { i as ConfigError } from "./errors-DG8yufqX.js";
3
- import "./runtime-4UPWxjjq.js";
3
+ import "./runtime-_AK9P7qx.js";
4
4
  // src/loop-runner.ts
5
5
  /** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */
6
6
  const DELEGATED_LOOP_MODES = [
@@ -55,4 +55,4 @@ function auditLoopRunner(options) {
55
55
  }
56
56
  export { runDelegatedLoop as i, auditLoopRunner as n, isDelegatedLoopMode as r, DELEGATED_LOOP_MODES as t };
57
57
 
58
- //# sourceMappingURL=loop-runner-TFs-O4vJ.js.map
58
+ //# sourceMappingURL=loop-runner-D1JzSiLo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loop-runner-TFs-O4vJ.js","names":[],"sources":["../src/loop-runner.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a `DelegatedLoopResult`. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\ninterface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\ninterface WorktreeLoopRunnerOptions {\n /** Exact profile carried by the personified root that owns this fanout. */\n rootProfile: AgentProfile\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: options.rootProfile, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\ninterface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\ninterface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n"],"mappings":";;;;;AAyCA,MAAa,uBAAuB;CAAC;CAAQ;CAAU;CAAY;CAAS;AAAc;;AAM1F,SAAgB,oBAAoB,OAA4C;CAC9E,OAAO,OAAO,UAAU,YAAa,qBAA2C,SAAS,KAAK;AAChG;;;;;;;;;;AAoCA,eAAsB,iBACpB,MACA,UACA,UAAmC,CAAC,GACH;CACjC,MAAM,SAAS,SAAS;CACxB,IAAI,CAAC,QACH,MAAM,IAAI,YACR,oDAAoD,KAAK,iBACvD,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,KAAK,OACrC,EACH;CAEF,MAAM,MAAM,QAAQ,OAAO,KAAK;CAChC,MAAM,SAAS,QAAQ,UAAU,IAAI,gBAAgB,CAAC,CAAC;CACvD,MAAM,QAAQ,IAAI;CAClB,IAAI;EAEF,OAAO;GAAE;GAAM,IAAI;GAAM,QAAA,MADJ,OAAO,MAAM;GACD,YAAY,IAAI,IAAI;EAAM;CAC7D,SAAS,KAAK;EACZ,OAAO;GACL;GACA,IAAI;GACJ,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;GACtD,YAAY,IAAI,IAAI;EACtB;CACF;AACF;;;;;;AAoKA,SAAgB,gBACd,SAC6D;CAC7D,OAAO,YAAY,eAAiC,OAAO;AAC7D"}
1
+ {"version":3,"file":"loop-runner-D1JzSiLo.js","names":[],"sources":["../src/loop-runner.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a `DelegatedLoopResult`. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\ninterface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\ninterface WorktreeLoopRunnerOptions {\n /** Exact profile carried by the personified root that owns this fanout. */\n rootProfile: AgentProfile\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: options.rootProfile, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\ninterface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\ninterface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n"],"mappings":";;;;;AAyCA,MAAa,uBAAuB;CAAC;CAAQ;CAAU;CAAY;CAAS;AAAc;;AAM1F,SAAgB,oBAAoB,OAA4C;CAC9E,OAAO,OAAO,UAAU,YAAa,qBAA2C,SAAS,KAAK;AAChG;;;;;;;;;;AAoCA,eAAsB,iBACpB,MACA,UACA,UAAmC,CAAC,GACH;CACjC,MAAM,SAAS,SAAS;CACxB,IAAI,CAAC,QACH,MAAM,IAAI,YACR,oDAAoD,KAAK,iBACvD,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,KAAK,OACrC,EACH;CAEF,MAAM,MAAM,QAAQ,OAAO,KAAK;CAChC,MAAM,SAAS,QAAQ,UAAU,IAAI,gBAAgB,CAAC,CAAC;CACvD,MAAM,QAAQ,IAAI;CAClB,IAAI;EAEF,OAAO;GAAE;GAAM,IAAI;GAAM,QAAA,MADJ,OAAO,MAAM;GACD,YAAY,IAAI,IAAI;EAAM;CAC7D,SAAS,KAAK;EACZ,OAAO;GACL;GACA,IAAI;GACJ,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;GACtD,YAAY,IAAI,IAAI;EACtB;CACF;AACF;;;;;;AAoKA,SAAgB,gBACd,SAC6D;CAC7D,OAAO,YAAY,eAAiC,OAAO;AAC7D"}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as runDelegatedLoop, r as isDelegatedLoopMode, t as DELEGATED_LOOP_MODES } from "./loop-runner-TFs-O4vJ.js";
2
+ import { i as runDelegatedLoop, r as isDelegatedLoopMode, t as DELEGATED_LOOP_MODES } from "./loop-runner-D1JzSiLo.js";
3
3
  // src/loop-runner-bin.ts
4
4
  /**
5
5
  *
package/dist/mcp/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { Fn as FileObserverJournal, Kn as readTraceContextFromEnv, Kt as coordinationProfileToolPrefix } from "../supervisor-accounting-Bnp1WYTX.js";
3
3
  import { i as ConfigError } from "../errors-DG8yufqX.js";
4
- import { s as supervisorInstructions } from "../delegate-BKD8kvLL.js";
5
- import { a as DelegationTaskQueue, n as observerJournalEventSource, o as FileDelegationStore, r as rootStreamEventSource, t as createMcpServer } from "../server-BPYmJQvn.js";
4
+ import { s as supervisorInstructions } from "../delegate-BCilDCSO.js";
5
+ import { a as DelegationTaskQueue, n as observerJournalEventSource, o as FileDelegationStore, r as rootStreamEventSource, t as createMcpServer } from "../server-C4IwVj_Z.js";
6
6
  import { basename, isAbsolute } from "node:path";
7
7
  // src/mcp/delegate-supervisor-provisioning.ts
8
8
  function trimmed(value) {
package/dist/mcp/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as ConfigError, m as ValidationError } from "../errors-DG8yufqX.js";
2
- import { h as runCoderChecks, vt as selectValidWinner } from "../runtime-4UPWxjjq.js";
3
- import { a as DelegationTaskQueue, i as createDelegateHandler, o as FileDelegationStore, s as composeLoopTraceEmitters, t as createMcpServer } from "../server-BPYmJQvn.js";
2
+ import { h as runCoderChecks, vt as selectValidWinner } from "../runtime-_AK9P7qx.js";
3
+ import { a as DelegationTaskQueue, i as createDelegateHandler, o as FileDelegationStore, s as composeLoopTraceEmitters, t as createMcpServer } from "../server-C4IwVj_Z.js";
4
4
  import { t as assertExecutableAgentProfile } from "../model-policy-DTbTFyOG.js";
5
5
  import { Lt as runWorktreeHarness, O as runAgentRounds, Rt as LOCAL_HARNESSES, j as createSandboxForSpec, k as assertBoxlessPromptOptions } from "../supervisor-D88YZZKa.js";
6
6
  import { s as deleteBoxSafe, v as sleep, x as throwIfAborted } from "../util-qsH5cC9S.js";
@@ -3,11 +3,11 @@ import { At as recordValue, P as contentAddress, St as notifySandboxEventObserve
3
3
  import "./run-state-D-rOe5N8.js";
4
4
  import { B as isTraceAnalysisStore, Kt as coordinationProfileToolPrefix, cr as harnessTranscriptArtifact, gn as insideCursorNamespace, hr as readBoundHarnessSessions, ni as executableAgentProfileSnapshot, ot as rollingDispatch, ri as executableAgentSpecSnapshot, tt as settledToIteration } from "./supervisor-accounting-Bnp1WYTX.js";
5
5
  import "./result-blob-store-nBpCKwFg.js";
6
- import { A as validateGraphTopology, D as validateFlowGraph, L as kernelPromptRegistry, a as bridgeProfileRefusal, h as runBrainLoop, t as supervise, x as coordinationControlToolNames } from "./supervise-aJRMwxRm.js";
6
+ import { A as validateGraphTopology, D as validateFlowGraph, L as kernelPromptRegistry, a as bridgeProfileRefusal, h as runBrainLoop, t as supervise, x as coordinationControlToolNames } from "./supervise-CJLO16hM.js";
7
7
  import { T as zeroSpend, a as cloneSpend, c as errorMessage, d as isAbortError, f as isAsyncIterable, h as randomSuffix, i as chargedTokens, l as fnv1a32Hex, n as addSpend, p as mapWithConcurrency, u as hasCompleteCacheBreakdown, v as sleep, y as stringifySafe } from "./util-qsH5cC9S.js";
8
8
  import { a as captureMaterializedWorkspace, b as sha256Bytes$1, m as canonicalCandidateDigest$1, v as immutableCandidateValue } from "./output-artifacts-AqkZ8lO2.js";
9
9
  import { i as ConfigError, m as ValidationError, n as AnalystError, s as PlannerError } from "./errors-DG8yufqX.js";
10
- import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession } from "./graph-CWtb5mlR.js";
10
+ import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession } from "./graph-CDegLFf5.js";
11
11
  import { a as concreteProfileModel, c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, p as canonicalObservedModelParts, t as assertExecutableAgentProfile, y as harnessRunsAgent } from "./model-policy-DTbTFyOG.js";
12
12
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DilFZch5.js";
13
13
  import { o as armDeadlineTimer } from "./deadline-CySmJ_0S.js";
@@ -18,7 +18,7 @@ import { y as markPutStreamVerified } from "./workspace-streams-C7PGLAUd.js";
18
18
  import "./provision-supervisor-DyrYiZOg.js";
19
19
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
20
20
  import { a as reconcileInterruptedSearchCalls, c as searchExecutor, r as dedicatedLane, x as runtimeShipDecision } from "./search-executor-B0NdgH8a.js";
21
- import "./delegate-BKD8kvLL.js";
21
+ import "./delegate-BCilDCSO.js";
22
22
  import "./continuation-Bccak14N.js";
23
23
  import { S as graphRouteWhenSchema, _ as compileGraphParameters, a as graphRegistry, d as recordGraphRun, g as bindGraphParameters, h as assertGraphTriggerBindings, i as graphFromStored, j as assertJsonData, l as lookupGraph, m as taskShapeDigest, o as graphRunsFor, r as graphDigest, t as digestOfGraph, v as graphTriggerBindingsSchema, x as graphFileSchema, y as graphCheckNodeSchema } from "./graph-registry-BmghD_VO.js";
24
24
  import { d as foldCoordinationRecords } from "./supervise-identity-OkAQ-Ekg.js";
@@ -9990,4 +9990,4 @@ function tail(s) {
9990
9990
  }
9991
9991
  export { strategyTournament as $, completionAuthorizes as $t, searchPresets as A, readHarnessTranscriptSessions as At, graphFromSessionFacts as B, resolveMcpServerLaunch as Bt, withUntrackedArtifacts as C, createScopeAnalyst as Ct, SEARCH_SPEC_CORRELATION_KEY as D, inProcessSandboxClient as Dt, createFencedSqlRunContext as E, observationFromRegistry as Et, loadProfile as F, materializeLocalMcp as Ft, readGraphStrings as G, loopDispatch as Gt, graphWorkspace as H, secretEnvOfMcpServer as Ht, pickBestProfile as I, createMcpEnvironment as It, graphDesignerExtraTools as J, checkProgramDigest as Jt, setGraphProfile as K, superviseDispatch as Kt, profileRegistry as L, sanitizeMcpToolSchema as Lt, connectRemoteSupervisor as M, resolveSandboxClient as Mt, connectRemoteSupervisorControl as N, McpSpawnFault as Nt, assertSearchSpec as O, HarvestError as Ot, bestProfileFor as P, connectStdioMcp as Pt, runStrategyEvolution as Q, readDeclaredCheck as Qt, profileRunsForName as R, envKeyProvider as Rt, copyUntrackedIntoClone as S, buildSteerContext as St, validateStoredGraph as T, measurePairedCommands as Tt, loadGraphFile as U, inlineSandboxClient as Ut, GraphFileResolutionError as V, resolveSecretEnv as Vt, readGraphProfile as W, loopCampaignDispatch as Wt, chatWorkerSeam as X, declaredCheckDigest as Xt, chatTransportExecutor as Y, declaredCheckDeliverable as Yt, createChatSessionStore as Z, declaredCheckJudge as Zt, NOTE_MAX_CHARS as _, pipeline as _t, localShell as a, renderLeaderboardHtml as an, createPrivateCasArtifactPort as at, composeWorkerEvidence as b, widen as bt, createVerifierEnvironment as c, renderPairwiseMarkdown as cn, definePersona as ct, harvestSurfaceDiffs as d, InMemoryCorpus as dt, deterministicCompletion as en, SandboxRunAbortError as et, analystsFromRegistry as f, renderCorpusToInstructions as ft, EVIDENCE_MAX_CHARS as g, panel as gt, runCoderChecks as h, loopUntil as ht, jjWorkspace as i, pairwiseSignificance as in, runBenchmark as it, searchSpecDigest as j, defineLeaderboard as jt, compileSearchSpec as k, harvestCorpus as kt, boxSurfaceReader as l, SqlRunOwnershipError as ln, runPersonified as lt, worktreeFanout as m, flatWidenGate as mt, makeFinding$1 as n, stopSentinel as nn, createS3PrivateCasStore as nt, runInWorkspace as o, renderLeaderboardMarkdown as on, equalKOnCost as ot, failuresAnalyst as p, fanout as pt, setGraphStrings as q, assertDeclaredCheck as qt, gitWorkspace as r, leaderboard as rn, printBenchmarkReport as rt, createWaterfallCollector as s, renderLeaderboardSvg as sn, trajectoryReport as st, computeFindingId$1 as t, sentinelCompletion as tn, openSandboxRun as tt, fsSurfaceReader as u, openSqlRunStore as un, FileCorpus as ut, VERIFY_TAIL_CHARS as v, selectValidWinner as vt, analyzeTrace as w, registryScopeAnalyst as wt, settledWorkerOut as x, assertTraceDerivedFindings as xt, closingWorkerNote as y, verify as yt, recordProfileRun as z, mcpSecretEnvMetadataKey as zt };
9992
9992
 
9993
- //# sourceMappingURL=runtime-4UPWxjjq.js.map
9993
+ //# sourceMappingURL=runtime-_AK9P7qx.js.map