/** * Data hooks for sidebar panel twins. * * These hooks lift the data sources used by the bottom-region panels * (ProcessList, Kanban, Connections) into the shared `app-view.tsx` * runtime scope so the sidebar twins can receive real data instead of * hardcoded empty arrays. * * Each hook is self-contained: it manages its own refresh interval and * cleanup. The hooks must be called unconditionally (rules of hooks), but * polling is gated by the `enabled` flag — app-view passes whether the * twin currently occupies a visible sidebar slot. While a panel is closed * or routed to the bottom region no polling runs (the bottom panels run * their own polling when open), so the session pays no IPC probes or disk * reads for panels nobody is looking at. Each hook performs an immediate * first read when enabled, so data is fresh the moment the twin mounts. */ export interface SidebarProcess { pid: number; name: string; status: string; } /** * Read the live process registry. Refreshes every 2 seconds (only while * `enabled`) so elapsed times and newly spawned/killed processes are * reflected. */ export declare function useSidebarProcessList(enabled?: boolean): { activeCount: number; totalCount: number; processes: readonly SidebarProcess[]; }; export interface SidebarConnection { name: string; status: 'ok' | 'warn' | 'down' | 'unknown'; latencyMs?: number | undefined; } /** * Poll connections health every 8 seconds (only while `enabled`). The * collection function lives in `connections-health.ts` and mirrors the * WebUI server's shape. We map the richer `ConnectionHealthService` status * into the sidebar's 4-state enum so the sidebar twin stays simple. */ export declare function useSidebarConnections(projectRoot: string, enabled?: boolean): readonly SidebarConnection[]; /** * Status returned by the WrongProxy sidebar twin. Mirrors the * 4-state shape used by `useSidebarConnections` so the sidebar frame's * pill / glyph / row coloring stay uniform across panels. */ export type SidebarWrongProxyStatus = 'ok' | 'warn' | 'down' | 'unknown'; export interface SidebarWrongProxy { url: string; status: SidebarWrongProxyStatus; latencyMs?: number | undefined; detail?: string | undefined; /** * WrongTrace IPC endpoint, read from the `/api/health` body's * `socket_path` field (named pipe / UDS the daemon listens on). * Undefined when the daemon is down or does not expose a socket — * the sidebar then omits the IPC rows entirely. */ socketPath?: string | undefined; /** Daemon version from the `/api/health` body, when reported. */ version?: string | undefined; } /** * Probe the WrongProxy daemon. Refreshes every 8 seconds while * `enabled` is true; returns `null` when `enabled` is false so the * sidebar twin (and its slot reservation) stop participating in the * `SIDEBAR_PANEL_LIMIT` race — the panel is then rendered as `null` * by `app-view-sidebar.tsx`. The probe hits `/api/health`, the * canonical endpoint shared with the runtime probe in * `packages/cli/src/wiring/proxy-probe.ts`; we deliberately do NOT * share the runtime probe's mutable `active` flag because the sidebar * twin needs its own observable state (latency, error detail) to * paint a useful panel — the runtime probe only flips a boolean. * * Errors stay silent: failures populate `status: 'down'` so the card * shows "unreachable" without spamming the console, matching the * no-throw contract used by every other sidebar probe. */ export declare function useSidebarWrongProxy(url: string | undefined, enabled?: boolean): SidebarWrongProxy | null; export interface SidebarKanbanColumn { name: string; count: number; } /** * Load the kanban board summary for the sidebar. Uses `listBoards()` to * find the most recently used board, then fetches its column counts. * Refreshes every 10 seconds (only while `enabled`). */ export declare function useSidebarKanban(projectRoot: string, enabled?: boolean): { columns: readonly SidebarKanbanColumn[]; totalActive: number; activeCardTitles: readonly string[]; }; //# sourceMappingURL=use-sidebar-panel-data.d.ts.map