import type { Component, EditorComponent, EditorTheme, MarkdownTheme, TUI } from "@earendil-works/pi-tui"; import type { AgentSession } from "../../../core/agent-session.js"; import type { BashResult } from "../../../core/bash-executor.ts"; import type { ReadonlyFooterDataProvider } from "../../../core/footer-data-provider.ts"; import type { ChatMessageEntry, ChatMessageRenderOptions } from "./chat-message-renderer.ts"; import type { ChatTranscriptEntryLike } from "./chat-transcript.js"; export interface ChatSessionHostStyle { dim(text: string): string; text(text: string): string; textMuted(text: string): string; accent(text: string): string; accentBold(text: string): string; workingIndicatorPalette?: () => { dark: string; lift: string; muted: string; accent: string; bright: string; peak: string; }; /** Use Atomic's live global theme when the host shares the interactive theme proxy. */ workingIndicatorUseGlobalTheme?: boolean; rule(hex: string, text: string): string; cursor(): string; blank(width: number): string; editorRuleColor(disabled: boolean, agentSession: AgentSession | undefined, state?: { isBashMode: boolean; }): string; } export interface ChatSessionHostBashRequest { command: string; excludeFromContext: boolean; onChunk: (chunk: string) => void; } /** * Which key produced one submission. `auto` is Enter; `followUp` is the * explicit follow-up binding. The mode travels with the submission so a host * whose idle `prompt` command has to pick a delivery queue reads this * invocation's intent rather than shared state a concurrent submission owns. */ export type ChatSessionSubmitMode = "auto" | "followUp"; export interface ChatSessionHostCommands { ensureAttached?: () => Promise; prompt?: (text: string, mode: ChatSessionSubmitMode) => Promise; /** Host-owned admission route, used instead of raw SDK streaming shortcuts. */ submitUserMessage?: (text: string, mode: ChatSessionSubmitMode) => Promise; steer?: (text: string) => Promise; followUp?: (text: string) => Promise; interrupt?: () => Promise; resume?: (message?: string, mode?: ChatSessionSubmitMode) => Promise; runBash?: (request: ChatSessionHostBashRequest) => Promise; abortBash?: () => void | Promise; abortCompaction?: () => void | Promise; handleSlashCommand?: (text: string) => Promise | boolean; } export interface ChatSessionHostOpts { style: ChatSessionHostStyle; commands?: ChatSessionHostCommands; requestRender?: () => void; getAgentSession?: () => AgentSession | undefined; /** Custom hosts may retain live task rows; interactive stage chat uses footer-only status. */ taskRowsInChat?: boolean; isStreaming?: () => boolean; isPaused?: () => boolean; isDisabled?: () => boolean; isBashRunning?: () => boolean; showWarning?: (message: string) => void; showStatus?: (message: string) => void; actions?: Record void | Promise>; getActionKeyDisplay?: (action: string) => string; getMarkdownTheme?: () => MarkdownTheme; tui?: TUI; keybindings?: unknown; editorFactory?: (tui: TUI, theme: EditorTheme, keybindings: unknown) => EditorComponent; autocompleteProvider?: import("@earendil-works/pi-tui").AutocompleteProvider; editorTheme: EditorTheme; getChatRenderSettings?: () => Partial> | undefined; getCwd?: () => string; footerData?: ReadonlyFooterDataProvider; renderExtraEntry?: (entry: TExtraEntry) => Component; } export type ChatSessionHostEntry = ChatMessageEntry | TExtraEntry; export type AgentSnapshotMessage = AgentSession["messages"][number]; export type CacheKeyPart = string | number | boolean | null; //# sourceMappingURL=chat-session-host-types.d.ts.map