@alfe.ai/openclaw-mcp-bundler 0.0.5 → 0.0.6
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/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/plugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":["McpServerConfig","StdioServerConfig","RemoteServerConfig","Record","McpTransportKind","McpToolDescriptor","ReconcileDiff","Logger","McpToolCallResult","BundlerOptions","STDIO_ENV_DENYLIST","Set","sanitizeStdioEnv","ConnectionDeps","McpClientHandle","Promise","AbortSignal","Connection","defaultConnect","McpBundler","sanitizeNameSegment","buildNamespacedToolName","disambiguateAgainst","ReadonlySet"],"sources":["../../mcp-bundler/dist/index.d.ts","../src/plugin.ts"],"sourcesContent":["//#region src/types.d.ts\n/**\n * Shape of a single MCP server entry — matches OpenClaw `mcp.servers.{name}`.\n * Either a stdio child process spec or a remote URL spec.\n */\ntype McpServerConfig = StdioServerConfig | RemoteServerConfig;\ninterface StdioServerConfig {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface RemoteServerConfig {\n url: string;\n transport?: 'sse' | 'streamable-http';\n headers?: Record<string, string>;\n connectionTimeoutMs?: number;\n}\ntype McpTransportKind = 'stdio' | 'sse' | 'streamable-http';\n/**\n * One tool surfaced from one MCP server, after namespacing.\n */\ninterface McpToolDescriptor {\n /** Namespaced name as the LLM sees it: `{serverName}__{originalName}`, sanitized + max 64 chars. */\n prefixed: string;\n /** Server name (key in `mcp.servers.*`). */\n server: string;\n /** Original tool name as advertised by the MCP server. */\n original: string;\n /** Human label for the tool (truncated description, suitable for UI). */\n label: string;\n /** Full description from the MCP server. */\n description: string;\n /** JSON Schema (object) for tool parameters. */\n parameters: Record<string, unknown>;\n}\ninterface ReconcileDiff {\n added: string[];\n removed: string[];\n changed: string[];\n unchanged: string[];\n}\ninterface Logger {\n debug: (msg: string, meta?: Record<string, unknown>) => void;\n info: (msg: string, meta?: Record<string, unknown>) => void;\n warn: (msg: string, meta?: Record<string, unknown>) => void;\n error: (msg: string, meta?: Record<string, unknown>) => void;\n}\ninterface McpToolCallResult {\n content: Record<string, unknown>[];\n isError?: boolean;\n}\ninterface BundlerOptions {\n logger?: Logger;\n /** Idle TTL for spawned children (ms). 0 disables. Default: 600_000 (10 min). */\n idleTtlMs?: number;\n /** Sweep interval for idle reaping (ms). Default: 60_000 (1 min). */\n idleSweepIntervalMs?: number;\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\n//#region src/connection.d.ts\n/** Env keys OpenClaw rejects from stdio MCP env blocks. Filter them out before spawning. */\ndeclare const STDIO_ENV_DENYLIST: Set<string>;\ndeclare function sanitizeStdioEnv(env: Record<string, string> | undefined): Record<string, string>;\ninterface ConnectionDeps {\n /**\n * Factory for an MCP Client connected to the given config. Injected so tests\n * can mock without spawning real processes. In production this wraps\n * `@modelcontextprotocol/sdk/client`.\n */\n connect: (server: McpServerConfig) => Promise<McpClientHandle>;\n}\n/**\n * Minimal interface our connection layer needs from an MCP client. Mirrors\n * the @modelcontextprotocol/sdk Client surface but kept narrow so we can\n * mock cleanly in tests.\n */\ninterface McpClientHandle {\n listTools(): Promise<{\n name: string;\n description?: string;\n inputSchema: Record<string, unknown>;\n }[]>;\n callTool(name: string, args: unknown, opts?: {\n signal?: AbortSignal;\n }): Promise<McpToolCallResult>;\n close(): Promise<void>;\n}\n/**\n * One Connection per MCP server. Owns lifecycle (lazy-spawn, close, refresh-lock).\n * Refresh-lock pattern adapted from AIWerk `index.ts:219-250` — prevents\n * reconnect + `notifications/tools/list_changed` race.\n */\ndeclare class Connection {\n readonly name: string;\n readonly config: McpServerConfig;\n private readonly deps;\n private readonly logger;\n private client;\n private tools;\n private connectInFlight;\n private refreshInFlight;\n private refreshQueued;\n private lastUsedAt;\n constructor(params: {\n name: string;\n config: McpServerConfig;\n deps: ConnectionDeps;\n logger?: Logger;\n });\n /** Returns the most recent known tool list. May be empty if the server hasn't connected yet. */\n snapshotTools(): McpToolDescriptor[];\n /** Whether an MCP child process / remote connection has been established. */\n isConnected(): boolean;\n /** Idle timestamp for reaping. */\n idleSinceMs(): number;\n /**\n * Lazy connect + tool discovery. Safe to call concurrently; in-flight\n * connects coalesce.\n */\n ensureConnected(): Promise<void>;\n private connectAndDiscover;\n /**\n * Re-discover tools. Used on reconnect or `tools/list_changed` notification.\n * Refresh-lock collapses concurrent refreshes; if one is in flight, the next\n * is queued (max 1 queued, since N>1 queued provides no extra freshness).\n */\n refresh(): Promise<void>;\n callTool(originalName: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Close the underlying transport. Idempotent. If a connect is in flight\n * (warmup racing with reconcile-removal), wait for it to settle and then\n * close the client it produced — otherwise the child process is orphaned.\n */\n close(): Promise<void>;\n /**\n * Stable hash of the config for diff detection in `reconcile`.\n * Two configs with the same hash are equivalent (no restart needed).\n */\n configFingerprint(): string;\n}\n/**\n * Build the production `connect` factory using the official MCP SDK.\n * Kept in a separate function so tests can substitute a mock without\n * pulling the SDK into the test bundle.\n */\ndeclare function defaultConnect(server: McpServerConfig): Promise<McpClientHandle>;\n//# sourceMappingURL=connection.d.ts.map\n//#endregion\n//#region src/bundler.d.ts\n/**\n * Provider-agnostic MCP server bundler. Holds N MCP server connections,\n * exposes a unified namespaced tool catalog, and routes calls to the right\n * server.\n *\n * Designed to be embedded in any host (OpenClaw plugin, AI proxy, Lambda).\n * Public surface is intentionally synchronous where the host needs sync\n * (snapshot, listTools), async only where I/O is unavoidable.\n */\ndeclare class McpBundler {\n private readonly logger;\n private readonly connections;\n private readonly idleTtlMs;\n private readonly idleSweepIntervalMs;\n private idleSweepTimer;\n private readonly deps;\n private disposed;\n private reconcileLatch;\n constructor(opts?: BundlerOptions, deps?: ConnectionDeps);\n /**\n * Diff `desired` against current connections, spawn newcomers, dispose\n * removals, hot-restart on config change. Pull-based — call whenever the\n * host's config snapshot may have changed. Cheap if no diff.\n *\n * Lazy: newly-added servers are NOT eagerly connected; they connect on the\n * first `callTool()` (or first `listTools()` after `forceDiscover()`).\n * This avoids paying spawn cost for servers the agent never uses.\n */\n reconcile(desired: Record<string, McpServerConfig>): Promise<ReconcileDiff>;\n private doReconcile;\n /**\n * Synchronous snapshot of all currently-known tools across connected servers.\n * Servers that have not connected yet contribute nothing. Intended for use\n * inside OpenClaw's plugin tool factory which must be sync.\n *\n * Tool names are namespaced and disambiguated (suffix `-2`, `-3` on collision)\n * so cross-server name clashes never produce duplicate registrations.\n */\n listTools(): McpToolDescriptor[];\n /**\n * Eagerly connect to every configured server and discover tools. Used by\n * hosts that want a hot list rather than the lazy default. Errors are\n * swallowed per-server (logged), so one bad server doesn't fail the batch.\n */\n warmup(): Promise<void>;\n /**\n * Invoke a tool by its namespaced name. Routes to the originating server.\n * Errors are returned as `{ isError: true, content: [...] }` so a failing\n * tool doesn't crash the host.\n */\n callTool(prefixed: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Resolve a namespaced tool name back to its server connection and original\n * tool name. Returns undefined if the tool is not currently advertised.\n */\n private routeToolName;\n /**\n * Tear down all connections and stop background tasks. Idempotent.\n * Call from `registerRuntimeLifecycle({ cleanup })` in the host plugin.\n */\n dispose(): Promise<void>;\n private startIdleSweep;\n private sweepIdle;\n}\n//# sourceMappingURL=bundler.d.ts.map\n//#endregion\n//#region src/tool-naming.d.ts\n/**\n * Tool name sanitization and collision handling.\n *\n * OpenClaw constraint: tool names must match `[A-Za-z0-9_-]` and be ≤64 chars.\n * Pattern mirrored from `openclaw/src/agents/pi-bundle-mcp-names.ts`.\n *\n * Strategy: prefix every tool with its server name (`{server}__{tool}`),\n * sanitize disallowed chars to `_`, truncate, then suffix-disambiguate\n * (`-2`, `-3`, ...) on collision.\n */\ndeclare function sanitizeNameSegment(value: string): string;\ndeclare function buildNamespacedToolName(server: string, tool: string): string;\n/**\n * Disambiguate a candidate name against an existing set by appending `-2`, `-3`, etc.\n * Mutates nothing; returns the chosen name. Caller is responsible for inserting it\n * into the set.\n */\ndeclare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;\n//# sourceMappingURL=tool-naming.d.ts.map\n\n//#endregion\nexport { type BundlerOptions, Connection, type ConnectionDeps, type Logger, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type StdioServerConfig, buildNamespacedToolName, defaultConnect, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;KAKKA,eAAAA,GAAkBC,iBAAsC,GAAlBC,kBAAkB;AAAA,UACnDD,iBAAAA,CAAiB;EAGb,OAGJC,EAAAA,MAAAA;;QAHFC;;ACGwF;AAUhF,UDVND,kBAAAA,CCiBc;EAAA,GAAA,EAAA,MAAA;WACgC,CAAA,EAAA,KAAA,GAAA,iBAAA;SACrB,CAAA,EDhBvBC,MCgBuB,CAAA,MAAA,EAAA,MAAA,CAAA;qBAAf,CAAA,EAAA,MAAA;;;;;AATJ,UAAN,MAAA,CAOA;EAAc,KAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA;MACgC,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA;MACrB,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA;OAAf,CAAA,GAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA;;AAAM,UAFhB,cAAA,CAKe;EAAA,MAAA,CAAA,EAAA;IACd,QAAA,CAAA,EAAA;MACC,KAAA,CAAA,EAAA,MAAA;MAAM,WAAA,CAA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uBAAuB,YAAY;;;;;8BAGlC;;cAqDxB;;;;;;;;gBAgBU;kBA+EE"}
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":["McpServerConfig","StdioServerConfig","RemoteServerConfig","Record","McpTransportKind","McpToolDescriptor","ReconcileDiff","Logger","McpToolCallResult","BundlerOptions","STDIO_ENV_DENYLIST","Set","sanitizeStdioEnv","ConnectionDeps","McpClientHandle","Promise","AbortSignal","Connection","defaultConnect","McpBundler","sanitizeNameSegment","buildNamespacedToolName","disambiguateAgainst","ReadonlySet","ServerOwner","StoredServerCommon","StoredServerEntry","StoreSchema","StoreOptions","Store","defaultStorePath","toServerConfig","toStoredEntry","OpenclawExecutor","defaultOpenclawExecutor","ManagerOptions","AddServerOptions","Manager"],"sources":["../../mcp-bundler/dist/index.d.ts","../src/plugin.ts"],"sourcesContent":["//#region src/types.d.ts\n/**\n * Shape of a single MCP server entry — matches OpenClaw `mcp.servers.{name}`.\n * Either a stdio child process spec or a remote URL spec.\n */\ntype McpServerConfig = StdioServerConfig | RemoteServerConfig;\ninterface StdioServerConfig {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface RemoteServerConfig {\n url: string;\n transport?: 'sse' | 'streamable-http';\n headers?: Record<string, string>;\n connectionTimeoutMs?: number;\n}\ntype McpTransportKind = 'stdio' | 'sse' | 'streamable-http';\n/**\n * One tool surfaced from one MCP server, after namespacing.\n */\ninterface McpToolDescriptor {\n /** Namespaced name as the LLM sees it: `{serverName}__{originalName}`, sanitized + max 64 chars. */\n prefixed: string;\n /** Server name (key in `mcp.servers.*`). */\n server: string;\n /** Original tool name as advertised by the MCP server. */\n original: string;\n /** Human label for the tool (truncated description, suitable for UI). */\n label: string;\n /** Full description from the MCP server. */\n description: string;\n /** JSON Schema (object) for tool parameters. */\n parameters: Record<string, unknown>;\n}\ninterface ReconcileDiff {\n added: string[];\n removed: string[];\n changed: string[];\n unchanged: string[];\n}\ninterface Logger {\n debug: (msg: string, meta?: Record<string, unknown>) => void;\n info: (msg: string, meta?: Record<string, unknown>) => void;\n warn: (msg: string, meta?: Record<string, unknown>) => void;\n error: (msg: string, meta?: Record<string, unknown>) => void;\n}\ninterface McpToolCallResult {\n content: Record<string, unknown>[];\n isError?: boolean;\n}\ninterface BundlerOptions {\n logger?: Logger;\n /** Idle TTL for spawned children (ms). 0 disables. Default: 600_000 (10 min). */\n idleTtlMs?: number;\n /** Sweep interval for idle reaping (ms). Default: 60_000 (1 min). */\n idleSweepIntervalMs?: number;\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\n//#region src/connection.d.ts\n/** Env keys OpenClaw rejects from stdio MCP env blocks. Filter them out before spawning. */\ndeclare const STDIO_ENV_DENYLIST: Set<string>;\ndeclare function sanitizeStdioEnv(env: Record<string, string> | undefined): Record<string, string>;\ninterface ConnectionDeps {\n /**\n * Factory for an MCP Client connected to the given config. Injected so tests\n * can mock without spawning real processes. In production this wraps\n * `@modelcontextprotocol/sdk/client`.\n */\n connect: (server: McpServerConfig) => Promise<McpClientHandle>;\n}\n/**\n * Minimal interface our connection layer needs from an MCP client. Mirrors\n * the @modelcontextprotocol/sdk Client surface but kept narrow so we can\n * mock cleanly in tests.\n */\ninterface McpClientHandle {\n listTools(): Promise<{\n name: string;\n description?: string;\n inputSchema: Record<string, unknown>;\n }[]>;\n callTool(name: string, args: unknown, opts?: {\n signal?: AbortSignal;\n }): Promise<McpToolCallResult>;\n close(): Promise<void>;\n}\n/**\n * One Connection per MCP server. Owns lifecycle (lazy-spawn, close, refresh-lock).\n * Refresh-lock pattern adapted from AIWerk `index.ts:219-250` — prevents\n * reconnect + `notifications/tools/list_changed` race.\n */\ndeclare class Connection {\n readonly name: string;\n readonly config: McpServerConfig;\n private readonly deps;\n private readonly logger;\n private client;\n private tools;\n private connectInFlight;\n private refreshInFlight;\n private refreshQueued;\n private lastUsedAt;\n constructor(params: {\n name: string;\n config: McpServerConfig;\n deps: ConnectionDeps;\n logger?: Logger;\n });\n /** Returns the most recent known tool list. May be empty if the server hasn't connected yet. */\n snapshotTools(): McpToolDescriptor[];\n /** Whether an MCP child process / remote connection has been established. */\n isConnected(): boolean;\n /** Idle timestamp for reaping. */\n idleSinceMs(): number;\n /**\n * Lazy connect + tool discovery. Safe to call concurrently; in-flight\n * connects coalesce.\n */\n ensureConnected(): Promise<void>;\n private connectAndDiscover;\n /**\n * Re-discover tools. Used on reconnect or `tools/list_changed` notification.\n * Refresh-lock collapses concurrent refreshes; if one is in flight, the next\n * is queued (max 1 queued, since N>1 queued provides no extra freshness).\n */\n refresh(): Promise<void>;\n callTool(originalName: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Close the underlying transport. Idempotent. If a connect is in flight\n * (warmup racing with reconcile-removal), wait for it to settle and then\n * close the client it produced — otherwise the child process is orphaned.\n */\n close(): Promise<void>;\n /**\n * Stable hash of the config for diff detection in `reconcile`.\n * Two configs with the same hash are equivalent (no restart needed).\n */\n configFingerprint(): string;\n}\n/**\n * Build the production `connect` factory using the official MCP SDK.\n * Kept in a separate function so tests can substitute a mock without\n * pulling the SDK into the test bundle.\n */\ndeclare function defaultConnect(server: McpServerConfig): Promise<McpClientHandle>;\n//# sourceMappingURL=connection.d.ts.map\n//#endregion\n//#region src/bundler.d.ts\n/**\n * Provider-agnostic MCP server bundler. Holds N MCP server connections,\n * exposes a unified namespaced tool catalog, and routes calls to the right\n * server.\n *\n * Designed to be embedded in any host (OpenClaw plugin, AI proxy, Lambda).\n * Public surface is intentionally synchronous where the host needs sync\n * (snapshot, listTools), async only where I/O is unavoidable.\n */\ndeclare class McpBundler {\n private readonly logger;\n private readonly connections;\n private readonly idleTtlMs;\n private readonly idleSweepIntervalMs;\n private idleSweepTimer;\n private readonly deps;\n private disposed;\n private reconcileLatch;\n constructor(opts?: BundlerOptions, deps?: ConnectionDeps);\n /**\n * Diff `desired` against current connections, spawn newcomers, dispose\n * removals, hot-restart on config change. Pull-based — call whenever the\n * host's config snapshot may have changed. Cheap if no diff.\n *\n * Lazy: newly-added servers are NOT eagerly connected; they connect on the\n * first `callTool()` (or first `listTools()` after `forceDiscover()`).\n * This avoids paying spawn cost for servers the agent never uses.\n */\n reconcile(desired: Record<string, McpServerConfig>): Promise<ReconcileDiff>;\n private doReconcile;\n /**\n * Synchronous snapshot of all currently-known tools across connected servers.\n * Servers that have not connected yet contribute nothing. Intended for use\n * inside OpenClaw's plugin tool factory which must be sync.\n *\n * Tool names are namespaced and disambiguated (suffix `-2`, `-3` on collision)\n * so cross-server name clashes never produce duplicate registrations.\n */\n listTools(): McpToolDescriptor[];\n /**\n * Eagerly connect to every configured server and discover tools. Used by\n * hosts that want a hot list rather than the lazy default. Errors are\n * swallowed per-server (logged), so one bad server doesn't fail the batch.\n */\n warmup(): Promise<void>;\n /**\n * Invoke a tool by its namespaced name. Routes to the originating server.\n * Errors are returned as `{ isError: true, content: [...] }` so a failing\n * tool doesn't crash the host.\n */\n callTool(prefixed: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Resolve a namespaced tool name back to its server connection and original\n * tool name. Returns undefined if the tool is not currently advertised.\n */\n private routeToolName;\n /**\n * Tear down all connections and stop background tasks. Idempotent.\n * Call from `registerRuntimeLifecycle({ cleanup })` in the host plugin.\n */\n dispose(): Promise<void>;\n private startIdleSweep;\n private sweepIdle;\n}\n//# sourceMappingURL=bundler.d.ts.map\n//#endregion\n//#region src/tool-naming.d.ts\n/**\n * Tool name sanitization and collision handling.\n *\n * OpenClaw constraint: tool names must match `[A-Za-z0-9_-]` and be ≤64 chars.\n * Pattern mirrored from `openclaw/src/agents/pi-bundle-mcp-names.ts`.\n *\n * Strategy: prefix every tool with its server name (`{server}__{tool}`),\n * sanitize disallowed chars to `_`, truncate, then suffix-disambiguate\n * (`-2`, `-3`, ...) on collision.\n */\ndeclare function sanitizeNameSegment(value: string): string;\ndeclare function buildNamespacedToolName(server: string, tool: string): string;\n/**\n * Disambiguate a candidate name against an existing set by appending `-2`, `-3`, etc.\n * Mutates nothing; returns the chosen name. Caller is responsible for inserting it\n * into the set.\n */\ndeclare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;\n//# sourceMappingURL=tool-naming.d.ts.map\n//#endregion\n//#region src/store.d.ts\n/**\n * Where a server entry came from. Used by `removeServersByOwner` so an\n * integration uninstall can drop only its own entries without touching\n * `cli`-owned (e.g. `alfe-platform`) or `manual`-owned (user-added) ones.\n */\ntype ServerOwner = 'cli' | `integration:${string}` | 'manual';\ninterface StoredServerCommon {\n /** Where the entry came from — controls bulk-removal semantics. */\n owner: ServerOwner;\n /** ISO timestamp of first registration; preserved across updates. */\n addedAt: string;\n /** Optional semver of the providing package (e.g. `@alfe.ai/mcp-server` for `alfe-platform`). Used for drift detection on CLI upgrade. */\n version?: string;\n}\ntype StoredServerEntry = (StoredServerCommon & {\n transport: 'stdio';\n} & StdioServerConfig) | (StoredServerCommon & {\n transport: 'sse' | 'streamable-http';\n} & RemoteServerConfig);\ninterface StoreSchema {\n servers: Record<string, StoredServerEntry>;\n config: {\n sessionIdleTtlMs?: number;\n };\n /**\n * Server names this manager has written into `openclaw.json#mcp.servers.*`.\n * Used to compute the mirror-write diff without re-reading openclaw.json\n * (which would be a second source of truth). Foreign keys not listed here\n * are preserved across mirror writes.\n */\n _ownedOpenclawKeys: string[];\n}\ninterface StoreOptions {\n /** Absolute path to the store file. Defaults to `~/.alfe/mcp/servers.json`. */\n path?: string;\n logger?: Logger;\n}\n/**\n * On-disk source of truth for the bundler's configured servers.\n *\n * Mutations go through `update()` (read-modify-write with atomic\n * temp+rename) so a concurrent writer (e.g. two `alfe mcp add` invocations\n * racing) can't lose data — the second writer reads the first's state.\n *\n * Schema is owner-tagged so `removeServersByOwner` can implement\n * integration uninstall without touching CLI-owned or manual entries.\n */\ndeclare class Store {\n private readonly storePath;\n private readonly logger?;\n private watcher?;\n private watcherListeners;\n private rewatchTimer?;\n constructor(opts?: StoreOptions);\n get path(): string;\n read(): StoreSchema;\n /**\n * Read-modify-write with atomic temp+rename, guarded by an\n * inter-process lock file. Caller passes a pure function that\n * produces the next state; this serialises the mutation to disk in\n * one rename, which is atomic on POSIX and on Windows when the\n * target path is on the same volume.\n *\n * The lock guards the read-then-rename window so two processes\n * (e.g. two `alfe mcp add` shells, or the CLI racing the daemon)\n * can't drop each other's writes. The lock file is at\n * `<storePath>.lock`; stale locks (older than `LOCK_STALE_MS`) are\n * stolen so a crashed writer doesn't wedge the store.\n *\n * Pure-function shape (instead of a `read()` then `write(next)`\n * pair) intentionally — it keeps the read-modify-write contract\n * local to each caller so two updates back-to-back never see each\n * other's partial state.\n */\n update(fn: (cur: StoreSchema) => StoreSchema): StoreSchema;\n /**\n * Acquire an inter-process file lock by atomically creating a\n * sentinel via `openSync(lockPath, 'wx')`. Spins with bounded\n * backoff up to `LOCK_WAIT_MS`. If the lock file is older than\n * `LOCK_STALE_MS` it's assumed orphaned (writer crashed mid-update)\n * and stolen — the write window is sub-second in practice, so\n * holding the lock for >5s means something went wrong.\n *\n * Returns the release function. Single-process callers are\n * unaffected — re-entering the same process spins briefly while\n * the prior call's `finally` runs.\n */\n private acquireLock;\n private lockIsStale;\n /**\n * Watch the store file for external changes (e.g. another `alfe mcp add`\n * shelling out from a separate process). Returns an unsubscribe fn.\n *\n * Coalesces bursts via a 50 ms debounce — editors and atomic-rename\n * writers commonly fire multiple events per logical save.\n */\n watch(cb: () => void): () => void;\n dispose(): void;\n private ensureWatcher;\n private disposeWatcher;\n}\ndeclare function defaultStorePath(): string;\n/** Pull the runtime config (transport + transport-specific fields) out of a stored entry. */\ndeclare function toServerConfig(entry: StoredServerEntry): McpServerConfig;\n/** Build a stored entry from a runtime config + ownership metadata. */\ndeclare function toStoredEntry(config: McpServerConfig, meta: {\n owner: ServerOwner;\n transport?: McpTransportKind;\n version?: string;\n addedAt?: string;\n}): StoredServerEntry;\n//#endregion\n//#region src/manager.d.ts\n/**\n * Shells out to `openclaw config set --batch-json` / `openclaw config unset`\n * to keep `openclaw.json#mcp.servers.*` in sync with the bundler store.\n * Default executor reuses the same machinery the integrations applier has\n * used for ~6 months; tests inject a fake.\n */\ninterface OpenclawExecutor {\n setBatch: (batch: {\n path: string;\n value: unknown;\n }[]) => Promise<void>;\n unset: (path: string) => Promise<void>;\n}\ndeclare const defaultOpenclawExecutor: OpenclawExecutor;\ninterface ManagerOptions {\n /** Pre-constructed store. If omitted, one is built with default options. */\n store?: Store;\n /** Override for the openclaw mirror executor (tests inject a fake). */\n executor?: OpenclawExecutor;\n logger?: Logger;\n /**\n * Debounce window for the mirror-write. Mutations landing inside this\n * window coalesce into a single openclaw config update, avoiding the\n * auto-restart race where two back-to-back `addServer` calls hit an\n * openclaw that's mid-shutdown from the first write's watcher.\n */\n mirrorDebounceMs?: number;\n}\ninterface AddServerOptions {\n /** Required — flat-namespace key under `mcp.servers.*`. */\n id: string;\n /** Marks ownership for bulk removal. Defaults to `manual`. */\n owner?: ServerOwner;\n /** Semver of the providing package; used for CLI version-drift detection. */\n version?: string;\n /** Explicit transport hint for remote configs. Defaults to inferring from `config`. */\n transport?: McpTransportKind;\n}\n/**\n * Bundler manager — owns the alfe store, mirrors it into openclaw.json,\n * and surfaces a small CRUD API the CLI and integration applier both\n * call into.\n *\n * The store is the Alfe-owned source of truth; openclaw.json is a\n * derived mirror so the runtime keeps consuming its existing format.\n */\ndeclare class Manager {\n private readonly store;\n private readonly executor;\n private readonly logger?;\n private readonly mirrorDebounceMs;\n private mirrorTimer?;\n private mirrorPromise;\n private mirrorPending?;\n private bundler?;\n private changeListeners;\n private storeUnsubscribe?;\n constructor(opts?: ManagerOptions);\n /** Direct accessor — handy for tests and the CLI's `alfe mcp list`. */\n getStore(): Store;\n /**\n * Register or overwrite a server entry. Resolves as soon as the store\n * mutation is committed to disk — the openclaw.json mirror runs async\n * in the background and is debounced so back-to-back calls coalesce\n * into one runtime restart. Call `flush()` to await the mirror.\n */\n addServer(config: McpServerConfig, opts: AddServerOptions): Promise<void>;\n /**\n * Remove a single server entry. No-op if the id isn't in the store.\n * Refuses to remove an entry whose owner doesn't match `expectedOwner`\n * when supplied — the CLI uses this to guard `alfe mcp remove` from\n * accidentally clobbering integration- or cli-owned entries.\n *\n * Resolves as soon as the store mutation is committed. Mirror runs\n * async; call `flush()` to await it.\n */\n removeServer(id: string, opts?: {\n expectedOwner?: ServerOwner;\n }): Promise<boolean>;\n /** Drop every entry whose owner matches — used by integration uninstall. */\n removeServersByOwner(owner: ServerOwner): Promise<string[]>;\n /** Read-only snapshot for `alfe mcp list` and similar UIs. */\n listServers(): {\n id: string;\n entry: StoredServerEntry;\n }[];\n /**\n * Push the current store contents into a bundler instance (which owns\n * connections / tools). Wires up a store watcher so external mutations\n * (e.g. another shell running `alfe mcp add`) re-reconcile.\n */\n loadIntoBundler(bundler: McpBundler): Promise<void>;\n /** Subscribe to store mutations. Returns an unsubscribe fn. */\n onChange(cb: () => void): () => void;\n /**\n * Cancel any pending mirror-write, flush the in-flight one, and stop\n * watching the store. Safe to call multiple times.\n */\n dispose(): Promise<void>;\n /**\n * Force the debounced mirror to run now and wait for it to finish.\n * Surfaces the executor error if the mirror failed — callers wrap in\n * try/catch (or .rejects in tests) if they need to handle it.\n */\n flush(): Promise<void>;\n private scheduleMirror;\n private runMirror;\n /**\n * Compute the diff between this manager's owned set and what the store\n * declares now, then apply the openclaw config delta. Foreign keys\n * (entries in openclaw.json#mcp.servers.* not in our store) are\n * preserved — we only touch the names we previously claimed.\n */\n private applyMirror;\n private reconcileBundler;\n private fireChange;\n}\n//# sourceMappingURL=manager.d.ts.map\n\n//#endregion\nexport { type AddServerOptions, type BundlerOptions, Connection, type ConnectionDeps, type Logger, Manager, type ManagerOptions, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type OpenclawExecutor, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type ServerOwner, type StdioServerConfig, Store, type StoreOptions, type StoreSchema, type StoredServerEntry, buildNamespacedToolName, defaultConnect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AAA,OAAA,CAAA;;UAdD,SAAA,CAgBiB;EAAc,IAAA,EAAA,MAAA;EAG/B,KAAA,CAAA,EAAA,MAAA;EAAqB,WAAA,EAAA,MAAA;YAEI,EAjBrB,MAiBqB,CAAA,MAAA,EAAA,OAAA,CAAA;SACA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAdtB,WAcsB,EAAA,QAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,GAAA,IAAA,EAAA,GAZ5B,OAY4B,CAZpB,eAYoB,CAAA;;AAAO,UAThC,kBAAA,CAYiB;EAAA,MAAA,CAAA,EAXhB,cAWgB;eACjB,CAAA,EAXQ,cAWR;kBACC,CAAA,EAAA,GAAA,GAXgB,cAWhB,GAAA,SAAA;;UARD,qBAAA,CAaA;MAAmB,MAAA;OAAuB,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAXjB,OAWiB,CAAA,IAAA,CAAA;MAAY,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAV7B,OAU6B,CAAA,IAAA,CAAA;;UAPtD,iBAAA,CAUyC;EAqD7C,MAAA,EA9DI,MAiKT;EAAA,MAAA,CAAA,EAhKU,cAgKV;cAnFe,CAAA,EAAA;IA+EE,QAAA,CAAA,EAAA,OAAA;EAAiB,CAAA;;;;sBAzJM;;;uBAE/B,mBAAmB,uBAAuB,YAAY;;;;;8BAGlC;;cAqDxB;;;;;;;;gBAgBU;kBA+EE"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","names":["McpServerConfig","StdioServerConfig","RemoteServerConfig","Record","McpTransportKind","McpToolDescriptor","ReconcileDiff","Logger","McpToolCallResult","BundlerOptions","STDIO_ENV_DENYLIST","Set","sanitizeStdioEnv","ConnectionDeps","McpClientHandle","Promise","AbortSignal","Connection","defaultConnect","McpBundler","sanitizeNameSegment","buildNamespacedToolName","disambiguateAgainst","ReadonlySet"],"sources":["../../mcp-bundler/dist/index.d.ts","../src/plugin.ts"],"sourcesContent":["//#region src/types.d.ts\n/**\n * Shape of a single MCP server entry — matches OpenClaw `mcp.servers.{name}`.\n * Either a stdio child process spec or a remote URL spec.\n */\ntype McpServerConfig = StdioServerConfig | RemoteServerConfig;\ninterface StdioServerConfig {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface RemoteServerConfig {\n url: string;\n transport?: 'sse' | 'streamable-http';\n headers?: Record<string, string>;\n connectionTimeoutMs?: number;\n}\ntype McpTransportKind = 'stdio' | 'sse' | 'streamable-http';\n/**\n * One tool surfaced from one MCP server, after namespacing.\n */\ninterface McpToolDescriptor {\n /** Namespaced name as the LLM sees it: `{serverName}__{originalName}`, sanitized + max 64 chars. */\n prefixed: string;\n /** Server name (key in `mcp.servers.*`). */\n server: string;\n /** Original tool name as advertised by the MCP server. */\n original: string;\n /** Human label for the tool (truncated description, suitable for UI). */\n label: string;\n /** Full description from the MCP server. */\n description: string;\n /** JSON Schema (object) for tool parameters. */\n parameters: Record<string, unknown>;\n}\ninterface ReconcileDiff {\n added: string[];\n removed: string[];\n changed: string[];\n unchanged: string[];\n}\ninterface Logger {\n debug: (msg: string, meta?: Record<string, unknown>) => void;\n info: (msg: string, meta?: Record<string, unknown>) => void;\n warn: (msg: string, meta?: Record<string, unknown>) => void;\n error: (msg: string, meta?: Record<string, unknown>) => void;\n}\ninterface McpToolCallResult {\n content: Record<string, unknown>[];\n isError?: boolean;\n}\ninterface BundlerOptions {\n logger?: Logger;\n /** Idle TTL for spawned children (ms). 0 disables. Default: 600_000 (10 min). */\n idleTtlMs?: number;\n /** Sweep interval for idle reaping (ms). Default: 60_000 (1 min). */\n idleSweepIntervalMs?: number;\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\n//#region src/connection.d.ts\n/** Env keys OpenClaw rejects from stdio MCP env blocks. Filter them out before spawning. */\ndeclare const STDIO_ENV_DENYLIST: Set<string>;\ndeclare function sanitizeStdioEnv(env: Record<string, string> | undefined): Record<string, string>;\ninterface ConnectionDeps {\n /**\n * Factory for an MCP Client connected to the given config. Injected so tests\n * can mock without spawning real processes. In production this wraps\n * `@modelcontextprotocol/sdk/client`.\n */\n connect: (server: McpServerConfig) => Promise<McpClientHandle>;\n}\n/**\n * Minimal interface our connection layer needs from an MCP client. Mirrors\n * the @modelcontextprotocol/sdk Client surface but kept narrow so we can\n * mock cleanly in tests.\n */\ninterface McpClientHandle {\n listTools(): Promise<{\n name: string;\n description?: string;\n inputSchema: Record<string, unknown>;\n }[]>;\n callTool(name: string, args: unknown, opts?: {\n signal?: AbortSignal;\n }): Promise<McpToolCallResult>;\n close(): Promise<void>;\n}\n/**\n * One Connection per MCP server. Owns lifecycle (lazy-spawn, close, refresh-lock).\n * Refresh-lock pattern adapted from AIWerk `index.ts:219-250` — prevents\n * reconnect + `notifications/tools/list_changed` race.\n */\ndeclare class Connection {\n readonly name: string;\n readonly config: McpServerConfig;\n private readonly deps;\n private readonly logger;\n private client;\n private tools;\n private connectInFlight;\n private refreshInFlight;\n private refreshQueued;\n private lastUsedAt;\n constructor(params: {\n name: string;\n config: McpServerConfig;\n deps: ConnectionDeps;\n logger?: Logger;\n });\n /** Returns the most recent known tool list. May be empty if the server hasn't connected yet. */\n snapshotTools(): McpToolDescriptor[];\n /** Whether an MCP child process / remote connection has been established. */\n isConnected(): boolean;\n /** Idle timestamp for reaping. */\n idleSinceMs(): number;\n /**\n * Lazy connect + tool discovery. Safe to call concurrently; in-flight\n * connects coalesce.\n */\n ensureConnected(): Promise<void>;\n private connectAndDiscover;\n /**\n * Re-discover tools. Used on reconnect or `tools/list_changed` notification.\n * Refresh-lock collapses concurrent refreshes; if one is in flight, the next\n * is queued (max 1 queued, since N>1 queued provides no extra freshness).\n */\n refresh(): Promise<void>;\n callTool(originalName: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Close the underlying transport. Idempotent. If a connect is in flight\n * (warmup racing with reconcile-removal), wait for it to settle and then\n * close the client it produced — otherwise the child process is orphaned.\n */\n close(): Promise<void>;\n /**\n * Stable hash of the config for diff detection in `reconcile`.\n * Two configs with the same hash are equivalent (no restart needed).\n */\n configFingerprint(): string;\n}\n/**\n * Build the production `connect` factory using the official MCP SDK.\n * Kept in a separate function so tests can substitute a mock without\n * pulling the SDK into the test bundle.\n */\ndeclare function defaultConnect(server: McpServerConfig): Promise<McpClientHandle>;\n//# sourceMappingURL=connection.d.ts.map\n//#endregion\n//#region src/bundler.d.ts\n/**\n * Provider-agnostic MCP server bundler. Holds N MCP server connections,\n * exposes a unified namespaced tool catalog, and routes calls to the right\n * server.\n *\n * Designed to be embedded in any host (OpenClaw plugin, AI proxy, Lambda).\n * Public surface is intentionally synchronous where the host needs sync\n * (snapshot, listTools), async only where I/O is unavoidable.\n */\ndeclare class McpBundler {\n private readonly logger;\n private readonly connections;\n private readonly idleTtlMs;\n private readonly idleSweepIntervalMs;\n private idleSweepTimer;\n private readonly deps;\n private disposed;\n private reconcileLatch;\n constructor(opts?: BundlerOptions, deps?: ConnectionDeps);\n /**\n * Diff `desired` against current connections, spawn newcomers, dispose\n * removals, hot-restart on config change. Pull-based — call whenever the\n * host's config snapshot may have changed. Cheap if no diff.\n *\n * Lazy: newly-added servers are NOT eagerly connected; they connect on the\n * first `callTool()` (or first `listTools()` after `forceDiscover()`).\n * This avoids paying spawn cost for servers the agent never uses.\n */\n reconcile(desired: Record<string, McpServerConfig>): Promise<ReconcileDiff>;\n private doReconcile;\n /**\n * Synchronous snapshot of all currently-known tools across connected servers.\n * Servers that have not connected yet contribute nothing. Intended for use\n * inside OpenClaw's plugin tool factory which must be sync.\n *\n * Tool names are namespaced and disambiguated (suffix `-2`, `-3` on collision)\n * so cross-server name clashes never produce duplicate registrations.\n */\n listTools(): McpToolDescriptor[];\n /**\n * Eagerly connect to every configured server and discover tools. Used by\n * hosts that want a hot list rather than the lazy default. Errors are\n * swallowed per-server (logged), so one bad server doesn't fail the batch.\n */\n warmup(): Promise<void>;\n /**\n * Invoke a tool by its namespaced name. Routes to the originating server.\n * Errors are returned as `{ isError: true, content: [...] }` so a failing\n * tool doesn't crash the host.\n */\n callTool(prefixed: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Resolve a namespaced tool name back to its server connection and original\n * tool name. Returns undefined if the tool is not currently advertised.\n */\n private routeToolName;\n /**\n * Tear down all connections and stop background tasks. Idempotent.\n * Call from `registerRuntimeLifecycle({ cleanup })` in the host plugin.\n */\n dispose(): Promise<void>;\n private startIdleSweep;\n private sweepIdle;\n}\n//# sourceMappingURL=bundler.d.ts.map\n//#endregion\n//#region src/tool-naming.d.ts\n/**\n * Tool name sanitization and collision handling.\n *\n * OpenClaw constraint: tool names must match `[A-Za-z0-9_-]` and be ≤64 chars.\n * Pattern mirrored from `openclaw/src/agents/pi-bundle-mcp-names.ts`.\n *\n * Strategy: prefix every tool with its server name (`{server}__{tool}`),\n * sanitize disallowed chars to `_`, truncate, then suffix-disambiguate\n * (`-2`, `-3`, ...) on collision.\n */\ndeclare function sanitizeNameSegment(value: string): string;\ndeclare function buildNamespacedToolName(server: string, tool: string): string;\n/**\n * Disambiguate a candidate name against an existing set by appending `-2`, `-3`, etc.\n * Mutates nothing; returns the chosen name. Caller is responsible for inserting it\n * into the set.\n */\ndeclare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;\n//# sourceMappingURL=tool-naming.d.ts.map\n\n//#endregion\nexport { type BundlerOptions, Connection, type ConnectionDeps, type Logger, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type StdioServerConfig, buildNamespacedToolName, defaultConnect, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;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EAjBrB,MAiBqB,CAAA,MAAA,EAAA,OAAA,CAAA;SACA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAdtB,WAcsB,EAAA,QAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,GAAA,IAAA,EAAA,GAZ5B,OAY4B,CAZpB,eAYoB,CAAA;;AAAO,UAThC,kBAAA,CAYiB;EAAA,MAAA,CAAA,EAXhB,cAWgB;eACjB,CAAA,EAXQ,cAWR;kBACC,CAAA,EAAA,GAAA,GAXgB,cAWhB,GAAA,SAAA;;UARD,qBAAA,CAaA;MAAmB,MAAA;OAAuB,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAXjB,OAWiB,CAAA,IAAA,CAAA;MAAY,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAV7B,OAU6B,CAAA,IAAA,CAAA;;UAPtD,iBAAA,CAUyC;EAqD7C,MAAA,EA9DI,MAiKT;EAAA,MAAA,CAAA,EAhKU,cAgKV;cAnFe,CAAA,EAAA;IA+EE,QAAA,CAAA,EAAA,OAAA;EAAiB,CAAA;;;;sBAzJM;;;uBAE/B,mBAAmB,uBAAuB,YAAY;;;;;8BAGlC;;cAqDxB;;;;;;;;gBAgBU;kBA+EE"}
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","names":["McpServerConfig","StdioServerConfig","RemoteServerConfig","Record","McpTransportKind","McpToolDescriptor","ReconcileDiff","Logger","McpToolCallResult","BundlerOptions","STDIO_ENV_DENYLIST","Set","sanitizeStdioEnv","ConnectionDeps","McpClientHandle","Promise","AbortSignal","Connection","defaultConnect","McpBundler","sanitizeNameSegment","buildNamespacedToolName","disambiguateAgainst","ReadonlySet","ServerOwner","StoredServerCommon","StoredServerEntry","StoreSchema","StoreOptions","Store","defaultStorePath","toServerConfig","toStoredEntry","OpenclawExecutor","defaultOpenclawExecutor","ManagerOptions","AddServerOptions","Manager"],"sources":["../../mcp-bundler/dist/index.d.ts","../src/plugin.ts"],"sourcesContent":["//#region src/types.d.ts\n/**\n * Shape of a single MCP server entry — matches OpenClaw `mcp.servers.{name}`.\n * Either a stdio child process spec or a remote URL spec.\n */\ntype McpServerConfig = StdioServerConfig | RemoteServerConfig;\ninterface StdioServerConfig {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface RemoteServerConfig {\n url: string;\n transport?: 'sse' | 'streamable-http';\n headers?: Record<string, string>;\n connectionTimeoutMs?: number;\n}\ntype McpTransportKind = 'stdio' | 'sse' | 'streamable-http';\n/**\n * One tool surfaced from one MCP server, after namespacing.\n */\ninterface McpToolDescriptor {\n /** Namespaced name as the LLM sees it: `{serverName}__{originalName}`, sanitized + max 64 chars. */\n prefixed: string;\n /** Server name (key in `mcp.servers.*`). */\n server: string;\n /** Original tool name as advertised by the MCP server. */\n original: string;\n /** Human label for the tool (truncated description, suitable for UI). */\n label: string;\n /** Full description from the MCP server. */\n description: string;\n /** JSON Schema (object) for tool parameters. */\n parameters: Record<string, unknown>;\n}\ninterface ReconcileDiff {\n added: string[];\n removed: string[];\n changed: string[];\n unchanged: string[];\n}\ninterface Logger {\n debug: (msg: string, meta?: Record<string, unknown>) => void;\n info: (msg: string, meta?: Record<string, unknown>) => void;\n warn: (msg: string, meta?: Record<string, unknown>) => void;\n error: (msg: string, meta?: Record<string, unknown>) => void;\n}\ninterface McpToolCallResult {\n content: Record<string, unknown>[];\n isError?: boolean;\n}\ninterface BundlerOptions {\n logger?: Logger;\n /** Idle TTL for spawned children (ms). 0 disables. Default: 600_000 (10 min). */\n idleTtlMs?: number;\n /** Sweep interval for idle reaping (ms). Default: 60_000 (1 min). */\n idleSweepIntervalMs?: number;\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\n//#region src/connection.d.ts\n/** Env keys OpenClaw rejects from stdio MCP env blocks. Filter them out before spawning. */\ndeclare const STDIO_ENV_DENYLIST: Set<string>;\ndeclare function sanitizeStdioEnv(env: Record<string, string> | undefined): Record<string, string>;\ninterface ConnectionDeps {\n /**\n * Factory for an MCP Client connected to the given config. Injected so tests\n * can mock without spawning real processes. In production this wraps\n * `@modelcontextprotocol/sdk/client`.\n */\n connect: (server: McpServerConfig) => Promise<McpClientHandle>;\n}\n/**\n * Minimal interface our connection layer needs from an MCP client. Mirrors\n * the @modelcontextprotocol/sdk Client surface but kept narrow so we can\n * mock cleanly in tests.\n */\ninterface McpClientHandle {\n listTools(): Promise<{\n name: string;\n description?: string;\n inputSchema: Record<string, unknown>;\n }[]>;\n callTool(name: string, args: unknown, opts?: {\n signal?: AbortSignal;\n }): Promise<McpToolCallResult>;\n close(): Promise<void>;\n}\n/**\n * One Connection per MCP server. Owns lifecycle (lazy-spawn, close, refresh-lock).\n * Refresh-lock pattern adapted from AIWerk `index.ts:219-250` — prevents\n * reconnect + `notifications/tools/list_changed` race.\n */\ndeclare class Connection {\n readonly name: string;\n readonly config: McpServerConfig;\n private readonly deps;\n private readonly logger;\n private client;\n private tools;\n private connectInFlight;\n private refreshInFlight;\n private refreshQueued;\n private lastUsedAt;\n constructor(params: {\n name: string;\n config: McpServerConfig;\n deps: ConnectionDeps;\n logger?: Logger;\n });\n /** Returns the most recent known tool list. May be empty if the server hasn't connected yet. */\n snapshotTools(): McpToolDescriptor[];\n /** Whether an MCP child process / remote connection has been established. */\n isConnected(): boolean;\n /** Idle timestamp for reaping. */\n idleSinceMs(): number;\n /**\n * Lazy connect + tool discovery. Safe to call concurrently; in-flight\n * connects coalesce.\n */\n ensureConnected(): Promise<void>;\n private connectAndDiscover;\n /**\n * Re-discover tools. Used on reconnect or `tools/list_changed` notification.\n * Refresh-lock collapses concurrent refreshes; if one is in flight, the next\n * is queued (max 1 queued, since N>1 queued provides no extra freshness).\n */\n refresh(): Promise<void>;\n callTool(originalName: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Close the underlying transport. Idempotent. If a connect is in flight\n * (warmup racing with reconcile-removal), wait for it to settle and then\n * close the client it produced — otherwise the child process is orphaned.\n */\n close(): Promise<void>;\n /**\n * Stable hash of the config for diff detection in `reconcile`.\n * Two configs with the same hash are equivalent (no restart needed).\n */\n configFingerprint(): string;\n}\n/**\n * Build the production `connect` factory using the official MCP SDK.\n * Kept in a separate function so tests can substitute a mock without\n * pulling the SDK into the test bundle.\n */\ndeclare function defaultConnect(server: McpServerConfig): Promise<McpClientHandle>;\n//# sourceMappingURL=connection.d.ts.map\n//#endregion\n//#region src/bundler.d.ts\n/**\n * Provider-agnostic MCP server bundler. Holds N MCP server connections,\n * exposes a unified namespaced tool catalog, and routes calls to the right\n * server.\n *\n * Designed to be embedded in any host (OpenClaw plugin, AI proxy, Lambda).\n * Public surface is intentionally synchronous where the host needs sync\n * (snapshot, listTools), async only where I/O is unavoidable.\n */\ndeclare class McpBundler {\n private readonly logger;\n private readonly connections;\n private readonly idleTtlMs;\n private readonly idleSweepIntervalMs;\n private idleSweepTimer;\n private readonly deps;\n private disposed;\n private reconcileLatch;\n constructor(opts?: BundlerOptions, deps?: ConnectionDeps);\n /**\n * Diff `desired` against current connections, spawn newcomers, dispose\n * removals, hot-restart on config change. Pull-based — call whenever the\n * host's config snapshot may have changed. Cheap if no diff.\n *\n * Lazy: newly-added servers are NOT eagerly connected; they connect on the\n * first `callTool()` (or first `listTools()` after `forceDiscover()`).\n * This avoids paying spawn cost for servers the agent never uses.\n */\n reconcile(desired: Record<string, McpServerConfig>): Promise<ReconcileDiff>;\n private doReconcile;\n /**\n * Synchronous snapshot of all currently-known tools across connected servers.\n * Servers that have not connected yet contribute nothing. Intended for use\n * inside OpenClaw's plugin tool factory which must be sync.\n *\n * Tool names are namespaced and disambiguated (suffix `-2`, `-3` on collision)\n * so cross-server name clashes never produce duplicate registrations.\n */\n listTools(): McpToolDescriptor[];\n /**\n * Eagerly connect to every configured server and discover tools. Used by\n * hosts that want a hot list rather than the lazy default. Errors are\n * swallowed per-server (logged), so one bad server doesn't fail the batch.\n */\n warmup(): Promise<void>;\n /**\n * Invoke a tool by its namespaced name. Routes to the originating server.\n * Errors are returned as `{ isError: true, content: [...] }` so a failing\n * tool doesn't crash the host.\n */\n callTool(prefixed: string, args: unknown, signal?: AbortSignal): Promise<McpToolCallResult>;\n /**\n * Resolve a namespaced tool name back to its server connection and original\n * tool name. Returns undefined if the tool is not currently advertised.\n */\n private routeToolName;\n /**\n * Tear down all connections and stop background tasks. Idempotent.\n * Call from `registerRuntimeLifecycle({ cleanup })` in the host plugin.\n */\n dispose(): Promise<void>;\n private startIdleSweep;\n private sweepIdle;\n}\n//# sourceMappingURL=bundler.d.ts.map\n//#endregion\n//#region src/tool-naming.d.ts\n/**\n * Tool name sanitization and collision handling.\n *\n * OpenClaw constraint: tool names must match `[A-Za-z0-9_-]` and be ≤64 chars.\n * Pattern mirrored from `openclaw/src/agents/pi-bundle-mcp-names.ts`.\n *\n * Strategy: prefix every tool with its server name (`{server}__{tool}`),\n * sanitize disallowed chars to `_`, truncate, then suffix-disambiguate\n * (`-2`, `-3`, ...) on collision.\n */\ndeclare function sanitizeNameSegment(value: string): string;\ndeclare function buildNamespacedToolName(server: string, tool: string): string;\n/**\n * Disambiguate a candidate name against an existing set by appending `-2`, `-3`, etc.\n * Mutates nothing; returns the chosen name. Caller is responsible for inserting it\n * into the set.\n */\ndeclare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;\n//# sourceMappingURL=tool-naming.d.ts.map\n//#endregion\n//#region src/store.d.ts\n/**\n * Where a server entry came from. Used by `removeServersByOwner` so an\n * integration uninstall can drop only its own entries without touching\n * `cli`-owned (e.g. `alfe-platform`) or `manual`-owned (user-added) ones.\n */\ntype ServerOwner = 'cli' | `integration:${string}` | 'manual';\ninterface StoredServerCommon {\n /** Where the entry came from — controls bulk-removal semantics. */\n owner: ServerOwner;\n /** ISO timestamp of first registration; preserved across updates. */\n addedAt: string;\n /** Optional semver of the providing package (e.g. `@alfe.ai/mcp-server` for `alfe-platform`). Used for drift detection on CLI upgrade. */\n version?: string;\n}\ntype StoredServerEntry = (StoredServerCommon & {\n transport: 'stdio';\n} & StdioServerConfig) | (StoredServerCommon & {\n transport: 'sse' | 'streamable-http';\n} & RemoteServerConfig);\ninterface StoreSchema {\n servers: Record<string, StoredServerEntry>;\n config: {\n sessionIdleTtlMs?: number;\n };\n /**\n * Server names this manager has written into `openclaw.json#mcp.servers.*`.\n * Used to compute the mirror-write diff without re-reading openclaw.json\n * (which would be a second source of truth). Foreign keys not listed here\n * are preserved across mirror writes.\n */\n _ownedOpenclawKeys: string[];\n}\ninterface StoreOptions {\n /** Absolute path to the store file. Defaults to `~/.alfe/mcp/servers.json`. */\n path?: string;\n logger?: Logger;\n}\n/**\n * On-disk source of truth for the bundler's configured servers.\n *\n * Mutations go through `update()` (read-modify-write with atomic\n * temp+rename) so a concurrent writer (e.g. two `alfe mcp add` invocations\n * racing) can't lose data — the second writer reads the first's state.\n *\n * Schema is owner-tagged so `removeServersByOwner` can implement\n * integration uninstall without touching CLI-owned or manual entries.\n */\ndeclare class Store {\n private readonly storePath;\n private readonly logger?;\n private watcher?;\n private watcherListeners;\n private rewatchTimer?;\n constructor(opts?: StoreOptions);\n get path(): string;\n read(): StoreSchema;\n /**\n * Read-modify-write with atomic temp+rename, guarded by an\n * inter-process lock file. Caller passes a pure function that\n * produces the next state; this serialises the mutation to disk in\n * one rename, which is atomic on POSIX and on Windows when the\n * target path is on the same volume.\n *\n * The lock guards the read-then-rename window so two processes\n * (e.g. two `alfe mcp add` shells, or the CLI racing the daemon)\n * can't drop each other's writes. The lock file is at\n * `<storePath>.lock`; stale locks (older than `LOCK_STALE_MS`) are\n * stolen so a crashed writer doesn't wedge the store.\n *\n * Pure-function shape (instead of a `read()` then `write(next)`\n * pair) intentionally — it keeps the read-modify-write contract\n * local to each caller so two updates back-to-back never see each\n * other's partial state.\n */\n update(fn: (cur: StoreSchema) => StoreSchema): StoreSchema;\n /**\n * Acquire an inter-process file lock by atomically creating a\n * sentinel via `openSync(lockPath, 'wx')`. Spins with bounded\n * backoff up to `LOCK_WAIT_MS`. If the lock file is older than\n * `LOCK_STALE_MS` it's assumed orphaned (writer crashed mid-update)\n * and stolen — the write window is sub-second in practice, so\n * holding the lock for >5s means something went wrong.\n *\n * Returns the release function. Single-process callers are\n * unaffected — re-entering the same process spins briefly while\n * the prior call's `finally` runs.\n */\n private acquireLock;\n private lockIsStale;\n /**\n * Watch the store file for external changes (e.g. another `alfe mcp add`\n * shelling out from a separate process). Returns an unsubscribe fn.\n *\n * Coalesces bursts via a 50 ms debounce — editors and atomic-rename\n * writers commonly fire multiple events per logical save.\n */\n watch(cb: () => void): () => void;\n dispose(): void;\n private ensureWatcher;\n private disposeWatcher;\n}\ndeclare function defaultStorePath(): string;\n/** Pull the runtime config (transport + transport-specific fields) out of a stored entry. */\ndeclare function toServerConfig(entry: StoredServerEntry): McpServerConfig;\n/** Build a stored entry from a runtime config + ownership metadata. */\ndeclare function toStoredEntry(config: McpServerConfig, meta: {\n owner: ServerOwner;\n transport?: McpTransportKind;\n version?: string;\n addedAt?: string;\n}): StoredServerEntry;\n//#endregion\n//#region src/manager.d.ts\n/**\n * Shells out to `openclaw config set --batch-json` / `openclaw config unset`\n * to keep `openclaw.json#mcp.servers.*` in sync with the bundler store.\n * Default executor reuses the same machinery the integrations applier has\n * used for ~6 months; tests inject a fake.\n */\ninterface OpenclawExecutor {\n setBatch: (batch: {\n path: string;\n value: unknown;\n }[]) => Promise<void>;\n unset: (path: string) => Promise<void>;\n}\ndeclare const defaultOpenclawExecutor: OpenclawExecutor;\ninterface ManagerOptions {\n /** Pre-constructed store. If omitted, one is built with default options. */\n store?: Store;\n /** Override for the openclaw mirror executor (tests inject a fake). */\n executor?: OpenclawExecutor;\n logger?: Logger;\n /**\n * Debounce window for the mirror-write. Mutations landing inside this\n * window coalesce into a single openclaw config update, avoiding the\n * auto-restart race where two back-to-back `addServer` calls hit an\n * openclaw that's mid-shutdown from the first write's watcher.\n */\n mirrorDebounceMs?: number;\n}\ninterface AddServerOptions {\n /** Required — flat-namespace key under `mcp.servers.*`. */\n id: string;\n /** Marks ownership for bulk removal. Defaults to `manual`. */\n owner?: ServerOwner;\n /** Semver of the providing package; used for CLI version-drift detection. */\n version?: string;\n /** Explicit transport hint for remote configs. Defaults to inferring from `config`. */\n transport?: McpTransportKind;\n}\n/**\n * Bundler manager — owns the alfe store, mirrors it into openclaw.json,\n * and surfaces a small CRUD API the CLI and integration applier both\n * call into.\n *\n * The store is the Alfe-owned source of truth; openclaw.json is a\n * derived mirror so the runtime keeps consuming its existing format.\n */\ndeclare class Manager {\n private readonly store;\n private readonly executor;\n private readonly logger?;\n private readonly mirrorDebounceMs;\n private mirrorTimer?;\n private mirrorPromise;\n private mirrorPending?;\n private bundler?;\n private changeListeners;\n private storeUnsubscribe?;\n constructor(opts?: ManagerOptions);\n /** Direct accessor — handy for tests and the CLI's `alfe mcp list`. */\n getStore(): Store;\n /**\n * Register or overwrite a server entry. Resolves as soon as the store\n * mutation is committed to disk — the openclaw.json mirror runs async\n * in the background and is debounced so back-to-back calls coalesce\n * into one runtime restart. Call `flush()` to await the mirror.\n */\n addServer(config: McpServerConfig, opts: AddServerOptions): Promise<void>;\n /**\n * Remove a single server entry. No-op if the id isn't in the store.\n * Refuses to remove an entry whose owner doesn't match `expectedOwner`\n * when supplied — the CLI uses this to guard `alfe mcp remove` from\n * accidentally clobbering integration- or cli-owned entries.\n *\n * Resolves as soon as the store mutation is committed. Mirror runs\n * async; call `flush()` to await it.\n */\n removeServer(id: string, opts?: {\n expectedOwner?: ServerOwner;\n }): Promise<boolean>;\n /** Drop every entry whose owner matches — used by integration uninstall. */\n removeServersByOwner(owner: ServerOwner): Promise<string[]>;\n /** Read-only snapshot for `alfe mcp list` and similar UIs. */\n listServers(): {\n id: string;\n entry: StoredServerEntry;\n }[];\n /**\n * Push the current store contents into a bundler instance (which owns\n * connections / tools). Wires up a store watcher so external mutations\n * (e.g. another shell running `alfe mcp add`) re-reconcile.\n */\n loadIntoBundler(bundler: McpBundler): Promise<void>;\n /** Subscribe to store mutations. Returns an unsubscribe fn. */\n onChange(cb: () => void): () => void;\n /**\n * Cancel any pending mirror-write, flush the in-flight one, and stop\n * watching the store. Safe to call multiple times.\n */\n dispose(): Promise<void>;\n /**\n * Force the debounced mirror to run now and wait for it to finish.\n * Surfaces the executor error if the mirror failed — callers wrap in\n * try/catch (or .rejects in tests) if they need to handle it.\n */\n flush(): Promise<void>;\n private scheduleMirror;\n private runMirror;\n /**\n * Compute the diff between this manager's owned set and what the store\n * declares now, then apply the openclaw config delta. Foreign keys\n * (entries in openclaw.json#mcp.servers.* not in our store) are\n * preserved — we only touch the names we previously claimed.\n */\n private applyMirror;\n private reconcileBundler;\n private fireChange;\n}\n//# sourceMappingURL=manager.d.ts.map\n\n//#endregion\nexport { type AddServerOptions, type BundlerOptions, Connection, type ConnectionDeps, type Logger, Manager, type ManagerOptions, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type OpenclawExecutor, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type ServerOwner, type StdioServerConfig, Store, type StoreOptions, type StoreSchema, type StoredServerEntry, buildNamespacedToolName, defaultConnect, defaultOpenclawExecutor, defaultStorePath, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv, toServerConfig, toStoredEntry };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;KAKKA,eAAAA,GAAkBC,iBAAsC,GAAlBC,kBAAkB;AAAA,UACnDD,iBAAAA,CAAiB;EAGb,OAGJC,EAAAA,MAAAA;;QAHFC;;ACGwF;AAUhF,UDVND,kBAAAA,CCiBc;EAAA,GAAA,EAAA,MAAA;WACgC,CAAA,EAAA,KAAA,GAAA,iBAAA;SACrB,CAAA,EDhBvBC,MCgBuB,CAAA,MAAA,EAAA,MAAA,CAAA;qBAAf,CAAA,EAAA,MAAA;;;;;AATJ,UAAN,MAAA,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AXQ,cAWR;kBACC,CAAA,EAAA,GAAA,GAXgB,cAWhB,GAAA,SAAA;;UARD,qBAAA,CAaA;MAAmB,MAAA;OAAuB,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAXjB,OAWiB,CAAA,IAAA,CAAA;MAAY,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA,GAV7B,OAU6B,CAAA,IAAA,CAAA;;UAPtD,iBAAA,CAUyC;EAqD7C,MAAA,EA9DI,MAiKT;EAAA,MAAA,CAAA,EAhKU,cAgKV;cAnFe,CAAA,EAAA;IA+EE,QAAA,CAAA,EAAA,OAAA;EAAiB,CAAA;;;;sBAzJM;;;uBAE/B,mBAAmB,uBAAuB,YAAY;;;;;8BAGlC;;cAqDxB;;;;;;;;gBAgBU;kBA+EE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/openclaw-mcp-bundler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "OpenClaw plugin that bridges mcp.servers config into agent tool list via @alfe.ai/mcp-bundler — works for any LLM backend (not just claude-cli/codex-cli)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"openclaw.plugin.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@alfe.ai/mcp-bundler": "0.0
|
|
30
|
+
"@alfe.ai/mcp-bundler": "0.1.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"openclaw": ">=2026.3.0"
|