@dreb/coding-agent 2.19.3 → 2.21.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.
- package/README.md +11 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/forbidden-commands.d.ts.map +1 -1
- package/dist/core/forbidden-commands.js +63 -2
- package/dist/core/forbidden-commands.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +18 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +3 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +7 -5
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +28 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tab-title.d.ts +51 -0
- package/dist/modes/interactive/tab-title.d.ts.map +1 -0
- package/dist/modes/interactive/tab-title.js +166 -0
- package/dist/modes/interactive/tab-title.js.map +1 -0
- package/docs/settings.md +18 -0
- package/package.json +1 -1
|
@@ -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.
|
|
@@ -489,6 +511,10 @@ export class InteractiveMode {
|
|
|
489
511
|
this.showWarning(warning);
|
|
490
512
|
}
|
|
491
513
|
});
|
|
514
|
+
// Warn if running as root
|
|
515
|
+
if (process.getuid?.() === 0) {
|
|
516
|
+
this.showWarning("Running as root (UID 0). The agent has unrestricted system access — all commands execute with full root privileges.");
|
|
517
|
+
}
|
|
492
518
|
// Show startup warnings
|
|
493
519
|
const { migratedProviders, modelFallbackMessage, initialMessage, initialImages, initialMessages } = this.options;
|
|
494
520
|
if (migratedProviders && migratedProviders.length > 0) {
|
|
@@ -2055,6 +2081,8 @@ export class InteractiveMode {
|
|
|
2055
2081
|
}
|
|
2056
2082
|
// Buddy context + reaction for tool execution
|
|
2057
2083
|
this.buddyController.handleEvent(event);
|
|
2084
|
+
// Tab title auto-generation
|
|
2085
|
+
this.tabTitleGenerator?.onToolEnd();
|
|
2058
2086
|
break;
|
|
2059
2087
|
}
|
|
2060
2088
|
case "agent_end":
|