import type { TodoItem } from '@wrongstack/core/agent'; import type { CacheStats } from '@wrongstack/core/types'; import type { ContextBreakdown } from '@wrongstack/core/utils'; import type React from 'react'; import type { ResumeSessionEntry } from '../app-state.js'; import type { FleetEntry } from '../app-state-fleet.js'; import type { HeapSample } from '../heap-watchdog.js'; import type { PanelId } from '../ui-contracts.js'; import type { LiveSessionEntry } from './sessions-panel.js'; export interface SidebarContentProps { /** Live context window data from useStatusbarViewModel. */ contextWindow: { used: number; max: number; } | undefined; /** Honest per-category accounting behind the context window display. */ contextBreakdown?: ContextBreakdown | undefined; /** * Live prompt-cache hit ratio + token counts for the sidebar card. * Surfaced so a user staring at the right rail can see how much of * the spend is hitting the prompt cache without opening `/context`. */ cacheStats?: CacheStats | undefined; /** * How far the cached prefix reaches into the live request, in tokens. * Drawn as an overlay marker on the context-window spectrum bar so * "exactly how far the cache extends" is answerable at a glance. * Zero hides the marker — no prompt cached this request. */ cacheCoverageTokens?: number | undefined; /** Fleet entries (leader + subagents) from useStatusbarViewModel. */ entries: Record; /** Fleet counts summary. */ fleetCounts: { running: number; idle: number; pending: number; completed: number; } | undefined; /** Current provider label for display. */ provider?: string | undefined; /** Current model label for display. */ model?: string | undefined; /** Actual sidebar width in columns (including border+padding chrome). * Used to size the content area and truncate text appropriately. */ width: number; /** Vertical scroll offset — number of rows scrolled from the top. */ scrollOffset?: number | undefined; /** When true, the sidebar has keyboard focus (↑↓ scroll). */ focused?: boolean | undefined; /** Live leader todo board — rendered as a compact mission queue. */ todos?: readonly TodoItem[] | undefined; /** When true, show the agent-swarm + mission-queue section. Gated by the * effective agent-swarm panel mode being 'sidebar' (see app-view.tsx). */ showSwarmSection?: boolean | undefined; /** Live sessions from the SessionRegistry — same data as the F10 panel. * Shown as compact "live" rows with project name + status + agent count. */ liveSessions?: readonly LiveSessionEntry[] | undefined; /** Recent stored sessions for the `/resume` picker. Shown as compact rows * with title + last-activity + outcome badge. */ resumeSessions?: readonly ResumeSessionEntry[] | undefined; /** The current session ID — used to highlight the active session row. */ currentSessionId?: string | undefined; /** Current RSS/heap sample for this CLI process. */ processMemory?: HeapSample | undefined; /** CPU usage percentage (0-100). Derived from process.cpuUsage delta. */ cpuPercent?: number | undefined; /** Recent CPU ratios (0-1, oldest → newest) for the trend sparkline. */ cpuHistory?: readonly number[] | undefined; /** Recent RSS/totalMem ratios (0-1) for the trend sparkline. */ rssHistory?: readonly number[] | undefined; /** Recent heap-pressure ratios (0-1) for the trend sparkline. */ heapHistory?: readonly number[] | undefined; /** Total physical RAM in bytes — denominator of the RAM ratio. */ totalMem?: number | undefined; /** * Set of F-key panels that are routed to the sidebar AND win a slot * under `SIDEBAR_PANEL_LIMIT` this render. The persistent AGENT SWARM / * MISSIONS / SESSIONS cards check this set and skip themselves when the * corresponding F twin is already mounted above — otherwise the user * would see the same data rendered twice (once as a routed twin, once * as a persistent card). The F twin wins because it has its own Card * chrome and richer header / status affordances; the persistent card * is the fallback when the twin is at the bottom (F-key default). */ effectiveSidebarRoutes?: ReadonlySet | undefined; } /** * Normalized "is this session row the current session?" predicate used by * both the `SidebarContent` SESSIONS card (live + resume rows) and the * `SessionsPanelSidebar` (sidebar twin). The runtime `currentSessionId` * is the authoritative source — when defined, the row whose id matches * is the current row. When undefined (e.g. before the host registers a * session), the per-row `isCurrent` flag is the fallback (carried over * from the resume-picker domain for the case where the picker marks * the current session as non-resumable but the host hasn't published * the runtime id yet). A row without an id can never be the current * row, regardless of what its fallback flag says. The two SESSIONS * rows used to disagree on which key to read (live used strict id * compare, resume used `rs.isCurrent` first); this helper is the * single source of truth. */ export declare function isCurrentSession(rowId: string | undefined, currentSessionId: string | undefined, fallbackIsCurrent?: boolean | undefined): boolean; /** * (Replaced by `SidebarSectionHeader` in `./sidebar-panel-frame.tsx`.) * Kept here as a doc-comment so anyone hunting for "the sidebar's section * header" lands on the right file. The local `SectionHeader` symbol was * promoted to the shared `sidebar-panel-frame.tsx` so routed panels and * persistent content cards use the same capsuled-pill component. */ /** * The `Card` component now lives in `./sidebar-card.tsx` as the shared * raised-surface iskelet used by both the persistent cards (this file) and * the routed F-key panel twins (`sidebar-panel-frame.tsx` + * `sidebar-panels-{workspace,task}.tsx`). Imported at the top of this file * for the `MODEL CORE`, `PROMPT CACHE`, `SYSTEM`, `AGENT SWARM`, `MISSIONS`, * and `SESSIONS` cards — the migration keeps the persistent * call sites identical because the shared component preserves the same * `innerWidth` / `marginBottom` / `accent` / `children` contract. */ interface ContextSegment { label: string; shortLabel: string; tokens: number; color: string; glyph: string; } export declare function contextSpectrum(breakdown: ContextBreakdown | undefined, contextWindow: { used: number; max: number; } | undefined, width: number): Array; export declare function SidebarContent({ contextWindow, contextBreakdown, cacheStats, cacheCoverageTokens, entries, fleetCounts, provider, model, width, scrollOffset, focused, todos, showSwarmSection, liveSessions, resumeSessions, currentSessionId, processMemory, cpuPercent, cpuHistory, rssHistory, heapHistory, totalMem, effectiveSidebarRoutes, }: SidebarContentProps): React.ReactElement; export {}; //# sourceMappingURL=sidebar-content.d.ts.map