@dreb/coding-agent 2.19.3 → 2.20.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.
@@ -57,6 +57,7 @@ import { ToolExecutionComponent } from "./components/tool-execution.js";
57
57
  import { TreeSelectorComponent } from "./components/tree-selector.js";
58
58
  import { UserMessageComponent } from "./components/user-message.js";
59
59
  import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
60
+ import { TabTitleGenerator } from "./tab-title.js";
60
61
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, Theme, theme, } from "./theme/theme.js";
61
62
  function isExpandable(obj) {
62
63
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
@@ -138,6 +139,8 @@ export class InteractiveMode {
138
139
  // Buddy companion
139
140
  buddyController;
140
141
  buddyComponent = null;
142
+ // Tab title auto-generation
143
+ tabTitleGenerator = undefined;
141
144
  // Convenience accessors
142
145
  get agent() {
143
146
  return this.session.agent;
@@ -432,6 +435,8 @@ export class InteractiveMode {
432
435
  this.renderInitialMessages();
433
436
  // Set terminal title
434
437
  this.updateTerminalTitle();
438
+ // Initialize tab title auto-generation
439
+ this.initTabTitleGenerator();
435
440
  // Subscribe to agent events
436
441
  this.subscribeToAgent();
437
442
  // Auto-load buddy if one exists
@@ -465,6 +470,23 @@ export class InteractiveMode {
465
470
  this.ui.terminal.setTitle(`dreb - ${cwdBasename}`);
466
471
  }
467
472
  }
473
+ /**
474
+ * Initialize the tab title auto-generator. Sets up a TabTitleGenerator that
475
+ * will fire a background LLM call after a threshold of tool calls to produce
476
+ * a concise, task-descriptive terminal tab title.
477
+ */
478
+ initTabTitleGenerator() {
479
+ const settings = this.settingsManager.getTabTitleSettings();
480
+ if (settings?.enabled === false)
481
+ return;
482
+ this.tabTitleGenerator = new TabTitleGenerator(settings, {
483
+ setTitle: (title) => this.ui.terminal.setTitle(title),
484
+ getMessages: () => this.session.state.messages,
485
+ getModel: () => this.session.model,
486
+ getModelRegistry: () => this.session.modelRegistry,
487
+ getProvider: () => this.session.model?.provider,
488
+ });
489
+ }
468
490
  /**
469
491
  * Run the interactive mode. This is the main entry point.
470
492
  * Initializes the UI, shows warnings, processes initial messages, and starts the interactive loop.
@@ -2055,6 +2077,8 @@ export class InteractiveMode {
2055
2077
  }
2056
2078
  // Buddy context + reaction for tool execution
2057
2079
  this.buddyController.handleEvent(event);
2080
+ // Tab title auto-generation
2081
+ this.tabTitleGenerator?.onToolEnd();
2058
2082
  break;
2059
2083
  }
2060
2084
  case "agent_end":