import { c as Message, d as CompactionResult, e as AgentConfig, f as Tool, L as LoopEvent, g as ContextConfig, h as PermissionConfig, b as Provider, i as ToolVerifier } from './types-CfFrXG7Q.js'; export { A as APIToolDefinition, j as AssistantMessage, B as BaseProvider, a as ChatMessage, C as ChatRequest, k as ContentBlock, D as DEFAULT_COMPACT_THRESHOLD, l as DEFAULT_CONTEXT_WINDOW, m as DEFAULT_MAX_OUTPUT_TOKENS, n as DEFAULT_MAX_TURNS, o as MAX_CONCURRENT_TOOLS, M as ModelResponse, R as RetryableError, S as StreamEvent, p as TextBlock, q as ThinkingBlock, T as TokenUsage, r as ToolContext, s as ToolExecuteOptions, t as ToolResultMessage, u as ToolUseBlock, U as UserMessage, V as VerificationCheck, v as VerificationContext, w as VerificationResult, x as VerificationRule, y as createStreamAggregator, z as defineTool, E as defineToolFromClass } from './types-CfFrXG7Q.js'; import { MemoryStore } from './memory/index.js'; export { InMemoryStore, SQLiteStore } from './memory/index.js'; import { ToolRegistry } from './tools/index.js'; export { BashTool, FileEditTool, FileReadTool, FileWriteTool, GlobTool, GrepTool, ToolExecutionResult, WebFetchTool, orchestrateTools } from './tools/index.js'; import { D as DualPathVerifier } from './router-w_4lkJaq.js'; export { a as DEFAULT_ROUTING_POLICY, b as DualPathVerdict, F as FastPathResult, R as RoutingPolicy, S as SafetyClass, c as SlowPathResult, T as ToolOperation, V as Verdict, W as WorldModel } from './router-w_4lkJaq.js'; export { FuzzyEditError, fuzzyContains, fuzzyReplace } from './tools/fuzzy-edit.js'; import { b as ProjectProfile } from './adapters-DmzWHUlv.js'; export { A as AnthropicAdapter, B as BENCHMARK_PRESETS, G as GoogleAIAdapter, M as ModelRegistry, O as OpenAICompatAdapter } from './adapters-DmzWHUlv.js'; export { AnthropicProvider, ClusterConfig, ClusterProvider, ClusterSlot, ModelTier, OllamaProvider, OpenAIProvider, RouterStats, TieredRouter, TieredRouterConfig, anthropic, cluster, createProvider, ollama, openai } from './llm/index.js'; export { MCPClient, MCPServerConfig, MCPToolDefinition, loadMCPTools } from './mcp/index.js'; export { I as InitOptions, i as init } from './index-D-K6sx8s.js'; import { EventEmitter } from 'events'; export { B as BenchmarkConfig, a as BenchmarkPreset, b as BenchmarkResult, M as ModelCapability, c as ModelInfo, P as ProviderAdapter, R as RankedModel, S as SelectionCriteria } from './types-CSAIysnE.js'; export { runFastPath, runSlowPath } from './verify/index.js'; import 'zod'; interface AgentHooks { onTurnStart?: (turn: number, messages: Message[]) => Promise; onTurnEnd?: (turn: number, messages: Message[]) => Promise; onToolUse?: (name: string, input: Record) => Promise<{ allow?: boolean; input?: Record; } | void>; onToolResult?: (result: { id: string; name: string; output: string; isError: boolean; durationMs: number; }) => Promise; onError?: (error: Error, turn: number) => Promise<{ retry?: boolean; message?: string; } | void>; onCompact?: (result: CompactionResult) => Promise; } declare class HookRunner { private hooks; constructor(hooks?: AgentHooks); runOnTurnStart(turn: number, messages: Message[]): Promise; runOnTurnEnd(turn: number, messages: Message[]): Promise; runOnToolUse(name: string, input: Record): Promise<{ allow: boolean; input: Record; }>; runOnToolResult(result: { id: string; name: string; output: string; isError: boolean; durationMs: number; }): Promise; runOnError(error: Error, turn: number): Promise<{ retry: boolean; message?: string; }>; runOnCompact(result: CompactionResult): Promise; } interface CostRecord { model: string; inputTokens: number; outputTokens: number; cacheReadTokens: number; cacheWriteTokens: number; inputCost: number; outputCost: number; timestamp: number; turn: number; toolName?: string; } interface ModelPricing { inputCostPer1k: number; outputCostPer1k: number; } declare const DEFAULT_PRICING: Record; declare class CostTracker { private records; private pricing; constructor(customPricing?: Record); record(model: string, usage: { inputTokens: number; outputTokens: number; cacheReadTokens?: number; cacheWriteTokens?: number; }, turn: number, toolName?: string): void; getTotal(): { cost: number; inputTokens: number; outputTokens: number; cacheReadTokens: number; cacheWriteTokens: number; }; getByModel(): Record; getByTool(): Record; getRecords(): CostRecord[]; reset(): void; setPricing(model: string, pricing: ModelPricing): void; } interface AgentConfigV2 extends AgentConfig { hooks?: AgentHooks; memory?: MemoryStore; threadId?: string; costTracker?: CostTracker; title?: string; disableTitle?: boolean; projectDir?: string; } declare class Agent { private model; private tools; private systemPrompt; private maxTurns; private contextManager; private permissionEngine; private permissionConfig?; private verifier?; private dualPathVerifier?; private cwd; private maxRetries; private messages; private hooks?; private memory?; private threadId?; private costTracker; private _loaded; private _title?; private _titleFetched; private _disableTitle; private projectContext?; constructor(config: AgentConfig | AgentConfigV2); addTool(tool: Tool): void; addMessage(message: Message): void; reset(): void; getMessages(): Message[]; getCostTracker(): CostTracker; get title(): string | undefined; private loadMemory; private saveMemory; fork(newThreadId?: string): Agent; run(prompt: string, options?: { abortSignal?: AbortSignal; }): AsyncGenerator; chat(prompt: string, options?: { abortSignal?: AbortSignal; }): Promise<{ text: string; usage: { inputTokens: number; outputTokens: number; }; messages: Message[]; cost: number; }>; structured(prompt: string, schema: { safeParse: (data: unknown) => { success: boolean; data?: T; error?: { issues: Array<{ path: (string | number)[]; message: string; }>; }; }; }, options?: { abortSignal?: AbortSignal; maxRetries?: number; }): Promise; structuredViaTool(prompt: string, schema: { safeParse: (data: unknown) => { success: boolean; data?: T; error?: { issues: Array<{ path: (string | number)[]; message: string; }>; }; }; }, options?: { abortSignal?: AbortSignal; maxRetries?: number; }): Promise; asTool(options?: { allowSubAgents?: boolean; name?: string; description?: string; }): Promise; private generateTitle; } interface ContextCheck { totalTokens: number; availableTokens: number; usagePercent: number; needsCompact: boolean; recommendedMethod: "snip" | "compact"; } declare class ContextManager { readonly maxTokens: number; readonly maxOutputTokens: number; readonly compactThreshold: number; constructor(config?: ContextConfig); check(messages: Message[]): ContextCheck; compact(messages: Message[], summaryFn?: (messages: Message[]) => Promise): Promise; pruneToolOutputs(messages: Message[]): Message[]; getAvailableTokens(messages: Message[]): number; getUsagePercent(messages: Message[]): number; } interface PermissionResult { allowed: boolean; reason?: string; } declare class PermissionEngine { private allowedPatterns; private deniedPatterns; private askPatterns; private defaultAction; constructor(config?: PermissionConfig); check(toolName: string, _input?: Record): PermissionResult; addAllowed(pattern: string): void; addDenied(pattern: string): void; addAsk(pattern: string): void; } interface AgentLoopConfig { model: Provider; tools: ToolRegistry; messages: Message[]; systemPrompt?: string; maxTurns?: number; contextManager: ContextManager; permissionEngine: PermissionEngine; cwd?: string; abortSignal?: AbortSignal; maxRetries?: number; hooks?: AgentHooks; costTracker?: CostTracker; verifier?: ToolVerifier; dualPathVerifier?: DualPathVerifier; } declare function agentLoop(config: AgentLoopConfig): AsyncGenerator; interface TokenCount { total: number; byRole: Record; } declare function estimateTokens(text: string, model?: string): number; declare function estimateMessageTokens(message: Message, model?: string): number; declare function estimateConversationTokens(messages: Message[], model?: string): TokenCount; declare class ProjectContext { private rootDir; private _profile; private analyzer; constructor(rootDir: string); get profile(): ProjectProfile | null; private ensureProfile; getProjectContextString(): string; getTestCommand(): string; getBuildCommand(): string; getLintCommand(): string; getPackageManager(): string; } interface SymbolEntry { name: string; kind: "function" | "class" | "interface" | "type" | "variable" | "constant" | "enum" | "method" | "property"; filePath: string; line: number; exported: boolean; } interface ImportEntry { source: string; symbols: string[]; filePath: string; line: number; } interface FileEntry { path: string; relativePath: string; lastModified: number; size: number; lineCount: number; language: string; symbols: SymbolEntry[]; imports: ImportEntry[]; } interface CodebaseIndex { rootDir: string; files: Map; symbolIndex: Map; importGraph: Map>; indexedAt: number; fileCount: number; totalSymbols: number; } declare class CodebaseIndexer { private index; buildIndex(rootDir: string): CodebaseIndex; lookup(name: string): SymbolEntry[]; getDependencies(filePath: string): string[]; getDependents(filePath: string): string[]; getRelatedFiles(filePath: string): string[]; invalidate(filePath: string): void; save(rootDir: string): void; load(rootDir: string): CodebaseIndex | null; private collectFiles; private parseTsJs; private parsePython; private resolveImport; } interface CircuitBreakerOptions { failureThreshold: number; resetTimeoutMs: number; } declare class CircuitBreaker extends EventEmitter { private state; private failureCount; private lastFailureTime; private options; constructor(options: CircuitBreakerOptions); private isCircuitOpen; private transitionTo; recordSuccess(): void; recordFailure(): void; checkExecutionState(): { allowed: boolean; reason: string; }; execute(fn: () => Promise): Promise; } interface FixLoopConfig { cwd: string; maxIterations: number; buildCommand?: string; testCommand?: string; lintCommand?: string; typecheckCommand?: string; autoDetect: boolean; } interface VerificationResult { success: boolean; stage: "build" | "test" | "lint" | "typecheck"; output: string; errors: ParsedError[]; durationMs: number; } interface ParsedError { filePath: string; line: number; column?: number; message: string; severity: "error" | "warning"; source: "tsc" | "eslint" | "vitest" | "jest" | "cargo" | "go" | "generic"; } interface FixLoopResult { iterations: number; totalDurationMs: number; finalState: "success" | "failed" | "timeout" | "aborted"; history: FixIteration[]; } interface FixIteration { iteration: number; edits: string[]; verification: VerificationResult[]; errorsFound: number; errorsFixed: number; } type FixLoopEvent = { type: "editing"; iteration: number; edits: string[]; } | { type: "verifying"; iteration: number; stage: string; } | { type: "errors_found"; iteration: number; errors: ParsedError[]; } | { type: "iteration_complete"; iteration: number; fixed: number; remaining: number; } | { type: "done"; result: FixLoopResult; }; declare class FixLoop { private config; private commands; constructor(config: FixLoopConfig); run(initialEdits: string[], applyEdit: (description: string) => Promise, verify?: () => Promise): AsyncGenerator; private getCommandList; runVerification(cwd: string, commands: string[]): VerificationResult[]; private detectStage; private detectSource; } export { Agent, AgentConfig, type AgentConfigV2, type AgentHooks, type AgentLoopConfig, CircuitBreaker, type CodebaseIndex, CodebaseIndexer, CompactionResult, type ContextCheck, ContextConfig, ContextManager, type CostRecord, CostTracker, DEFAULT_PRICING, DualPathVerifier, type FileEntry, type FixIteration, FixLoop, type FixLoopConfig, type FixLoopEvent, type ParsedError as FixLoopParsedError, type FixLoopResult, type VerificationResult as FixLoopVerificationResult, HookRunner, type ImportEntry, LoopEvent, MemoryStore, Message, type ModelPricing, PermissionConfig, PermissionEngine, type PermissionResult, ProjectContext, Provider, type SymbolEntry, type TokenCount, Tool, ToolRegistry, ToolVerifier, agentLoop, estimateConversationTokens, estimateMessageTokens, estimateTokens };