/**
 * Owns control protocol bookkeeping (initialize + hook/permission/mcp routing)
 * shared by ``query()`` and ``createSession()``.
 */
import type { Transport } from '../transport';
import type { AgentDefinition, CanUseTool, ControlInitializeRequest, ControlInitializeResponse, ControlRequest, HookCallbackMatcher, HookEvent } from '../types';
export interface InitializePayloadOptions {
    /** SDK-defined agent definitions (sent via initialize control_request) */
    agents?: Record<string, AgentDefinition>;
    /** Override the default system prompt (string), or append (object) */
    systemPrompt?: string | {
        append: string;
    };
    /** Predefined environment for selfhosted authentication */
    environment?: ControlInitializeRequest['environment'];
    /** Custom endpoint URL for selfhosted environment */
    endpoint?: ControlInitializeRequest['endpoint'];
    /** Whether a prompt is going to follow this initialize (controls history replay) */
    hasPrompt: boolean;
}
export declare class QueryController {
    private readonly transport;
    private readonly canUseToolGetter;
    private readonly abortSignalGetter;
    private hookCallbacks;
    private registeredHooks?;
    constructor(transport: Transport, hooks: Partial<Record<HookEvent, HookCallbackMatcher[]>> | undefined, canUseToolGetter: () => CanUseTool | undefined, abortSignalGetter: () => AbortSignal);
    initialize(opts: InitializePayloadOptions): Promise<ControlInitializeResponse>;
    handleControlRequest(request: ControlRequest): Promise<void>;
    private handlePermissionRequest;
    private handleHookCallback;
    /**
     * Replace the registered hook callbacks. The hook event structure (events,
     * matchers) was sent to CLI during initialize() — this just rewires the
     * callback functions for existing hook IDs.
     */
    setHooks(hooks: Partial<Record<HookEvent, HookCallbackMatcher[]>> | undefined): void;
    private registerHooks;
    private buildHooksConfig;
}
//# sourceMappingURL=query-controller.d.ts.map