codeep 1.0.13 → 1.0.15
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/dist/components/Input.js +9 -12
- package/dist/utils/agent.js +18 -10
- package/package.json +1 -1
package/dist/components/Input.js
CHANGED
|
@@ -30,16 +30,16 @@ const COMMANDS = [
|
|
|
30
30
|
];
|
|
31
31
|
export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }) => {
|
|
32
32
|
const [value, setValue] = useState('');
|
|
33
|
-
const [displayValue, setDisplayValue] = useState('');
|
|
34
33
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
35
34
|
const [isSelectingCommand, setIsSelectingCommand] = useState(false);
|
|
35
|
+
const [pasteInfo, setPasteInfo] = useState(null);
|
|
36
36
|
// Clear input when clearTrigger changes
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (clearTrigger > 0) {
|
|
39
39
|
setValue('');
|
|
40
|
-
setDisplayValue('');
|
|
41
40
|
setSelectedIndex(0);
|
|
42
41
|
setIsSelectingCommand(false);
|
|
42
|
+
setPasteInfo(null);
|
|
43
43
|
}
|
|
44
44
|
}, [clearTrigger]);
|
|
45
45
|
// Filter commands based on input
|
|
@@ -68,15 +68,13 @@ export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }
|
|
|
68
68
|
const clipboardText = await clipboard.read();
|
|
69
69
|
// Replace newlines with spaces to prevent multi-line issues
|
|
70
70
|
const sanitized = clipboardText.replace(/\r?\n/g, ' ').trim();
|
|
71
|
-
// Store full text
|
|
71
|
+
// Store full text
|
|
72
72
|
setValue(prev => prev + sanitized);
|
|
73
|
-
//
|
|
73
|
+
// Show paste info if long text
|
|
74
74
|
if (sanitized.length > 100) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
else {
|
|
79
|
-
setDisplayValue(prev => prev + sanitized);
|
|
75
|
+
setPasteInfo(`[pasted ${sanitized.length} chars]`);
|
|
76
|
+
// Clear info after 2 seconds
|
|
77
|
+
setTimeout(() => setPasteInfo(null), 2000);
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
catch (error) {
|
|
@@ -104,15 +102,14 @@ export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }
|
|
|
104
102
|
}, { isActive: !disabled });
|
|
105
103
|
const handleChange = (newValue) => {
|
|
106
104
|
setValue(newValue);
|
|
107
|
-
setDisplayValue(newValue);
|
|
108
105
|
};
|
|
109
106
|
const handleSubmit = () => {
|
|
110
107
|
if (value.trim() && !disabled) {
|
|
111
108
|
onSubmit(value.trim());
|
|
112
109
|
setValue('');
|
|
113
|
-
|
|
110
|
+
setPasteInfo(null);
|
|
114
111
|
setIsSelectingCommand(false);
|
|
115
112
|
}
|
|
116
113
|
};
|
|
117
|
-
return (_jsxs(Box, { flexDirection: "column", children: [suggestions.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [suggestions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, bold: i === selectedIndex, children: s.cmd }), _jsxs(Text, { color: i === selectedIndex ? undefined : 'gray', children: [" - ", s.desc] })] }, s.cmd))), _jsxs(Text, { color: "gray", children: ["\u2191\u2193 Navigate \u2022 Tab Complete \u2022 ", suggestions.length, " ", suggestions.length === 1 ? 'command' : 'commands'] })] })), _jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: '> ' }), disabled ? (_jsx(Text, { children: "..." })) : (_jsx(TextInput, { value:
|
|
114
|
+
return (_jsxs(Box, { flexDirection: "column", children: [suggestions.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [suggestions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, bold: i === selectedIndex, children: s.cmd }), _jsxs(Text, { color: i === selectedIndex ? undefined : 'gray', children: [" - ", s.desc] })] }, s.cmd))), _jsxs(Text, { color: "gray", children: ["\u2191\u2193 Navigate \u2022 Tab Complete \u2022 ", suggestions.length, " ", suggestions.length === 1 ? 'command' : 'commands'] })] })), _jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: '> ' }), disabled ? (_jsx(Text, { children: "..." })) : (_jsx(TextInput, { value: value, onChange: handleChange, onSubmit: handleSubmit, placeholder: "Type a message or /command..." }))] }), pasteInfo && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "green", children: pasteInfo }) }))] })] }));
|
|
118
115
|
};
|
package/dist/utils/agent.js
CHANGED
|
@@ -28,21 +28,25 @@ function getAgentSystemPrompt(projectContext) {
|
|
|
28
28
|
|
|
29
29
|
## IMPORTANT: Follow User Instructions Exactly
|
|
30
30
|
- Do EXACTLY what the user asks
|
|
31
|
+
- If user says "create a website" -> create ALL necessary files (HTML, CSS, JS, images, etc.)
|
|
31
32
|
- If user says "create folder X" -> use create_directory tool to create folder X
|
|
32
33
|
- If user says "delete file X" -> use delete_file tool to delete file X
|
|
33
34
|
- The user may write in any language - understand their request and execute it
|
|
34
35
|
- Tool names and parameters must ALWAYS be in English (e.g., "create_directory", not "kreiraj_direktorij")
|
|
35
|
-
-
|
|
36
|
+
- KEEP WORKING until the ENTIRE task is finished - do NOT stop after creating just directories or partial files
|
|
37
|
+
- Only stop when you have created ALL files needed for a complete, working solution
|
|
36
38
|
|
|
37
39
|
## Rules
|
|
38
40
|
1. Always read files before editing them to understand the current content
|
|
39
41
|
2. Use edit_file for modifications to existing files (preserves other content)
|
|
40
42
|
3. Use write_file only for creating new files or complete overwrites
|
|
41
43
|
4. Use create_directory to create new folders/directories
|
|
42
|
-
5. Use list_files to see directory contents
|
|
43
|
-
6. Use
|
|
44
|
-
7.
|
|
45
|
-
8.
|
|
44
|
+
5. Use list_files to see directory contents
|
|
45
|
+
6. Use search_code to find files or search patterns
|
|
46
|
+
7. NEVER use execute_command for: ls, find, cat, grep, mkdir, rm, cp, mv, touch
|
|
47
|
+
8. Use execute_command ONLY for: npm, git, composer, pip, cargo (build/package managers)
|
|
48
|
+
9. When the task is complete, respond with a summary WITHOUT any tool calls
|
|
49
|
+
10. IMPORTANT: After finishing, your response must NOT include any tool calls - just provide a summary
|
|
46
50
|
|
|
47
51
|
## Self-Verification
|
|
48
52
|
After you make changes, the system will automatically run build and tests.
|
|
@@ -72,11 +76,13 @@ function getFallbackSystemPrompt(projectContext) {
|
|
|
72
76
|
|
|
73
77
|
## IMPORTANT: Follow User Instructions Exactly
|
|
74
78
|
- Do EXACTLY what the user asks
|
|
79
|
+
- If user says "create a website" -> create ALL necessary files (HTML, CSS, JS, images, etc.)
|
|
75
80
|
- If user says "create folder X" -> use create_directory tool
|
|
76
81
|
- If user says "delete file X" -> use delete_file tool
|
|
77
82
|
- The user may write in any language - understand and execute
|
|
78
83
|
- Tool names and parameters must ALWAYS be in English
|
|
79
|
-
-
|
|
84
|
+
- KEEP WORKING until the ENTIRE task is finished - do NOT stop after creating just directories or partial files
|
|
85
|
+
- Only stop when you have created ALL files needed for a complete, working solution
|
|
80
86
|
|
|
81
87
|
## Available Tools
|
|
82
88
|
${formatToolDefinitions()}
|
|
@@ -102,10 +108,12 @@ When you need to use a tool, respond with:
|
|
|
102
108
|
|
|
103
109
|
## Rules
|
|
104
110
|
1. Use the exact format shown above
|
|
105
|
-
2. Use list_files to see directory contents
|
|
106
|
-
3. Use
|
|
107
|
-
4.
|
|
108
|
-
5.
|
|
111
|
+
2. Use list_files to see directory contents
|
|
112
|
+
3. Use search_code to find files or search patterns
|
|
113
|
+
4. NEVER use execute_command for: ls, find, cat, grep, mkdir, rm, cp, mv, touch
|
|
114
|
+
5. Use execute_command ONLY for: npm, git, composer, pip, cargo (build/package managers)
|
|
115
|
+
6. Always read files before editing
|
|
116
|
+
7. When done, respond WITHOUT tool calls
|
|
109
117
|
|
|
110
118
|
## Project: ${projectContext.name} (${projectContext.type})
|
|
111
119
|
${projectContext.structure}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|