codeep 1.0.47 → 1.0.49
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/AgentProgress.js +58 -32
- package/dist/utils/tools.js +29 -1
- package/package.json +1 -1
|
@@ -21,8 +21,18 @@ export const AgentProgress = ({ isRunning, iteration, maxIterations, actions, cu
|
|
|
21
21
|
if (!isRunning && actions.length === 0) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
// Show last
|
|
25
|
-
const recentActions = actions.slice(-
|
|
24
|
+
// Show last 5 actions (more compact)
|
|
25
|
+
const recentActions = actions.slice(-5);
|
|
26
|
+
// Get current/last action for prominent display
|
|
27
|
+
const currentAction = actions.length > 0 ? actions[actions.length - 1] : null;
|
|
28
|
+
// Count actions by type
|
|
29
|
+
const actionCounts = {
|
|
30
|
+
reads: actions.filter(a => a.type === 'read').length,
|
|
31
|
+
writes: actions.filter(a => a.type === 'write').length,
|
|
32
|
+
edits: actions.filter(a => a.type === 'edit').length,
|
|
33
|
+
commands: actions.filter(a => a.type === 'command').length,
|
|
34
|
+
searches: actions.filter(a => a.type === 'search').length,
|
|
35
|
+
};
|
|
26
36
|
// Count file changes
|
|
27
37
|
const fileChanges = {
|
|
28
38
|
created: actions.filter(a => a.type === 'write' && a.result === 'success').length,
|
|
@@ -30,7 +40,48 @@ export const AgentProgress = ({ isRunning, iteration, maxIterations, actions, cu
|
|
|
30
40
|
deleted: actions.filter(a => a.type === 'delete' && a.result === 'success').length,
|
|
31
41
|
};
|
|
32
42
|
const totalFileChanges = fileChanges.created + fileChanges.modified + fileChanges.deleted;
|
|
33
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: dryRun ? 'yellow' : '#f02a30', padding: 1, marginY: 1, children: [_jsx(Box, { children: isRunning ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: dryRun ? 'yellow' : '#f02a30', children: ["[", SPINNER_FRAMES[spinnerFrame], "]"] }), _jsxs(Text, { color: dryRun ? 'yellow' : '#f02a30', bold: true, children: [' ', dryRun ? 'DRY RUN' : 'AGENT', ' '] }), _jsx(Text, { color: "gray", children: "|" }), _jsxs(Text, { color: "cyan", children: [" step ", iteration] }), _jsx(Text, { color: "gray", children: " | " }), _jsxs(Text, { color: "
|
|
43
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: dryRun ? 'yellow' : '#f02a30', padding: 1, marginY: 1, children: [_jsx(Box, { children: isRunning ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: dryRun ? 'yellow' : '#f02a30', children: ["[", SPINNER_FRAMES[spinnerFrame], "]"] }), _jsxs(Text, { color: dryRun ? 'yellow' : '#f02a30', bold: true, children: [' ', dryRun ? 'DRY RUN' : 'AGENT', ' '] }), _jsx(Text, { color: "gray", children: "|" }), _jsxs(Text, { color: "cyan", children: [" step ", iteration] }), _jsx(Text, { color: "gray", children: " | " }), actionCounts.reads > 0 && _jsxs(Text, { color: "blue", children: [actionCounts.reads, "R "] }), actionCounts.writes > 0 && _jsxs(Text, { color: "green", children: [actionCounts.writes, "W "] }), actionCounts.edits > 0 && _jsxs(Text, { color: "yellow", children: [actionCounts.edits, "E "] }), actionCounts.commands > 0 && _jsxs(Text, { color: "magenta", children: [actionCounts.commands, "C "] }), actionCounts.searches > 0 && _jsxs(Text, { color: "cyan", children: [actionCounts.searches, "S "] }), actions.length === 0 && _jsx(Text, { color: "gray", children: "0 actions" })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { color: "green", bold: true, children: "[DONE] " }), _jsx(Text, { children: "Agent completed" }), _jsx(Text, { color: "gray", children: " | " }), _jsxs(Text, { color: "white", children: [actions.length, " actions"] })] })) }), isRunning && currentAction && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "white", bold: true, children: "Now: " }), _jsxs(Text, { color: getActionColor(currentAction.type), children: [getActionLabel(currentAction.type), " "] }), _jsx(Text, { color: "white", children: formatTarget(currentAction.target) })] }), (currentAction.type === 'write' || currentAction.type === 'edit') && currentAction.details && (_jsxs(Box, { flexDirection: "column", marginLeft: 2, marginTop: 0, children: [_jsx(Text, { color: "gray", dimColor: true, children: '┌' + '─'.repeat(40) }), currentAction.details.split('\n').slice(0, 5).map((line, i) => (_jsxs(Text, { color: "gray", dimColor: true, children: ['│ ', line.slice(0, 60), line.length > 60 ? '...' : ''] }, i))), _jsx(Text, { color: "gray", dimColor: true, children: '└' + '─'.repeat(40) })] }))] })), _jsx(Text, { color: "gray", children: '─'.repeat(50) }), recentActions.length > 1 && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "gray", dimColor: true, children: "Recent:" }), recentActions.slice(0, -1).map((action, i) => (_jsx(ActionItem, { action: action }, i)))] })), isRunning && totalFileChanges > 0 && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Changes: " }), fileChanges.created > 0 && _jsxs(Text, { color: "green", children: ["+", fileChanges.created, " "] }), fileChanges.modified > 0 && _jsxs(Text, { color: "yellow", children: ["~", fileChanges.modified, " "] }), fileChanges.deleted > 0 && _jsxs(Text, { color: "red", children: ["-", fileChanges.deleted] })] })), isRunning && currentThinking && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", wrap: "truncate-end", children: ["> ", currentThinking.slice(0, 80), currentThinking.length > 80 ? '...' : ''] }) })), isRunning && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Press " }), _jsx(Text, { color: "#f02a30", children: "Esc" }), _jsx(Text, { color: "gray", children: " to stop" })] })), !isRunning && totalFileChanges > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { bold: true, children: "File Changes:" }), fileChanges.created > 0 && (_jsxs(Text, { color: "green", children: [" + ", fileChanges.created, " file(s) created"] })), fileChanges.modified > 0 && (_jsxs(Text, { color: "yellow", children: [" ~ ", fileChanges.modified, " file(s) modified"] })), fileChanges.deleted > 0 && (_jsxs(Text, { color: "red", children: [" - ", fileChanges.deleted, " file(s) deleted"] }))] }))] }));
|
|
44
|
+
};
|
|
45
|
+
// Helper functions for action display
|
|
46
|
+
const getActionColor = (type) => {
|
|
47
|
+
switch (type) {
|
|
48
|
+
case 'read': return 'blue';
|
|
49
|
+
case 'write': return 'green';
|
|
50
|
+
case 'edit': return 'yellow';
|
|
51
|
+
case 'delete': return 'red';
|
|
52
|
+
case 'command': return 'magenta';
|
|
53
|
+
case 'search': return 'cyan';
|
|
54
|
+
case 'list': return 'white';
|
|
55
|
+
case 'mkdir': return 'blue';
|
|
56
|
+
case 'fetch': return 'cyan';
|
|
57
|
+
default: return 'white';
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const getActionLabel = (type) => {
|
|
61
|
+
switch (type) {
|
|
62
|
+
case 'read': return 'Reading';
|
|
63
|
+
case 'write': return 'Creating';
|
|
64
|
+
case 'edit': return 'Editing';
|
|
65
|
+
case 'delete': return 'Deleting';
|
|
66
|
+
case 'command': return 'Running';
|
|
67
|
+
case 'search': return 'Searching';
|
|
68
|
+
case 'list': return 'Listing';
|
|
69
|
+
case 'mkdir': return 'Creating dir';
|
|
70
|
+
case 'fetch': return 'Fetching';
|
|
71
|
+
default: return type.toUpperCase();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const formatTarget = (target) => {
|
|
75
|
+
// For file paths, show just the filename or last part
|
|
76
|
+
if (target.includes('/')) {
|
|
77
|
+
const parts = target.split('/');
|
|
78
|
+
const filename = parts[parts.length - 1];
|
|
79
|
+
if (parts.length > 2) {
|
|
80
|
+
return `.../${parts[parts.length - 2]}/${filename}`;
|
|
81
|
+
}
|
|
82
|
+
return target.length > 50 ? '...' + target.slice(-47) : target;
|
|
83
|
+
}
|
|
84
|
+
return target.length > 50 ? target.slice(0, 47) + '...' : target;
|
|
34
85
|
};
|
|
35
86
|
/**
|
|
36
87
|
* Single action item display
|
|
@@ -39,39 +90,14 @@ const ActionItem = ({ action }) => {
|
|
|
39
90
|
const getStatusIndicator = () => {
|
|
40
91
|
switch (action.result) {
|
|
41
92
|
case 'success':
|
|
42
|
-
return _jsx(Text, { color: "green", children: "
|
|
93
|
+
return _jsx(Text, { color: "green", children: "\u2713" });
|
|
43
94
|
case 'error':
|
|
44
|
-
return _jsx(Text, { color: "red", children: "
|
|
45
|
-
default:
|
|
46
|
-
return _jsx(Text, { color: "yellow", children: "[..]" });
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const getTypeInfo = () => {
|
|
50
|
-
switch (action.type) {
|
|
51
|
-
case 'read':
|
|
52
|
-
return { color: 'blue', label: 'READ' };
|
|
53
|
-
case 'write':
|
|
54
|
-
return { color: 'green', label: 'CREATE' };
|
|
55
|
-
case 'edit':
|
|
56
|
-
return { color: 'yellow', label: 'EDIT' };
|
|
57
|
-
case 'delete':
|
|
58
|
-
return { color: 'red', label: 'DELETE' };
|
|
59
|
-
case 'command':
|
|
60
|
-
return { color: 'magenta', label: 'EXEC' };
|
|
61
|
-
case 'search':
|
|
62
|
-
return { color: 'cyan', label: 'SEARCH' };
|
|
63
|
-
case 'list':
|
|
64
|
-
return { color: 'white', label: 'LIST' };
|
|
65
|
-
case 'mkdir':
|
|
66
|
-
return { color: 'blue', label: 'MKDIR' };
|
|
67
|
-
case 'fetch':
|
|
68
|
-
return { color: 'cyan', label: 'FETCH' };
|
|
95
|
+
return _jsx(Text, { color: "red", children: "\u2717" });
|
|
69
96
|
default:
|
|
70
|
-
return { color:
|
|
97
|
+
return _jsx(Text, { color: "yellow", children: "\u00B7" });
|
|
71
98
|
}
|
|
72
99
|
};
|
|
73
|
-
|
|
74
|
-
return (_jsxs(Text, { children: [getStatusIndicator(), ' ', _jsx(Text, { color: typeInfo.color, children: typeInfo.label.padEnd(6) }), ' ', _jsxs(Text, { children: [action.target.slice(0, 40), action.target.length > 40 ? '...' : ''] })] }));
|
|
100
|
+
return (_jsxs(Text, { children: [getStatusIndicator(), ' ', _jsx(Text, { color: getActionColor(action.type), children: getActionLabel(action.type).padEnd(10) }), ' ', _jsx(Text, { color: "gray", children: formatTarget(action.target) })] }));
|
|
75
101
|
};
|
|
76
102
|
export const AgentSummary = ({ success, iterations, actions, error, aborted, }) => {
|
|
77
103
|
const filesWritten = actions.filter(a => a.type === 'write' && a.result === 'success');
|
package/dist/utils/tools.js
CHANGED
|
@@ -893,11 +893,39 @@ export function createActionLog(toolCall, result) {
|
|
|
893
893
|
toolCall.parameters.pattern ||
|
|
894
894
|
toolCall.parameters.url ||
|
|
895
895
|
'unknown';
|
|
896
|
+
// For write/edit actions, include content preview in details
|
|
897
|
+
let details;
|
|
898
|
+
if (result.success) {
|
|
899
|
+
if (normalizedTool === 'write_file' && toolCall.parameters.content) {
|
|
900
|
+
// Show first few lines of written content
|
|
901
|
+
const content = toolCall.parameters.content;
|
|
902
|
+
const lines = content.split('\n').slice(0, 5);
|
|
903
|
+
details = lines.join('\n');
|
|
904
|
+
if (content.split('\n').length > 5) {
|
|
905
|
+
details += '\n...';
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
else if (normalizedTool === 'edit_file' && toolCall.parameters.new_text) {
|
|
909
|
+
// Show the new text being inserted
|
|
910
|
+
const newText = toolCall.parameters.new_text;
|
|
911
|
+
const lines = newText.split('\n').slice(0, 5);
|
|
912
|
+
details = lines.join('\n');
|
|
913
|
+
if (newText.split('\n').length > 5) {
|
|
914
|
+
details += '\n...';
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
details = result.output.slice(0, 200);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
details = result.error;
|
|
923
|
+
}
|
|
896
924
|
return {
|
|
897
925
|
type: typeMap[normalizedTool] || 'command',
|
|
898
926
|
target,
|
|
899
927
|
result: result.success ? 'success' : 'error',
|
|
900
|
-
details
|
|
928
|
+
details,
|
|
901
929
|
timestamp: Date.now(),
|
|
902
930
|
};
|
|
903
931
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
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",
|