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,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { MarkdownRenderer } from './MarkdownRenderer.js';
|
|
4
|
+
export const StreamingMessageDisplay = React.memo(({ message }) => {
|
|
5
|
+
const timestamp = message.timestamp
|
|
6
|
+
? new Date(message.timestamp).toLocaleTimeString()
|
|
7
|
+
: '';
|
|
8
|
+
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
|
|
9
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
10
|
+
React.createElement(Text, { color: "#00cc66", bold: true }, "Centaurus:"),
|
|
11
|
+
timestamp && (React.createElement(Text, { color: "#666666", dimColor: true },
|
|
12
|
+
" ",
|
|
13
|
+
timestamp))),
|
|
14
|
+
message.content && (React.createElement(MarkdownRenderer, { content: message.content, maxWidth: 100 })),
|
|
15
|
+
React.createElement(Box, { paddingLeft: 2 },
|
|
16
|
+
React.createElement(Text, { color: "#00ccff" }, "\u258A"))));
|
|
17
|
+
}, (prevProps, nextProps) => {
|
|
18
|
+
// Return true if props are equal (skip re-render), false if different (re-render)
|
|
19
|
+
// For streaming messages, we need to re-render when content changes
|
|
20
|
+
if (prevProps.message.id !== nextProps.message.id)
|
|
21
|
+
return false;
|
|
22
|
+
if (prevProps.message.content !== nextProps.message.content)
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=StreamingMessageDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingMessageDisplay.js","sourceRoot":"","sources":["../../../src/ui/components/StreamingMessageDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAazD,MAAM,CAAC,MAAM,uBAAuB,GAA2C,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACxG,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS;QACjC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE;QAClD,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QACzC,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,uBAEnB;YACN,SAAS,IAAI,CACZ,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ;;gBAAG,SAAS,CAAQ,CACnD,CACG;QAGL,OAAO,CAAC,OAAO,IAAI,CAClB,oBAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAI,CAC9D;QAGD,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;YACjB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,aAAS,CAC1B,CACF,CACP,CAAC;AACJ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC1B,kFAAkF;IAClF,oEAAoE;IACpE,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,SAAS,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE1E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Message } from '../../types/index.js';
|
|
3
|
+
interface ToolExecutionMessageProps {
|
|
4
|
+
message: Message;
|
|
5
|
+
}
|
|
6
|
+
export declare const ToolExecutionMessage: React.FC<ToolExecutionMessageProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ToolExecutionMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExecutionMessage.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAaD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA8MnE,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
const TOOL_LABELS = {
|
|
4
|
+
read_file: { verb: 'Reading file', emoji: '📖' },
|
|
5
|
+
write_file: { verb: 'Writing file', emoji: '✍️' },
|
|
6
|
+
edit_file: { verb: 'Editing file', emoji: '✏️' },
|
|
7
|
+
list_directory: { verb: 'Listing directory', emoji: '📁' },
|
|
8
|
+
execute_command: { verb: 'Executing command', emoji: '⚡' },
|
|
9
|
+
grep_search: { verb: 'Searching files', emoji: '🔍' },
|
|
10
|
+
web_search: { verb: 'Searching web', emoji: '🌐' },
|
|
11
|
+
fetch_url: { verb: 'Fetching URL', emoji: '📡' },
|
|
12
|
+
};
|
|
13
|
+
export const ToolExecutionMessage = React.memo(({ message }) => {
|
|
14
|
+
if (!message.toolExecution) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const { toolName, status, result, error, arguments: toolArgs } = message.toolExecution;
|
|
18
|
+
const toolInfo = TOOL_LABELS[toolName] || { verb: 'Executing', emoji: '🔧' };
|
|
19
|
+
// EXECUTING state
|
|
20
|
+
if (status === 'executing') {
|
|
21
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#003b59", paddingX: 1, marginY: 1 },
|
|
22
|
+
React.createElement(Box, null,
|
|
23
|
+
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
24
|
+
"\u23F3 ",
|
|
25
|
+
toolInfo.emoji,
|
|
26
|
+
" ",
|
|
27
|
+
toolInfo.verb,
|
|
28
|
+
"..."))));
|
|
29
|
+
}
|
|
30
|
+
// ERROR state
|
|
31
|
+
if (status === 'error') {
|
|
32
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff3366", paddingX: 1, marginY: 1 },
|
|
33
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
34
|
+
React.createElement(Text, { color: "#ff3366", bold: true },
|
|
35
|
+
"\u2717 ",
|
|
36
|
+
toolInfo.emoji,
|
|
37
|
+
" ",
|
|
38
|
+
toolInfo.verb,
|
|
39
|
+
" failed")),
|
|
40
|
+
error && (React.createElement(Box, { paddingLeft: 2 },
|
|
41
|
+
React.createElement(Text, { color: "#ff3366" },
|
|
42
|
+
error.slice(0, 500),
|
|
43
|
+
error.length > 500 ? '...' : '')))));
|
|
44
|
+
}
|
|
45
|
+
// COMPLETED state - tool-specific rendering
|
|
46
|
+
if (status === 'completed') {
|
|
47
|
+
// READ_FILE
|
|
48
|
+
if (toolName === 'read_file' && toolArgs) {
|
|
49
|
+
const { file_path, start_line, end_line } = toolArgs;
|
|
50
|
+
const lineInfo = start_line && end_line
|
|
51
|
+
? `lines ${start_line}-${end_line}`
|
|
52
|
+
: 'entire file';
|
|
53
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
54
|
+
React.createElement(Box, null,
|
|
55
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
56
|
+
"\u2713 ",
|
|
57
|
+
toolInfo.emoji,
|
|
58
|
+
" Read ",
|
|
59
|
+
lineInfo,
|
|
60
|
+
" from "),
|
|
61
|
+
React.createElement(Text, { color: "#00ccff" }, file_path))));
|
|
62
|
+
}
|
|
63
|
+
// EXECUTE_COMMAND
|
|
64
|
+
if (toolName === 'execute_command' && toolArgs) {
|
|
65
|
+
const { command } = toolArgs;
|
|
66
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00cc66", paddingX: 1, marginY: 1 },
|
|
67
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
68
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
69
|
+
"\u2713 ",
|
|
70
|
+
toolInfo.emoji,
|
|
71
|
+
" "),
|
|
72
|
+
React.createElement(Text, { color: "#00ccff" }, command)),
|
|
73
|
+
result && (React.createElement(Box, { flexDirection: "column", paddingLeft: 2, paddingY: 1, borderStyle: "single", borderColor: "#666666" },
|
|
74
|
+
React.createElement(Text, { color: "#aaaaaa" },
|
|
75
|
+
result.slice(0, 1000),
|
|
76
|
+
result.length > 1000 ? '\n...(truncated)' : '')))));
|
|
77
|
+
}
|
|
78
|
+
// WRITE_FILE
|
|
79
|
+
if (toolName === 'write_file' && toolArgs) {
|
|
80
|
+
const { file_path, content } = toolArgs;
|
|
81
|
+
const lines = content ? content.split('\n').length : 0;
|
|
82
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
83
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
84
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
85
|
+
"\u2713 ",
|
|
86
|
+
toolInfo.emoji,
|
|
87
|
+
" Wrote to "),
|
|
88
|
+
React.createElement(Text, { color: "#00ccff" }, file_path),
|
|
89
|
+
React.createElement(Text, { color: "#666666" },
|
|
90
|
+
" (",
|
|
91
|
+
lines,
|
|
92
|
+
" lines)")),
|
|
93
|
+
content && content.length < 500 && (React.createElement(Box, { flexDirection: "column", paddingLeft: 2, paddingY: 1, borderStyle: "single", borderColor: "#666666" },
|
|
94
|
+
React.createElement(Text, { color: "#aaaaaa" }, content)))));
|
|
95
|
+
}
|
|
96
|
+
// EDIT_FILE
|
|
97
|
+
if (toolName === 'edit_file' && toolArgs) {
|
|
98
|
+
const { file_path, search_pattern, replacement } = toolArgs;
|
|
99
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
100
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
101
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
102
|
+
"\u2713 ",
|
|
103
|
+
toolInfo.emoji,
|
|
104
|
+
" Edited "),
|
|
105
|
+
React.createElement(Text, { color: "#00ccff" }, file_path)),
|
|
106
|
+
search_pattern && replacement && (React.createElement(Box, { flexDirection: "column", paddingLeft: 2, paddingY: 1, borderStyle: "single", borderColor: "#666666" },
|
|
107
|
+
React.createElement(Text, { color: "#ff6666" },
|
|
108
|
+
"- ",
|
|
109
|
+
search_pattern.split('\n')[0],
|
|
110
|
+
search_pattern.includes('\n') ? '...' : ''),
|
|
111
|
+
React.createElement(Text, { color: "#66ff66" },
|
|
112
|
+
"+ ",
|
|
113
|
+
replacement.split('\n')[0],
|
|
114
|
+
replacement.includes('\n') ? '...' : '')))));
|
|
115
|
+
}
|
|
116
|
+
// LIST_DIRECTORY
|
|
117
|
+
if (toolName === 'list_directory' && toolArgs) {
|
|
118
|
+
const { directory_path } = toolArgs;
|
|
119
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
120
|
+
React.createElement(Box, null,
|
|
121
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
122
|
+
"\u2713 ",
|
|
123
|
+
toolInfo.emoji,
|
|
124
|
+
" Listed "),
|
|
125
|
+
React.createElement(Text, { color: "#00ccff" }, directory_path)),
|
|
126
|
+
result && result.length < 300 && (React.createElement(Box, { paddingLeft: 2, paddingTop: 1 },
|
|
127
|
+
React.createElement(Text, { color: "#aaaaaa" }, result)))));
|
|
128
|
+
}
|
|
129
|
+
// GREP_SEARCH
|
|
130
|
+
if (toolName === 'grep_search' && toolArgs) {
|
|
131
|
+
const { pattern } = toolArgs;
|
|
132
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
133
|
+
React.createElement(Box, null,
|
|
134
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
135
|
+
"\u2713 ",
|
|
136
|
+
toolInfo.emoji,
|
|
137
|
+
" Searched for "),
|
|
138
|
+
React.createElement(Text, { color: "#00ccff" },
|
|
139
|
+
"\"",
|
|
140
|
+
pattern,
|
|
141
|
+
"\"")),
|
|
142
|
+
result && result.length < 400 && (React.createElement(Box, { paddingLeft: 2, paddingTop: 1 },
|
|
143
|
+
React.createElement(Text, { color: "#aaaaaa" }, result)))));
|
|
144
|
+
}
|
|
145
|
+
// WEB_SEARCH
|
|
146
|
+
if (toolName === 'web_search' && toolArgs) {
|
|
147
|
+
const { query } = toolArgs;
|
|
148
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
149
|
+
React.createElement(Box, null,
|
|
150
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
151
|
+
"\u2713 ",
|
|
152
|
+
toolInfo.emoji,
|
|
153
|
+
" Executing"))));
|
|
154
|
+
}
|
|
155
|
+
// FETCH_URL
|
|
156
|
+
if (toolName === 'fetch_url' && toolArgs) {
|
|
157
|
+
const { url } = toolArgs;
|
|
158
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
159
|
+
React.createElement(Box, null,
|
|
160
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
161
|
+
"\u2713 ",
|
|
162
|
+
toolInfo.emoji,
|
|
163
|
+
" Fetched "),
|
|
164
|
+
React.createElement(Text, { color: "#00ccff" }, url))));
|
|
165
|
+
}
|
|
166
|
+
// DEFAULT - for any other tool
|
|
167
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#00ccff", paddingX: 1, marginY: 1 },
|
|
168
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
169
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
170
|
+
"\u2713 ",
|
|
171
|
+
toolInfo.emoji,
|
|
172
|
+
" ",
|
|
173
|
+
toolInfo.verb)),
|
|
174
|
+
result && result.length < 300 && (React.createElement(Box, { paddingLeft: 2 },
|
|
175
|
+
React.createElement(Text, { color: "#aaaaaa" }, result)))));
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}, (prevProps, nextProps) => {
|
|
179
|
+
// Only re-render if the status or key fields changed
|
|
180
|
+
const prevExec = prevProps.message.toolExecution;
|
|
181
|
+
const nextExec = nextProps.message.toolExecution;
|
|
182
|
+
if (!prevExec || !nextExec)
|
|
183
|
+
return false;
|
|
184
|
+
return prevExec.status === nextExec.status &&
|
|
185
|
+
prevExec.toolName === nextExec.toolName &&
|
|
186
|
+
prevExec.result === nextExec.result &&
|
|
187
|
+
prevExec.error === nextExec.error;
|
|
188
|
+
});
|
|
189
|
+
//# sourceMappingURL=ToolExecutionMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExecutionMessage.js","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAQhC,MAAM,WAAW,GAAoD;IACnE,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IAChD,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IACjD,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IAChD,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE;IAC1D,eAAe,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE;IAC1D,WAAW,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE;IACrD,UAAU,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE;IAClD,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAwC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAClG,IAAI,C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,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;YAC3F,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;gBAClB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI;;oBAAI,QAAQ,CAAC,KAAK;;oBAAG,QAAQ,CAAC,IAAI,CAAQ,CAChE;YACL,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAChC,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;gBACjB,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,IAAE,MAAM,CAAQ,CACjC,CACP,CACG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC1B,qDAAqD;IACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;IACjD,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;IAEjD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAEzC,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACnC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;QACvC,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACnC,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ToolExecutionStatusProps {
|
|
3
|
+
toolName: string;
|
|
4
|
+
status: 'pending' | 'executing' | 'success' | 'error';
|
|
5
|
+
result?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ToolExecutionStatus: React.FC<ToolExecutionStatusProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ToolExecutionStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExecutionStatus.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgEjE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
const TOOL_LABELS = {
|
|
5
|
+
read_file: { verb: 'Reading file', emoji: '📖' },
|
|
6
|
+
write_file: { verb: 'Writing file', emoji: '✍️' },
|
|
7
|
+
edit_file: { verb: 'Editing file', emoji: '✏️' },
|
|
8
|
+
list_directory: { verb: 'Listing directory', emoji: '📁' },
|
|
9
|
+
execute_command: { verb: 'Executing command', emoji: '⚡' },
|
|
10
|
+
grep_search: { verb: 'Searching files', emoji: '🔍' },
|
|
11
|
+
};
|
|
12
|
+
export const ToolExecutionStatus = React.memo(({ toolName, status, result, error, }) => {
|
|
13
|
+
const toolInfo = TOOL_LABELS[toolName] || { verb: 'Executing', emoji: '🔧' };
|
|
14
|
+
if (status === 'pending') {
|
|
15
|
+
return (React.createElement(Box, null,
|
|
16
|
+
React.createElement(Text, { color: "#666666", dimColor: true },
|
|
17
|
+
"\u23F3 ",
|
|
18
|
+
toolInfo.verb,
|
|
19
|
+
"...")));
|
|
20
|
+
}
|
|
21
|
+
if (status === 'executing') {
|
|
22
|
+
return (React.createElement(Box, null,
|
|
23
|
+
React.createElement(Text, { color: "#00ccff" },
|
|
24
|
+
React.createElement(Spinner, { type: "dots" })),
|
|
25
|
+
React.createElement(Text, { color: "#00ccff", bold: true },
|
|
26
|
+
" ",
|
|
27
|
+
toolInfo.emoji,
|
|
28
|
+
" ",
|
|
29
|
+
toolInfo.verb,
|
|
30
|
+
"...")));
|
|
31
|
+
}
|
|
32
|
+
if (status === 'success') {
|
|
33
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
34
|
+
React.createElement(Box, null,
|
|
35
|
+
React.createElement(Text, { color: "#00cc66", bold: true },
|
|
36
|
+
"\u2713 ",
|
|
37
|
+
toolInfo.emoji,
|
|
38
|
+
" ",
|
|
39
|
+
toolInfo.verb)),
|
|
40
|
+
result && result.length < 300 && (React.createElement(Box, { marginLeft: 2 },
|
|
41
|
+
React.createElement(Text, { color: "#666666" }, result)))));
|
|
42
|
+
}
|
|
43
|
+
if (status === 'error') {
|
|
44
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
45
|
+
React.createElement(Box, null,
|
|
46
|
+
React.createElement(Text, { color: "#ff3366", bold: true },
|
|
47
|
+
"\u2717 ",
|
|
48
|
+
toolInfo.emoji,
|
|
49
|
+
" ",
|
|
50
|
+
toolInfo.verb,
|
|
51
|
+
" failed")),
|
|
52
|
+
error && (React.createElement(Box, { marginLeft: 2 },
|
|
53
|
+
React.createElement(Text, { color: "#ff3366" },
|
|
54
|
+
error.slice(0, 200),
|
|
55
|
+
error.length > 200 ? '...' : '')))));
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}, (prevProps, nextProps) => {
|
|
59
|
+
// Only re-render if props actually changed
|
|
60
|
+
return prevProps.toolName === nextProps.toolName &&
|
|
61
|
+
prevProps.status === nextProps.status &&
|
|
62
|
+
prevProps.result === nextProps.result &&
|
|
63
|
+
prevProps.error === nextProps.error;
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=ToolExecutionStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExecutionStatus.js","sourceRoot":"","sources":["../../../src/ui/components/ToolExecutionStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AASlC,MAAM,WAAW,GAAoD;IACnE,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IAChD,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IACjD,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE;IAChD,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE;IAC1D,eAAe,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE;IAC1D,WAAW,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAuC,KAAK,CAAC,IAAI,CAAC,CAAC,EACjF,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAE7E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,CACL,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ;;gBAAI,QAAQ,CAAC,IAAI;sBAAW,CACtD,CACP,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,K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E,CACP,CACG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC1B,2CAA2C;IAC3C,OAAO,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QACrC,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QACrC,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC;AAC7C,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolResult.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ToolResult.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2BhD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export const ToolResult = ({ toolName, result, success, duration }) => {
|
|
4
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: success ? '#00cc66' : '#ff3366', paddingX: 1 },
|
|
5
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
6
|
+
React.createElement(Text, { color: success ? '#00cc66' : '#ff3366', bold: true },
|
|
7
|
+
success ? '✓' : '✗',
|
|
8
|
+
" ",
|
|
9
|
+
toolName),
|
|
10
|
+
duration && (React.createElement(Text, { color: "#666666" },
|
|
11
|
+
" (",
|
|
12
|
+
duration,
|
|
13
|
+
"ms)"))),
|
|
14
|
+
React.createElement(Box, null,
|
|
15
|
+
React.createElement(Text, { color: "#ffffff" }, result))));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=ToolResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolResult.js","sourceRoot":"","sources":["../../../src/ui/components/ToolResult.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACT,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAC5C,QAAQ,EAAE,CAAC;QAEX,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI;gBAC/C,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;gBAAG,QAAQ,CAC1B;YACN,QAAQ,IAAI,CACX,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS;;gBAAI,QAAQ;sBAAW,CAC7C,CACG;QAEN,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,IAAE,MAAM,CAAQ,CACjC,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeBanner.d.ts","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAiChC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export const WelcomeBanner = React.memo(() => {
|
|
4
|
+
// Clearer ASCII art that properly spells CENTAURUS CLI
|
|
5
|
+
const lines = [
|
|
6
|
+
' ██████╗███████╗███╗ ██╗████████╗ █████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗',
|
|
7
|
+
'██╔════╝██╔════╝████╗ ██║╚══██╔══╝██╔══██╗██║ ██║██╔══██╗██║ ██║██╔════╝',
|
|
8
|
+
'██║ █████╗ ██╔██╗ ██║ ██║ ███████║██║ ██║██████╔╝██║ ██║███████╗',
|
|
9
|
+
'██║ ██╔══╝ ██║╚██╗██║ ██║ ██╔══██║██║ ██║██╔══██╗██║ ██║╚════██║',
|
|
10
|
+
'╚██████╗███████╗██║ ╚████║ ██║ ██║ ██║╚██████╔╝██║ ██║╚██████╔╝███████║',
|
|
11
|
+
' ╚═════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝',
|
|
12
|
+
'',
|
|
13
|
+
' ██████╗██╗ ██╗',
|
|
14
|
+
' ██╔════╝██║ ██║',
|
|
15
|
+
' ██║ ██║ ██║',
|
|
16
|
+
' ██║ ██║ ██║',
|
|
17
|
+
' ╚██████╗███████╗██║',
|
|
18
|
+
' ╚═════╝╚══════╝╚═╝'
|
|
19
|
+
];
|
|
20
|
+
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
|
|
21
|
+
React.createElement(Box, { flexDirection: "column" }, lines.map((line, i) => (React.createElement(Text, { key: i, color: "#00ccff" }, line)))),
|
|
22
|
+
React.createElement(Box, { marginTop: 1 },
|
|
23
|
+
React.createElement(Text, { dimColor: true },
|
|
24
|
+
"Type ",
|
|
25
|
+
React.createElement(Text, { color: "#00ccff" }, "/help"),
|
|
26
|
+
" for commands"))));
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=WelcomeBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeBanner.js","sourceRoot":"","sources":["../../../src/ui/components/WelcomeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,aAAa,GAAa,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;IACrD,uDAAuD;IACvD,MAAM,KAAK,GAAG;QACZ,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,+EAA+E;QAC/E,EAAE;QACF,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;QACzC,yCAAyC;KAC1C,CAAC;IAEF,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QAEzC,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,oBAAC,IAAI,IAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,IAAE,IAAI,CAAQ,CAC5C,CAAC,CACE;QAGN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,QAAQ;;gBAAM,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,YAAa;gCAAoB,CACtE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/ui/components/code-block.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAoFjE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { screenBuffer, createColorAttr, colors, drawBox, truncate } from '../terminal-kit-base.js';
|
|
2
|
+
// Render a code block with line numbers
|
|
3
|
+
// Format: LineNum │ Code
|
|
4
|
+
// Max 20 lines, truncated with message
|
|
5
|
+
export function renderCodeBlock(options) {
|
|
6
|
+
const { x, y, width, code, language = 'text', title } = options;
|
|
7
|
+
const lines = code.split('\n');
|
|
8
|
+
const MAX_LINES = 20;
|
|
9
|
+
const truncated = lines.length > MAX_LINES;
|
|
10
|
+
const displayLines = truncated ? lines.slice(0, MAX_LINES) : lines;
|
|
11
|
+
// Calculate height
|
|
12
|
+
let height = 3; // Border + title + border
|
|
13
|
+
height += displayLines.length; // Code lines
|
|
14
|
+
if (truncated)
|
|
15
|
+
height += 1; // Truncation message
|
|
16
|
+
// Draw rounded border with dark blue color
|
|
17
|
+
drawBox({
|
|
18
|
+
x,
|
|
19
|
+
y,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
borderStyle: 'rounded',
|
|
23
|
+
borderColor: colors.border, // #003b59
|
|
24
|
+
});
|
|
25
|
+
let currentY = y + 1;
|
|
26
|
+
// Title with icon if provided
|
|
27
|
+
if (title) {
|
|
28
|
+
const titleAttr = createColorAttr(colors.primary, true); // Cyan, bold
|
|
29
|
+
const langAttr = createColorAttr(colors.dimmed); // Gray
|
|
30
|
+
let titleText = `📄 ${title}`;
|
|
31
|
+
if (language) {
|
|
32
|
+
titleText += ` `;
|
|
33
|
+
}
|
|
34
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: titleAttr }, titleText);
|
|
35
|
+
if (language) {
|
|
36
|
+
screenBuffer.put({
|
|
37
|
+
x: x + 2 + titleText.length,
|
|
38
|
+
y: currentY,
|
|
39
|
+
attr: langAttr
|
|
40
|
+
}, `(${language})`);
|
|
41
|
+
}
|
|
42
|
+
currentY += 2; // Title + empty line
|
|
43
|
+
}
|
|
44
|
+
// Render code lines with line numbers
|
|
45
|
+
const lineNumAttr = createColorAttr(colors.dimmed); // Gray
|
|
46
|
+
const codeAttr = createColorAttr(colors.text); // White
|
|
47
|
+
const maxLineNumWidth = 3; // Pad to 3 chars
|
|
48
|
+
for (let i = 0; i < displayLines.length; i++) {
|
|
49
|
+
const lineNum = (i + 1).toString().padStart(maxLineNumWidth, ' ');
|
|
50
|
+
const line = displayLines[i];
|
|
51
|
+
// Line number
|
|
52
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: lineNumAttr }, lineNum + ' │ ');
|
|
53
|
+
// Code (truncate if too long for width)
|
|
54
|
+
const codeWidth = width - 2 - maxLineNumWidth - 5; // Border + line num + separator + padding
|
|
55
|
+
const truncatedLine = truncate(line, codeWidth);
|
|
56
|
+
screenBuffer.put({
|
|
57
|
+
x: x + 2 + maxLineNumWidth + 3,
|
|
58
|
+
y: currentY,
|
|
59
|
+
attr: codeAttr
|
|
60
|
+
}, truncatedLine);
|
|
61
|
+
currentY++;
|
|
62
|
+
}
|
|
63
|
+
// Truncation message if needed
|
|
64
|
+
if (truncated) {
|
|
65
|
+
currentY++; // Empty line before message
|
|
66
|
+
const truncMsg = `... (${lines.length - MAX_LINES} more lines)`;
|
|
67
|
+
const truncAttr = createColorAttr(colors.dimmed, false, true); // Dimmed
|
|
68
|
+
screenBuffer.put({ x: x + 2, y: currentY, attr: truncAttr }, truncMsg);
|
|
69
|
+
currentY++;
|
|
70
|
+
}
|
|
71
|
+
// Return total height + bottom margin
|
|
72
|
+
return height + 1;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=code-block.js.map
|
|
@@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Q,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,GAAG,KAAK,CAAC,CAAC;QAEhF,wCAAwC;QACxC,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,0CAA0C;QAC7F,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAChD,YAAY,CAAC,GAAG,CAAC;YACf,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,eAAe,GAAG,CAAC;YAC9B,CAAC,EAAE,QAAQ;YACX,IAAI,EAAE,QAAQ;SACf,EAAE,aAAa,CAAC,CAAC;QAElB,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,+BAA+B;IAC/B,IAAI,SAAS,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,4BAA4B;QACxC,MAAM,QAAQ,GAAG,QAAQ,KAAK,CAAC,MAAM,GAAG,SAAS,cAAc,CAAC;QAChE,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;QAExE,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;QACvE,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,sCAAsC;IACtC,OAAO,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConfirmPromptOptions {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
message: string;
|
|
6
|
+
showFeedbackOption?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type PromptOption = 'yes' | 'no' | 'feedback';
|
|
9
|
+
export declare function renderConfirmPrompt(options: ConfirmPromptOptions, selected?: PromptOption): number;
|
|
10
|
+
export declare function waitForConfirmation(options: ConfirmPromptOptions): Promise<'yes' | 'no' | 'feedback' | null>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=confirm-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-prompt.d.ts","sourceRoot":"","sources":["../../../src/ui/components/confirm-prompt.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,KAAK,YAAY,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,CAAC;AAG9C,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,GAAE,YAAoB,GAC7B,MAAM,CAgER;AAGD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,KAAK,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,CA8D3C"}
|