codeep 1.1.35 → 1.1.36
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/renderer/App.d.ts +0 -10
- package/dist/renderer/App.js +1 -87
- package/dist/renderer/main.js +1 -15
- package/package.json +1 -1
package/dist/renderer/App.d.ts
CHANGED
|
@@ -43,7 +43,6 @@ export declare class App {
|
|
|
43
43
|
private agentIteration;
|
|
44
44
|
private agentActions;
|
|
45
45
|
private agentThinking;
|
|
46
|
-
private agentCodePreview;
|
|
47
46
|
private pasteInfo;
|
|
48
47
|
private pasteInfoOpen;
|
|
49
48
|
private helpOpen;
|
|
@@ -176,15 +175,6 @@ export declare class App {
|
|
|
176
175
|
* Set agent thinking text
|
|
177
176
|
*/
|
|
178
177
|
setAgentThinking(text: string): void;
|
|
179
|
-
/**
|
|
180
|
-
* Set code preview for agent progress panel
|
|
181
|
-
*/
|
|
182
|
-
setAgentCodePreview(preview: {
|
|
183
|
-
path: string;
|
|
184
|
-
actionType: 'write' | 'edit';
|
|
185
|
-
content: string;
|
|
186
|
-
oldContent?: string;
|
|
187
|
-
} | null): void;
|
|
188
178
|
/**
|
|
189
179
|
* Paste from system clipboard (Ctrl+V)
|
|
190
180
|
*/
|
package/dist/renderer/App.js
CHANGED
|
@@ -241,7 +241,6 @@ export class App {
|
|
|
241
241
|
agentIteration = 0;
|
|
242
242
|
agentActions = [];
|
|
243
243
|
agentThinking = '';
|
|
244
|
-
agentCodePreview = null;
|
|
245
244
|
// Paste detection state
|
|
246
245
|
pasteInfo = null;
|
|
247
246
|
pasteInfoOpen = false;
|
|
@@ -492,12 +491,10 @@ export class App {
|
|
|
492
491
|
this.agentIteration = 0;
|
|
493
492
|
this.agentActions = [];
|
|
494
493
|
this.agentThinking = '';
|
|
495
|
-
this.agentCodePreview = null;
|
|
496
494
|
this.isLoading = false; // Clear loading state when agent takes over
|
|
497
495
|
this.startSpinner();
|
|
498
496
|
}
|
|
499
497
|
else {
|
|
500
|
-
this.agentCodePreview = null;
|
|
501
498
|
this.isLoading = false; // Ensure loading is cleared when agent finishes
|
|
502
499
|
this.stopSpinner();
|
|
503
500
|
}
|
|
@@ -518,36 +515,6 @@ export class App {
|
|
|
518
515
|
*/
|
|
519
516
|
setAgentThinking(text) {
|
|
520
517
|
this.agentThinking = text;
|
|
521
|
-
// Clear code preview when agent moves to a non-write/edit action
|
|
522
|
-
if (text && !text.startsWith('write:') && !text.startsWith('edit:')) {
|
|
523
|
-
this.agentCodePreview = null;
|
|
524
|
-
}
|
|
525
|
-
this.render();
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Set code preview for agent progress panel
|
|
529
|
-
*/
|
|
530
|
-
setAgentCodePreview(preview) {
|
|
531
|
-
if (preview && preview.content) {
|
|
532
|
-
const ext = preview.path.split('.').pop()?.toLowerCase() || '';
|
|
533
|
-
const lang = LANG_ALIASES[ext] || ext;
|
|
534
|
-
const lines = preview.content.split('\n');
|
|
535
|
-
const MAX_STORED_LINES = 50;
|
|
536
|
-
const trimmedContent = lines.length > MAX_STORED_LINES
|
|
537
|
-
? lines.slice(-MAX_STORED_LINES).join('\n')
|
|
538
|
-
: preview.content;
|
|
539
|
-
this.agentCodePreview = {
|
|
540
|
-
path: preview.path,
|
|
541
|
-
actionType: preview.actionType,
|
|
542
|
-
content: trimmedContent,
|
|
543
|
-
oldContent: preview.oldContent,
|
|
544
|
-
lang,
|
|
545
|
-
totalLines: lines.length,
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
this.agentCodePreview = null;
|
|
550
|
-
}
|
|
551
518
|
this.render();
|
|
552
519
|
}
|
|
553
520
|
/**
|
|
@@ -1625,20 +1592,7 @@ export class App {
|
|
|
1625
1592
|
bottomPanelHeight = previewLines + 6; // title + preview + extra line indicator + options
|
|
1626
1593
|
}
|
|
1627
1594
|
else if (this.isAgentRunning) {
|
|
1628
|
-
|
|
1629
|
-
const MAX_PREVIEW_LINES = 12;
|
|
1630
|
-
const storedLines = this.agentCodePreview.content.split('\n').length;
|
|
1631
|
-
const visibleCodeLines = Math.min(storedLines, MAX_PREVIEW_LINES);
|
|
1632
|
-
const startIdx = Math.max(0, storedLines - MAX_PREVIEW_LINES);
|
|
1633
|
-
const startLineNum = this.agentCodePreview.totalLines - storedLines + startIdx;
|
|
1634
|
-
const hasOverflow = startLineNum > 0 ? 1 : 0;
|
|
1635
|
-
// top border + action + code separator + code lines + overflow + stats + bottom border + margin
|
|
1636
|
-
bottomPanelHeight = 1 + 1 + 1 + visibleCodeLines + hasOverflow + 1 + 1 + 1;
|
|
1637
|
-
bottomPanelHeight = Math.min(bottomPanelHeight, Math.floor(height * 0.6));
|
|
1638
|
-
}
|
|
1639
|
-
else {
|
|
1640
|
-
bottomPanelHeight = 5; // Agent progress box (4 lines + 1 margin)
|
|
1641
|
-
}
|
|
1595
|
+
bottomPanelHeight = 5; // Agent progress box (4 lines + 1 margin)
|
|
1642
1596
|
}
|
|
1643
1597
|
else if (this.permissionOpen) {
|
|
1644
1598
|
bottomPanelHeight = 10; // Permission dialog
|
|
@@ -2294,46 +2248,6 @@ export class App {
|
|
|
2294
2248
|
this.screen.write(1, y, 'Starting...', fg.gray);
|
|
2295
2249
|
}
|
|
2296
2250
|
y++;
|
|
2297
|
-
// Code preview section (for write/edit operations)
|
|
2298
|
-
if (this.agentCodePreview) {
|
|
2299
|
-
const MAX_PREVIEW_LINES = 12;
|
|
2300
|
-
// Code separator with language label
|
|
2301
|
-
const langLabel = this.agentCodePreview.lang ? ` ${this.agentCodePreview.lang} ` : '';
|
|
2302
|
-
const sepPadLeft = 2;
|
|
2303
|
-
const sepPadRight = width - sepPadLeft - langLabel.length - 1;
|
|
2304
|
-
this.screen.write(0, y, '─'.repeat(sepPadLeft), SYNTAX.codeFrame);
|
|
2305
|
-
this.screen.write(sepPadLeft, y, langLabel, SYNTAX.codeLang);
|
|
2306
|
-
this.screen.write(sepPadLeft + langLabel.length, y, '─'.repeat(Math.max(0, sepPadRight)), SYNTAX.codeFrame);
|
|
2307
|
-
y++;
|
|
2308
|
-
// Determine visible code lines (show tail for long content)
|
|
2309
|
-
const codeLines = this.agentCodePreview.content.split('\n');
|
|
2310
|
-
const totalLines = this.agentCodePreview.totalLines;
|
|
2311
|
-
const displayCount = Math.min(codeLines.length, MAX_PREVIEW_LINES);
|
|
2312
|
-
const startIdx = Math.max(0, codeLines.length - MAX_PREVIEW_LINES);
|
|
2313
|
-
const startLineNum = totalLines - codeLines.length + startIdx;
|
|
2314
|
-
// Overflow indicator if truncated from top
|
|
2315
|
-
if (startLineNum > 0) {
|
|
2316
|
-
this.screen.write(1, y, `... (${startLineNum} lines above)`, fg.gray);
|
|
2317
|
-
y++;
|
|
2318
|
-
}
|
|
2319
|
-
// Render highlighted code lines with line numbers
|
|
2320
|
-
const lineNumWidth = String(totalLines).length;
|
|
2321
|
-
const codeAreaWidth = width - lineNumWidth - 4;
|
|
2322
|
-
for (let i = 0; i < displayCount; i++) {
|
|
2323
|
-
const lineNum = startLineNum + i + 1;
|
|
2324
|
-
const lineNumStr = String(lineNum).padStart(lineNumWidth, ' ');
|
|
2325
|
-
// Truncate wide lines
|
|
2326
|
-
let codeLine = codeLines[startIdx + i];
|
|
2327
|
-
if (codeLine.length > codeAreaWidth) {
|
|
2328
|
-
codeLine = codeLine.slice(0, codeAreaWidth - 1) + '\u2026';
|
|
2329
|
-
}
|
|
2330
|
-
const highlighted = highlightCode(codeLine, this.agentCodePreview.lang);
|
|
2331
|
-
// Use writeRaw with line number embedded as ANSI since writeRaw clears the full line
|
|
2332
|
-
const lineNumAnsi = SYNTAX.comment + lineNumStr + '\x1b[0m' + ' ';
|
|
2333
|
-
this.screen.writeRaw(y, ' ' + lineNumAnsi + highlighted);
|
|
2334
|
-
y++;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
2251
|
// Stats line: Files and step info
|
|
2338
2252
|
let x = 1;
|
|
2339
2253
|
// File changes
|
package/dist/renderer/main.js
CHANGED
|
@@ -312,7 +312,7 @@ async function executeAgentTask(task, dryRun = false) {
|
|
|
312
312
|
// Update agent thinking
|
|
313
313
|
const shortTarget = target.length > 50 ? '...' + target.slice(-47) : target;
|
|
314
314
|
app.setAgentThinking(`${actionType}: ${shortTarget}`);
|
|
315
|
-
//
|
|
315
|
+
// Add chat message for write/edit operations
|
|
316
316
|
if (actionType === 'write' && tool.parameters.content) {
|
|
317
317
|
const filePath = tool.parameters.path;
|
|
318
318
|
const ext = filePath.split('.').pop() || '';
|
|
@@ -320,11 +320,6 @@ async function executeAgentTask(task, dryRun = false) {
|
|
|
320
320
|
role: 'system',
|
|
321
321
|
content: `**Write** \`${filePath}\`\n\n\`\`\`${ext}\n${tool.parameters.content}\n\`\`\``,
|
|
322
322
|
});
|
|
323
|
-
app.setAgentCodePreview({
|
|
324
|
-
path: filePath,
|
|
325
|
-
actionType: 'write',
|
|
326
|
-
content: tool.parameters.content,
|
|
327
|
-
});
|
|
328
323
|
}
|
|
329
324
|
else if (actionType === 'edit' && tool.parameters.new_text) {
|
|
330
325
|
const filePath = tool.parameters.path;
|
|
@@ -333,15 +328,6 @@ async function executeAgentTask(task, dryRun = false) {
|
|
|
333
328
|
role: 'system',
|
|
334
329
|
content: `**Edit** \`${filePath}\`\n\n\`\`\`${ext}\n${tool.parameters.new_text}\n\`\`\``,
|
|
335
330
|
});
|
|
336
|
-
app.setAgentCodePreview({
|
|
337
|
-
path: filePath,
|
|
338
|
-
actionType: 'edit',
|
|
339
|
-
content: tool.parameters.new_text,
|
|
340
|
-
oldContent: tool.parameters.old_text,
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
app.setAgentCodePreview(null);
|
|
345
331
|
}
|
|
346
332
|
},
|
|
347
333
|
onToolResult: (result, toolCall) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
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",
|