diff --git a/src/frontends/tui/fullscreen.ts b/src/frontends/tui/fullscreen.ts index 2f9d623..a7703a3 100644 --- a/src/frontends/tui/fullscreen.ts +++ b/src/frontends/tui/fullscreen.ts @@ -3,20 +3,28 @@ import { render } from 'ink'; import { App } from './components/index.js'; import type { ManagedSession } from '../../session/index.js'; import type { ModelClient } from '../../models/types.js'; +import type { ModelRouter } from '../../models/router.js'; export interface FullscreenTuiConfig { session: ManagedSession; modelClient: ModelClient; + modelRouter?: ModelRouter; systemPrompt: string; model: string; onExit?: () => void; } export async function startFullscreenTui(config: FullscreenTuiConfig): Promise { + // Ensure stdin is in a clean state for Ink + if (process.stdin.isPaused()) { + process.stdin.resume(); + } + const { waitUntilExit } = render( React.createElement(App, { session: config.session, modelClient: config.modelClient, + modelRouter: config.modelRouter, systemPrompt: config.systemPrompt, model: config.model, onExit: config.onExit, diff --git a/src/frontends/tui/index.ts b/src/frontends/tui/index.ts index e3879f5..2e01b51 100644 --- a/src/frontends/tui/index.ts +++ b/src/frontends/tui/index.ts @@ -2,7 +2,7 @@ export { MinimalTui, formatPrompt, parseCommand, - type TuiCommand, + type Command, type MinimalTuiConfig, } from './minimal.js'; @@ -11,4 +11,7 @@ export { type FullscreenTuiConfig, } from './fullscreen.js'; +export { renderMarkdown } from './markdown.js'; +export { parseCommand as parseCommandUtil, getHelpText, resolveModelAlias } from './commands.js'; + export { App, StatusBar, MessageList, InputBar } from './components/index.js';