chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import type { SkillMcpManagerState } from "./types";
|
||||
export declare function registerProcessCleanup(state: SkillMcpManagerState): void;
|
||||
export declare function unregisterProcessCleanup(state: SkillMcpManagerState): void;
|
||||
export declare function startCleanupTimer(state: SkillMcpManagerState): void;
|
||||
export declare function stopCleanupTimer(state: SkillMcpManagerState): void;
|
||||
export declare function disconnectSession(state: SkillMcpManagerState, sessionID: string): Promise<void>;
|
||||
export declare function disconnectAll(state: SkillMcpManagerState): Promise<void>;
|
||||
export declare function forceReconnect(state: SkillMcpManagerState, clientKey: string): Promise<boolean>;
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
||||
import type { ConnectionType } from "./types";
|
||||
/**
|
||||
* Determines connection type from MCP server configuration.
|
||||
* Priority: explicit type field > url presence > command presence
|
||||
*/
|
||||
export declare function getConnectionType(config: ClaudeCodeMcpServer): ConnectionType | null;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
||||
import type { SkillMcpClientInfo, SkillMcpManagerState } from "./types";
|
||||
export declare function getOrCreateClient(params: {
|
||||
state: SkillMcpManagerState;
|
||||
clientKey: string;
|
||||
info: SkillMcpClientInfo;
|
||||
config: ClaudeCodeMcpServer;
|
||||
}): Promise<Client>;
|
||||
export declare function getOrCreateClientWithRetryImpl(params: {
|
||||
state: SkillMcpManagerState;
|
||||
clientKey: string;
|
||||
info: SkillMcpClientInfo;
|
||||
config: ClaudeCodeMcpServer;
|
||||
}): Promise<Client>;
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare const EXCLUDED_ENV_PATTERNS: RegExp[];
|
||||
export declare function createCleanMcpEnvironment(customEnv?: Record<string, string>): Record<string, string>;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import type { SkillMcpClientConnectionParams } from "./types";
|
||||
export declare function createHttpClient(params: SkillMcpClientConnectionParams): Promise<Client>;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export * from "./types";
|
||||
export { SkillMcpManager } from "./manager";
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import type { Prompt, Resource, Tool } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
||||
import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
||||
export declare class SkillMcpManager {
|
||||
private readonly state;
|
||||
private getClientKey;
|
||||
getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
|
||||
disconnectSession(sessionID: string): Promise<void>;
|
||||
disconnectAll(): Promise<void>;
|
||||
listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
|
||||
listResources(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Resource[]>;
|
||||
listPrompts(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Prompt[]>;
|
||||
callTool(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, unknown>): Promise<unknown>;
|
||||
readResource(info: SkillMcpClientInfo, context: SkillMcpServerContext, uri: string): Promise<unknown>;
|
||||
getPrompt(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, string>): Promise<unknown>;
|
||||
private withOperationRetry;
|
||||
private getOrCreateClientWithRetry;
|
||||
getConnectedServers(): string[];
|
||||
isConnected(info: SkillMcpClientInfo): boolean;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
||||
import { McpOAuthProvider } from "../mcp-oauth/provider";
|
||||
export declare function getOrCreateAuthProvider(authProviders: Map<string, McpOAuthProvider>, serverUrl: string, oauth: NonNullable<ClaudeCodeMcpServer["oauth"]>): McpOAuthProvider;
|
||||
export declare function buildHttpRequestInit(config: ClaudeCodeMcpServer, authProviders: Map<string, McpOAuthProvider>): Promise<RequestInit | undefined>;
|
||||
export declare function handleStepUpIfNeeded(params: {
|
||||
error: Error;
|
||||
config: ClaudeCodeMcpServer;
|
||||
authProviders: Map<string, McpOAuthProvider>;
|
||||
}): Promise<boolean>;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import type { SkillMcpClientConnectionParams } from "./types";
|
||||
export declare function createStdioClient(params: SkillMcpClientConnectionParams): Promise<Client>;
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import type { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
||||
import type { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
||||
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
||||
import type { McpOAuthProvider } from "../mcp-oauth/provider";
|
||||
export type SkillMcpConfig = Record<string, ClaudeCodeMcpServer>;
|
||||
export interface SkillMcpClientInfo {
|
||||
serverName: string;
|
||||
skillName: string;
|
||||
sessionID: string;
|
||||
}
|
||||
export interface SkillMcpServerContext {
|
||||
config: ClaudeCodeMcpServer;
|
||||
skillName: string;
|
||||
}
|
||||
/**
|
||||
* Connection type for a managed MCP client.
|
||||
* - "stdio": Local process via stdin/stdout
|
||||
* - "http": Remote server via HTTP (Streamable HTTP transport)
|
||||
*/
|
||||
export type ConnectionType = "stdio" | "http";
|
||||
export interface ManagedClientBase {
|
||||
client: Client;
|
||||
skillName: string;
|
||||
lastUsedAt: number;
|
||||
connectionType: ConnectionType;
|
||||
}
|
||||
export interface ManagedStdioClient extends ManagedClientBase {
|
||||
connectionType: "stdio";
|
||||
transport: StdioClientTransport;
|
||||
}
|
||||
export interface ManagedHttpClient extends ManagedClientBase {
|
||||
connectionType: "http";
|
||||
transport: StreamableHTTPClientTransport;
|
||||
}
|
||||
export type ManagedClient = ManagedStdioClient | ManagedHttpClient;
|
||||
export interface ProcessCleanupHandler {
|
||||
signal: NodeJS.Signals;
|
||||
listener: () => void;
|
||||
}
|
||||
export interface SkillMcpManagerState {
|
||||
clients: Map<string, ManagedClient>;
|
||||
pendingConnections: Map<string, Promise<Client>>;
|
||||
disconnectedSessions: Map<string, number>;
|
||||
authProviders: Map<string, McpOAuthProvider>;
|
||||
cleanupRegistered: boolean;
|
||||
cleanupInterval: ReturnType<typeof setInterval> | null;
|
||||
cleanupHandlers: ProcessCleanupHandler[];
|
||||
idleTimeoutMs: number;
|
||||
shutdownGeneration: number;
|
||||
inFlightConnections: Map<string, number>;
|
||||
disposed: boolean;
|
||||
}
|
||||
export interface SkillMcpClientConnectionParams {
|
||||
state: SkillMcpManagerState;
|
||||
clientKey: string;
|
||||
info: SkillMcpClientInfo;
|
||||
config: ClaudeCodeMcpServer;
|
||||
}
|
||||
Reference in New Issue
Block a user