codeep 1.0.67 → 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 +39 -7
- package/dist/components/Settings.d.ts +2 -0
- package/dist/components/Settings.js +11 -2
- package/package.json +1 -1
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);
|
|
@@ -111,6 +112,14 @@ export const App = () => {
|
|
|
111
112
|
}
|
|
112
113
|
setProjectContext(ctx);
|
|
113
114
|
setPermissionChecked(true);
|
|
115
|
+
// Warn user if Agent Mode is ON but only read permission exists
|
|
116
|
+
const agentMode = config.get('agentMode');
|
|
117
|
+
if (agentMode === 'on' && !hasWrite) {
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
setNotificationDuration(8000);
|
|
120
|
+
setNotification('⚠️ Agent Mode is ON but only read access. Use /grant for write access or /agent for manual mode.');
|
|
121
|
+
}, 500);
|
|
122
|
+
}
|
|
114
123
|
}
|
|
115
124
|
else {
|
|
116
125
|
// Need to ask for permission
|
|
@@ -120,6 +129,14 @@ export const App = () => {
|
|
|
120
129
|
}
|
|
121
130
|
else {
|
|
122
131
|
setPermissionChecked(true);
|
|
132
|
+
// Warn user if Agent Mode is ON but not in a project directory
|
|
133
|
+
const agentMode = config.get('agentMode');
|
|
134
|
+
if (agentMode === 'on') {
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
setNotificationDuration(8000);
|
|
137
|
+
setNotification('⚠️ Agent Mode is ON but no project detected. Run codeep in a project directory.');
|
|
138
|
+
}, 500);
|
|
139
|
+
}
|
|
123
140
|
}
|
|
124
141
|
}
|
|
125
142
|
}, [showIntro, permissionChecked, projectPath, screen]);
|
|
@@ -153,10 +170,10 @@ export const App = () => {
|
|
|
153
170
|
// Clear notification after delay
|
|
154
171
|
useEffect(() => {
|
|
155
172
|
if (notification) {
|
|
156
|
-
const timer = setTimeout(() => setNotification(''),
|
|
173
|
+
const timer = setTimeout(() => setNotification(''), notificationDuration);
|
|
157
174
|
return () => clearTimeout(timer);
|
|
158
175
|
}
|
|
159
|
-
}, [notification]);
|
|
176
|
+
}, [notification, notificationDuration]);
|
|
160
177
|
// Handle keyboard shortcuts
|
|
161
178
|
useInput((input, key) => {
|
|
162
179
|
// Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
|
|
@@ -237,7 +254,8 @@ export const App = () => {
|
|
|
237
254
|
}
|
|
238
255
|
}
|
|
239
256
|
});
|
|
240
|
-
const notify = useCallback((msg) => {
|
|
257
|
+
const notify = useCallback((msg, duration = 3000) => {
|
|
258
|
+
setNotificationDuration(duration);
|
|
241
259
|
setNotification(msg);
|
|
242
260
|
}, []);
|
|
243
261
|
// Start agent execution
|
|
@@ -396,10 +414,10 @@ export const App = () => {
|
|
|
396
414
|
logger.debug(`[handleSubmit] agentMode=${agentMode}, hasWriteAccess=${hasWriteAccess}, hasProjectContext=${!!projectContext}`);
|
|
397
415
|
if (agentMode === 'on') {
|
|
398
416
|
if (!projectContext) {
|
|
399
|
-
notify('⚠️ Agent Mode ON: Requires project directory. Using chat mode instead.');
|
|
417
|
+
notify('⚠️ Agent Mode ON: Requires project directory. Using chat mode instead.', 8000);
|
|
400
418
|
}
|
|
401
419
|
else if (!hasWriteAccess) {
|
|
402
|
-
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);
|
|
403
421
|
}
|
|
404
422
|
else {
|
|
405
423
|
notify('✓ Using agent mode (change in /settings)');
|
|
@@ -1259,9 +1277,23 @@ export const App = () => {
|
|
|
1259
1277
|
? 'Project access granted (read + write, this session)'
|
|
1260
1278
|
: 'Project access granted (read-only, this session)');
|
|
1261
1279
|
}
|
|
1280
|
+
// Warn user if Agent Mode is ON but write access was not granted
|
|
1281
|
+
const agentMode = config.get('agentMode');
|
|
1282
|
+
if (agentMode === 'on' && !writeGranted) {
|
|
1283
|
+
setTimeout(() => {
|
|
1284
|
+
notify('⚠️ Agent Mode is ON but write access not granted. Use /grant for full agent or /agent for manual.', 8000);
|
|
1285
|
+
}, 100);
|
|
1286
|
+
}
|
|
1262
1287
|
}
|
|
1263
1288
|
else {
|
|
1264
1289
|
notify('Project access denied');
|
|
1290
|
+
// Warn user if Agent Mode is ON but access was denied
|
|
1291
|
+
const agentMode = config.get('agentMode');
|
|
1292
|
+
if (agentMode === 'on') {
|
|
1293
|
+
setTimeout(() => {
|
|
1294
|
+
notify('⚠️ Agent Mode is ON but project access denied. Agent cannot run.', 8000);
|
|
1295
|
+
}, 100);
|
|
1296
|
+
}
|
|
1265
1297
|
}
|
|
1266
1298
|
setScreen('chat');
|
|
1267
1299
|
};
|
|
@@ -1321,7 +1353,7 @@ export const App = () => {
|
|
|
1321
1353
|
}, onCancel: () => setScreen('chat') }));
|
|
1322
1354
|
}
|
|
1323
1355
|
if (screen === 'settings') {
|
|
1324
|
-
return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1356
|
+
return (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }));
|
|
1325
1357
|
}
|
|
1326
1358
|
if (screen === 'search') {
|
|
1327
1359
|
return (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
|
|
@@ -1362,7 +1394,7 @@ export const App = () => {
|
|
|
1362
1394
|
const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
|
|
1363
1395
|
const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
|
|
1364
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));
|
|
1365
|
-
}), _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)" })) })] })] }));
|
|
1366
1398
|
};
|
|
1367
1399
|
// Model selection component
|
|
1368
1400
|
const ModelSelect = ({ onClose, notify }) => {
|
|
@@ -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
|
-
|
|
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.
|
|
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",
|