@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.21 kB
TypeScript
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { type McpCachedServerCatalog } from "./catalog-cache.ts";
import { ServerConnection } from "./connection.ts";
import type { ServerConnectionOptions } from "./connection-types.ts";
import { SharedMcpLease } from "./shared-lease.ts";
export interface SharedMcpOptions extends ServerConnectionOptions {
readonly agentDir: string;
readonly configHash: string;
}
/** Owns one SDK handler set, reconnect loop, cache writer and aggregate lifetime. */
export declare class SharedMcpConnection {
#private;
readonly connection: ServerConnection;
readonly leases: Set<SharedMcpLease>;
constructor(options: SharedMcpOptions, onDispose: () => void);
attach(options: ServerConnectionOptions, owner: object, key: string): SharedMcpLease;
connect(): Promise<Client>;
runRequest<T>(call: () => Promise<T>): Promise<T>;
callTool<T>(lease: SharedMcpLease, call: () => Promise<T>): Promise<T>;
release(lease: SharedMcpLease): void;
catalog(refresh?: boolean): Promise<McpCachedServerCatalog>;
dispose(): Promise<void>;
invalidate(): Promise<void>;
}
//# sourceMappingURL=shared-connection.d.ts.map