codeep 1.0.99 → 1.0.101
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 +13 -14
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { Box, Text, useApp, useInput, useStdout } from 'ink';
|
|
4
4
|
import clipboardy from 'clipboardy';
|
|
5
5
|
import { logger } from './utils/logger.js';
|
|
@@ -92,6 +92,8 @@ export const App = () => {
|
|
|
92
92
|
const [agentThinking, setAgentThinking] = useState('');
|
|
93
93
|
const [agentResult, setAgentResult] = useState(null);
|
|
94
94
|
const [agentDryRun, setAgentDryRun] = useState(false);
|
|
95
|
+
// Track LiveCodeStream height to render placeholder after agent finishes (prevents ghost content)
|
|
96
|
+
const [lastStreamHeight, setLastStreamHeight] = useState(0);
|
|
95
97
|
// Load API keys for ALL providers on startup and check if current provider is configured
|
|
96
98
|
useEffect(() => {
|
|
97
99
|
loadAllApiKeys().then(() => {
|
|
@@ -179,18 +181,6 @@ export const App = () => {
|
|
|
179
181
|
setClearInputTrigger(prev => prev + 1);
|
|
180
182
|
}
|
|
181
183
|
}, [modalScreen]);
|
|
182
|
-
// Clear LiveCodeStream ghost content when agent finishes
|
|
183
|
-
const prevAgentRunning = React.useRef(isAgentRunning);
|
|
184
|
-
useEffect(() => {
|
|
185
|
-
// Detect transition from running to stopped
|
|
186
|
-
if (prevAgentRunning.current === true && isAgentRunning === false) {
|
|
187
|
-
// Agent just stopped - clear terminal to remove LiveCodeStream ghost
|
|
188
|
-
setTimeout(() => {
|
|
189
|
-
stdout?.write('\x1b[2J\x1b[3J\x1b[H');
|
|
190
|
-
}, 100);
|
|
191
|
-
}
|
|
192
|
-
prevAgentRunning.current = isAgentRunning;
|
|
193
|
-
}, [isAgentRunning, stdout]);
|
|
194
184
|
// Handle keyboard shortcuts
|
|
195
185
|
useInput((input, key) => {
|
|
196
186
|
// Ctrl+L to clear chat (F5 doesn't work reliably in all terminals)
|
|
@@ -202,6 +192,7 @@ export const App = () => {
|
|
|
202
192
|
clearCodeBlocks();
|
|
203
193
|
setAgentResult(null);
|
|
204
194
|
setAgentActions([]);
|
|
195
|
+
setLastStreamHeight(0);
|
|
205
196
|
const newSessId = startNewSession();
|
|
206
197
|
setSessionId(newSessId);
|
|
207
198
|
setClearInputTrigger(prev => prev + 1); // Trigger input clear
|
|
@@ -293,6 +284,7 @@ export const App = () => {
|
|
|
293
284
|
setAgentActions([]);
|
|
294
285
|
setAgentThinking('');
|
|
295
286
|
setAgentResult(null);
|
|
287
|
+
setLastStreamHeight(0);
|
|
296
288
|
setAgentDryRun(dryRun);
|
|
297
289
|
// Add user message
|
|
298
290
|
const userMessage = {
|
|
@@ -339,6 +331,12 @@ export const App = () => {
|
|
|
339
331
|
timestamp: Date.now(),
|
|
340
332
|
};
|
|
341
333
|
setAgentActions(prev => [...prev, actionLog]);
|
|
334
|
+
// Track stream height for ghost content cleanup
|
|
335
|
+
if (details) {
|
|
336
|
+
const lineCount = details.split('\n').length;
|
|
337
|
+
// LiveCodeStream shows: 1 header + lines + 1 loading indicator + 1 footer = ~lineCount + 3
|
|
338
|
+
setLastStreamHeight(Math.min(lineCount, 50) + 5);
|
|
339
|
+
}
|
|
342
340
|
},
|
|
343
341
|
onToolResult: (result, toolCall) => {
|
|
344
342
|
// Replace the last action with the complete one
|
|
@@ -399,6 +397,7 @@ export const App = () => {
|
|
|
399
397
|
if (agentResult) {
|
|
400
398
|
setAgentResult(null);
|
|
401
399
|
setAgentActions([]);
|
|
400
|
+
setLastStreamHeight(0);
|
|
402
401
|
}
|
|
403
402
|
// Validate input
|
|
404
403
|
const validation = validateInput(input);
|
|
@@ -1418,7 +1417,7 @@ export const App = () => {
|
|
|
1418
1417
|
// If we got here, we're in an unknown state - default to chat
|
|
1419
1418
|
return null;
|
|
1420
1419
|
}
|
|
1421
|
-
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, scrollOffset: 0, terminalHeight: stdout.rows || 24 }, sessionId), isLoading && !isAgentRunning && _jsx(Loading, { isStreaming: !!streamingContent }), isAgentRunning ? (_jsxs(Box, { flexDirection: "column", children: [_jsx(LiveCodeStream, { actions: agentActions, isRunning: true, terminalWidth: stdout?.columns || 80 }), _jsx(AgentProgress, { isRunning: true, iteration: agentIteration, maxIterations: 50, actions: agentActions, currentThinking: agentThinking, dryRun: agentDryRun })] }, "agent-running")) : agentResult ? (_jsx(Box, { flexDirection: "column", children: _jsx(AgentSummary, { success: agentResult.success, iterations: agentResult.iterations, actions: agentActions, error: agentResult.error, aborted: agentResult.aborted }) }, "agent-complete")) : null, 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) => {
|
|
1420
|
+
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, scrollOffset: 0, terminalHeight: stdout.rows || 24 }, sessionId), isLoading && !isAgentRunning && _jsx(Loading, { isStreaming: !!streamingContent }), isAgentRunning ? (_jsxs(Box, { flexDirection: "column", children: [_jsx(LiveCodeStream, { actions: agentActions, isRunning: true, terminalWidth: stdout?.columns || 80 }), _jsx(AgentProgress, { isRunning: true, iteration: agentIteration, maxIterations: 50, actions: agentActions, currentThinking: agentThinking, dryRun: agentDryRun })] }, "agent-running")) : agentResult ? (_jsxs(Box, { flexDirection: "column", children: [lastStreamHeight > 0 && (_jsx(Box, { flexDirection: "column", children: Array.from({ length: lastStreamHeight }).map((_, i) => (_jsx(Text, { children: " " }, i))) })), _jsx(AgentSummary, { success: agentResult.success, iterations: agentResult.iterations, actions: agentActions, error: agentResult.error, aborted: agentResult.aborted })] }, "agent-complete")) : null, 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) => {
|
|
1422
1421
|
const actionColor = change.action === 'delete' ? 'red' : change.action === 'edit' ? 'yellow' : 'green';
|
|
1423
1422
|
const actionLabel = change.action === 'delete' ? 'DELETE' : change.action === 'edit' ? 'EDIT' : 'CREATE';
|
|
1424
1423
|
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));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.101",
|
|
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",
|