import React from 'react'; import type { MossAsyncTaskCompletion, MossAsyncTaskSnapshot } from '@rdk-moss/core/contracts/async-task'; import type { MossAgent } from '../core/index.js'; import type { SkillLearner } from '../core/memory/skill-learner.js'; import { type TodoItem } from '../tools/todo-tool.js'; import { type CommandSpec } from './commands/registry.js'; import { type CliRuntimeStatus, type OnboardingState } from './onboarding.js'; import { type ContextUsageSnapshot } from './usage-display.js'; import { type SkillHubSoulChoice } from './soul-command.js'; import type { MossSoul } from '@rdk-moss/core'; import { transcriptColor } from './tui-utils.js'; import type { ActivityItem, DeviceContextSummary, QueuedInput, TranscriptItem, TuiRunState, UserQuestionState } from './tui-utils.js'; export * from './tui-utils.js'; export interface MossTuiProps { agent: MossAgent; skillLearner?: SkillLearner; runtime?: CliRuntimeStatus; sessionKey: string; } export declare function stopCommandScope(message: string): 'btw' | 'main' | null; export declare function requestBtwStop(controller: AbortController | null): boolean; export interface StatusBarProps { state: TuiRunState; device: string; workspace: string; version: string; notice?: string; model?: string; ctxUsage?: ContextUsageSnapshot; flashHint?: string; hint?: string; } export interface SessionHeaderProps { device: string; workspace: string; model?: string; state: TuiRunState; toolsExpanded?: boolean; version?: string; cacheMode?: string; profile?: string; permissions?: string; } export declare function SessionHeader({ device: _device, workspace, model, state: _state, toolsExpanded: _toolsExpanded, version, cacheMode: _cacheMode, profile: _profile, permissions }: SessionHeaderProps): React.ReactElement; /** * Single-line status bar: * Default ready ctx 21k/200k (10%) ───── model | Ctrl+O expand · /help * Colors: * - mode (Default): primary * - status: state-dependent (green/cyan/amber) * - ctx %: muted < 70 < amber < 90 < red * - rest: dim */ export declare function StatusBar({ state, device, workspace, version, notice, model, ctxUsage, flashHint, hint }: StatusBarProps): React.ReactElement; export interface WelcomePanelProps { workspace: string; device: string; model?: string; cacheMode?: string; profile?: string; executionPlane?: DeviceContextSummary; tip?: string; compact?: boolean; /** Context-aware onboarding hints derived from runtime state. */ onboardingHint?: string | null; soul?: MossSoul; } export declare function soulWelcomeHint(soul: MossSoul): string; /** * Derive onboarding state from the current runtime. Used to decide whether to * show first-run guided setup, returning-user gap tips, or power-user tips. */ export declare function deriveOnboardingState(runtime: CliRuntimeStatus | undefined): OnboardingState; export declare function WelcomePanel({ workspace: _workspace, device: _device, model: _model, cacheMode: _cacheMode, profile: _profile, executionPlane, tip, compact, onboardingHint, soul, }: WelcomePanelProps): React.ReactElement; export interface ActivityItemLineProps { item: ActivityItem; expanded?: boolean; } /** * Tool call block. Always renders one-line headline: * {icon} {toolName} · {headline} {elapsed|…|!} * When expanded, appends the full input JSON below (indented). * * Running tools show a live elapsed clock (Grok/CC parity) instead of a * frozen "…" so long exec/search calls do not look stuck. * * Test contract (cli-tui-render.spec.mjs): * - running tool shows "…" or a live "Ns" clock * - completed tool shows "ms" * - failed tool contains "!" * - inputSummary content stays visible */ export declare function ActivityItemLine({ item, expanded }: ActivityItemLineProps): React.ReactElement; export interface ApprovalPromptLineProps { question: string; selectedIndex?: number; } export declare function ApprovalPromptLine({ question, selectedIndex }: ApprovalPromptLineProps): React.ReactElement; export interface UserQuestionPromptLineProps { state: UserQuestionState; } /** Claude Code-style multiple-choice prompt for ask_user_question. */ export declare function UserQuestionPromptLine({ state }: UserQuestionPromptLineProps): React.ReactElement; export interface TranscriptMessageProps { item: TranscriptItem; } export declare function TranscriptMessage({ item, toolsExpanded, showThinking }: TranscriptMessageProps & { model?: string; toolsExpanded?: boolean; showThinking?: boolean; }): React.ReactElement; export interface PromptEditorProps { value: string; cursor?: number; onChange: (value: string) => void; onCursorChange?: (cursor: number) => void; onSubmit: (value: string) => void; placeholder: string; disabled: boolean; onHistoryPrevious?: () => void; onHistoryNext?: () => void; onShiftEnter?: () => void; onPasteAttachmentShortcut?: () => void; hint?: string; model?: string; mode?: string; /** When true, route keystrokes through the vim modal handler. */ vimEnabled?: boolean; /** File-based custom commands to merge into the slash-command menu. */ extraCommandRows?: ReadonlyArray; /** Workspace root for `@`-file reference autocomplete (omit to disable). */ workspace?: string; } export declare function promptEditorRowBudget(value: string, options?: { hint?: string; model?: string; placeholder?: string; maxPreviewLines?: number; extraCommandRows?: ReadonlyArray; workspace?: string; }): number; export declare function PromptEditor({ value, cursor, onChange, onCursorChange, onSubmit, placeholder, disabled, onHistoryPrevious, onHistoryNext, onShiftEnter, onPasteAttachmentShortcut, hint, model: _model, mode, vimEnabled, extraCommandRows, workspace, }: PromptEditorProps): React.ReactElement; export interface QueuePreviewProps { items: QueuedInput[]; paused?: boolean; now?: number; } export declare function QueuePreview({ items, paused, now }: QueuePreviewProps): React.ReactElement | null; export interface SubagentTaskPanelProps { tasks: MossAsyncTaskSnapshot[]; completions?: Map; now?: number; } export interface TodoProgressPanelProps { todos: TodoItem[]; collapsed?: boolean; } /** * Sticky multi-step checklist for the current coding run (Claude Code TaskList / * Grok Todo parity). Populated from todo_write tool_results so long refactors * stay visible without Ctrl+O'ing buried tool rows. */ export declare function TodoProgressPanel({ todos, collapsed, }: TodoProgressPanelProps): React.ReactElement | null; export declare function SubagentTaskPanel({ tasks, completions, now, }: SubagentTaskPanelProps): React.ReactElement | null; interface SoulPickerChoice extends SkillHubSoulChoice { isDefault?: boolean; } interface SoulPickerState { choices: SoulPickerChoice[]; selectedIndex: number; } export declare function SoulPicker({ state, activeSoul }: { state: SoulPickerState; activeSoul?: MossSoul; }): React.ReactElement; /** * Live "the agent is working" line shown above the input while busy. It is a * self-animating spinner + an elapsed-seconds counter, so the moving glyph makes * it obvious the run is alive (not frozen) — the missing signal users hit when a * model turn streams after a tool call and the transcript area looks blank. */ interface WorkingIndicatorProps { reasoningRef?: React.MutableRefObject<{ lastAt: number; chars: number; }>; outputStreamRef?: React.MutableRefObject<{ chars: number; lastAt: number; }>; phase?: string; } export declare function WorkingIndicator({ reasoningRef, outputStreamRef, phase }: WorkingIndicatorProps): React.ReactElement; export { formatBackgroundCompletionNotice, formatBackgroundCompletionFlash, } from './background-completion-ui.js'; export declare function MossTui({ agent, skillLearner, runtime, sessionKey: initialSessionKey }: MossTuiProps): React.ReactElement; /** In-TUI `/help` command reference. Exported for discoverability tests. @internal */ export declare function commandList(customCommands?: readonly CommandSpec[]): string; export declare function runInkInteractive(agent: MossAgent, skillLearner: SkillLearner | undefined, runtime: CliRuntimeStatus | undefined, options?: { sessionKey?: string; }): Promise; export { transcriptColor }; //# sourceMappingURL=tui.d.ts.map