codeep 1.0.1 → 1.0.4
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/api/index.js +4 -4
- package/dist/app.js +36 -38
- package/dist/components/Login.js +4 -4
- package/dist/components/LogoutPicker.js +1 -1
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/components/MessageList.js +1 -1
- package/dist/components/ProjectPermission.js +2 -2
- package/dist/components/SessionPicker.js +1 -1
- package/dist/components/Sessions.js +23 -6
- package/dist/components/Settings.js +2 -2
- package/dist/components/Status.js +1 -1
- package/dist/config/index.js +18 -5
- package/dist/config/providers.test.js +1 -1
- package/dist/index.js +2 -2
- package/dist/utils/agent.js +6 -6
- package/dist/utils/codeReview.js +1 -1
- package/dist/utils/context.js +1 -1
- package/dist/utils/export.d.ts +1 -1
- package/dist/utils/git.test.js +1 -1
- package/dist/utils/keychain.js +1 -1
- package/dist/utils/project.test.js +1 -1
- package/dist/utils/ratelimit.js +1 -1
- package/dist/utils/ratelimit.test.js +1 -1
- package/dist/utils/retry.test.js +1 -1
- package/dist/utils/tools.js +2 -2
- package/dist/utils/validation.test.js +1 -1
- package/dist/utils/verify.js +1 -1
- package/package.json +2 -2
package/dist/api/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { config, getApiKey } from '../config/index';
|
|
2
|
-
import { withRetry, isNetworkError, isTimeoutError } from '../utils/retry';
|
|
3
|
-
import { getProvider, getProviderBaseUrl, getProviderAuthHeader } from '../config/providers';
|
|
4
|
-
import { logApiRequest, logApiResponse } from '../utils/logger';
|
|
1
|
+
import { config, getApiKey } from '../config/index.js';
|
|
2
|
+
import { withRetry, isNetworkError, isTimeoutError } from '../utils/retry.js';
|
|
3
|
+
import { getProvider, getProviderBaseUrl, getProviderAuthHeader } from '../config/providers.js';
|
|
4
|
+
import { logApiRequest, logApiResponse } from '../utils/logger.js';
|
|
5
5
|
// Error messages by language
|
|
6
6
|
const ERROR_MESSAGES = {
|
|
7
7
|
en: {
|
package/dist/app.js
CHANGED
|
@@ -2,40 +2,40 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { Box, Text, useApp, useInput, useStdout } from 'ink';
|
|
4
4
|
import clipboardy from 'clipboardy';
|
|
5
|
-
import { logger } from './utils/logger';
|
|
6
|
-
import { Logo, IntroAnimation } from './components/Logo';
|
|
7
|
-
import { Loading } from './components/Loading';
|
|
8
|
-
import { getCodeBlock, clearCodeBlocks } from './components/Message';
|
|
9
|
-
import { ChatInput } from './components/Input';
|
|
10
|
-
import { Help } from './components/Help';
|
|
11
|
-
import { Status } from './components/Status';
|
|
12
|
-
import { Login } from './components/Login';
|
|
13
|
-
import { Sessions } from './components/Sessions';
|
|
14
|
-
import { SessionPicker } from './components/SessionPicker';
|
|
15
|
-
import { LogoutPicker } from './components/LogoutPicker';
|
|
16
|
-
import { Settings } from './components/Settings';
|
|
17
|
-
import { ProjectPermission } from './components/ProjectPermission';
|
|
18
|
-
import { Search } from './components/Search';
|
|
19
|
-
import { Export } from './components/Export';
|
|
20
|
-
import { MessageList } from './components/MessageList';
|
|
21
|
-
import { chat } from './api/index';
|
|
22
|
-
import { config, loadApiKey, loadAllApiKeys, PROTOCOLS, LANGUAGES, autoSaveSession, startNewSession, getCurrentSessionId, renameSession, deleteSession, hasReadPermission, hasWritePermission, setProjectPermission, setProvider, getCurrentProvider, getModelsForCurrentProvider, PROVIDERS } from './config/index';
|
|
23
|
-
import { getProviderList } from './config/providers';
|
|
24
|
-
import { isProjectDirectory, getProjectContext, detectFilePaths, readProjectFile, parseFileChanges, writeProjectFile, deleteProjectFile } from './utils/project';
|
|
25
|
-
import { logStartup, setLogProjectPath } from './utils/logger';
|
|
26
|
-
import { searchMessages } from './utils/search';
|
|
27
|
-
import { exportMessages, saveExport } from './utils/export';
|
|
28
|
-
import { checkForUpdates, formatVersionInfo, getCurrentVersion } from './utils/update';
|
|
29
|
-
import { getGitDiff, getGitStatus, suggestCommitMessage, formatDiffForDisplay } from './utils/git';
|
|
30
|
-
import { validateInput } from './utils/validation';
|
|
31
|
-
import { checkApiRateLimit, checkCommandRateLimit } from './utils/ratelimit';
|
|
32
|
-
import { runAgent, formatAgentResult, undoLastAction, undoAllActions, getRecentSessions } from './utils/agent';
|
|
33
|
-
import { autoCommitAgentChanges } from './utils/git';
|
|
34
|
-
import { saveContext, loadContext, clearContext, mergeContext } from './utils/context';
|
|
35
|
-
import { performCodeReview, formatReviewResult } from './utils/codeReview';
|
|
36
|
-
import { learnFromProject, addCustomRule, getLearningStatus } from './utils/learning';
|
|
37
|
-
import { getAllSkills, findSkill, formatSkillsList, formatSkillHelp, generateSkillPrompt, saveCustomSkill, deleteCustomSkill, parseSkillChain, parseSkillArgs, searchSkills, trackSkillUsage, getSkillStats } from './utils/skills';
|
|
38
|
-
import { AgentProgress, AgentSummary } from './components/AgentProgress';
|
|
5
|
+
import { logger } from './utils/logger.js';
|
|
6
|
+
import { Logo, IntroAnimation } from './components/Logo.js';
|
|
7
|
+
import { Loading } from './components/Loading.js';
|
|
8
|
+
import { getCodeBlock, clearCodeBlocks } from './components/Message.js';
|
|
9
|
+
import { ChatInput } from './components/Input.js';
|
|
10
|
+
import { Help } from './components/Help.js';
|
|
11
|
+
import { Status } from './components/Status.js';
|
|
12
|
+
import { Login } from './components/Login.js';
|
|
13
|
+
import { Sessions } from './components/Sessions.js';
|
|
14
|
+
import { SessionPicker } from './components/SessionPicker.js';
|
|
15
|
+
import { LogoutPicker } from './components/LogoutPicker.js';
|
|
16
|
+
import { Settings } from './components/Settings.js';
|
|
17
|
+
import { ProjectPermission } from './components/ProjectPermission.js';
|
|
18
|
+
import { Search } from './components/Search.js';
|
|
19
|
+
import { Export } from './components/Export.js';
|
|
20
|
+
import { MessageList } from './components/MessageList.js';
|
|
21
|
+
import { chat } from './api/index.js';
|
|
22
|
+
import { config, loadApiKey, loadAllApiKeys, PROTOCOLS, LANGUAGES, autoSaveSession, startNewSession, getCurrentSessionId, renameSession, deleteSession, hasReadPermission, hasWritePermission, setProjectPermission, setProvider, getCurrentProvider, getModelsForCurrentProvider, PROVIDERS } from './config/index.js';
|
|
23
|
+
import { getProviderList } from './config/providers.js';
|
|
24
|
+
import { isProjectDirectory, getProjectContext, detectFilePaths, readProjectFile, parseFileChanges, writeProjectFile, deleteProjectFile } from './utils/project.js';
|
|
25
|
+
import { logStartup, setLogProjectPath } from './utils/logger.js';
|
|
26
|
+
import { searchMessages } from './utils/search.js';
|
|
27
|
+
import { exportMessages, saveExport } from './utils/export.js';
|
|
28
|
+
import { checkForUpdates, formatVersionInfo, getCurrentVersion } from './utils/update.js';
|
|
29
|
+
import { getGitDiff, getGitStatus, suggestCommitMessage, formatDiffForDisplay } from './utils/git.js';
|
|
30
|
+
import { validateInput } from './utils/validation.js';
|
|
31
|
+
import { checkApiRateLimit, checkCommandRateLimit } from './utils/ratelimit.js';
|
|
32
|
+
import { runAgent, formatAgentResult, undoLastAction, undoAllActions, getRecentSessions } from './utils/agent.js';
|
|
33
|
+
import { autoCommitAgentChanges } from './utils/git.js';
|
|
34
|
+
import { saveContext, loadContext, clearContext, mergeContext } from './utils/context.js';
|
|
35
|
+
import { performCodeReview, formatReviewResult } from './utils/codeReview.js';
|
|
36
|
+
import { learnFromProject, addCustomRule, getLearningStatus } from './utils/learning.js';
|
|
37
|
+
import { getAllSkills, findSkill, formatSkillsList, formatSkillHelp, generateSkillPrompt, saveCustomSkill, deleteCustomSkill, parseSkillChain, parseSkillArgs, searchSkills, trackSkillUsage, getSkillStats } from './utils/skills.js';
|
|
38
|
+
import { AgentProgress, AgentSummary } from './components/AgentProgress.js';
|
|
39
39
|
export const App = () => {
|
|
40
40
|
const { exit } = useApp();
|
|
41
41
|
const { stdout } = useStdout();
|
|
@@ -1208,10 +1208,8 @@ export const App = () => {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
setProjectContext(ctx);
|
|
1210
1210
|
if (permanent) {
|
|
1211
|
-
// Save permission to local .codeep/config.json
|
|
1212
|
-
|
|
1213
|
-
setProjectPermission(projectPath, true, false); // read only
|
|
1214
|
-
}
|
|
1211
|
+
// Save permission to local .codeep/config.json
|
|
1212
|
+
setProjectPermission(projectPath, true, writeGranted);
|
|
1215
1213
|
notify(writeGranted
|
|
1216
1214
|
? 'Project access granted (read + write, permanent)'
|
|
1217
1215
|
: 'Project access granted (read-only, permanent)');
|
package/dist/components/Login.js
CHANGED
|
@@ -3,10 +3,10 @@ import { useState } from 'react';
|
|
|
3
3
|
import { Text, Box, useInput } from 'ink';
|
|
4
4
|
import TextInput from 'ink-text-input';
|
|
5
5
|
import open from 'open';
|
|
6
|
-
import { setApiKey, setProvider } from '../config/index';
|
|
7
|
-
import { validateApiKey } from '../api/index';
|
|
8
|
-
import { Logo } from './Logo';
|
|
9
|
-
import { getProviderList } from '../config/providers';
|
|
6
|
+
import { setApiKey, setProvider } from '../config/index.js';
|
|
7
|
+
import { validateApiKey } from '../api/index.js';
|
|
8
|
+
import { Logo } from './Logo.js';
|
|
9
|
+
import { getProviderList } from '../config/providers.js';
|
|
10
10
|
const PROVIDER_URLS = {
|
|
11
11
|
'z.ai': 'https://z.ai/subscribe?ic=NXYNXZOV14',
|
|
12
12
|
'minimax': 'https://platform.minimax.io/subscribe/coding-plan?code=2lWvoWUhrp&source=link',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Text, Box, useInput } from 'ink';
|
|
4
|
-
import { getConfiguredProviders, clearApiKey, getCurrentProvider } from '../config/index';
|
|
4
|
+
import { getConfiguredProviders, clearApiKey, getCurrentProvider } from '../config/index.js';
|
|
5
5
|
export const LogoutPicker = ({ onLogout, onLogoutAll, onCancel }) => {
|
|
6
6
|
const providers = getConfiguredProviders();
|
|
7
7
|
const currentProvider = getCurrentProvider();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Static } from 'ink';
|
|
3
|
-
import { MessageView } from './Message';
|
|
3
|
+
import { MessageView } from './Message.js';
|
|
4
4
|
export const MessageList = ({ messages, }) => {
|
|
5
5
|
// Use Static component to prevent messages from re-rendering on every keystroke
|
|
6
6
|
// This keeps the scroll position stable when typing in input field
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
import { setProjectPermission } from '../config/index';
|
|
5
|
-
import { getProjectSummary } from '../utils/project';
|
|
4
|
+
import { setProjectPermission } from '../config/index.js';
|
|
5
|
+
import { getProjectSummary } from '../utils/project.js';
|
|
6
6
|
export const ProjectPermission = ({ projectPath, onComplete }) => {
|
|
7
7
|
const [step, setStep] = useState('read');
|
|
8
8
|
const [readGranted, setReadGranted] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo } from 'react';
|
|
3
3
|
import { Text, Box, useInput } from 'ink';
|
|
4
|
-
import { listSessionsWithInfo, loadSession, startNewSession } from '../config/index';
|
|
4
|
+
import { listSessionsWithInfo, loadSession, startNewSession } from '../config/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Format relative time (e.g., "today", "yesterday", "3 days ago")
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Text, Box, useInput } from 'ink';
|
|
4
4
|
import TextInput from 'ink-text-input';
|
|
5
|
-
import { listSessions, saveSession, loadSession, deleteSession } from '../config/index';
|
|
5
|
+
import { listSessions, saveSession, loadSession, deleteSession } from '../config/index.js';
|
|
6
6
|
export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = false, projectPath }) => {
|
|
7
7
|
const [name, setName] = useState('');
|
|
8
8
|
const [message, setMessage] = useState(deleteMode ? 'Select a session to delete (D or Enter)' : '');
|
|
@@ -47,15 +47,32 @@ export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = fals
|
|
|
47
47
|
handleDelete();
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
// S = Save, L = Load, D = Delete
|
|
51
|
-
if (!deleteMode &&
|
|
50
|
+
// Ctrl+S = Save, Ctrl+L = Load, Ctrl+D = Delete, Enter = Save/Load depending on context
|
|
51
|
+
if (!deleteMode && key.ctrl && input === 's') {
|
|
52
52
|
handleSave();
|
|
53
|
+
return;
|
|
53
54
|
}
|
|
54
|
-
if (!deleteMode &&
|
|
55
|
+
if (!deleteMode && key.ctrl && input === 'l') {
|
|
55
56
|
handleLoad();
|
|
57
|
+
return;
|
|
56
58
|
}
|
|
57
|
-
if (
|
|
59
|
+
if (key.ctrl && input === 'd') {
|
|
58
60
|
handleDelete();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Enter key behavior
|
|
64
|
+
if (!deleteMode && key.return) {
|
|
65
|
+
// If name is filled, try to save or load
|
|
66
|
+
if (name.trim()) {
|
|
67
|
+
// Check if session exists - if yes, load it, if no, save current
|
|
68
|
+
if (sessions.includes(name.trim())) {
|
|
69
|
+
handleLoad();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
handleSave();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
59
76
|
}
|
|
60
77
|
});
|
|
61
78
|
const handleSave = () => {
|
|
@@ -98,5 +115,5 @@ export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = fals
|
|
|
98
115
|
setConfirmDelete(sessionName);
|
|
99
116
|
setMessage(`Delete "${sessionName}"? (Y/N)`);
|
|
100
117
|
};
|
|
101
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: deleteMode ? 'Delete Session' : 'Sessions' }), _jsx(Text, { children: " " }), !deleteMode && (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", children: "Name: " }), _jsx(TextInput, { value: name, onChange: setName, placeholder: "session name..." })] }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "S" }), "=Save ", _jsx(Text, { color: "#f02a30", children: "L" }), "=Load ", _jsx(Text, { color: "#f02a30", children: "D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Close"] })] })), deleteMode && (_jsx(_Fragment, { children: _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Enter/D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Cancel"] }) })), sessions.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { children: "Saved sessions (\u2191/\u2193 to select):" }), sessions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, children: s })] }, s)))] })), message && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "cyan", children: message })] }))] }));
|
|
118
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: deleteMode ? 'Delete Session' : 'Sessions' }), _jsx(Text, { children: " " }), !deleteMode && (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", children: "Name: " }), _jsx(TextInput, { value: name, onChange: setName, placeholder: "session name..." })] }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Ctrl+S" }), "=Save ", _jsx(Text, { color: "#f02a30", children: "Ctrl+L" }), "=Load ", _jsx(Text, { color: "#f02a30", children: "Ctrl+D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Enter" }), "=Save/Load ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Close"] })] })), deleteMode && (_jsx(_Fragment, { children: _jsxs(Text, { children: ["Actions: ", _jsx(Text, { color: "#f02a30", children: "Enter/Ctrl+D" }), "=Delete ", _jsx(Text, { color: "#f02a30", children: "Esc" }), "=Cancel"] }) })), sessions.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { children: "Saved sessions (\u2191/\u2193 to select):" }), sessions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, children: s })] }, s)))] })), message && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "cyan", children: message })] }))] }));
|
|
102
119
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
import { config } from '../config/index';
|
|
5
|
-
import { updateRateLimits } from '../utils/ratelimit';
|
|
4
|
+
import { config } from '../config/index.js';
|
|
5
|
+
import { updateRateLimits } from '../utils/ratelimit.js';
|
|
6
6
|
const SETTINGS = [
|
|
7
7
|
{
|
|
8
8
|
key: 'temperature',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, Box } from 'ink';
|
|
3
|
-
import { config, getMaskedApiKey, getModelsForCurrentProvider, getCurrentProvider, PROTOCOLS, LANGUAGES } from '../config/index';
|
|
3
|
+
import { config, getMaskedApiKey, getModelsForCurrentProvider, getCurrentProvider, PROTOCOLS, LANGUAGES } from '../config/index.js';
|
|
4
4
|
export const Status = () => {
|
|
5
5
|
const model = config.get('model');
|
|
6
6
|
const protocol = config.get('protocol');
|
package/dist/config/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import Conf from 'conf';
|
|
|
2
2
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { homedir } from 'os';
|
|
5
|
-
import { PROVIDERS, getProvider } from './providers';
|
|
6
|
-
import { logSession } from '../utils/logger';
|
|
5
|
+
import { PROVIDERS, getProvider } from './providers.js';
|
|
6
|
+
import { logSession } from '../utils/logger.js';
|
|
7
7
|
// Global sessions directory (fallback when not in a project)
|
|
8
8
|
const GLOBAL_SESSIONS_DIR = join(homedir(), '.codeep', 'sessions');
|
|
9
9
|
// Ensure global sessions directory exists
|
|
@@ -36,10 +36,23 @@ function getLocalConfigPath(projectPath) {
|
|
|
36
36
|
return join(configDir, 'config.json');
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Check if directory is a project
|
|
39
|
+
* Check if directory is a project
|
|
40
|
+
* Looks for common project indicators: package.json, pyproject.toml, Cargo.toml, go.mod, composer.json, etc.
|
|
40
41
|
*/
|
|
41
42
|
function isProjectDirectory(path) {
|
|
42
|
-
|
|
43
|
+
const projectFiles = [
|
|
44
|
+
'package.json', // Node.js
|
|
45
|
+
'pyproject.toml', // Python (Poetry)
|
|
46
|
+
'requirements.txt', // Python (pip)
|
|
47
|
+
'setup.py', // Python
|
|
48
|
+
'Cargo.toml', // Rust
|
|
49
|
+
'go.mod', // Go
|
|
50
|
+
'composer.json', // PHP
|
|
51
|
+
'pom.xml', // Java (Maven)
|
|
52
|
+
'build.gradle', // Java (Gradle)
|
|
53
|
+
'.git', // Git repository
|
|
54
|
+
];
|
|
55
|
+
return projectFiles.some(file => existsSync(join(path, file)));
|
|
43
56
|
}
|
|
44
57
|
export const config = new Conf({
|
|
45
58
|
projectName: 'codeep',
|
|
@@ -278,7 +291,7 @@ export function getModelsForCurrentProvider() {
|
|
|
278
291
|
return models;
|
|
279
292
|
}
|
|
280
293
|
// Re-export PROVIDERS for convenience
|
|
281
|
-
export { PROVIDERS } from './providers';
|
|
294
|
+
export { PROVIDERS } from './providers.js';
|
|
282
295
|
// Generate unique session ID
|
|
283
296
|
function generateSessionId() {
|
|
284
297
|
const now = new Date();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { PROVIDERS, getProvider, getProviderList, getProviderModels, getProviderBaseUrl, getProviderAuthHeader, } from './providers';
|
|
2
|
+
import { PROVIDERS, getProvider, getProviderList, getProviderModels, getProviderBaseUrl, getProviderAuthHeader, } from './providers.js';
|
|
3
3
|
describe('providers', () => {
|
|
4
4
|
describe('PROVIDERS constant', () => {
|
|
5
5
|
it('should have z.ai provider', () => {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { render } from 'ink';
|
|
4
|
-
import { App } from './app';
|
|
5
|
-
import { getCurrentVersion } from './utils/update';
|
|
4
|
+
import { App } from './app.js';
|
|
5
|
+
import { getCurrentVersion } from './utils/update.js';
|
|
6
6
|
// Handle CLI flags
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
if (args.includes('--version') || args.includes('-v')) {
|
package/dist/utils/agent.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent loop - autonomous task execution
|
|
3
3
|
*/
|
|
4
|
-
import { parseToolCalls, executeTool, createActionLog, formatToolDefinitions, getOpenAITools, getAnthropicTools, parseOpenAIToolCalls, parseAnthropicToolCalls } from './tools';
|
|
5
|
-
import { config, getApiKey } from '../config/index';
|
|
6
|
-
import { getProviderBaseUrl, getProviderAuthHeader, supportsNativeTools } from '../config/providers';
|
|
7
|
-
import { startSession, endSession, undoLastAction, undoAllActions, getCurrentSession, getRecentSessions, formatSession } from './history';
|
|
8
|
-
import { runAllVerifications, formatErrorsForAgent, hasVerificationErrors, getVerificationSummary } from './verify';
|
|
9
|
-
import { gatherSmartContext, formatSmartContext, extractTargetFile } from './smartContext';
|
|
4
|
+
import { parseToolCalls, executeTool, createActionLog, formatToolDefinitions, getOpenAITools, getAnthropicTools, parseOpenAIToolCalls, parseAnthropicToolCalls } from './tools.js';
|
|
5
|
+
import { config, getApiKey } from '../config/index.js';
|
|
6
|
+
import { getProviderBaseUrl, getProviderAuthHeader, supportsNativeTools } from '../config/providers.js';
|
|
7
|
+
import { startSession, endSession, undoLastAction, undoAllActions, getCurrentSession, getRecentSessions, formatSession } from './history.js';
|
|
8
|
+
import { runAllVerifications, formatErrorsForAgent, hasVerificationErrors, getVerificationSummary } from './verify.js';
|
|
9
|
+
import { gatherSmartContext, formatSmartContext, extractTargetFile } from './smartContext.js';
|
|
10
10
|
const DEFAULT_OPTIONS = {
|
|
11
11
|
maxIterations: 20,
|
|
12
12
|
maxDuration: 5 * 60 * 1000, // 5 minutes
|
package/dist/utils/codeReview.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { existsSync, readFileSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, extname, relative } from 'path';
|
|
6
|
-
import { getChangedFiles } from './git';
|
|
6
|
+
import { getChangedFiles } from './git.js';
|
|
7
7
|
// Common code patterns that indicate issues
|
|
8
8
|
const CODE_PATTERNS = [
|
|
9
9
|
// Security issues
|
package/dist/utils/context.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, unlinkSync } from 'fs';
|
|
5
5
|
import { join, basename } from 'path';
|
|
6
6
|
import { homedir } from 'os';
|
|
7
|
-
import { logger } from './logger';
|
|
7
|
+
import { logger } from './logger.js';
|
|
8
8
|
// Context storage directory
|
|
9
9
|
const CONTEXT_DIR = join(homedir(), '.codeep', 'contexts');
|
|
10
10
|
/**
|
package/dist/utils/export.d.ts
CHANGED
package/dist/utils/git.test.js
CHANGED
|
@@ -3,7 +3,7 @@ import { execSync } from 'child_process';
|
|
|
3
3
|
import { mkdirSync, rmSync, writeFileSync } from 'fs';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { tmpdir } from 'os';
|
|
6
|
-
import { isGitRepository, getGitStatus, getGitDiff, getChangedFiles, suggestCommitMessage, createCommit, stageAll, formatDiffForDisplay, } from './git';
|
|
6
|
+
import { isGitRepository, getGitStatus, getGitDiff, getChangedFiles, suggestCommitMessage, createCommit, stageAll, formatDiffForDisplay, } from './git.js';
|
|
7
7
|
// Create a temp directory for git tests
|
|
8
8
|
const TEST_DIR = join(tmpdir(), 'codeep-git-test-' + Date.now());
|
|
9
9
|
const NON_GIT_DIR = join(tmpdir(), 'codeep-non-git-test-' + Date.now());
|
package/dist/utils/keychain.js
CHANGED
|
@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
|
2
2
|
import { mkdirSync, rmSync, writeFileSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { tmpdir } from 'os';
|
|
5
|
-
import { isProjectDirectory, getProjectType, scanDirectory, generateTreeStructure, readProjectFile, deleteProjectFile, writeProjectFile, } from './project';
|
|
5
|
+
import { isProjectDirectory, getProjectType, scanDirectory, generateTreeStructure, readProjectFile, deleteProjectFile, writeProjectFile, } from './project.js';
|
|
6
6
|
const TEST_DIR = join(tmpdir(), 'codeep-project-test-' + Date.now());
|
|
7
7
|
describe('project utilities', () => {
|
|
8
8
|
beforeEach(() => {
|
package/dist/utils/ratelimit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import { checkApiRateLimit, checkCommandRateLimit, resetRateLimits, getRateLimitStatus, } from './ratelimit';
|
|
2
|
+
import { checkApiRateLimit, checkCommandRateLimit, resetRateLimits, getRateLimitStatus, } from './ratelimit.js';
|
|
3
3
|
describe('ratelimit utilities', () => {
|
|
4
4
|
beforeEach(() => {
|
|
5
5
|
// Reset rate limiters before each test
|
package/dist/utils/retry.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { withRetry, isNetworkError, isTimeoutError, fetchWithTimeout, } from './retry';
|
|
2
|
+
import { withRetry, isNetworkError, isTimeoutError, fetchWithTimeout, } from './retry.js';
|
|
3
3
|
describe('retry utilities', () => {
|
|
4
4
|
describe('isNetworkError', () => {
|
|
5
5
|
it('should detect fetch TypeError', () => {
|
package/dist/utils/tools.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { existsSync, readdirSync, statSync, readFileSync, writeFileSync, unlinkSync, mkdirSync, rmSync } from 'fs';
|
|
5
5
|
import { join, dirname, relative, resolve, isAbsolute } from 'path';
|
|
6
|
-
import { executeCommand } from './shell';
|
|
7
|
-
import { recordWrite, recordEdit, recordDelete, recordMkdir, recordCommand } from './history';
|
|
6
|
+
import { executeCommand } from './shell.js';
|
|
7
|
+
import { recordWrite, recordEdit, recordDelete, recordMkdir, recordCommand } from './history.js';
|
|
8
8
|
// Tool definitions for system prompt
|
|
9
9
|
export const AGENT_TOOLS = {
|
|
10
10
|
read_file: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { validateInput, validateApiKey, validateCommandArgs, validateFilePath, sanitizeOutput, } from './validation';
|
|
2
|
+
import { validateInput, validateApiKey, validateCommandArgs, validateFilePath, sanitizeOutput, } from './validation.js';
|
|
3
3
|
describe('validation utilities', () => {
|
|
4
4
|
describe('validateInput', () => {
|
|
5
5
|
it('should reject empty input', () => {
|
package/dist/utils/verify.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "node --import tsx src/index.tsx",
|
|
12
|
-
"build": "tsc",
|
|
12
|
+
"build": "tsc && node scripts/fix-imports.js",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"build:binary": "npm run build && pkg dist/index.js --targets node18-macos-arm64,node18-macos-x64,node18-linux-x64 --output bin/codeep",
|
|
15
15
|
"test": "vitest run",
|