codeep 1.0.68 → 1.0.69

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
@@ -47,6 +47,7 @@ export const App = () => {
47
47
  const [isLoading, setIsLoading] = useState(false);
48
48
  const [streamingContent, setStreamingContent] = useState('');
49
49
  const [notification, setNotification] = useState('');
50
+ const [notificationDuration, setNotificationDuration] = useState(3000);
50
51
  const [abortController, setAbortController] = useState(null);
51
52
  const [sessionId, setSessionId] = useState(getCurrentSessionId());
52
53
  const [showIntro, setShowIntro] = useState(true);
@@ -115,6 +116,7 @@ export const App = () => {
115
116
  const agentMode = config.get('agentMode');
116
117
  if (agentMode === 'on' && !hasWrite) {
117
118
  setTimeout(() => {
119
+ setNotificationDuration(8000);
118
120
  setNotification('⚠️ Agent Mode is ON but only read access. Use /grant for write access or /agent for manual mode.');
119
121
  }, 500);
120
122
  }
@@ -131,6 +133,7 @@ export const App = () => {
131
133
  const agentMode = config.get('agentMode');
132
134
  if (agentMode === 'on') {
133
135
  setTimeout(() => {
136
+ setNotificationDuration(8000);
134
137
  setNotification('⚠️ Agent Mode is ON but no project detected. Run codeep in a project directory.');
135
138
  }, 500);
136
139
  }
@@ -167,10 +170,10 @@ export const App = () => {
167
170
  // Clear notification after delay
168
171
  useEffect(() => {
169
172
  if (notification) {
170
- const timer = setTimeout(() => setNotification(''), 3000);
173
+ const timer = setTimeout(() => setNotification(''), notificationDuration);
171
174
  return () => clearTimeout(timer);
172
175
  }
173
- }, [notification]);
176
+ }, [notification, notificationDuration]);
174
177
  // Handle keyboard shortcuts
175
178
  useInput((input, key) => {
176
179
  // Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
@@ -251,7 +254,8 @@ export const App = () => {
251
254
  }
252
255
  }
253
256
  });
254
- const notify = useCallback((msg) => {
257
+ const notify = useCallback((msg, duration = 3000) => {
258
+ setNotificationDuration(duration);
255
259
  setNotification(msg);
256
260
  }, []);
257
261
  // Start agent execution
@@ -410,10 +414,10 @@ export const App = () => {
410
414
  logger.debug(`[handleSubmit] agentMode=${agentMode}, hasWriteAccess=${hasWriteAccess}, hasProjectContext=${!!projectContext}`);
411
415
  if (agentMode === 'on') {
412
416
  if (!projectContext) {
413
- notify('⚠️ Agent Mode ON: Requires project directory. Using chat mode instead.');
417
+ notify('⚠️ Agent Mode ON: Requires project directory. Using chat mode instead.', 8000);
414
418
  }
415
419
  else if (!hasWriteAccess) {
416
- notify('⚠️ Agent Mode ON: Write permission required. Grant with /grant or using chat mode.');
420
+ notify('⚠️ Agent Mode ON: Write permission required. Grant with /grant or using chat mode.', 8000);
417
421
  }
418
422
  else {
419
423
  notify('✓ Using agent mode (change in /settings)');
@@ -1277,7 +1281,7 @@ export const App = () => {
1277
1281
  const agentMode = config.get('agentMode');
1278
1282
  if (agentMode === 'on' && !writeGranted) {
1279
1283
  setTimeout(() => {
1280
- notify('⚠️ Agent Mode is ON but write access not granted. Use /grant for full agent or /agent for manual.');
1284
+ notify('⚠️ Agent Mode is ON but write access not granted. Use /grant for full agent or /agent for manual.', 8000);
1281
1285
  }, 100);
1282
1286
  }
1283
1287
  }
@@ -1287,7 +1291,7 @@ export const App = () => {
1287
1291
  const agentMode = config.get('agentMode');
1288
1292
  if (agentMode === 'on') {
1289
1293
  setTimeout(() => {
1290
- notify('⚠️ Agent Mode is ON but project access denied. Agent cannot run.');
1294
+ notify('⚠️ Agent Mode is ON but project access denied. Agent cannot run.', 8000);
1291
1295
  }, 100);
1292
1296
  }
1293
1297
  }
@@ -1349,7 +1353,7 @@ export const App = () => {
1349
1353
  }, onCancel: () => setScreen('chat') }));
1350
1354
  }
1351
1355
  if (screen === 'settings') {
1352
- return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify }));
1356
+ return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }));
1353
1357
  }
1354
1358
  if (screen === 'search') {
1355
1359
  return (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
@@ -1390,7 +1394,7 @@ export const App = () => {
1390
1394
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1391
1395
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1392
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));
1393
- }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Apply changes? ", _jsx(Text, { color: "#f02a30", bold: true, children: "[Y/n]" })] }), _jsx(Text, { color: "gray", 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)) })] }), _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" })] }) })] }));
1397
+ }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Apply changes? ", _jsx(Text, { color: "#f02a30", bold: true, children: "[Y/n]" })] }), _jsx(Text, { color: "gray", 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" })) : (_jsxs(Text, { color: "yellow", children: ["Agent: ON (inactive - ", !projectContext ? 'no project' : 'no write access', ")"] }))) : (_jsx(Text, { color: "gray", children: "Agent: Manual (use /agent)" })) })] })] }));
1394
1398
  };
1395
1399
  // Model selection component
1396
1400
  const ModelSelect = ({ onClose, notify }) => {
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  interface SettingsProps {
3
3
  onClose: () => void;
4
4
  notify: (msg: string) => void;
5
+ hasWriteAccess?: boolean;
6
+ hasProjectContext?: boolean;
5
7
  }
6
8
  export declare const Settings: React.FC<SettingsProps>;
7
9
  export {};
@@ -97,7 +97,7 @@ const SETTINGS = [
97
97
  step: 10,
98
98
  },
99
99
  ];
100
- export const Settings = ({ onClose, notify }) => {
100
+ export const Settings = ({ onClose, notify, hasWriteAccess = false, hasProjectContext = false }) => {
101
101
  const [selected, setSelected] = useState(0);
102
102
  const [editing, setEditing] = useState(false);
103
103
  const [editValue, setEditValue] = useState('');
@@ -185,5 +185,14 @@ export const Settings = ({ onClose, notify }) => {
185
185
  }
186
186
  }
187
187
  });
188
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Settings" }), _jsx(Text, { children: " " }), SETTINGS.map((setting, i) => (_jsx(Box, { children: _jsxs(Text, { children: [i === selected ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsxs(Text, { color: i === selected ? '#f02a30' : undefined, children: [setting.label, ":"] }), _jsx(Text, { children: " " }), editing && i === selected ? (_jsx(Text, { color: "cyan", inverse: true, children: editValue || ' ' })) : (_jsx(Text, { color: "green", children: setting.value() })), i === selected && setting.type === 'number' && !editing && (_jsx(Text, { children: " (\u2190/\u2192 adjust, Enter to type)" })), i === selected && setting.type === 'select' && (_jsx(Text, { children: " (\u2190/\u2192 or Enter to toggle)" }))] }) }, setting.key))), _jsx(Text, { children: " " }), _jsx(Text, { children: "\u2191/\u2193 Navigate | \u2190/\u2192 Adjust | Enter Edit | Esc Close" })] }));
188
+ const agentMode = config.get('agentMode');
189
+ const agentCanRun = agentMode === 'on' && hasWriteAccess && hasProjectContext;
190
+ const agentStatusMessage = agentMode === 'on'
191
+ ? (!hasProjectContext
192
+ ? '⚠️ No project detected - agent cannot run'
193
+ : (!hasWriteAccess
194
+ ? '⚠️ No write access - use /grant or agent runs in chat mode'
195
+ : '✓ Agent will run automatically'))
196
+ : 'ℹ️ Use /agent <task> to run agent manually';
197
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Settings" }), _jsx(Text, { children: " " }), SETTINGS.map((setting, i) => (_jsx(Box, { children: _jsxs(Text, { children: [i === selected ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsxs(Text, { color: i === selected ? '#f02a30' : undefined, children: [setting.label, ":"] }), _jsx(Text, { children: " " }), editing && i === selected ? (_jsx(Text, { color: "cyan", inverse: true, children: editValue || ' ' })) : (_jsx(Text, { color: "green", children: setting.value() })), i === selected && setting.type === 'number' && !editing && (_jsx(Text, { children: " (\u2190/\u2192 adjust, Enter to type)" })), i === selected && setting.type === 'select' && (_jsx(Text, { children: " (\u2190/\u2192 or Enter to toggle)" }))] }) }, setting.key))), _jsx(Text, { children: " " }), _jsx(Text, { color: agentCanRun ? 'green' : (agentMode === 'on' ? 'yellow' : 'gray'), children: agentStatusMessage }), _jsx(Text, { children: " " }), _jsx(Text, { children: "\u2191/\u2193 Navigate | \u2190/\u2192 Adjust | Enter Edit | Esc Close" })] }));
189
198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
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",