import type { Session, SessionEvent } from "@opengeni/sdk"; import { type EmbeddedSessionReadClientOverride } from "../session-context.js"; import { type SessionEventFeedOptions } from "./internal.js"; export type UseSessionOptions = EmbeddedSessionReadClientOverride & SessionEventFeedOptions & { /** Re-fetch on an interval (ms). Off by default — pair with `useSessionEvents` for live status. */ pollIntervalMs?: number | undefined; /** Optional shared causal clock invoked when each network read starts. */ beginRead?: (() => number) | undefined; }; export type UseSessionResult = { session: Session | null; loading: boolean; error: Error | null; /** Monotonic revision of accepted authoritative detail reads. */ readRevision: number; /** Causal generation captured when the accepted network read started. */ readGeneration: number; refresh: () => Promise; /** Manually rename the session (PATCH, source='user'). Returns the updated session, or null on failure. */ updateTitle: (title: string) => Promise; /** True while a rename is in flight. */ updating: boolean; mutationError: Error | null; clearMutationError: () => void; }; /** Event types that change the session title (auto + cross-client renames). */ export declare function isTitleEvent(event: Pick): boolean; /** Fetch one session (with optional polling), live-patching its title on `session.title_set`. */ export declare function useSession(sessionId: string | null | undefined, options?: UseSessionOptions): UseSessionResult;