import { END } from "../types.js"; import type { ChannelSchema, NodeDefinition, Edge, ONICheckpointer } from "../types.js"; import type { BaseStore } from "../store/index.js"; import type { GuardrailsConfig } from "../guardrails/types.js"; import type { EventListeners } from "../events/types.js"; import type { TracerLike } from "../telemetry.js"; import type { ONIModel } from "../models/types.js"; import type { SwarmAgentDef, HandoffRecord, SwarmMessage, RubricConfig, VerificationResult, VulnerabilitySeverity, BranchState, SprintResult } from "./types.js"; import type { AgentRegistry } from "./registry.js"; export interface PregelRunnerInternals> { nodes: Map>; _edgesBySource: Map[]>; } export type BaseSwarmState = { task: string; context: Record; agentResults: Record; messages: Array<{ role: string; content: string; }>; swarmMessages: SwarmMessage[]; supervisorRound: number; currentAgent: string | null; done: boolean; handoffHistory: HandoffRecord[]; [key: string]: unknown; }; export declare const baseSwarmChannels: { task: import("../types.js").Channel; context: import("../types.js").Channel<{}>; agentResults: import("../types.js").Channel<{}>; messages: import("../types.js").Channel<{ role: string; content: string; }[]>; swarmMessages: import("../types.js").Channel; supervisorRound: import("../types.js").Channel; currentAgent: import("../types.js").Channel; done: import("../types.js").Channel; handoffHistory: import("../types.js").Channel; }; export interface HierarchicalConfig { supervisor: { model?: ONIModel; strategy: "llm" | "rule" | "round-robin"; rules?: Array<{ condition: (task: string, context: Record) => boolean; agentId: string; }>; systemPrompt?: string; maxRounds?: number; /** Whole-swarm deadline in ms, computed from invoke-time (not compile-time). */ deadlineMs?: number; /** Auto-recover: when an agent errors, route to an idle agent with matching capability. */ autoRecover?: boolean; }; agents: SwarmAgentDef[]; channels?: Partial>; onError?: "fallback" | "throw"; } export interface FanOutConfig { agents: SwarmAgentDef[]; reducer: (agentResults: Record, weights?: Record) => Partial; channels?: Partial>; /** Max agents to run simultaneously (default: all). */ maxConcurrency?: number; /** Per-agent timeout in ms. Agents that exceed this are marked with _error. */ timeoutMs?: number; /** Per-agent weights passed to the reducer as second argument. */ weights?: Record; } export interface PipelineConfig { stages: SwarmAgentDef[]; transitions?: Record string | typeof END>; channels?: Partial>; } export interface PeerNetworkConfig { agents: SwarmAgentDef[]; entrypoint: string; handoffs: Record string | typeof END>; channels?: Partial>; } export interface MapReduceConfig { mapper: SwarmAgentDef; poolSize?: number; poolStrategy?: "round-robin" | "least-busy" | "random"; inputField: keyof S; reducer: (agentResults: Record) => Partial; channels?: Partial>; } export interface DebateConfig { debaters: SwarmAgentDef[]; judge: { model: ONIModel; systemPrompt?: string; maxRounds: number; consensusKeyword?: string; /** Enable per-round scoring of debaters (scores stored in context.debateScores). */ scoreDebaters?: boolean; /** Auto-consensus when score spread is within this threshold. */ consensusThreshold?: number; }; topic: keyof S; channels?: Partial>; } export interface HierarchicalMeshConfig { coordinator: { model: ONIModel; strategy: "llm" | "rule" | "round-robin"; rules?: Array<{ condition: (task: string, context: Record) => boolean; agentId: string; }>; systemPrompt?: string; maxRounds?: number; }; teams: Record[]; handoffs?: Record string | typeof END>; }>; channels?: Partial>; } export interface SwarmCompileOpts { checkpointer?: ONICheckpointer; interruptBefore?: string[]; interruptAfter?: string[]; store?: BaseStore; guardrails?: GuardrailsConfig; listeners?: EventListeners; defaults?: { nodeTimeout?: number; }; deadLetterQueue?: boolean; tracer?: TracerLike; } export interface SwarmExtensions> { registry: AgentRegistry; agentStats: () => ReturnType["stats"]>; toMermaid: () => string; /** Dynamically spawn a new agent into the compiled swarm */ spawnAgent: (def: SwarmAgentDef) => void; /** Remove an agent from the compiled swarm (marks as terminated) */ removeAgent: (agentId: string) => void; } export interface CritiqueRefineConfig { generator: SwarmAgentDef; critic: SwarmAgentDef; feedback: "freeform" | RubricConfig; maxRounds: number; channels?: Partial>; } export type EnsembleCustomAggregator = (agentResults: Record, state: S) => Partial; export interface EnsembleVoteConfig { agents: SwarmAgentDef[]; mode: "vote" | "synthesize" | EnsembleCustomAggregator; judge?: { model: ONIModel; systemPrompt?: string; }; synthesizer?: SwarmAgentDef; timeoutMs?: number; channels?: Partial>; } export interface SpeculativeExecutionConfig { strategies: SwarmAgentDef[]; validator: (result: unknown, state: S) => boolean | Promise; timeoutMs?: number; perStrategyTimeoutMs?: number; onCancel?: (agentId: string) => void | Promise; channels?: Partial>; } export interface TreeOfThoughtConfig { thinker: SwarmAgentDef; scorer: SwarmAgentDef | ((branch: BranchState, state: S) => number | Promise); branchFactor: number; maxDepth: number; topK: number; pruneThreshold: number; channels?: Partial>; } export interface AutoResearchConfig { decomposer: SwarmAgentDef; researcher: SwarmAgentDef; synthesizer: SwarmAgentDef; maxDepth: number; confidenceThreshold: number; maxConcurrentSearches?: number; channels?: Partial>; } export interface AdversarialDevConfig { planner: SwarmAgentDef; generator: SwarmAgentDef; evaluator: SwarmAgentDef; passThreshold: number; maxSprints: number; maxRetriesPerSprint: number; contractNegotiationRounds?: number; onSprintComplete?: (sprint: SprintResult) => void | Promise; channels?: Partial>; } export interface SocraticElicitConfig { interviewer: SwarmAgentDef; respondent: "interrupt" | SwarmAgentDef; synthesizer?: SwarmAgentDef; coverageDimensions: string[]; completionThreshold: number; maxQuestions: number; outputFormat?: string; channels?: Partial>; } export interface RedTeamConfig { attacker: SwarmAgentDef; builder: SwarmAgentDef; maxRounds: number; severityThreshold?: VulnerabilitySeverity; attackSurface?: string[]; channels?: Partial>; } export interface StepwiseStage { worker: SwarmAgentDef; verifier: SwarmAgentDef | ((result: unknown, state: S) => VerificationResult | Promise); maxRetries: number; retryDelayMs?: number; } export interface StepwiseVerifyConfig { stages: StepwiseStage[]; onStageFailure?: "halt" | "skip"; channels?: Partial>; } //# sourceMappingURL=config.d.ts.map