centaurus-cli 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTH_FLOW.md +138 -0
- package/CONFIG_GUIDE.md +255 -0
- package/LICENSE +21 -0
- package/README.md +346 -0
- package/dist/ai/provider-factory.d.ts +6 -0
- package/dist/ai/provider-factory.d.ts.map +1 -0
- package/dist/ai/provider-factory.js +27 -0
- package/dist/ai/provider-factory.js.map +1 -0
- package/dist/ai/providers/base.d.ts +25 -0
- package/dist/ai/providers/base.d.ts.map +1 -0
- package/dist/ai/providers/base.js +9 -0
- package/dist/ai/providers/base.js.map +1 -0
- package/dist/ai/providers/gemini.d.ts +34 -0
- package/dist/ai/providers/gemini.d.ts.map +1 -0
- package/dist/ai/providers/gemini.js +146 -0
- package/dist/ai/providers/gemini.js.map +1 -0
- package/dist/ai/types.d.ts +20 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/cli-adapter.d.ts +78 -0
- package/dist/cli-adapter.d.ts.map +1 -0
- package/dist/cli-adapter.js +605 -0
- package/dist/cli-adapter.js.map +1 -0
- package/dist/commands/CommandParser.d.ts +27 -0
- package/dist/commands/CommandParser.d.ts.map +1 -0
- package/dist/commands/CommandParser.js +238 -0
- package/dist/commands/CommandParser.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +59 -0
- package/dist/config/ConfigManager.d.ts.map +1 -0
- package/dist/config/ConfigManager.js +332 -0
- package/dist/config/ConfigManager.js.map +1 -0
- package/dist/config/defaultConfig.d.ts +82 -0
- package/dist/config/defaultConfig.d.ts.map +1 -0
- package/dist/config/defaultConfig.js +88 -0
- package/dist/config/defaultConfig.js.map +1 -0
- package/dist/config/manager.d.ts +60 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +162 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/types.d.ts +9 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +6 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index-custom.d.ts +3 -0
- package/dist/index-custom.d.ts.map +1 -0
- package/dist/index-custom.js +65 -0
- package/dist/index-custom.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/system-prompt.d.ts +47 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -0
- package/dist/prompts/system-prompt.js +378 -0
- package/dist/prompts/system-prompt.js.map +1 -0
- package/dist/providers/GoogleProvider.d.ts +26 -0
- package/dist/providers/GoogleProvider.d.ts.map +1 -0
- package/dist/providers/GoogleProvider.js +313 -0
- package/dist/providers/GoogleProvider.js.map +1 -0
- package/dist/providers/Provider.d.ts +114 -0
- package/dist/providers/Provider.d.ts.map +1 -0
- package/dist/providers/Provider.js +44 -0
- package/dist/providers/Provider.js.map +1 -0
- package/dist/services/api-client.d.ts +282 -0
- package/dist/services/api-client.d.ts.map +1 -0
- package/dist/services/api-client.js +339 -0
- package/dist/services/api-client.js.map +1 -0
- package/dist/services/auth-handler.d.ts +30 -0
- package/dist/services/auth-handler.d.ts.map +1 -0
- package/dist/services/auth-handler.js +210 -0
- package/dist/services/auth-handler.js.map +1 -0
- package/dist/services/conversation-manager.d.ts +73 -0
- package/dist/services/conversation-manager.d.ts.map +1 -0
- package/dist/services/conversation-manager.js +128 -0
- package/dist/services/conversation-manager.js.map +1 -0
- package/dist/tests/automated-verification.d.ts +27 -0
- package/dist/tests/automated-verification.d.ts.map +1 -0
- package/dist/tests/automated-verification.js +359 -0
- package/dist/tests/automated-verification.js.map +1 -0
- package/dist/tests/integration-tests.d.ts +50 -0
- package/dist/tests/integration-tests.d.ts.map +1 -0
- package/dist/tests/integration-tests.js +648 -0
- package/dist/tests/integration-tests.js.map +1 -0
- package/dist/tools/ToolRegistry.d.ts +44 -0
- package/dist/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/tools/ToolRegistry.js +494 -0
- package/dist/tools/ToolRegistry.js.map +1 -0
- package/dist/tools/command.d.ts +4 -0
- package/dist/tools/command.d.ts.map +1 -0
- package/dist/tools/command.js +117 -0
- package/dist/tools/command.js.map +1 -0
- package/dist/tools/file-ops-test.d.ts +6 -0
- package/dist/tools/file-ops-test.d.ts.map +1 -0
- package/dist/tools/file-ops-test.js +197 -0
- package/dist/tools/file-ops-test.js.map +1 -0
- package/dist/tools/file-ops.d.ts +6 -0
- package/dist/tools/file-ops.d.ts.map +1 -0
- package/dist/tools/file-ops.js +189 -0
- package/dist/tools/file-ops.js.map +1 -0
- package/dist/tools/plan-mode.d.ts +53 -0
- package/dist/tools/plan-mode.d.ts.map +1 -0
- package/dist/tools/plan-mode.js +202 -0
- package/dist/tools/plan-mode.js.map +1 -0
- package/dist/tools/registry.d.ts +30 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +67 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +34 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/web-search.d.ts +24 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +194 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/DisplayHistory.d.ts +53 -0
- package/dist/ui/DisplayHistory.d.ts.map +1 -0
- package/dist/ui/DisplayHistory.js +82 -0
- package/dist/ui/DisplayHistory.js.map +1 -0
- package/dist/ui/clack-ui.d.ts +83 -0
- package/dist/ui/clack-ui.d.ts.map +1 -0
- package/dist/ui/clack-ui.js +304 -0
- package/dist/ui/clack-ui.js.map +1 -0
- package/dist/ui/components/App.d.ts +47 -0
- package/dist/ui/components/App.d.ts.map +1 -0
- package/dist/ui/components/App.js +389 -0
- package/dist/ui/components/App.js.map +1 -0
- package/dist/ui/components/AuthScreen.d.ts +8 -0
- package/dist/ui/components/AuthScreen.d.ts.map +1 -0
- package/dist/ui/components/AuthScreen.js +37 -0
- package/dist/ui/components/AuthScreen.js.map +1 -0
- package/dist/ui/components/AuthWelcomeScreen.d.ts +8 -0
- package/dist/ui/components/AuthWelcomeScreen.d.ts.map +1 -0
- package/dist/ui/components/AuthWelcomeScreen.js +34 -0
- package/dist/ui/components/AuthWelcomeScreen.js.map +1 -0
- package/dist/ui/components/CodeBlock.d.ts +9 -0
- package/dist/ui/components/CodeBlock.d.ts.map +1 -0
- package/dist/ui/components/CodeBlock.js +22 -0
- package/dist/ui/components/CodeBlock.js.map +1 -0
- package/dist/ui/components/ConfigViewer.d.ts +11 -0
- package/dist/ui/components/ConfigViewer.d.ts.map +1 -0
- package/dist/ui/components/ConfigViewer.js +27 -0
- package/dist/ui/components/ConfigViewer.js.map +1 -0
- package/dist/ui/components/ConfirmPrompt.d.ts +11 -0
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -0
- package/dist/ui/components/ConfirmPrompt.js +55 -0
- package/dist/ui/components/ConfirmPrompt.js.map +1 -0
- package/dist/ui/components/DiffViewer.d.ts +8 -0
- package/dist/ui/components/DiffViewer.d.ts.map +1 -0
- package/dist/ui/components/DiffViewer.js +63 -0
- package/dist/ui/components/DiffViewer.js.map +1 -0
- package/dist/ui/components/DisplayItemRenderer.d.ts +18 -0
- package/dist/ui/components/DisplayItemRenderer.d.ts.map +1 -0
- package/dist/ui/components/DisplayItemRenderer.js +53 -0
- package/dist/ui/components/DisplayItemRenderer.js.map +1 -0
- package/dist/ui/components/DynamicMessage.d.ts +13 -0
- package/dist/ui/components/DynamicMessage.d.ts.map +1 -0
- package/dist/ui/components/DynamicMessage.js +27 -0
- package/dist/ui/components/DynamicMessage.js.map +1 -0
- package/dist/ui/components/ErrorBoundary.d.ts +16 -0
- package/dist/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/ui/components/ErrorBoundary.js +25 -0
- package/dist/ui/components/ErrorBoundary.js.map +1 -0
- package/dist/ui/components/FileOperation.d.ts +10 -0
- package/dist/ui/components/FileOperation.d.ts.map +1 -0
- package/dist/ui/components/FileOperation.js +31 -0
- package/dist/ui/components/FileOperation.js.map +1 -0
- package/dist/ui/components/InputBox.d.ts +12 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -0
- package/dist/ui/components/InputBox.js +50 -0
- package/dist/ui/components/InputBox.js.map +1 -0
- package/dist/ui/components/KeyboardHelp.d.ts +7 -0
- package/dist/ui/components/KeyboardHelp.d.ts.map +1 -0
- package/dist/ui/components/KeyboardHelp.js +25 -0
- package/dist/ui/components/KeyboardHelp.js.map +1 -0
- package/dist/ui/components/LoadingIndicator.d.ts +3 -0
- package/dist/ui/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/ui/components/LoadingIndicator.js +25 -0
- package/dist/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/ui/components/MarkdownRenderer.d.ts +8 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/ui/components/MarkdownRenderer.js +96 -0
- package/dist/ui/components/MarkdownRenderer.js.map +1 -0
- package/dist/ui/components/MessageBox.d.ts +10 -0
- package/dist/ui/components/MessageBox.d.ts.map +1 -0
- package/dist/ui/components/MessageBox.js +50 -0
- package/dist/ui/components/MessageBox.js.map +1 -0
- package/dist/ui/components/MessageDisplay.d.ts +8 -0
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -0
- package/dist/ui/components/MessageDisplay.js +43 -0
- package/dist/ui/components/MessageDisplay.js.map +1 -0
- package/dist/ui/components/ScrollableContent.d.ts +7 -0
- package/dist/ui/components/ScrollableContent.d.ts.map +1 -0
- package/dist/ui/components/ScrollableContent.js +6 -0
- package/dist/ui/components/ScrollableContent.js.map +1 -0
- package/dist/ui/components/ScrollableMessageList.d.ts +10 -0
- package/dist/ui/components/ScrollableMessageList.d.ts.map +1 -0
- package/dist/ui/components/ScrollableMessageList.js +133 -0
- package/dist/ui/components/ScrollableMessageList.js.map +1 -0
- package/dist/ui/components/ScrollableScreen.d.ts +9 -0
- package/dist/ui/components/ScrollableScreen.d.ts.map +1 -0
- package/dist/ui/components/ScrollableScreen.js +22 -0
- package/dist/ui/components/ScrollableScreen.js.map +1 -0
- package/dist/ui/components/SelectPrompt.d.ts +12 -0
- package/dist/ui/components/SelectPrompt.d.ts.map +1 -0
- package/dist/ui/components/SelectPrompt.js +10 -0
- package/dist/ui/components/SelectPrompt.js.map +1 -0
- package/dist/ui/components/StaticMessageHistory.d.ts +14 -0
- package/dist/ui/components/StaticMessageHistory.d.ts.map +1 -0
- package/dist/ui/components/StaticMessageHistory.js +19 -0
- package/dist/ui/components/StaticMessageHistory.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +10 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +20 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/StreamingMessageDisplay.d.ts +13 -0
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -0
- package/dist/ui/components/StreamingMessageDisplay.js +26 -0
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -0
- package/dist/ui/components/ToolExecutionMessage.d.ts +8 -0
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -0
- package/dist/ui/components/ToolExecutionMessage.js +189 -0
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -0
- package/dist/ui/components/ToolExecutionStatus.d.ts +10 -0
- package/dist/ui/components/ToolExecutionStatus.d.ts.map +1 -0
- package/dist/ui/components/ToolExecutionStatus.js +65 -0
- package/dist/ui/components/ToolExecutionStatus.js.map +1 -0
- package/dist/ui/components/ToolResult.d.ts +10 -0
- package/dist/ui/components/ToolResult.d.ts.map +1 -0
- package/dist/ui/components/ToolResult.js +17 -0
- package/dist/ui/components/ToolResult.js.map +1 -0
- package/dist/ui/components/WelcomeBanner.d.ts +3 -0
- package/dist/ui/components/WelcomeBanner.d.ts.map +1 -0
- package/dist/ui/components/WelcomeBanner.js +28 -0
- package/dist/ui/components/WelcomeBanner.js.map +1 -0
- package/dist/ui/components/code-block.d.ts +10 -0
- package/dist/ui/components/code-block.d.ts.map +1 -0
- package/dist/ui/components/code-block.js +74 -0
- package/dist/ui/components/code-block.js.map +1 -0
- package/dist/ui/components/confirm-prompt.d.ts +12 -0
- package/dist/ui/components/confirm-prompt.d.ts.map +1 -0
- package/dist/ui/components/confirm-prompt.js +104 -0
- package/dist/ui/components/confirm-prompt.js.map +1 -0
- package/dist/ui/components/diff-viewer.d.ts +9 -0
- package/dist/ui/components/diff-viewer.d.ts.map +1 -0
- package/dist/ui/components/diff-viewer.js +57 -0
- package/dist/ui/components/diff-viewer.js.map +1 -0
- package/dist/ui/components/input-box.d.ts +18 -0
- package/dist/ui/components/input-box.d.ts.map +1 -0
- package/dist/ui/components/input-box.js +157 -0
- package/dist/ui/components/input-box.js.map +1 -0
- package/dist/ui/components/keyboard-help.d.ts +7 -0
- package/dist/ui/components/keyboard-help.d.ts.map +1 -0
- package/dist/ui/components/keyboard-help.js +43 -0
- package/dist/ui/components/keyboard-help.js.map +1 -0
- package/dist/ui/components/loading-indicator.d.ts +3 -0
- package/dist/ui/components/loading-indicator.d.ts.map +1 -0
- package/dist/ui/components/loading-indicator.js +42 -0
- package/dist/ui/components/loading-indicator.js.map +1 -0
- package/dist/ui/components/message-display.d.ts +7 -0
- package/dist/ui/components/message-display.d.ts.map +1 -0
- package/dist/ui/components/message-display.js +104 -0
- package/dist/ui/components/message-display.js.map +1 -0
- package/dist/ui/components/misc.d.ts +28 -0
- package/dist/ui/components/misc.d.ts.map +1 -0
- package/dist/ui/components/misc.js +128 -0
- package/dist/ui/components/misc.js.map +1 -0
- package/dist/ui/components/select-prompt.d.ts +13 -0
- package/dist/ui/components/select-prompt.d.ts.map +1 -0
- package/dist/ui/components/select-prompt.js +42 -0
- package/dist/ui/components/select-prompt.js.map +1 -0
- package/dist/ui/components/status-bar.d.ts +11 -0
- package/dist/ui/components/status-bar.d.ts.map +1 -0
- package/dist/ui/components/status-bar.js +47 -0
- package/dist/ui/components/status-bar.js.map +1 -0
- package/dist/ui/components/tool-execution.d.ts +3 -0
- package/dist/ui/components/tool-execution.d.ts.map +1 -0
- package/dist/ui/components/tool-execution.js +374 -0
- package/dist/ui/components/tool-execution.js.map +1 -0
- package/dist/ui/components/tool-result.d.ts +11 -0
- package/dist/ui/components/tool-result.d.ts.map +1 -0
- package/dist/ui/components/tool-result.js +58 -0
- package/dist/ui/components/tool-result.js.map +1 -0
- package/dist/ui/components/welcome-banner.d.ts +3 -0
- package/dist/ui/components/welcome-banner.d.ts.map +1 -0
- package/dist/ui/components/welcome-banner.js +46 -0
- package/dist/ui/components/welcome-banner.js.map +1 -0
- package/dist/ui/hooks/useDisplayHistory.d.ts +13 -0
- package/dist/ui/hooks/useDisplayHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useDisplayHistory.js +45 -0
- package/dist/ui/hooks/useDisplayHistory.js.map +1 -0
- package/dist/ui/render-engine.d.ts +69 -0
- package/dist/ui/render-engine.d.ts.map +1 -0
- package/dist/ui/render-engine.js +197 -0
- package/dist/ui/render-engine.js.map +1 -0
- package/dist/ui/terminal/TerminalRenderer.d.ts +84 -0
- package/dist/ui/terminal/TerminalRenderer.d.ts.map +1 -0
- package/dist/ui/terminal/TerminalRenderer.js +154 -0
- package/dist/ui/terminal/TerminalRenderer.js.map +1 -0
- package/dist/ui/terminal/TerminalUI.d.ts +139 -0
- package/dist/ui/terminal/TerminalUI.d.ts.map +1 -0
- package/dist/ui/terminal/TerminalUI.js +430 -0
- package/dist/ui/terminal/TerminalUI.js.map +1 -0
- package/dist/ui/terminal/VirtualChatBuffer.d.ts +32 -0
- package/dist/ui/terminal/VirtualChatBuffer.d.ts.map +1 -0
- package/dist/ui/terminal/VirtualChatBuffer.js +37 -0
- package/dist/ui/terminal/VirtualChatBuffer.js.map +1 -0
- package/dist/ui/terminal-kit-base.d.ts +117 -0
- package/dist/ui/terminal-kit-base.d.ts.map +1 -0
- package/dist/ui/terminal-kit-base.js +188 -0
- package/dist/ui/terminal-kit-base.js.map +1 -0
- package/dist/utils/file.d.ts +21 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +68 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-parser.d.ts +56 -0
- package/dist/utils/markdown-parser.d.ts.map +1 -0
- package/dist/utils/markdown-parser.js +307 -0
- package/dist/utils/markdown-parser.js.map +1 -0
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +62 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/state.d.ts +13 -0
- package/dist/utils/state.d.ts.map +1 -0
- package/dist/utils/state.js +25 -0
- package/dist/utils/state.js.map +1 -0
- package/package.json +81 -0
- package/postinstall.js +46 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { term, ensureScreenBuffer, createColorAttr, colors, drawBox, render } from '../terminal-kit-base.js';
|
|
2
|
+
// Render the prompt (static parts)
|
|
3
|
+
export function renderConfirmPrompt(options, selected = 'yes') {
|
|
4
|
+
const { x, y, width, message, showFeedbackOption = false } = options;
|
|
5
|
+
const height = 6; // Border + empty + message + empty + options + border
|
|
6
|
+
// Draw rounded border with orange color
|
|
7
|
+
drawBox({
|
|
8
|
+
x,
|
|
9
|
+
y,
|
|
10
|
+
width,
|
|
11
|
+
height,
|
|
12
|
+
borderStyle: 'rounded',
|
|
13
|
+
borderColor: colors.warning, // #ffaa00 (Orange)
|
|
14
|
+
});
|
|
15
|
+
let currentY = y + 1;
|
|
16
|
+
// Empty line
|
|
17
|
+
currentY++;
|
|
18
|
+
// Message with warning icon
|
|
19
|
+
const buffer = ensureScreenBuffer();
|
|
20
|
+
const messageAttr = createColorAttr(colors.warning, true); // Orange, bold
|
|
21
|
+
const messageText = `⚠️ ${message}`;
|
|
22
|
+
buffer.put({ x: x + 2, y: currentY, attr: messageAttr }, messageText);
|
|
23
|
+
currentY += 2; // Message + empty line
|
|
24
|
+
// Options row
|
|
25
|
+
let optionsX = x + 2;
|
|
26
|
+
// Yes option
|
|
27
|
+
const yesSelected = selected === 'yes';
|
|
28
|
+
const yesAttr = createColorAttr(yesSelected ? colors.success : colors.dimmed, yesSelected);
|
|
29
|
+
const yesPrefix = yesSelected ? '▶ ' : ' ';
|
|
30
|
+
buffer.put({ x: optionsX, y: currentY, attr: yesAttr }, yesPrefix + '[Y]es');
|
|
31
|
+
optionsX += (yesPrefix + '[Y]es').length + 4; // Add spacing
|
|
32
|
+
// No option
|
|
33
|
+
const noSelected = selected === 'no';
|
|
34
|
+
const noAttr = createColorAttr(noSelected ? colors.error : colors.dimmed, noSelected);
|
|
35
|
+
const noPrefix = noSelected ? '▶ ' : ' ';
|
|
36
|
+
buffer.put({ x: optionsX, y: currentY, attr: noAttr }, noPrefix + '[N]o');
|
|
37
|
+
optionsX += (noPrefix + '[N]o').length + 4;
|
|
38
|
+
// Feedback option (if enabled)
|
|
39
|
+
if (showFeedbackOption) {
|
|
40
|
+
const feedbackSelected = selected === 'feedback';
|
|
41
|
+
const feedbackAttr = createColorAttr(feedbackSelected ? colors.primary : colors.dimmed, feedbackSelected);
|
|
42
|
+
const feedbackPrefix = feedbackSelected ? '▶ ' : ' ';
|
|
43
|
+
buffer.put({ x: optionsX, y: currentY, attr: feedbackAttr }, feedbackPrefix + '[F]eedback');
|
|
44
|
+
}
|
|
45
|
+
// Return height + bottom margin
|
|
46
|
+
return height + 1;
|
|
47
|
+
}
|
|
48
|
+
// Wait for user input and return selected option
|
|
49
|
+
export async function waitForConfirmation(options) {
|
|
50
|
+
let selected = 'yes';
|
|
51
|
+
const showFeedback = options.showFeedbackOption || false;
|
|
52
|
+
const validOptions = showFeedback
|
|
53
|
+
? ['yes', 'no', 'feedback']
|
|
54
|
+
: ['yes', 'no'];
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
// Render initial state
|
|
57
|
+
renderConfirmPrompt(options, selected);
|
|
58
|
+
render(); // Actually draw to screen!
|
|
59
|
+
// Listen for key events
|
|
60
|
+
const cleanup = term.on('key', (name) => {
|
|
61
|
+
// Handle arrow keys for navigation
|
|
62
|
+
if (name === 'LEFT' || name === 'RIGHT') {
|
|
63
|
+
const currentIdx = validOptions.indexOf(selected);
|
|
64
|
+
const nextIdx = name === 'LEFT'
|
|
65
|
+
? (currentIdx - 1 + validOptions.length) % validOptions.length
|
|
66
|
+
: (currentIdx + 1) % validOptions.length;
|
|
67
|
+
selected = validOptions[nextIdx];
|
|
68
|
+
// Re-render with new selection
|
|
69
|
+
renderConfirmPrompt(options, selected);
|
|
70
|
+
render(); // Actually draw to screen!
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// Handle direct key presses
|
|
74
|
+
if (name === 'y' || name === 'Y') {
|
|
75
|
+
cleanup();
|
|
76
|
+
resolve('yes');
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (name === 'n' || name === 'N') {
|
|
80
|
+
cleanup();
|
|
81
|
+
resolve('no');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (showFeedback && (name === 'f' || name === 'F')) {
|
|
85
|
+
cleanup();
|
|
86
|
+
resolve('feedback');
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// Handle Enter to confirm current selection
|
|
90
|
+
if (name === 'ENTER') {
|
|
91
|
+
cleanup();
|
|
92
|
+
resolve(selected);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Handle Ctrl+C to exit
|
|
96
|
+
if (name === 'CTRL_C') {
|
|
97
|
+
cleanup();
|
|
98
|
+
process.exit(0);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=confirm-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-prompt.js","sourceRoot":"","sources":["../../../src/ui/components/confirm-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAY7G,mCAAmC;AACnC,MAAM,UAAU,mBAAmB,CACjC,OAA6B,EAC7B,WAAyB,KAAK;IAE9B,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAErE,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,sDAAsD;IAExE,wCAAwC;IACxC,OAAO,CAAC;QACN,CAAC;QACD,CAAC;QACD,KAAK;QACL,MAAM;QACN,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,mBAAmB;KACjD,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;IAErB,aAAa;IACb,QAAQ,EAAE,CAAC;IAEX,4BAA4B;IAC5B,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe;IAC1E,MAAM,WAAW,GAAG,OAAO,OAAO,EAAE,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,CAAC,CAAC;IAEtE,QAAQ,IAAI,CAAC,CAAC,CAAC,uBAAuB;IAEtC,cAAc;IACd,IAAI,QAAQ,GAAG,CA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names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAgBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAiDnE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { screenBuffer, createColorAttr, colors, drawBox, truncate } from '../terminal-kit-base.js';
|
|
2
|
+
// Get line color based on diff prefix
|
|
3
|
+
function getLineColor(line) {
|
|
4
|
+
if (line.startsWith('+')) {
|
|
5
|
+
return colors.success; // #00cc66 (Green)
|
|
6
|
+
}
|
|
7
|
+
else if (line.startsWith('-')) {
|
|
8
|
+
return colors.error; // #ff3366 (Red)
|
|
9
|
+
}
|
|
10
|
+
else if (line.startsWith('@@')) {
|
|
11
|
+
return colors.primary; // #00ccff (Cyan)
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return colors.text; // #ffffff (White)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Render diff viewer with colored lines
|
|
18
|
+
export function renderDiffViewer(options) {
|
|
19
|
+
const { x, y, width, diff, filePath } = options;
|
|
20
|
+
const lines = diff.split('\n');
|
|
21
|
+
// Calculate height
|
|
22
|
+
const height = 3 + lines.length; // Border + header + lines + border
|
|
23
|
+
// Draw rounded border with orange color
|
|
24
|
+
drawBox({
|
|
25
|
+
x,
|
|
26
|
+
y,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
borderStyle: 'rounded',
|
|
30
|
+
borderColor: colors.warning, // #ffaa00 (Orange)
|
|
31
|
+
});
|
|
32
|
+
let currentY = y + 1;
|
|
33
|
+
// Header: "Changes to: {filePath}"
|
|
34
|
+
const headerLabelAttr = createColorAttr(colors.warning, true); // Orange, bold
|
|
35
|
+
const filePathAttr = createColorAttr(colors.text); // White
|
|
36
|
+
const headerLabel = 'Changes to: ';
|
|
37
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: headerLabelAttr }, headerLabel);
|
|
38
|
+
screenBuffer.put({
|
|
39
|
+
x: x + 2 + headerLabel.length,
|
|
40
|
+
y: currentY,
|
|
41
|
+
attr: filePathAttr
|
|
42
|
+
}, truncate(filePath, width - headerLabel.length - 6));
|
|
43
|
+
currentY += 2; // Header + empty line
|
|
44
|
+
// Render diff lines with appropriate colors
|
|
45
|
+
for (const line of lines) {
|
|
46
|
+
const lineColor = getLineColor(line);
|
|
47
|
+
const lineAttr = createColorAttr(lineColor);
|
|
48
|
+
// Truncate line if too long
|
|
49
|
+
const maxLineWidth = width - 4; // Account for borders and padding
|
|
50
|
+
const truncatedLine = truncate(line, maxLineWidth);
|
|
51
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: lineAttr }, truncatedLine);
|
|
52
|
+
currentY++;
|
|
53
|
+
}
|
|
54
|
+
// Return total height + bottom margin
|
|
55
|
+
return height + 1;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=diff-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-viewer.js","sourceRoot":"","sources":["../../../src/ui/components/diff-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAUnG,sCAAsC;AACtC,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,kBAAkB;IAC3C,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,gBAAgB;IACvC,CAAC;SAAM,IAAI,IAAI,CAAC,U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,CAAC,QAAQ,EAAE,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAEvD,QAAQ,IAAI,CAAC,CAAC,CAAC,sBAAsB;IAErC,4CAA4C;IAC5C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAE5C,4BAA4B;QAC5B,MAAM,YAAY,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,kCAAkC;QAClE,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEnD,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;QAC3E,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,sCAAsC;IACtC,OAAO,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface InputBoxOptions {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
model: string;
|
|
6
|
+
autoAcceptMode: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface InputBoxCallbacks {
|
|
10
|
+
onSubmit: (value: string) => void;
|
|
11
|
+
onToggleAutoAccept: () => void;
|
|
12
|
+
onExit: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function renderInputBox(options: InputBoxOptions): void;
|
|
15
|
+
export declare function getInput(x: number, y: number, width: number, placeholder: string, callbacks: InputBoxCallbacks): Promise<string>;
|
|
16
|
+
export declare function clearInputField(x: number, y: number, width: number): void;
|
|
17
|
+
export declare function showPlaceholder(x: number, y: number, width: number, placeholder: string): void;
|
|
18
|
+
//# sourceMappingURL=input-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-box.d.ts","sourceRoot":"","sources":["../../../src/ui/components/input-box.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAGD,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,QA8EtD;AAGD,wBAAsB,QAAQ,CAC5B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAyEjB;AAGD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QASlE;AAGD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAYvF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { term, ensureScreenBuffer, createColorAttr, colors, drawBox } from '../terminal-kit-base.js';
|
|
2
|
+
// Render the input box (static parts - border, labels)
|
|
3
|
+
export function renderInputBox(options) {
|
|
4
|
+
const { x, y, width, model, autoAcceptMode, placeholder = 'Ask anything...' } = options;
|
|
5
|
+
// Box height is fixed at 8 lines:
|
|
6
|
+
// 1: top border
|
|
7
|
+
// 2: empty line
|
|
8
|
+
// 3: header (Your Message: ... Model: X [AUTO-ACCEPT])
|
|
9
|
+
// 4: empty line
|
|
10
|
+
// 5: input line (> placeholder/text)
|
|
11
|
+
// 6: empty line
|
|
12
|
+
// 7: help text (Ctrl+T... • Ctrl+C...)
|
|
13
|
+
// 8: bottom border
|
|
14
|
+
const height = 8;
|
|
15
|
+
// Draw rounded border with dark blue color
|
|
16
|
+
drawBox({
|
|
17
|
+
x,
|
|
18
|
+
y,
|
|
19
|
+
width,
|
|
20
|
+
height,
|
|
21
|
+
borderStyle: 'rounded',
|
|
22
|
+
borderColor: colors.border, // #003b59
|
|
23
|
+
});
|
|
24
|
+
// Line 3: Header
|
|
25
|
+
const headerY = y + 2;
|
|
26
|
+
const buffer = ensureScreenBuffer();
|
|
27
|
+
// Left side: "Your Message:"
|
|
28
|
+
const headerLeftAttr = createColorAttr(colors.primary, true); // Cyan, bold
|
|
29
|
+
buffer.put({ x: x + 2, y: headerY, attr: headerLeftAttr }, 'Your Message:');
|
|
30
|
+
// Right side: Model info and auto-accept status
|
|
31
|
+
const modelLabelAttr = createColorAttr(colors.dimmed); // Gray
|
|
32
|
+
const modelValueAttr = createColorAttr(colors.primary); // Cyan
|
|
33
|
+
let rightSideText = `Model: `;
|
|
34
|
+
let rightSideX = x + width - 2; // Start from right edge
|
|
35
|
+
// Auto-accept status
|
|
36
|
+
let autoAcceptText;
|
|
37
|
+
let autoAcceptAttr;
|
|
38
|
+
if (autoAcceptMode) {
|
|
39
|
+
autoAcceptText = '[AUTO-ACCEPT: ON]';
|
|
40
|
+
autoAcceptAttr = createColorAttr(colors.success, true); // Green, bold
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
autoAcceptText = '[AUTO-ACCEPT: OFF]';
|
|
44
|
+
autoAcceptAttr = createColorAttr(colors.dimmed, false, true); // Gray, dimmed
|
|
45
|
+
}
|
|
46
|
+
// Calculate positions (right-aligned)
|
|
47
|
+
const totalRightLength = `Model: ${model} ${autoAcceptText}`.length;
|
|
48
|
+
rightSideX = x + width - totalRightLength - 2;
|
|
49
|
+
// Render right side
|
|
50
|
+
buffer.put({ x: rightSideX, y: headerY, attr: modelLabelAttr }, 'Model: ');
|
|
51
|
+
buffer.put({
|
|
52
|
+
x: rightSideX + 'Model: '.length,
|
|
53
|
+
y: headerY,
|
|
54
|
+
attr: modelValueAttr
|
|
55
|
+
}, model);
|
|
56
|
+
buffer.put({
|
|
57
|
+
x: rightSideX + `Model: ${model} `.length,
|
|
58
|
+
y: headerY,
|
|
59
|
+
attr: autoAcceptAttr
|
|
60
|
+
}, autoAcceptText);
|
|
61
|
+
// Line 5: Input prompt prefix "> "
|
|
62
|
+
const inputY = y + 4;
|
|
63
|
+
const promptAttr = createColorAttr(colors.dimmed); // Gray
|
|
64
|
+
buffer.put({ x: x + 2, y: inputY, attr: promptAttr }, '> ');
|
|
65
|
+
// Line 7: Help text
|
|
66
|
+
const helpY = y + 6;
|
|
67
|
+
const helpAttr = createColorAttr(colors.dimmed, false, true); // Gray, dimmed
|
|
68
|
+
const helpText = 'Ctrl+T to toggle auto-accept • Ctrl+C to exit';
|
|
69
|
+
buffer.put({ x: x + 2, y: helpY, attr: helpAttr }, helpText);
|
|
70
|
+
}
|
|
71
|
+
// Get input from user with simple line input
|
|
72
|
+
export async function getInput(x, y, width, placeholder, callbacks) {
|
|
73
|
+
// Calculate input field position
|
|
74
|
+
// Inside box at line 5, after "> " prompt
|
|
75
|
+
const inputX = x + 4; // x + 2 (padding) + 2 ("> " prompt)
|
|
76
|
+
const inputY = y + 4;
|
|
77
|
+
const inputWidth = width - 8; // Subtract padding and prompt
|
|
78
|
+
return new Promise((resolve) => {
|
|
79
|
+
let currentInput = '';
|
|
80
|
+
let hasSubmitted = false;
|
|
81
|
+
// Position cursor at input start
|
|
82
|
+
term.moveTo(inputX, inputY);
|
|
83
|
+
// Show cursor
|
|
84
|
+
term.hideCursor(false);
|
|
85
|
+
// Handle key events
|
|
86
|
+
const keyHandler = (name, matches, data) => {
|
|
87
|
+
if (hasSubmitted)
|
|
88
|
+
return;
|
|
89
|
+
// Handle Ctrl+C - Exit
|
|
90
|
+
if (name === 'CTRL_C') {
|
|
91
|
+
term.removeListener('key', keyHandler);
|
|
92
|
+
callbacks.onExit();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Handle Ctrl+T - Toggle auto-accept
|
|
96
|
+
if (name === 'CTRL_T') {
|
|
97
|
+
callbacks.onToggleAutoAccept();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Handle Enter - Submit
|
|
101
|
+
if (name === 'ENTER') {
|
|
102
|
+
hasSubmitted = true;
|
|
103
|
+
term.removeListener('key', keyHandler);
|
|
104
|
+
// Clear the input line before resolving
|
|
105
|
+
term.moveTo(inputX, inputY);
|
|
106
|
+
term.eraseLine();
|
|
107
|
+
resolve(currentInput.trim());
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
// Handle Backspace
|
|
111
|
+
if (name === 'BACKSPACE') {
|
|
112
|
+
if (currentInput.length > 0) {
|
|
113
|
+
currentInput = currentInput.slice(0, -1);
|
|
114
|
+
// Clear the line and rewrite
|
|
115
|
+
term.moveTo(inputX, inputY);
|
|
116
|
+
term.eraseLine();
|
|
117
|
+
term(currentInput);
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Handle regular character input
|
|
122
|
+
// Check if it's a character (terminal-kit provides isCharacter flag)
|
|
123
|
+
if (data && data.isCharacter && data.codepoint) {
|
|
124
|
+
if (currentInput.length < inputWidth) {
|
|
125
|
+
const char = String.fromCharCode(data.codepoint);
|
|
126
|
+
currentInput += char;
|
|
127
|
+
term(char);
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
term.on('key', keyHandler);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// Clear input field
|
|
136
|
+
export function clearInputField(x, y, width) {
|
|
137
|
+
const inputY = y + 4;
|
|
138
|
+
const inputX = x + 4; // After "> " prompt
|
|
139
|
+
const inputWidth = width - 8;
|
|
140
|
+
// Clear the input area with spaces
|
|
141
|
+
const clearAttr = createColorAttr(colors.text);
|
|
142
|
+
const buffer = ensureScreenBuffer();
|
|
143
|
+
buffer.put({ x: inputX, y: inputY, attr: clearAttr }, ' '.repeat(inputWidth));
|
|
144
|
+
}
|
|
145
|
+
// Show placeholder text
|
|
146
|
+
export function showPlaceholder(x, y, width, placeholder) {
|
|
147
|
+
const inputY = y + 4;
|
|
148
|
+
const inputX = x + 4; // After "> " prompt
|
|
149
|
+
const inputWidth = width - 8;
|
|
150
|
+
const placeholderAttr = createColorAttr(colors.dimmed, false, true); // Gray, dimmed
|
|
151
|
+
const truncatedPlaceholder = placeholder.length > inputWidth
|
|
152
|
+
? placeholder.slice(0, inputWidth - 3) + '...'
|
|
153
|
+
: placeholder;
|
|
154
|
+
const buffer = ensureScreenBuffer();
|
|
155
|
+
buffer.put({ x: inputX, y: inputY, attr: placeholderAttr }, truncatedPlaceholder);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=input-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-box.js","sourceRoot":"","sources":["../../../src/ui/components/input-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAO,MAAM,yBAAyB,CAAC;AAiB1G,uDAAuD;AACvD,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,GAAG,iBAAiB,EAAE,GAAG,OAAO,CAAC;IAExF,kCAAkC;IAClC,gBAAgB;IAChB,gBAAgB;IAChB,uDAAuD;IACvD,gBAAgB;IAChB,qCAAqC;IACrC,gBAAgB;IAChB,u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CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA0CvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { screenBuffer, createColorAttr, colors, drawBox, pad } from '../terminal-kit-base.js';
|
|
2
|
+
// Keyboard shortcuts from UI_ELEMENTS_REFERENCE.md
|
|
3
|
+
const SHORTCUTS = [
|
|
4
|
+
{ key: 'Enter', action: 'Submit message' },
|
|
5
|
+
{ key: 'Ctrl+T', action: 'Toggle auto-accept mode' },
|
|
6
|
+
{ key: 'Ctrl+C', action: 'Exit application' },
|
|
7
|
+
{ key: '/', action: 'Start slash command' },
|
|
8
|
+
{ key: '?', action: 'Show/hide this help' },
|
|
9
|
+
];
|
|
10
|
+
// Render keyboard help overlay
|
|
11
|
+
export function renderKeyboardHelp(options) {
|
|
12
|
+
const { x, y, width } = options;
|
|
13
|
+
const height = 4 + SHORTCUTS.length + 2; // Border + header + shortcuts + footer + border
|
|
14
|
+
// Draw double-line border with cyan color
|
|
15
|
+
drawBox({
|
|
16
|
+
x,
|
|
17
|
+
y,
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
borderStyle: 'double',
|
|
21
|
+
borderColor: colors.primary, // #00ccff (Cyan)
|
|
22
|
+
});
|
|
23
|
+
let currentY = y + 1;
|
|
24
|
+
// Header: "Keyboard Shortcuts"
|
|
25
|
+
const headerAttr = createColorAttr(colors.primary, true); // Cyan, bold
|
|
26
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: headerAttr }, 'Keyboard Shortcuts');
|
|
27
|
+
currentY += 2; // Header + empty line
|
|
28
|
+
// Shortcuts list
|
|
29
|
+
const keyAttr = createColorAttr(colors.success, true); // Green, bold
|
|
30
|
+
const actionAttr = createColorAttr(colors.text); // White
|
|
31
|
+
for (const shortcut of SHORTCUTS) {
|
|
32
|
+
const paddedKey = pad(shortcut.key, 15, ' ', 'left'); // Pad to 15 chars
|
|
33
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: keyAttr }, paddedKey);
|
|
34
|
+
screenBuffer.put({ x: x + 2 + 15, y: currentY, attr: actionAttr }, shortcut.action);
|
|
35
|
+
currentY += 2; // Shortcut + margin
|
|
36
|
+
}
|
|
37
|
+
// Footer: "Press ? or ESC to close"
|
|
38
|
+
const footerAttr = createColorAttr(colors.dimmed, false, true); // Dimmed
|
|
39
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: footerAttr }, 'Press ? or ESC to close');
|
|
40
|
+
// Return height + bottom margin
|
|
41
|
+
return height + 1;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=keyboard-help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-help.js","sourceRoot":"","sources":["../../../src/ui/components/keyboard-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9F,mDAAmD;AACnD,MAAM,SAAS,GAAG;IAChB,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC1C,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,yBAAyB,EAAE;IACpD,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC7C,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,qBAAqB,EAAE;IAC3C,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,qBAAqB,EAAE;CAC5C,CAAC;AAQF,+BAA+B;AAC/B,MAAM,UAAU,kBAAkB,CAAC,OAA4B;IAC7D,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEhC,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,C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AAC,CAAC,CAAC,oBAAoB;IACrC,CAAC;IAED,oCAAoC;IACpC,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;IACzE,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,yBAAyB,CAAC,CAAC;IAEzF,gCAAgC;IAChC,OAAO,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-indicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/loading-indicator.ts"],"names":[],"mappings":"AA4BA,wBAAgB,mBAAmB,SAElC;AAKD,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAanE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ensureScreenBuffer, createColorAttr, colors } from '../terminal-kit-base.js';
|
|
2
|
+
// Loading messages from UI_ELEMENTS_REFERENCE.md (exact)
|
|
3
|
+
const LOADING_MESSAGES = [
|
|
4
|
+
'Thrusting',
|
|
5
|
+
'Propelling',
|
|
6
|
+
'Boosting',
|
|
7
|
+
'Launching',
|
|
8
|
+
'Intercepting',
|
|
9
|
+
'Slingshotting',
|
|
10
|
+
'Accelerating',
|
|
11
|
+
'Cruising',
|
|
12
|
+
'Warping',
|
|
13
|
+
'Docking',
|
|
14
|
+
];
|
|
15
|
+
let selectedMessage = null;
|
|
16
|
+
// Select a random message (only once per loading session)
|
|
17
|
+
function getRandomMessage() {
|
|
18
|
+
if (!selectedMessage) {
|
|
19
|
+
const index = Math.floor(Math.random() * LOADING_MESSAGES.length);
|
|
20
|
+
selectedMessage = LOADING_MESSAGES[index];
|
|
21
|
+
}
|
|
22
|
+
return selectedMessage;
|
|
23
|
+
}
|
|
24
|
+
// Reset the selected message (call when loading is done)
|
|
25
|
+
export function resetLoadingMessage() {
|
|
26
|
+
selectedMessage = null;
|
|
27
|
+
}
|
|
28
|
+
// Render loading indicator
|
|
29
|
+
// Format: ⏳ {RandomLoadingMessage}...
|
|
30
|
+
// Returns height (1 line + bottom margin)
|
|
31
|
+
export function renderLoadingIndicator(x, y) {
|
|
32
|
+
const message = getRandomMessage();
|
|
33
|
+
const text = `⏳ ${message}...`;
|
|
34
|
+
// Cyan, bold
|
|
35
|
+
const attr = createColorAttr(colors.primary, true);
|
|
36
|
+
// Padding left: 1 space
|
|
37
|
+
const buffer = ensureScreenBuffer();
|
|
38
|
+
buffer.put({ x: x + 1, y, attr }, text);
|
|
39
|
+
// Return height: 1 line + bottom margin (1 line) = 2
|
|
40
|
+
return 2;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=loading-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-indicator.js","sourceRoot":"","sources":["../../../src/ui/components/loading-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtF,yDAAyD;AACzD,MAAM,gBAAgB,GAAG;IACvB,WAAW;IACX,YAAY;IACZ,UAAU;IACV,WAAW;IACX,cAAc;IACd,eAAe;IACf,cAAc;IACd,UAAU;IACV,SAAS;IACT,SAAS;CACV,CAAC;AAEF,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,0DAA0D;AAC1D,SAAS,gBAAgB;IACvB,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClE,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,mBAAmB;IACjC,eAAe,GAAG,IAAI,CAAC;AACzB,CAAC;AAED,2BAA2B;AAC3B,sCAAsC;AACtC,0CAA0C;AAC1C,MAAM,UAAU,sBAAsB,CAAC,CAAS,EAAE,CAAS;IACzD,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,KAAK,OAAO,KAAK,CAAC;IAE/B,aAAa;IACb,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEnD,wBAAwB;IACxB,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;IAExC,qDAAqD;IACrD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Message } from '../../types/index.js';
|
|
2
|
+
export declare function renderMessage(message: Message, x: number, y: number, maxWidth: number): number;
|
|
3
|
+
export declare function renderMessages(messages: Message[], x: number, startY: number, maxWidth: number, maxHeight: number): {
|
|
4
|
+
endY: number;
|
|
5
|
+
renderedCount: number;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=message-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-display.d.ts","sourceRoot":"","sources":["../../../src/ui/components/message-display.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAiD/C,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+C9F;AAGD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,OAAO,EAAE,EACnB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAqBzC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ensureScreenBuffer, createColorAttr, colors, wrapText } from '../terminal-kit-base.js';
|
|
2
|
+
// Role color mapping (from UI_ELEMENTS_REFERENCE.md)
|
|
3
|
+
function getRoleColor(role) {
|
|
4
|
+
switch (role) {
|
|
5
|
+
case 'user':
|
|
6
|
+
return colors.primary; // #00ccff (Cyan)
|
|
7
|
+
case 'assistant':
|
|
8
|
+
return colors.success; // #00cc66 (Green)
|
|
9
|
+
case 'system':
|
|
10
|
+
return colors.warning; // #ffaa00 (Orange)
|
|
11
|
+
case 'tool':
|
|
12
|
+
return colors.primary; // #00ccff (Cyan)
|
|
13
|
+
default:
|
|
14
|
+
return colors.text; // #ffffff (White)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Role label mapping
|
|
18
|
+
function getRoleLabel(role) {
|
|
19
|
+
switch (role) {
|
|
20
|
+
case 'user':
|
|
21
|
+
return 'You';
|
|
22
|
+
case 'assistant':
|
|
23
|
+
return 'Centaurus';
|
|
24
|
+
case 'system':
|
|
25
|
+
return 'System';
|
|
26
|
+
case 'tool':
|
|
27
|
+
return 'Tool';
|
|
28
|
+
default:
|
|
29
|
+
return role;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Format timestamp: HH:MM:SS AM/PM (e.g., "10:43:31 am")
|
|
33
|
+
function formatTimestamp(timestamp) {
|
|
34
|
+
if (!timestamp)
|
|
35
|
+
return '';
|
|
36
|
+
const date = new Date(timestamp);
|
|
37
|
+
return date.toLocaleTimeString('en-US', {
|
|
38
|
+
hour: '2-digit',
|
|
39
|
+
minute: '2-digit',
|
|
40
|
+
second: '2-digit',
|
|
41
|
+
hour12: true,
|
|
42
|
+
}).toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
// Render a single message
|
|
45
|
+
// Returns the number of lines rendered
|
|
46
|
+
export function renderMessage(message, x, y, maxWidth) {
|
|
47
|
+
let currentY = y;
|
|
48
|
+
// Format: {RoleLabel}: {timestamp}
|
|
49
|
+
const roleLabel = getRoleLabel(message.role);
|
|
50
|
+
const timestamp = formatTimestamp(message.timestamp);
|
|
51
|
+
const roleColor = getRoleColor(message.role);
|
|
52
|
+
const roleAttr = createColorAttr(roleColor, true); // Bold
|
|
53
|
+
const timestampAttr = createColorAttr(colors.dimmed, false, true); // Dimmed
|
|
54
|
+
// Render role and timestamp
|
|
55
|
+
let headerText = `${roleLabel}:`;
|
|
56
|
+
if (timestamp) {
|
|
57
|
+
headerText += ` ${timestamp}`;
|
|
58
|
+
}
|
|
59
|
+
// Split header into role (colored, bold) and timestamp (dimmed)
|
|
60
|
+
const buffer = ensureScreenBuffer();
|
|
61
|
+
buffer.put({ x, y: currentY, attr: roleAttr }, roleLabel + ':');
|
|
62
|
+
if (timestamp) {
|
|
63
|
+
buffer.put({
|
|
64
|
+
x: x + roleLabel.length + 1,
|
|
65
|
+
y: currentY,
|
|
66
|
+
attr: timestampAttr
|
|
67
|
+
}, ' ' + timestamp);
|
|
68
|
+
}
|
|
69
|
+
currentY++;
|
|
70
|
+
// Empty line after header
|
|
71
|
+
currentY++;
|
|
72
|
+
// Render message content (indented by 2 spaces, wrapped to fit width)
|
|
73
|
+
const contentAttr = createColorAttr(colors.text); // White
|
|
74
|
+
const contentMaxWidth = maxWidth - 4; // Leave some margin
|
|
75
|
+
const wrappedLines = wrapText(message.content, contentMaxWidth);
|
|
76
|
+
for (const line of wrappedLines) {
|
|
77
|
+
buffer.put({ x: x + 2, y: currentY, attr: contentAttr }, line);
|
|
78
|
+
currentY++;
|
|
79
|
+
}
|
|
80
|
+
// Bottom margin (1 line)
|
|
81
|
+
currentY++;
|
|
82
|
+
// Return total height
|
|
83
|
+
return currentY - y;
|
|
84
|
+
}
|
|
85
|
+
// Render multiple messages
|
|
86
|
+
export function renderMessages(messages, x, startY, maxWidth, maxHeight) {
|
|
87
|
+
let currentY = startY;
|
|
88
|
+
let renderedCount = 0;
|
|
89
|
+
for (const message of messages) {
|
|
90
|
+
// Check if we have space for at least the header
|
|
91
|
+
if (currentY + 3 > startY + maxHeight) {
|
|
92
|
+
break; // Out of space
|
|
93
|
+
}
|
|
94
|
+
// Skip tool messages (they're rendered by ToolExecutionMessage)
|
|
95
|
+
if (message.toolExecution) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const height = renderMessage(message, x, currentY, maxWidth);
|
|
99
|
+
currentY += height;
|
|
100
|
+
renderedCount++;
|
|
101
|
+
}
|
|
102
|
+
return { endY: currentY, renderedCount };
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=message-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-display.js","sourceRoot":"","sources":["../../../src/ui/components/message-display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGhG,qDAAqD;AACrD,SAAS,YAAY,CAAC,IAAY;IAChC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,OAAO,CAAC,CAAG,iBAAiB;QAC5C,KAAK,WAAW;YACd,OAAO,MAAM,CAAC,OAAO,CAAC,CAAG,kBAAkB;QAC7C,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,OAAO,CAAC,CAAG,mBAAmB;QAC9C,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,OAAO,CAAC,CAAG,iBAAiB;QAC5C;YACE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAM,kBAAkB;IAC/C,CAAC;AACH,CAAC;AAED,qBAAqB;AACrB,SAAS,YAAY,CAAC,IAAY;IAChC,QAAQ,IAAI,EAAE,CA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