codeep 1.0.107 → 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 code being written/edited by agent
18
- * Displays code progressively 10 lines at a time ABOVE agent progress
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, useRef, memo } from 'react';
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,66 +145,31 @@ const isSectionBreak = (line, prevLine) => {
145
145
  }
146
146
  return false;
147
147
  };
148
- const LINES_PER_CHUNK = 10; // Show 10 lines at a time
149
- export const LiveCodeStream = memo(({ actions, isRunning, terminalWidth = 80 }) => {
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
- // Create a unique ID for current action
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 while running
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 allLines = code.split('\n');
196
- const totalLines = allLines.length;
197
- 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';
198
163
  const actionColor = currentAction.type === 'write' ? 'green' : 'yellow';
199
- // Show lines up to visibleLineCount
200
- const linesToShow = allLines.slice(0, visibleLineCount);
201
- const hasMoreLines = visibleLineCount < totalLines;
202
- // Calculate line width based on terminal width (same as agent box)
203
- const lineWidth = Math.max(20, terminalWidth);
204
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: actionColor, children: '─'.repeat(lineWidth) }), _jsxs(Text, { children: [_jsxs(Text, { color: actionColor, bold: true, children: [actionLabel, " "] }), _jsx(Text, { color: "white", bold: true, children: filename }), _jsxs(Text, { color: "cyan", children: [" \u2022 ", langLabel, " \u2022 "] }), _jsx(Text, { color: "cyan", children: visibleLineCount }), _jsxs(Text, { color: "cyan", children: ["/", totalLines, " lines"] }), hasMoreLines && _jsx(Text, { color: "yellow", children: " \u25BC streaming..." })] }), linesToShow.map((line, i) => {
205
- const lineNum = i + 1;
206
- return (_jsxs(Text, { children: [_jsxs(Text, { color: "cyan", dimColor: true, children: [String(lineNum).padStart(4, ' '), " \u2502", ' '] }), _jsx(Text, { color: getCodeColor(line, ext), children: line.slice(0, 80) }), line.length > 80 && _jsx(Text, { color: "cyan", children: "\u2026" })] }, `line-${i}`));
207
- }), hasMoreLines && (_jsxs(Text, { color: "cyan", dimColor: true, children: [' ', "\u2502 ... ", totalLines - visibleLineCount, " more lines loading..."] })), _jsx(Text, { color: actionColor, children: '─'.repeat(lineWidth) })] }));
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"] }));
208
173
  });
209
174
  LiveCodeStream.displayName = 'LiveCodeStream';
210
175
  // Helper functions for action display
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.107",
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",