codeep 1.0.121 → 1.0.123
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 +29 -29
- package/dist/components/AgentProgress.js +13 -6
- package/dist/components/Input.js +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -1323,38 +1323,38 @@ export const App = () => {
|
|
|
1323
1323
|
const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
|
|
1324
1324
|
const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
|
|
1325
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));
|
|
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)) })] })),
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
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');
|
|
1332
1340
|
setMessages([]);
|
|
1333
1341
|
setScreen('login');
|
|
1334
|
-
}
|
|
1335
|
-
|
|
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
|
+
}
|
|
1336
1356
|
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"));
|
|
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"));
|
|
1358
1358
|
};
|
|
1359
1359
|
// Model selection component
|
|
1360
1360
|
const ModelSelect = ({ onClose, notify }) => {
|
|
@@ -145,11 +145,13 @@ const isSectionBreak = (line, prevLine) => {
|
|
|
145
145
|
}
|
|
146
146
|
return false;
|
|
147
147
|
};
|
|
148
|
-
const MAX_PREVIEW_LINES =
|
|
148
|
+
const MAX_PREVIEW_LINES = 12; // Code preview lines for live streaming
|
|
149
149
|
export const LiveCodeStream = memo(({ actions, isRunning, terminalWidth = 80 }) => {
|
|
150
|
-
// Find the current write/edit action for live preview
|
|
150
|
+
// Find the current write/edit action for live preview (skip read actions)
|
|
151
151
|
const currentAction = actions.length > 0 ? actions[actions.length - 1] : null;
|
|
152
152
|
const isCodeAction = currentAction && (currentAction.type === 'write' || currentAction.type === 'edit');
|
|
153
|
+
// Skip rendering for read actions - no preview needed
|
|
154
|
+
const isReadAction = currentAction && currentAction.type === 'read';
|
|
153
155
|
// ALL HOOKS MUST BE CALLED BEFORE ANY EARLY RETURNS (Rules of Hooks)
|
|
154
156
|
// Calculate statistics from all actions
|
|
155
157
|
const stats = useMemo(() => {
|
|
@@ -205,12 +207,17 @@ export const LiveCodeStream = memo(({ actions, isRunning, terminalWidth = 80 })
|
|
|
205
207
|
? line.slice(0, boxWidth - 13) + '...'
|
|
206
208
|
: line;
|
|
207
209
|
return (_jsxs(Text, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: [String(lineNum).padStart(3), " "] }), _jsx(Text, { color: getCodeColor(line, ext), children: displayLine || ' ' })] }, i));
|
|
208
|
-
})
|
|
210
|
+
})] })] }));
|
|
209
211
|
}
|
|
210
|
-
// RUNNING STATE but not a code action: show simple status
|
|
211
|
-
|
|
212
|
+
// RUNNING STATE but not a code action (and not read): show simple status
|
|
213
|
+
// Skip showing box for read actions - they don't need preview
|
|
214
|
+
if (isRunning && currentAction && !isReadAction) {
|
|
212
215
|
const boxWidth = Math.min(terminalWidth - 4, 76);
|
|
213
|
-
return (
|
|
216
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", marginBottom: 1, width: boxWidth, children: _jsxs(Box, { paddingX: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "\u25E6 " }), _jsxs(Text, { color: getActionColor(currentAction.type), children: [getActionLabel(currentAction.type), " "] }), _jsx(Text, { color: "white", children: formatTarget(currentAction.target) })] }) }));
|
|
217
|
+
}
|
|
218
|
+
// For read actions while running, don't show anything
|
|
219
|
+
if (isRunning && isReadAction) {
|
|
220
|
+
return null;
|
|
214
221
|
}
|
|
215
222
|
// FINISHED STATE: Show summary statistics (same height as live preview)
|
|
216
223
|
const boxWidth = Math.min(terminalWidth - 4, 76);
|
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.123",
|
|
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",
|