/** * Framework integrations for x402-cfo. * * Pre-built adapters for LangChain, CrewAI, MCP, and generic tool-use * patterns. Gives any agent framework financial controls with one import. * * Usage with LangChain: * import { AgentCFO } from 'x402-cfo'; * import { createLangChainTool } from 'x402-cfo/integrations'; * * const agent = new AgentCFO({ wallet, budget: { daily: 50 } }); * const tools = [createLangChainTool(agent)]; * // Pass tools to your LangChain agent */ import type { AgentCFO } from './controller.js'; /** * Generic tool definition compatible with most agent frameworks. * Framework-specific adapters build on top of this. */ export interface AgentTool { name: string; description: string; parameters: Record; execute: (params: Record) => Promise; } /** * Create a set of tools that expose AgentCFO capabilities to any * agent framework. Returns 4 tools: fetch, estimate, budget, and audit. */ export declare function createAgentTools(cfo: AgentCFO): AgentTool[]; /** * LangChain-compatible tool definition. * Follows the LangChain StructuredTool interface pattern. * * Usage: * const tools = createLangChainTools(agent); * const executor = AgentExecutor.fromAgentAndTools({ agent, tools }); */ export interface LangChainToolDef { name: string; description: string; schema: { type: 'object'; properties: Record; required: string[]; }; func: (input: Record) => Promise; } export declare function createLangChainTools(cfo: AgentCFO): LangChainToolDef[]; /** * CrewAI-compatible tool definition. * Follows CrewAI's BaseTool pattern. * * Usage: * const tools = createCrewAITools(agent); * const researcher = new Agent({ tools }); */ export interface CrewAIToolDef { name: string; description: string; args_schema: Record; run: (args: Record) => Promise; } export declare function createCrewAITools(cfo: AgentCFO): CrewAIToolDef[]; /** * MCP-compatible tool definition. * Follows Anthropic's Model Context Protocol for tool use. * * Usage: * const tools = createMCPTools(agent); * // Register with your MCP server */ export interface MCPToolDef { name: string; description: string; input_schema: { type: 'object'; properties: Record; required: string[]; }; handler: (input: Record) => Promise<{ content: Array<{ type: 'text'; text: string; }>; }>; } export declare function createMCPTools(cfo: AgentCFO): MCPToolDef[]; //# sourceMappingURL=integrations.d.ts.map