codeep 1.0.60 → 1.0.62

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 CHANGED
@@ -273,14 +273,34 @@ export const App = () => {
273
273
  setAgentIteration(iteration);
274
274
  },
275
275
  onToolCall: (tool) => {
276
- // Create a placeholder action - will be updated by onToolResult
277
- const placeholderResult = {
278
- success: true,
279
- output: '',
280
- tool: tool.tool,
281
- parameters: tool.parameters,
276
+ // Create action log with content for live code preview
277
+ // For write/edit actions, include content immediately so it shows while agent works
278
+ const toolName = tool.tool.toLowerCase().replace(/-/g, '_');
279
+ let details;
280
+ if (toolName === 'write_file' && tool.parameters.content) {
281
+ details = tool.parameters.content;
282
+ }
283
+ else if (toolName === 'edit_file' && tool.parameters.new_text) {
284
+ details = tool.parameters.new_text;
285
+ }
286
+ const actionLog = {
287
+ type: toolName === 'write_file' ? 'write' :
288
+ toolName === 'edit_file' ? 'edit' :
289
+ toolName === 'read_file' ? 'read' :
290
+ toolName === 'delete_file' ? 'delete' :
291
+ toolName === 'execute_command' ? 'command' :
292
+ toolName === 'search_code' ? 'search' :
293
+ toolName === 'list_files' ? 'list' :
294
+ toolName === 'create_directory' ? 'mkdir' :
295
+ toolName === 'fetch_url' ? 'fetch' : 'command',
296
+ target: tool.parameters.path ||
297
+ tool.parameters.command ||
298
+ tool.parameters.pattern ||
299
+ tool.parameters.url || 'unknown',
300
+ result: 'success', // Will be updated by onToolResult
301
+ details,
302
+ timestamp: Date.now(),
282
303
  };
283
- const actionLog = createActionLog(tool, placeholderResult);
284
304
  setAgentActions(prev => [...prev, actionLog]);
285
305
  },
286
306
  onToolResult: (result, toolCall) => {
@@ -13,9 +13,8 @@ interface AgentProgressProps {
13
13
  }
14
14
  export declare const AgentProgress: React.FC<AgentProgressProps>;
15
15
  /**
16
- * Live Code Stream component - shows ALL code being written/edited by agent
17
- * Displayed ABOVE the AgentProgress component
18
- * Enhanced with better syntax highlighting and visual organization
16
+ * Live Code Stream component - shows code being written/edited by agent
17
+ * FIXED HEIGHT to prevent layout shift and empty lines
19
18
  */
20
19
  interface LiveCodeStreamProps {
21
20
  actions: ActionLog[];
@@ -139,6 +139,7 @@ const isSectionBreak = (line, prevLine) => {
139
139
  }
140
140
  return false;
141
141
  };
142
+ const LIVE_CODE_LINES = 8; // Fixed number of visible lines
142
143
  export const LiveCodeStream = ({ actions, isRunning }) => {
143
144
  // Find the current write/edit action with code content
144
145
  const currentAction = actions.length > 0 ? actions[actions.length - 1] : null;
@@ -158,12 +159,19 @@ export const LiveCodeStream = ({ actions, isRunning }) => {
158
159
  const totalLines = allLines.length;
159
160
  const actionLabel = currentAction.type === 'write' ? '✨ Creating' : '✏️ Editing';
160
161
  const actionColor = currentAction.type === 'write' ? 'green' : 'yellow';
161
- // Show last 10 lines (most recent code being written)
162
- const WINDOW_SIZE = 10;
163
- const startLine = Math.max(0, totalLines - WINDOW_SIZE);
164
- const linesToShow = allLines.slice(startLine, totalLines);
165
- const linesAbove = startLine;
166
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { color: actionColor, bold: true, children: [actionLabel, " "] }), _jsx(Text, { color: "white", bold: true, children: filename }), _jsxs(Text, { color: "gray", children: [" \u2022 ", langLabel, " \u2022 "] }), _jsx(Text, { color: "cyan", children: totalLines }), _jsx(Text, { color: "gray", children: " lines" })] }), _jsx(Text, { color: actionColor, children: '─'.repeat(76) }), linesAbove > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" \u22EE ", linesAbove, " lines above"] })), linesToShow.map((line, i) => (_jsxs(Text, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: [String(startLine + i + 1).padStart(4, ' '), " \u2502", ' '] }), _jsx(Text, { color: getCodeColor(line, ext), children: line.slice(0, 68) }), line.length > 68 && _jsx(Text, { color: "gray", children: "\u2026" })] }, `line-${startLine + i}`))), _jsx(Text, { color: actionColor, children: '─'.repeat(76) })] }));
162
+ // Show last N lines (sliding window)
163
+ const startLine = Math.max(0, totalLines - LIVE_CODE_LINES);
164
+ const visibleLines = allLines.slice(startLine, totalLines);
165
+ // Pad to fixed height to prevent layout shift
166
+ const paddedLines = [...visibleLines];
167
+ while (paddedLines.length < LIVE_CODE_LINES) {
168
+ paddedLines.push('');
169
+ }
170
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsxs(Text, { color: actionColor, bold: true, children: [actionLabel, " "] }), _jsx(Text, { color: "white", bold: true, children: filename }), _jsxs(Text, { color: "gray", children: [" \u2022 ", langLabel, " \u2022 "] }), _jsx(Text, { color: "cyan", children: totalLines }), _jsx(Text, { color: "gray", children: " lines" }), startLine > 0 && _jsxs(Text, { color: "gray", dimColor: true, children: [" (showing ", startLine + 1, "-", totalLines, ")"] })] }), paddedLines.map((line, i) => {
171
+ const lineNum = startLine + i + 1;
172
+ const isRealLine = i < visibleLines.length;
173
+ return (_jsxs(Text, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: [isRealLine ? String(lineNum).padStart(4, ' ') : ' ', " \u2502", ' '] }), isRealLine ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: getCodeColor(line, ext), children: line.slice(0, 70) }), line.length > 70 && _jsx(Text, { color: "gray", children: "\u2026" })] })) : (_jsx(Text, { children: " " }))] }, `fixed-line-${i}`));
174
+ })] }));
167
175
  };
168
176
  // Helper functions for action display
169
177
  const getActionColor = (type) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
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",