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 { App } from './components/index.js';
|
||||||
import type { ManagedSession } from '../../session/index.js';
|
import type { ManagedSession } from '../../session/index.js';
|
||||||
import type { ModelClient } from '../../models/types.js';
|
import type { ModelClient } from '../../models/types.js';
|
||||||
|
import type { ModelRouter } from '../../models/router.js';
|
||||||
|
|
||||||
export interface FullscreenTuiConfig {
|
export interface FullscreenTuiConfig {
|
||||||
session: ManagedSession;
|
session: ManagedSession;
|
||||||
modelClient: ModelClient;
|
modelClient: ModelClient;
|
||||||
|
modelRouter?: ModelRouter;
|
||||||
systemPrompt: string;
|
systemPrompt: string;
|
||||||
model: string;
|
model: string;
|
||||||
onExit?: () => void;
|
onExit?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function startFullscreenTui(config: FullscreenTuiConfig): Promise<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(
|
const { waitUntilExit } = render(
|
||||||
React.createElement(App, {
|
React.createElement(App, {
|
||||||
session: config.session,
|
session: config.session,
|
||||||
modelClient: config.modelClient,
|
modelClient: config.modelClient,
|
||||||
|
modelRouter: config.modelRouter,
|
||||||
systemPrompt: config.systemPrompt,
|
systemPrompt: config.systemPrompt,
|
||||||
model: config.model,
|
model: config.model,
|
||||||
onExit: config.onExit,
|
onExit: config.onExit,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export {
|
|||||||
MinimalTui,
|
MinimalTui,
|
||||||
formatPrompt,
|
formatPrompt,
|
||||||
parseCommand,
|
parseCommand,
|
||||||
type TuiCommand,
|
type Command,
|
||||||
type MinimalTuiConfig,
|
type MinimalTuiConfig,
|
||||||
} from './minimal.js';
|
} from './minimal.js';
|
||||||
|
|
||||||
@@ -11,4 +11,7 @@ export {
|
|||||||
type FullscreenTuiConfig,
|
type FullscreenTuiConfig,
|
||||||
} from './fullscreen.js';
|
} 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';
|
export { App, StatusBar, MessageList, InputBar } from './components/index.js';
|
||||||
|
|||||||
Reference in New Issue
Block a user