import type { AgentSession } from '@earendil-works/pi-coding-agent';
export type EmbeddedRunHandle = {
    sessionKey: string;
    sessionId: string;
    runId: string;
    session: AgentSession;
    abort: () => Promise<void>;
};
/**
 * Tracks in-flight embedded agent turns so we can abort/steer them by sessionKey or runId.
 *
 * The previous implementation used two module-level Maps; this class is the supported
 * single-instance state, while {@link defaultEmbeddedRunRegistry} preserves the previous
 * free-function API for callers that have not yet been moved to dependency injection.
 */
export declare class EmbeddedRunRegistry {
    private readonly bySessionKey;
    private readonly byRunId;
    /**
     * Register a new in-flight run. If a run is already registered for the same
     * sessionKey we drop the stale handle (the new run takes ownership). The caller
     * is responsible for aborting the previous run before re-registering if needed —
     * we warn loudly so this does not happen silently.
     */
    register(handle: EmbeddedRunHandle): void;
    unregister(handle: EmbeddedRunHandle): void;
    getBySessionKey(sessionKey: string): EmbeddedRunHandle | undefined;
    getByRunId(runId: string): EmbeddedRunHandle | undefined;
    abortBySessionKey(sessionKey: string): Promise<boolean>;
    steerBySessionKey(sessionKey: string, text: string): Promise<boolean>;
    /** Test-only helper to drop all registrations without touching live sessions. */
    resetForTest(): void;
    size(): number;
}
/**
 * Process-wide default registry. Prefer constructing a dedicated `EmbeddedRunRegistry`
 * and injecting it; the module-level singleton stays so the existing free functions
 * keep working until every caller has been migrated.
 */
export declare const defaultEmbeddedRunRegistry: EmbeddedRunRegistry;
export declare function registerEmbeddedRun(handle: EmbeddedRunHandle): void;
export declare function unregisterEmbeddedRun(handle: EmbeddedRunHandle): void;
export declare function getEmbeddedRunBySessionKey(sessionKey: string): EmbeddedRunHandle | undefined;
export declare function getEmbeddedRunByRunId(runId: string): EmbeddedRunHandle | undefined;
export declare function abortEmbeddedRun(sessionKey: string): Promise<boolean>;
export declare function queueEmbeddedSteer(sessionKey: string, text: string): Promise<boolean>;
