import type { Message } from 'ollama';
import type { IChatClient } from './chatClient';
import type { Tool, ToolCall, LoopConfig, LoopEvent } from '../types';
import type { HookPipeline } from '../extensibility/hookPipeline';
import type { SessionStorage } from '../persistence/sessionStorage';
import type { LearningRecorder } from '../learning/engine';
import type { RuntimeTracer } from './tracing';
export interface QueryLoopDeps {
    client: IChatClient;
    tools: Tool[];
    permissionCheck?: (call: ToolCall) => Promise<{
        allowed: boolean;
        reason?: string;
    }>;
    hooks?: HookPipeline;
    session?: SessionStorage;
    summarizerClient?: IChatClient;
    tracer?: RuntimeTracer;
    /** Per-session, project-scoped recorder. Passed through to the dispatcher
     * so tool usage is logged under the caller's PROJECT_DIR and sessionId
     * instead of the legacy default recorder bound to `process.cwd()`. */
    learningRecorder?: LearningRecorder;
}
export declare function queryLoop(config: LoopConfig, deps: QueryLoopDeps, initialMessages?: Message[]): AsyncGenerator<LoopEvent>;
/**
 * Detect whether a model's text response is a partial result that asks
 * the user to continue, rather than a genuine final answer.
 * Returns a reason string if partial, or null if it looks complete.
 */
export declare function detectPartialResult(text: string): string | null;
/**
 * Detect tool output that indicates zero results / empty matches.
 * Returns a reason string if empty, null otherwise.
 */
export declare function detectEmptyResult(output: string): string | null;
//# sourceMappingURL=queryLoop.d.ts.map