import type { SpawnRequest, SpawnResult, WorkflowPhase } from '../types/index.js';
import { type SpawnExecutionMode } from './spawn-bridge.js';
export type SpawnSessionStatus = 'running' | 'completed' | 'failed' | 'timeout' | 'rejected' | 'queued';
export type SpawnSession = {
    id: string;
    request: SpawnRequest;
    status: SpawnSessionStatus;
    startedAt: string;
    completedAt?: string;
    result?: SpawnResult;
    violation?: string;
    fallback?: boolean;
};
export type SpawnSessionEvent = {
    type: 'spawn-started' | 'spawn-completed' | 'spawn-failed' | 'spawn-queued';
    sessionId: string;
    taskId: string;
    phase: WorkflowPhase;
    role: string;
    timestamp: string;
    result?: SpawnResult;
    reason?: string;
};
export declare function getSession(sessionId: string): SpawnSession | undefined;
export declare function listSessions(filter?: {
    taskId?: string;
    status?: SpawnSessionStatus;
}): SpawnSession[];
export declare function onSessionEvent(listener: (event: SpawnSessionEvent) => void): () => void;
export declare function spawnDetached(request: SpawnRequest, cwd: string, mode?: SpawnExecutionMode): SpawnSession;
export declare function loadPersistedSessions(cwd: string): SpawnSession[];
