refactor(agents): trim MCP runtime exports (#106520)

Related: #105595
This commit is contained in:
Peter Steinberger
2026-07-13 08:49:16 -07:00
committed by GitHub
parent 260a5c6e2b
commit f0fe068da7
4 changed files with 7 additions and 27 deletions

View File

@@ -824,16 +824,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
"src/acp/runtime/registry.ts: AcpRuntimeBackend",
"src/agents/agent-bundle-lsp-runtime.ts: spawnLspServerProcess",
"src/agents/agent-bundle-mcp-tools.ts: __testing",
"src/agents/agent-bundle-mcp-tools.ts: BundleMcpToolRuntime",
"src/agents/agent-bundle-mcp-tools.ts: completeDeferredSessionMcpRuntimeRetirement",
"src/agents/agent-bundle-mcp-tools.ts: createSessionMcpRuntime",
"src/agents/agent-bundle-mcp-tools.ts: disposeSessionMcpRuntime",
"src/agents/agent-bundle-mcp-tools.ts: getSessionMcpRuntimeManager",
"src/agents/agent-bundle-mcp-tools.ts: McpCatalogTool",
"src/agents/agent-bundle-mcp-tools.ts: McpServerCatalog",
"src/agents/agent-bundle-mcp-tools.ts: McpToolCatalog",
"src/agents/agent-bundle-mcp-tools.ts: SessionMcpRuntime",
"src/agents/agent-bundle-mcp-tools.ts: SessionMcpRuntimeManager",
"src/agents/agent-bundle-mcp-tools.ts: testing",
"src/agents/agent-hooks/compaction-instructions.ts: DEFAULT_COMPACTION_INSTRUCTIONS",
"src/agents/agent-hooks/compaction-safeguard.ts: testing",

View File

@@ -7,11 +7,13 @@ import { expectDefined } from "@openclaw/normalization-core";
import { afterEach, describe, expect, it, vi } from "vitest";
import { cleanupTempDirs, makeTempDir } from "../../test/helpers/temp-dir.js";
import { useAutoCleanupTempDirTracker } from "../../test/helpers/temp-dir.js";
import { createBundleMcpJsonSchemaValidator } from "./agent-bundle-mcp-runtime.js";
import { cleanupBundleMcpHarness } from "./agent-bundle-mcp-test-harness.js";
import {
completeDeferredSessionMcpRuntimeRetirement,
createBundleMcpJsonSchemaValidator,
createSessionMcpRuntime,
} from "./agent-bundle-mcp-runtime.js";
import { cleanupBundleMcpHarness } from "./agent-bundle-mcp-test-harness.js";
import {
getOrCreateSessionMcpRuntime,
materializeBundleMcpToolsForRun,
retireSessionMcpRuntime,

View File

@@ -1204,7 +1204,7 @@ function createSessionMcpRuntimeManager(
};
}
export function getSessionMcpRuntimeManager(): SessionMcpRuntimeManager {
function getSessionMcpRuntimeManager(): SessionMcpRuntimeManager {
return resolveGlobalSingleton(SESSION_MCP_RUNTIME_MANAGER_KEY, createSessionMcpRuntimeManager);
}
@@ -1232,7 +1232,7 @@ export function peekSessionMcpRuntime(params: {
});
}
export async function disposeSessionMcpRuntime(sessionId: string): Promise<void> {
async function disposeSessionMcpRuntime(sessionId: string): Promise<void> {
await getSessionMcpRuntimeManager().disposeSession(sessionId);
}

View File

@@ -1,22 +1,10 @@
/** Public facade for bundle MCP tool materialization and session-scoped runtime management. */
export type {
BundleMcpToolRuntime,
McpCatalogTool,
McpServerCatalog,
McpToolCatalog,
McpToolCatalogDiagnostic,
SessionMcpRuntime,
SessionMcpRuntimeManager,
} from "./agent-bundle-mcp-types.js";
export type { McpToolCatalogDiagnostic } from "./agent-bundle-mcp-types.js";
export {
testing,
testing as __testing,
completeDeferredSessionMcpRuntimeRetirement,
createSessionMcpRuntime,
disposeAllSessionMcpRuntimes,
disposeSessionMcpRuntime,
getOrCreateSessionMcpRuntime,
getSessionMcpRuntimeManager,
peekSessionMcpRuntime,
resolveSessionMcpConfigSummary,
retireSessionMcpRuntime,