/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import type { Context } from '@nocobase/actions'; import { StdioConnection, StreamableHTTPConnection } from '@langchain/mcp-adapters'; import { StructuredToolInterface } from '@langchain/core/tools'; import type { MCPEntry, MCPOptions } from './types'; type MCPConnection = StdioConnection | StreamableHTTPConnection; export type UserContextMCPClientManagerOptions = { app: any; listEntries: () => Promise; buildConnection: (options: MCPOptions) => MCPConnection; ttlMs?: number; maxSize?: number; }; export declare class UserContextMCPClientManager { private readonly options; private readonly cache; private readonly ttlMs; private readonly maxSize; constructor(options: UserContextMCPClientManagerOptions); getToolsMap(ctx: Context): Promise>; clear(): Promise; private evictExpired; private evictOversized; private closeEntry; } export {};