codeep 2.9.0 → 2.11.0
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 +3 -3
- package/dist/acp/commands.js +29 -1
- package/dist/acp/protocol.d.ts +4 -0
- package/dist/acp/server.js +7 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +31 -21
- package/dist/config/providers.js +20 -12
- package/dist/renderer/App.d.ts +7 -1
- package/dist/renderer/App.js +78 -50
- package/dist/renderer/commands.js +57 -9
- package/dist/renderer/components/Help.d.ts +0 -5
- package/dist/renderer/components/Help.js +1 -68
- package/dist/renderer/components/Settings.d.ts +0 -5
- package/dist/renderer/components/Settings.js +1 -80
- package/dist/renderer/highlight.js +16 -0
- package/dist/renderer/index.d.ts +1 -2
- package/dist/renderer/index.js +1 -2
- package/dist/utils/tokenTracker.js +8 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -4
- package/dist/renderer/ChatUI.d.ts +0 -71
- package/dist/renderer/ChatUI.js +0 -286
- package/dist/renderer/demo-app.d.ts +0 -6
- package/dist/renderer/demo-app.js +0 -85
- package/dist/renderer/demo.d.ts +0 -6
- package/dist/renderer/demo.js +0 -52
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Demo for full App with modals
|
|
4
|
-
* Run with: npm run demo:app
|
|
5
|
-
*/
|
|
6
|
-
import { App } from './App.js';
|
|
7
|
-
// Simulate API response
|
|
8
|
-
function simulateResponse(app, text) {
|
|
9
|
-
return new Promise((resolve) => {
|
|
10
|
-
app.startStreaming();
|
|
11
|
-
let index = 0;
|
|
12
|
-
const words = text.split(' ');
|
|
13
|
-
const interval = setInterval(() => {
|
|
14
|
-
if (index >= words.length) {
|
|
15
|
-
clearInterval(interval);
|
|
16
|
-
app.endStreaming();
|
|
17
|
-
resolve();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
app.addStreamChunk((index > 0 ? ' ' : '') + words[index]);
|
|
21
|
-
index++;
|
|
22
|
-
}, 30);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
// Mock status
|
|
26
|
-
function getStatus() {
|
|
27
|
-
return {
|
|
28
|
-
version: '1.1.12',
|
|
29
|
-
provider: 'OpenAI',
|
|
30
|
-
model: 'gpt-4o',
|
|
31
|
-
agentMode: 'on',
|
|
32
|
-
projectPath: process.cwd(),
|
|
33
|
-
hasWriteAccess: true,
|
|
34
|
-
sessionId: 'demo-session',
|
|
35
|
-
messageCount: 0,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// Main
|
|
39
|
-
async function main() {
|
|
40
|
-
const app = new App({
|
|
41
|
-
onSubmit: async (message) => {
|
|
42
|
-
// Simulate AI response
|
|
43
|
-
const responses = {
|
|
44
|
-
'hello': 'Hello! I\'m Codeep, your AI coding assistant. How can I help you today?',
|
|
45
|
-
'hi': 'Hi there! What would you like to work on?',
|
|
46
|
-
'test': 'This is the full App demo with:\n\n• Help screen (/help)\n• Status screen (/status)\n• Modal overlays\n• Streaming responses\n• All keyboard shortcuts\n\nThe custom renderer is working perfectly!',
|
|
47
|
-
};
|
|
48
|
-
const response = responses[message.toLowerCase()] ||
|
|
49
|
-
`You said: "${message}"\n\nI'm a demo response. In the real app, this would be an AI-generated response based on your project context.`;
|
|
50
|
-
await simulateResponse(app, response);
|
|
51
|
-
},
|
|
52
|
-
onCommand: (command, args) => {
|
|
53
|
-
// Handle commands not built into App
|
|
54
|
-
switch (command) {
|
|
55
|
-
case 'version':
|
|
56
|
-
app.notify('Codeep v1.1.12 • OpenAI • gpt-4o');
|
|
57
|
-
break;
|
|
58
|
-
case 'provider':
|
|
59
|
-
app.showList('Select Provider', ['OpenAI', 'Anthropic', 'Google', 'Local'], (index) => {
|
|
60
|
-
app.notify(`Selected: ${['OpenAI', 'Anthropic', 'Google', 'Local'][index]}`);
|
|
61
|
-
});
|
|
62
|
-
break;
|
|
63
|
-
case 'model':
|
|
64
|
-
app.showList('Select Model', ['gpt-4o', 'gpt-4o-mini', 'gpt-3.5-turbo', 'o1-preview'], (index) => {
|
|
65
|
-
app.notify(`Selected model: ${['gpt-4o', 'gpt-4o-mini', 'gpt-3.5-turbo', 'o1-preview'][index]}`);
|
|
66
|
-
});
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
app.notify(`Unknown command: /${command}`);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
onExit: () => {
|
|
73
|
-
console.log('\nGoodbye!');
|
|
74
|
-
process.exit(0);
|
|
75
|
-
},
|
|
76
|
-
getStatus,
|
|
77
|
-
});
|
|
78
|
-
// Welcome message
|
|
79
|
-
app.addMessage({
|
|
80
|
-
role: 'system',
|
|
81
|
-
content: 'Welcome to Codeep App Demo!\n\nTry these commands:\n• /help - Show help\n• /status - Show status\n• /provider - Select provider\n• /model - Select model\n• /clear - Clear chat\n• /exit - Quit',
|
|
82
|
-
});
|
|
83
|
-
app.start();
|
|
84
|
-
}
|
|
85
|
-
main().catch(console.error);
|
package/dist/renderer/demo.d.ts
DELETED
package/dist/renderer/demo.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Demo/Test for custom renderer
|
|
4
|
-
* Run with: npx ts-node src/renderer/demo.ts
|
|
5
|
-
*/
|
|
6
|
-
import { ChatUI } from './ChatUI.js';
|
|
7
|
-
// Simulate streaming response
|
|
8
|
-
function simulateStreaming(ui, text) {
|
|
9
|
-
return new Promise((resolve) => {
|
|
10
|
-
ui.startStreaming();
|
|
11
|
-
let index = 0;
|
|
12
|
-
const words = text.split(' ');
|
|
13
|
-
const interval = setInterval(() => {
|
|
14
|
-
if (index >= words.length) {
|
|
15
|
-
clearInterval(interval);
|
|
16
|
-
ui.endStreaming();
|
|
17
|
-
resolve();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
ui.addStreamChunk((index > 0 ? ' ' : '') + words[index]);
|
|
21
|
-
index++;
|
|
22
|
-
}, 50); // 50ms per word
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
// Main
|
|
26
|
-
async function main() {
|
|
27
|
-
const ui = new ChatUI({
|
|
28
|
-
onSubmit: async (message) => {
|
|
29
|
-
// Simulate AI response
|
|
30
|
-
const responses = {
|
|
31
|
-
'hello': 'Hello! How can I help you today?',
|
|
32
|
-
'hi': 'Hi there! What would you like to do?',
|
|
33
|
-
'help': 'Available commands:\n- Type any message to chat\n- Ctrl+L to clear\n- Ctrl+C to exit\n- Page Up/Down to scroll',
|
|
34
|
-
'test': 'This is a test response. The custom renderer is working correctly without Ink!\n\nIt supports:\n- Multi-line messages\n- Word wrapping for long lines\n- Streaming responses\n- Scroll history\n- Cursor-based input editing',
|
|
35
|
-
};
|
|
36
|
-
const response = responses[message.toLowerCase()] ||
|
|
37
|
-
`You said: "${message}"\n\nThis is a simulated response from the custom renderer. No Ink involved - just pure ANSI escape codes and a virtual screen buffer with diff-based rendering.`;
|
|
38
|
-
await simulateStreaming(ui, response);
|
|
39
|
-
},
|
|
40
|
-
onExit: () => {
|
|
41
|
-
console.log('\nGoodbye!');
|
|
42
|
-
process.exit(0);
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
// Add welcome message
|
|
46
|
-
ui.addMessage({
|
|
47
|
-
role: 'system',
|
|
48
|
-
content: 'Welcome to Codeep Custom Renderer Demo!\nType "help" for commands, or just start chatting.',
|
|
49
|
-
});
|
|
50
|
-
ui.start();
|
|
51
|
-
}
|
|
52
|
-
main().catch(console.error);
|