codeep 1.0.120 → 1.0.122
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 +35 -90
- package/dist/components/Input.js +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -163,21 +163,6 @@ export const App = () => {
|
|
|
163
163
|
return () => clearTimeout(timer);
|
|
164
164
|
}
|
|
165
165
|
}, [notification, notificationDuration]);
|
|
166
|
-
// Use alternate screen buffer for fullscreen views (non-chat screens)
|
|
167
|
-
// This prevents ghost content while keeping chat scrollable in normal buffer
|
|
168
|
-
useEffect(() => {
|
|
169
|
-
const isFullscreen = screen !== 'chat' && screen !== 'login' && screen !== 'permission' && screen !== 'session-picker';
|
|
170
|
-
if (isFullscreen) {
|
|
171
|
-
// Enter alternate buffer
|
|
172
|
-
stdout?.write('\x1b[?1049h\x1b[H');
|
|
173
|
-
}
|
|
174
|
-
return () => {
|
|
175
|
-
if (isFullscreen) {
|
|
176
|
-
// Exit alternate buffer when leaving fullscreen view
|
|
177
|
-
stdout?.write('\x1b[?1049l');
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}, [screen, stdout]);
|
|
181
166
|
// Handle keyboard shortcuts
|
|
182
167
|
useInput((input, key) => {
|
|
183
168
|
// Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
|
|
@@ -1319,12 +1304,6 @@ export const App = () => {
|
|
|
1319
1304
|
if (screen === 'permission') {
|
|
1320
1305
|
return (_jsx(ProjectPermission, { projectPath: projectPath, onComplete: handlePermissionComplete }));
|
|
1321
1306
|
}
|
|
1322
|
-
if (screen === 'help') {
|
|
1323
|
-
return (_jsxs(Box, { flexDirection: "column", height: stdout?.rows || 24, children: [_jsx(Help, {}), _jsx(Text, { children: "Press Escape to close" })] }, "help-screen"));
|
|
1324
|
-
}
|
|
1325
|
-
if (screen === 'status') {
|
|
1326
|
-
return (_jsxs(Box, { flexDirection: "column", height: stdout?.rows || 24, children: [_jsx(Status, {}), _jsx(Text, { children: "Press Escape to close" })] }, "status-screen"));
|
|
1327
|
-
}
|
|
1328
1307
|
if (screen === 'session-picker') {
|
|
1329
1308
|
return (_jsx(SessionPicker, { projectPath: projectPath, onSelect: (loadedMessages, sessionName) => {
|
|
1330
1309
|
setMessages(loadedMessages);
|
|
@@ -1337,79 +1316,45 @@ export const App = () => {
|
|
|
1337
1316
|
setScreen('chat');
|
|
1338
1317
|
} }));
|
|
1339
1318
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
if (screen === 'sessions-delete') {
|
|
1344
|
-
return (_jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), onDelete: (name) => {
|
|
1345
|
-
notify(`Deleted: ${name}`);
|
|
1346
|
-
setScreen('chat');
|
|
1347
|
-
}, deleteMode: true, projectPath: projectPath }));
|
|
1348
|
-
}
|
|
1349
|
-
if (screen === 'logout') {
|
|
1350
|
-
return (_jsx(LogoutPicker, { onLogout: (providerId) => {
|
|
1351
|
-
notify(`Logged out from ${providerId}`);
|
|
1352
|
-
// If logged out from current provider, go to login
|
|
1353
|
-
if (providerId === config.get('provider')) {
|
|
1354
|
-
setMessages([]);
|
|
1355
|
-
setScreen('login');
|
|
1356
|
-
}
|
|
1357
|
-
else {
|
|
1358
|
-
setScreen('chat');
|
|
1359
|
-
}
|
|
1360
|
-
}, onLogoutAll: () => {
|
|
1361
|
-
notify('Logged out from all providers');
|
|
1362
|
-
setMessages([]);
|
|
1363
|
-
setScreen('login');
|
|
1364
|
-
}, onCancel: () => setScreen('chat') }));
|
|
1365
|
-
}
|
|
1366
|
-
if (screen === 'settings') {
|
|
1367
|
-
return (_jsx(Box, { flexDirection: "column", height: stdout?.rows || 24, children: _jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }) }, "settings-screen"));
|
|
1368
|
-
}
|
|
1369
|
-
if (screen === 'search') {
|
|
1370
|
-
return (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
|
|
1371
|
-
// Just close search for now - message is already in chat history
|
|
1372
|
-
notify(`Message #${index + 1}`);
|
|
1373
|
-
} }));
|
|
1374
|
-
}
|
|
1375
|
-
if (screen === 'export') {
|
|
1376
|
-
return (_jsx(Export, { onExport: (format) => {
|
|
1377
|
-
const content = exportMessages(messages, {
|
|
1378
|
-
format,
|
|
1379
|
-
sessionName: sessionId || 'chat',
|
|
1380
|
-
});
|
|
1381
|
-
const result = saveExport(content, format, process.cwd(), sessionId || undefined);
|
|
1382
|
-
if (result.success) {
|
|
1383
|
-
notify(`Exported to ${result.filePath}`);
|
|
1384
|
-
}
|
|
1385
|
-
else {
|
|
1386
|
-
notify(`Export failed: ${result.error}`);
|
|
1387
|
-
}
|
|
1388
|
-
setScreen('chat');
|
|
1389
|
-
}, onCancel: () => setScreen('chat') }));
|
|
1390
|
-
}
|
|
1391
|
-
if (screen === 'model') {
|
|
1392
|
-
return (_jsx(ModelSelect, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1393
|
-
}
|
|
1394
|
-
if (screen === 'provider') {
|
|
1395
|
-
return (_jsx(ProviderSelect, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1396
|
-
}
|
|
1397
|
-
if (screen === 'protocol') {
|
|
1398
|
-
return (_jsx(ProtocolSelect, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1399
|
-
}
|
|
1400
|
-
if (screen === 'language') {
|
|
1401
|
-
return (_jsx(LanguageSelect, { onClose: () => setScreen('chat'), notify: notify }));
|
|
1402
|
-
}
|
|
1403
|
-
// Main chat screen (only render when screen === 'chat')
|
|
1404
|
-
if (screen !== 'chat') {
|
|
1405
|
-
// If we got here, we're in an unknown state - default to chat
|
|
1406
|
-
return null;
|
|
1407
|
-
}
|
|
1319
|
+
// Helper to check if we're showing an inline menu
|
|
1320
|
+
const isInlineMenu = ['help', 'status', 'settings', 'sessions', 'sessions-delete',
|
|
1321
|
+
'logout', 'search', 'export', 'model', 'provider', 'protocol', 'language'].includes(screen);
|
|
1408
1322
|
return (_jsxs(Box, { flexDirection: "column", children: [messages.length === 0 && !isLoading && _jsx(Logo, {}), messages.length === 0 && !isLoading && (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Box, { justifyContent: "center", children: _jsxs(Text, { children: ["Connected to ", _jsx(Text, { color: "#f02a30", children: config.get('model') }), ". Type ", _jsx(Text, { color: "#f02a30", children: "/help" }), " for commands."] }) }), _jsx(Text, { children: " " }), _jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: "cyan", bold: true, children: "Welcome to Codeep - Your AI Coding Assistant" }) }), _jsx(Text, { children: " " }), _jsxs(Box, { flexDirection: "column", paddingX: 2, children: [_jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2022" }), " Ask questions about your code or request implementations"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2022" }), " Use ", _jsxs(Text, { color: "cyan", children: ["/agent ", '<task>'] }), " for autonomous task execution"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2022" }), " Type ", _jsx(Text, { color: "cyan", children: "/diff" }), " to review changes, ", _jsx(Text, { color: "cyan", children: "/commit" }), " to generate commit messages"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2022" }), " Configure settings with ", _jsx(Text, { color: "cyan", children: "/settings" }), " - enable Agent Mode for auto-execution"] })] }), _jsx(Text, { children: " " }), _jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: "gray", children: "Start typing your message or use a command to begin..." }) }), _jsx(Text, { children: " " })] })), _jsx(MessageList, { messages: messages, streamingContent: streamingContent }, sessionId), isLoading && !isAgentRunning && _jsx(Loading, { isStreaming: !!streamingContent }), (isAgentRunning || agentResult) && (_jsxs(Box, { flexDirection: "column", children: [_jsx(LiveCodeStream, { actions: agentActions, isRunning: isAgentRunning, terminalWidth: stdout?.columns || 80 }), isAgentRunning && (_jsx(AgentProgress, { isRunning: true, iteration: agentIteration, maxIterations: 50, actions: agentActions, currentThinking: agentThinking, dryRun: agentDryRun }))] }, "agent-ui")), pendingFileChanges.length > 0 && !isLoading && (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, marginY: 1, children: [_jsxs(Text, { color: "#f02a30", bold: true, children: ["\u2713 Detected ", pendingFileChanges.length, " file change(s):"] }), pendingFileChanges.map((change, i) => {
|
|
1409
1323
|
const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
|
|
1410
1324
|
const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
|
|
1411
1325
|
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));
|
|
1412
|
-
}), _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(
|
|
1326
|
+
}), _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 }) })), !isInlineMenu && (_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)) })] })), isInlineMenu && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "#f02a30", children: '─'.repeat(stdout?.columns || 80) }), screen === 'help' && _jsx(Help, {}), screen === 'status' && _jsx(Status, {}), screen === 'settings' && (_jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext })), screen === 'sessions' && (_jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), projectPath: projectPath })), screen === 'sessions-delete' && (_jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), onDelete: (name) => {
|
|
1327
|
+
notify(`Deleted: ${name}`);
|
|
1328
|
+
setScreen('chat');
|
|
1329
|
+
}, deleteMode: true, projectPath: projectPath })), screen === 'logout' && (_jsx(LogoutPicker, { onLogout: (providerId) => {
|
|
1330
|
+
notify(`Logged out from ${providerId}`);
|
|
1331
|
+
if (providerId === config.get('provider')) {
|
|
1332
|
+
setMessages([]);
|
|
1333
|
+
setScreen('login');
|
|
1334
|
+
}
|
|
1335
|
+
else {
|
|
1336
|
+
setScreen('chat');
|
|
1337
|
+
}
|
|
1338
|
+
}, onLogoutAll: () => {
|
|
1339
|
+
notify('Logged out from all providers');
|
|
1340
|
+
setMessages([]);
|
|
1341
|
+
setScreen('login');
|
|
1342
|
+
}, onCancel: () => setScreen('chat') })), screen === 'search' && (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
|
|
1343
|
+
notify(`Message #${index + 1}`);
|
|
1344
|
+
} })), screen === 'export' && (_jsx(Export, { onExport: (format) => {
|
|
1345
|
+
const content = exportMessages(messages, {
|
|
1346
|
+
format,
|
|
1347
|
+
sessionName: sessionId || 'chat',
|
|
1348
|
+
});
|
|
1349
|
+
const result = saveExport(content, format, process.cwd(), sessionId || undefined);
|
|
1350
|
+
if (result.success) {
|
|
1351
|
+
notify(`Exported to ${result.filePath}`);
|
|
1352
|
+
}
|
|
1353
|
+
else {
|
|
1354
|
+
notify(`Export failed: ${result.error}`);
|
|
1355
|
+
}
|
|
1356
|
+
setScreen('chat');
|
|
1357
|
+
}, onCancel: () => setScreen('chat') })), screen === 'model' && _jsx(ModelSelect, { onClose: () => setScreen('chat'), notify: notify }), screen === 'provider' && _jsx(ProviderSelect, { onClose: () => setScreen('chat'), notify: notify }), screen === 'protocol' && _jsx(ProtocolSelect, { onClose: () => setScreen('chat'), notify: notify }), screen === 'language' && _jsx(LanguageSelect, { onClose: () => setScreen('chat'), notify: notify }), _jsx(Text, { color: "gray", children: "Press Escape to close" })] })), !isInlineMenu && (_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"));
|
|
1413
1358
|
};
|
|
1414
1359
|
// Model selection component
|
|
1415
1360
|
const ModelSelect = ({ onClose, notify }) => {
|
package/dist/components/Input.js
CHANGED
|
@@ -327,5 +327,5 @@ export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }
|
|
|
327
327
|
const after = value.slice(cursorPos + 1);
|
|
328
328
|
return (_jsxs(Text, { children: [before, _jsx(Text, { backgroundColor: "white", color: "black", children: cursor }), after] }));
|
|
329
329
|
};
|
|
330
|
-
return (_jsxs(Box, { flexDirection: "column", children: [value === '/' && (_jsx(Box, {
|
|
330
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: '> ' }), disabled ? (_jsx(Text, { color: "yellow", children: "Agent working... (Esc to stop)" })) : (renderInput())] }), value === '/' && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "cyan", dimColor: true, children: "Type command name (e.g., help, status, settings) or press Tab to see all" }) })), suggestions.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [suggestions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, bold: i === selectedIndex, children: s.cmd }), _jsxs(Text, { color: i === selectedIndex ? undefined : 'gray', children: [" - ", s.desc] })] }, s.cmd))), _jsx(Text, { color: "cyan", dimColor: true, children: "\u2191\u2193 navigate \u2022 Tab complete \u2022 Esc cancel" })] })), pasteInfo && (_jsx(Box, { borderStyle: "round", borderColor: "green", paddingX: 1, marginTop: 1, flexDirection: "column", children: _jsxs(Text, { children: [_jsx(Text, { color: "green", bold: true, children: "\uD83D\uDCCB " }), _jsx(Text, { color: "white", bold: true, children: pasteInfo.chars }), _jsx(Text, { color: "cyan", children: " chars" }), pasteInfo.lines > 1 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "cyan", children: " \u2022 " }), _jsx(Text, { color: "white", bold: true, children: pasteInfo.lines }), _jsx(Text, { color: "cyan", children: " lines" })] })), _jsx(Text, { color: "cyan", dimColor: true, children: " (Enter send \u2022 Esc cancel)" })] }) }))] }));
|
|
331
331
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.122",
|
|
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",
|