From 4dbd9f30b6df879661e968e493f817667954bfce Mon Sep 17 00:00:00 2001 From: Tommaso Sciortino Date: Fri, 18 Jul 2025 17:28:40 -0700 Subject: Revert background agent commits (#4479) --- packages/core/src/background/backgroundManager.ts | 40 ----------------------- 1 file changed, 40 deletions(-) delete mode 100644 packages/core/src/background/backgroundManager.ts (limited to 'packages/core/src/background/backgroundManager.ts') diff --git a/packages/core/src/background/backgroundManager.ts b/packages/core/src/background/backgroundManager.ts deleted file mode 100644 index a3ec526c..00000000 --- a/packages/core/src/background/backgroundManager.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -import { MCPServerConfig } from '../config/config.js'; -import { BackgroundAgent, loadBackgroundAgent } from './backgroundAgent.js'; - -export async function loadBackgroundAgentManager( - backgroundAgentConfigs: Record | undefined, - debugMode: boolean, -): Promise { - const agents = await Promise.all( - Object.entries(backgroundAgentConfigs ?? {}).map(([name, config]) => - loadBackgroundAgent(name, config, debugMode).catch((error) => { - console.error(`Error loading background agent '${name}': ${error}`); - return null; - }), - ), - ).then((agents) => agents.filter((agent) => agent !== null)); - return new BackgroundAgentManager(agents); -} - -export class BackgroundAgentManager { - // The active agent. May be empty if none are confgured. - activeAgent?: BackgroundAgent; - - constructor(readonly backgroundAgents: BackgroundAgent[]) { - if (backgroundAgents.length !== 0) { - this.activeAgent = backgroundAgents[0]; - } - } - - setActiveAgentByName(name: string) { - this.activeAgent = this.backgroundAgents.find( - (agent) => agent.serverName === name, - ); - } -} -- cgit v1.2.3