codeep 1.2.10 → 1.2.12
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 +7 -7
- package/dist/config/index.js +3 -3
- package/dist/config/providers.d.ts +6 -0
- package/dist/config/providers.js +41 -2
- package/dist/config/providers.test.js +31 -2
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAgent.js +3 -3
- package/dist/renderer/App.js +8 -8
- package/dist/renderer/ChatUI.js +3 -3
- package/dist/renderer/Screen.js +1 -1
- package/dist/renderer/components/Export.js +1 -1
- package/dist/renderer/components/Help.js +1 -1
- package/dist/renderer/components/Intro.js +1 -1
- package/dist/renderer/components/Login.js +3 -3
- package/dist/renderer/components/Logout.js +1 -1
- package/dist/renderer/components/Modal.js +2 -2
- package/dist/renderer/components/Permission.js +2 -2
- package/dist/renderer/components/Search.js +1 -1
- package/dist/renderer/components/SelectScreen.js +1 -1
- package/dist/renderer/components/Settings.js +3 -3
- package/dist/renderer/components/Status.js +1 -1
- package/dist/renderer/demo-app.js +1 -1
- package/dist/renderer/demo.js +1 -1
- package/dist/renderer/index.js +9 -9
- package/dist/renderer/main.js +31 -31
- package/dist/utils/agent.js +10 -10
- package/dist/utils/agent.test.js +1 -1
- package/dist/utils/codeReview.js +1 -1
- package/dist/utils/context.js +1 -1
- package/dist/utils/git.test.js +1 -1
- package/dist/utils/gitignore.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/smartContext.js +1 -1
- package/dist/utils/smartContext.test.js +1 -1
- package/dist/utils/taskPlanner.js +2 -2
- package/dist/utils/tools.d.ts +64 -4
- package/dist/utils/tools.js +212 -7
- package/dist/utils/tools.test.js +1 -1
- package/dist/utils/validation.test.js +1 -1
- package/dist/utils/verify.js +1 -1
- package/package.json +1 -1
- package/bin/codeep.js +0 -2
- package/dist/app.d.ts +0 -2
- package/dist/app.js +0 -1501
- package/dist/components/AgentActions.d.ts +0 -18
- package/dist/components/AgentActions.js +0 -122
- package/dist/components/AgentProgress.d.ts +0 -59
- package/dist/components/AgentProgress.js +0 -368
- package/dist/components/Export.d.ts +0 -8
- package/dist/components/Export.js +0 -27
- package/dist/components/Help.d.ts +0 -6
- package/dist/components/Help.js +0 -7
- package/dist/components/Input.d.ts +0 -9
- package/dist/components/Input.js +0 -334
- package/dist/components/Loading.d.ts +0 -17
- package/dist/components/Loading.js +0 -52
- package/dist/components/Login.d.ts +0 -7
- package/dist/components/Login.js +0 -77
- package/dist/components/Logo.d.ts +0 -8
- package/dist/components/Logo.js +0 -89
- package/dist/components/LogoutPicker.d.ts +0 -8
- package/dist/components/LogoutPicker.js +0 -61
- package/dist/components/Message.d.ts +0 -10
- package/dist/components/Message.js +0 -242
- package/dist/components/MessageList.d.ts +0 -10
- package/dist/components/MessageList.js +0 -42
- package/dist/components/ProjectPermission.d.ts +0 -7
- package/dist/components/ProjectPermission.js +0 -65
- package/dist/components/Search.d.ts +0 -10
- package/dist/components/Search.js +0 -30
- package/dist/components/SessionPicker.d.ts +0 -9
- package/dist/components/SessionPicker.js +0 -88
- package/dist/components/Sessions.d.ts +0 -12
- package/dist/components/Sessions.js +0 -119
- package/dist/components/Settings.d.ts +0 -9
- package/dist/components/Settings.js +0 -198
- package/dist/components/Spinner.d.ts +0 -34
- package/dist/components/Spinner.js +0 -38
- package/dist/components/Status.d.ts +0 -2
- package/dist/components/Status.js +0 -13
- package/dist/components/StreamingMessage.d.ts +0 -14
- package/dist/components/StreamingMessage.js +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -42
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Text, Box, useInput } from 'ink';
|
|
4
|
-
import TextInput from 'ink-text-input';
|
|
5
|
-
import { listSessions, saveSession, loadSession, deleteSession } from '../config/index.js';
|
|
6
|
-
export const Sessions = ({ history, onLoad, onClose, onDelete, deleteMode = false, projectPath }) => {
|
|
7
|
-
const [name, setName] = useState('');
|
|
8
|
-
const [message, setMessage] = useState(deleteMode ? 'Select a session to delete (D or Enter)' : '');
|
|
9
|
-
const [sessions, setSessions] = useState(listSessions(projectPath));
|
|
10
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
11
|
-
const [confirmDelete, setConfirmDelete] = useState(null);
|
|
12
|
-
useInput((input, key) => {
|
|
13
|
-
// Handle delete confirmation
|
|
14
|
-
if (confirmDelete) {
|
|
15
|
-
if (input === 'y' || input === 'Y') {
|
|
16
|
-
if (deleteSession(confirmDelete, projectPath)) {
|
|
17
|
-
setMessage(`Deleted: ${confirmDelete}`);
|
|
18
|
-
setSessions(listSessions(projectPath));
|
|
19
|
-
if (onDelete)
|
|
20
|
-
onDelete(confirmDelete);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
setMessage('Failed to delete');
|
|
24
|
-
}
|
|
25
|
-
setConfirmDelete(null);
|
|
26
|
-
}
|
|
27
|
-
else if (input === 'n' || input === 'N' || key.escape) {
|
|
28
|
-
setConfirmDelete(null);
|
|
29
|
-
setMessage('Delete cancelled');
|
|
30
|
-
}
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (key.escape) {
|
|
34
|
-
onClose();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (key.upArrow && sessions.length > 0) {
|
|
38
|
-
setSelectedIndex(i => Math.max(0, i - 1));
|
|
39
|
-
setName(sessions[Math.max(0, selectedIndex - 1)] || '');
|
|
40
|
-
}
|
|
41
|
-
if (key.downArrow && sessions.length > 0) {
|
|
42
|
-
setSelectedIndex(i => Math.min(sessions.length - 1, i + 1));
|
|
43
|
-
setName(sessions[Math.min(sessions.length - 1, selectedIndex + 1)] || '');
|
|
44
|
-
}
|
|
45
|
-
// In delete mode, Enter also triggers delete
|
|
46
|
-
if (deleteMode && key.return) {
|
|
47
|
-
handleDelete();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
// Ctrl+S = Save, Ctrl+L = Load, Ctrl+D = Delete, Enter = Save/Load depending on context
|
|
51
|
-
if (!deleteMode && key.ctrl && input === 's') {
|
|
52
|
-
handleSave();
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (!deleteMode && key.ctrl && input === 'l') {
|
|
56
|
-
handleLoad();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (key.ctrl && input === 'd') {
|
|
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;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
const handleSave = () => {
|
|
79
|
-
if (!name.trim()) {
|
|
80
|
-
setMessage('Enter session name');
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (history.length === 0) {
|
|
84
|
-
setMessage('Nothing to save');
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (saveSession(name.trim(), history, projectPath)) {
|
|
88
|
-
setMessage(`Saved: ${name}`);
|
|
89
|
-
setTimeout(onClose, 1000);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
setMessage('Failed to save');
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const handleLoad = () => {
|
|
96
|
-
if (!name.trim()) {
|
|
97
|
-
setMessage('Enter session name');
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const loaded = loadSession(name.trim(), projectPath);
|
|
101
|
-
if (loaded) {
|
|
102
|
-
onLoad(loaded, name.trim());
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
setMessage('Session not found');
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const handleDelete = () => {
|
|
109
|
-
const sessionName = name.trim() || (sessions.length > 0 ? sessions[selectedIndex] : '');
|
|
110
|
-
if (!sessionName) {
|
|
111
|
-
setMessage('Select a session to delete');
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
// Ask for confirmation
|
|
115
|
-
setConfirmDelete(sessionName);
|
|
116
|
-
setMessage(`Delete "${sessionName}"? (Y/N)`);
|
|
117
|
-
};
|
|
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 })] }))] }));
|
|
119
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { updateRateLimits } from '../utils/ratelimit.js';
|
|
6
|
-
const SETTINGS = [
|
|
7
|
-
{
|
|
8
|
-
key: 'temperature',
|
|
9
|
-
label: 'Temperature',
|
|
10
|
-
value: () => config.get('temperature'),
|
|
11
|
-
type: 'number',
|
|
12
|
-
min: 0,
|
|
13
|
-
max: 2,
|
|
14
|
-
step: 0.1,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
key: 'maxTokens',
|
|
18
|
-
label: 'Max Tokens',
|
|
19
|
-
value: () => config.get('maxTokens'),
|
|
20
|
-
type: 'number',
|
|
21
|
-
min: 256,
|
|
22
|
-
max: 32768,
|
|
23
|
-
step: 256,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
key: 'apiTimeout',
|
|
27
|
-
label: 'API Timeout (ms)',
|
|
28
|
-
value: () => config.get('apiTimeout'),
|
|
29
|
-
type: 'number',
|
|
30
|
-
min: 5000,
|
|
31
|
-
max: 300000,
|
|
32
|
-
step: 5000,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: 'rateLimitApi',
|
|
36
|
-
label: 'API Rate Limit (/min)',
|
|
37
|
-
value: () => config.get('rateLimitApi'),
|
|
38
|
-
type: 'number',
|
|
39
|
-
min: 1,
|
|
40
|
-
max: 300,
|
|
41
|
-
step: 5,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: 'rateLimitCommands',
|
|
45
|
-
label: 'Command Rate Limit (/min)',
|
|
46
|
-
value: () => config.get('rateLimitCommands'),
|
|
47
|
-
type: 'number',
|
|
48
|
-
min: 10,
|
|
49
|
-
max: 1000,
|
|
50
|
-
step: 10,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
key: 'autoSave',
|
|
54
|
-
label: 'Auto Save Sessions',
|
|
55
|
-
value: () => config.get('autoSave') ? 'On' : 'Off',
|
|
56
|
-
type: 'select',
|
|
57
|
-
options: [
|
|
58
|
-
{ value: true, label: 'On' },
|
|
59
|
-
{ value: false, label: 'Off' },
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
key: 'agentMode',
|
|
64
|
-
label: 'Agent Mode',
|
|
65
|
-
value: () => config.get('agentMode') === 'on' ? 'ON' : 'Manual',
|
|
66
|
-
type: 'select',
|
|
67
|
-
options: [
|
|
68
|
-
{ value: 'on', label: 'ON' },
|
|
69
|
-
{ value: 'manual', label: 'Manual' },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
key: 'agentApiTimeout',
|
|
74
|
-
label: 'Agent API Timeout (ms)',
|
|
75
|
-
value: () => config.get('agentApiTimeout'),
|
|
76
|
-
type: 'number',
|
|
77
|
-
min: 30000,
|
|
78
|
-
max: 300000,
|
|
79
|
-
step: 10000,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
key: 'agentMaxDuration',
|
|
83
|
-
label: 'Agent Max Duration (min)',
|
|
84
|
-
value: () => config.get('agentMaxDuration'),
|
|
85
|
-
type: 'number',
|
|
86
|
-
min: 5,
|
|
87
|
-
max: 60,
|
|
88
|
-
step: 5,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
key: 'agentMaxIterations',
|
|
92
|
-
label: 'Agent Max Iterations',
|
|
93
|
-
value: () => config.get('agentMaxIterations'),
|
|
94
|
-
type: 'number',
|
|
95
|
-
min: 10,
|
|
96
|
-
max: 200,
|
|
97
|
-
step: 10,
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
export const Settings = ({ onClose, notify, hasWriteAccess = false, hasProjectContext = false }) => {
|
|
101
|
-
const [selected, setSelected] = useState(0);
|
|
102
|
-
const [editing, setEditing] = useState(false);
|
|
103
|
-
const [editValue, setEditValue] = useState('');
|
|
104
|
-
useInput((input, key) => {
|
|
105
|
-
if (key.escape) {
|
|
106
|
-
if (editing) {
|
|
107
|
-
setEditing(false);
|
|
108
|
-
setEditValue('');
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
onClose();
|
|
112
|
-
}
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (editing) {
|
|
116
|
-
// Handle editing mode
|
|
117
|
-
if (key.return) {
|
|
118
|
-
const setting = SETTINGS[selected];
|
|
119
|
-
if (setting.type === 'number') {
|
|
120
|
-
const num = parseFloat(editValue);
|
|
121
|
-
if (!isNaN(num)) {
|
|
122
|
-
const clamped = Math.max(setting.min || 0, Math.min(setting.max || Infinity, num));
|
|
123
|
-
config.set(setting.key, clamped);
|
|
124
|
-
// Update rate limiters if changed
|
|
125
|
-
if (setting.key === 'rateLimitApi' || setting.key === 'rateLimitCommands') {
|
|
126
|
-
updateRateLimits();
|
|
127
|
-
}
|
|
128
|
-
notify(`${setting.label}: ${clamped}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
setEditing(false);
|
|
132
|
-
setEditValue('');
|
|
133
|
-
}
|
|
134
|
-
else if (key.backspace || key.delete) {
|
|
135
|
-
setEditValue(v => v.slice(0, -1));
|
|
136
|
-
}
|
|
137
|
-
else if (/^[0-9.]$/.test(input)) {
|
|
138
|
-
setEditValue(v => v + input);
|
|
139
|
-
}
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
// Navigation mode
|
|
143
|
-
if (key.upArrow) {
|
|
144
|
-
setSelected(s => Math.max(0, s - 1));
|
|
145
|
-
}
|
|
146
|
-
else if (key.downArrow) {
|
|
147
|
-
setSelected(s => Math.min(SETTINGS.length - 1, s + 1));
|
|
148
|
-
}
|
|
149
|
-
else if (key.leftArrow || key.rightArrow) {
|
|
150
|
-
// Adjust value with arrows
|
|
151
|
-
const setting = SETTINGS[selected];
|
|
152
|
-
if (setting.type === 'number') {
|
|
153
|
-
const current = setting.value();
|
|
154
|
-
const step = setting.step || 1;
|
|
155
|
-
const delta = key.leftArrow ? -step : step;
|
|
156
|
-
const newValue = Math.max(setting.min || 0, Math.min(setting.max || Infinity, current + delta));
|
|
157
|
-
config.set(setting.key, newValue);
|
|
158
|
-
// Update rate limiters if changed
|
|
159
|
-
if (setting.key === 'rateLimitApi' || setting.key === 'rateLimitCommands') {
|
|
160
|
-
updateRateLimits();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
else if (setting.type === 'select' && setting.options) {
|
|
164
|
-
const current = config.get(setting.key);
|
|
165
|
-
const currentIdx = setting.options.findIndex(o => o.value === current);
|
|
166
|
-
const newIdx = key.leftArrow
|
|
167
|
-
? Math.max(0, currentIdx - 1)
|
|
168
|
-
: Math.min(setting.options.length - 1, currentIdx + 1);
|
|
169
|
-
config.set(setting.key, setting.options[newIdx].value);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
else if (key.return) {
|
|
173
|
-
const setting = SETTINGS[selected];
|
|
174
|
-
if (setting.type === 'number') {
|
|
175
|
-
setEditing(true);
|
|
176
|
-
setEditValue(String(setting.value()));
|
|
177
|
-
}
|
|
178
|
-
else if (setting.type === 'select' && setting.options) {
|
|
179
|
-
// Toggle select options
|
|
180
|
-
const current = config.get(setting.key);
|
|
181
|
-
const currentIdx = setting.options.findIndex(o => o.value === current);
|
|
182
|
-
const newIdx = (currentIdx + 1) % setting.options.length;
|
|
183
|
-
config.set(setting.key, setting.options[newIdx].value);
|
|
184
|
-
notify(`${setting.label}: ${setting.options[newIdx].label}`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
const agentMode = config.get('agentMode');
|
|
189
|
-
const agentCanRun = agentMode === 'on' && hasWriteAccess && hasProjectContext;
|
|
190
|
-
const agentStatusMessage = agentMode === 'on'
|
|
191
|
-
? (!hasWriteAccess
|
|
192
|
-
? '⚠️ Agent needs permission - use /grant to allow folder access'
|
|
193
|
-
: (!hasProjectContext
|
|
194
|
-
? '⚠️ Agent needs permission - use /grant to allow folder access'
|
|
195
|
-
: '✓ Agent will run automatically on every message'))
|
|
196
|
-
: 'ℹ️ Manual mode - use /agent <task> to run agent';
|
|
197
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "#f02a30", bold: true, children: "Settings" }), _jsx(Text, { children: " " }), SETTINGS.map((setting, i) => (_jsx(Box, { children: _jsxs(Text, { children: [i === selected ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsxs(Text, { color: i === selected ? '#f02a30' : undefined, children: [setting.label, ":"] }), _jsx(Text, { children: " " }), editing && i === selected ? (_jsx(Text, { color: "cyan", inverse: true, children: editValue || ' ' })) : (_jsx(Text, { color: "green", children: setting.value() })), i === selected && setting.type === 'number' && !editing && (_jsx(Text, { children: " (\u2190/\u2192 adjust, Enter to type)" })), i === selected && setting.type === 'select' && (_jsx(Text, { children: " (\u2190/\u2192 or Enter to toggle)" }))] }) }, setting.key))), _jsx(Text, { children: " " }), _jsx(Text, { color: agentCanRun ? 'green' : (agentMode === 'on' ? 'yellow' : 'gray'), children: agentStatusMessage }), _jsx(Text, { children: " " }), _jsx(Text, { children: "\u2191/\u2193 Navigate | \u2190/\u2192 Adjust | Enter Edit | Esc Close" })] }));
|
|
198
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Isolated Spinner component
|
|
3
|
-
* Animation state is local - doesn't cause parent re-renders
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
declare const SPINNERS: {
|
|
7
|
-
dots: string[];
|
|
8
|
-
line: string[];
|
|
9
|
-
simple: string[];
|
|
10
|
-
arrow: string[];
|
|
11
|
-
bounce: string[];
|
|
12
|
-
};
|
|
13
|
-
type SpinnerType = keyof typeof SPINNERS;
|
|
14
|
-
interface SpinnerProps {
|
|
15
|
-
type?: SpinnerType;
|
|
16
|
-
color?: string;
|
|
17
|
-
interval?: number;
|
|
18
|
-
prefix?: string;
|
|
19
|
-
suffix?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Spinner with isolated animation state
|
|
23
|
-
* Parent component won't re-render when spinner frame changes
|
|
24
|
-
*/
|
|
25
|
-
export declare const Spinner: React.FC<SpinnerProps>;
|
|
26
|
-
/**
|
|
27
|
-
* Static spinner character (no animation)
|
|
28
|
-
* Use when you want consistent display without flickering
|
|
29
|
-
*/
|
|
30
|
-
export declare const StaticSpinner: React.FC<{
|
|
31
|
-
char?: string;
|
|
32
|
-
color?: string;
|
|
33
|
-
}>;
|
|
34
|
-
export default Spinner;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Isolated Spinner component
|
|
4
|
-
* Animation state is local - doesn't cause parent re-renders
|
|
5
|
-
*/
|
|
6
|
-
import { useState, useEffect, memo } from 'react';
|
|
7
|
-
import { Text } from 'ink';
|
|
8
|
-
// Different spinner styles
|
|
9
|
-
const SPINNERS = {
|
|
10
|
-
dots: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
|
|
11
|
-
line: ['/', '-', '\\', '|'],
|
|
12
|
-
simple: ['·', '•', '●', '•'],
|
|
13
|
-
arrow: ['←', '↖', '↑', '↗', '→', '↘', '↓', '↙'],
|
|
14
|
-
bounce: ['⠁', '⠂', '⠄', '⠂'],
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Spinner with isolated animation state
|
|
18
|
-
* Parent component won't re-render when spinner frame changes
|
|
19
|
-
*/
|
|
20
|
-
export const Spinner = memo(({ type = 'line', color = '#f02a30', interval = 100, prefix = '', suffix = '', }) => {
|
|
21
|
-
const [frame, setFrame] = useState(0);
|
|
22
|
-
const frames = SPINNERS[type];
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
const timer = setInterval(() => {
|
|
25
|
-
setFrame(f => (f + 1) % frames.length);
|
|
26
|
-
}, interval);
|
|
27
|
-
return () => clearInterval(timer);
|
|
28
|
-
}, [frames.length, interval]);
|
|
29
|
-
return (_jsxs(Text, { children: [prefix, _jsx(Text, { color: color, children: frames[frame] }), suffix] }));
|
|
30
|
-
});
|
|
31
|
-
Spinner.displayName = 'Spinner';
|
|
32
|
-
/**
|
|
33
|
-
* Static spinner character (no animation)
|
|
34
|
-
* Use when you want consistent display without flickering
|
|
35
|
-
*/
|
|
36
|
-
export const StaticSpinner = memo(({ char = '●', color = '#f02a30', }) => (_jsx(Text, { color: color, children: char })));
|
|
37
|
-
StaticSpinner.displayName = 'StaticSpinner';
|
|
38
|
-
export default Spinner;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text, Box } from 'ink';
|
|
3
|
-
import { config, getMaskedApiKey, getModelsForCurrentProvider, getCurrentProvider, PROTOCOLS, LANGUAGES } from '../config/index.js';
|
|
4
|
-
export const Status = () => {
|
|
5
|
-
const model = config.get('model');
|
|
6
|
-
const protocol = config.get('protocol');
|
|
7
|
-
const plan = config.get('plan');
|
|
8
|
-
const language = config.get('language');
|
|
9
|
-
const agentMode = config.get('agentMode');
|
|
10
|
-
const provider = getCurrentProvider();
|
|
11
|
-
const models = getModelsForCurrentProvider();
|
|
12
|
-
return (_jsxs(Box, { flexDirection: "column", 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()] })] }));
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Streaming message component
|
|
3
|
-
* Isolates streaming state from main App to reduce re-renders
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
interface StreamingMessageProps {
|
|
7
|
-
content: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Displays streaming content as it arrives
|
|
11
|
-
* Wrapped in memo to prevent unnecessary re-renders when content hasn't changed
|
|
12
|
-
*/
|
|
13
|
-
export declare const StreamingMessage: React.FC<StreamingMessageProps>;
|
|
14
|
-
export default StreamingMessage;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Streaming message component
|
|
4
|
-
* Isolates streaming state from main App to reduce re-renders
|
|
5
|
-
*/
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
import { Box } from 'ink';
|
|
8
|
-
import { MessageView } from './Message.js';
|
|
9
|
-
/**
|
|
10
|
-
* Displays streaming content as it arrives
|
|
11
|
-
* Wrapped in memo to prevent unnecessary re-renders when content hasn't changed
|
|
12
|
-
*/
|
|
13
|
-
export const StreamingMessage = memo(({ content }) => {
|
|
14
|
-
if (!content)
|
|
15
|
-
return null;
|
|
16
|
-
return (_jsx(Box, { flexDirection: "column", children: _jsx(MessageView, { role: "assistant", content: content }) }));
|
|
17
|
-
});
|
|
18
|
-
StreamingMessage.displayName = 'StreamingMessage';
|
|
19
|
-
export default StreamingMessage;
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { render } from 'ink';
|
|
4
|
-
import { App } from './app.js';
|
|
5
|
-
import { getCurrentVersion } from './utils/update.js';
|
|
6
|
-
// Handle CLI flags
|
|
7
|
-
const args = process.argv.slice(2);
|
|
8
|
-
if (args.includes('--version') || args.includes('-v')) {
|
|
9
|
-
console.log(`Codeep v${getCurrentVersion()}`);
|
|
10
|
-
process.exit(0);
|
|
11
|
-
}
|
|
12
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
13
|
-
console.log(`
|
|
14
|
-
Codeep - AI-powered coding assistant TUI
|
|
15
|
-
|
|
16
|
-
Usage:
|
|
17
|
-
codeep Start interactive chat
|
|
18
|
-
codeep --version Show version
|
|
19
|
-
codeep --help Show this help
|
|
20
|
-
|
|
21
|
-
Commands (in chat):
|
|
22
|
-
/help Show all available commands
|
|
23
|
-
/status Show current status
|
|
24
|
-
/version Show version and current model
|
|
25
|
-
/update Check for updates
|
|
26
|
-
/exit Quit application
|
|
27
|
-
|
|
28
|
-
Documentation: https://codeep.dev
|
|
29
|
-
GitHub: https://github.com/VladoIvankovic/Codeep
|
|
30
|
-
X/Twitter: https://x.com/CodeepDev
|
|
31
|
-
Contact: info@codeep.dev
|
|
32
|
-
`);
|
|
33
|
-
process.exit(0);
|
|
34
|
-
}
|
|
35
|
-
// Clear screen on start
|
|
36
|
-
console.clear();
|
|
37
|
-
// Render app with optimized settings
|
|
38
|
-
render(_jsx(App, {}), {
|
|
39
|
-
// Limit frames per second to reduce CPU usage and flickering
|
|
40
|
-
// Default is undefined (no limit), we set to 30fps
|
|
41
|
-
patchConsole: false, // Don't patch console - we handle output ourselves
|
|
42
|
-
});
|