codeep 1.0.56 → 1.0.58
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 +1 -1
- package/dist/components/AgentProgress.js +28 -18
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -1330,7 +1330,7 @@ export const App = () => {
|
|
|
1330
1330
|
return (_jsx(LanguageSelect, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1331
1331
|
}
|
|
1332
1332
|
// Main chat screen
|
|
1333
|
-
return (_jsxs(Box, { flexDirection: "column", children: [messages.length === 0 && !isLoading && _jsx(Logo, {}), messages.length === 0 && !isLoading && (_jsx(Box, { justifyContent: "center", children: _jsxs(Text, { children: ["Connected to ", _jsx(Text, { color: "#f02a30", children: config.get('model') }), ". Type ", _jsx(Text, { color: "#f02a30", children: "/help" }), " for commands."] }) })), _jsx(MessageList, { messages: messages, streamingContent: streamingContent, scrollOffset: 0, terminalHeight: stdout.rows || 24 }, sessionId), isLoading && !isAgentRunning && _jsx(Loading, { isStreaming: !!streamingContent }), isAgentRunning && (_jsx(LiveCodeStream, { actions: agentActions, isRunning: true })
|
|
1333
|
+
return (_jsxs(Box, { flexDirection: "column", children: [messages.length === 0 && !isLoading && _jsx(Logo, {}), messages.length === 0 && !isLoading && (_jsx(Box, { justifyContent: "center", children: _jsxs(Text, { children: ["Connected to ", _jsx(Text, { color: "#f02a30", children: config.get('model') }), ". Type ", _jsx(Text, { color: "#f02a30", children: "/help" }), " for commands."] }) })), _jsx(MessageList, { messages: messages, streamingContent: streamingContent, scrollOffset: 0, terminalHeight: stdout.rows || 24 }, sessionId), isLoading && !isAgentRunning && _jsx(Loading, { isStreaming: !!streamingContent }), isAgentRunning && (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: agentDryRun ? 'yellow' : '#f02a30', marginY: 1, children: [_jsx(LiveCodeStream, { actions: agentActions, isRunning: true }), _jsx(AgentProgress, { isRunning: true, iteration: agentIteration, maxIterations: 50, actions: agentActions, currentThinking: agentThinking, dryRun: agentDryRun })] })), !isAgentRunning && agentResult && (_jsx(AgentSummary, { success: agentResult.success, iterations: agentResult.iterations, actions: agentActions, error: agentResult.error, aborted: agentResult.aborted })), pendingFileChanges.length > 0 && !isLoading && (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, marginY: 1, children: [_jsxs(Text, { color: "#f02a30", bold: true, children: ["\u2713 Detected ", pendingFileChanges.length, " file change(s):"] }), pendingFileChanges.map((change, i) => {
|
|
1334
1334
|
const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
|
|
1335
1335
|
const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
|
|
1336
1336
|
return (_jsxs(Text, { children: ["\u2022 ", _jsxs(Text, { color: actionColor, children: ["[", actionLabel, "]"] }), " ", change.path, change.action !== 'delete' && change.content.includes('\n') && ` (${change.content.split('\n').length} lines)`] }, i));
|
|
@@ -40,7 +40,7 @@ export const AgentProgress = ({ isRunning, iteration, maxIterations, actions, cu
|
|
|
40
40
|
deleted: actions.filter(a => a.type === 'delete' && a.result === 'success').length,
|
|
41
41
|
};
|
|
42
42
|
const totalFileChanges = fileChanges.created + fileChanges.modified + fileChanges.deleted;
|
|
43
|
-
return (_jsxs(Box, { flexDirection: "column",
|
|
43
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 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, { marginTop: 1, 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) })] })), _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
44
|
};
|
|
45
45
|
// Get file extension for language detection
|
|
46
46
|
const getFileExtension = (filename) => {
|
|
@@ -143,6 +143,7 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
143
143
|
// Use ref for tracking to avoid re-render loops
|
|
144
144
|
const lastActionIdRef = useRef(null);
|
|
145
145
|
const timerRef = useRef(null);
|
|
146
|
+
const totalLinesRef = useRef(0);
|
|
146
147
|
// State for visible lines - only update when batch is ready
|
|
147
148
|
const [displayState, setDisplayState] = useState({
|
|
148
149
|
endLine: 0,
|
|
@@ -150,10 +151,13 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
150
151
|
});
|
|
151
152
|
// Find the current write/edit action with code content
|
|
152
153
|
const currentAction = actions.length > 0 ? actions[actions.length - 1] : null;
|
|
154
|
+
// Only show for write/edit actions
|
|
155
|
+
const isWriteOrEdit = currentAction && (currentAction.type === 'write' || currentAction.type === 'edit');
|
|
153
156
|
// Create a unique ID for the current action
|
|
154
157
|
const actionId = currentAction ? `${currentAction.target}-${currentAction.timestamp}` : null;
|
|
155
|
-
// Get total lines for current action
|
|
158
|
+
// Get total lines for current action and store in ref
|
|
156
159
|
const totalLines = currentAction?.details ? currentAction.details.split('\n').length : 0;
|
|
160
|
+
totalLinesRef.current = totalLines;
|
|
157
161
|
// Stream lines progressively using interval instead of recursive setTimeout
|
|
158
162
|
useEffect(() => {
|
|
159
163
|
// Clear any existing timer
|
|
@@ -161,7 +165,8 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
161
165
|
clearInterval(timerRef.current);
|
|
162
166
|
timerRef.current = null;
|
|
163
167
|
}
|
|
164
|
-
|
|
168
|
+
// Only stream for write/edit actions with content
|
|
169
|
+
if (!currentAction || !currentAction.details || !isRunning || !isWriteOrEdit) {
|
|
165
170
|
if (displayState.endLine !== 0 || displayState.actionId !== null) {
|
|
166
171
|
setDisplayState({ endLine: 0, actionId: null });
|
|
167
172
|
}
|
|
@@ -170,19 +175,24 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
170
175
|
// If this is a new action, reset and start streaming
|
|
171
176
|
if (actionId !== lastActionIdRef.current) {
|
|
172
177
|
lastActionIdRef.current = actionId;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
const initialLines = Math.min(10, totalLinesRef.current);
|
|
179
|
+
setDisplayState({ endLine: initialLines, actionId });
|
|
180
|
+
// Only start interval if there are more lines to show
|
|
181
|
+
if (totalLinesRef.current > 10) {
|
|
182
|
+
timerRef.current = setInterval(() => {
|
|
183
|
+
setDisplayState(prev => {
|
|
184
|
+
// Use ref to get current totalLines value
|
|
185
|
+
const currentTotal = totalLinesRef.current;
|
|
186
|
+
const newEndLine = Math.min(prev.endLine + 10, currentTotal);
|
|
187
|
+
// Stop interval when we've shown all lines
|
|
188
|
+
if (newEndLine >= currentTotal && timerRef.current) {
|
|
189
|
+
clearInterval(timerRef.current);
|
|
190
|
+
timerRef.current = null;
|
|
191
|
+
}
|
|
192
|
+
return { ...prev, endLine: newEndLine };
|
|
193
|
+
});
|
|
194
|
+
}, 150);
|
|
195
|
+
}
|
|
186
196
|
}
|
|
187
197
|
return () => {
|
|
188
198
|
if (timerRef.current) {
|
|
@@ -190,7 +200,7 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
190
200
|
timerRef.current = null;
|
|
191
201
|
}
|
|
192
202
|
};
|
|
193
|
-
}, [actionId, isRunning,
|
|
203
|
+
}, [actionId, isRunning, isWriteOrEdit]);
|
|
194
204
|
// Only show for write/edit actions with content while running
|
|
195
205
|
if (!isRunning || !currentAction)
|
|
196
206
|
return null;
|
|
@@ -214,7 +224,7 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
|
|
|
214
224
|
const linesToShow = allLines.slice(startLine, visibleEndLine);
|
|
215
225
|
const remainingLines = totalLines - visibleEndLine;
|
|
216
226
|
const linesAbove = startLine;
|
|
217
|
-
return (_jsxs(Box, { flexDirection: "column",
|
|
227
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsxs(Text, { color: actionColor, bold: true, children: [actionLabel, " "] }), _jsx(Text, { color: "white", bold: true, children: filename })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "gray", children: [langLabel, " \u2022 "] }), _jsx(Text, { color: "cyan", children: visibleEndLine }), _jsxs(Text, { color: "gray", children: ["/", totalLines, " lines"] }), remainingLines > 0 && (_jsx(Text, { color: "yellow", children: " \u25BC streaming..." }))] })] }), fullPath !== filename && (_jsxs(Text, { color: "gray", dimColor: true, children: [" \uD83D\uDCC1 ", fullPath] })), _jsx(Text, { color: actionColor, children: '─'.repeat(80) }), linesAbove > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" \u22EE ", linesAbove, " lines above"] })), _jsx(Box, { flexDirection: "column", children: linesToShow.map((line, i) => {
|
|
218
228
|
const lineNum = startLine + i + 1;
|
|
219
229
|
const lineColor = getCodeColor(line, ext);
|
|
220
230
|
return (_jsxs(Text, { children: [_jsx(Text, { color: "gray", dimColor: true, children: String(lineNum).padStart(4, ' ') }), _jsx(Text, { color: "gray", dimColor: true, children: " \u2502 " }), _jsx(Text, { color: lineColor, children: line.slice(0, 72) }), line.length > 72 && _jsx(Text, { color: "gray", children: "\u2026" })] }, i));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
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",
|