codeep 1.0.9 → 1.0.11
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/utils/agent.js +21 -10
- package/package.json +1 -1
package/dist/utils/agent.js
CHANGED
|
@@ -39,8 +39,10 @@ function getAgentSystemPrompt(projectContext) {
|
|
|
39
39
|
2. Use edit_file for modifications to existing files (preserves other content)
|
|
40
40
|
3. Use write_file only for creating new files or complete overwrites
|
|
41
41
|
4. Use create_directory to create new folders/directories
|
|
42
|
-
5.
|
|
43
|
-
6.
|
|
42
|
+
5. Use list_files to see directory contents (NOT execute_command with ls)
|
|
43
|
+
6. Use execute_command only for npm, git, build tools, tests (NOT for ls, cat, etc.)
|
|
44
|
+
7. When the task is complete, respond with a summary WITHOUT any tool calls
|
|
45
|
+
8. IMPORTANT: After finishing, your response must NOT include any tool calls - just provide a summary
|
|
44
46
|
|
|
45
47
|
## Self-Verification
|
|
46
48
|
After you make changes, the system will automatically run build and tests.
|
|
@@ -90,14 +92,20 @@ When you need to use a tool, respond with:
|
|
|
90
92
|
{"tool": "create_directory", "parameters": {"path": "my-folder"}}
|
|
91
93
|
</tool_call>
|
|
92
94
|
|
|
95
|
+
<tool_call>
|
|
96
|
+
{"tool": "list_files", "parameters": {"path": "."}}
|
|
97
|
+
</tool_call>
|
|
98
|
+
|
|
93
99
|
<tool_call>
|
|
94
100
|
{"tool": "write_file", "parameters": {"path": "test/index.html", "content": "<!DOCTYPE html>..."}}
|
|
95
101
|
</tool_call>
|
|
96
102
|
|
|
97
103
|
## Rules
|
|
98
104
|
1. Use the exact format shown above
|
|
99
|
-
2.
|
|
100
|
-
3.
|
|
105
|
+
2. Use list_files to see directory contents (NOT execute_command with ls)
|
|
106
|
+
3. Use execute_command only for npm, git, build tools (NOT for ls, cat, etc.)
|
|
107
|
+
4. Always read files before editing
|
|
108
|
+
5. When done, respond WITHOUT tool calls
|
|
101
109
|
|
|
102
110
|
## Project: ${projectContext.name} (${projectContext.type})
|
|
103
111
|
${projectContext.structure}
|
|
@@ -487,19 +495,22 @@ export async function runAgent(prompt, projectContext, options = {}) {
|
|
|
487
495
|
if (taskPlan && taskPlan.tasks.some(t => t.status === 'pending')) {
|
|
488
496
|
const nextTask = getNextTask(taskPlan.tasks);
|
|
489
497
|
if (nextTask) {
|
|
498
|
+
// Mark previous task as completed
|
|
499
|
+
const prevTask = taskPlan.tasks.find(t => t.status === 'in_progress' && t.id !== nextTask.id);
|
|
500
|
+
if (prevTask) {
|
|
501
|
+
prevTask.status = 'completed';
|
|
502
|
+
}
|
|
490
503
|
// Move to next task
|
|
491
504
|
nextTask.status = 'in_progress';
|
|
492
505
|
opts.onTaskUpdate?.(nextTask);
|
|
506
|
+
// Build progress summary
|
|
507
|
+
const completedTasks = taskPlan.tasks.filter(t => t.status === 'completed');
|
|
508
|
+
const progressSummary = completedTasks.map(t => `✓ ${t.id}. ${t.description}`).join('\n');
|
|
493
509
|
messages.push({ role: 'assistant', content: finalResponse });
|
|
494
510
|
messages.push({
|
|
495
511
|
role: 'user',
|
|
496
|
-
content: `
|
|
512
|
+
content: `Excellent! Task ${prevTask?.id} is complete.\n\nProgress so far:\n${progressSummary}\n\nNow continue with:\n${nextTask.id}. ${nextTask.description}\n\nOriginal request: ${taskPlan.originalPrompt}`
|
|
497
513
|
});
|
|
498
|
-
// Mark previous task as completed
|
|
499
|
-
const prevTask = taskPlan.tasks.find(t => t.status === 'in_progress' && t.id !== nextTask.id);
|
|
500
|
-
if (prevTask) {
|
|
501
|
-
prevTask.status = 'completed';
|
|
502
|
-
}
|
|
503
514
|
finalResponse = ''; // Reset for next task
|
|
504
515
|
continue;
|
|
505
516
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
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",
|