/** * Custom Agent Adapter — The simplest way to plug in any agent * * For agent systems that don't have a dedicated adapter, or for * quick prototyping, this adapter lets you register plain async functions * as agents. No framework dependency needed. * * Usage: * const adapter = new CustomAdapter(); * * // Register any async function as an agent * adapter.registerHandler("my-agent", async (payload, context) => { * // Your agent logic here * return { analysis: "result data" }; * }); * * // Register an HTTP-based agent * adapter.registerHttpAgent("remote-agent", "https://api.example.com/agent"); * * await registry.addAdapter(adapter); * * Then in the orchestrator: * delegateTask({ targetAgent: "custom:my-agent", ... }) * * @module CustomAdapter * @version 1.0.0 */ import { BaseAdapter } from './base-adapter'; import type { AdapterCapabilities, AgentPayload, AgentContext, AgentResult } from '../types/agent-adapter'; /** * A simple agent handler function. * Takes the task payload and context, returns any result. */ export type AgentHandler = (payload: AgentPayload, context: AgentContext) => Promise; /** * HTTP agent configuration */ export interface HttpAgentConfig { url: string; method?: 'POST' | 'PUT'; headers?: Record; timeout?: number; /** Transform the payload before sending */ transformRequest?: (payload: AgentPayload, context: AgentContext) => unknown; /** Transform the response before returning */ transformResponse?: (response: unknown) => unknown; } export declare class CustomAdapter extends BaseAdapter { readonly name = "custom"; readonly version = "1.0.0"; private handlers; private httpAgents; get capabilities(): AdapterCapabilities; /** * Register a plain async function as an agent. * This is the simplest way to add custom agent logic. */ registerHandler(agentId: string, handler: AgentHandler, metadata?: { description?: string; capabilities?: string[]; }): void; /** * Register an HTTP endpoint as an agent. * The orchestrator will POST task payloads to the URL. */ registerHttpAgent(agentId: string, urlOrConfig: string | HttpAgentConfig, metadata?: { description?: string; capabilities?: string[]; }): void; executeAgent(agentId: string, payload: AgentPayload, context: AgentContext): Promise; private executeHandler; private executeHttpAgent; } //# sourceMappingURL=custom-adapter.d.ts.map