refactor(core): split index.ts and config-handler.ts into focused modules
Main entry point: - create-hooks.ts, create-tools.ts, create-managers.ts - plugin-interface.ts: plugin interface types - plugin/ directory: plugin lifecycle modules Config handler: - agent-config-handler.ts, command-config-handler.ts - tool-config-handler.ts, mcp-config-handler.ts - provider-config-handler.ts, category-config-resolver.ts - agent-priority-order.ts, prometheus-agent-config-builder.ts - plugin-components-loader.ts
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { OhMyOpenCodeConfig } from "../config";
|
||||
import { loadMcpConfigs } from "../features/claude-code-mcp-loader";
|
||||
import { createBuiltinMcps } from "../mcp";
|
||||
import type { PluginComponents } from "./plugin-components-loader";
|
||||
|
||||
export async function applyMcpConfig(params: {
|
||||
config: Record<string, unknown>;
|
||||
pluginConfig: OhMyOpenCodeConfig;
|
||||
pluginComponents: PluginComponents;
|
||||
}): Promise<void> {
|
||||
const mcpResult = params.pluginConfig.claude_code?.mcp ?? true
|
||||
? await loadMcpConfigs()
|
||||
: { servers: {} };
|
||||
|
||||
params.config.mcp = {
|
||||
...createBuiltinMcps(params.pluginConfig.disabled_mcps, params.pluginConfig),
|
||||
...(params.config.mcp as Record<string, unknown>),
|
||||
...mcpResult.servers,
|
||||
...params.pluginComponents.mcpServers,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user