feat: add fullscreen TUI mode with Ink React components

This commit is contained in:
William Valentin
2026-02-05 00:41:17 -08:00
parent 53a8bd97eb
commit f671ea5ab5
4 changed files with 89 additions and 26 deletions
+27
View File
@@ -0,0 +1,27 @@
import React from 'react';
import { render } from 'ink';
import { App } from './components/index.js';
import type { ManagedSession } from '../../session/index.js';
import type { ModelClient } from '../../models/types.js';
export interface FullscreenTuiConfig {
session: ManagedSession;
modelClient: ModelClient;
systemPrompt: string;
model: string;
onExit?: () => void;
}
export async function startFullscreenTui(config: FullscreenTuiConfig): Promise<void> {
const { waitUntilExit } = render(
React.createElement(App, {
session: config.session,
modelClient: config.modelClient,
systemPrompt: config.systemPrompt,
model: config.model,
onExit: config.onExit,
})
);
await waitUntilExit();
}
+7
View File
@@ -5,3 +5,10 @@ export {
type TuiCommand,
type MinimalTuiConfig,
} from './minimal.js';
export {
startFullscreenTui,
type FullscreenTuiConfig,
} from './fullscreen.js';
export { App, StatusBar, MessageList, InputBar } from './components/index.js';