codeep 1.0.66 → 1.0.68
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/README.md +2 -2
- package/dist/app.js +40 -4
- package/dist/components/Help.js +1 -1
- package/dist/components/Settings.js +2 -2
- package/dist/components/Status.js +2 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -508,7 +508,7 @@ With write access enabled:
|
|
|
508
508
|
| API Timeout | 60000ms | Request timeout |
|
|
509
509
|
| API Rate Limit | 30/min | Max API calls per minute |
|
|
510
510
|
| Command Rate Limit | 100/min | Max commands per minute |
|
|
511
|
-
| Agent Mode |
|
|
511
|
+
| Agent Mode | ON | `ON` = agent runs on every message, `Manual` = use /agent |
|
|
512
512
|
| Agent API Timeout | 180000ms | Timeout per agent API call (auto-adjusted for complexity) |
|
|
513
513
|
| Agent Max Duration | 20 min | Maximum time for agent to run (5-60 min) |
|
|
514
514
|
| Agent Max Iterations | 100 | Maximum agent iterations (10-200) |
|
|
@@ -520,7 +520,7 @@ With write access enabled:
|
|
|
520
520
|
|
|
521
521
|
## Usage Examples
|
|
522
522
|
|
|
523
|
-
### Autonomous Coding (
|
|
523
|
+
### Autonomous Coding (Agent Mode ON)
|
|
524
524
|
|
|
525
525
|
With write access enabled, just describe what you want:
|
|
526
526
|
|
package/dist/app.js
CHANGED
|
@@ -111,6 +111,13 @@ export const App = () => {
|
|
|
111
111
|
}
|
|
112
112
|
setProjectContext(ctx);
|
|
113
113
|
setPermissionChecked(true);
|
|
114
|
+
// Warn user if Agent Mode is ON but only read permission exists
|
|
115
|
+
const agentMode = config.get('agentMode');
|
|
116
|
+
if (agentMode === 'on' && !hasWrite) {
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
setNotification('⚠️ Agent Mode is ON but only read access. Use /grant for write access or /agent for manual mode.');
|
|
119
|
+
}, 500);
|
|
120
|
+
}
|
|
114
121
|
}
|
|
115
122
|
else {
|
|
116
123
|
// Need to ask for permission
|
|
@@ -120,6 +127,13 @@ export const App = () => {
|
|
|
120
127
|
}
|
|
121
128
|
else {
|
|
122
129
|
setPermissionChecked(true);
|
|
130
|
+
// Warn user if Agent Mode is ON but not in a project directory
|
|
131
|
+
const agentMode = config.get('agentMode');
|
|
132
|
+
if (agentMode === 'on') {
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
setNotification('⚠️ Agent Mode is ON but no project detected. Run codeep in a project directory.');
|
|
135
|
+
}, 500);
|
|
136
|
+
}
|
|
123
137
|
}
|
|
124
138
|
}
|
|
125
139
|
}, [showIntro, permissionChecked, projectPath, screen]);
|
|
@@ -394,10 +408,18 @@ export const App = () => {
|
|
|
394
408
|
// Auto-agent mode: if enabled and we have write access, use agent
|
|
395
409
|
const agentMode = config.get('agentMode');
|
|
396
410
|
logger.debug(`[handleSubmit] agentMode=${agentMode}, hasWriteAccess=${hasWriteAccess}, hasProjectContext=${!!projectContext}`);
|
|
397
|
-
if (agentMode === '
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
411
|
+
if (agentMode === 'on') {
|
|
412
|
+
if (!projectContext) {
|
|
413
|
+
notify('⚠️ Agent Mode ON: Requires project directory. Using chat mode instead.');
|
|
414
|
+
}
|
|
415
|
+
else if (!hasWriteAccess) {
|
|
416
|
+
notify('⚠️ Agent Mode ON: Write permission required. Grant with /grant or using chat mode.');
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
notify('✓ Using agent mode (change in /settings)');
|
|
420
|
+
startAgent(sanitizedInput, false);
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
401
423
|
}
|
|
402
424
|
// Auto-detect file paths and enrich message
|
|
403
425
|
let enrichedInput = sanitizedInput;
|
|
@@ -1251,9 +1273,23 @@ export const App = () => {
|
|
|
1251
1273
|
? 'Project access granted (read + write, this session)'
|
|
1252
1274
|
: 'Project access granted (read-only, this session)');
|
|
1253
1275
|
}
|
|
1276
|
+
// Warn user if Agent Mode is ON but write access was not granted
|
|
1277
|
+
const agentMode = config.get('agentMode');
|
|
1278
|
+
if (agentMode === 'on' && !writeGranted) {
|
|
1279
|
+
setTimeout(() => {
|
|
1280
|
+
notify('⚠️ Agent Mode is ON but write access not granted. Use /grant for full agent or /agent for manual.');
|
|
1281
|
+
}, 100);
|
|
1282
|
+
}
|
|
1254
1283
|
}
|
|
1255
1284
|
else {
|
|
1256
1285
|
notify('Project access denied');
|
|
1286
|
+
// Warn user if Agent Mode is ON but access was denied
|
|
1287
|
+
const agentMode = config.get('agentMode');
|
|
1288
|
+
if (agentMode === 'on') {
|
|
1289
|
+
setTimeout(() => {
|
|
1290
|
+
notify('⚠️ Agent Mode is ON but project access denied. Agent cannot run.');
|
|
1291
|
+
}, 100);
|
|
1292
|
+
}
|
|
1257
1293
|
}
|
|
1258
1294
|
setScreen('chat');
|
|
1259
1295
|
};
|
package/dist/components/Help.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, Box } from 'ink';
|
|
3
|
-
export const Help = () => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Commands" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/help" }), " - Show this help"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/status" }), " - Show current status"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/version" }), " - Show version info"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/update" }), " - Check for updates"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/model" }), " - Switch model"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/protocol" }), " - Switch API protocol"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/provider" }), " - Switch API provider"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/lang" }), " - Set response language"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/settings" }), " - Adjust temp, tokens, timeout, rate limits"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/sessions" }), " - Save/load chat sessions"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/sessions delete" }), " ", '<name>', " - Delete a session"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/rename" }), " ", '<name>', " - Rename current session"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/search" }), " ", '<term>', " - Search through messages (e.g. /search error)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/export" }), " - Export chat to MD/JSON/TXT format"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/diff" }), " [--staged] - Review git changes with AI"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/commit" }), " - Generate commit message from staged changes"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/apply" }), " - Apply file changes from AI response"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/copy" }), " [n] - Copy code block [n] to clipboard"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent" }), " ", '<task>', " - Start autonomous agent for task"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent-dry" }), " ", '<task>', " - Preview agent actions (no changes)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent-stop" }), " - Stop running agent"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/clear" }), " - Clear chat history"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/login" }), " - Login with different key"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/logout" }), " - Logout and clear key"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/exit" }), " - Quit application"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Shortcuts" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2191/\u2193" }), " - Navigate input history or command suggestions"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Tab" }), " - Autocomplete selected command"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Ctrl+L" }), " - Clear chat (same as /clear)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Escape" }), " - Cancel request"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Code Blocks" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Code blocks are numbered [0], [1], etc." }), _jsxs(Text, { children: ["Use ", _jsx(Text, { color: "#f02a30", children: "/copy" }), " to copy last block, ", _jsx(Text, { color: "#f02a30", children: "/copy 0" }), " for first"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Project Context" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "When started in a project directory, Codeep can:" }), _jsx(Text, { children: " \u2022 Auto-detect file paths in your messages" }), _jsx(Text, { children: " \u2022 Attach file contents automatically" }), _jsx(Text, { children: " \u2022 Understand your project structure" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Examples:" }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"check src/app.tsx\"" }), " - reads and analyzes file"] }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"what does package.json contain\"" }), " - shows file"] }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"improve error handling\"" }), " - AI knows project"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Agent Mode" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "
|
|
3
|
+
export const Help = () => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Commands" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/help" }), " - Show this help"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/status" }), " - Show current status"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/version" }), " - Show version info"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/update" }), " - Check for updates"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/model" }), " - Switch model"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/protocol" }), " - Switch API protocol"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/provider" }), " - Switch API provider"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/lang" }), " - Set response language"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/settings" }), " - Adjust temp, tokens, timeout, rate limits"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/sessions" }), " - Save/load chat sessions"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/sessions delete" }), " ", '<name>', " - Delete a session"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/rename" }), " ", '<name>', " - Rename current session"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/search" }), " ", '<term>', " - Search through messages (e.g. /search error)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/export" }), " - Export chat to MD/JSON/TXT format"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/diff" }), " [--staged] - Review git changes with AI"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/commit" }), " - Generate commit message from staged changes"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/apply" }), " - Apply file changes from AI response"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/copy" }), " [n] - Copy code block [n] to clipboard"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent" }), " ", '<task>', " - Start autonomous agent for task"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent-dry" }), " ", '<task>', " - Preview agent actions (no changes)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/agent-stop" }), " - Stop running agent"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/clear" }), " - Clear chat history"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/login" }), " - Login with different key"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/logout" }), " - Logout and clear key"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "/exit" }), " - Quit application"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Shortcuts" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "\u2191/\u2193" }), " - Navigate input history or command suggestions"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Tab" }), " - Autocomplete selected command"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Ctrl+L" }), " - Clear chat (same as /clear)"] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Escape" }), " - Cancel request"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Code Blocks" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Code blocks are numbered [0], [1], etc." }), _jsxs(Text, { children: ["Use ", _jsx(Text, { color: "#f02a30", children: "/copy" }), " to copy last block, ", _jsx(Text, { color: "#f02a30", children: "/copy 0" }), " for first"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Project Context" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "When started in a project directory, Codeep can:" }), _jsx(Text, { children: " \u2022 Auto-detect file paths in your messages" }), _jsx(Text, { children: " \u2022 Attach file contents automatically" }), _jsx(Text, { children: " \u2022 Understand your project structure" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Examples:" }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"check src/app.tsx\"" }), " - reads and analyzes file"] }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"what does package.json contain\"" }), " - shows file"] }), _jsxs(Text, { children: [" ", _jsx(Text, { children: "\"improve error handling\"" }), " - AI knows project"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: "#f02a30", bold: true, children: "Agent Mode" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: ["Two modes available in ", _jsx(Text, { color: "#f02a30", children: "/settings" }), ":"] }), _jsxs(Text, { children: [" \u2022 ", _jsx(Text, { color: "green", bold: true, children: "ON" }), " - Agent runs automatically on every message"] }), _jsxs(Text, { children: [" \u2022 ", _jsx(Text, { color: "yellow", bold: true, children: "Manual" }), " - Agent runs only with /agent command"] }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Agent capabilities:" }), _jsx(Text, { children: " \u2022 Creates, edits, deletes files automatically" }), _jsx(Text, { children: " \u2022 Runs shell commands (npm, git, etc.)" }), _jsx(Text, { children: " \u2022 Loops until task is complete" }), _jsx(Text, { children: " \u2022 Shows progress and all actions taken" }), _jsx(Text, { children: " " }), _jsx(Text, { children: "Manual mode examples:" }), _jsxs(Text, { children: [" ", _jsx(Text, { color: "#f02a30", children: "/agent" }), " \"add error handling to api.ts\""] }), _jsxs(Text, { children: [" ", _jsx(Text, { color: "#f02a30", children: "/agent" }), " \"run tests and fix failures\""] }), _jsxs(Text, { children: [" ", _jsx(Text, { color: "#f02a30", children: "/agent" }), " \"create a new React component for user profile\""] }), _jsxs(Text, { children: [" ", _jsx(Text, { color: "#f02a30", children: "/agent-dry" }), " \"refactor utils folder\" - preview only"] })] }));
|
|
@@ -62,10 +62,10 @@ const SETTINGS = [
|
|
|
62
62
|
{
|
|
63
63
|
key: 'agentMode',
|
|
64
64
|
label: 'Agent Mode',
|
|
65
|
-
value: () => config.get('agentMode') === '
|
|
65
|
+
value: () => config.get('agentMode') === 'on' ? 'ON' : 'Manual',
|
|
66
66
|
type: 'select',
|
|
67
67
|
options: [
|
|
68
|
-
{ value: '
|
|
68
|
+
{ value: 'on', label: 'ON' },
|
|
69
69
|
{ value: 'manual', label: 'Manual' },
|
|
70
70
|
],
|
|
71
71
|
},
|
|
@@ -6,7 +6,8 @@ export const Status = () => {
|
|
|
6
6
|
const protocol = config.get('protocol');
|
|
7
7
|
const plan = config.get('plan');
|
|
8
8
|
const language = config.get('language');
|
|
9
|
+
const agentMode = config.get('agentMode');
|
|
9
10
|
const provider = getCurrentProvider();
|
|
10
11
|
const models = getModelsForCurrentProvider();
|
|
11
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Status" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Provider:" }), "
|
|
12
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#f02a30", padding: 1, children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Status" }), _jsx(Text, { children: " " }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Provider:" }), " ", provider.name] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Model:" }), " ", models[model] || model] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Protocol:" }), " ", PROTOCOLS[protocol] || protocol] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Language:" }), " ", LANGUAGES[language] || language] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Plan:" }), " ", plan.toUpperCase()] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "Agent Mode:" }), " ", agentMode === 'on' ? 'ON' : 'Manual'] }), _jsxs(Text, { children: [_jsx(Text, { color: "#f02a30", children: "API Key:" }), " ", getMaskedApiKey()] })] }));
|
|
12
13
|
};
|
package/dist/config/index.d.ts
CHANGED
package/dist/config/index.js
CHANGED
|
@@ -60,7 +60,7 @@ export const config = new Conf({
|
|
|
60
60
|
apiKey: '',
|
|
61
61
|
provider: 'z.ai',
|
|
62
62
|
model: 'glm-4.7',
|
|
63
|
-
agentMode: '
|
|
63
|
+
agentMode: 'on',
|
|
64
64
|
agentConfirmation: 'dangerous', // Confirm only dangerous actions by default
|
|
65
65
|
agentAutoCommit: false,
|
|
66
66
|
agentAutoCommitBranch: false,
|
|
@@ -83,6 +83,10 @@ export const config = new Conf({
|
|
|
83
83
|
providerApiKeys: [],
|
|
84
84
|
},
|
|
85
85
|
});
|
|
86
|
+
// Migrate old 'auto' value to 'on'
|
|
87
|
+
if (config.get('agentMode') === 'auto') {
|
|
88
|
+
config.set('agentMode', 'on');
|
|
89
|
+
}
|
|
86
90
|
// In-memory cache for API keys (populated on first access)
|
|
87
91
|
const apiKeyCache = new Map();
|
|
88
92
|
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.68",
|
|
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",
|