codeep 1.0.75 → 1.0.77

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
@@ -96,50 +96,37 @@ export const App = () => {
96
96
  setScreen('login');
97
97
  });
98
98
  }, []);
99
- // Check project permission after intro
99
+ // Check folder permission after intro
100
100
  useEffect(() => {
101
101
  if (!showIntro && !permissionChecked && screen !== 'login') {
102
102
  const isProject = isProjectDirectory(projectPath);
103
103
  setIsInProject(isProject);
104
- if (isProject) {
105
- const hasRead = hasReadPermission(projectPath);
106
- if (hasRead) {
107
- // Already has permission, load context
108
- setHasProjectAccess(true);
109
- const hasWrite = hasWritePermission(projectPath);
110
- setHasWriteAccess(hasWrite);
111
- const ctx = getProjectContext(projectPath);
112
- if (ctx) {
113
- ctx.hasWriteAccess = hasWrite;
114
- }
115
- setProjectContext(ctx);
116
- setPermissionChecked(true);
117
- // Warn user if Agent Mode is ON but only read permission exists
118
- const agentMode = config.get('agentMode');
119
- if (agentMode === 'on' && !hasWrite) {
120
- setTimeout(() => {
121
- setNotificationDuration(8000);
122
- setNotification('⚠️ Agent Mode ON: Needs write permission to work. Use /grant to enable or /agent for manual mode.');
123
- }, 500);
124
- }
125
- }
126
- else {
127
- // Need to ask for permission
128
- setScreen('permission');
129
- setPermissionChecked(true);
130
- }
131
- }
132
- else {
104
+ const hasRead = hasReadPermission(projectPath);
105
+ if (hasRead) {
106
+ // Already has permission, load context
107
+ setHasProjectAccess(true);
108
+ const hasWrite = hasWritePermission(projectPath);
109
+ setHasWriteAccess(hasWrite);
110
+ const ctx = getProjectContext(projectPath);
111
+ if (ctx) {
112
+ ctx.hasWriteAccess = hasWrite;
113
+ }
114
+ setProjectContext(ctx);
133
115
  setPermissionChecked(true);
134
- // Warn user if Agent Mode is ON but not in a project directory
116
+ // Warn user if Agent Mode is ON but only read permission exists
135
117
  const agentMode = config.get('agentMode');
136
- if (agentMode === 'on') {
118
+ if (agentMode === 'on' && !hasWrite) {
137
119
  setTimeout(() => {
138
120
  setNotificationDuration(8000);
139
- setNotification('⚠️ Agent Mode ON: No project detected here. Open terminal in a project folder and run codeep there.');
121
+ setNotification('⚠️ Agent Mode ON: Needs write permission. Use /grant to enable or /agent for manual mode.');
140
122
  }, 500);
141
123
  }
142
124
  }
125
+ else {
126
+ // Need to ask for permission
127
+ setScreen('permission');
128
+ setPermissionChecked(true);
129
+ }
143
130
  }
144
131
  }, [showIntro, permissionChecked, projectPath, screen]);
145
132
  // Show session picker after permission is handled (instead of auto-loading)
@@ -176,6 +163,12 @@ export const App = () => {
176
163
  return () => clearTimeout(timer);
177
164
  }
178
165
  }, [notification, notificationDuration]);
166
+ // Clear terminal when opening modals
167
+ useEffect(() => {
168
+ if (screen !== 'chat' && screen !== 'login') {
169
+ stdout?.write('\x1b[2J\x1b[H');
170
+ }
171
+ }, [screen, stdout]);
179
172
  // Handle keyboard shortcuts
180
173
  useInput((input, key) => {
181
174
  // Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
@@ -185,6 +178,8 @@ export const App = () => {
185
178
  stdout?.write('\x1b[2J\x1b[H');
186
179
  setMessages([]);
187
180
  clearCodeBlocks();
181
+ setAgentResult(null);
182
+ setAgentActions([]);
188
183
  const newSessId = startNewSession();
189
184
  setSessionId(newSessId);
190
185
  setClearInputTrigger(prev => prev + 1); // Trigger input clear
@@ -415,14 +410,11 @@ export const App = () => {
415
410
  const agentMode = config.get('agentMode');
416
411
  logger.debug(`[handleSubmit] agentMode=${agentMode}, hasWriteAccess=${hasWriteAccess}, hasProjectContext=${!!projectContext}, isInProject=${isInProject}`);
417
412
  if (agentMode === 'on') {
418
- if (!isInProject) {
419
- notify('⚠️ Agent Mode ON: No project detected. Open terminal in a project folder and run codeep there.', 8000);
420
- }
421
- else if (!hasWriteAccess) {
413
+ if (!hasWriteAccess) {
422
414
  notify('⚠️ Agent Mode ON: Needs write permission. Use /grant to enable.', 8000);
423
415
  }
424
416
  else if (!projectContext) {
425
- notify('⚠️ Agent Mode ON: Needs permission. Use /grant to allow project access.', 8000);
417
+ notify('⚠️ Agent Mode ON: Needs permission. Use /grant to allow folder access.', 8000);
426
418
  }
427
419
  else {
428
420
  notify('✓ Using agent mode (change in /settings)');
@@ -630,16 +622,7 @@ export const App = () => {
630
622
  setScreen('settings');
631
623
  break;
632
624
  case '/grant': {
633
- // Grant write permission for agent mode
634
- if (!projectContext) {
635
- notify('No project detected. Open terminal in a project folder and run codeep there.');
636
- break;
637
- }
638
- if (hasWriteAccess) {
639
- notify('Write permission already granted. Agent Mode is ready.');
640
- break;
641
- }
642
- // Open permission dialog to grant write access
625
+ // Always open permission dialog to allow users to manage permissions
643
626
  setScreen('permission');
644
627
  break;
645
628
  }
@@ -1372,7 +1355,7 @@ export const App = () => {
1372
1355
  }, onCancel: () => setScreen('chat') }));
1373
1356
  }
1374
1357
  if (screen === 'settings') {
1375
- return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext, isInProject: isInProject }));
1358
+ return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }));
1376
1359
  }
1377
1360
  if (screen === 'search') {
1378
1361
  return (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
@@ -1413,7 +1396,7 @@ export const App = () => {
1413
1396
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1414
1397
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1415
1398
  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));
1416
- }), _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 (", !isInProject ? 'no project - run codeep in project folder' : 'no permission - use /grant', ")"] }))) : (_jsx(Text, { color: "gray", children: "Agent: Manual (use /agent)" })) })] })] }));
1399
+ }), _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" })) : (_jsx(Text, { color: "yellow", children: "Agent: ON (no permission - use /grant)" }))) : (_jsx(Text, { color: "gray", children: "Agent: Manual (use /agent)" })) })] })] }));
1417
1400
  };
1418
1401
  // Model selection component
1419
1402
  const ModelSelect = ({ onClose, notify }) => {
@@ -4,7 +4,6 @@ interface SettingsProps {
4
4
  notify: (msg: string) => void;
5
5
  hasWriteAccess?: boolean;
6
6
  hasProjectContext?: boolean;
7
- isInProject?: boolean;
8
7
  }
9
8
  export declare const Settings: React.FC<SettingsProps>;
10
9
  export {};
@@ -97,7 +97,7 @@ const SETTINGS = [
97
97
  step: 10,
98
98
  },
99
99
  ];
100
- export const Settings = ({ onClose, notify, hasWriteAccess = false, hasProjectContext = false, isInProject = false }) => {
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('');
@@ -188,10 +188,10 @@ export const Settings = ({ onClose, notify, hasWriteAccess = false, hasProjectCo
188
188
  const agentMode = config.get('agentMode');
189
189
  const agentCanRun = agentMode === 'on' && hasWriteAccess && hasProjectContext;
190
190
  const agentStatusMessage = agentMode === 'on'
191
- ? (!isInProject
192
- ? '⚠️ No project detected - open terminal in a project folder and run codeep there'
193
- : (!hasWriteAccess
194
- ? '⚠️ Agent needs permission - use /grant to allow project access'
191
+ ? (!hasWriteAccess
192
+ ? '⚠️ Agent needs permission - use /grant to allow folder access'
193
+ : (!hasProjectContext
194
+ ? '⚠️ Agent needs permission - use /grant to allow folder access'
195
195
  : '✓ Agent will run automatically on every message'))
196
196
  : 'ℹ️ Manual mode - use /agent <task> to run agent';
197
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" })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
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",