/** * Tool Pipeline * * Lightweight tool composition that lets agents chain MCP tool calls * declaratively. Steps execute sequentially, with data flowing between * them via `$ref` parameter references. * * @example * ```typescript * const result = await executePipeline(hypervisor, ctx, [ * { * label: 'customer', * tool: '@@mcp_stripe_create_customer', * params: { email: 'user@example.com' }, * }, * { * label: 'payment', * tool: '@@mcp_stripe_create_payment_intent', * params: { * customer: { $ref: 'customer.id' }, * amount: 2000, * currency: 'usd', * }, * }, * ]); * ``` */ import type { MCPHypervisor, MCPTenantContext } from './hypervisor.js'; export interface PipelineStep { /** Namespaced tool name (e.g., @@mcp_stripe_create_payment_intent) */ tool: string; /** Parameters - can reference previous step outputs via $ref syntax */ params: Record; /** Optional: only run if condition is met */ when?: (previousResults: Map) => boolean; /** Step label for referencing in later steps */ label?: string; } export interface PipelineStepResult { label: string; tool: string; success: boolean; data?: unknown; error?: string; durationMs: number; } export interface PipelineResult { success: boolean; steps: PipelineStepResult[]; totalDurationMs: number; } /** * Execute a sequence of tool calls with data flowing between steps. * * Parameter references: use `{ "$ref": "step_label.path.to.value" }` * to reference output from a previous step. * * Tools are identified by their namespaced name (`@@mcp_{server}_{tool}`) * and dispatched through the hypervisor's tenant-scoped call path. */ export declare function executePipeline(hypervisor: MCPHypervisor, ctx: MCPTenantContext, steps: PipelineStep[]): Promise; //# sourceMappingURL=pipeline.d.ts.map