codeep 1.0.2 → 1.0.5
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/app.js +2 -4
- package/dist/components/Sessions.js +22 -5
- package/dist/config/index.js +15 -2
- package/dist/utils/agent.js +11 -3
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -1208,10 +1208,8 @@ export const App = () => {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
setProjectContext(ctx);
|
|
1210
1210
|
if (permanent) {
|
|
1211
|
-
// Save permission to local .codeep/config.json
|
|
1212
|
-
|
|
1213
|
-
setProjectPermission(projectPath, true, false); // read only
|
|
1214
|
-
}
|
|
1211
|
+
// Save permission to local .codeep/config.json
|
|
1212
|
+
setProjectPermission(projectPath, true, writeGranted);
|
|
1215
1213
|
notify(writeGranted
|
|
1216
1214
|
? 'Project access granted (read + write, permanent)'
|
|
1217
1215
|
: 'Project access granted (read-only, permanent)');
|
|
@@ -47,15 +47,32 @@ export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = fals
|
|
|
47
47
|
handleDelete();
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
// S = Save, L = Load, D = Delete
|
|
51
|
-
if (!deleteMode &&
|
|
50
|
+
// Ctrl+S = Save, Ctrl+L = Load, Ctrl+D = Delete, Enter = Save/Load depending on context
|
|
51
|
+
if (!deleteMode && key.ctrl && input === 's') {
|
|
52
52
|
handleSave();
|
|
53
|
+
return;
|
|
53
54
|
}
|
|
54
|
-
if (!deleteMode &&
|
|
55
|
+
if (!deleteMode && key.ctrl && input === 'l') {
|
|
55
56
|
handleLoad();
|
|
57
|
+
return;
|
|
56
58
|
}
|
|
57
|
-
if (
|
|
59
|
+
if (key.ctrl && input === 'd') {
|
|
58
60
|
handleDelete();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Enter key behavior
|
|
64
|
+
if (!deleteMode && key.return) {
|
|
65
|
+
// If name is filled, try to save or load
|
|
66
|
+
if (name.trim()) {
|
|
67
|
+
// Check if session exists - if yes, load it, if no, save current
|
|
68
|
+
if (sessions.includes(name.trim())) {
|
|
69
|
+
handleLoad();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
handleSave();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
59
76
|
}
|
|
60
77
|
});
|
|
61
78
|
const handleSave = () => {
|
|
@@ -98,5 +115,5 @@ export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = fals
|
|
|
98
115
|
setConfirmDelete(sessionName);
|
|
99
116
|
setMessage(`Delete "${sessionName}"? (Y/N)`);
|
|
100
117
|
};
|
|
101
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: deleteMode ? 'Delete Session' : 'Sessions' }), _jsx(Text, { children: " " }), !deleteMode && (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", children: "Name: " }), _jsx(TextInput, { value: name, onChange: setName, placeholder: "session name..." })] }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "S" }), "=Save ", _jsx(Text, { color: "#f02a30", children: "L" }), "=Load ", _jsx(Text, { color: "#f02a30", children: "D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Close"] })] })), deleteMode && (_jsx(_Fragment, { children: _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Enter/D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Cancel"] }) })), sessions.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { children: "Saved sessions (\u2191/\u2193 to select):" }), sessions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, children: s })] }, s)))] })), message && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "cyan", children: message })] }))] }));
|
|
118
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: deleteMode ? 'Delete Session' : 'Sessions' }), _jsx(Text, { children: " " }), !deleteMode && (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", children: "Name: " }), _jsx(TextInput, { value: name, onChange: setName, placeholder: "session name..." })] }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Ctrl+S" }), "=Save ", _jsx(Text, { color: "#f02a30", children: "Ctrl+L" }), "=Load ", _jsx(Text, { color: "#f02a30", children: "Ctrl+D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Enter" }), "=Save/Load ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Close"] })] })), deleteMode && (_jsx(_Fragment, { children: _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Enter/Ctrl+D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Cancel"] }) })), sessions.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { children: "Saved sessions (\u2191/\u2193 to select):" }), sessions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, children: s })] }, s)))] })), message && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "cyan", children: message })] }))] }));
|
|
102
119
|
};
|
package/dist/config/index.js
CHANGED
|
@@ -36,10 +36,23 @@ function getLocalConfigPath(projectPath) {
|
|
|
36
36
|
return join(configDir, 'config.json');
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Check if directory is a project
|
|
39
|
+
* Check if directory is a project
|
|
40
|
+
* Looks for common project indicators: package.json, pyproject.toml, Cargo.toml, go.mod, composer.json, etc.
|
|
40
41
|
*/
|
|
41
42
|
function isProjectDirectory(path) {
|
|
42
|
-
|
|
43
|
+
const projectFiles = [
|
|
44
|
+
'package.json', // Node.js
|
|
45
|
+
'pyproject.toml', // Python (Poetry)
|
|
46
|
+
'requirements.txt', // Python (pip)
|
|
47
|
+
'setup.py', // Python
|
|
48
|
+
'Cargo.toml', // Rust
|
|
49
|
+
'go.mod', // Go
|
|
50
|
+
'composer.json', // PHP
|
|
51
|
+
'pom.xml', // Java (Maven)
|
|
52
|
+
'build.gradle', // Java (Gradle)
|
|
53
|
+
'.git', // Git repository
|
|
54
|
+
];
|
|
55
|
+
return projectFiles.some(file => existsSync(join(path, file)));
|
|
43
56
|
}
|
|
44
57
|
export const config = new Conf({
|
|
45
58
|
projectName: 'codeep',
|
package/dist/utils/agent.js
CHANGED
|
@@ -8,8 +8,8 @@ import { startSession, endSession, undoLastAction, undoAllActions, getCurrentSes
|
|
|
8
8
|
import { runAllVerifications, formatErrorsForAgent, hasVerificationErrors, getVerificationSummary } from './verify.js';
|
|
9
9
|
import { gatherSmartContext, formatSmartContext, extractTargetFile } from './smartContext.js';
|
|
10
10
|
const DEFAULT_OPTIONS = {
|
|
11
|
-
maxIterations:
|
|
12
|
-
maxDuration:
|
|
11
|
+
maxIterations: 50, // Increased for complex tasks like website creation
|
|
12
|
+
maxDuration: 10 * 60 * 1000, // 10 minutes
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Generate system prompt for agent mode (used with native tool calling)
|
|
@@ -38,7 +38,8 @@ function getAgentSystemPrompt(projectContext) {
|
|
|
38
38
|
2. Use edit_file for modifications to existing files (preserves other content)
|
|
39
39
|
3. Use write_file only for creating new files or complete overwrites
|
|
40
40
|
4. Use create_directory to create new folders/directories
|
|
41
|
-
5. When the task is complete, respond with a summary
|
|
41
|
+
5. When the task is complete, respond with a summary WITHOUT any tool calls
|
|
42
|
+
6. IMPORTANT: After finishing, your response must NOT include any tool calls - just provide a summary
|
|
42
43
|
|
|
43
44
|
## Self-Verification
|
|
44
45
|
After you make changes, the system will automatically run build and tests.
|
|
@@ -443,6 +444,13 @@ export async function runAgent(prompt, projectContext, options = {}) {
|
|
|
443
444
|
finalResponse = content.replace(/<think>[\s\S]*?<\/think>/gi, '').trim();
|
|
444
445
|
break;
|
|
445
446
|
}
|
|
447
|
+
// Also check if response indicates completion (even with tool calls)
|
|
448
|
+
const completionIndicators = ['task completed', 'finished', 'done with', 'successfully created', 'all set'];
|
|
449
|
+
const lowerContent = content.toLowerCase();
|
|
450
|
+
if (completionIndicators.some(indicator => lowerContent.includes(indicator))) {
|
|
451
|
+
// Agent thinks task is complete, but included tool calls - execute them and finish
|
|
452
|
+
// Continue with tool execution but mark this as potentially the last iteration
|
|
453
|
+
}
|
|
446
454
|
// Add assistant response to history
|
|
447
455
|
messages.push({ role: 'assistant', content });
|
|
448
456
|
// Execute tool calls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|