codeep 1.1.15 → 1.1.17

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.
@@ -473,9 +473,11 @@ export class App {
473
473
  this.agentIteration = 0;
474
474
  this.agentActions = [];
475
475
  this.agentThinking = '';
476
+ this.isLoading = false; // Clear loading state when agent takes over
476
477
  this.startSpinner();
477
478
  }
478
479
  else {
480
+ this.isLoading = false; // Ensure loading is cleared when agent finishes
479
481
  this.stopSpinner();
480
482
  }
481
483
  this.render();
@@ -1559,7 +1561,7 @@ export class App {
1559
1561
  bottomPanelHeight = previewLines + 6; // title + preview + extra line indicator + options
1560
1562
  }
1561
1563
  else if (this.isAgentRunning) {
1562
- bottomPanelHeight = 8; // Agent progress box
1564
+ bottomPanelHeight = 6; // Agent progress box (5 lines + 1 margin)
1563
1565
  }
1564
1566
  else if (this.permissionOpen) {
1565
1567
  bottomPanelHeight = 10; // Permission dialog
@@ -2166,7 +2168,7 @@ export class App {
2166
2168
  renderInlineAgentProgress(startY, width) {
2167
2169
  let y = startY;
2168
2170
  const spinner = SPINNER_FRAMES[this.spinnerFrame];
2169
- const boxWidth = Math.min(width - 4, 60);
2171
+ const boxWidth = width - 2; // Use full width minus small margin
2170
2172
  // Calculate stats
2171
2173
  const stats = {
2172
2174
  reads: this.agentActions.filter(a => a.type === 'read').length,
@@ -2178,58 +2180,67 @@ export class App {
2178
2180
  errors: this.agentActions.filter(a => a.result === 'error').length,
2179
2181
  };
2180
2182
  // 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
2181
2191
  const title = ` ${spinner} AGENT `;
2182
- const borderLeft = '╭' + '─'.repeat(2);
2183
- const borderRight = '─'.repeat(Math.max(0, boxWidth - title.length - 4)) + '╮';
2184
- this.screen.write(0, y, borderLeft, PRIMARY_COLOR);
2185
- this.screen.write(borderLeft.length, y, title, PRIMARY_COLOR + style.bold);
2186
- this.screen.write(borderLeft.length + title.length, y, borderRight, PRIMARY_COLOR);
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
2197
  y++;
2188
2198
  // Current action line
2189
- this.screen.write(0, y, '│ ', PRIMARY_COLOR);
2199
+ this.screen.write(0, y, '│', PRIMARY_COLOR);
2190
2200
  if (this.agentActions.length > 0) {
2191
2201
  const lastAction = this.agentActions[this.agentActions.length - 1];
2192
2202
  const actionLabel = this.getActionLabel(lastAction.type);
2193
2203
  const actionColor = this.getActionColor(lastAction.type);
2194
- const target = this.formatActionTarget(lastAction.target, boxWidth - actionLabel.length - 6);
2195
- this.screen.write(2, y, actionLabel + ' ', actionColor + style.bold);
2204
+ const maxTargetLen = boxWidth - actionLabel.length - 6;
2205
+ const target = this.formatActionTarget(lastAction.target, maxTargetLen);
2206
+ this.screen.write(2, y, actionLabel, actionColor + style.bold);
2196
2207
  this.screen.write(2 + actionLabel.length + 1, y, target, fg.white);
2197
2208
  }
2198
2209
  else {
2199
2210
  this.screen.write(2, y, 'Starting...', fg.gray);
2200
2211
  }
2201
- this.screen.write(boxWidth - 1, y, ' │', PRIMARY_COLOR);
2212
+ this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2202
2213
  y++;
2203
2214
  // Separator
2204
2215
  this.screen.write(0, y, '├' + '─'.repeat(boxWidth - 2) + '┤', fg.gray);
2205
2216
  y++;
2206
2217
  // File changes line
2207
- this.screen.write(0, y, '│ ', PRIMARY_COLOR);
2208
- this.screen.write(2, y, 'Files: ', fg.cyan);
2218
+ this.screen.write(0, y, '│', PRIMARY_COLOR);
2219
+ this.screen.write(2, y, 'Files:', fg.cyan);
2209
2220
  let fileX = 9;
2210
2221
  if (stats.writes > 0) {
2211
- const txt = `+${stats.writes} `;
2222
+ const txt = `+${stats.writes}`;
2212
2223
  this.screen.write(fileX, y, txt, fg.green);
2213
- fileX += txt.length;
2224
+ fileX += txt.length + 1;
2214
2225
  }
2215
2226
  if (stats.edits > 0) {
2216
- const txt = `~${stats.edits} `;
2227
+ const txt = `~${stats.edits}`;
2217
2228
  this.screen.write(fileX, y, txt, fg.yellow);
2218
- fileX += txt.length;
2229
+ fileX += txt.length + 1;
2219
2230
  }
2220
2231
  if (stats.deletes > 0) {
2221
- const txt = `-${stats.deletes} `;
2232
+ const txt = `-${stats.deletes}`;
2222
2233
  this.screen.write(fileX, y, txt, fg.red);
2223
- fileX += txt.length;
2234
+ fileX += txt.length + 1;
2224
2235
  }
2225
2236
  if (stats.writes === 0 && stats.edits === 0 && stats.deletes === 0) {
2226
2237
  this.screen.write(fileX, y, 'no changes yet', fg.gray);
2227
2238
  }
2228
- this.screen.write(boxWidth - 1, y, ' │', PRIMARY_COLOR);
2239
+ this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2229
2240
  y++;
2230
2241
  // Stats line
2231
- this.screen.write(0, y, '│ ', PRIMARY_COLOR);
2232
- this.screen.write(2, y, 'Stats: ', fg.cyan);
2242
+ this.screen.write(0, y, '│', PRIMARY_COLOR);
2243
+ this.screen.write(2, y, 'Stats:', fg.cyan);
2233
2244
  let statX = 9;
2234
2245
  const statParts = [];
2235
2246
  if (stats.reads > 0)
@@ -2241,34 +2252,21 @@ export class App {
2241
2252
  statParts.push({ text: `step ${this.agentIteration}`, color: fg.white });
2242
2253
  for (let i = 0; i < statParts.length; i++) {
2243
2254
  if (i > 0) {
2244
- this.screen.write(statX, y, ' | ', fg.gray);
2245
- statX += 3;
2255
+ this.screen.write(statX, y, '|', fg.gray);
2256
+ statX += 2;
2246
2257
  }
2247
2258
  this.screen.write(statX, y, statParts[i].text, statParts[i].color);
2248
- statX += statParts[i].text.length;
2259
+ statX += statParts[i].text.length + 1;
2249
2260
  }
2250
- this.screen.write(boxWidth - 1, y, ' │', PRIMARY_COLOR);
2251
- y++;
2252
- // Errors line (if any)
2253
- this.screen.write(0, y, '│ ', PRIMARY_COLOR);
2254
- if (stats.errors > 0) {
2255
- this.screen.write(2, y, `${stats.errors} error(s)`, fg.red);
2256
- }
2257
- else if (this.agentThinking) {
2258
- const thinking = this.agentThinking.length > boxWidth - 6
2259
- ? this.agentThinking.slice(0, boxWidth - 9) + '...'
2260
- : this.agentThinking;
2261
- this.screen.write(2, y, '> ' + thinking, fg.gray);
2262
- }
2263
- this.screen.write(boxWidth - 1, y, ' │', PRIMARY_COLOR);
2261
+ this.screen.write(boxWidth - 1, y, '│', PRIMARY_COLOR);
2264
2262
  y++;
2265
2263
  // Bottom border with help
2266
2264
  const helpText = ' Esc to stop ';
2267
- const bottomLeft = '╰' + '─'.repeat(Math.floor((boxWidth - helpText.length - 2) / 2));
2268
- const bottomRight = '─'.repeat(Math.ceil((boxWidth - helpText.length - 2) / 2)) + '╯';
2269
- this.screen.write(0, y, bottomLeft, PRIMARY_COLOR);
2270
- this.screen.write(bottomLeft.length, y, helpText, fg.gray);
2271
- this.screen.write(bottomLeft.length + helpText.length, y, bottomRight, PRIMARY_COLOR);
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);
2272
2270
  }
2273
2271
  /**
2274
2272
  * Get color for action type
@@ -48,7 +48,7 @@ let agentAbortController = null;
48
48
  async function handleSubmit(message) {
49
49
  // Check if we're waiting for interactive mode answers
50
50
  if (pendingInteractiveContext) {
51
- const { parseAnswers, enhancePromptWithAnswers } = await import('../utils/interactive');
51
+ const { parseAnswers, enhancePromptWithAnswers } = await import('../utils/interactive.js');
52
52
  const answers = parseAnswers(message, pendingInteractiveContext.context);
53
53
  // Enhance the original prompt with user's answers
54
54
  const enhancedTask = enhancePromptWithAnswers(pendingInteractiveContext.context, answers);
@@ -191,7 +191,7 @@ async function runAgentTask(task, dryRun = false) {
191
191
  const interactiveMode = config.get('agentInteractive') !== false;
192
192
  if (interactiveMode) {
193
193
  // Analyze task for ambiguity
194
- const { analyzeForClarification, formatQuestions } = await import('../utils/interactive');
194
+ const { analyzeForClarification, formatQuestions } = await import('../utils/interactive.js');
195
195
  const interactiveContext = analyzeForClarification(task);
196
196
  if (interactiveContext.needsClarification) {
197
197
  // Store context for follow-up
@@ -516,7 +516,7 @@ function handleCommand(command, args) {
516
516
  const staged = args.includes('--staged') || args.includes('-s');
517
517
  app.notify(staged ? 'Getting staged diff...' : 'Getting diff...');
518
518
  // Import dynamically to avoid circular deps
519
- import('../utils/git').then(({ getGitDiff, formatDiffForDisplay }) => {
519
+ import('../utils/git.js').then(({ getGitDiff, formatDiffForDisplay }) => {
520
520
  const result = getGitDiff(staged, projectPath);
521
521
  if (!result.success || !result.diff) {
522
522
  app.notify(result.error || 'No changes');
@@ -534,7 +534,7 @@ function handleCommand(command, args) {
534
534
  app.notify('No project context');
535
535
  return;
536
536
  }
537
- import('../utils/git').then(({ getGitDiff, getGitStatus, suggestCommitMessage }) => {
537
+ import('../utils/git.js').then(({ getGitDiff, getGitStatus, suggestCommitMessage }) => {
538
538
  const status = getGitStatus(projectPath);
539
539
  if (!status.isRepo) {
540
540
  app.notify('Not a git repository');
@@ -552,14 +552,14 @@ function handleCommand(command, args) {
552
552
  break;
553
553
  }
554
554
  case 'undo': {
555
- import('../utils/agent').then(({ undoLastAction }) => {
555
+ import('../utils/agent.js').then(({ undoLastAction }) => {
556
556
  const result = undoLastAction();
557
557
  app.notify(result.success ? `Undo: ${result.message}` : `Cannot undo: ${result.message}`);
558
558
  });
559
559
  break;
560
560
  }
561
561
  case 'undo-all': {
562
- import('../utils/agent').then(({ undoAllActions }) => {
562
+ import('../utils/agent.js').then(({ undoAllActions }) => {
563
563
  const result = undoAllActions();
564
564
  app.notify(result.success ? `Undone ${result.results.length} action(s)` : 'Nothing to undo');
565
565
  });
@@ -571,7 +571,7 @@ function handleCommand(command, args) {
571
571
  return;
572
572
  }
573
573
  app.notify('Scanning project...');
574
- import('../utils/projectIntelligence').then(({ scanProject, saveProjectIntelligence, generateContextFromIntelligence }) => {
574
+ import('../utils/projectIntelligence.js').then(({ scanProject, saveProjectIntelligence, generateContextFromIntelligence }) => {
575
575
  scanProject(projectContext.root).then(intelligence => {
576
576
  saveProjectIntelligence(projectContext.root, intelligence);
577
577
  const context = generateContextFromIntelligence(intelligence);
@@ -591,7 +591,7 @@ function handleCommand(command, args) {
591
591
  app.notify('No project context');
592
592
  return;
593
593
  }
594
- import('../utils/codeReview').then(({ performCodeReview, formatReviewResult }) => {
594
+ import('../utils/codeReview.js').then(({ performCodeReview, formatReviewResult }) => {
595
595
  const reviewFiles = args.length > 0 ? args : undefined;
596
596
  const result = performCodeReview(projectContext, reviewFiles);
597
597
  app.addMessage({
@@ -603,7 +603,7 @@ function handleCommand(command, args) {
603
603
  }
604
604
  case 'update': {
605
605
  app.notify('Checking for updates...');
606
- import('../utils/update').then(({ checkForUpdates, formatVersionInfo }) => {
606
+ import('../utils/update.js').then(({ checkForUpdates, formatVersionInfo }) => {
607
607
  checkForUpdates().then(info => {
608
608
  const message = formatVersionInfo(info);
609
609
  app.notify(message.split('\n')[0], 5000);
@@ -817,7 +817,7 @@ function handleCommand(command, args) {
817
817
  app.notify(`Invalid block number. Available: 1-${codeBlocks.length}`);
818
818
  return;
819
819
  }
820
- import('../utils/clipboard').then(({ copyToClipboard }) => {
820
+ import('../utils/clipboard.js').then(({ copyToClipboard }) => {
821
821
  if (copyToClipboard(codeBlocks[index])) {
822
822
  app.notify(`Copied block ${index + 1} to clipboard`);
823
823
  }
@@ -944,7 +944,7 @@ function handleCommand(command, args) {
944
944
  }
945
945
  // Agent history and changes
946
946
  case 'history': {
947
- import('../utils/agent').then(({ getAgentHistory }) => {
947
+ import('../utils/agent.js').then(({ getAgentHistory }) => {
948
948
  const history = getAgentHistory();
949
949
  if (history.length === 0) {
950
950
  app.notify('No agent history');
@@ -964,7 +964,7 @@ function handleCommand(command, args) {
964
964
  break;
965
965
  }
966
966
  case 'changes': {
967
- import('../utils/agent').then(({ getCurrentSessionActions }) => {
967
+ import('../utils/agent.js').then(({ getCurrentSessionActions }) => {
968
968
  const actions = getCurrentSessionActions();
969
969
  if (actions.length === 0) {
970
970
  app.notify('No changes in current session');
@@ -1011,7 +1011,7 @@ function handleCommand(command, args) {
1011
1011
  // Learning mode
1012
1012
  case 'learn': {
1013
1013
  if (args[0] === 'status') {
1014
- import('../utils/learning').then(({ getLearningStatus }) => {
1014
+ import('../utils/learning.js').then(({ getLearningStatus }) => {
1015
1015
  const status = getLearningStatus(projectPath);
1016
1016
  app.addMessage({
1017
1017
  role: 'system',
@@ -1023,7 +1023,7 @@ function handleCommand(command, args) {
1023
1023
  return;
1024
1024
  }
1025
1025
  if (args[0] === 'rule' && args.length > 1) {
1026
- import('../utils/learning').then(({ addCustomRule }) => {
1026
+ import('../utils/learning.js').then(({ addCustomRule }) => {
1027
1027
  addCustomRule(projectPath, args.slice(1).join(' '));
1028
1028
  app.notify('Custom rule added');
1029
1029
  }).catch(() => {
@@ -1036,7 +1036,7 @@ function handleCommand(command, args) {
1036
1036
  return;
1037
1037
  }
1038
1038
  app.notify('Learning from project...');
1039
- import('../utils/learning').then(({ learnFromProject, formatPreferencesForPrompt }) => {
1039
+ import('../utils/learning.js').then(({ learnFromProject, formatPreferencesForPrompt }) => {
1040
1040
  // Get some source files to learn from
1041
1041
  import('fs').then(fs => {
1042
1042
  import('path').then(path => {
@@ -1200,7 +1200,7 @@ function handleCommand(command, args) {
1200
1200
  break;
1201
1201
  }
1202
1202
  case 'skills': {
1203
- import('../utils/skills').then(({ getAllSkills, searchSkills, formatSkillsList, getSkillStats }) => {
1203
+ import('../utils/skills.js').then(({ getAllSkills, searchSkills, formatSkillsList, getSkillStats }) => {
1204
1204
  const query = args.join(' ').toLowerCase();
1205
1205
  // Check for stats subcommand
1206
1206
  if (query === 'stats') {
@@ -1224,7 +1224,7 @@ function handleCommand(command, args) {
1224
1224
  break;
1225
1225
  }
1226
1226
  case 'skill': {
1227
- import('../utils/skills').then(({ findSkill, formatSkillHelp, createSkillTemplate, saveCustomSkill, deleteCustomSkill }) => {
1227
+ import('../utils/skills.js').then(({ findSkill, formatSkillHelp, createSkillTemplate, saveCustomSkill, deleteCustomSkill }) => {
1228
1228
  const subCommand = args[0]?.toLowerCase();
1229
1229
  const skillName = args[1];
1230
1230
  if (!subCommand) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
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",