codeep 1.1.12 → 1.1.14

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.
Files changed (45) hide show
  1. package/bin/codeep.js +1 -1
  2. package/dist/config/index.js +10 -10
  3. package/dist/renderer/App.d.ts +430 -0
  4. package/dist/renderer/App.js +2712 -0
  5. package/dist/renderer/ChatUI.d.ts +71 -0
  6. package/dist/renderer/ChatUI.js +286 -0
  7. package/dist/renderer/Input.d.ts +72 -0
  8. package/dist/renderer/Input.js +371 -0
  9. package/dist/renderer/Screen.d.ts +79 -0
  10. package/dist/renderer/Screen.js +278 -0
  11. package/dist/renderer/ansi.d.ts +99 -0
  12. package/dist/renderer/ansi.js +176 -0
  13. package/dist/renderer/components/Box.d.ts +64 -0
  14. package/dist/renderer/components/Box.js +90 -0
  15. package/dist/renderer/components/Help.d.ts +30 -0
  16. package/dist/renderer/components/Help.js +195 -0
  17. package/dist/renderer/components/Intro.d.ts +12 -0
  18. package/dist/renderer/components/Intro.js +128 -0
  19. package/dist/renderer/components/Login.d.ts +42 -0
  20. package/dist/renderer/components/Login.js +178 -0
  21. package/dist/renderer/components/Modal.d.ts +43 -0
  22. package/dist/renderer/components/Modal.js +207 -0
  23. package/dist/renderer/components/Permission.d.ts +20 -0
  24. package/dist/renderer/components/Permission.js +113 -0
  25. package/dist/renderer/components/SelectScreen.d.ts +26 -0
  26. package/dist/renderer/components/SelectScreen.js +101 -0
  27. package/dist/renderer/components/Settings.d.ts +37 -0
  28. package/dist/renderer/components/Settings.js +333 -0
  29. package/dist/renderer/components/Status.d.ts +18 -0
  30. package/dist/renderer/components/Status.js +78 -0
  31. package/dist/renderer/demo-app.d.ts +6 -0
  32. package/dist/renderer/demo-app.js +85 -0
  33. package/dist/renderer/demo.d.ts +6 -0
  34. package/dist/renderer/demo.js +52 -0
  35. package/dist/renderer/index.d.ts +16 -0
  36. package/dist/renderer/index.js +17 -0
  37. package/dist/renderer/main.d.ts +6 -0
  38. package/dist/renderer/main.js +1635 -0
  39. package/dist/utils/agent.d.ts +21 -0
  40. package/dist/utils/agent.js +29 -0
  41. package/dist/utils/clipboard.d.ts +15 -0
  42. package/dist/utils/clipboard.js +95 -0
  43. package/package.json +7 -11
  44. package/dist/utils/console.d.ts +0 -55
  45. package/dist/utils/console.js +0 -188
package/bin/codeep.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/index.js';
2
+ import '../dist/renderer/main.js';
@@ -216,16 +216,16 @@ const apiKeyCache = new Map();
216
216
  export const LANGUAGES = {
217
217
  'auto': 'Auto-detect',
218
218
  'en': 'English',
219
- 'zh': 'Chinese (中文)',
220
- 'es': 'Spanish (Español)',
221
- 'hi': 'Hindi (हिन्दी)',
222
- 'ar': 'Arabic (العربية)',
223
- 'pt': 'Portuguese (Português)',
224
- 'fr': 'French (Français)',
225
- 'de': 'German (Deutsch)',
226
- 'ja': 'Japanese (日本語)',
227
- 'ru': 'Russian (Русский)',
228
- 'hr': 'Croatian (Hrvatski)',
219
+ 'zh': 'Chinese',
220
+ 'es': 'Spanish',
221
+ 'hi': 'Hindi',
222
+ 'ar': 'Arabic',
223
+ 'pt': 'Portuguese',
224
+ 'fr': 'French',
225
+ 'de': 'German',
226
+ 'ja': 'Japanese',
227
+ 'ru': 'Russian',
228
+ 'hr': 'Croatian',
229
229
  };
230
230
  export const PROTOCOLS = {
231
231
  'openai': 'OpenAI Compatible',
@@ -0,0 +1,430 @@
1
+ /**
2
+ * Main Application using custom renderer
3
+ * Replaces Ink-based App
4
+ */
5
+ import { StatusInfo } from './components/Status';
6
+ import { SelectItem } from './components/SelectScreen';
7
+ export interface Message {
8
+ role: 'user' | 'assistant' | 'system';
9
+ content: string;
10
+ }
11
+ export type AppScreen = 'chat' | 'status';
12
+ export interface ConfirmOptions {
13
+ title: string;
14
+ message: string[];
15
+ confirmLabel?: string;
16
+ cancelLabel?: string;
17
+ onConfirm: () => void;
18
+ onCancel?: () => void;
19
+ }
20
+ export interface AppOptions {
21
+ onSubmit: (message: string) => Promise<void>;
22
+ onCommand: (command: string, args: string[]) => void;
23
+ onExit: () => void;
24
+ getStatus: () => StatusInfo;
25
+ hasWriteAccess?: () => boolean;
26
+ hasProjectContext?: () => boolean;
27
+ }
28
+ export declare class App {
29
+ private screen;
30
+ private input;
31
+ private editor;
32
+ private messages;
33
+ private streamingContent;
34
+ private isStreaming;
35
+ private isLoading;
36
+ private currentScreen;
37
+ private options;
38
+ private scrollOffset;
39
+ private notification;
40
+ private notificationTimeout;
41
+ private spinnerFrame;
42
+ private spinnerInterval;
43
+ private isAgentRunning;
44
+ private agentIteration;
45
+ private agentActions;
46
+ private agentThinking;
47
+ private pasteInfo;
48
+ private pasteInfoOpen;
49
+ private helpOpen;
50
+ private helpScrollIndex;
51
+ private settingsState;
52
+ private showAutocomplete;
53
+ private autocompleteIndex;
54
+ private autocompleteItems;
55
+ private confirmOpen;
56
+ private confirmOptions;
57
+ private confirmSelection;
58
+ private menuOpen;
59
+ private menuTitle;
60
+ private menuItems;
61
+ private menuIndex;
62
+ private menuCurrentValue;
63
+ private menuCallback;
64
+ private settingsOpen;
65
+ private permissionOpen;
66
+ private permissionIndex;
67
+ private permissionPath;
68
+ private permissionIsProject;
69
+ private permissionCallback;
70
+ private sessionPickerOpen;
71
+ private sessionPickerIndex;
72
+ private sessionPickerItems;
73
+ private sessionPickerCallback;
74
+ private sessionPickerDeleteMode;
75
+ private sessionPickerDeleteCallback;
76
+ private searchOpen;
77
+ private searchQuery;
78
+ private searchResults;
79
+ private searchIndex;
80
+ private searchCallback;
81
+ private exportOpen;
82
+ private exportIndex;
83
+ private exportCallback;
84
+ private logoutOpen;
85
+ private logoutIndex;
86
+ private logoutProviders;
87
+ private logoutCallback;
88
+ private showIntro;
89
+ private introPhase;
90
+ private introProgress;
91
+ private introInterval;
92
+ private introCallback;
93
+ private loginOpen;
94
+ private loginStep;
95
+ private loginProviders;
96
+ private loginProviderIndex;
97
+ private loginApiKey;
98
+ private loginError;
99
+ private loginCallback;
100
+ private static readonly GLITCH_CHARS;
101
+ private static readonly COMMANDS;
102
+ constructor(options: AppOptions);
103
+ /**
104
+ * Start the application
105
+ */
106
+ start(): void;
107
+ /**
108
+ * Stop the application
109
+ */
110
+ stop(): void;
111
+ /**
112
+ * Add a message
113
+ */
114
+ addMessage(message: Message): void;
115
+ /**
116
+ * Set messages (for loading session)
117
+ */
118
+ setMessages(messages: Message[]): void;
119
+ /**
120
+ * Clear messages
121
+ */
122
+ clearMessages(): void;
123
+ /**
124
+ * Get all messages (for API history)
125
+ */
126
+ getMessages(): Message[];
127
+ /**
128
+ * Scroll to a specific message by index
129
+ */
130
+ scrollToMessage(messageIndex: number): void;
131
+ /**
132
+ * Get messages without system messages (for API)
133
+ */
134
+ getChatHistory(): Array<{
135
+ role: 'user' | 'assistant';
136
+ content: string;
137
+ }>;
138
+ /**
139
+ * Start streaming
140
+ */
141
+ startStreaming(): void;
142
+ /**
143
+ * Add streaming chunk
144
+ */
145
+ addStreamChunk(chunk: string): void;
146
+ /**
147
+ * End streaming
148
+ */
149
+ endStreaming(): void;
150
+ /**
151
+ * Set loading state
152
+ */
153
+ setLoading(loading: boolean): void;
154
+ /**
155
+ * Start spinner animation
156
+ */
157
+ private startSpinner;
158
+ /**
159
+ * Stop spinner animation
160
+ */
161
+ private stopSpinner;
162
+ /**
163
+ * Set agent running state
164
+ */
165
+ setAgentRunning(running: boolean): void;
166
+ /**
167
+ * Update agent progress
168
+ */
169
+ updateAgentProgress(iteration: number, action?: {
170
+ type: string;
171
+ target: string;
172
+ result: string;
173
+ }): void;
174
+ /**
175
+ * Set agent thinking text
176
+ */
177
+ setAgentThinking(text: string): void;
178
+ /**
179
+ * Paste from system clipboard (Ctrl+V)
180
+ */
181
+ private pasteFromClipboard;
182
+ /**
183
+ * Handle paste detection - call this when large text is pasted
184
+ */
185
+ handlePaste(text: string): void;
186
+ /**
187
+ * Handle paste info key events
188
+ */
189
+ private handlePasteInfoKey;
190
+ /**
191
+ * Show notification
192
+ */
193
+ notify(message: string, duration?: number): void;
194
+ /**
195
+ * Show list selection (inline menu below status bar)
196
+ */
197
+ showList(title: string, items: string[], callback: (index: number) => void): void;
198
+ /**
199
+ * Show settings (inline, below status bar)
200
+ */
201
+ showSettings(): void;
202
+ /**
203
+ * Show confirmation dialog
204
+ */
205
+ showConfirm(options: ConfirmOptions): void;
206
+ /**
207
+ * Show permission dialog (inline, below status bar)
208
+ */
209
+ showPermission(projectPath: string, isProject: boolean, callback: (level: 'none' | 'read' | 'write') => void): void;
210
+ /**
211
+ * Show session picker (inline, below status bar)
212
+ */
213
+ showSessionPicker(sessions: Array<{
214
+ name: string;
215
+ messageCount: number;
216
+ createdAt: string;
217
+ }>, callback: (sessionName: string | null) => void, deleteCallback?: (sessionName: string) => void): void;
218
+ /**
219
+ * Show search screen
220
+ */
221
+ showSearch(query: string, results: Array<{
222
+ role: string;
223
+ messageIndex: number;
224
+ matchedText: string;
225
+ }>, callback: (messageIndex: number) => void): void;
226
+ /**
227
+ * Show export screen
228
+ */
229
+ showExport(callback: (format: 'md' | 'json' | 'txt') => void): void;
230
+ /**
231
+ * Show logout picker
232
+ */
233
+ showLogoutPicker(providers: Array<{
234
+ id: string;
235
+ name: string;
236
+ isCurrent: boolean;
237
+ }>, callback: (providerId: string | 'all' | null) => void): void;
238
+ /**
239
+ * Start intro animation
240
+ */
241
+ startIntro(callback: () => void): void;
242
+ /**
243
+ * Skip intro animation
244
+ */
245
+ private skipIntro;
246
+ /**
247
+ * Finish intro animation
248
+ */
249
+ private finishIntro;
250
+ /**
251
+ * Show inline login dialog
252
+ */
253
+ showLogin(providers: Array<{
254
+ id: string;
255
+ name: string;
256
+ }>, callback: (result: {
257
+ providerId: string;
258
+ apiKey: string;
259
+ } | null) => void): void;
260
+ /**
261
+ * Reinitialize screen (after external screen takeover)
262
+ */
263
+ reinitScreen(): void;
264
+ /**
265
+ * Show inline menu (renders below status bar)
266
+ */
267
+ showSelect(title: string, items: SelectItem[], currentValue: string, callback: (item: SelectItem) => void): void;
268
+ /**
269
+ * Handle keyboard input
270
+ */
271
+ private handleKey;
272
+ /**
273
+ * Handle chat screen keys
274
+ */
275
+ private handleChatKey;
276
+ /**
277
+ * Update autocomplete suggestions
278
+ */
279
+ private updateAutocomplete;
280
+ /**
281
+ * Handle help screen keys
282
+ */
283
+ private handleInlineHelpKey;
284
+ /**
285
+ * Handle inline settings keys
286
+ */
287
+ private handleInlineSettingsKey;
288
+ /**
289
+ * Handle search screen keys
290
+ */
291
+ private handleSearchKey;
292
+ /**
293
+ * Handle export screen keys
294
+ */
295
+ private handleExportKey;
296
+ /**
297
+ * Handle logout picker keys
298
+ */
299
+ private handleLogoutKey;
300
+ /**
301
+ * Handle login keys
302
+ */
303
+ private handleLoginKey;
304
+ /**
305
+ * Paste API key from clipboard
306
+ */
307
+ private pasteApiKey;
308
+ /**
309
+ * Handle inline menu keys
310
+ */
311
+ private handleMenuKey;
312
+ /**
313
+ * Handle confirmation dialog keys
314
+ */
315
+ private handleInlinePermissionKey;
316
+ private handleInlineSessionPickerKey;
317
+ private handleInlineConfirmKey;
318
+ /**
319
+ * Handle command
320
+ */
321
+ private handleCommand;
322
+ /**
323
+ * Render current screen
324
+ */
325
+ render(): void;
326
+ /**
327
+ * Render chat screen
328
+ */
329
+ private renderChat;
330
+ /**
331
+ * Render inline confirmation dialog below status bar
332
+ */
333
+ private renderInlineConfirm;
334
+ /**
335
+ * Render input line
336
+ */
337
+ private renderInput;
338
+ /**
339
+ * Render inline menu below status bar
340
+ */
341
+ private renderInlineMenu;
342
+ /**
343
+ * Render inline settings below status bar
344
+ */
345
+ private renderInlineSettings;
346
+ /**
347
+ * Render inline help below status bar
348
+ */
349
+ private renderInlineHelp;
350
+ /**
351
+ * Render inline autocomplete below status bar
352
+ */
353
+ private renderInlineAutocomplete;
354
+ /**
355
+ * Render inline permission dialog
356
+ */
357
+ private renderInlinePermission;
358
+ /**
359
+ * Render inline session picker
360
+ */
361
+ private renderInlineSessionPicker;
362
+ /**
363
+ * Render inline paste info below status bar
364
+ */
365
+ private renderInlinePasteInfo;
366
+ /**
367
+ * Render inline agent progress below status bar (LiveCodeStream style)
368
+ */
369
+ private renderInlineAgentProgress;
370
+ /**
371
+ * Get color for action type
372
+ */
373
+ private getActionColor;
374
+ /**
375
+ * Format action target for display
376
+ */
377
+ private formatActionTarget;
378
+ /**
379
+ * Get action label for display
380
+ */
381
+ private getActionLabel;
382
+ /**
383
+ * Render status bar
384
+ */
385
+ private renderStatusBar;
386
+ /**
387
+ * Get visible messages (including streaming)
388
+ */
389
+ private getVisibleMessages;
390
+ /**
391
+ * Format message into lines with syntax highlighting for code blocks
392
+ */
393
+ private formatMessage;
394
+ /**
395
+ * Format plain text lines
396
+ */
397
+ private formatTextLines;
398
+ /**
399
+ * Format code block with syntax highlighting (no border)
400
+ */
401
+ private formatCodeBlock;
402
+ /**
403
+ * Render inline search screen
404
+ */
405
+ private renderInlineSearch;
406
+ /**
407
+ * Render inline export screen
408
+ */
409
+ private renderInlineExport;
410
+ /**
411
+ * Render inline logout picker
412
+ */
413
+ private renderInlineLogout;
414
+ /**
415
+ * Render inline login dialog
416
+ */
417
+ private renderInlineLogin;
418
+ /**
419
+ * Render intro animation
420
+ */
421
+ private renderIntro;
422
+ /**
423
+ * Get decrypted logo for intro animation
424
+ */
425
+ private getDecryptedLogo;
426
+ /**
427
+ * Word wrap
428
+ */
429
+ private wordWrap;
430
+ }