@tangle-network/agent-runtime 0.101.1 → 0.102.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +5 -3
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/candidate-execution/index.d.ts +13 -2
- package/dist/candidate-execution/index.js +8 -3
- package/dist/chunk-377GOJHJ.js +578 -0
- package/dist/chunk-377GOJHJ.js.map +1 -0
- package/dist/{chunk-DI677IPX.js → chunk-3DW5DEKQ.js} +3 -3
- package/dist/{chunk-KVJQV342.js → chunk-6MR4IJRW.js} +25 -1777
- package/dist/chunk-6MR4IJRW.js.map +1 -0
- package/dist/{chunk-RJPQLUDA.js → chunk-7FJJUC73.js} +336 -43
- package/dist/chunk-7FJJUC73.js.map +1 -0
- package/dist/{chunk-TA4RBJLE.js → chunk-CI7WS6S2.js} +5 -5
- package/dist/{chunk-U4PRAATQ.js → chunk-CK76OZPM.js} +3 -3
- package/dist/{chunk-KSBUSEUA.js → chunk-KJ2Q4T7F.js} +2 -2
- package/dist/{chunk-MAONWP4R.js → chunk-KPHTCHQ4.js} +611 -1419
- package/dist/chunk-KPHTCHQ4.js.map +1 -0
- package/dist/{chunk-BXZ7GPL4.js → chunk-KSM6GFHP.js} +2 -2
- package/dist/chunk-L5DST3QC.js +351 -0
- package/dist/chunk-L5DST3QC.js.map +1 -0
- package/dist/{chunk-HGSHPVJ6.js → chunk-LJLG734E.js} +200 -441
- package/dist/chunk-LJLG734E.js.map +1 -0
- package/dist/chunk-ROILMKDL.js +1338 -0
- package/dist/chunk-ROILMKDL.js.map +1 -0
- package/dist/{chunk-N2CEE5Q3.js → chunk-RTB3TC73.js} +3 -3
- package/dist/chunk-SQ3ZJH3Y.js +3082 -0
- package/dist/chunk-SQ3ZJH3Y.js.map +1 -0
- package/dist/chunk-UPWGXKXB.js +254 -0
- package/dist/chunk-UPWGXKXB.js.map +1 -0
- package/dist/{completion-gate-C80jiRfN.d.ts → completion-gate-C6dhVN-N.d.ts} +2 -2
- package/dist/{coordination-BFE3Den7.d.ts → coordination-D9l_YmwW.d.ts} +6 -6
- package/dist/environment-provider.d.ts +2 -2
- package/dist/{improve-g75IE2Cx.d.ts → improve-B40dRu0X.d.ts} +47 -19
- package/dist/index.d.ts +331 -23
- package/dist/index.js +544 -136
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +63 -62
- package/dist/intelligence.js +62 -471
- package/dist/intelligence.js.map +1 -1
- package/dist/knowledge.d.ts +8 -8
- package/dist/knowledge.js +9 -7
- package/dist/{local-harness-ZqCx51u7.d.ts → local-harness-CtK9dSny.d.ts} +14 -2
- package/dist/{loop-runner-bin-Cn1N2rRo.d.ts → loop-runner-bin-PnWslIw4.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +6 -6
- package/dist/loop-runner-bin.js +6 -4
- package/dist/loops.d.ts +231 -460
- package/dist/loops.js +58 -37
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +184 -12
- package/dist/mcp/index.js +31 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-bin.d.ts +1 -0
- package/dist/mcp/memory-bin.js +22 -0
- package/dist/mcp/memory-bin.js.map +1 -0
- package/dist/profiles.d.ts +3 -3
- package/dist/structural-rollout-D7xik9XR.d.ts +446 -0
- package/dist/{substrate-DO2GHNg2.d.ts → substrate-Dyiqmd3o.d.ts} +1 -1
- package/dist/{supervise-BLPI50-w.d.ts → supervise-BQdNAXtK.d.ts} +4 -4
- package/dist/testing.js +255 -211
- package/dist/testing.js.map +1 -1
- package/dist/{types-B3vAW0Oq.d.ts → types-CLat4bT9.d.ts} +1 -1
- package/dist/{types-CmnA2iL3.d.ts → types-D870JlH0.d.ts} +2 -2
- package/dist/{worktree-fanout-DCA3G4bO.d.ts → worktree-fanout-DsIR4d6w.d.ts} +234 -234
- package/package.json +6 -5
- package/dist/chunk-HGSHPVJ6.js.map +0 -1
- package/dist/chunk-IKGCKPDX.js +0 -1115
- package/dist/chunk-IKGCKPDX.js.map +0 -1
- package/dist/chunk-KVJQV342.js.map +0 -1
- package/dist/chunk-MAONWP4R.js.map +0 -1
- package/dist/chunk-RJPQLUDA.js.map +0 -1
- package/dist/{chunk-DI677IPX.js.map → chunk-3DW5DEKQ.js.map} +0 -0
- package/dist/{chunk-TA4RBJLE.js.map → chunk-CI7WS6S2.js.map} +0 -0
- package/dist/{chunk-U4PRAATQ.js.map → chunk-CK76OZPM.js.map} +0 -0
- package/dist/{chunk-KSBUSEUA.js.map → chunk-KJ2Q4T7F.js.map} +0 -0
- package/dist/{chunk-BXZ7GPL4.js.map → chunk-KSM6GFHP.js.map} +0 -0
- package/dist/{chunk-N2CEE5Q3.js.map → chunk-RTB3TC73.js.map} +0 -0
- package/dist/{sanitize-BTSsdBXw.d.ts → sanitize-DEbPNtyI.d.ts} +58 -58
package/dist/index.d.ts
CHANGED
|
@@ -2,42 +2,43 @@ import { AgentEvalError, AnalystFinding, KnowledgeReadinessReport, RunRecord, Co
|
|
|
2
2
|
export { AgentEvalError, AgentEvalErrorCode, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, RunRecord, ValidationError } from '@tangle-network/agent-eval';
|
|
3
3
|
import { c as createOpenAICompatibleBackend } from './backends-BO4Jqoe2.js';
|
|
4
4
|
export { a as createIterableBackend, b as createSandboxPromptBackend } from './backends-BO4Jqoe2.js';
|
|
5
|
-
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource, AgentCandidateModelGrantActivateInput, AgentCandidateModelGrantClient, AgentCandidateModelGrantReservation, AgentCandidateModelGrantReserveInput, AgentCandidateModelGrantSettleInput, AgentCandidateProfileSource, AgentCandidateWorkspaceArchiveLimits, BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CaptureAgentCandidateWorkspaceOptions, CapturedAgentCandidateWorkspace, CreateAgentCandidateWorkspacePortOptions, CreateProtectedAgentCandidateModelPortOptions, DisposePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, FileAgentCandidateExecutionClaimStoreOptions, RecoverExpiredAgentCandidateOptions, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle } from './candidate-execution/index.js';
|
|
5
|
+
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource, AgentCandidateModelGrantActivateInput, AgentCandidateModelGrantClient, AgentCandidateModelGrantReservation, AgentCandidateModelGrantReserveInput, AgentCandidateModelGrantSettleInput, AgentCandidateProfileSource, AgentCandidateWorkspaceArchiveLimits, BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CaptureAgentCandidateWorkspaceOptions, CapturedAgentCandidateWorkspace, CreateAgentCandidateWorkspacePortOptions, CreateProtectedAgentCandidateModelPortOptions, DisposePreparedAgentCandidateOptions, ExactProcessCandidateExecutorOptions, FileAgentCandidateExecutionClaimStore, FileAgentCandidateExecutionClaimStoreOptions, RecoverExpiredAgentCandidateOptions, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle } from './candidate-execution/index.js';
|
|
6
6
|
export { a as AgentCandidateExecutionAttemptRecord, b as AgentCandidateExecutionAttemptRef, c as AgentCandidateExecutionClaim, d as AgentCandidateExecutionClaimResult, A as AgentCandidateExecutionClaimStore, e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, g as AgentCandidateExecutionFinishResult, h as AgentCandidateExecutionLease, i as AgentCandidateExecutionPhase, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionRecoveryEvidence, l as AgentCandidateExecutionStageResult, m as AgentCandidateExecutionTerminalRecord, n as AgentCandidateExecutionTerminalResult, o as AgentCandidatePreparationEvidence, q as AgentCandidateRetryRejection, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, r as applyExactAgentProfileDiff, s as executePreparedAgentCandidate, t as parseExactAgentProfile, u as parseExactAgentProfileDiff, v as prepareAgentCandidateExecution } from './profile-DbfaMTdk.js';
|
|
7
7
|
export { f as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, g as AgentCandidateContainerPort, e as AgentCandidateExecutionPorts, h as AgentCandidateExecutorFinalCapture, i as AgentCandidateExecutorMemoryCapture, A as AgentCandidateExecutorPort, j as AgentCandidateExecutorProfileFile, k as AgentCandidateExecutorRequest, l as AgentCandidateExecutorStopRequest, m as AgentCandidateExecutorTaskOutcomeCapture, n as AgentCandidateExecutorWorkspaceFile, o as AgentCandidateExecutorWorkspaceInput, p as AgentCandidateMemoryPort, q as AgentCandidateMemoryResetResult, r as AgentCandidateModelLimits, s as AgentCandidateModelPort, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, u as AgentCandidateProtectedModelActivation, v as AgentCandidateProtectedModelReservation, w as AgentCandidateProtectedModelSettlement, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, z as AgentCandidateVerificationPorts, B as AgentCandidateWorkspacePort, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, P as PreparedAgentCandidateExecution, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, V as VerifiedAgentCandidate, J as VerifiedAgentCandidateTaskOutcome } from './types-CWqfCO8s.js';
|
|
8
8
|
export { AuthSource, BackendCallPolicy, CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, Conversation, ConversationDriveState, ConversationJournal, ConversationJournalEntry, ConversationParticipant, ConversationPolicy, ConversationResult, ConversationStreamEvent, ConversationTurn, D1DatabaseLike, D1StmtLike, DEFAULT_MAX_DEPTH, DeadlineExceededError, FORWARD_HEADERS, FileConversationJournal, ForwardHeaderName, HaltContext, HaltPredicate, HaltReason, HaltSignal, InMemoryConversationJournal, PersonaConversationResult, PersonaDriver, PropagatedHeaders, RetryBackoff, RetryableErrorPredicate, RunConversationOptions, RunPersonaConfig, RunPersonaConversationOptions, SqlAdapter, SqlConversationJournal, TurnOrder, buildForwardHeaders, computeBackoff, createConversationBackend, d1ToSqlAdapter, defaultIsRetryable, defineConversation, isDepthExceeded, makePerAttemptSignal, readDepth, runConversation, runConversationStream, runPersonaConversation, runPersonaDispatch, sleep, slugifySpeaker, turnId } from './conversation.js';
|
|
9
|
-
import { V as Verifier, C as CandidateGenerator } from './improve-
|
|
10
|
-
export { A as AGENTIC_PROFILE_RESOURCE_ROOT, b as AgenticGeneratorOptions, c as AgenticGeneratorShotDisposition, d as AgenticGeneratorShotExecution, e as AgenticGeneratorShotReceipt, f as ImproveCodeOptions, I as ImproveOptions, a as ImproveResult, g as ImproveSkillsOptions, h as ImproveSurface, i as ImprovementCandidate, j as ImprovementDriverOptions, M as ManagedImprovementDriver, k as VerifyResult, l as agenticGenerator, m as commandVerifier, n as
|
|
11
|
-
import { ProposeContext, SurfaceProposer } from '@tangle-network/agent-eval/campaign';
|
|
9
|
+
import { V as Verifier, C as CandidateGenerator } from './improve-B40dRu0X.js';
|
|
10
|
+
export { A as AGENTIC_PROFILE_RESOURCE_ROOT, b as AgenticGeneratorOptions, c as AgenticGeneratorShotDisposition, d as AgenticGeneratorShotExecution, e as AgenticGeneratorShotReceipt, f as ImproveCodeOptions, I as ImproveOptions, a as ImproveResult, g as ImproveSkillsOptions, h as ImproveSurface, i as ImprovementCandidate, j as ImprovementDriverOptions, M as ManagedImprovementDriver, k as VerifyResult, l as agenticGenerator, m as commandVerifier, n as defaultBuildPrompt, o as improve, p as improvementDriver } from './improve-B40dRu0X.js';
|
|
11
|
+
import { ProposeContext, SurfaceProposer, MutableSurface } from '@tangle-network/agent-eval/campaign';
|
|
12
|
+
import { L as LocalHarness, r as runLocalHarness } from './local-harness-CtK9dSny.js';
|
|
13
|
+
import { T as ToolLoopChat, c as RuntimeTelemetryOptions } from './sanitize-DEbPNtyI.js';
|
|
14
|
+
export { d as RuntimeEventCollector, e as RuntimeStreamEventCollector, S as SanitizedKnowledgeReadinessReport, f as createRuntimeEventCollector, g as createRuntimeStreamEventCollector, s as sanitizeAgentRuntimeEvent, h as sanitizeKnowledgeReadinessReport, i as sanitizeRuntimeStreamEvent } from './sanitize-DEbPNtyI.js';
|
|
12
15
|
import { AgentProfile, AgentProfileDiff } from '@tangle-network/agent-interface';
|
|
13
16
|
export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-interface';
|
|
14
17
|
import { Scenario, SelfImproveOptions } from '@tangle-network/agent-eval/contract';
|
|
15
18
|
import { S as SurfaceImprovementEdit } from './improvement-adapter-HAZz-7vK.js';
|
|
16
19
|
import { I as ImprovementProposalSource } from './types-CmYCMbFT.js';
|
|
20
|
+
import { S as StructuralRolloutPolicy } from './structural-rollout-D7xik9XR.js';
|
|
17
21
|
export { AgentKnowledgeReadinessCheckOptions, CreateKnowledgeImprovementActivationExecutorOptions, KnowledgeImprovementActivationExecutor, KnowledgeImprovementCandidatePair, KnowledgeImprovementExperimentBundles, KnowledgeImprovementJobMeasurement, KnowledgeImprovementJobResult, KnowledgeReadinessCheck, KnowledgeReadinessCheckInput, KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, RunKnowledgeImprovementJobOptions, SupervisedKnowledgeUpdateInput, SupervisedKnowledgeUpdateOptions, SupervisedKnowledgeUpdateResult, SupervisedKnowledgeUpdater, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate } from './knowledge.js';
|
|
18
|
-
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-
|
|
22
|
+
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-PnWslIw4.js';
|
|
19
23
|
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-fnj6SRVg.js';
|
|
20
|
-
export { b0 as EvalRunEvent, b1 as EvalRunGeneration, b2 as EvalRunsExportConfig, b3 as EvalRunsExportResult, b4 as INTELLIGENCE_WIRE_VERSION, b5 as LoopSpanNode, b6 as OtelAttribute, b7 as OtelExportConfig, b8 as OtelExporter, b9 as OtelSpan, ba as RuntimeEventOtelOptions, bb as buildLoopOtelSpans, bc as buildLoopSpanNodes, bd as buildRuntimeEventOtelSpans, be as createOtelExporter, bf as exportEvalRuns, bg as loopEventToOtelSpan } from './coordination-
|
|
24
|
+
export { b0 as EvalRunEvent, b1 as EvalRunGeneration, b2 as EvalRunsExportConfig, b3 as EvalRunsExportResult, b4 as INTELLIGENCE_WIRE_VERSION, b5 as LoopSpanNode, b6 as OtelAttribute, b7 as OtelExportConfig, b8 as OtelExporter, b9 as OtelSpan, ba as RuntimeEventOtelOptions, bb as buildLoopOtelSpans, bc as buildLoopSpanNodes, bd as buildRuntimeEventOtelSpans, be as createOtelExporter, bf as exportEvalRuns, bg as loopEventToOtelSpan } from './coordination-D9l_YmwW.js';
|
|
21
25
|
import { K as KnowledgeReadinessDecision, A as AgentBackendInput, c as AgentExecutionBackend, h as RunAgentTaskOptions, i as AgentTaskRunResult, j as RunAgentTaskStreamOptions, R as RuntimeStreamEvent, k as RuntimeSessionStore, l as RuntimeSession } from './types-BwoZWq-i.js';
|
|
22
26
|
export { m as AgentAdapter, d as AgentBackendContext, n as AgentKnowledgeProvider, e as AgentRuntimeEvent, o as AgentRuntimeEventSink, p as AgentTaskContext, g as AgentTaskSpec, f as AgentTaskStatus, B as BackendErrorDetail, b as OpenAIChatResponseFormat, O as OpenAIChatTool, a as OpenAIChatToolChoice } from './types-BwoZWq-i.js';
|
|
23
|
-
import { R as RuntimeHooks } from './types-
|
|
24
|
-
export {
|
|
25
|
-
import
|
|
26
|
-
export { d as RuntimeEventCollector, e as RuntimeStreamEventCollector, S as SanitizedKnowledgeReadinessReport, f as createRuntimeEventCollector, g as createRuntimeStreamEventCollector, s as sanitizeAgentRuntimeEvent, h as sanitizeKnowledgeReadinessReport, i as sanitizeRuntimeStreamEvent } from './sanitize-BTSsdBXw.js';
|
|
27
|
-
import './local-harness-ZqCx51u7.js';
|
|
27
|
+
import { R as RuntimeHooks } from './types-CLat4bT9.js';
|
|
28
|
+
export { e as RuntimeDecisionEvidenceRef, f as RuntimeDecisionKind, g as RuntimeDecisionPoint, h as RuntimeHookContext, i as RuntimeHookErrorContext, j as RuntimeHookEvent, k as RuntimeHookPhase, l as RuntimeHookTarget, m as RuntimeRunHandle, n as RuntimeRunPersistenceAdapter, o as RuntimeRunRow, p as composeRuntimeHooks, q as defineRuntimeHooks, r as notifyRuntimeDecisionPoint, s as notifyRuntimeHookEvent, t as startRuntimeRun } from './types-CLat4bT9.js';
|
|
29
|
+
import '@tangle-network/agent-interface/environment-provider';
|
|
28
30
|
import 'node:child_process';
|
|
29
|
-
import '
|
|
30
|
-
import './
|
|
31
|
-
import './supervise-BLPI50-w.js';
|
|
32
|
-
import './types-CmnA2iL3.js';
|
|
31
|
+
import './worktree-fanout-DsIR4d6w.js';
|
|
32
|
+
import './types-D870JlH0.js';
|
|
33
33
|
import '@tangle-network/sandbox';
|
|
34
|
-
import './completion-gate-
|
|
34
|
+
import './completion-gate-C6dhVN-N.js';
|
|
35
35
|
import '@tangle-network/agent-profile-materialize';
|
|
36
|
+
import '@tangle-network/agent-knowledge';
|
|
37
|
+
import './activation-Cm-9MMX1.js';
|
|
38
|
+
import './supervise-BQdNAXtK.js';
|
|
36
39
|
import './kb-gate-CwHO0vz6.js';
|
|
37
|
-
import './
|
|
38
|
-
import './substrate-DO2GHNg2.js';
|
|
40
|
+
import './substrate-Dyiqmd3o.js';
|
|
39
41
|
import './environment-provider.js';
|
|
40
|
-
import '@tangle-network/agent-interface/environment-provider';
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* `handleChatTurn` — framework-neutral chat-turn HTTP orchestrator.
|
|
@@ -259,11 +260,188 @@ type FindingsArg = {
|
|
|
259
260
|
report: unknown;
|
|
260
261
|
findings: AnalystFinding[];
|
|
261
262
|
};
|
|
263
|
+
/** Render findings as the ranked-evidence block every build prompt ends with. */
|
|
264
|
+
declare function findingLines(findings: AnalystFinding[]): string[];
|
|
262
265
|
/** Build the starting instruction for a coder agent tasked with implementing a new tool. */
|
|
263
266
|
declare function toolBuildPrompt(args: FindingsArg): string;
|
|
264
267
|
/** Build the starting instruction for a coder agent tasked with implementing a new MCP server. */
|
|
265
268
|
declare function mcpBuildPrompt(args: FindingsArg): string;
|
|
266
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Campaign `spans.jsonl` → OTLP-flat JSONL — the missing converter between
|
|
272
|
+
* what the substrate RECORDS and what its trace analysts READ.
|
|
273
|
+
*
|
|
274
|
+
* agent-eval's `runCampaign` durably records one `spans.jsonl` per cell
|
|
275
|
+
* (`defaultBuildTraceWriter`): flat records
|
|
276
|
+
* `{ name, cellId, startMs, durationMs?, ...attributes }` with no trace/span
|
|
277
|
+
* ids. Its trace consumers (`OtlpFileTraceStore`, the trace-analyst registry,
|
|
278
|
+
* `haloProposer`/`traceAnalystProposer` via `resolveTraces`) read OTLP-flat
|
|
279
|
+
* JSONL (`trace_id`/`span_id`/ISO times/status/attributes — the shape
|
|
280
|
+
* `projectOtlpFlatLine` parses). Nothing shipped converts between the two, so
|
|
281
|
+
* the traces real optimization runs write could never reach the trace-native
|
|
282
|
+
* proposers. This module is that wire adapter:
|
|
283
|
+
*
|
|
284
|
+
* - {@link campaignCellSpansToOtlp} — one cell's `spans.jsonl` content →
|
|
285
|
+
* OTLP lines (a per-cell root AGENT anchor span + one child per record).
|
|
286
|
+
* - {@link convertCampaignDirToOtlp} — walk any campaign run/generation dir
|
|
287
|
+
* for `spans.jsonl` files and concatenate their OTLP lines.
|
|
288
|
+
* - {@link campaignTraceResolver} — the `resolveTraces` implementation for
|
|
289
|
+
* `traceAnalystProposer`/`haloProposer`: proposing generation g reads the
|
|
290
|
+
* traces the loop just recorded (`gen-<g-1>`, or `baseline` for g = 0)
|
|
291
|
+
* under the same `runDir` handed to `improve()`/`selfImprove()`.
|
|
292
|
+
*
|
|
293
|
+
* Trace identity: one trace per CELL, keyed on the cell's on-disk path — the
|
|
294
|
+
* same sanitized `cellId` recurs across the baseline and every candidate
|
|
295
|
+
* campaign, so folding the id alone would merge distinct runs into one trace.
|
|
296
|
+
* Ids are deterministic FNV-1a folds to OTLP's 32/16-hex width, so re-converts
|
|
297
|
+
* are stable and byte-identical.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
interface CampaignOtlpOptions {
|
|
301
|
+
/** OTLP `service.name` on every emitted span. Default `'campaign'`. */
|
|
302
|
+
serviceName?: string;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Convert ONE cell's `spans.jsonl` content to OTLP-flat JSONL lines.
|
|
306
|
+
* `cellKey` is the identity the trace id folds from — pass the cell's on-disk
|
|
307
|
+
* path (unique per campaign); `cellId` is the display/attribute label.
|
|
308
|
+
* Returns `[]` for empty/recordless content (a dispatch that never touched
|
|
309
|
+
* `ctx.trace`/`ctx.cost` writes an empty file — that is data, not an error).
|
|
310
|
+
*/
|
|
311
|
+
declare function campaignCellSpansToOtlp(content: string, cell: {
|
|
312
|
+
cellId: string;
|
|
313
|
+
cellKey?: string;
|
|
314
|
+
}, opts?: CampaignOtlpOptions): string[];
|
|
315
|
+
/**
|
|
316
|
+
* Walk `dir` (a campaign run dir, a generation dir, or a whole `selfImprove`
|
|
317
|
+
* run root) for `spans.jsonl` files and return their concatenated OTLP-flat
|
|
318
|
+
* JSONL — the exact string the `resolveTraces` contract expects. `''` when no
|
|
319
|
+
* spans exist (the proposers fail loud on empty by design).
|
|
320
|
+
*/
|
|
321
|
+
declare function convertCampaignDirToOtlp(dir: string, opts?: CampaignOtlpOptions): string;
|
|
322
|
+
interface CampaignTraceResolverOptions extends CampaignOtlpOptions {
|
|
323
|
+
/** The `selfImprove`/`improve()` run root — the SAME `runDir` the loop
|
|
324
|
+
* records under (`<runDir>/baseline/...`, `<runDir>/gen-<g>/candidate-<i>/...`).
|
|
325
|
+
* Must be a real path; a `mem://` run records nothing to resolve. */
|
|
326
|
+
runDir: string;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Build the `resolveTraces` function `traceAnalystProposer`/`haloProposer`
|
|
330
|
+
* take: proposing generation g reads the traces of the campaigns the loop just
|
|
331
|
+
* scored — `gen-<g-1>` (or `baseline` when g = 0), falling back to every trace
|
|
332
|
+
* under the run root when that directory has none (e.g. a caller pointing at a
|
|
333
|
+
* single campaign dir rather than a loop root).
|
|
334
|
+
*
|
|
335
|
+
* traceAnalystProposer({ ..., resolveTraces: campaignTraceResolver({ runDir }) })
|
|
336
|
+
*/
|
|
337
|
+
declare function campaignTraceResolver(opts: CampaignTraceResolverOptions): (ctx: Pick<ProposeContext, 'generation'>) => string;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* `driverLoopGenerator` — the driver→worker `CandidateGenerator`: the build
|
|
341
|
+
* loop run by the ATOM instead of the canned respawn.
|
|
342
|
+
*
|
|
343
|
+
* `agenticGenerator` steers with three hardcoded conditions picking a canned
|
|
344
|
+
* note (`EMPTY_TREE_NOTE` / `failureNote`) and respawns. This generator swaps
|
|
345
|
+
* that respawn brain for a real driver: an LLM on the canonical tool-loop seam
|
|
346
|
+
* (`runBrainLoop` + `ToolLoopChat` — the exact loop `driverAgent` runs its
|
|
347
|
+
* brain on) that AUTHORS each worker instruction, OBSERVES what the session
|
|
348
|
+
* actually produced (diff, files, verifier output), RATES it, and DECIDES
|
|
349
|
+
* refine / re-scope / decompose — prompted with the senior scientific-method
|
|
350
|
+
* doctrine (`buildDriverSystem`).
|
|
351
|
+
*
|
|
352
|
+
* The worker stays the proven primitive: `runLocalHarness` in the candidate
|
|
353
|
+
* worktree, same as `agenticGenerator` — only the brain between sessions
|
|
354
|
+
* changes. The worktree machinery (`worktreeBuildCandidate`) and verifiers
|
|
355
|
+
* (`commandVerifier` / `mcpServeVerifier`) are reused verbatim.
|
|
356
|
+
*
|
|
357
|
+
* Completion-oracle invariant (the supervisor doctrine, kept): the driver's
|
|
358
|
+
* prose NEVER decides the outcome. After the loop, code re-checks ground
|
|
359
|
+
* truth — tree dirty, raw-trace evidence present, verifier green — and only
|
|
360
|
+
* that decides `applied`. A driver that claims success over a failing verifier
|
|
361
|
+
* produces a discarded candidate, not a shipped one.
|
|
362
|
+
*
|
|
363
|
+
* @experimental
|
|
364
|
+
*/
|
|
365
|
+
|
|
366
|
+
interface DriverLoopGeneratorOptions {
|
|
367
|
+
/** The driver-LLM seam — ONE inference turn over the conversation + tool specs (the canonical
|
|
368
|
+
* `ToolLoopChat`, same seam as `driverAgent`): `routerBrain(cfg)` in production, a scripted
|
|
369
|
+
* mock in tests. */
|
|
370
|
+
brain: ToolLoopChat;
|
|
371
|
+
/** Local coding harness the driver's worker sessions run in the worktree. Default `claude`. */
|
|
372
|
+
harness?: LocalHarness;
|
|
373
|
+
/** Per-worker-session wall-clock timeout (ms). Default = `runLocalHarness` default (5m). */
|
|
374
|
+
timeoutMs?: number;
|
|
375
|
+
/** Build the driver's task briefing (domain framing + method + findings) — the same senior
|
|
376
|
+
* prompt the worker path uses (`toolBuildPrompt` / `mcpBuildPrompt`). The driver reads it and
|
|
377
|
+
* folds what each worker needs into its instruction. Default `defaultBuildPrompt`. */
|
|
378
|
+
buildPrompt?: (args: {
|
|
379
|
+
report: unknown;
|
|
380
|
+
findings: AnalystFinding[];
|
|
381
|
+
}) => string;
|
|
382
|
+
/** Verify the worktree (the intrinsic check). Exposed to the driver as `run_verifier` AND
|
|
383
|
+
* re-run by code as the final keep/discard gate. Omitted ⇒ the final gate is dirty-tree only
|
|
384
|
+
* (legacy `agenticGenerator` behavior sans verifier). */
|
|
385
|
+
verify?: Verifier;
|
|
386
|
+
/** Max driver inference turns. Default `max(8, 2 + maxShots * 3)` — room for one
|
|
387
|
+
* observe/rate/decide cycle per worker session plus orientation. */
|
|
388
|
+
maxTurns?: number;
|
|
389
|
+
/** The research seam (adopt-not-build): when set, the driver gets a
|
|
390
|
+
* `research{query}` tool + the `researchDriverNote` doctrine, so it can
|
|
391
|
+
* discover an EXISTING external MCP instead of building one. Wire a real
|
|
392
|
+
* web/search backend here — none is provisioned by default (the build
|
|
393
|
+
* harness has no live web access yet; flagged). */
|
|
394
|
+
research?: (query: string) => Promise<string>;
|
|
395
|
+
/** Test seam — inject the harness runner (defaults to `runLocalHarness`). */
|
|
396
|
+
runHarness?: typeof runLocalHarness;
|
|
397
|
+
/** Test seam — inject the worktree diff reader (defaults to `git diff` in the worktree). */
|
|
398
|
+
readDiff?: (worktreePath: string) => string;
|
|
399
|
+
/** Test seam — inject the changed-paths reader (defaults to `git status --porcelain`). */
|
|
400
|
+
changedPaths?: (worktreePath: string) => string[];
|
|
401
|
+
}
|
|
402
|
+
/** Driver→worker `CandidateGenerator`: an LLM driver on the canonical tool-loop authors, observes, rates, and steers coding-harness sessions in the worktree until the verifier passes or the session budget is spent. */
|
|
403
|
+
declare function driverLoopGenerator(opts: DriverLoopGeneratorOptions): CandidateGenerator;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Typed-findings accessor — the one place `unknown[]` findings become
|
|
407
|
+
* `AnalystFinding[]`.
|
|
408
|
+
*
|
|
409
|
+
* agent-eval's `ProposeContext.findings` is `TFindings[] = unknown[]` on the
|
|
410
|
+
* wire: the loop threads whatever the previous `analyzeGeneration` producer (or
|
|
411
|
+
* the caller's static seed) returned. Consumers that need the typed envelope
|
|
412
|
+
* (`claim`/`severity`/`recommended_action`) were down-casting with a bare
|
|
413
|
+
* `as AnalystFinding[]` — a lie at runtime whenever the seed was a raw string
|
|
414
|
+
* or an ad-hoc digest, which then rendered `undefined` into build prompts.
|
|
415
|
+
*
|
|
416
|
+
* `toAnalystFindings` replaces that cast: real findings pass through
|
|
417
|
+
* unchanged (structural guard, fail-closed), and non-conforming values are
|
|
418
|
+
* LIFTED into a real `AnalystFinding` envelope via `makeFinding` — the most
|
|
419
|
+
* actionable text becomes the claim, the original value rides in `metadata.raw`
|
|
420
|
+
* — so everything downstream of the accessor handles exactly one shape.
|
|
421
|
+
*/
|
|
422
|
+
|
|
423
|
+
/** Analyst id stamped on findings lifted from untyped seed values. */
|
|
424
|
+
declare const LIFTED_FINDING_ANALYST_ID = "lifted-seed";
|
|
425
|
+
/** Structural guard for the schema-versioned `AnalystFinding` envelope.
|
|
426
|
+
* Strict on the identity fields `makeFinding` always populates — a partial
|
|
427
|
+
* look-alike is lifted (re-enveloped), not trusted. */
|
|
428
|
+
declare function isAnalystFinding(value: unknown): value is AnalystFinding;
|
|
429
|
+
interface ToAnalystFindingsOptions {
|
|
430
|
+
/** `analyst_id` stamped on lifted (non-conforming) values.
|
|
431
|
+
* Default {@link LIFTED_FINDING_ANALYST_ID}. */
|
|
432
|
+
analystId?: string;
|
|
433
|
+
/** `area` stamped on lifted values. Default `'seed'`. */
|
|
434
|
+
area?: string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Normalize a mixed `unknown[]` findings array to `AnalystFinding[]`:
|
|
438
|
+
* conforming findings pass through by reference; strings and finding-ish
|
|
439
|
+
* objects are lifted into envelopes (claim = most actionable text, original
|
|
440
|
+
* value under `metadata.raw`); values with no extractable text are dropped.
|
|
441
|
+
* Never throws — a malformed seed must not kill a proposal round.
|
|
442
|
+
*/
|
|
443
|
+
declare function toAnalystFindings(findings: readonly unknown[], opts?: ToAnalystFindingsOptions): AnalystFinding[];
|
|
444
|
+
|
|
267
445
|
/**
|
|
268
446
|
* `mcpServeVerifier` — the intrinsic verifier for a built MCP server: the
|
|
269
447
|
* boot-and-probe checker named in docs/artifact-lifecycle-frontier.md. A
|
|
@@ -272,13 +450,15 @@ declare function mcpBuildPrompt(args: FindingsArg): string;
|
|
|
272
450
|
* handshake: `initialize` → `notifications/initialized` → `tools/list`, and
|
|
273
451
|
* asserts the server answers with at least `minTools` tools.
|
|
274
452
|
*
|
|
453
|
+
* The spawn + handshake is the SHARED same-host stdio connection
|
|
454
|
+
* (`connectStdioMcp`) — the same code path that later serves the built server
|
|
455
|
+
* LIVE to a scored run (`materializeLocalMcp`), so "verified it serves" and
|
|
456
|
+
* "served while scored" can never drift apart.
|
|
457
|
+
*
|
|
275
458
|
* Outcomes follow the `Verifier` contract: a server that fails to start, exits
|
|
276
459
|
* early, errors the handshake, times out, or exposes no tools is a FAILED
|
|
277
460
|
* candidate (`{ok:false}`, fed back into the next generation shot); a missing
|
|
278
461
|
* start binary or spawn fault THROWS (a setup bug, never a silent fallback).
|
|
279
|
-
*
|
|
280
|
-
* Protocol matches the runtime's own stdio MCP server (src/mcp/server.ts):
|
|
281
|
-
* newline-delimited JSON-RPC 2.0, protocol version 2024-11-05.
|
|
282
462
|
*/
|
|
283
463
|
|
|
284
464
|
interface McpServeSpec {
|
|
@@ -295,6 +475,46 @@ interface McpServeSpec {
|
|
|
295
475
|
/** Build a `Verifier` that boots a generated MCP server over stdio and checks it exposes tools. */
|
|
296
476
|
declare function mcpServeVerifier(spec: McpServeSpec): Verifier;
|
|
297
477
|
|
|
478
|
+
/**
|
|
479
|
+
* The senior scientific-method optimizer doctrine — the ONE substantial prompt
|
|
480
|
+
* core shared by every builder/author surface (tool build, MCP build, codebase
|
|
481
|
+
* improvement, strategy authoring) and by the driver that steers build workers
|
|
482
|
+
* (`driverLoopGenerator`).
|
|
483
|
+
*
|
|
484
|
+
* Seeded from the proven senior prompts rather than invented: GEPA's
|
|
485
|
+
* `REFLECTION_SYSTEM` (localize → diagnose → minimal generalizable fix →
|
|
486
|
+
* preserve what works), the /evolve loop (one hypothesis with a mechanism and a
|
|
487
|
+
* falsifiable prediction; attack the largest measured gap first), /pursue (one
|
|
488
|
+
* coherent change set, no partial scaffolding), and the self-improving-loop /
|
|
489
|
+
* supervisor doctrine (a keep is decided by a real check, never by the author;
|
|
490
|
+
* observe → rate → decide). Generalized from "mutate a prompt string" to
|
|
491
|
+
* "build a code surface a held-out measurement will grade".
|
|
492
|
+
*/
|
|
493
|
+
/**
|
|
494
|
+
* The shared method block every build/author prompt embeds. Domain framing
|
|
495
|
+
* (what a tool/MCP/codebase-edit deliverable looks like) wraps around it; this
|
|
496
|
+
* is the process itself.
|
|
497
|
+
*/
|
|
498
|
+
declare const optimizerMethod: string;
|
|
499
|
+
/**
|
|
500
|
+
* The driver's stance for `driverLoopGenerator` — the build-domain instance of
|
|
501
|
+
* the supervisor doctrine (observe → rate → decide; refine / re-scope /
|
|
502
|
+
* decompose; the check decides delivery, never the driver's prose).
|
|
503
|
+
*/
|
|
504
|
+
declare const buildDriverSystem: string;
|
|
505
|
+
/**
|
|
506
|
+
* The driver's ADOPT-not-build doctrine, appended to `buildDriverSystem` when
|
|
507
|
+
* a `research` tool is wired into the loop (`DriverLoopGeneratorOptions.
|
|
508
|
+
* research`). Kept separate so a driver WITHOUT the tool is never told to
|
|
509
|
+
* call a tool it does not have.
|
|
510
|
+
*/
|
|
511
|
+
declare const researchDriverNote: string;
|
|
512
|
+
/**
|
|
513
|
+
* The senior authoring process for `authorStrategy` — the same method, shaped
|
|
514
|
+
* to the strategy contract (author-blind, conserved budget, one module out).
|
|
515
|
+
*/
|
|
516
|
+
declare const strategyAuthorMethod: string;
|
|
517
|
+
|
|
298
518
|
type ProfileDiffProposerContext<TFindings = unknown> = ProposeContext<TFindings> & {
|
|
299
519
|
profile: AgentProfile;
|
|
300
520
|
};
|
|
@@ -398,6 +618,94 @@ interface ReflectiveGeneratorOptions {
|
|
|
398
618
|
/** Cheap no-sandbox `CandidateGenerator` (the `shots=1` setting): draft surface edits via the improvement adapter and apply them as one coherent candidate. */
|
|
399
619
|
declare function reflectiveGenerator(opts: ReflectiveGeneratorOptions): CandidateGenerator;
|
|
400
620
|
|
|
621
|
+
/**
|
|
622
|
+
* `rolloutPolicyProposer` — the `'rollout-policy'` surface for `improve()`: the
|
|
623
|
+
* inference-time `StructuralRolloutPolicy` dials { k, repairRounds, testgen } as a
|
|
624
|
+
* held-out-gated optimizable surface.
|
|
625
|
+
*
|
|
626
|
+
* Why this seam: agent-eval's loop contract is already generic — `MutableSurface`
|
|
627
|
+
* admits any string, documented as "serialized tool config" — so the policy rides
|
|
628
|
+
* the SAME serialize→propose→gate→parse-back cycle the tools/mcp/hooks surfaces
|
|
629
|
+
* use. No agent-eval changes; the only net-new piece is this proposer.
|
|
630
|
+
*
|
|
631
|
+
* Why deterministic: prompt-wording proposals are a measured zero on this stack,
|
|
632
|
+
* and the policy space is tiny and fully enumerable. The proposer emits bounded
|
|
633
|
+
* single-dial neighbors (k±2 in [1,10], repairRounds±1 in [0,3], testgen±3 in
|
|
634
|
+
* [0,10], ≤4 per generation) and lets the held-out gate do ALL the deciding — an
|
|
635
|
+
* LLM proposer would add cost and nondeterminism with nothing to reason about.
|
|
636
|
+
*
|
|
637
|
+
* Persistence: the policy lives in `profile.extensions['structural-rollout']`
|
|
638
|
+
* (AgentProfile's designed slot for runtime-specific config). A gated winner is
|
|
639
|
+
* written back there by `improve()`, the same profile-field write-back every other
|
|
640
|
+
* config surface gets; `structuralRolloutPolicyFromProfile` is the read side a
|
|
641
|
+
* runtime caller feeds to `structuralRollout({ policy })`.
|
|
642
|
+
*
|
|
643
|
+
* @experimental
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
/** The profile extensions namespace the policy persists under. */
|
|
647
|
+
declare const ROLLOUT_POLICY_EXTENSION = "structural-rollout";
|
|
648
|
+
/** Proposal bounds per dial. These are the SEARCH bounds (what the proposer may
|
|
649
|
+
* explore), chosen so every reachable value is a measured-sane recipe: k=1 is the
|
|
650
|
+
* low-compute preset, testgen=0 disables check authoring, repairRounds caps where
|
|
651
|
+
* the measured increment flattens (+1–3pp beyond round 2). */
|
|
652
|
+
declare const ROLLOUT_POLICY_BOUNDS: {
|
|
653
|
+
readonly k: {
|
|
654
|
+
readonly min: 1;
|
|
655
|
+
readonly max: 10;
|
|
656
|
+
readonly step: 2;
|
|
657
|
+
};
|
|
658
|
+
readonly repairRounds: {
|
|
659
|
+
readonly min: 0;
|
|
660
|
+
readonly max: 3;
|
|
661
|
+
readonly step: 1;
|
|
662
|
+
};
|
|
663
|
+
readonly testgen: {
|
|
664
|
+
readonly min: 0;
|
|
665
|
+
readonly max: 10;
|
|
666
|
+
readonly step: 3;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
/** Parse a serialized policy surface. Defensive by design — the proposer reads
|
|
670
|
+
* `ctx.currentSurface`, which the loop types as `string | CodeSurface`. Returns
|
|
671
|
+
* `undefined` (never throws) for non-strings, malformed JSON, or a shape that
|
|
672
|
+
* violates the policy's own invariants: the no-op signal. Unknown dials are
|
|
673
|
+
* dropped; `diverse`/`temperature` ride through untouched (the proposer never
|
|
674
|
+
* mutates them — `diverse` is a measured paired null). */
|
|
675
|
+
declare function parseRolloutPolicy(surface: MutableSurface): StructuralRolloutPolicy | undefined;
|
|
676
|
+
/** Normalize an untyped policy bag (a parsed surface or a profile extension) into
|
|
677
|
+
* a full `StructuralRolloutPolicy`, defaults merged. Returns `undefined` when any
|
|
678
|
+
* present dial violates the policy invariants (mirrors `resolvePolicy`: integer
|
|
679
|
+
* k ≥ 1, repairRounds ≥ 0, testgen ≥ 0) — a corrupt config must read as "not
|
|
680
|
+
* configured", never as a fabricated recipe. */
|
|
681
|
+
declare function normalizeRolloutPolicy(raw: unknown): StructuralRolloutPolicy | undefined;
|
|
682
|
+
/** Stable serialization — dial order is fixed so identical policies produce
|
|
683
|
+
* identical surfaces (the loop dedupes/hashes candidates by surface content). */
|
|
684
|
+
declare function serializeRolloutPolicy(policy: StructuralRolloutPolicy): string;
|
|
685
|
+
/** Read the persisted policy off the profile. `undefined` when the profile does
|
|
686
|
+
* not opt into structural rollout — the improve() surface no-ops then, because
|
|
687
|
+
* tuning dials nothing consumes would ship dead config. */
|
|
688
|
+
declare function structuralRolloutPolicyFromProfile(profile: AgentProfile): StructuralRolloutPolicy | undefined;
|
|
689
|
+
/** Persist a policy into the profile's extensions namespace. Shallow copy; never
|
|
690
|
+
* mutates the input profile (the applyWinnerToProfile contract). */
|
|
691
|
+
declare function applyRolloutPolicyToProfile(profile: AgentProfile, policy: StructuralRolloutPolicy): AgentProfile;
|
|
692
|
+
/** All bounded single-dial neighbors of `policy`, in a fixed priority order: k
|
|
693
|
+
* first (selection breadth carries 85–92% of the measured effect), then
|
|
694
|
+
* repairRounds, then testgen. Steps clamp to the dial's bounds; clamped-to-no-op
|
|
695
|
+
* and duplicate policies are dropped. */
|
|
696
|
+
declare function enumerateNeighborPolicies(policy: StructuralRolloutPolicy): StructuralRolloutPolicy[];
|
|
697
|
+
/**
|
|
698
|
+
* The deterministic `SurfaceProposer` for the `'rollout-policy'` surface.
|
|
699
|
+
*
|
|
700
|
+
* Each generation: parse the current policy surface, enumerate its bounded
|
|
701
|
+
* single-dial neighbors, and return at most `min(populationSize, 4)` of them,
|
|
702
|
+
* rotating the enumeration window by generation so successive generations explore
|
|
703
|
+
* different neighbors when nothing promoted. Proposes NOTHING when the surface
|
|
704
|
+
* carries no policy (the profile never opted in) — an empty proposal is the
|
|
705
|
+
* loop-native no-op, mirroring `improvementDriver`'s no-findings behavior.
|
|
706
|
+
*/
|
|
707
|
+
declare function rolloutPolicyProposer(): SurfaceProposer;
|
|
708
|
+
|
|
401
709
|
/**
|
|
402
710
|
*
|
|
403
711
|
* Chat-model resolution + catalog validation — the shared primitive every
|
|
@@ -823,4 +1131,4 @@ interface StreamToolLoopOptions<Raw> {
|
|
|
823
1131
|
* `capped` if it stops for any non-completed reason with calls still pending. */
|
|
824
1132
|
declare function streamToolLoop<Raw>(opts: StreamToolLoopOptions<Raw>): AsyncGenerator<StreamToolLoopYield<Raw>, void, unknown>;
|
|
825
1133
|
|
|
826
|
-
export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, AgentTaskRunResult, BackendTransportError, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, type McpServeSpec, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, Verifier, applyRunRecordDefaults, cleanModelId, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, getModels, handleChatTurn, mcpBuildPrompt, mcpServeVerifier, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, streamToolLoop, toolBuildPrompt, validateChatModelId };
|
|
1134
|
+
export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, AgentTaskRunResult, BackendTransportError, type CampaignOtlpOptions, type CampaignTraceResolverOptions, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, type DriverLoopGeneratorOptions, InMemoryRuntimeSessionStore, LIFTED_FINDING_ANALYST_ID, type McpServeSpec, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, ROLLOUT_POLICY_BOUNDS, ROLLOUT_POLICY_EXTENSION, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToAnalystFindingsOptions, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, Verifier, applyRolloutPolicyToProfile, applyRunRecordDefaults, buildDriverSystem, campaignCellSpansToOtlp, campaignTraceResolver, cleanModelId, convertCampaignDirToOtlp, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, driverLoopGenerator, enumerateNeighborPolicies, findingLines, getModels, handleChatTurn, isAnalystFinding, mcpBuildPrompt, mcpServeVerifier, normalizeRolloutPolicy, optimizerMethod, parseRolloutPolicy, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, researchDriverNote, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, rolloutPolicyProposer, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, serializeRolloutPolicy, strategyAuthorMethod, streamToolLoop, structuralRolloutPolicyFromProfile, toAnalystFindings, toolBuildPrompt, validateChatModelId };
|