codeep 1.1.17 → 1.1.19

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.
@@ -21,6 +21,7 @@ export interface AppOptions {
21
21
  onSubmit: (message: string) => Promise<void>;
22
22
  onCommand: (command: string, args: string[]) => void;
23
23
  onExit: () => void;
24
+ onStopAgent?: () => void;
24
25
  getStatus: () => StatusInfo;
25
26
  hasWriteAccess?: () => boolean;
26
27
  hasProjectContext?: () => boolean;
@@ -862,13 +862,17 @@ export class App {
862
862
  this.handleMenuKey(event);
863
863
  return;
864
864
  }
865
- // Escape to cancel streaming/loading or close autocomplete
865
+ // Escape to cancel streaming/loading/agent or close autocomplete
866
866
  if (event.key === 'escape') {
867
867
  if (this.showAutocomplete) {
868
868
  this.showAutocomplete = false;
869
869
  this.render();
870
870
  return;
871
871
  }
872
+ if (this.isAgentRunning && this.options.onStopAgent) {
873
+ this.options.onStopAgent();
874
+ return;
875
+ }
872
876
  if (this.isStreaming) {
873
877
  this.endStreaming();
874
878
  }
@@ -1561,7 +1565,7 @@ export class App {
1561
1565
  bottomPanelHeight = previewLines + 6; // title + preview + extra line indicator + options
1562
1566
  }
1563
1567
  else if (this.isAgentRunning) {
1564
- bottomPanelHeight = 6; // Agent progress box (5 lines + 1 margin)
1568
+ bottomPanelHeight = 5; // Agent progress box (4 lines + 1 margin)
1565
1569
  }
1566
1570
  else if (this.permissionOpen) {
1567
1571
  bottomPanelHeight = 10; // Permission dialog
@@ -2168,7 +2172,6 @@ export class App {
2168
2172
  renderInlineAgentProgress(startY, width) {
2169
2173
  let y = startY;
2170
2174
  const spinner = SPINNER_FRAMES[this.spinnerFrame];
2171
- const boxWidth = width - 2; // Use full width minus small margin
2172
2175
  // Calculate stats
2173
2176
  const stats = {
2174
2177
  reads: this.agentActions.filter(a => a.type === 'read').length,
@@ -2180,93 +2183,71 @@ export class App {
2180
2183
  errors: this.agentActions.filter(a => a.result === 'error').length,
2181
2184
  };
2182
2185
  // Top border with title
2183
- // Helper to draw a box line with content
2184
- const drawBoxLine = (content, contentStyle = fg.white) => {
2185
- this.screen.write(0, y, '│', PRIMARY_COLOR);
2186
- this.screen.write(2, y, content, contentStyle);
2187
- this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2188
- y++;
2189
- };
2190
- // Top border with title
2191
2186
  const title = ` ${spinner} AGENT `;
2192
- const titlePadLeft = 3;
2193
- const titlePadRight = boxWidth - titlePadLeft - title.length - 1;
2194
- this.screen.write(0, y, '╭' + '─'.repeat(titlePadLeft), PRIMARY_COLOR);
2195
- this.screen.write(titlePadLeft + 1, y, title, PRIMARY_COLOR + style.bold);
2196
- this.screen.write(titlePadLeft + 1 + title.length, y, '─'.repeat(Math.max(0, titlePadRight)) + '╮', PRIMARY_COLOR);
2187
+ const titlePadLeft = 2;
2188
+ const titlePadRight = width - titlePadLeft - title.length - 1;
2189
+ this.screen.write(0, y, '─'.repeat(titlePadLeft), PRIMARY_COLOR);
2190
+ this.screen.write(titlePadLeft, y, title, PRIMARY_COLOR + style.bold);
2191
+ this.screen.write(titlePadLeft + title.length, y, '─'.repeat(Math.max(0, titlePadRight)), PRIMARY_COLOR);
2197
2192
  y++;
2198
- // Current action line
2199
- this.screen.write(0, y, '│', PRIMARY_COLOR);
2193
+ // Current action line (no side borders)
2200
2194
  if (this.agentActions.length > 0) {
2201
2195
  const lastAction = this.agentActions[this.agentActions.length - 1];
2202
2196
  const actionLabel = this.getActionLabel(lastAction.type);
2203
2197
  const actionColor = this.getActionColor(lastAction.type);
2204
- const maxTargetLen = boxWidth - actionLabel.length - 6;
2198
+ const maxTargetLen = width - actionLabel.length - 4;
2205
2199
  const target = this.formatActionTarget(lastAction.target, maxTargetLen);
2206
- this.screen.write(2, y, actionLabel, actionColor + style.bold);
2207
- this.screen.write(2 + actionLabel.length + 1, y, target, fg.white);
2200
+ this.screen.write(1, y, actionLabel, actionColor + style.bold);
2201
+ this.screen.write(1 + actionLabel.length + 1, y, target, fg.white);
2208
2202
  }
2209
2203
  else {
2210
- this.screen.write(2, y, 'Starting...', fg.gray);
2204
+ this.screen.write(1, y, 'Starting...', fg.gray);
2211
2205
  }
2212
- this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2213
2206
  y++;
2214
- // Separator
2215
- this.screen.write(0, y, '├' + '─'.repeat(boxWidth - 2) + '┤', fg.gray);
2216
- y++;
2217
- // File changes line
2218
- this.screen.write(0, y, '│', PRIMARY_COLOR);
2219
- this.screen.write(2, y, 'Files:', fg.cyan);
2220
- let fileX = 9;
2207
+ // Stats line: Files and step info
2208
+ let x = 1;
2209
+ // File changes
2221
2210
  if (stats.writes > 0) {
2222
2211
  const txt = `+${stats.writes}`;
2223
- this.screen.write(fileX, y, txt, fg.green);
2224
- fileX += txt.length + 1;
2212
+ this.screen.write(x, y, txt, fg.green);
2213
+ x += txt.length + 1;
2225
2214
  }
2226
2215
  if (stats.edits > 0) {
2227
2216
  const txt = `~${stats.edits}`;
2228
- this.screen.write(fileX, y, txt, fg.yellow);
2229
- fileX += txt.length + 1;
2217
+ this.screen.write(x, y, txt, fg.yellow);
2218
+ x += txt.length + 1;
2230
2219
  }
2231
2220
  if (stats.deletes > 0) {
2232
2221
  const txt = `-${stats.deletes}`;
2233
- this.screen.write(fileX, y, txt, fg.red);
2234
- fileX += txt.length + 1;
2235
- }
2236
- if (stats.writes === 0 && stats.edits === 0 && stats.deletes === 0) {
2237
- this.screen.write(fileX, y, 'no changes yet', fg.gray);
2238
- }
2239
- this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2240
- y++;
2241
- // Stats line
2242
- this.screen.write(0, y, '│', PRIMARY_COLOR);
2243
- this.screen.write(2, y, 'Stats:', fg.cyan);
2244
- let statX = 9;
2245
- const statParts = [];
2246
- if (stats.reads > 0)
2247
- statParts.push({ text: `${stats.reads}R`, color: fg.blue });
2248
- if (stats.commands > 0)
2249
- statParts.push({ text: `${stats.commands}C`, color: fg.magenta });
2250
- if (stats.searches > 0)
2251
- statParts.push({ text: `${stats.searches}S`, color: fg.cyan });
2252
- statParts.push({ text: `step ${this.agentIteration}`, color: fg.white });
2253
- for (let i = 0; i < statParts.length; i++) {
2254
- if (i > 0) {
2255
- this.screen.write(statX, y, '|', fg.gray);
2256
- statX += 2;
2257
- }
2258
- this.screen.write(statX, y, statParts[i].text, statParts[i].color);
2259
- statX += statParts[i].text.length + 1;
2260
- }
2261
- this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2222
+ this.screen.write(x, y, txt, fg.red);
2223
+ x += txt.length + 1;
2224
+ }
2225
+ if (stats.reads > 0) {
2226
+ const txt = `${stats.reads}R`;
2227
+ this.screen.write(x, y, txt, fg.blue);
2228
+ x += txt.length + 1;
2229
+ }
2230
+ if (stats.commands > 0) {
2231
+ const txt = `${stats.commands}C`;
2232
+ this.screen.write(x, y, txt, fg.magenta);
2233
+ x += txt.length + 1;
2234
+ }
2235
+ if (stats.searches > 0) {
2236
+ const txt = `${stats.searches}S`;
2237
+ this.screen.write(x, y, txt, fg.cyan);
2238
+ x += txt.length + 1;
2239
+ }
2240
+ // Step info on the right
2241
+ const stepText = `step ${this.agentIteration}`;
2242
+ this.screen.write(width - stepText.length - 1, y, stepText, fg.gray);
2262
2243
  y++;
2263
2244
  // Bottom border with help
2264
2245
  const helpText = ' Esc to stop ';
2265
- const helpPadLeft = Math.floor((boxWidth - helpText.length - 2) / 2);
2266
- const helpPadRight = Math.ceil((boxWidth - helpText.length - 2) / 2);
2267
- this.screen.write(0, y, '╰' + '─'.repeat(helpPadLeft), PRIMARY_COLOR);
2268
- this.screen.write(helpPadLeft + 1, y, helpText, fg.gray);
2269
- this.screen.write(helpPadLeft + 1 + helpText.length, y, '─'.repeat(helpPadRight) + '╯', PRIMARY_COLOR);
2246
+ const helpPadLeft = Math.floor((width - helpText.length) / 2);
2247
+ const helpPadRight = Math.ceil((width - helpText.length) / 2);
2248
+ this.screen.write(0, y, '─'.repeat(helpPadLeft), fg.gray);
2249
+ this.screen.write(helpPadLeft, y, helpText, fg.gray);
2250
+ this.screen.write(helpPadLeft + helpText.length, y, '─'.repeat(helpPadRight), fg.gray);
2270
2251
  }
2271
2252
  /**
2272
2253
  * Get color for action type
@@ -1504,6 +1504,12 @@ Commands (in chat):
1504
1504
  console.log('\nGoodbye!');
1505
1505
  process.exit(0);
1506
1506
  },
1507
+ onStopAgent: () => {
1508
+ if (isAgentRunning && agentAbortController) {
1509
+ agentAbortController.abort();
1510
+ app.notify('Stopping agent...');
1511
+ }
1512
+ },
1507
1513
  getStatus,
1508
1514
  hasWriteAccess: () => hasWriteAccess,
1509
1515
  hasProjectContext: () => projectContext !== null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
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",