feat(tui): update fullscreen config for model router
This commit is contained in:
@@ -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<void> {
|
||||
// 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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user