/** * Bounded current-session hub and routing to existing child surfaces. * * It deliberately reads no Harness state. The owning attachment supplies the * current title and facts, decides which controls are human-safe, and owns the * actual navigation and title mutation seams. * @module dshline/session/overlay */ import type { SessionId, SessionSeq } from '@deepseek-ai/dsh-session'; import type { EventContextState, EventSearchState, LineageState } from '../sessions/model.ts'; import type { TuiOverlay } from '../slots.ts'; import { type CurrentSessionHubCapabilities, type CurrentSessionReading } from './model.ts'; /** Result of a title flow the owner performs for this live session. */ export type CurrentSessionRenameOutcome = /** The title was accepted and normalized by the owning authority. */ { readonly kind: 'renamed'; readonly title: string; } /** The reader dismissed the owner-owned title prompt. */ | { readonly kind: 'cancelled'; } /** The authority refused the proposed title. */ | { readonly kind: 'failed'; readonly message: string; }; /** * The Session navigator callbacks a current-session child needs. * * This is intentionally a callback-shaped Session navigator, whose methods * match the existing SessionCatalog public methods without claiming a new * navigation service. An owner can pass those callbacks directly while still * choosing whether each operation is safe to expose here. */ export interface CurrentSessionNavigator { /** Current within-session event-search state. */ readonly events: () => EventSearchState; /** Start or restart an event search for a session. */ readonly searchEvents: (sessionId: SessionId, query: string) => void; /** Append the next event-search page. */ readonly loadMoreEvents: () => void; /** Request bounded context for one event hit. */ readonly requestEventContext: (sessionId: SessionId, seq: SessionSeq) => void; /** Read context state for one exact event hit. */ readonly eventContext: (sessionId: SessionId, seq: SessionSeq) => EventContextState; /** Read lineage state for one session. */ readonly lineage: (sessionId: SessionId) => LineageState; /** Request lineage for one session. */ readonly requestLineage: (sessionId: SessionId) => void; /** * Abandon in-flight navigation reads when the hub closes. * * Optional so a presenter that owns no cancellable work can omit it; when * supplied, a late page can never repaint a surface that has come down. */ readonly cancel?: () => void; } /** Inputs the current-session hub needs from its owner. */ export interface CurrentSessionHubOverlaySpec { /** Current title, stable id, and facts; re-read on every paint. */ readonly reading: () => CurrentSessionReading; /** Capability state already adjudicated by the owner. */ readonly capabilities: () => CurrentSessionHubCapabilities; /** Session navigator callbacks used by Find and Lineage children. */ readonly navigator?: CurrentSessionNavigator; /** Open the owner's authoritative turns surface over this hub. */ readonly openTurns?: () => void; /** Collect and submit a replacement title through the owner. */ readonly rename?: () => Promise; /** * Focus a lineage row outside this hub. * * The lineage child remains useful without it, but its Enter action reports * that the owner cannot navigate to another session instead of pretending a * SessionCatalog supplies such a mutation. */ readonly focusLineage?: (sessionId: SessionId) => boolean; /** User home used by the existing lineage presentation. */ readonly home: string | undefined; /** Current time injected for the existing lineage presentation and notices. */ readonly now: () => number; /** * Push a normal overlay-stack child, receiving the stack-owned close callback. * * This is the same factory shape used by `openSurface`, so Escape closes only * the child and returns to this still-mounted hub. */ readonly push: (create: (close: () => void) => TuiOverlay) => void; /** Remove this hub from the owner-managed overlay stack. */ readonly close: () => void; /** Request redraw after local selection or asynchronous title outcome changes. */ readonly invalidate: () => void; } /** * Create the bounded current-session hub. * @param spec - owner reading, capability decisions, callback seams, and stack controls. * @returns a temporary overlay that never writes scrollback. */ export declare function createCurrentSessionHubOverlay(spec: CurrentSessionHubOverlaySpec): TuiOverlay; //# sourceMappingURL=overlay.d.ts.map