/** * DefaultPipeline — IPipeline implementation backed by PipelineExecutor + stage handlers. * * This is the standard pipeline used by SmartAgent when no custom pipeline is * configured. It runs one of two stage sequences, selected by * {@link SmartAgentConfig.enrichedToolSearch}: * * **Single-phase (default):** * ```text * classify → summarize → parallel(rag-query tools, rag-query history, rag-query …) → * rerank → skill-select → tool-select → assemble → tool-loop → history-upsert * ``` * * **Enriched (`enrichedToolSearch: true`):** the tools RAG store is queried in * a second phase driven by context from prior retrieval + selected skills: * ```text * classify → summarize → parallel(rag-query history, rag-query …) → * rerank → skill-select → build-tool-query → rag-query tools (enriched) → * tool-select → assemble → tool-loop → history-upsert * ``` * * Built-in RAG stores (`tools`, `history`) are wired from `toolsRag`/`historyRag` deps. * Additional custom stores can be passed via `ragStores` and are queried in parallel * with built-ins. Stores can be added/removed at runtime via `rebuildStages()`. */ import type { CallOptions, ICoordinatorConfig, ILlm, LlmStreamChunk, LlmTool, Message, Result, SubAgentRegistry } from '@mcp-abap-adt/llm-agent'; import type { OrchestratorError } from '../agent.js'; import type { IPipeline, PipelineDeps, PipelineResult } from '../interfaces/pipeline.js'; import { PendingToolResultsRegistry } from '../policy/pending-tool-results-registry.js'; import { ToolAvailabilityRegistry } from '../policy/tool-availability-registry.js'; import type { DagCoordinatorHandlerDeps } from './handlers/dag-coordinator.js'; import type { IStageHandler } from './stage-handler.js'; /** * Resolves the per-session tool-availability / pending-tool-results registries * for a pipeline request. When the SessionGraph injects them via `CallOptions`, * the same instances are reused across requests sharing the sessionId; otherwise * fresh per-request instances are created (preserves embed-as-library behavior). */ export declare function resolveSessionRegistries(src: { toolAvailability?: ToolAvailabilityRegistry; pendingToolResults?: PendingToolResultsRegistry; }): { toolAvailability: ToolAvailabilityRegistry; pendingToolResults: PendingToolResultsRegistry; }; /** * Standard IPipeline implementation that orchestrates the default SmartAgent * request lifecycle via PipelineExecutor and built-in stage handlers. * * Usage: * ```ts * const pipeline = new DefaultPipeline(); * pipeline.initialize(deps); * const result = await pipeline.execute(input, history, options, yieldChunk); * ``` */ /** * Optional construction options for {@link DefaultPipeline}. */ export interface DefaultPipelineOptions { /** * Sub-agent registry to expose as a `sub_agent_call` tool via the default * handler registry. When omitted or empty, no sub-agent handler is wired in. */ subAgents?: SubAgentRegistry; /** * Optional coordinator configuration. When a coordinator (`planning`+`dispatch`, * or a `dagCoordinator`) is configured, a `coordinator-activate` runtime stage * decides per-request (via the activation strategy) whether the `coordinator` * stage runs in place of `tool-loop`. */ coordinator?: ICoordinatorConfig; /** * DAG coordinator deps. When set, registers `DagCoordinatorHandler` under * the `coordinator` stage slot and wires `coordinator-activate`. * Mutually exclusive with `coordinator` — `dagCoordinator` takes precedence. */ dagCoordinator?: DagCoordinatorHandlerDeps; /** * Pre-built stage handler to register under the `coordinator` slot. * Takes precedence over `dagCoordinator` and `coordinator`. * Used by the 18.0 Stepper runtime. */ stepperCoordinator?: IStageHandler; } export declare class DefaultPipeline implements IPipeline { private deps; private executor; private stages; private readonly subAgents?; private readonly coordinator?; private readonly dagCoordinator?; private readonly stepperCoordinator?; constructor(options?: DefaultPipelineOptions); private resolvedTracer; private resolvedClassifier; private resolvedAssembler; private resolvedReranker; private resolvedQueryExpander; private resolvedToolCache; private resolvedOutputValidator; private resolvedSessionManager; private resolvedMetrics; private resolvedRequestLogger; private resolvedLlmCallStrategy; initialize(deps: PipelineDeps): void; execute(input: string | Message[], history: Message[], options: CallOptions | undefined, yieldChunk: (chunk: Result) => void, externalTools?: LlmTool[]): Promise; rebuildStages(): void; /** * Propagate a runtime LLM hot-swap (from `SmartAgent.reconfigure()`) into * the pipeline's own dependency snapshot. `_buildContext()` reads * `this.deps.mainLlm` per request and the tool-loop logs the usage `byModel` * key from `ctx.mainLlm.model`, so without this update the pipeline would * keep logging the INITIAL model after a swap (issue #164). */ reconfigure(update: { mainLlm?: ILlm; helperLlm?: ILlm; classifierLlm?: ILlm; }): void; /** * Build the fixed stage list. RAG parallel block only includes stores * that were provided in deps. */ private _buildStages; /** * Create a PipelineContext from deps + per-request input. * Mirrors the pattern in SmartAgent._runStructuredPipeline(). */ private _buildContext; } //# sourceMappingURL=default-pipeline.d.ts.map