codeep 1.0.84 → 1.0.86

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.
Files changed (2) hide show
  1. package/dist/app.js +9 -13
  2. package/package.json +1 -1
package/dist/app.js CHANGED
@@ -52,6 +52,7 @@ export const App = () => {
52
52
  const [sessionId, setSessionId] = useState(getCurrentSessionId());
53
53
  const [showIntro, setShowIntro] = useState(true);
54
54
  const [clearInputTrigger, setClearInputTrigger] = useState(0);
55
+ const [screenRenderKey, setScreenRenderKey] = useState(0);
55
56
  // Project context
56
57
  const [projectPath] = useState(process.cwd());
57
58
  // Log application startup and set project path for logging
@@ -163,22 +164,17 @@ export const App = () => {
163
164
  return () => clearTimeout(timer);
164
165
  }
165
166
  }, [notification, notificationDuration]);
166
- // Track previous screen to detect transitions
167
- const [prevScreen, setPrevScreen] = useState(screen);
168
- // Clear terminal when opening modals OR when closing them back to chat
167
+ // Clear input when opening command modals and increment render key when returning to chat
169
168
  useEffect(() => {
170
169
  const commandModals = ['help', 'status', 'sessions', 'sessions-delete', 'model', 'protocol', 'language', 'settings', 'provider', 'search', 'export', 'logout'];
171
- // Clear when opening a modal
172
170
  if (commandModals.includes(screen)) {
173
- stdout?.write('\x1b[2J\x1b[3J\x1b[H');
174
171
  setClearInputTrigger(prev => prev + 1);
175
172
  }
176
- // Clear when returning to chat from a modal
177
- if (screen === 'chat' && commandModals.includes(prevScreen)) {
178
- stdout?.write('\x1b[2J\x1b[3J\x1b[H');
173
+ else if (screen === 'chat') {
174
+ // Increment render key to force re-render when returning to chat
175
+ setScreenRenderKey(prev => prev + 1);
179
176
  }
180
- setPrevScreen(screen);
181
- }, [screen, stdout, prevScreen]);
177
+ }, [screen]);
182
178
  // Handle keyboard shortcuts
183
179
  useInput((input, key) => {
184
180
  // ? to open help (only from chat screen)
@@ -1326,10 +1322,10 @@ export const App = () => {
1326
1322
  return (_jsx(ProjectPermission, { projectPath: projectPath, onComplete: handlePermissionComplete }));
1327
1323
  }
1328
1324
  if (screen === 'help') {
1329
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Help, {}), _jsx(Text, { children: "Press Escape to close" })] }));
1325
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Help, {}), _jsx(Text, { children: "Press Escape to close" })] }, "help-screen"));
1330
1326
  }
1331
1327
  if (screen === 'status') {
1332
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Status, {}), _jsx(Text, { children: "Press Escape to close" })] }));
1328
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Status, {}), _jsx(Text, { children: "Press Escape to close" })] }, "status-screen"));
1333
1329
  }
1334
1330
  if (screen === 'session-picker') {
1335
1331
  return (_jsx(SessionPicker, { projectPath: projectPath, onSelect: (loadedMessages, sessionName) => {
@@ -1415,7 +1411,7 @@ export const App = () => {
1415
1411
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1416
1412
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1417
1413
  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));
1418
- }), _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)" })) })] })] }));
1414
+ }), _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-${screenRenderKey}`));
1419
1415
  };
1420
1416
  // Model selection component
1421
1417
  const ModelSelect = ({ onClose, notify }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
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",