/** Bounded child panels the Sessions browser opens over itself. */ import type { SessionId, SessionSeq } from '@deepseek-ai/dsh-session'; import type { TuiOverlay } from '../slots.ts'; import type { SessionFiltersValue } from './filters.ts'; import type { EventContextState, EventSearchState } from './model.ts'; /** Private signal consumed by the Sessions owner after a child handles a key. */ export declare const CHILD_CLOSE_REQUESTED: unique symbol; /** A child overlay that can ask its stack owner to remove it. */ export interface SessionsChildOverlay extends TuiOverlay { /** Whether the child has asked to be removed from the overlay stack. */ readonly [CHILD_CLOSE_REQUESTED]: () => boolean; } /** What the filter picker needs from its parent browser. */ export interface FilterOverlaySpec { /** Filter value copied when the picker opens. */ readonly value: SessionFiltersValue; /** Effective workspace; without one, `current` is not an available choice. */ readonly workspace: string | undefined; /** Apply the complete edited value. */ readonly apply: (filters: SessionFiltersValue) => void; /** Ask the stack owner to remove this child. */ readonly close: () => void; /** Redraw after a field move or value change. */ readonly invalidate: () => void; } /** What the within-session event browser needs from its parent. */ export interface EventsOverlaySpec { /** Session whose events are searched. */ readonly target: SessionId; /** Current event-search state. */ readonly events: () => EventSearchState; /** Start or restart a within-session search. */ readonly searchEvents: (sessionId: SessionId, query: string) => void; /** Append the next event-search page. */ readonly loadMoreEvents: () => void; /** * Read bounded context for one hit. * * The only read this overlay calls on activation of an ordinary hit; it is * never called while hits land, render, or move under the cursor. */ readonly readEvent: (sessionId: SessionId, seq: SessionSeq) => void; /** The catalog's context state for one exact hit. */ readonly eventContext: (sessionId: SessionId, seq: SessionSeq) => EventContextState; /** Push a child overlay onto the slot stack; the browser stays mounted beneath. */ readonly push: (overlay: (childClose: () => void) => TuiOverlay) => void; /** Current time for relative event ages. */ readonly now: () => number; /** Ask the stack owner to remove this child. */ readonly close: () => void; /** Redraw after editing, moving, or starting a read. */ readonly invalidate: () => void; } /** * Create the three-field Sessions filter picker. * @param spec - initial value, workspace availability, and owner controls. * @returns a bounded child overlay that applies only on Enter. */ export declare function createFilterOverlay(spec: FilterOverlaySpec): SessionsChildOverlay; /** * Create a query-line browser over full-text hits inside one session. * @param spec - target session, event-search state, and owner controls. * @returns a bounded child overlay whose hit rows are intentionally read-only. */ export declare function createEventsOverlay(spec: EventsOverlaySpec): SessionsChildOverlay; /** What the bounded context inspector needs from its parent browser. */ export interface EventContextOverlaySpec { /** * The catalog's current context state for this exact hit. * * The catalog has already narrowed this to the hit the panel was opened for, * so the inspector draws what it returns and does not re-identify the hit. */ readonly context: () => EventContextState; /** Current time for relative event ages. */ readonly now: () => number; /** Ask the stack owner to remove this child. */ readonly close: () => void; /** Redraw after scrolling. */ readonly invalidate: () => void; } /** * Create a bounded, scrollable inspector over one hit and its neighbors. * * The window is already bounded by the catalog's read, and this panel bounds it * again to the terminal: only whole committed-frame rows are drawn, the rest * scroll, and the target is marked rather than left for the reader to find. The * content itself is Harness's own semantic extraction, escaped before it is * measured so an event payload can never drive the terminal. * @param spec - target hit, catalog state, and owner controls. * @returns a bounded child overlay that closes on esc or ctrl-c. */ export declare function createEventContextOverlay(spec: EventContextOverlaySpec): SessionsChildOverlay; //# sourceMappingURL=panels.d.ts.map