MCPcopy
hub / github.com/Doorman11991/smallcode / constructor

Method constructor

src/tui/fullscreen.js:156–227  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

154
155class FullScreenTUI {
156 constructor(options = {}) {
157 this.theme = THEMES[options.theme || 'dark'];
158 this.showToolPanel = options.showToolPanel || false;
159 this.width = process.stdout.columns || 80;
160 this.height = process.stdout.rows || 24;
161
162 // Panel content buffers
163 this.chatLines = []; // Rendered chat messages
164 this.toolLines = []; // Tool execution log
165 this.inputBuffer = ''; // Current user input
166 this.inputCursor = 0; // Cursor position in input
167 this.chatScroll = 0; // Scroll offset for chat
168 this.inputHistory = []; // Command history
169 this.historyIdx = -1;
170
171 // Command palette
172 this.commandPaletteOpen = false;
173 this.commandPaletteSelection = 0;
174 this._paletteScrollOffset = 0;
175 this.commands = [
176 { cmd: '/quit', alias: '/q', desc: 'Exit SmallCode' },
177 { cmd: '/clear', alias: null, desc: 'Reset conversation' },
178 { cmd: '/model', alias: null, desc: 'Show/switch model' },
179 { cmd: '/endpoint', alias: null, desc: 'Switch API endpoint' },
180 { cmd: '/stats', alias: null, desc: 'Session statistics' },
181 { cmd: '/tokens', alias: null, desc: 'Token usage report' },
182 { cmd: '/budget', alias: null, desc: 'Context window budget' },
183 { cmd: '/files', alias: null, desc: 'List project files' },
184 { cmd: '/diff', alias: null, desc: 'Git diff summary' },
185 { cmd: '/git', alias: null, desc: 'Run git command' },
186 { cmd: '/loop', alias: null, desc: 'Validate + auto-fix file' },
187 { cmd: '/memory', alias: null, desc: 'View project memory' },
188 { cmd: '/trace', alias: null, desc: 'View execution traces' },
189 { cmd: '/eval', alias: null, desc: 'Run prompt evaluation' },
190 { cmd: '/escalation', alias: null, desc: 'Model escalation status' },
191 { cmd: '/profile', alias: null, desc: 'Model profile + routing' },
192 { cmd: '/cognition', alias: null, desc: 'MarrowScript cognition status' },
193 { cmd: '/mcp', alias: null, desc: 'Connected MCP servers' },
194 { cmd: '/skill', alias: null, desc: 'Manage reusable skills' },
195 { cmd: '/plugin', alias: null, desc: 'Manage plugins' },
196 { cmd: '/sessions', alias: null, desc: 'List/resume sessions' },
197 { cmd: '/session', alias: null, desc: 'Parallel sessions' },
198 { cmd: '/share', alias: null, desc: 'Export session' },
199 { cmd: '/undo', alias: null, desc: 'Revert last edit' },
200 { cmd: '/compact', alias: null, desc: 'Trim conversation history' },
201 { cmd: '/help', alias: null, desc: 'Show all commands' },
202 { cmd: '/version', alias: null, desc: 'Show SmallCode version' },
203 ];
204
205 // Layout dimensions (computed)
206 this.statusHeight = 1;
207 this.inputHeight = 3;
208 this.chatHeight = 0;
209 this.chatWidth = 0;
210 this.toolWidth = 0;
211
212 // State
213 this.active = false;

Callers

nothing calls this directly

Calls 1

_computeLayoutMethod · 0.95

Tested by

no test coverage detected