import type { AgentMessage, ThinkingLevel } from '@earendil-works/pi-agent-core'; import { InMemoryTranscriptRuntime } from '../../agent/embedded/transcript-runtime.js'; import type { SessionMetadata } from '../../session/types.js'; import type { CreateSideChatInput, SideChatConfig, SideChatStatus, SideChatView } from './types.js'; export declare class SideChatError extends Error { readonly code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'PARENT_NOT_FOUND' | 'LIMIT_REACHED' | 'CAPACITY_REACHED' | 'CONFLICT' | 'EXPIRED'; readonly reason?: 'idle' | 'waiting'; constructor(message: string, code: 'INVALID_REQUEST' | 'NOT_FOUND' | 'PARENT_NOT_FOUND' | 'LIMIT_REACHED' | 'CAPACITY_REACHED' | 'CONFLICT' | 'EXPIRED', reason?: 'idle' | 'waiting'); } export interface EphemeralSideChatManagerOptions { getParentMetadata: (sessionKey: string) => Promise; loadParentMessages: (sessionKey: string) => Promise; getDefaultModelRef: (sessionKey: string) => string; getDefaultThinkingLevel?: (sessionKey: string) => ThinkingLevel; getWorkspacePath: (metadata: SessionMetadata) => string; idleTtlMs?: number; maxPerClient?: number; maxTotal?: number; now?: () => number; startSweepTimer?: boolean; onBeforeDispose?: (sideChatId: string, clientInstanceId: string, messages: AgentMessage[]) => void | Promise; onExpired?: (sideChatId: string, clientInstanceId: string, reason: 'idle' | 'waiting') => void; } export declare class EphemeralSideChatManager { private readonly options; private readonly entries; private readonly reservations; private readonly expired; private readonly disposals; private stopped; private readonly now; private readonly idleTtlMs; private readonly maxPerClient; private readonly maxTotal; private readonly sweepTimer; constructor(options: EphemeralSideChatManagerOptions); create(input: CreateSideChatInput): Promise; private createEntry; get(id: string, clientInstanceId: string): SideChatView; getRuntime(id: string, clientInstanceId: string): InMemoryTranscriptRuntime; getMessages(id: string, clientInstanceId: string): AgentMessage[]; updateConfig(id: string, clientInstanceId: string, patch: Partial): SideChatView; heartbeat(id: string, clientInstanceId: string): SideChatView; extend(id: string, clientInstanceId: string): SideChatView; setStatus(id: string, clientInstanceId: string, status: SideChatStatus, runId?: string): SideChatView; waitForInput(id: string, clientInstanceId: string, clarification: NonNullable, status?: 'waiting-input' | 'waiting-approval'): void; dispose(id: string, clientInstanceId: string): Promise; disposeClient(clientInstanceId: string): Promise; sweepExpired(at?: number): Promise; disposeAll(): Promise; private requireEntry; private isExpired; private expireEntry; private pruneExpiredRecords; private toView; private touchEntry; private runBeforeDispose; } export declare function parseThinkingLevel(value: unknown): ThinkingLevel | undefined;