/** * Haystack Adapter * * Integrates deepset Haystack pipelines and agents with the SwarmOrchestrator. * Haystack is a production-grade framework for building RAG and search * pipelines with customisable components. * * Usage: * const adapter = new HaystackAdapter(); * adapter.registerPipeline("search", myPipeline); * adapter.registerAgent("qa-agent", myHaystackAgent); * await registry.addAdapter(adapter); * * Then in the orchestrator: * delegateTask({ targetAgent: "haystack:search", ... }) * * @module HaystackAdapter * @version 1.0.0 */ import { BaseAdapter } from './base-adapter'; import type { AdapterCapabilities, AgentPayload, AgentContext, AgentResult } from '../types/agent-adapter'; /** Matches Haystack's Pipeline.run() interface */ export interface HaystackPipeline { /** Run the pipeline with inputs */ run(inputs: Record): Promise; /** Get pipeline metadata */ getMetadata?(): { name?: string; components?: string[]; }; } /** Pipeline result */ export interface HaystackPipelineResult { [componentName: string]: Record; } /** Matches Haystack Agent interface */ export interface HaystackAgent { /** Run the agent with a query */ run(query: string, params?: Record): Promise; } /** Agent result */ export interface HaystackAgentResult { answer?: string; transcript?: Array<{ role: string; content: string; }>; documents?: Array<{ content?: string; meta?: Record; score?: number; }>; } /** Haystack component (individual node in a pipeline) */ export interface HaystackComponent { /** Run the component */ run(inputs: Record): Promise>; } export declare class HaystackAdapter extends BaseAdapter { readonly name = "haystack"; readonly version = "1.0.0"; private entries; get capabilities(): AdapterCapabilities; registerPipeline(agentId: string, pipeline: HaystackPipeline, metadata?: { description?: string; capabilities?: string[]; }): void; registerAgent(agentId: string, agent: HaystackAgent, metadata?: { description?: string; capabilities?: string[]; }): void; registerComponent(agentId: string, component: HaystackComponent, metadata?: { description?: string; capabilities?: string[]; }): void; executeAgent(agentId: string, payload: AgentPayload, context: AgentContext): Promise; private executePipeline; private executeHaystackAgent; private executeComponent; private buildPipelineInputs; private normalizePipelineResult; } //# sourceMappingURL=haystack-adapter.d.ts.map