/** Which source produced a resolved selection. */ export type SessionSelectionProvenance = /** Selection persisted in the host (`session.get()`). */ 'host-persisted' /** Last selection observed from an external (user-initiated) chat * message, kept by slim's session metadata. */ | 'observed-external' /** No selection could be resolved. */ | 'unknown'; export interface SessionSelection { agent?: string; /** Prompt-shaped model ref (`{providerID, modelID}`), the same form * promptAsync bodies expect. */ model?: { providerID: string; modelID: string; }; variant?: string; provenance: SessionSelectionProvenance; } export interface SessionSelectionReader { /** Read the host-persisted selection for a session, or undefined when * the host does not expose one. Implementations must not throw. */ readHostSelection(sessionID: string): Promise<{ agent?: string; model?: unknown; } | undefined>; } /** Bound only the host `session.get` read. Metadata fallback must still * run if that read is slow or hangs (#1079 Oracle r2). */ export declare const HOST_SELECTION_TIMEOUT_MS = 2000; /** * Resolve the session's CURRENT selection for lifecycle continuations * (#1079): a background-task lifecycle event must continue the parent in * the agent/model the session actually uses now, never a hardcoded * `orchestrator`. * * Hierarchy: * 1. Host-persisted selection (`session.get()`). This is whatever the * host last stored; user-message admission updates it, and synthetic * prompts may also rewrite the host copy. * 2. Last externally observed selection from slim metadata (internal * admissions are filtered out of this store). * 3. Unknown — callers apply a conservative fallback (`orchestrator`, * matching historical wake behavior). */ export declare function resolveCurrentSelection(sessionID: string, host: SessionSelectionReader, metadata: { getAgent(sessionID: string): string | undefined; getModel(sessionID: string): string | undefined; }, timeoutMs?: number): Promise; /** Slim stores models as `"provider/modelID"`; promptAsync wants the * object form. A slash-less string cannot be a continuation pin. */ export declare function modelFromMetadataString(model: string | undefined): { providerID: string; modelID: string; } | undefined; /** Build a {@link SessionSelectionReader} from a plugin client. Works * for the v1 SDK client and the v2 client shim alike (the shim * delegates `session.get` without transforming it, wrapping the result * in `{data}`). The published v1 SDK type for `Session` omits * `agent`/`model`, but the runtime host sends both; read them * defensively. */ export declare function createSessionSelectionReader(client: unknown, directory?: string): SessionSelectionReader;