import type { SessionKey } from "@yanlinglabs/winter-agent-sdk"; import { type ContinuityEndpoint, type MessageOrigin } from "@yanlinglabs/winter-provider-runtime"; import { RuntimeSdkError } from "../errors.js"; import type { SeamContextWithDirectory } from "../seams/context.js"; import type { SwitchReviewer } from "../seams/review-switch.js"; import { type SharedSessionStore } from "./wiring.js"; export interface SwitchReviewerDeps { /** The one shared store. Built lazily from the peer + `winterHome` when a host does not pass one. */ shared?: SharedSessionStore; /** Defaults to the context's, then the peer's own `resolveWinterHome()` — resolved at first use. */ winterHome?: string; /** WS-21: the store's root when it is not `winterHome` (the shared runtime home). Defaults to the context's. */ storeHome?: string; /** * WS-18 W18-20 (P10b): turns a stamped `MessageOrigin` into full endpoint facts — normally * `createEndpointResolver(registry)` over the host's own (credentialed, live-discovery-aware) * catalog registry. Absent means `defaultEndpointResolver()` — a registry built from the COMPILED * catalog alone (`default-endpoint-resolver.ts`, fix round 1 CRITICAL): the bare * `endpointFromOrigin` fallback reports `readableState: "none"` for every model, which silently * over-warns a real lossless exposed-reasoning transfer. */ resolveEndpoint?: (origin: MessageOrigin) => ContinuityEndpoint; } export interface SwitchReviewerHandle extends SwitchReviewer { /** The shared store this reviewer reads through — the same object the router's recovery door uses. */ readonly shared: SharedSessionStore; } /** A review asked for a session the router has no record of. The text is matched by hosts — keep it. */ export declare class SwitchReviewError extends RuntimeSdkError { constructor(session: SessionKey, reason: string); } export declare function createSwitchReviewer(context: SeamContextWithDirectory, deps?: SwitchReviewerDeps): SwitchReviewerHandle;