MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / createTUIState

Function createTUIState

apps/kimi-code/src/tui/tui-state.ts:58–108  ·  view source on GitHub ↗
(options: KimiTUIOptions)

Source from the content-addressed store, hash-verified

56}
57
58export function createTUIState(options: KimiTUIOptions): TUIState {
59 const initialAppState = options.initialAppState;
60 const theme = currentTheme;
61
62 const terminal = new ProcessTerminal();
63 const ui = new TUI(terminal);
64
65 const transcriptContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
66 const activityContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
67 const todoPanelContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
68 const todoPanel = new TodoPanelComponent();
69 const queueContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
70 const btwPanelContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
71 const editorContainer = new GutterContainer(CHROME_GUTTER, CHROME_GUTTER);
72 const editor = new CustomEditor(ui, {
73 disablePasteBurst: initialAppState.disablePasteBurst ?? DEFAULT_TUI_CONFIG.disablePasteBurst,
74 });
75 const footer = new FooterComponent({ ...initialAppState }, () => {
76 ui.requestRender();
77 });
78
79 return {
80 ui,
81 terminal,
82 transcriptContainer,
83 activityContainer,
84 todoPanelContainer,
85 todoPanel,
86 queueContainer,
87 btwPanelContainer,
88 editorContainer,
89 editor,
90 footer,
91 theme,
92 appState: { ...initialAppState },
93 startupState: 'pending',
94 livePane: { ...INITIAL_LIVE_PANE },
95 transcriptEntries: [],
96 terminalState: createTerminalState(),
97 activitySpinner: null,
98 toolOutputExpanded: false,
99 sessions: [],
100 loadingSessions: false,
101 sessionsScope: 'cwd',
102 activeDialog: null,
103 tasksBrowser: undefined,
104 externalEditorRunning: false,
105 queuedMessages: [],
106 swarmModeEntry: undefined,
107 };
108}

Callers 2

constructorMethod · 0.90

Calls 2

requestRenderMethod · 0.95
createTerminalStateFunction · 0.90

Tested by

no test coverage detected