codeep 1.0.104 → 1.0.106
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 +1 -29
- package/dist/config/index.js +10 -8
- 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,25 +92,6 @@ 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);
|
|
97
|
-
// Clear ghost content when agent finishes by erasing lines above cursor
|
|
98
|
-
const prevAgentRunning = React.useRef(isAgentRunning);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (prevAgentRunning.current === true && isAgentRunning === false && lastStreamHeight > 0) {
|
|
101
|
-
// Erase N lines above without scrolling: move up, clear each line, move back down
|
|
102
|
-
const linesToClear = lastStreamHeight;
|
|
103
|
-
let escapeSeq = '';
|
|
104
|
-
escapeSeq += `\x1b[${linesToClear}A`; // Move cursor up N lines
|
|
105
|
-
for (let i = 0; i < linesToClear; i++) {
|
|
106
|
-
escapeSeq += '\x1b[2K\x1b[B'; // Clear line, move down
|
|
107
|
-
}
|
|
108
|
-
escapeSeq += `\x1b[${linesToClear}A`; // Move back up to original position
|
|
109
|
-
stdout?.write(escapeSeq);
|
|
110
|
-
setLastStreamHeight(0);
|
|
111
|
-
}
|
|
112
|
-
prevAgentRunning.current = isAgentRunning;
|
|
113
|
-
}, [isAgentRunning, lastStreamHeight, stdout]);
|
|
114
95
|
// Load API keys for ALL providers on startup and check if current provider is configured
|
|
115
96
|
useEffect(() => {
|
|
116
97
|
loadAllApiKeys().then(() => {
|
|
@@ -209,7 +190,6 @@ export const App = () => {
|
|
|
209
190
|
clearCodeBlocks();
|
|
210
191
|
setAgentResult(null);
|
|
211
192
|
setAgentActions([]);
|
|
212
|
-
setLastStreamHeight(0);
|
|
213
193
|
const newSessId = startNewSession();
|
|
214
194
|
setSessionId(newSessId);
|
|
215
195
|
setClearInputTrigger(prev => prev + 1); // Trigger input clear
|
|
@@ -301,7 +281,6 @@ export const App = () => {
|
|
|
301
281
|
setAgentActions([]);
|
|
302
282
|
setAgentThinking('');
|
|
303
283
|
setAgentResult(null);
|
|
304
|
-
setLastStreamHeight(0);
|
|
305
284
|
setAgentDryRun(dryRun);
|
|
306
285
|
// Add user message
|
|
307
286
|
const userMessage = {
|
|
@@ -348,12 +327,6 @@ export const App = () => {
|
|
|
348
327
|
timestamp: Date.now(),
|
|
349
328
|
};
|
|
350
329
|
setAgentActions(prev => [...prev, actionLog]);
|
|
351
|
-
// Track stream height for ghost content cleanup
|
|
352
|
-
if (details) {
|
|
353
|
-
const lineCount = details.split('\n').length;
|
|
354
|
-
// LiveCodeStream shows: 1 header + lines + 1 loading indicator + 1 footer = ~lineCount + 3
|
|
355
|
-
setLastStreamHeight(Math.min(lineCount, 50) + 5);
|
|
356
|
-
}
|
|
357
330
|
},
|
|
358
331
|
onToolResult: (result, toolCall) => {
|
|
359
332
|
// Replace the last action with the complete one
|
|
@@ -414,7 +387,6 @@ export const App = () => {
|
|
|
414
387
|
if (agentResult) {
|
|
415
388
|
setAgentResult(null);
|
|
416
389
|
setAgentActions([]);
|
|
417
|
-
setLastStreamHeight(0);
|
|
418
390
|
}
|
|
419
391
|
// Validate input
|
|
420
392
|
const validation = validateInput(input);
|
package/dist/config/index.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import Conf from 'conf';
|
|
2
2
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import { homedir } from 'os';
|
|
3
|
+
import { join, dirname } from 'path';
|
|
5
4
|
import { PROVIDERS, getProvider } from './providers.js';
|
|
6
5
|
import { logSession } from '../utils/logger.js';
|
|
7
|
-
//
|
|
8
|
-
const GLOBAL_SESSIONS_DIR = join(homedir(), '.codeep', 'sessions');
|
|
9
|
-
// Ensure global sessions directory exists
|
|
10
|
-
if (!existsSync(GLOBAL_SESSIONS_DIR)) {
|
|
11
|
-
mkdirSync(GLOBAL_SESSIONS_DIR, { recursive: true });
|
|
12
|
-
}
|
|
6
|
+
// We'll initialize GLOBAL_SESSIONS_DIR after config is created (to use config.path)
|
|
13
7
|
/**
|
|
14
8
|
* Get sessions directory - local .codeep/sessions/ if in project, otherwise global
|
|
15
9
|
*/
|
|
@@ -87,6 +81,14 @@ export const config = new Conf({
|
|
|
87
81
|
if (config.get('agentMode') === 'auto') {
|
|
88
82
|
config.set('agentMode', 'on');
|
|
89
83
|
}
|
|
84
|
+
// Global sessions directory - use same directory as conf package for cross-platform consistency
|
|
85
|
+
// config.path gives us something like ~/.config/codeep-nodejs/config.json, we use its parent
|
|
86
|
+
const GLOBAL_BASE_DIR = dirname(config.path);
|
|
87
|
+
const GLOBAL_SESSIONS_DIR = join(GLOBAL_BASE_DIR, 'sessions');
|
|
88
|
+
// Ensure global sessions directory exists
|
|
89
|
+
if (!existsSync(GLOBAL_SESSIONS_DIR)) {
|
|
90
|
+
mkdirSync(GLOBAL_SESSIONS_DIR, { recursive: true });
|
|
91
|
+
}
|
|
90
92
|
// In-memory cache for API keys (populated on first access)
|
|
91
93
|
const apiKeyCache = new Map();
|
|
92
94
|
export const LANGUAGES = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
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",
|