gencode-ai 0.1.1 → 0.1.3
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/.gencode/settings.local.json +7 -0
- package/CLAUDE.md +86 -0
- package/README.md +13 -16
- package/dist/agent/agent.d.ts +50 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +96 -16
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/types.d.ts +14 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/cli/components/App.d.ts +8 -1
- package/dist/cli/components/App.d.ts.map +1 -1
- package/dist/cli/components/App.js +266 -29
- package/dist/cli/components/App.js.map +1 -1
- package/dist/cli/components/CommandSuggestions.d.ts.map +1 -1
- package/dist/cli/components/CommandSuggestions.js +2 -0
- package/dist/cli/components/CommandSuggestions.js.map +1 -1
- package/dist/cli/components/Header.d.ts +1 -1
- package/dist/cli/components/Header.d.ts.map +1 -1
- package/dist/cli/components/Header.js +4 -6
- package/dist/cli/components/Header.js.map +1 -1
- package/dist/cli/components/Logo.d.ts +1 -0
- package/dist/cli/components/Logo.d.ts.map +1 -1
- package/dist/cli/components/Logo.js +16 -3
- package/dist/cli/components/Logo.js.map +1 -1
- package/dist/cli/components/Messages.d.ts +4 -4
- package/dist/cli/components/Messages.d.ts.map +1 -1
- package/dist/cli/components/Messages.js +66 -23
- package/dist/cli/components/Messages.js.map +1 -1
- package/dist/cli/components/PermissionPrompt.d.ts +60 -0
- package/dist/cli/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/cli/components/PermissionPrompt.js +192 -0
- package/dist/cli/components/PermissionPrompt.js.map +1 -0
- package/dist/cli/components/ProviderManager.js +3 -3
- package/dist/cli/components/ProviderManager.js.map +1 -1
- package/dist/cli/components/QuestionPrompt.d.ts +23 -0
- package/dist/cli/components/QuestionPrompt.d.ts.map +1 -0
- package/dist/cli/components/QuestionPrompt.js +231 -0
- package/dist/cli/components/QuestionPrompt.js.map +1 -0
- package/dist/cli/components/Spinner.d.ts +7 -2
- package/dist/cli/components/Spinner.d.ts.map +1 -1
- package/dist/cli/components/Spinner.js +116 -25
- package/dist/cli/components/Spinner.js.map +1 -1
- package/dist/cli/components/TodoList.d.ts +7 -0
- package/dist/cli/components/TodoList.d.ts.map +1 -0
- package/dist/cli/components/TodoList.js +34 -0
- package/dist/cli/components/TodoList.js.map +1 -0
- package/dist/cli/components/index.d.ts +2 -0
- package/dist/cli/components/index.d.ts.map +1 -1
- package/dist/cli/components/index.js +2 -0
- package/dist/cli/components/index.js.map +1 -1
- package/dist/cli/components/theme.d.ts +7 -0
- package/dist/cli/components/theme.d.ts.map +1 -1
- package/dist/cli/components/theme.js +11 -1
- package/dist/cli/components/theme.js.map +1 -1
- package/dist/cli/index.js +47 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +13 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +18 -3
- package/dist/config/index.js.map +1 -1
- package/dist/config/levels.d.ts +49 -0
- package/dist/config/levels.d.ts.map +1 -0
- package/dist/config/levels.js +222 -0
- package/dist/config/levels.js.map +1 -0
- package/dist/config/loader.d.ts +46 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +153 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/manager.d.ts +115 -15
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +260 -34
- package/dist/config/manager.js.map +1 -1
- package/dist/config/manager.test.d.ts +5 -0
- package/dist/config/manager.test.d.ts.map +1 -0
- package/dist/config/manager.test.js +192 -0
- package/dist/config/manager.test.js.map +1 -0
- package/dist/config/merger.d.ts +56 -0
- package/dist/config/merger.d.ts.map +1 -0
- package/dist/config/merger.js +177 -0
- package/dist/config/merger.js.map +1 -0
- package/dist/config/test-utils.d.ts +24 -0
- package/dist/config/test-utils.d.ts.map +1 -0
- package/dist/config/test-utils.js +55 -0
- package/dist/config/test-utils.js.map +1 -0
- package/dist/config/types.d.ts +78 -9
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +52 -2
- package/dist/config/types.js.map +1 -1
- package/dist/memory/import-resolver.d.ts +46 -0
- package/dist/memory/import-resolver.d.ts.map +1 -0
- package/dist/memory/import-resolver.js +117 -0
- package/dist/memory/import-resolver.js.map +1 -0
- package/dist/memory/index.d.ts +7 -6
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +7 -5
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/init-prompt.d.ts +22 -0
- package/dist/memory/init-prompt.d.ts.map +1 -0
- package/dist/memory/init-prompt.js +103 -0
- package/dist/memory/init-prompt.js.map +1 -0
- package/dist/memory/memory-manager.d.ts +119 -0
- package/dist/memory/memory-manager.d.ts.map +1 -0
- package/dist/memory/memory-manager.js +587 -0
- package/dist/memory/memory-manager.js.map +1 -0
- package/dist/memory/rules-parser.d.ts +38 -0
- package/dist/memory/rules-parser.d.ts.map +1 -0
- package/dist/memory/rules-parser.js +69 -0
- package/dist/memory/rules-parser.js.map +1 -0
- package/dist/memory/test-utils.d.ts +20 -0
- package/dist/memory/test-utils.d.ts.map +1 -0
- package/dist/memory/test-utils.js +44 -0
- package/dist/memory/test-utils.js.map +1 -0
- package/dist/memory/types.d.ts +70 -63
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/types.js +42 -2
- package/dist/memory/types.js.map +1 -1
- package/dist/permissions/audit.d.ts +82 -0
- package/dist/permissions/audit.d.ts.map +1 -0
- package/dist/permissions/audit.js +229 -0
- package/dist/permissions/audit.js.map +1 -0
- package/dist/permissions/index.d.ts +11 -1
- package/dist/permissions/index.d.ts.map +1 -1
- package/dist/permissions/index.js +15 -0
- package/dist/permissions/index.js.map +1 -1
- package/dist/permissions/manager.d.ts +149 -13
- package/dist/permissions/manager.d.ts.map +1 -1
- package/dist/permissions/manager.js +480 -35
- package/dist/permissions/manager.js.map +1 -1
- package/dist/permissions/manager.test.d.ts +5 -0
- package/dist/permissions/manager.test.d.ts.map +1 -0
- package/dist/permissions/manager.test.js +213 -0
- package/dist/permissions/manager.test.js.map +1 -0
- package/dist/permissions/persistence.d.ts +74 -0
- package/dist/permissions/persistence.d.ts.map +1 -0
- package/dist/permissions/persistence.js +248 -0
- package/dist/permissions/persistence.js.map +1 -0
- package/dist/permissions/persistence.test.d.ts +5 -0
- package/dist/permissions/persistence.test.d.ts.map +1 -0
- package/dist/permissions/persistence.test.js +171 -0
- package/dist/permissions/persistence.test.js.map +1 -0
- package/dist/permissions/prompt-matcher.d.ts +64 -0
- package/dist/permissions/prompt-matcher.d.ts.map +1 -0
- package/dist/permissions/prompt-matcher.js +415 -0
- package/dist/permissions/prompt-matcher.js.map +1 -0
- package/dist/permissions/prompt-matcher.test.d.ts +5 -0
- package/dist/permissions/prompt-matcher.test.d.ts.map +1 -0
- package/dist/permissions/prompt-matcher.test.js +107 -0
- package/dist/permissions/prompt-matcher.test.js.map +1 -0
- package/dist/permissions/types.d.ts +157 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js +45 -8
- package/dist/permissions/types.js.map +1 -1
- package/dist/prompts/index.d.ts +92 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +241 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/tools/builtin/ask-user.d.ts +64 -0
- package/dist/tools/builtin/ask-user.d.ts.map +1 -0
- package/dist/tools/builtin/ask-user.js +148 -0
- package/dist/tools/builtin/ask-user.js.map +1 -0
- package/dist/tools/builtin/bash.d.ts.map +1 -1
- package/dist/tools/builtin/bash.js +2 -1
- package/dist/tools/builtin/bash.js.map +1 -1
- package/dist/tools/builtin/edit.d.ts.map +1 -1
- package/dist/tools/builtin/edit.js +2 -1
- package/dist/tools/builtin/edit.js.map +1 -1
- package/dist/tools/builtin/glob.d.ts.map +1 -1
- package/dist/tools/builtin/glob.js +2 -1
- package/dist/tools/builtin/glob.js.map +1 -1
- package/dist/tools/builtin/grep.d.ts.map +1 -1
- package/dist/tools/builtin/grep.js +2 -1
- package/dist/tools/builtin/grep.js.map +1 -1
- package/dist/tools/builtin/read.d.ts.map +1 -1
- package/dist/tools/builtin/read.js +2 -1
- package/dist/tools/builtin/read.js.map +1 -1
- package/dist/tools/builtin/todowrite.d.ts +15 -0
- package/dist/tools/builtin/todowrite.d.ts.map +1 -0
- package/dist/tools/builtin/todowrite.js +88 -0
- package/dist/tools/builtin/todowrite.js.map +1 -0
- package/dist/tools/builtin/webfetch.d.ts.map +1 -1
- package/dist/tools/builtin/webfetch.js +2 -5
- package/dist/tools/builtin/webfetch.js.map +1 -1
- package/dist/tools/builtin/websearch.d.ts.map +1 -1
- package/dist/tools/builtin/websearch.js +2 -16
- package/dist/tools/builtin/websearch.js.map +1 -1
- package/dist/tools/builtin/write.d.ts.map +1 -1
- package/dist/tools/builtin/write.js +2 -1
- package/dist/tools/builtin/write.js.map +1 -1
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.d.ts +39 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +8 -0
- package/dist/tools/types.js.map +1 -1
- package/docs/config-system-comparison.md +707 -0
- package/docs/memory-system.md +238 -0
- package/docs/permissions.md +368 -0
- package/docs/proposals/0005-todo-system.md +350 -85
- package/docs/proposals/0006-memory-system.md +11 -10
- package/docs/proposals/0012-ask-user-question.md +1007 -207
- package/docs/proposals/0023-permission-enhancements.md +61 -2
- package/docs/proposals/0041-configuration-system.md +33 -2
- package/docs/proposals/0042-prompt-optimization.md +866 -0
- package/docs/proposals/README.md +7 -6
- package/examples/test-ask-user.ts +167 -0
- package/jest.config.js +26 -0
- package/package.json +8 -2
- package/src/agent/agent.ts +130 -16
- package/src/agent/index.ts +1 -0
- package/src/agent/types.ts +13 -1
- package/src/cli/components/App.tsx +362 -37
- package/src/cli/components/CommandSuggestions.tsx +2 -0
- package/src/cli/components/Header.tsx +11 -17
- package/src/cli/components/Logo.tsx +76 -9
- package/src/cli/components/Messages.tsx +104 -41
- package/src/cli/components/PermissionPrompt.tsx +388 -0
- package/src/cli/components/ProviderManager.tsx +5 -5
- package/src/cli/components/QuestionPrompt.tsx +462 -0
- package/src/cli/components/Spinner.tsx +138 -25
- package/src/cli/components/TodoList.tsx +54 -0
- package/src/cli/components/index.ts +7 -0
- package/src/cli/components/theme.ts +11 -1
- package/src/cli/index.tsx +54 -6
- package/src/config/index.ts +78 -4
- package/src/config/levels.test.ts +163 -0
- package/src/config/levels.ts +285 -0
- package/src/config/loader.test.ts +120 -0
- package/src/config/loader.ts +178 -0
- package/src/config/manager.test.ts +215 -0
- package/src/config/manager.ts +328 -40
- package/src/config/merger.test.ts +360 -0
- package/src/config/merger.ts +221 -0
- package/src/config/test-utils.ts +79 -0
- package/src/config/types.ts +152 -9
- package/src/memory/import-resolver.test.ts +117 -0
- package/src/memory/import-resolver.ts +149 -0
- package/src/memory/index.ts +11 -0
- package/src/memory/init-prompt.ts +113 -0
- package/src/memory/memory-manager.test.ts +198 -0
- package/src/memory/memory-manager.ts +716 -0
- package/src/memory/rules-parser.test.ts +182 -0
- package/src/memory/rules-parser.ts +82 -0
- package/src/memory/test-utils.ts +60 -0
- package/src/memory/types.ts +119 -0
- package/src/permissions/audit.ts +284 -0
- package/src/permissions/index.ts +20 -1
- package/src/permissions/manager.test.ts +260 -0
- package/src/permissions/manager.ts +592 -40
- package/src/permissions/persistence.test.ts +220 -0
- package/src/permissions/persistence.ts +301 -0
- package/src/permissions/prompt-matcher.test.ts +213 -0
- package/src/permissions/prompt-matcher.ts +472 -0
- package/src/permissions/types.ts +238 -8
- package/src/prompts/index.test.ts +279 -0
- package/src/prompts/index.ts +306 -0
- package/src/prompts/system/anthropic.txt +29 -0
- package/src/prompts/system/base.txt +166 -0
- package/src/prompts/system/gemini.txt +35 -0
- package/src/prompts/system/generic.txt +128 -0
- package/src/prompts/system/openai.txt +29 -0
- package/src/prompts/tools/ask-user.txt +110 -0
- package/src/prompts/tools/bash.txt +60 -0
- package/src/prompts/tools/edit.txt +29 -0
- package/src/prompts/tools/glob.txt +35 -0
- package/src/prompts/tools/grep.txt +43 -0
- package/src/prompts/tools/read.txt +22 -0
- package/src/prompts/tools/todowrite.txt +71 -0
- package/src/prompts/tools/webfetch.txt +34 -0
- package/src/prompts/tools/websearch.txt +41 -0
- package/src/prompts/tools/write.txt +23 -0
- package/src/tools/builtin/ask-user.ts +185 -0
- package/src/tools/builtin/bash.ts +2 -1
- package/src/tools/builtin/edit.ts +2 -1
- package/src/tools/builtin/glob.ts +2 -1
- package/src/tools/builtin/grep.ts +2 -1
- package/src/tools/builtin/read.ts +2 -1
- package/src/tools/builtin/todowrite.ts +102 -0
- package/src/tools/builtin/webfetch.ts +2 -5
- package/src/tools/builtin/websearch.ts +2 -16
- package/src/tools/builtin/write.ts +2 -1
- package/src/tools/index.ts +19 -0
- package/src/tools/types.ts +30 -0
- package/tsconfig.json +1 -1
|
@@ -1,16 +1,83 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
|
+
import { colors } from './theme.js';
|
|
2
3
|
|
|
4
|
+
// Small G logo for inline use
|
|
3
5
|
export function Logo() {
|
|
4
|
-
// Full G with 3D shadow - subdued slate color
|
|
5
|
-
const slateColor = "#64748B"; // Slate 500 - stable, professional
|
|
6
6
|
return (
|
|
7
|
-
<Box
|
|
8
|
-
<Text color={
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
<Box marginRight={1}>
|
|
8
|
+
<Text bold color={colors.brand}>◆</Text>
|
|
9
|
+
</Box>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Large ASCII art logo with elegant gradient
|
|
14
|
+
export function BigLogo() {
|
|
15
|
+
// Indigo gradient - brand colors
|
|
16
|
+
const c1 = '#818CF8'; // Indigo 400
|
|
17
|
+
const c2 = '#818CF8'; // Indigo 400
|
|
18
|
+
const c3 = '#A5B4FC'; // Indigo 300
|
|
19
|
+
const c4 = '#A5B4FC'; // Indigo 300
|
|
20
|
+
const c5 = '#C7D2FE'; // Indigo 200
|
|
21
|
+
const c6 = '#C7D2FE'; // Indigo 200
|
|
22
|
+
const c7 = '#C7D2FE'; // Indigo 200
|
|
23
|
+
|
|
24
|
+
// G E N C O D E
|
|
25
|
+
return (
|
|
26
|
+
<Box flexDirection="column">
|
|
27
|
+
<Text>
|
|
28
|
+
<Text color={c1}> ██████╗ </Text>
|
|
29
|
+
<Text color={c2}>███████╗</Text>
|
|
30
|
+
<Text color={c3}>███╗ ██╗</Text>
|
|
31
|
+
<Text color={c4}> ██████╗</Text>
|
|
32
|
+
<Text color={c5}> ██████╗ </Text>
|
|
33
|
+
<Text color={c6}>██████╗ </Text>
|
|
34
|
+
<Text color={c7}>███████╗</Text>
|
|
35
|
+
</Text>
|
|
36
|
+
<Text>
|
|
37
|
+
<Text color={c1}>██╔════╝ </Text>
|
|
38
|
+
<Text color={c2}>██╔════╝</Text>
|
|
39
|
+
<Text color={c3}>████╗ ██║</Text>
|
|
40
|
+
<Text color={c4}>██╔════╝</Text>
|
|
41
|
+
<Text color={c5}>██╔═══██╗</Text>
|
|
42
|
+
<Text color={c6}>██╔══██╗</Text>
|
|
43
|
+
<Text color={c7}>██╔════╝</Text>
|
|
44
|
+
</Text>
|
|
45
|
+
<Text>
|
|
46
|
+
<Text color={c1}>██║ ███╗</Text>
|
|
47
|
+
<Text color={c2}>█████╗ </Text>
|
|
48
|
+
<Text color={c3}>██╔██╗ ██║</Text>
|
|
49
|
+
<Text color={c4}>██║ </Text>
|
|
50
|
+
<Text color={c5}>██║ ██║</Text>
|
|
51
|
+
<Text color={c6}>██║ ██║</Text>
|
|
52
|
+
<Text color={c7}>█████╗ </Text>
|
|
53
|
+
</Text>
|
|
54
|
+
<Text>
|
|
55
|
+
<Text color={c1}>██║ ██║</Text>
|
|
56
|
+
<Text color={c2}>██╔══╝ </Text>
|
|
57
|
+
<Text color={c3}>██║╚██╗██║</Text>
|
|
58
|
+
<Text color={c4}>██║ </Text>
|
|
59
|
+
<Text color={c5}>██║ ██║</Text>
|
|
60
|
+
<Text color={c6}>██║ ██║</Text>
|
|
61
|
+
<Text color={c7}>██╔══╝ </Text>
|
|
62
|
+
</Text>
|
|
63
|
+
<Text>
|
|
64
|
+
<Text color={c1}>╚██████╔╝</Text>
|
|
65
|
+
<Text color={c2}>███████╗</Text>
|
|
66
|
+
<Text color={c3}>██║ ╚████║</Text>
|
|
67
|
+
<Text color={c4}>╚██████╗</Text>
|
|
68
|
+
<Text color={c5}>╚██████╔╝</Text>
|
|
69
|
+
<Text color={c6}>██████╔╝</Text>
|
|
70
|
+
<Text color={c7}>███████╗</Text>
|
|
71
|
+
</Text>
|
|
72
|
+
<Text>
|
|
73
|
+
<Text color={c1}> ╚═════╝ </Text>
|
|
74
|
+
<Text color={c2}>╚══════╝</Text>
|
|
75
|
+
<Text color={c3}>╚═╝ ╚═══╝</Text>
|
|
76
|
+
<Text color={c4}> ╚═════╝</Text>
|
|
77
|
+
<Text color={c5}> ╚═════╝ </Text>
|
|
78
|
+
<Text color={c6}>╚═════╝ </Text>
|
|
79
|
+
<Text color={c7}>╚══════╝</Text>
|
|
80
|
+
</Text>
|
|
14
81
|
</Box>
|
|
15
82
|
);
|
|
16
83
|
}
|
|
@@ -38,12 +38,15 @@ interface UserMessageProps {
|
|
|
38
38
|
|
|
39
39
|
export function UserMessage({ text }: UserMessageProps) {
|
|
40
40
|
const lines = text.trimEnd().split('\n');
|
|
41
|
+
// Subtle gray - ~8% darker than pure white
|
|
42
|
+
const inputBg = '#EFEFEF';
|
|
43
|
+
|
|
41
44
|
return (
|
|
42
45
|
<Box flexDirection="column" marginTop={1} marginBottom={0}>
|
|
43
46
|
{lines.map((line, i) => (
|
|
44
|
-
<Box key={i}>
|
|
47
|
+
<Box key={i} backgroundColor={inputBg}>
|
|
45
48
|
<Text color={colors.brand}>{icons.userPrompt} </Text>
|
|
46
|
-
<Text
|
|
49
|
+
<Text>{line}</Text>
|
|
47
50
|
</Box>
|
|
48
51
|
))}
|
|
49
52
|
</Box>
|
|
@@ -88,8 +91,9 @@ export function AssistantMessage({ text, streaming }: AssistantMessageProps) {
|
|
|
88
91
|
return (
|
|
89
92
|
<Box flexDirection="column" marginTop={1} marginBottom={0}>
|
|
90
93
|
<Box>
|
|
91
|
-
<Text color={colors.success}>{icons.assistant}
|
|
92
|
-
<Text>
|
|
94
|
+
<Text color={colors.success}>{icons.assistant}</Text>
|
|
95
|
+
<Text> </Text>
|
|
96
|
+
<Text wrap="wrap">{rendered}</Text>
|
|
93
97
|
</Box>
|
|
94
98
|
</Box>
|
|
95
99
|
);
|
|
@@ -100,29 +104,74 @@ interface ToolCallProps {
|
|
|
100
104
|
input: Record<string, unknown>;
|
|
101
105
|
}
|
|
102
106
|
|
|
107
|
+
// Format tool input for display
|
|
108
|
+
function formatToolInput(name: string, input: Record<string, unknown>): string {
|
|
109
|
+
switch (name) {
|
|
110
|
+
case 'Read':
|
|
111
|
+
return input.file_path as string || '';
|
|
112
|
+
case 'Write':
|
|
113
|
+
case 'Edit':
|
|
114
|
+
return input.file_path as string || '';
|
|
115
|
+
case 'Glob':
|
|
116
|
+
return input.pattern as string || '';
|
|
117
|
+
case 'Grep':
|
|
118
|
+
return `"${input.pattern}"` + (input.path ? ` in ${input.path}` : '');
|
|
119
|
+
case 'Bash':
|
|
120
|
+
return truncate(input.command as string || '', 50);
|
|
121
|
+
case 'WebFetch':
|
|
122
|
+
return input.url as string || '';
|
|
123
|
+
case 'WebSearch':
|
|
124
|
+
return `"${input.query}"` || '';
|
|
125
|
+
case 'TodoWrite': {
|
|
126
|
+
const todos = input.todos as Array<{ content: string; status: string }> || [];
|
|
127
|
+
return `${todos.length} task${todos.length !== 1 ? 's' : ''}`;
|
|
128
|
+
}
|
|
129
|
+
case 'AskUserQuestion': {
|
|
130
|
+
// Show collapsed JSON preview
|
|
131
|
+
const json = JSON.stringify(input);
|
|
132
|
+
return truncate(json, 60);
|
|
133
|
+
}
|
|
134
|
+
default:
|
|
135
|
+
return truncate(JSON.stringify(input), 40);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
103
139
|
export function ToolCall({ name, input }: ToolCallProps) {
|
|
104
|
-
//
|
|
105
|
-
if (name === '
|
|
106
|
-
|
|
140
|
+
// Hide TodoWrite (shown in TodoList component)
|
|
141
|
+
if (name === 'TodoWrite') return null;
|
|
142
|
+
|
|
143
|
+
// Special display for AskUserQuestion (Claude Code style with expand hint)
|
|
144
|
+
if (name === 'AskUserQuestion') {
|
|
145
|
+
const json = JSON.stringify(input);
|
|
146
|
+
const displayJson = truncate(json, 70);
|
|
147
|
+
|
|
107
148
|
return (
|
|
108
|
-
<Box marginTop={1}>
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
149
|
+
<Box marginTop={1} flexDirection="column">
|
|
150
|
+
<Box>
|
|
151
|
+
<Text color={colors.tool}>{icons.tool}</Text>
|
|
152
|
+
<Text> </Text>
|
|
153
|
+
<Text bold>{name}</Text>
|
|
154
|
+
<Text color={colors.textMuted}> </Text>
|
|
155
|
+
<Text color={colors.textSecondary}>{displayJson}</Text>
|
|
156
|
+
<Text color={colors.textMuted}> ctrl+o</Text>
|
|
157
|
+
</Box>
|
|
113
158
|
</Box>
|
|
114
159
|
);
|
|
115
160
|
}
|
|
116
161
|
|
|
117
|
-
|
|
118
|
-
const shortInput = truncate(JSON.stringify(input), 50);
|
|
162
|
+
const displayInput = formatToolInput(name, input);
|
|
119
163
|
|
|
120
164
|
return (
|
|
121
165
|
<Box marginTop={1}>
|
|
122
|
-
<Text
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
166
|
+
<Text color={colors.tool}>{icons.tool}</Text>
|
|
167
|
+
<Text> </Text>
|
|
168
|
+
<Text bold>{name}</Text>
|
|
169
|
+
{displayInput && (
|
|
170
|
+
<>
|
|
171
|
+
<Text color={colors.textMuted}> </Text>
|
|
172
|
+
<Text color={colors.textSecondary}>{truncate(displayInput, 60)}</Text>
|
|
173
|
+
</>
|
|
174
|
+
)}
|
|
126
175
|
</Box>
|
|
127
176
|
);
|
|
128
177
|
}
|
|
@@ -134,31 +183,43 @@ interface PendingToolCallProps {
|
|
|
134
183
|
}
|
|
135
184
|
|
|
136
185
|
export function PendingToolCall({ name, input }: PendingToolCallProps) {
|
|
137
|
-
//
|
|
138
|
-
if (name === '
|
|
139
|
-
|
|
186
|
+
// Hide TodoWrite (shown in TodoList component)
|
|
187
|
+
if (name === 'TodoWrite') return null;
|
|
188
|
+
|
|
189
|
+
// Special display for AskUserQuestion
|
|
190
|
+
if (name === 'AskUserQuestion') {
|
|
191
|
+
const json = JSON.stringify(input);
|
|
192
|
+
const displayJson = truncate(json, 70);
|
|
193
|
+
|
|
140
194
|
return (
|
|
141
195
|
<Box marginTop={1}>
|
|
142
196
|
<Text color={colors.tool}>
|
|
143
197
|
<InkSpinner type="dots" />
|
|
144
198
|
</Text>
|
|
145
|
-
<Text>
|
|
146
|
-
<Text
|
|
147
|
-
<Text>
|
|
199
|
+
<Text> </Text>
|
|
200
|
+
<Text bold>{name}</Text>
|
|
201
|
+
<Text color={colors.textMuted}> </Text>
|
|
202
|
+
<Text color={colors.textSecondary}>{displayJson}</Text>
|
|
203
|
+
<Text color={colors.textMuted}> ctrl+o</Text>
|
|
148
204
|
</Box>
|
|
149
205
|
);
|
|
150
206
|
}
|
|
151
207
|
|
|
152
|
-
|
|
153
|
-
const shortInput = truncate(JSON.stringify(input), 50);
|
|
208
|
+
const displayInput = formatToolInput(name, input);
|
|
154
209
|
|
|
155
210
|
return (
|
|
156
211
|
<Box marginTop={1}>
|
|
157
212
|
<Text color={colors.tool}>
|
|
158
213
|
<InkSpinner type="dots" />
|
|
159
214
|
</Text>
|
|
160
|
-
<Text>
|
|
161
|
-
<Text
|
|
215
|
+
<Text> </Text>
|
|
216
|
+
<Text bold>{name}</Text>
|
|
217
|
+
{displayInput && (
|
|
218
|
+
<>
|
|
219
|
+
<Text> </Text>
|
|
220
|
+
<Text color={colors.textSecondary}>{truncate(displayInput, 60)}</Text>
|
|
221
|
+
</>
|
|
222
|
+
)}
|
|
162
223
|
</Box>
|
|
163
224
|
);
|
|
164
225
|
}
|
|
@@ -186,23 +247,26 @@ export function ToolResult({ name, success, output, metadata }: ToolResultProps)
|
|
|
186
247
|
if (metadata?.subtitle) {
|
|
187
248
|
return (
|
|
188
249
|
<Box marginLeft={2}>
|
|
189
|
-
<Text
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
</Text>
|
|
250
|
+
<Text color={colors.textMuted}>{icons.treeEnd}</Text>
|
|
251
|
+
<Text> </Text>
|
|
252
|
+
<Text color={statusColor}>{metadata.subtitle}</Text>
|
|
193
253
|
</Box>
|
|
194
254
|
);
|
|
195
255
|
}
|
|
196
256
|
|
|
197
|
-
//
|
|
198
|
-
|
|
257
|
+
// TodoWrite: Don't show result (TodoList component shows the full list)
|
|
258
|
+
if (name === 'TodoWrite') {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Default: Show first line of output with status icon
|
|
263
|
+
const displayOutput = truncate(output.split('\n')[0]?.trim() || '', 60);
|
|
199
264
|
|
|
200
265
|
return (
|
|
201
266
|
<Box marginLeft={2}>
|
|
202
|
-
<Text
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
</Text>
|
|
267
|
+
<Text color={colors.textMuted}>{icons.treeEnd}</Text>
|
|
268
|
+
<Text> </Text>
|
|
269
|
+
<Text color={statusColor}>{displayOutput || (success ? 'Done' : 'Failed')}</Text>
|
|
206
270
|
</Box>
|
|
207
271
|
);
|
|
208
272
|
}
|
|
@@ -238,11 +302,10 @@ interface WelcomeMessageProps {
|
|
|
238
302
|
model: string;
|
|
239
303
|
}
|
|
240
304
|
|
|
241
|
-
export function WelcomeMessage({ model }: WelcomeMessageProps) {
|
|
305
|
+
export function WelcomeMessage({ model: _model }: WelcomeMessageProps) {
|
|
242
306
|
return (
|
|
243
307
|
<Box marginTop={1} marginBottom={0}>
|
|
244
|
-
<Text color={colors.textMuted}
|
|
245
|
-
<Text color={colors.brand}>{model}</Text>
|
|
308
|
+
<Text color={colors.textMuted}>? for help · Ctrl+C to exit</Text>
|
|
246
309
|
</Box>
|
|
247
310
|
);
|
|
248
311
|
}
|