diff options
| author | Tommaso Sciortino <[email protected]> | 2025-07-18 15:38:04 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-18 22:38:04 +0000 |
| commit | 003609239fe81c8a2920ed0c63b7f5142bb4f7e5 (patch) | |
| tree | 9dcce05e79a6f1bbe58d8074232212e2495130c5 /packages/core/src/config/config.ts | |
| parent | 04bbc60b97809b4200c5dd09ba849e4d097d1d1f (diff) | |
Add /background commands (when background agent is configured) (#4407)
Co-authored-by: Bryan Morgan <[email protected]>
Diffstat (limited to 'packages/core/src/config/config.ts')
| -rw-r--r-- | packages/core/src/config/config.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index f81b3e32..5d02f269 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -45,6 +45,10 @@ import { DEFAULT_GEMINI_FLASH_MODEL, } from './models.js'; import { ClearcutLogger } from '../telemetry/clearcut-logger/clearcut-logger.js'; +import { + BackgroundAgentManager, + loadBackgroundAgentManager, +} from '../background/backgroundManager.js'; export enum ApprovalMode { DEFAULT = 'default', @@ -127,6 +131,7 @@ export interface ConfigParameters { toolCallCommand?: string; mcpServerCommand?: string; mcpServers?: Record<string, MCPServerConfig>; + backgroundAgents?: Record<string, MCPServerConfig>; userMemory?: string; geminiMdFileCount?: number; approvalMode?: ApprovalMode; @@ -158,6 +163,7 @@ export interface ConfigParameters { export class Config { private toolRegistry!: ToolRegistry; + private backgroundAgentManager?: BackgroundAgentManager; private readonly sessionId: string; private contentGeneratorConfig!: ContentGeneratorConfig; private readonly embeddingModel: string; @@ -172,6 +178,7 @@ export class Config { private readonly toolCallCommand: string | undefined; private readonly mcpServerCommand: string | undefined; private readonly mcpServers: Record<string, MCPServerConfig> | undefined; + private readonly backgroundAgents?: Record<string, MCPServerConfig>; private userMemory: string; private geminiMdFileCount: number; private approvalMode: ApprovalMode; @@ -224,6 +231,7 @@ export class Config { this.toolCallCommand = params.toolCallCommand; this.mcpServerCommand = params.mcpServerCommand; this.mcpServers = params.mcpServers; + this.backgroundAgents = params.backgroundAgents; this.userMemory = params.userMemory ?? ''; this.geminiMdFileCount = params.geminiMdFileCount ?? 0; this.approvalMode = params.approvalMode ?? ApprovalMode.DEFAULT; @@ -281,6 +289,10 @@ export class Config { if (this.getCheckpointingEnabled()) { await this.getGitService(); } + this.backgroundAgentManager = await loadBackgroundAgentManager( + this.backgroundAgents, + this.debugMode, + ); this.toolRegistry = await this.createToolRegistry(); } @@ -406,6 +418,10 @@ export class Config { return this.mcpServers; } + getBackgroundAgentManager(): BackgroundAgentManager | undefined { + return this.backgroundAgentManager; + } + getUserMemory(): string { return this.userMemory; } |
