codeep 1.0.86 → 1.0.88

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 +17 -12
  2. package/package.json +1 -1
package/dist/app.js CHANGED
@@ -37,11 +37,21 @@ 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
+ };
40
49
  export const App = () => {
41
50
  const { exit } = useApp();
42
51
  const { stdout } = useStdout();
43
52
  // Start with 'chat' screen, will switch to login if needed after loading API key
44
53
  const [screen, setScreen] = useState('chat');
54
+ const [modalScreen, setModalScreen] = useState(null);
45
55
  const [messages, setMessages] = useState([]);
46
56
  const [inputHistory, setInputHistory] = useState([]);
47
57
  const [isLoading, setIsLoading] = useState(false);
@@ -52,7 +62,6 @@ export const App = () => {
52
62
  const [sessionId, setSessionId] = useState(getCurrentSessionId());
53
63
  const [showIntro, setShowIntro] = useState(true);
54
64
  const [clearInputTrigger, setClearInputTrigger] = useState(0);
55
- const [screenRenderKey, setScreenRenderKey] = useState(0);
56
65
  // Project context
57
66
  const [projectPath] = useState(process.cwd());
58
67
  // Log application startup and set project path for logging
@@ -164,22 +173,18 @@ export const App = () => {
164
173
  return () => clearTimeout(timer);
165
174
  }
166
175
  }, [notification, notificationDuration]);
167
- // Clear input when opening command modals and increment render key when returning to chat
176
+ // Clear input when opening command modals
168
177
  useEffect(() => {
169
178
  const commandModals = ['help', 'status', 'sessions', 'sessions-delete', 'model', 'protocol', 'language', 'settings', 'provider', 'search', 'export', 'logout'];
170
179
  if (commandModals.includes(screen)) {
171
180
  setClearInputTrigger(prev => prev + 1);
172
181
  }
173
- else if (screen === 'chat') {
174
- // Increment render key to force re-render when returning to chat
175
- setScreenRenderKey(prev => prev + 1);
176
- }
177
182
  }, [screen]);
178
183
  // Handle keyboard shortcuts
179
184
  useInput((input, key) => {
180
185
  // ? to open help (only from chat screen)
181
- if (input === '?' && screen === 'chat' && !isLoading) {
182
- setScreen('help');
186
+ if (input === '?' && screen === 'chat' && !isLoading && !modalScreen) {
187
+ setModalScreen('help');
183
188
  return;
184
189
  }
185
190
  // Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
@@ -539,10 +544,10 @@ export const App = () => {
539
544
  exit();
540
545
  break;
541
546
  case '/help':
542
- setScreen('help');
547
+ setModalScreen('help');
543
548
  break;
544
549
  case '/status':
545
- setScreen('status');
550
+ setModalScreen('status');
546
551
  break;
547
552
  case '/version': {
548
553
  const version = getCurrentVersion();
@@ -630,7 +635,7 @@ export const App = () => {
630
635
  }
631
636
  break;
632
637
  case '/settings':
633
- setScreen('settings');
638
+ setModalScreen('settings');
634
639
  break;
635
640
  case '/grant': {
636
641
  // Always open permission dialog to allow users to manage permissions
@@ -1411,7 +1416,7 @@ export const App = () => {
1411
1416
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1412
1417
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1413
1418
  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));
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
+ }), _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, {}) })), modalScreen === 'status' && (_jsx(ModalOverlay, { onClose: () => setModalScreen(null), children: _jsx(Status, {}) })), modalScreen === 'settings' && (_jsx(ModalOverlay, { onClose: () => setModalScreen(null), children: _jsx(Settings, { onClose: () => setModalScreen(null), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }) })), _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"));
1415
1420
  };
1416
1421
  // Model selection component
1417
1422
  const ModelSelect = ({ onClose, notify }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
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",