import { DEFAULT_MODELS, type LLMProviderName } from './llm-settings.js'; /** A tool call the model asked for, in provider-neutral form. */ export interface ToolCall { /** Provider-assigned id — must be echoed back on the matching result. */ id: string; name: string; input: Record; } /** A single message in a chat conversation */ export interface ChatMessage { role: 'system' | 'user' | 'assistant' | 'tool'; content: string; /** Set on assistant messages that requested tools. */ toolCalls?: ToolCall[]; /** Set on `tool` messages — the id of the call being answered. */ toolCallId?: string; /** Set on `tool` messages when the tool failed, so the model can recover. */ isError?: boolean; } /** A tool the model may call. `inputSchema` is JSON Schema. */ export interface ToolDefinition { name: string; description: string; inputSchema: Record; } /** Why the model stopped generating. */ export type StopReason = 'end_turn' | 'tool_use' | 'max_tokens' | 'refusal' | 'other'; /** Options for an LLM completion request */ export interface CompletionOptions { messages: ChatMessage[]; temperature?: number; maxTokens?: number; /** Tools the model may call this turn. */ tools?: ToolDefinition[]; } /** Result of an LLM completion */ export interface CompletionResult { content: string; /** Tool calls requested by the model, if any. */ toolCalls?: ToolCall[]; stopReason?: StopReason; usage?: { promptTokens: number; completionTokens: number; totalTokens: number; }; } /** LLM provider interface */ export interface LLMProvider { readonly name: string; complete(options: CompletionOptions): Promise; } /** Provider configuration resolved from environment */ export interface LLMConfig { provider: LLMProviderName; apiKey: string; model: string; baseUrl?: string; } /** * Resolve LLM config from the environment, a project `.env`, project settings, * and stored user credentials — see `llm-settings.ts` for the precedence order. * * `projectRoot` is optional so existing callers that only ever used real * environment variables keep working unchanged. */ export declare function resolveLLMConfig(projectRoot?: string): LLMConfig | undefined; /** * Create an LLM provider from config. * Uses native fetch — no SDK dependencies required. */ export declare function createProvider(config: LLMConfig): LLMProvider; export declare function acceptsSamplingParams(model: string): boolean; export { DEFAULT_MODELS }; export type { LLMProviderName }; //# sourceMappingURL=llm-provider.d.ts.map