codeep 1.0.108 → 1.0.110

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
@@ -37,21 +37,11 @@ import { learnFromProject, addCustomRule, getLearningStatus } from './utils/lear
37
37
  import { getAllSkills, findSkill, formatSkillsList, formatSkillHelp, generateSkillPrompt, saveCustomSkill, deleteCustomSkill, parseSkillChain, parseSkillArgs, searchSkills, trackSkillUsage, getSkillStats } from './utils/skills.js';
38
38
  import { AgentProgress, AgentSummary, LiveCodeStream } from './components/AgentProgress.js';
39
39
  import { createActionLog } from './utils/tools.js';
40
- // Modal overlay component - renders modal content on top of chat
41
- const ModalOverlay = ({ children, onClose }) => {
42
- useInput((input, key) => {
43
- if (key.escape) {
44
- onClose();
45
- }
46
- });
47
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, marginTop: 2, marginBottom: 2, children: [children, _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "cyan", children: "Press Escape to close" }) })] }));
48
- };
49
40
  export const App = () => {
50
41
  const { exit } = useApp();
51
42
  const { stdout } = useStdout();
52
43
  // Start with 'chat' screen, will switch to login if needed after loading API key
53
44
  const [screen, setScreen] = useState('chat');
54
- const [modalScreen, setModalScreen] = useState(null);
55
45
  const [messages, setMessages] = useState([]);
56
46
  const [inputHistory, setInputHistory] = useState([]);
57
47
  const [isLoading, setIsLoading] = useState(false);
@@ -173,12 +163,6 @@ export const App = () => {
173
163
  return () => clearTimeout(timer);
174
164
  }
175
165
  }, [notification, notificationDuration]);
176
- // Clear input when opening modals
177
- useEffect(() => {
178
- if (modalScreen !== null) {
179
- setClearInputTrigger(prev => prev + 1);
180
- }
181
- }, [modalScreen]);
182
166
  // Handle keyboard shortcuts
183
167
  useInput((input, key) => {
184
168
  // Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
@@ -538,10 +522,10 @@ export const App = () => {
538
522
  exit();
539
523
  break;
540
524
  case '/help':
541
- setModalScreen('help');
525
+ setScreen('help');
542
526
  break;
543
527
  case '/status':
544
- setModalScreen('status');
528
+ setScreen('status');
545
529
  break;
546
530
  case '/version': {
547
531
  const version = getCurrentVersion();
@@ -629,7 +613,7 @@ export const App = () => {
629
613
  }
630
614
  break;
631
615
  case '/settings':
632
- setModalScreen('settings');
616
+ setScreen('settings');
633
617
  break;
634
618
  case '/grant': {
635
619
  // Always open permission dialog to allow users to manage permissions
@@ -1410,7 +1394,7 @@ export const App = () => {
1410
1394
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1411
1395
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1412
1396
  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));
1413
- }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Apply changes? ", _jsx(Text, { color: "#f02a30", bold: true, children: "[Y/n]" })] }), _jsx(Text, { color: "cyan", children: "Press Y to apply, N or Esc to reject" })] })), notification && (_jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: "cyan", children: notification }) })), modalScreen === 'help' && (_jsx(ModalOverlay, { onClose: () => setModalScreen(null), children: _jsx(Help, {}) }, "help-modal")), modalScreen === 'status' && (_jsx(ModalOverlay, { onClose: () => setModalScreen(null), children: _jsx(Status, {}) }, "status-modal")), modalScreen === 'settings' && (_jsx(ModalOverlay, { onClose: () => setModalScreen(null), children: _jsx(Settings, { onClose: () => setModalScreen(null), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }) }, "settings-modal")), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "#f02a30", children: '─'.repeat(Math.max(20, stdout?.columns || 80)) }), _jsx(Box, { paddingX: 1, children: _jsx(ChatInput, { onSubmit: handleSubmit, disabled: isLoading || isAgentRunning || pendingFileChanges.length > 0, history: inputHistory, clearTrigger: clearInputTrigger }) }), _jsx(Text, { color: "#f02a30", children: '─'.repeat(Math.max(20, stdout?.columns || 80)) })] }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Ctrl+V" }), _jsx(Text, { children: " Paste " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Ctrl+L" }), _jsx(Text, { children: " Clear " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Esc" }), _jsx(Text, { children: " Cancel " }), _jsx(Text, { color: "#f02a30", bold: true, children: "\u2191\u2193" }), _jsx(Text, { children: " History " }), _jsx(Text, { color: "#f02a30", bold: true, children: "/help" }), _jsx(Text, { children: " Commands" })] }) }), _jsx(Box, { children: config.get('agentMode') === 'on' ? (hasWriteAccess && projectContext ? (_jsx(Text, { color: "green", children: "Agent: ON \u2713" })) : (_jsx(Text, { color: "yellow", children: "Agent: ON (no permission - use /grant)" }))) : (_jsx(Text, { color: "cyan", children: "Agent: Manual (use /agent)" })) })] })] }, "chat-screen"));
1397
+ }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Apply changes? ", _jsx(Text, { color: "#f02a30", bold: true, children: "[Y/n]" })] }), _jsx(Text, { color: "cyan", children: "Press Y to apply, N or Esc to reject" })] })), notification && (_jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: "cyan", children: notification }) })), _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "#f02a30", children: '─'.repeat(Math.max(20, stdout?.columns || 80)) }), _jsx(Box, { paddingX: 1, children: _jsx(ChatInput, { onSubmit: handleSubmit, disabled: isLoading || isAgentRunning || pendingFileChanges.length > 0, history: inputHistory, clearTrigger: clearInputTrigger }) }), _jsx(Text, { color: "#f02a30", children: '─'.repeat(Math.max(20, stdout?.columns || 80)) })] }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Ctrl+V" }), _jsx(Text, { children: " Paste " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Ctrl+L" }), _jsx(Text, { children: " Clear " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Esc" }), _jsx(Text, { children: " Cancel " }), _jsx(Text, { color: "#f02a30", bold: true, children: "\u2191\u2193" }), _jsx(Text, { children: " History " }), _jsx(Text, { color: "#f02a30", bold: true, children: "/help" }), _jsx(Text, { children: " Commands" })] }) }), _jsx(Box, { children: config.get('agentMode') === 'on' ? (hasWriteAccess && projectContext ? (_jsx(Text, { color: "green", children: "Agent: ON \u2713" })) : (_jsx(Text, { color: "yellow", children: "Agent: ON (no permission - use /grant)" }))) : (_jsx(Text, { color: "cyan", children: "Agent: Manual (use /agent)" })) })] })] }, "chat-screen"));
1414
1398
  };
1415
1399
  // Model selection component
1416
1400
  const ModelSelect = ({ onClose, notify }) => {
@@ -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,78 +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
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
- // When action completes, show compact summary with blank lines to overwrite ghost
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 lines up to visibleLineCount
212
- const linesToShow = allLines.slice(0, visibleLineCount);
213
- const hasMoreLines = visibleLineCount < totalLines;
214
- // Calculate line width based on terminal width (same as agent box)
215
- const lineWidth = Math.max(20, terminalWidth);
216
- 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) => {
217
- const lineNum = i + 1;
218
- 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}`));
219
- }), 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"] }));
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.108",
3
+ "version": "1.0.110",
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",