codeep 1.0.119 → 1.0.121

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
@@ -1304,12 +1304,6 @@ export const App = () => {
1304
1304
  if (screen === 'permission') {
1305
1305
  return (_jsx(ProjectPermission, { projectPath: projectPath, onComplete: handlePermissionComplete }));
1306
1306
  }
1307
- if (screen === 'help') {
1308
- return (_jsxs(Box, { flexDirection: "column", height: stdout?.rows || 24, children: [_jsx(Help, {}), _jsx(Text, { children: "Press Escape to close" })] }, "help-screen"));
1309
- }
1310
- if (screen === 'status') {
1311
- return (_jsxs(Box, { flexDirection: "column", height: stdout?.rows || 24, children: [_jsx(Status, {}), _jsx(Text, { children: "Press Escape to close" })] }, "status-screen"));
1312
- }
1313
1307
  if (screen === 'session-picker') {
1314
1308
  return (_jsx(SessionPicker, { projectPath: projectPath, onSelect: (loadedMessages, sessionName) => {
1315
1309
  setMessages(loadedMessages);
@@ -1322,79 +1316,45 @@ export const App = () => {
1322
1316
  setScreen('chat');
1323
1317
  } }));
1324
1318
  }
1325
- if (screen === 'sessions') {
1326
- return (_jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), projectPath: projectPath }));
1327
- }
1328
- if (screen === 'sessions-delete') {
1329
- return (_jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), onDelete: (name) => {
1330
- notify(`Deleted: ${name}`);
1331
- setScreen('chat');
1332
- }, deleteMode: true, projectPath: projectPath }));
1333
- }
1334
- if (screen === 'logout') {
1335
- return (_jsx(LogoutPicker, { onLogout: (providerId) => {
1336
- notify(`Logged out from ${providerId}`);
1337
- // If logged out from current provider, go to login
1338
- if (providerId === config.get('provider')) {
1339
- setMessages([]);
1340
- setScreen('login');
1341
- }
1342
- else {
1343
- setScreen('chat');
1344
- }
1345
- }, onLogoutAll: () => {
1346
- notify('Logged out from all providers');
1347
- setMessages([]);
1348
- setScreen('login');
1349
- }, onCancel: () => setScreen('chat') }));
1350
- }
1351
- if (screen === 'settings') {
1352
- return (_jsx(Box, { flexDirection: "column", height: stdout?.rows || 24, children: _jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }) }, "settings-screen"));
1353
- }
1354
- if (screen === 'search') {
1355
- return (_jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
1356
- // Just close search for now - message is already in chat history
1357
- notify(`Message #${index + 1}`);
1358
- } }));
1359
- }
1360
- if (screen === 'export') {
1361
- return (_jsx(Export, { onExport: (format) => {
1362
- const content = exportMessages(messages, {
1363
- format,
1364
- sessionName: sessionId || 'chat',
1365
- });
1366
- const result = saveExport(content, format, process.cwd(), sessionId || undefined);
1367
- if (result.success) {
1368
- notify(`Exported to ${result.filePath}`);
1369
- }
1370
- else {
1371
- notify(`Export failed: ${result.error}`);
1372
- }
1373
- setScreen('chat');
1374
- }, onCancel: () => setScreen('chat') }));
1375
- }
1376
- if (screen === 'model') {
1377
- return (_jsx(ModelSelect, { onClose: () => setScreen('chat'), notify: notify }));
1378
- }
1379
- if (screen === 'provider') {
1380
- return (_jsx(ProviderSelect, { onClose: () => setScreen('chat'), notify: notify }));
1381
- }
1382
- if (screen === 'protocol') {
1383
- return (_jsx(ProtocolSelect, { onClose: () => setScreen('chat'), notify: notify }));
1384
- }
1385
- if (screen === 'language') {
1386
- return (_jsx(LanguageSelect, { onClose: () => setScreen('chat'), notify: notify }));
1387
- }
1388
- // Main chat screen (only render when screen === 'chat')
1389
- if (screen !== 'chat') {
1390
- // If we got here, we're in an unknown state - default to chat
1391
- return null;
1392
- }
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);
1393
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) => {
1394
1323
  const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
1395
1324
  const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
1396
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));
1397
- }), _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-screen"));
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)) })] })), screen === 'help' && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Help, {}), _jsx(Text, { color: "gray", children: "Press Escape to close" })] })), screen === 'status' && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Status, {}), _jsx(Text, { color: "gray", children: "Press Escape to close" })] })), screen === 'settings' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Settings, { onClose: () => setScreen('chat'), notify: notify, hasWriteAccess: hasWriteAccess, hasProjectContext: !!projectContext }) })), screen === 'sessions' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Sessions, { history: messages, onLoad: handleSessionLoad, onClose: () => setScreen('chat'), projectPath: projectPath }) })), screen === 'sessions-delete' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _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(Box, { flexDirection: "column", marginTop: 1, children: _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(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Search, { results: searchResults, searchTerm: searchTerm, onClose: () => setScreen('chat'), onSelectMessage: (index) => {
1343
+ notify(`Message #${index + 1}`);
1344
+ } }) })), screen === 'export' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _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(Box, { flexDirection: "column", marginTop: 1, children: _jsx(ModelSelect, { onClose: () => setScreen('chat'), notify: notify }) })), screen === 'provider' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(ProviderSelect, { onClose: () => setScreen('chat'), notify: notify }) })), screen === 'protocol' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(ProtocolSelect, { onClose: () => setScreen('chat'), notify: notify }) })), screen === 'language' && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(LanguageSelect, { onClose: () => setScreen('chat'), notify: notify }) })), !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"));
1398
1358
  };
1399
1359
  // Model selection component
1400
1360
  const ModelSelect = ({ onClose, notify }) => {
package/dist/index.js CHANGED
@@ -32,34 +32,7 @@ Contact: info@codeep.dev
32
32
  `);
33
33
  process.exit(0);
34
34
  }
35
- // Enter alternate screen buffer (like vim, less, htop)
36
- // This isolates the app from terminal scroll history
37
- // Eliminates ghost content and jumping issues
38
- process.stdout.write('\x1b[?1049h'); // Enter alternate buffer
39
- process.stdout.write('\x1b[H'); // Move cursor to top-left
40
- // Exit alternate buffer on app exit
41
- const exitAlternateBuffer = () => {
42
- process.stdout.write('\x1b[?1049l'); // Exit alternate buffer
43
- };
44
- // Handle various exit scenarios
45
- process.on('exit', exitAlternateBuffer);
46
- process.on('SIGINT', () => {
47
- exitAlternateBuffer();
48
- process.exit(0);
49
- });
50
- process.on('SIGTERM', () => {
51
- exitAlternateBuffer();
52
- process.exit(0);
53
- });
54
- // Also handle uncaught exceptions to ensure clean exit
55
- process.on('uncaughtException', (err) => {
56
- exitAlternateBuffer();
57
- console.error('Uncaught Exception:', err);
58
- process.exit(1);
59
- });
35
+ // Clear screen on start
36
+ console.clear();
60
37
  // Render app
61
- const { unmount, waitUntilExit } = render(_jsx(App, {}));
62
- // Ensure alternate buffer is exited when Ink unmounts
63
- waitUntilExit().then(() => {
64
- exitAlternateBuffer();
65
- });
38
+ render(_jsx(App, {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.119",
3
+ "version": "1.0.121",
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",