Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🕸️ fix: Minor Type Issues & Anthropic Web Search (#10618)
Danny Avila1814c81888ae
diff --git a/api/package.json b/api/package.jsonindex 1e57967e6a..4a011b33b5 100644--- a/api/package.json+++ b/api/package.json@@ -47,7 +47,7 @@"@langchain/google-genai": "^0.2.13","@langchain/google-vertexai": "^0.2.13","@langchain/textsplitters": "^0.1.0",- "@librechat/agents": "^3.0.27",+ "@librechat/agents": "^3.0.30","@librechat/api": "*","@librechat/data-schemas": "*","@microsoft/microsoft-graph-client": "^3.0.7",diff --git a/package-lock.json b/package-lock.jsonindex 4da9b4e26c..da281442fb 100644--- a/package-lock.json+++ b/package-lock.json@@ -63,7 +63,7 @@"@langchain/google-genai": "^0.2.13","@langchain/google-vertexai": "^0.2.13","@langchain/textsplitters": "^0.1.0",- "@librechat/agents": "^3.0.27",+ "@librechat/agents": "^3.0.30","@librechat/api": "*","@librechat/data-schemas": "*","@microsoft/microsoft-graph-client": "^3.0.7",@@ -16426,9 +16426,9 @@}},"node_modules/@librechat/agents": {- "version": "3.0.27",- "resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-3.0.27.tgz",- "integrity": "sha512-4xMzWdPgzYhEkbgGgwYx9/fIpYa9CDEupyTvYllR1sZQ8inBeByA8sMW3aTnaC+euAHZP0oVYs4Uw3J1SB0Mag==",+ "version": "3.0.30",+ "resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-3.0.30.tgz",+ "integrity": "sha512-EJLo6GqXH0tefpdrhMnoiVwhFupS3K9I0xXAKCn+6greIhdZV1IlsYRxu+NXoK+xaFJBJeMkAb0E9Oih61NxoA==","license": "MIT","dependencies": {"@langchain/anthropic": "^0.3.26",@@ -47440,7 +47440,7 @@"@azure/storage-blob": "^12.27.0","@keyv/redis": "^4.3.3","@langchain/core": "^0.3.79",- "@librechat/agents": "^3.0.27",+ "@librechat/agents": "^3.0.30","@librechat/data-schemas": "*","@modelcontextprotocol/sdk": "^1.21.0","axios": "^1.12.1",diff --git a/packages/api/package.json b/packages/api/package.jsonindex 82107c38fc..e67e47ac6a 100644--- a/packages/api/package.json+++ b/packages/api/package.json@@ -84,7 +84,7 @@"@azure/storage-blob": "^12.27.0","@keyv/redis": "^4.3.3","@langchain/core": "^0.3.79",- "@librechat/agents": "^3.0.27",+ "@librechat/agents": "^3.0.30","@librechat/data-schemas": "*","@modelcontextprotocol/sdk": "^1.21.0","axios": "^1.12.1",diff --git a/packages/api/src/agents/run.ts b/packages/api/src/agents/run.tsindex 5df80c5f39..8124b26d61 100644--- a/packages/api/src/agents/run.ts+++ b/packages/api/src/agents/run.ts@@ -9,6 +9,7 @@ import type {RunConfig,IState,} from '@librechat/agents';+import type { IUser } from '@librechat/data-schemas';import type { Agent } from 'librechat-data-provider';import type * as t from '~/types';import { resolveHeaders, createSafeUser } from '~/utils/env';@@ -79,7 +80,7 @@ export async function createRun({streaming?: boolean;streamUsage?: boolean;requestBody?: t.RequestBody;- user?: t.TUser;+ user?: IUser;} & Pick<RunConfig, 'tokenCounter' | 'customHandlers' | 'indexTokenCountMap'>): Promise<Run<IState>> {diff --git a/packages/api/src/mcp/MCPManager.ts b/packages/api/src/mcp/MCPManager.tsindex 1e0d483f17..c1442bdeba 100644--- a/packages/api/src/mcp/MCPManager.ts+++ b/packages/api/src/mcp/MCPManager.ts@@ -2,9 +2,8 @@ import pick from 'lodash/pick';import { logger } from '@librechat/data-schemas';import { CallToolResultSchema, ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';import type { RequestOptions } from '@modelcontextprotocol/sdk/shared/protocol.js';-import type { TokenMethods } from '@librechat/data-schemas';+import type { TokenMethods, IUser } from '@librechat/data-schemas';import type { FlowStateManager } from '~/flow/manager';-import type { TUser } from 'librechat-data-provider';import type { MCPOAuthTokens } from './oauth';import type { RequestBody } from '~/types';import type * as t from './types';@@ -49,7 +48,7 @@ export class MCPManager extends UserConnectionManager {public async getConnection(args: {serverName: string;- user?: TUser;+ user?: IUser;forceNew?: boolean;flowManager?: FlowStateManager<MCPOAuthTokens | null>;} & Omit<t.OAuthConnectionOptions, 'useOAuth' | 'user' | 'flowManager'>,@@ -176,7 +175,7 @@ Please follow these instructions when using tools from the respective MCP serveroauthEnd,customUserVars,}: {- user?: TUser;+ user?: IUser;serverName: string;toolName: string;provider: t.Provider;diff --git a/packages/api/src/mcp/oauth/OAuthReconnectionManager.ts b/packages/api/src/mcp/oauth/OAuthReconnectionManager.tsindex 25edec7f3a..db81a2ffae 100644--- a/packages/api/src/mcp/oauth/OAuthReconnectionManager.ts+++ b/packages/api/src/mcp/oauth/OAuthReconnectionManager.ts@@ -1,6 +1,5 @@import { logger } from '@librechat/data-schemas';-import type { TokenMethods } from '@librechat/data-schemas';-import type { TUser } from 'librechat-data-provider';+import type { TokenMethods, IUser } from '@librechat/data-schemas';import type { MCPOAuthTokens } from './types';import { OAuthReconnectionTracker } from './OAuthReconnectionTracker';import { FlowStateManager } from '~/flow/manager';@@ -117,7 +116,7 @@ export class OAuthReconnectionManager {// attempt to get connection (this will use existing tokens and refresh if needed)const connection = await this.mcpManager.getUserConnection({serverName,- user: { id: userId } as TUser,+ user: { id: userId } as IUser,flowManager: this.flowManager,tokenMethods: this.tokenMethods,// don't force new connection, let it reuse existing or create new as neededdiff --git a/packages/api/src/mcp/types/index.ts b/packages/api/src/mcp/types/index.tsindex 6e445e26ad..cc78ef720a 100644--- a/packages/api/src/mcp/types/index.ts+++ b/packages/api/src/mcp/types/index.ts@@ -1,16 +1,16 @@import { z } from 'zod';import {+ Tools,SSEOptionsSchema,MCPOptionsSchema,MCPServersSchema,StdioOptionsSchema,WebSocketOptionsSchema,StreamableHTTPOptionsSchema,- Tools,} from 'librechat-data-provider';-import type { SearchResultData, UIResource, TPlugin, TUser } from 'librechat-data-provider';+import type { SearchResultData, UIResource, TPlugin } from 'librechat-data-provider';+import type { TokenMethods, JsonSchemaType, IUser } from '@librechat/data-schemas';import type * as t from '@modelcontextprotocol/sdk/types.js';-import type { TokenMethods, JsonSchemaType } from '@librechat/data-schemas';import type { FlowStateManager } from '~/flow/manager';import type { RequestBody } from '~/types/http';import type * as o from '~/mcp/oauth/types';@@ -161,7 +161,7 @@ export interface BasicConnectionOptions {}export interface OAuthConnectionOptions {- user: TUser;+ user: IUser;useOAuth: true;requestBody?: RequestBody;customUserVars?: Record<string, string>;diff --git a/packages/api/src/utils/env.ts b/packages/api/src/utils/env.tsindex 81c7f3923b..86e60cfce9 100644--- a/packages/api/src/utils/env.ts+++ b/packages/api/src/utils/env.ts@@ -1,5 +1,5 @@import { extractEnvVariable } from 'librechat-data-provider';-import type { TUser, MCPOptions } from 'librechat-data-provider';+import type { MCPOptions } from 'librechat-data-provider';import type { IUser } from '@librechat/data-schemas';import type { RequestBody } from '~/types';import { extractOpenIDTokenInfo, processOpenIDPlaceholders, isOpenIDTokenValid } from './oidc';@@ -71,7 +71,7 @@ const ALLOWED_BODY_FIELDS = ['conversationId', 'parentMessageId', 'messageId'] a* @param user - The user object* @returns The processed string with placeholders replaced*/-function processUserPlaceholders(value: string, user?: TUser): string {+function processUserPlaceholders(value: string, user?: IUser): string {if (!user || typeof value !== 'string') {return value;}@@ -82,7 +82,7 @@ function processUserPlaceholders(value: string, user?: TUser): string {continue;}- const fieldValue = user[field as keyof TUser];+ const fieldValue = user[field as keyof IUser];// Skip replacement if field doesn't exist in user objectif (!(field in user)) {@@ -141,7 +141,7 @@ function processSingleValue({}: {originalValue: string;customUserVars?: Record<string, string>;- user?: TUser;+ user?: IUser;body?: RequestBody;}): string {let value = originalValue;@@ -182,7 +182,7 @@ function processSingleValue({*/export function processMCPEnv(params: {options: Readonly<MCPOptions>;- user?: TUser;+ user?: IUser;customUserVars?: Record<string, string>;body?: RequestBody;}): MCPOptions {@@ -227,7 +227,7 @@ export function processMCPEnv(params: {// Process OAuth configuration if it exists (for all transport types)if ('oauth' in newObj && newObj.oauth) {- const processedOAuth: Record<string, string | string[] | undefined> = {};+ const processedOAuth: Record<string, boolean | string | string[] | undefined> = {};for (const [key, originalValue] of Object.entries(newObj.oauth)) {// Only process string values for environment variables// token_exchange_method is an enum and shouldn't be processed@@ -255,7 +255,7 @@ export function processMCPEnv(params: {*/export function resolveHeaders(options?: {headers: Record<string, string> | undefined;- user?: Partial<TUser> | { id: string };+ user?: Partial<IUser> | { id: string };body?: RequestBody;customUserVars?: Record<string, string>;}) {@@ -269,7 +269,7 @@ export function resolveHeaders(options?: {resolvedHeaders[key] = processSingleValue({originalValue: inputHeaders[key],customUserVars,- user: user as TUser,+ user: user as IUser,body,});});diff --git a/packages/api/src/utils/oidc.ts b/packages/api/src/utils/oidc.tsindex fb16cdf16f..9c0ac478fd 100644--- a/packages/api/src/utils/oidc.ts+++ b/packages/api/src/utils/oidc.ts@@ -1,5 +1,4 @@import { logger } from '@librechat/data-schemas';-import type { TUser } from 'librechat-data-provider';import type { IUser } from '@librechat/data-schemas';export interface OpenIDTokenInfo {@@ -35,9 +34,7 @@ const OPENID_TOKEN_FIELDS = ['EXPIRES_AT',] as const;-export function extractOpenIDTokenInfo(- user: IUser | TUser | null | undefined,-): OpenIDTokenInfo | null {+export function extractOpenIDTokenInfo(user: IUser | null | undefined): OpenIDTokenInfo | null {if (!user) {logger.debug('[extractOpenIDTokenInfo] No user provided');return null;