codeep 1.0.108 → 1.0.109
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.
|
@@ -14,8 +14,8 @@ interface AgentProgressProps {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const AgentProgress: React.FC<AgentProgressProps>;
|
|
16
16
|
/**
|
|
17
|
-
* Live Code Stream component - shows
|
|
18
|
-
*
|
|
17
|
+
* Live Code Stream component - shows current file operation
|
|
18
|
+
* Simplified single-line display to avoid ghost content issues
|
|
19
19
|
*/
|
|
20
20
|
interface LiveCodeStreamProps {
|
|
21
21
|
actions: ActionLog[];
|
|
@@ -3,7 +3,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
* Agent progress display component
|
|
4
4
|
* Optimized with isolated spinner animation and memoization
|
|
5
5
|
*/
|
|
6
|
-
import { useState, useEffect,
|
|
6
|
+
import { useState, useEffect, memo } from 'react';
|
|
7
7
|
import { Box, Text } from 'ink';
|
|
8
8
|
// Spinner frames for animation (no emojis)
|
|
9
9
|
const SPINNER_FRAMES = ['/', '-', '\\', '|'];
|
|
@@ -145,78 +145,31 @@ const isSectionBreak = (line, prevLine) => {
|
|
|
145
145
|
}
|
|
146
146
|
return false;
|
|
147
147
|
};
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
// Track how many lines we've shown so far
|
|
151
|
-
const [visibleLineCount, setVisibleLineCount] = useState(LINES_PER_CHUNK);
|
|
152
|
-
const lastActionIdRef = useRef('');
|
|
153
|
-
// Find the current write/edit action with code content
|
|
148
|
+
export const LiveCodeStream = memo(({ actions, isRunning }) => {
|
|
149
|
+
// Find the current write/edit action
|
|
154
150
|
const currentAction = actions.length > 0 ? actions[actions.length - 1] : null;
|
|
155
|
-
//
|
|
156
|
-
const currentActionId = currentAction
|
|
157
|
-
? `${currentAction.type}-${currentAction.target}-${currentAction.details?.length || 0}`
|
|
158
|
-
: '';
|
|
159
|
-
// Reset visible lines when action changes
|
|
160
|
-
useEffect(() => {
|
|
161
|
-
if (currentActionId !== lastActionIdRef.current) {
|
|
162
|
-
lastActionIdRef.current = currentActionId;
|
|
163
|
-
setVisibleLineCount(LINES_PER_CHUNK);
|
|
164
|
-
}
|
|
165
|
-
}, [currentActionId]);
|
|
166
|
-
// Progressively show more lines
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
if (!isRunning || !currentAction)
|
|
169
|
-
return;
|
|
170
|
-
if (currentAction.type !== 'write' && currentAction.type !== 'edit')
|
|
171
|
-
return;
|
|
172
|
-
if (!currentAction.details)
|
|
173
|
-
return;
|
|
174
|
-
const totalLines = currentAction.details.split('\n').length;
|
|
175
|
-
// If we haven't shown all lines yet, schedule showing more
|
|
176
|
-
if (visibleLineCount < totalLines) {
|
|
177
|
-
const timer = setTimeout(() => {
|
|
178
|
-
setVisibleLineCount(prev => Math.min(prev + LINES_PER_CHUNK, totalLines));
|
|
179
|
-
}, 200); // Show next 10 lines every 200ms
|
|
180
|
-
return () => clearTimeout(timer);
|
|
181
|
-
}
|
|
182
|
-
}, [isRunning, currentAction, visibleLineCount]);
|
|
183
|
-
// Only show for write/edit actions with content
|
|
151
|
+
// Only show for write/edit actions while running
|
|
184
152
|
if (!isRunning || !currentAction)
|
|
185
153
|
return null;
|
|
186
154
|
if (currentAction.type !== 'write' && currentAction.type !== 'edit')
|
|
187
155
|
return null;
|
|
188
|
-
if (!currentAction.details)
|
|
189
|
-
return null;
|
|
190
|
-
const code = currentAction.details;
|
|
191
156
|
const fullPath = currentAction.target;
|
|
192
157
|
const filename = fullPath.split('/').pop() || fullPath;
|
|
193
158
|
const ext = getFileExtension(filename);
|
|
194
159
|
const langLabel = getLanguageLabel(ext);
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const isCompleted = currentAction.result === 'success' || currentAction.result === 'error';
|
|
199
|
-
if (isCompleted) {
|
|
200
|
-
const statusIcon = currentAction.result === 'success' ? '✓' : '✗';
|
|
201
|
-
const statusColor = currentAction.result === 'success' ? 'green' : 'red';
|
|
202
|
-
const actionVerb = currentAction.type === 'write' ? 'Created' : 'Edited';
|
|
203
|
-
// Calculate how many blank lines we need to overwrite the previous code display
|
|
204
|
-
// Header (2) + code lines shown + footer (1) + loading indicator (1)
|
|
205
|
-
const previousHeight = Math.min(visibleLineCount, totalLines) + 4;
|
|
206
|
-
const blankLines = Math.max(0, previousHeight - 1); // -1 for our summary line
|
|
207
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " ", actionVerb, " ", filename, " (", totalLines, " lines)"] }), Array.from({ length: blankLines }).map((_, i) => (_jsx(Text, { children: " " }, i)))] }));
|
|
208
|
-
}
|
|
209
|
-
const actionLabel = currentAction.type === 'write' ? '✨ Creating' : '✏️ Editing';
|
|
160
|
+
const totalLines = currentAction.details?.split('\n').length || 0;
|
|
161
|
+
const actionIcon = currentAction.type === 'write' ? '✨' : '✏️';
|
|
162
|
+
const actionVerb = currentAction.type === 'write' ? 'Creating' : 'Editing';
|
|
210
163
|
const actionColor = currentAction.type === 'write' ? 'green' : 'yellow';
|
|
211
|
-
// Show
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
164
|
+
// Show completion status if available
|
|
165
|
+
if (currentAction.result === 'success') {
|
|
166
|
+
return (_jsxs(Text, { color: "green", children: ["\u2713 ", currentAction.type === 'write' ? 'Created' : 'Edited', " ", filename, " (", totalLines, " lines)"] }));
|
|
167
|
+
}
|
|
168
|
+
if (currentAction.result === 'error') {
|
|
169
|
+
return (_jsxs(Text, { color: "red", children: ["\u2717 Failed to ", currentAction.type, " ", filename] }));
|
|
170
|
+
}
|
|
171
|
+
// Show in-progress status - single line, no height changes
|
|
172
|
+
return (_jsxs(Text, { color: actionColor, children: [actionIcon, " ", actionVerb, " ", filename, " \u2022 ", langLabel, " \u2022 ", totalLines, " lines"] }));
|
|
220
173
|
});
|
|
221
174
|
LiveCodeStream.displayName = 'LiveCodeStream';
|
|
222
175
|
// Helper functions for action display
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.109",
|
|
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",
|