import type React from 'react'; import type { AgentTimelineEntry } from '@wrongstack/core/coordination'; import type { AgentTranscriptReader } from '../ui-contracts.js'; export type { AgentTranscriptReader } from '../ui-contracts.js'; import type { FleetEntry } from '../app-state.js'; import type { HistoryEntry } from './history/types.js'; /** * Narrow read-only view of per-subagent transcripts. AgentMonitorService * (created in the CLI host) satisfies this structurally; the TUI never * imports from @wrongstack/cli. `getTranscript` returns entries NEWEST * FIRST (mirroring AgentMonitorService.getTranscript). */ export interface AgentsMonitorProps { entries: Record; totalCost: number; leaderCost?: number | undefined; totalTokens?: { input: number; output: number; }; nowTick: number; onClose?: (() => void) | undefined; transcripts?: AgentTranscriptReader | undefined; leaderTranscript?: (() => AgentTimelineEntry[]) | undefined; fullscreen?: boolean | undefined; } export { EMPTY_AGENTS_CLOSE_DELAY_MS, IDLE_HIDE_MS, TRANSCRIPT_FETCH_LIMIT, TRANSCRIPT_ROWS, } from './agents-monitor-constants.js'; /** * Select the agents the live monitor should render. Only actively-running * subagents are detail-worthy; idle workers are retained by the coordinator for * reuse but should not keep the TUI crowded after their task closes. LEADER * stays visible while a subagent is running (or while LEADER itself is running) * so F3 always has a detail card fallback. */ export declare function selectLiveAgents(all: FleetEntry[], _now: number, _idleHideMs?: number): FleetEntry[]; export declare function fmtExactTokens(n: number): string; export declare function formatContextRunway(tokens?: number, maxTokens?: number): string; export declare function formatRecentToolChip(tool: FleetEntry['recentTools'][number]): string; export declare function formatAgentDetailHeader(entry: FleetEntry): string; export declare function agentRisk(entry: FleetEntry): 'calm' | 'busy' | 'hot' | 'critical'; export declare function selectAgentDetail(live: FleetEntry[], selectedId?: string): FleetEntry | undefined; export declare function nextEmptyAgentsCloseStartedAt(liveCount: number, now: number, currentStartedAt?: number): number | undefined; export declare function shouldCloseEmptyAgentsMonitor(liveCount: number, now: number, emptyStartedAt: number | undefined, delayMs?: number): boolean; /** * Rows of transcript content for the current terminal. Constant for a * given terminal size and agent count, so agent switches never change * the panel height โ€” only explicit resizes / fleet composition do. * `fullscreen` lifts the 24-row cap: the F3 monitor owns the whole * screen (chat history hidden), so the pane should fill every row the * chrome doesn't need. */ export declare function transcriptRowsForTerminal(termRows: number | undefined, rosterCount: number, fullscreen?: boolean): number; /** One transcript entry as a single display line: `HH:MM:SS L3 ๐Ÿ”ง โ€ฆ`. */ export declare function formatTranscriptLine(e: AgentTimelineEntry, maxWidth?: number): string; /** * Map the main chat's history entries into the transcript timeline shape * so LEADER gets its own clean per-agent view in the F3 monitor. Subagent * lines are EXCLUDED โ€” that separation (leader vs subagents, not * interleaved) is the whole point of the per-agent view. Banners and * confirm prompts are UI chrome, not history, and are skipped too. */ export declare function leaderTimelineFromEntries(entries: readonly HistoryEntry[]): AgentTimelineEntry[]; /** * Slice a transcript (OLDEST first) into the fixed viewing window. * `scrollOffset` counts lines scrolled UP from the tail (0 = pinned to * newest). Returns the visible slice plus how many entries are hidden * above/below the window. */ export declare function selectTranscriptWindow(entries: readonly AgentTimelineEntry[], scrollOffset: number, rows?: number): { slice: AgentTimelineEntry[]; above: number; below: number; }; /** * Agents panel โ€” the redesigned F3 view. * * Layout: * โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” * โ”‚ โ—‡ AGENTS / live ops โ–ถ 2 โœ“ 5 $0.1234 โ”‚ โ† DashboardHeader * โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค * โ”‚ agents (4) โ”‚ AgentName model status โ”‚ โ† Right detail * โ”‚ โ–ถ agent1 โ–ˆโ–ˆโ–‘ 12s โ”‚ runtime 5m ยท L42 892t โ”‚ * โ”‚ โ—‹ agent2 โ–ˆโ–‘โ–‘ 5m โ”‚ ctx 45k/100k ยท 55k free โ”‚ * โ”‚ โ—‹ agent3 โ–‘โ–‘โ–‘ 2m โ”‚ active: โ†’ read foo.ts 1.2s โ”‚ * โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ * โ”‚ โ”‚ โ”‚ transcript 74 entries โ”‚ โ”‚ * โ”‚ โ”‚ โ”‚ L3 ๐Ÿ”ง read foo.ts โ”‚ โ”‚ * โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ * โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค * โ”‚ โ†‘โ†“ agent PgUp/Dn transcript F3 close โ”‚ * โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ */ export declare function AgentsMonitor({ entries, totalCost, leaderCost, totalTokens, nowTick, onClose, transcripts, leaderTranscript, fullscreen, }: AgentsMonitorProps): React.ReactElement; //# sourceMappingURL=agents-monitor.d.ts.map