codeep 1.0.130 → 1.0.132
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 +39 -44
- package/dist/utils/agent.js +7 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -326,73 +326,44 @@ export const App = () => {
|
|
|
326
326
|
return updated;
|
|
327
327
|
});
|
|
328
328
|
// Add formatted action to streaming content (stays in chat)
|
|
329
|
+
// NO CODE DISPLAY - just clean action lines to prevent terminal jumping
|
|
329
330
|
const actionType = actionLog.type;
|
|
330
331
|
const target = actionLog.target.split('/').pop() || actionLog.target; // Just filename
|
|
331
|
-
const fullPath = actionLog.target;
|
|
332
332
|
const status = actionLog.result === 'success' ? '✓' : '✗';
|
|
333
|
-
const
|
|
334
|
-
//
|
|
335
|
-
const
|
|
336
|
-
const ext = filename.split('.').pop()?.toLowerCase() || '';
|
|
337
|
-
const langMap = {
|
|
338
|
-
'ts': 'typescript', 'tsx': 'typescript', 'js': 'javascript', 'jsx': 'javascript',
|
|
339
|
-
'py': 'python', 'rb': 'ruby', 'go': 'go', 'rs': 'rust', 'java': 'java',
|
|
340
|
-
'php': 'php', 'css': 'css', 'scss': 'css', 'html': 'html', 'vue': 'html',
|
|
341
|
-
'json': 'json', 'yml': 'yaml', 'yaml': 'yaml', 'md': 'markdown',
|
|
342
|
-
'sh': 'bash', 'bash': 'bash', 'sql': 'sql',
|
|
343
|
-
};
|
|
344
|
-
return langMap[ext] || ext || 'code';
|
|
345
|
-
};
|
|
333
|
+
const failedText = actionLog.result === 'error' ? ' ✗' : '';
|
|
334
|
+
// Count lines in content
|
|
335
|
+
const lineCount = actionLog.details ? actionLog.details.split('\n').length : 0;
|
|
346
336
|
let actionLine = '';
|
|
347
|
-
if (actionType === 'write'
|
|
348
|
-
|
|
349
|
-
const lang = getLanguage(target);
|
|
350
|
-
actionLine = `${status} **Created ${fullPath}**\n\`\`\`${lang}\n${actionLog.details}\n\`\`\``;
|
|
351
|
-
}
|
|
352
|
-
else if (actionType === 'write') {
|
|
353
|
-
actionLine = `${status} Created **${target}**${statusColor}`;
|
|
354
|
-
}
|
|
355
|
-
else if (actionType === 'edit' && actionLog.details) {
|
|
356
|
-
// Show edited code with syntax highlighting
|
|
357
|
-
const lang = getLanguage(target);
|
|
358
|
-
actionLine = `${status} **Edited ${fullPath}**\n\`\`\`${lang}\n${actionLog.details}\n\`\`\``;
|
|
337
|
+
if (actionType === 'write') {
|
|
338
|
+
actionLine = `${status} Created **${target}**${lineCount > 0 ? ` (${lineCount} lines)` : ''}${failedText}`;
|
|
359
339
|
}
|
|
360
340
|
else if (actionType === 'edit') {
|
|
361
|
-
actionLine = `${status} Edited **${target}**${
|
|
341
|
+
actionLine = `${status} Edited **${target}**${lineCount > 0 ? ` (${lineCount} lines)` : ''}${failedText}`;
|
|
362
342
|
}
|
|
363
343
|
else if (actionType === 'read') {
|
|
364
344
|
actionLine = `→ Reading **${target}**`;
|
|
365
345
|
}
|
|
366
346
|
else if (actionType === 'delete') {
|
|
367
|
-
actionLine = `${status} Deleted **${
|
|
347
|
+
actionLine = `${status} Deleted **${target}**${failedText}`;
|
|
368
348
|
}
|
|
369
349
|
else if (actionType === 'command') {
|
|
370
|
-
const cmd = actionLog.target;
|
|
371
|
-
|
|
372
|
-
if (actionLog.details && actionLog.details.trim()) {
|
|
373
|
-
actionLine = `${status} Ran \`${cmd}\`\n\`\`\`\n${actionLog.details.slice(0, 500)}${actionLog.details.length > 500 ? '\n...(truncated)' : ''}\n\`\`\``;
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
actionLine = `${status} Ran \`${cmd}\`${statusColor}`;
|
|
377
|
-
}
|
|
350
|
+
const cmd = actionLog.target.length > 40 ? actionLog.target.slice(0, 40) + '...' : actionLog.target;
|
|
351
|
+
actionLine = `${status} Ran \`${cmd}\`${failedText}`;
|
|
378
352
|
}
|
|
379
353
|
else if (actionType === 'search') {
|
|
380
354
|
actionLine = `→ Searching **${target}**`;
|
|
381
355
|
}
|
|
382
356
|
else if (actionType === 'mkdir') {
|
|
383
|
-
actionLine = `${status} Created
|
|
357
|
+
actionLine = `${status} Created dir **${target}**`;
|
|
384
358
|
}
|
|
385
359
|
else if (actionType === 'fetch') {
|
|
386
|
-
actionLine =
|
|
360
|
+
actionLine = `→ Fetching **${target}**`;
|
|
387
361
|
}
|
|
388
362
|
else if (actionType === 'list') {
|
|
389
363
|
actionLine = `→ Listing **${target}**`;
|
|
390
364
|
}
|
|
391
|
-
else {
|
|
392
|
-
actionLine = `◦ ${actionType}: ${target}`;
|
|
393
|
-
}
|
|
394
365
|
if (actionLine) {
|
|
395
|
-
setAgentStreamingContent(prev => prev + (prev ? '\n
|
|
366
|
+
setAgentStreamingContent(prev => prev + (prev ? '\n' : '') + actionLine);
|
|
396
367
|
}
|
|
397
368
|
},
|
|
398
369
|
onThinking: (text) => {
|
|
@@ -409,10 +380,34 @@ export const App = () => {
|
|
|
409
380
|
abortSignal: controller.signal,
|
|
410
381
|
});
|
|
411
382
|
setAgentResult(result);
|
|
412
|
-
//
|
|
383
|
+
// Build action statistics
|
|
384
|
+
const stats = {
|
|
385
|
+
created: result.actions.filter(a => a.type === 'write' && a.result === 'success').length,
|
|
386
|
+
edited: result.actions.filter(a => a.type === 'edit' && a.result === 'success').length,
|
|
387
|
+
deleted: result.actions.filter(a => a.type === 'delete' && a.result === 'success').length,
|
|
388
|
+
commands: result.actions.filter(a => a.type === 'command' && a.result === 'success').length,
|
|
389
|
+
reads: result.actions.filter(a => a.type === 'read').length,
|
|
390
|
+
errors: result.actions.filter(a => a.result === 'error').length,
|
|
391
|
+
};
|
|
392
|
+
// Format statistics line
|
|
393
|
+
const statParts = [];
|
|
394
|
+
if (stats.created > 0)
|
|
395
|
+
statParts.push(`+${stats.created} created`);
|
|
396
|
+
if (stats.edited > 0)
|
|
397
|
+
statParts.push(`~${stats.edited} edited`);
|
|
398
|
+
if (stats.deleted > 0)
|
|
399
|
+
statParts.push(`-${stats.deleted} deleted`);
|
|
400
|
+
if (stats.commands > 0)
|
|
401
|
+
statParts.push(`${stats.commands} commands`);
|
|
402
|
+
if (stats.errors > 0)
|
|
403
|
+
statParts.push(`${stats.errors} errors`);
|
|
404
|
+
const statsLine = statParts.length > 0
|
|
405
|
+
? `\n\n---\n**${result.iterations} steps** | ${statParts.join(' | ')}`
|
|
406
|
+
: '';
|
|
407
|
+
// Add agent summary as assistant message with stats
|
|
413
408
|
const summaryMessage = {
|
|
414
409
|
role: 'assistant',
|
|
415
|
-
content: result.finalResponse || formatAgentResult(result),
|
|
410
|
+
content: (result.finalResponse || formatAgentResult(result)) + statsLine,
|
|
416
411
|
};
|
|
417
412
|
setMessages(prev => [...prev, summaryMessage]);
|
|
418
413
|
// Auto-save session
|
package/dist/utils/agent.js
CHANGED
|
@@ -635,7 +635,13 @@ export async function runAgent(prompt, projectContext, options = {}) {
|
|
|
635
635
|
if (toolCalls.length === 0) {
|
|
636
636
|
debug(`No tool calls at iteration ${iteration}, content length: ${content.length}`);
|
|
637
637
|
// Remove <think>...</think> tags from response (some models include thinking)
|
|
638
|
-
|
|
638
|
+
// Also remove Tool parameters/tool call artifacts that AI sometimes includes in text
|
|
639
|
+
finalResponse = content
|
|
640
|
+
.replace(/<think>[\s\S]*?<\/think>/gi, '')
|
|
641
|
+
.replace(/Tool parameters:[\s\S]*?(?=\n\n|$)/gi, '')
|
|
642
|
+
.replace(/\{'path'[\s\S]*?\}/g, '')
|
|
643
|
+
.replace(/```[\s\S]*?```/g, '')
|
|
644
|
+
.trim();
|
|
639
645
|
// Check if model indicates it wants to continue (incomplete response)
|
|
640
646
|
const continueIndicators = [
|
|
641
647
|
'let me', 'i will', 'i\'ll', 'now i', 'next i',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.132",
|
|
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",
|