import type { CanvasSource } from '../source.js'; import type { RemoteEventStream } from '../remote-event-stream.js'; import { type CoalescedRebuilder } from './rebuild-coalescer.js'; import { type BindingId, type BindingResolution, type RawTerminalInput } from '../../keybindings/index.js'; declare const BROWSE_NAV_ACTIONS: readonly ["crtr.browse.quit", "crtr.browse.down", "crtr.browse.up", "crtr.browse.first", "crtr.browse.last", "crtr.browse.expand-or-child", "crtr.browse.collapse-or-parent", "crtr.browse.toggle-fold", "crtr.browse.tab-next", "crtr.browse.tab-previous", "crtr.browse.tab.1", "crtr.browse.tab.2", "crtr.browse.tab.3", "crtr.browse.tab.4", "crtr.browse.tab.5", "crtr.browse.close-subtree", "crtr.browse.sort", "crtr.browse.scope", "crtr.browse.profile", "crtr.browse.residents", "crtr.browse.preview", "crtr.browse.search", "crtr.browse.revive-now", "crtr.browse.focus", "crtr.browse.focus-background"]; declare const BROWSE_SEARCH_ACTIONS: readonly ["crtr.browse.search.cancel", "crtr.browse.search.commit", "crtr.browse.search.delete", "crtr.browse.search.quit"]; export declare function resolveBrowseNavAction(bindings: BindingResolution, raw: RawTerminalInput): (typeof BROWSE_NAV_ACTIONS)[number] | null; export declare function resolveBrowseSearchAction(bindings: BindingResolution, raw: RawTerminalInput): (typeof BROWSE_SEARCH_ACTIONS)[number] | null; /** Wires a RemoteEventStream's `nodes`/`inbox` events through the coalescer * (`rebuild-coalescer.ts`) so a burst of SSE events collapses to ONE rebuild * round, never one N+1 remote-subprocess rebuild per event. Exported (rather * than left inline in `runBrowse`) so the coalescer integration test can * drive this ACTUAL wiring, not just `createCoalescedRebuilder` in isolation * — the test asserts this function routes through the coalescer rather than * calling `rebuild()` directly per event. */ export declare function wireEventStreamRebuild(eventStream: Pick, rebuild: () => Promise): { rebuilder: CoalescedRebuilder; unsubscribe: () => void; }; export declare function runBrowse(opts: { returnPane?: string; cwd?: string; /** Profile to show initially. Undefined means no profile is selected, so the * initial view includes all profiles and the profile toggle is unavailable. */ profileId?: string; /** The read source (required) — canvas-browse always injects one * (`cliCanvasSource`/remote); no in-process openDb fallback exists here. */ source: CanvasSource; eventStream?: RemoteEventStream; /** Local viewer registry projection. Kept separate from CanvasSource because * focus rows describe this machine's screens, not remote canvas state. */ viewedNodeIds?: () => Promise>; /** Route the `x` close-out through the daemon API (the CLI injects * `cliClient().closeNode(id, { finish: true })`). Kept as a callback so this * core module never imports the openDb-reaching `runtime/close.js`. Returns the * torn-down ids (root + cascaded). */ closeNode: (id: string) => Promise<{ closed: string[]; }>; }): Promise; export {};