/** * Query management for Claude SDK * * Handles tracking and lifecycle management of active Claude queries. * Supports concurrent query execution with interrupt capabilities. * * QueryRegistry is a singleton that encapsulates the global activeQueries Map. */ import type { Query } from '@anthropic-ai/claude-agent-sdk'; /** * Registry for tracking active Claude queries. * Singleton — use QueryRegistry.getInstance(). */ export declare class QueryRegistry { private static instance; private readonly activeQueries; private constructor(); static getInstance(): QueryRegistry; /** Reset singleton for testing */ static resetInstance(): void; /** Check if there is an active Claude process */ hasActiveProcess(): boolean; /** Check if a specific query is active */ isQueryActive(queryId: string): boolean; /** Get count of active queries */ getActiveQueryCount(): number; /** Register an active query */ registerQuery(queryId: string, queryInstance: Query): void; /** Unregister an active query */ unregisterQuery(queryId: string): void; /** * Interrupt a specific Claude query by ID. * @returns true if the query was interrupted, false if not found */ interruptQuery(queryId: string): boolean; /** * Interrupt all active Claude queries. * Catches EPIPE errors from the SDK writing to a dying child process. * @returns number of queries that were interrupted */ interruptAllQueries(): number; /** * Interrupt the most recently started Claude query. * @returns true if a query was interrupted, false if no query was running */ interruptCurrentProcess(): boolean; } /** Generate a unique query ID */ export declare function generateQueryId(): string; export declare function hasActiveProcess(): boolean; export declare function isQueryActive(queryId: string): boolean; export declare function getActiveQueryCount(): number; export declare function registerQuery(queryId: string, queryInstance: Query): void; export declare function unregisterQuery(queryId: string): void; export declare function interruptQuery(queryId: string): boolean; export declare function interruptAllQueries(): number; export declare function interruptCurrentProcess(): boolean; //# sourceMappingURL=query-manager.d.ts.map