import type { Agent } from '../services/agent'; export interface AgentConfig { model: string | ModelInstance; depsType?: new (...args: any[]) => TDeps; outputType?: new (...args: any[]) => TOutput; instructions?: string | ((_ctx: RunContext) => Promise | string); systemPrompt?: string | ((_ctx: RunContext) => Promise | string); tools?: ToolFunction[]; toolsets?: ToolFunction[][]; modelSettings?: ModelSettings; } export interface ModelSettings { temperature?: number; maxTokens?: number; topP?: number; timeout?: number; maxRetries?: number; retryDelay?: number; } export interface ModelInstance { provider: string; model: string; settings?: ModelSettings; } export interface FallbackModel { models: (string | ModelInstance)[]; strategy: 'sequential' | 'random' | 'fastest'; } export interface RunContext { deps: TDeps; sessionId: string; messageHistory: Message[]; modelSettings?: ModelSettings; metadata: Record; } export interface Message { role: 'system' | 'user' | 'assistant' | 'tool'; content: string; toolCalls?: ToolCall[]; toolCallId?: string; timestamp: Date; } export interface ToolCall { id: string; name: string; arguments: Record; } export interface ToolReturn { id: string; content: string; isError?: boolean; } export interface ToolFunction { name: string; description: string; parameters: { type: 'object'; properties: Record; required?: string[]; }; handler: (_ctx: RunContext, args: Record) => Promise | any; requiresContext?: boolean; } export interface RunResult { data: TOutput; success?: boolean; error?: string | Error; usage: { promptTokens: number; completionTokens: number; totalTokens: number; cost: number; }; messageHistory: Message[]; toolCalls: ToolCall[]; modelUsed: string; timestamp: Date; sessionId: string; metadata?: Record; } export interface StreamResponse { stream(): AsyncIterable; streamText(): AsyncIterable; getResult(): Promise>; abort(): void; } export type StreamEvent = TextDeltaEvent | ToolCallEvent | ToolReturnEvent | ModelSwitchEvent | ErrorEvent | CompletionEvent; export interface TextDeltaEvent { type: 'text_delta'; delta: string; timestamp: Date; } export interface ToolCallEvent { type: 'tool_call'; toolCall: ToolCall; timestamp: Date; } export interface ToolReturnEvent { type: 'tool_return'; toolReturn: ToolReturn; timestamp: Date; } export interface ModelSwitchEvent { type: 'model_switch'; fromModel: string; toModel: string; reason: string; timestamp: Date; } export interface ErrorEvent { type: 'error'; error: Error; recoverable: boolean; timestamp: Date; } export interface CompletionEvent { type: 'completion'; result: RunResult; timestamp: Date; } export declare class ModelRetry extends Error { readonly suggestion?: string | undefined; readonly retryCount?: number | undefined; constructor(message: string, suggestion?: string | undefined, retryCount?: number | undefined); } export declare class ValidationError extends Error { readonly field?: string | undefined; readonly value?: any | undefined; constructor(message: string, field?: string | undefined, value?: any | undefined); } export interface AgentRunOptions { deps?: TDeps; messages?: Message[]; modelSettings?: ModelSettings; metadata?: Record; timeout?: number; onEvent?: (event: StreamEvent) => void; } export interface TestModel { type: 'test'; responses: string[]; toolBehavior: 'call_all' | 'call_first' | 'call_none'; } export interface FunctionModel { type: 'function'; handler: (messages: Message[]) => Promise | string; } export type MockModel = TestModel | FunctionModel; export type InferDepsType = T extends Agent ? D : never; export type InferOutputType = T extends Agent ? O : never; export interface ToolDecorator<_TDeps = any> { (target: any, propertyKey: string, descriptor: PropertyDescriptor): void; } export interface ToolPlainDecorator { (target: any, propertyKey: string, descriptor: PropertyDescriptor): void; } export interface ValidationSchema { parse(input: unknown): T; safeParse(input: unknown): { success: true; data: T; } | { success: false; error: Error; }; } export type { AgentInstance, DynamicAgentTemplate, SMEAgentDefinition as AgentDefinition, } from './orchestrator'; export interface AgentAvailability { agentId: string; available: boolean; currentLoad: number; maxCapacity: number; estimatedFreeTime?: Date; capabilities: string[]; } export interface TaskRequirements { skills: string[]; resources: string[]; constraints: Record; priority: 'low' | 'medium' | 'high'; deadline?: Date; tasks: string[]; } //# sourceMappingURL=agent.d.ts.map