fix: update pi-ai/pi-tui usage

This commit is contained in:
Peter Steinberger
2026-01-20 16:37:57 +00:00
parent 842be7b864
commit 8bf484bdad
3 changed files with 5 additions and 7 deletions

View File

@@ -1,10 +1,8 @@
import {
Editor,
type EditorOptions,
type EditorTheme,
Key,
matchesKey,
type TUI,
} from "@mariozechner/pi-tui";
export class CustomEditor extends Editor {
@@ -19,8 +17,8 @@ export class CustomEditor extends Editor {
onShiftTab?: () => void;
onAltEnter?: () => void;
constructor(tui: TUI, theme: EditorTheme, options?: EditorOptions) {
super(tui, theme, options);
constructor(theme: EditorTheme) {
super(theme);
}
handleInput(data: string): void {
if (matchesKey(data, Key.alt("enter")) && this.onAltEnter) {

View File

@@ -193,7 +193,7 @@ export async function runTui(opts: TuiOptions) {
const statusContainer = new Container();
const footer = new Text("", 1, 0);
const chatLog = new ChatLog();
const editor = new CustomEditor(tui, editorTheme);
const editor = new CustomEditor(editorTheme);
const root = new Container();
root.addChild(header);
root.addChild(chatLog);