diff --git a/dependency_range_tests/docker-compose.yml b/dependency_range_tests/docker-compose.yml index 901857169738..538068eca709 100644 --- a/dependency_range_tests/docker-compose.yml +++ b/dependency_range_tests/docker-compose.yml @@ -9,6 +9,7 @@ services: working_dir: /app volumes: - ../libs/langchain:/langchain + - ../libs/langchain-core:/libs/langchain-core - ../libs/langchain-textsplitters:/libs/langchain-textsplitters - ../libs/providers/langchain-openai:/libs/langchain-openai - ../libs/providers/langchain-anthropic:/libs/langchain-anthropic diff --git a/dependency_range_tests/scripts/langchain/node/update_resolutions_latest.js b/dependency_range_tests/scripts/langchain/node/update_resolutions_latest.js index 604d130f8eb1..222a7ccae24e 100644 --- a/dependency_range_tests/scripts/langchain/node/update_resolutions_latest.js +++ b/dependency_range_tests/scripts/langchain/node/update_resolutions_latest.js @@ -27,11 +27,10 @@ const workspaceDependencies = [ for (const [depName, depVersion] of workspaceDependencies) { /** - * for the peer dependency @langchain/core, we want to make sure to install max version - * defined above + * for the peer dependency @langchain/core, we will link to the workspace dependency */ if (depName === "@langchain/core") { - delete currentPackageJson.devDependencies[depName]; + currentPackageJson.devDependencies[depName] = `file:/libs/langchain-core`; continue; } diff --git a/dependency_range_tests/scripts/langchain/node/update_resolutions_lowest.js b/dependency_range_tests/scripts/langchain/node/update_resolutions_lowest.js index 3095ee66fc2c..08f6eda693a6 100644 --- a/dependency_range_tests/scripts/langchain/node/update_resolutions_lowest.js +++ b/dependency_range_tests/scripts/langchain/node/update_resolutions_lowest.js @@ -17,10 +17,21 @@ if ( const minVersion = semver.minVersion( currentPackageJson.peerDependencies["@langchain/core"] ).version; - currentPackageJson.peerDependencies = { - ...currentPackageJson.peerDependencies, - "@langchain/core": minVersion, - }; + + // Check if the minimum version matches the workspace version + const corePackageJsonPath = "/libs/langchain-core/package.json"; + const corePackageJson = JSON.parse(fs.readFileSync(corePackageJsonPath)); + + if (corePackageJson.version === minVersion) { + currentPackageJson.pnpm.overrides[ + "@langchain/core" + ] = `file:/libs/langchain-core`; + } else { + currentPackageJson.peerDependencies = { + ...currentPackageJson.peerDependencies, + "@langchain/core": minVersion, + }; + } } /** diff --git a/examples/src/createAgent/middleware/promptCaching.ts b/examples/src/createAgent/middleware/promptCaching.ts index 5a4a7862fb25..4b671d1cfe57 100644 --- a/examples/src/createAgent/middleware/promptCaching.ts +++ b/examples/src/createAgent/middleware/promptCaching.ts @@ -1,11 +1,16 @@ -import { createAgent, HumanMessage, AIMessage } from "langchain"; -import { anthropicPromptCachingMiddleware } from "langchain"; +import { + createAgent, + HumanMessage, + AIMessage, + type AgentMiddleware, +} from "langchain"; +import { promptCachingMiddleware } from "@langchain/anthropic"; // Example usage const agent = createAgent({ model: "anthropic:claude-sonnet-4-20250514", tools: [], - middleware: [anthropicPromptCachingMiddleware({ ttl: "5m" })] as const, + middleware: [promptCachingMiddleware({ ttl: "5m" }) as AgentMiddleware], }); // Usage example with a long chat history for testing caching diff --git a/libs/langchain-classic/package.json b/libs/langchain-classic/package.json index 42bb5b5d9919..53f87c77e9bc 100644 --- a/libs/langchain-classic/package.json +++ b/libs/langchain-classic/package.json @@ -119,7 +119,7 @@ "lunary": "^0.8.8", "mariadb": "^3.4.0", "mem0ai": "^2.1.8", - "mongodb": "^6.17.0", + "mongodb": "^6.20.0", "openai": "^5.1.0", "peggy": "^3.0.2", "pg": "^8.16.3", @@ -1230,4 +1230,4 @@ }, "./package.json": "./package.json" } -} \ No newline at end of file +} diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index e55dc4876a85..70a14ae7c200 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -172,7 +172,7 @@ "mammoth": "^1.6.0", "mariadb": "^3.4.0", "mem0ai": "^2.1.8", - "mongodb": "^6.17.0", + "mongodb": "^6.20.0", "mysql2": "^3.9.8", "neo4j-driver": "^5.17.0", "node-llama-cpp": "3.1.1", @@ -3435,4 +3435,4 @@ "files": [ "dist/" ] -} \ No newline at end of file +} diff --git a/libs/langchain-core/package.json b/libs/langchain-core/package.json index 832e44793790..935f6a143ffd 100644 --- a/libs/langchain-core/package.json +++ b/libs/langchain-core/package.json @@ -319,6 +319,17 @@ }, "input": "./src/memory.ts" }, + "./middleware": { + "require": { + "types": "./dist/middleware/index.d.cts", + "default": "./dist/middleware/index.cjs" + }, + "import": { + "types": "./dist/middleware/index.d.ts", + "default": "./dist/middleware/index.js" + }, + "input": "./src/middleware/index.ts" + }, "./messages": { "require": { "types": "./dist/messages/index.d.cts", @@ -720,4 +731,4 @@ "files": [ "dist/" ] -} \ No newline at end of file +} diff --git a/libs/langchain-core/src/load/import_map.ts b/libs/langchain-core/src/load/import_map.ts index 2a729f5fbd0c..9956aebca788 100644 --- a/libs/langchain-core/src/load/import_map.ts +++ b/libs/langchain-core/src/load/import_map.ts @@ -21,6 +21,7 @@ export * as language_models__chat_models from "../language_models/chat_models.js export * as language_models__llms from "../language_models/llms.js"; export * as load__serializable from "../load/serializable.js"; export * as memory from "../memory.js"; +export * as middleware from "../middleware/index.js"; export * as messages from "../messages/index.js"; export * as messages__tool from "../messages/tool.js"; export * as output_parsers from "../output_parsers/index.js"; diff --git a/libs/langchain-core/src/middleware/README.md b/libs/langchain-core/src/middleware/README.md new file mode 100644 index 000000000000..94d0d8106fdd --- /dev/null +++ b/libs/langchain-core/src/middleware/README.md @@ -0,0 +1,369 @@ +# Middleware Primitives + +This document describes the core middleware primitives provided by `@langchain/core/middleware` that power the LangChain agents framework. + +## Overview + +Middleware allows you to hook into the agent lifecycle to add custom behavior like logging, caching, human-in-the-loop approval, rate limiting, and more. The middleware system provides: + +## Creating Middleware + +### `createMiddleware(config)` + +Factory function to create middleware with automatic type inference from Zod schemas. + +```typescript +import { createMiddleware } from "@langchain/core/middleware"; +import { z } from "zod"; + +const myMiddleware = createMiddleware({ + name: "MyMiddleware", + + // Optional: Define persisted state + stateSchema: z.object({ + count: z.number().default(0), + }), + + // Optional: Define per-invocation context + contextSchema: z.object({ + userId: z.string(), + }), + + // Optional: Lifecycle hooks + beforeAgent: async (state, runtime) => { + /* ... */ + }, + beforeModel: async (state, runtime) => { + /* ... */ + }, + afterModel: async (state, runtime) => { + /* ... */ + }, + afterAgent: async (state, runtime) => { + /* ... */ + }, + + // Optional: Request interception + wrapModelCall: async (request, handler) => { + /* ... */ + }, + wrapToolCall: async (request, handler) => { + /* ... */ + }, + + // Optional: Additional tools + tools: [myTool], + + // Optional: Control flow restrictions + afterModelJumpTo: ["model", "tools", "end"], +}); +``` + +**Configuration:** + +- `name` - Unique identifier (required) +- `stateSchema` - Zod schema for state that persists across invocations +- `contextSchema` - Zod schema for read-only per-invocation context +- `beforeAgent/Model/AfterModel/Agent` - Lifecycle hooks +- `wrapModelCall/wrapToolCall` - Request interceptors +- `tools` - Additional tools to register +- `*JumpTo` - Allowed control flow targets for each hook + +## Core Interfaces + +### `AgentMiddleware` + +The primary interface representing a middleware instance. Returned by `createMiddleware()` and accepted by `createAgent()`. + +### `AgentBuiltInState` + +Base state properties available to all agents: + +- `messages: BaseMessage[]` - Conversation history +- `structuredResponse?: Record` - Output when responseFormat is configured + +All middleware state extends this built-in state. + +### `MiddlewareResult` + +Return type for lifecycle hooks. Return partial state updates or `void`: + +```typescript +// Update state +return { myProperty: newValue }; + +// No updates +return; +``` + +## Lifecycle Hooks + +Middleware can hook into four key points in the agent execution: + +### `beforeAgent(state, runtime)` + +**When:** Once at the start of agent execution, before any model calls + +**Use cases:** + +- Initialize middleware state +- Validate input messages +- Early routing decisions + +```typescript +beforeAgent: async (state, runtime) => { + console.log("Agent starting"); + return { initialized: true }; +}; +``` + +### `beforeModel(state, runtime)` + +**When:** Before each model invocation (may be called multiple times) + +**Use cases:** + +- Modify messages before model sees them +- Add dynamic context +- Check rate limits + +```typescript +beforeModel: async (state, runtime) => { + // Add timestamp to messages + const lastMsg = state.messages[state.messages.length - 1]; + lastMsg.additional_kwargs.timestamp = Date.now(); +}; +``` + +### `afterModel(state, runtime)` + +**When:** After model responds, before tool execution + +**Use cases:** + +- Intercept tool calls (e.g., for human approval) +- Modify tool arguments +- Implement control flow jumps + +```typescript +afterModel: async (state, runtime) => { + const lastMsg = state.messages[state.messages.length - 1]; + if (lastMsg.tool_calls?.length > 10) { + throw new Error("Too many tool calls"); + } +}; +``` + +### `afterAgent(state, runtime)` + +**When:** Once after agent completes execution + +**Use cases:** + +- Cleanup operations +- Final logging +- Metrics collection + +```typescript +afterAgent: async (state, runtime) => { + console.log(`Agent completed in ${runtime.runModelCallCount} calls`); +}; +``` + +## Request Interception + +### `wrapModelCall(request, handler)` + +Intercept and modify model invocations. The request contains: + +- `model` - The language model +- `messages` - Messages to send +- `systemPrompt` - System message +- `toolChoice` - Tool selection strategy +- `tools` - Available tools +- `state` - Current agent state +- `runtime` - Runtime context + +```typescript +wrapModelCall: async (request, handler) => { + // Modify the request + const modifiedRequest = { + ...request, + systemPrompt: "You are a helpful assistant", + }; + + // Call the model + try { + return await handler(modifiedRequest); + } catch (error) { + // Fallback to different model + return await handler({ ...request, model: fallbackModel }); + } +}; +``` + +### `wrapToolCall(request, handler)` + +Intercept and modify tool executions. The request contains: + +- `toolCall` - The tool call (id, name, args) +- `tool` - The BaseTool instance +- `state` - Current agent state +- `runtime` - Runtime context + +```typescript +wrapToolCall: async (request, handler) => { + console.log(`Calling ${request.toolCall.name}`); + + // Check permissions + if (!isAuthorized(request.toolCall.name)) { + return new ToolMessage({ + content: "Unauthorized", + tool_call_id: request.toolCall.id, + }); + } + + // Execute the tool + return await handler(request); +}; +``` + +## State and Context + +### State (`stateSchema`) + +**Persisted** data that survives across agent invocations: + +```typescript +stateSchema: z.object({ + totalCalls: z.number().default(0), + cache: z.record(z.any()).default({}), +}); +``` + +- Checkpointed with agent state +- Mutable via hook return values +- Use for: counters, caches, accumulated data + +### Context (`contextSchema`) + +**Read-only** data provided at invocation time: + +```typescript +contextSchema: z.object({ + userId: z.string(), + features: z.array(z.string()).optional() +}) + +// Usage +await agent.invoke( + { messages: [...] }, + { context: { userId: "123", features: ["premium"] } } +); +``` + +- Not persisted between runs +- Fresh for each invocation +- Use for: user preferences, request metadata, feature flags + +### Private Properties + +Prefix property names with `_` to make them private (not exposed to user): + +```typescript +stateSchema: z.object({ + publicCount: z.number(), + _internalCache: z.record(z.any()), // Not part of user-facing type +}); +``` + +## Runtime + +The `runtime` parameter passed to hooks provides access to: + +### Context Access + +```typescript +runtime.context.userId; // From contextSchema +runtime.context.features; +``` + +### Metrics + +```typescript +runtime.runModelCallCount; // Calls in current run +runtime.threadLevelCallCount; // Calls across all runs in thread +``` + +### LangGraph Primitives + +```typescript +runtime.configurable.thread_id; // Thread identifier +runtime.interrupt(data); // Pause for user input +runtime.writer; // Stream updates +runtime.signal; // Abort signal +``` + +## Control Flow + +### Jump Targets: `JumpToTarget` + +Redirect agent execution from hooks using the `jumpTo` state property: + +- `"model"` - Jump back to model for another LLM call +- `"tools"` - Jump to tool execution (requires tool calls) +- `"end"` - End agent execution + +```typescript +afterModel: async (state, runtime) => { + if (shouldRetry) { + return { jumpTo: "model" }; // Call model again + } +}; +``` + +### Declaring Allowed Jumps + +Restrict which jumps are allowed from each hook: + +```typescript +createMiddleware({ + name: "RetryMiddleware", + afterModelJumpTo: ["model"], // Only allow jumping back to model + afterModel: async (state, runtime) => { + if (needsRetry) { + return { jumpTo: "model" }; // Allowed + } + // return { jumpTo: "end" }; // Would throw error + }, +}); +``` + +## Type Inference + +The middleware system provides helper types to extract state and context types from middleware arrays: + +### State Inference + +```typescript +// Get output state from middleware +type MyState = InferMiddlewareState; + +// Get output state from multiple middleware +type AllStates = InferMiddlewareStates; + +// Get input state (with optional defaults) +type InputState = InferMiddlewareInputStates; +``` + +### Context Inference + +```typescript +// Get context from middleware +type MyContext = InferMiddlewareContext; + +// Get merged context from multiple middleware +type AllContexts = InferMiddlewareContextInputs; +``` + +These types are automatically used by the agent to provide type-safe invocation. diff --git a/libs/langchain-core/src/middleware/constants.ts b/libs/langchain-core/src/middleware/constants.ts new file mode 100644 index 000000000000..be3971dda85f --- /dev/null +++ b/libs/langchain-core/src/middleware/constants.ts @@ -0,0 +1,9 @@ +/** + * jump targets (user facing) + * @internal + */ +export const JUMP_TO_TARGETS = ["model", "tools", "end"] as const; +/** + * @internal + */ +export type JumpToTarget = (typeof JUMP_TO_TARGETS)[number]; diff --git a/libs/langchain-core/src/middleware/index.ts b/libs/langchain-core/src/middleware/index.ts new file mode 100644 index 000000000000..a5620c51b91d --- /dev/null +++ b/libs/langchain-core/src/middleware/index.ts @@ -0,0 +1,4 @@ +export * from "./constants.js"; +export * from "./middleware.js"; +export type * from "./types.js"; +export type * from "./runtime.js"; diff --git a/libs/langchain-core/src/middleware/middleware.ts b/libs/langchain-core/src/middleware/middleware.ts new file mode 100644 index 000000000000..55d1db788670 --- /dev/null +++ b/libs/langchain-core/src/middleware/middleware.ts @@ -0,0 +1,398 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import type { + InteropZodObject, + InteropZodDefault, + InteropZodOptional, + InferInteropZodInput, + InferInteropZodOutput, +} from "../utils/types/index.js"; +import type { AIMessage, ToolMessage } from "../messages/index.js"; + +import type { JumpToTarget } from "./constants.js"; +import type { ClientTool, ServerTool } from "../tools/index.js"; +import type { BaseRuntime as Runtime } from "./runtime.js"; +import type { + AgentBuiltInState, + AgentMiddleware, + MiddlewareResult, + ToolCallRequest, + ToolCallHandler, + ModelRequest, +} from "./types.js"; +/** + * @internal + */ +export function createMiddleware< + TSchema extends InteropZodObject | undefined = undefined, + TContextSchema extends + | InteropZodObject + | InteropZodOptional + | InteropZodDefault + | undefined = undefined, + Command = void +>(config: { + /** + * The name of the middleware + */ + name: string; + /** + * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either: + * - A Zod object + * - A Zod optional object + * - A Zod default object + * - Undefined + */ + stateSchema?: TSchema; + /** + * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either: + * - A Zod object + * - A Zod optional object + * - A Zod default object + * - Undefined + */ + contextSchema?: TContextSchema; + /** + * Explitictly defines which targets are allowed to be jumped to from the `beforeAgent` hook. + */ + beforeAgentJumpTo?: JumpToTarget[]; + /** + * Explitictly defines which targets are allowed to be jumped to from the `beforeModel` hook. + */ + beforeModelJumpTo?: JumpToTarget[]; + /** + * Explitictly defines which targets are allowed to be jumped to from the `afterModel` hook. + */ + afterModelJumpTo?: JumpToTarget[]; + /** + * Explitictly defines which targets are allowed to be jumped to from the `afterAgent` hook. + */ + afterAgentJumpTo?: JumpToTarget[]; + /** + * Additional tools registered by the middleware. + */ + tools?: (ClientTool | ServerTool)[]; + /** + * Wraps tool execution with custom logic. This allows you to: + * - Modify tool call parameters before execution + * - Handle errors and retry with different parameters + * - Post-process tool results + * - Implement caching, logging, authentication, or other cross-cutting concerns + * - Return Command objects for advanced control flow + * + * The handler receives a ToolCallRequest containing the tool call, state, and runtime, + * along with a handler function to execute the actual tool. + * + * @param request - The tool call request containing toolCall, state, and runtime. + * @param handler - The function that executes the tool. Call this with a ToolCall to get the result. + * @returns The tool result as a ToolMessage or a Command for advanced control flow. + * + * @example + * ```ts + * wrapToolCall: async (request, handler) => { + * console.log(`Calling tool: ${request.tool.name}`); + * console.log(`Tool description: ${request.tool.description}`); + * + * try { + * // Execute the tool + * const result = await handler(request.toolCall); + * console.log(`Tool ${request.tool.name} succeeded`); + * return result; + * } catch (error) { + * console.error(`Tool ${request.tool.name} failed:`, error); + * // Could return a custom error message or retry + * throw error; + * } + * } + * ``` + * + * @example Authentication + * ```ts + * wrapToolCall: async (request, handler) => { + * // Check if user is authorized for this tool + * if (!request.runtime.context.isAuthorized(request.tool.name)) { + * return new ToolMessage({ + * content: "Unauthorized to call this tool", + * tool_call_id: request.toolCall.id, + * }); + * } + * return handler(request.toolCall); + * } + * ``` + */ + wrapToolCall?: ( + request: ToolCallRequest< + (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & + AgentBuiltInState, + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + >, + handler: ToolCallHandler< + Command, + (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & + AgentBuiltInState, + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + > + ) => Promise | ToolMessage | Command; + /** + * Wraps the model invocation with custom logic. This allows you to: + * - Modify the request before calling the model + * - Handle errors and retry with different parameters + * - Post-process the response + * - Implement custom caching, logging, or other cross-cutting concerns + * + * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime. + * + * @param request - The model request containing all the parameters needed. + * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response. + * @returns The response from the model (or a modified version). + * + * @example + * ```ts + * wrapModelCall: async (request, handler) => { + * // Modify request before calling + * const modifiedRequest = { ...request, systemPrompt: "You are helpful" }; + * + * try { + * // Call the model + * return await handler(modifiedRequest); + * } catch (error) { + * // Handle errors and retry with fallback + * const fallbackRequest = { ...request, model: fallbackModel }; + * return await handler(fallbackRequest); + * } + * } + * ``` + */ + wrapModelCall?: ( + request: ModelRequest< + (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & + AgentBuiltInState, + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + >, + handler: ( + request: ModelRequest< + (TSchema extends InteropZodObject + ? InferInteropZodInput + : {}) & + AgentBuiltInState, + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + > + ) => Promise | AIMessage + ) => Promise | AIMessage; + /** + * The function to run before the agent execution starts. This function is called once at the start of the agent invocation. + * It allows to modify the state of the agent before any model calls or tool executions. + * + * @param state - The middleware state + * @param runtime - The middleware runtime + * @returns The modified middleware state or undefined to pass through + */ + beforeAgent?: ( + state: (TSchema extends InteropZodObject + ? InferInteropZodInput + : {}) & + AgentBuiltInState, + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + ) => + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; + /** + * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook. + * It allows to modify the state of the agent. + * + * @param state - The middleware state + * @param runtime - The middleware runtime + * @returns The modified middleware state or undefined to pass through + */ + beforeModel?: ( + state: (TSchema extends InteropZodObject + ? InferInteropZodInput + : {}) & + AgentBuiltInState, + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + ) => + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; + /** + * The function to run after the model call. This function is called after the model is invoked and before any tools are called. + * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters. + * + * @param state - The middleware state + * @param runtime - The middleware runtime + * @returns The modified middleware state or undefined to pass through + */ + afterModel?: ( + state: (TSchema extends InteropZodObject + ? InferInteropZodInput + : {}) & + AgentBuiltInState, + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + ) => + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; + /** + * The function to run after the agent execution completes. This function is called once at the end of the agent invocation. + * It allows to modify the final state of the agent after all model calls and tool executions are complete. + * + * @param state - The middleware state + * @param runtime - The middleware runtime + * @returns The modified middleware state or undefined to pass through + */ + afterAgent?: ( + state: (TSchema extends InteropZodObject + ? InferInteropZodInput + : {}) & + AgentBuiltInState, + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > + ) => + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; +}): AgentMiddleware { + const middleware: AgentMiddleware = { + name: config.name, + stateSchema: config.stateSchema, + contextSchema: config.contextSchema, + beforeAgentJumpTo: config.beforeAgentJumpTo, + beforeModelJumpTo: config.beforeModelJumpTo, + afterModelJumpTo: config.afterModelJumpTo, + afterAgentJumpTo: config.afterAgentJumpTo, + tools: config.tools ?? [], + }; + + if (config.wrapToolCall) { + middleware.wrapToolCall = config.wrapToolCall; + } + + if (config.wrapModelCall) { + middleware.wrapModelCall = config.wrapModelCall; + } + + if (config.beforeAgent) { + middleware.beforeAgent = config.beforeAgent; + } + + if (config.beforeModel) { + middleware.beforeModel = config.beforeModel; + } + + if (config.afterModel) { + middleware.afterModel = config.afterModel; + } + + if (config.afterAgent) { + middleware.afterAgent = config.afterAgent; + } + + return middleware; +} diff --git a/libs/langchain-core/src/middleware/runtime.ts b/libs/langchain-core/src/middleware/runtime.ts new file mode 100644 index 000000000000..b2b3fdb4be25 --- /dev/null +++ b/libs/langchain-core/src/middleware/runtime.ts @@ -0,0 +1,83 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import type { + InteropZodDefault, + InteropZodOptional, +} from "../utils/types/index.js"; + +/** + * Type helper to check if TContext is an optional Zod schema + */ +type IsOptionalZodObject = T extends InteropZodOptional ? true : false; +type IsDefaultZodObject = T extends InteropZodDefault ? true : false; + +/** + * @internal + */ +export type WithMaybeContext = undefined extends TContext + ? { readonly context?: TContext } + : IsOptionalZodObject extends true + ? { readonly context?: TContext } + : IsDefaultZodObject extends true + ? { readonly context?: TContext } + : { readonly context: TContext }; + +/** + * Base runtime interface that can be extended by framework-specific runtime types. + * This empty interface serves as a fallback when no specific runtime is available. + * + * @internal + */ +export interface IBaseRuntime {} + +/** + * Runtime information available to middleware (readonly). + * + * @internal + * @template TContext - The context type for middleware + * @template BaseRuntime - The framework-specific runtime type (defaults to empty IBaseRuntime) + */ +export type BaseRuntime< + TContext = unknown, + BaseRuntime = IBaseRuntime +> = Partial> & + WithMaybeContext & + PrivateState & { + configurable?: { + thread_id?: string; + [key: string]: unknown; + }; + }; + +/** + * @internal + */ +export interface RunLevelPrivateState { + /** + * The number of times the model has been called at the run level. + * This includes multiple agent invocations. + */ + runModelCallCount: number; +} + +/** + * @internal + */ +export interface ThreadLevelPrivateState { + /** + * The number of times the model has been called at the thread level. + * This includes multiple agent invocations within different environments + * using the same thread. + */ + threadLevelCallCount: number; +} + +/** + * As private state we consider all information we want to track within + * the lifecycle of the agent, without exposing it to the user. These informations + * are propagated to the user as _readonly_ runtime properties. + * + * @internal + */ +export interface PrivateState + extends ThreadLevelPrivateState, + RunLevelPrivateState {} diff --git a/libs/langchain/src/agents/middleware/types.ts b/libs/langchain-core/src/middleware/types.ts similarity index 54% rename from libs/langchain/src/agents/middleware/types.ts rename to libs/langchain-core/src/middleware/types.ts index 0680989e961f..74252728172d 100644 --- a/libs/langchain/src/agents/middleware/types.ts +++ b/libs/langchain-core/src/middleware/types.ts @@ -1,36 +1,117 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import type { InteropZodObject, + InferInteropZodOutput, + InferInteropZodInput, InteropZodDefault, InteropZodOptional, - InferInteropZodInput, - InferInteropZodOutput, -} from "@langchain/core/utils/types"; -import type { AnnotationRoot } from "@langchain/langgraph"; -import type { InteropZodToStateDefinition } from "@langchain/langgraph/zod"; -import type { AIMessage, ToolMessage } from "@langchain/core/messages"; -import type { ToolCall } from "@langchain/core/messages/tool"; -import type { Command } from "@langchain/langgraph"; +} from "../utils/types/index.js"; +import type { LanguageModelLike } from "../language_models/base.js"; +import type { BaseMessage, AIMessage, ToolMessage } from "../messages/index.js"; +import type { JumpToTarget } from "./constants.js"; +import type { ClientTool, ServerTool } from "../tools/index.js"; +import type { BaseRuntime as Runtime } from "./runtime.js"; + +/** + * Configuration for modifying a model call at runtime. + * All fields are optional and only provided fields will override defaults. + * + * @internal + * @template TState - The agent's state type, must extend Record. Defaults to Record. + * @template TRuntime - The runtime type. Defaults to Runtime. + */ +export interface ModelRequest< + TState extends Record = Record, + TRuntime = Runtime +> { + /** + * The model to use for this step. + */ + model: LanguageModelLike; + /** + * The messages to send to the model. + */ + messages: BaseMessage[]; + /** + * The system message for this step. + */ + systemPrompt?: string; + /** + * Tool choice configuration (model-specific format). + * Can be one of: + * - `"auto"`: means the model can pick between generating a message or calling one or more tools. + * - `"none"`: means the model will not call any tool and instead generates a message. + * - `"required"`: means the model must call one or more tools. + * - `{ type: "function", function: { name: string } }`: The model will use the specified function. + */ + toolChoice?: + | "auto" + | "none" + | "required" + | { type: "function"; function: { name: string } }; + + /** + * The tools to make available for this step. + */ + tools: (ServerTool | ClientTool)[]; -import type { JumpToTarget } from "../constants.js"; -import type { ClientTool, ServerTool } from "../tools.js"; -import type { Runtime, AgentBuiltInState } from "../runtime.js"; -import type { ModelRequest } from "../nodes/types.js"; + /** + * The current agent state (includes both middleware state and built-in state). + */ + state: TState & AgentBuiltInState; + + /** + * The runtime context containing metadata, signal, writer, interrupt, etc. + */ + runtime: TRuntime; +} -export type AnyAnnotationRoot = AnnotationRoot; +/** + * Information about a tool call that has been executed. + * + * @internal + */ +export interface ToolCall { + /** + * The ID of the tool call. + */ + id: string; + /** + * The name of the tool that was called. + */ + name: string; + /** + * The arguments that were passed to the tool. + */ + args: Record; + /** + * The result of the tool call. + */ + result?: unknown; + /** + * An optional error message if the tool call failed. + */ + error?: string; +} /** * Result type for middleware functions. + * + * @internal */ export type MiddlewareResult = TState | void; /** * Represents a tool call request for the wrapToolCall hook. * Contains the tool call information along with the agent's current state and runtime. + * + * @template TState - The agent's state type, must extend Record. Defaults to Record. + * @template TRuntime - The runtime type. Defaults to Runtime. + * @internal */ export interface ToolCallRequest< TState extends Record = Record, - TContext = unknown + TRuntime = Runtime > { /** * The tool call to be executed @@ -48,31 +129,39 @@ export interface ToolCallRequest< /** * The runtime context containing metadata, signal, writer, interrupt, etc. */ - runtime: Runtime; + runtime: TRuntime; } /** * Handler function type for wrapping tool calls. * Takes a tool call and returns the tool result or a command. + * @internal */ -export type ToolCallHandler = ( - toolCall: ToolCall +export type ToolCallHandler< + Command, + TState extends Record = Record, + TRuntime = Runtime +> = ( + request: ToolCallRequest ) => Promise | ToolMessage | Command; /** * Wrapper function type for the wrapToolCall hook. * Allows middleware to intercept and modify tool execution. + * @internal */ export type ToolCallWrapper< + Command, TState extends Record = Record, - TContext = unknown + TRuntime = Runtime > = ( - request: ToolCallRequest, - handler: ToolCallHandler + request: ToolCallRequest, + handler: ToolCallHandler ) => Promise | ToolMessage | Command; /** * Base middleware interface. + * @internal */ export interface AgentMiddleware< TSchema extends InteropZodObject | undefined = any, @@ -80,8 +169,7 @@ export interface AgentMiddleware< | InteropZodObject | InteropZodDefault | InteropZodOptional - | undefined = any, - TFullContext = any + | undefined = any > { stateSchema?: TSchema; contextSchema?: TContextSchema; @@ -154,9 +242,18 @@ export interface AgentMiddleware< * ``` */ wrapToolCall?: ToolCallWrapper< + any, (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & AgentBuiltInState, - TFullContext + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > >; /** * Wraps the model invocation with custom logic. This allows you to: @@ -173,11 +270,11 @@ export interface AgentMiddleware< * ```ts * wrapModelCall: async (request, handler) => { * // Modify request before calling - * const modifiedRequest = { ...request, systemPrompt: "You are helpful" }; + * const modifiedCall = { ...request, systemPrompt: "You are helpful" }; * * try { * // Call the model - * return await handler(modifiedRequest); + * return await handler(modifiedCall); * } catch (error) { * // Handle errors and retry with fallback * const fallbackRequest = { ...request, model: fallbackModel }; @@ -190,7 +287,15 @@ export interface AgentMiddleware< request: ModelRequest< (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & AgentBuiltInState, - TFullContext + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > >, handler: ( request: ModelRequest< @@ -198,7 +303,15 @@ export interface AgentMiddleware< ? InferInteropZodInput : {}) & AgentBuiltInState, - TFullContext + Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > > ) => Promise | AIMessage ): Promise | AIMessage; @@ -207,55 +320,152 @@ export interface AgentMiddleware< ? InferInteropZodInput : {}) & AgentBuiltInState, - runtime: Runtime - ): Promise< - MiddlewareResult< - Partial< - TSchema extends InteropZodObject ? InferInteropZodInput : {} - > + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never > - >; + ): + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; beforeModel?( state: (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & AgentBuiltInState, - runtime: Runtime - ): Promise< - MiddlewareResult< - Partial< - TSchema extends InteropZodObject ? InferInteropZodInput : {} - > + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never > - >; + ): + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; afterModel?( state: (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & AgentBuiltInState, - runtime: Runtime - ): Promise< - MiddlewareResult< - Partial< - TSchema extends InteropZodObject ? InferInteropZodInput : {} - > + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never > - >; + ): + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; afterAgent?( state: (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & AgentBuiltInState, - runtime: Runtime - ): Promise< - MiddlewareResult< - Partial< - TSchema extends InteropZodObject ? InferInteropZodInput : {} - > + runtime: Runtime< + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never > - >; + ): + | Promise< + MiddlewareResult< + Partial< + TSchema extends InteropZodObject + ? InferInteropZodInput + : {} + > + > + > + | MiddlewareResult< + Partial< + TSchema extends InteropZodObject ? InferInteropZodInput : {} + > + >; } +/** + * Type for the agent's built-in state properties. + * @internal + */ +export type AgentBuiltInState = { + /** + * Array of messages representing the conversation history. + * + * This includes all messages exchanged during the agent's execution: + * - Human messages: Input from the user + * - AI messages: Responses from the language model + * - Tool messages: Results from tool executions + * - System messages: System-level instructions or information + * + * Messages are accumulated throughout the agent's lifecycle and can be + * accessed or modified by middleware hooks during execution. + */ + messages: BaseMessage[]; + /** + * Structured response data returned by the agent when a `responseFormat` is configured. + * + * This property is only populated when you provide a `responseFormat` schema + * (as Zod or JSON schema) to the agent configuration. The agent will format + * its final output to match the specified schema and store it in this property. + * + * Note: The type is specified as `Record` because TypeScript cannot + * infer the actual response format type in contexts like middleware, where the agent's + * generic type parameters are not accessible. You may need to cast this to your specific + * response type when accessing it. + */ + structuredResponse?: Record; +}; + /** * Helper type to filter out properties that start with underscore (private properties) */ @@ -266,9 +476,10 @@ type FilterPrivateProps = { /** * Helper type to infer the state schema type from a middleware * This filters out private properties (those starting with underscore) + * @internal */ export type InferMiddlewareState = - T extends AgentMiddleware + T extends AgentMiddleware ? S extends InteropZodObject ? FilterPrivateProps> : {} @@ -277,9 +488,10 @@ export type InferMiddlewareState = /** * Helper type to infer the input state schema type from a middleware (all properties optional) * This filters out private properties (those starting with underscore) + * @internal */ export type InferMiddlewareInputState = - T extends AgentMiddleware + T extends AgentMiddleware ? S extends InteropZodObject ? FilterPrivateProps> : {} @@ -287,6 +499,7 @@ export type InferMiddlewareInputState = /** * Helper type to infer merged state from an array of middleware (just the middleware states) + * @internal */ export type InferMiddlewareStates = T extends readonly [] ? {} @@ -300,6 +513,7 @@ export type InferMiddlewareStates = T extends readonly [] /** * Helper type to infer merged input state from an array of middleware (with optional defaults) + * @internal */ export type InferMiddlewareInputStates = T extends readonly [] @@ -314,21 +528,24 @@ export type InferMiddlewareInputStates = /** * Helper type to infer merged state from an array of middleware (includes built-in state) + * @internal */ export type InferMergedState = InferMiddlewareStates & AgentBuiltInState; /** * Helper type to infer merged input state from an array of middleware (includes built-in state) + * @internal */ export type InferMergedInputState = InferMiddlewareInputStates & AgentBuiltInState; /** * Helper type to infer the context schema type from a middleware + * @internal */ export type InferMiddlewareContext = - T extends AgentMiddleware + T extends AgentMiddleware ? C extends InteropZodObject ? InferInteropZodInput : {} @@ -336,9 +553,10 @@ export type InferMiddlewareContext = /** * Helper type to infer the input context schema type from a middleware (with optional defaults) + * @internal */ export type InferMiddlewareContextInput = - T extends AgentMiddleware + T extends AgentMiddleware ? C extends InteropZodOptional ? InferInteropZodInput | undefined : C extends InteropZodObject @@ -348,6 +566,7 @@ export type InferMiddlewareContextInput = /** * Helper type to infer merged context from an array of middleware + * @internal */ export type InferMiddlewareContexts = T extends readonly [] @@ -377,6 +596,7 @@ type MergeContextTypes = [A] extends [undefined] /** * Helper type to infer merged input context from an array of middleware (with optional defaults) + * @internal */ export type InferMiddlewareContextInputs = T extends readonly [] @@ -391,21 +611,3 @@ export type InferMiddlewareContextInputs = : InferMiddlewareContextInput : {} : {}; - -/** - * Helper type to extract input type from context schema (with optional defaults) - */ -export type InferContextInput< - ContextSchema extends AnyAnnotationRoot | InteropZodObject -> = ContextSchema extends InteropZodObject - ? InferInteropZodInput - : ContextSchema extends AnyAnnotationRoot - ? ToAnnotationRoot["State"] - : {}; - -export type ToAnnotationRoot = - A extends AnyAnnotationRoot - ? A - : A extends InteropZodObject - ? AnnotationRoot> - : never; diff --git a/libs/langchain-core/src/tools/index.ts b/libs/langchain-core/src/tools/index.ts index 43d2b9d94de6..7104d14b0da9 100644 --- a/libs/langchain-core/src/tools/index.ts +++ b/libs/langchain-core/src/tools/index.ts @@ -17,7 +17,7 @@ import { pickRunnableConfigKeys, type RunnableConfig, } from "../runnables/config.js"; -import type { RunnableFunc } from "../runnables/base.js"; +import type { RunnableFunc, RunnableToolLike } from "../runnables/base.js"; import { isDirectToolOutput, ToolCall, ToolMessage } from "../messages/tool.js"; import { AsyncLocalStorageProviderSingleton } from "../singletons/index.js"; import { @@ -773,3 +773,9 @@ function _stringify(content: unknown): string { return `${content}`; } } + +export type ServerTool = Record; +export type ClientTool = + | StructuredToolInterface + | DynamicTool + | RunnableToolLike; diff --git a/libs/langchain/src/agents/ReactAgent.ts b/libs/langchain/src/agents/ReactAgent.ts index e15b61cd743b..5bf832fdbe33 100644 --- a/libs/langchain/src/agents/ReactAgent.ts +++ b/libs/langchain/src/agents/ReactAgent.ts @@ -18,6 +18,14 @@ import { ToolMessage, AIMessage } from "@langchain/core/messages"; import { IterableReadableStream } from "@langchain/core/utils/stream"; import type { Runnable, RunnableConfig } from "@langchain/core/runnables"; import type { StreamEvent } from "@langchain/core/tracers/log_stream"; +import type { ClientTool, ServerTool } from "@langchain/core/tools"; +import type { + PrivateState, + AgentMiddleware, + InferMiddlewareContextInputs, + InferMiddlewareStates, + InferMiddlewareInputStates, +} from "@langchain/core/middleware"; import { createAgentAnnotationConditional } from "./annotation.js"; import { @@ -38,28 +46,17 @@ import { } from "./nodes/utils.js"; import type { WithStateGraphNodes } from "./types.js"; -import type { ClientTool, ServerTool } from "./tools.js"; import type { CreateAgentParams, BuiltInState, JumpTo, UserInput, -} from "./types.js"; -import type { - PrivateState, - InvokeConfiguration, - StreamConfiguration, -} from "./runtime.js"; -import type { - AgentMiddleware, - InferMiddlewareContextInputs, - InferMiddlewareStates, - InferMiddlewareInputStates, InferContextInput, ToAnnotationRoot, AnyAnnotationRoot, -} from "./middleware/types.js"; +} from "./types.js"; +import type { InvokeConfiguration, StreamConfiguration } from "./runtime.js"; import { type ResponseFormatUndefined } from "./responses.js"; // Helper type to get the state definition with middleware states diff --git a/libs/langchain/src/agents/annotation.ts b/libs/langchain/src/agents/annotation.ts index 3f438b077d1c..00a0ee014e35 100644 --- a/libs/langchain/src/agents/annotation.ts +++ b/libs/langchain/src/agents/annotation.ts @@ -9,10 +9,10 @@ import { } from "@langchain/langgraph"; import { withLangGraph } from "@langchain/langgraph/zod"; -import type { AgentMiddleware } from "./middleware/types.js"; +import type { AgentMiddleware } from "@langchain/core/middleware"; export function createAgentAnnotationConditional< - TMiddleware extends readonly AgentMiddleware[] = [] + TMiddleware extends readonly AgentMiddleware[] = [] >( hasStructuredResponse = true, middlewareList: TMiddleware = [] as unknown as TMiddleware diff --git a/libs/langchain/src/agents/constants.ts b/libs/langchain/src/agents/constants.ts index 9118176993b2..1ff050d73c26 100644 --- a/libs/langchain/src/agents/constants.ts +++ b/libs/langchain/src/agents/constants.ts @@ -1,7 +1 @@ -/** - * jump targets (user facing) - */ -export const JUMP_TO_TARGETS = ["model", "tools", "end"] as const; -export type JumpToTarget = (typeof JUMP_TO_TARGETS)[number]; - export const PROMPT_RUNNABLE_NAME = "prompt"; diff --git a/libs/langchain/src/agents/index.ts b/libs/langchain/src/agents/index.ts index 797d21033ce0..030cd495ee1e 100644 --- a/libs/langchain/src/agents/index.ts +++ b/libs/langchain/src/agents/index.ts @@ -3,11 +3,11 @@ import type { InteropZodObject, InteropZodType, } from "@langchain/core/utils/types"; +import type { AgentMiddleware } from "@langchain/core/middleware"; import type { ResponseFormatUndefined } from "./responses.js"; import type { CreateAgentParams } from "./types.js"; -import type { AgentMiddleware, AnyAnnotationRoot } from "./middleware/types.js"; -import type { ExtractZodArrayTypes } from "./types.js"; +import type { ExtractZodArrayTypes, AnyAnnotationRoot } from "./types.js"; import type { ToolStrategy, TypedToolStrategy, @@ -330,8 +330,6 @@ export function createAgent< // Re-export types and utilities export * from "./types.js"; export * from "./errors.js"; -export type { JumpToTarget } from "./constants.js"; -export type { Runtime } from "./runtime.js"; export { toolStrategy, providerStrategy, @@ -340,11 +338,12 @@ export { type ResponseFormat, type ResponseFormatUndefined, } from "./responses.js"; -export { createMiddleware } from "./middleware.js"; -export type { - ToolCallRequest, - ToolCallHandler, - ToolCallWrapper, -} from "./middleware/types.js"; export { FakeToolCallingModel } from "./tests/utils.js"; export type { ReactAgent } from "./ReactAgent.js"; +export { type AgentMiddleware } from "@langchain/core/middleware"; + +/** + * Re-export createMiddleware from core but provide a + * typed wrapper that uses LangGraph Runtime + */ +export { createMiddleware } from "./middleware.js"; diff --git a/libs/langchain/src/agents/middleware.ts b/libs/langchain/src/agents/middleware.ts index eb4f39970f95..fd94ac1ce69f 100644 --- a/libs/langchain/src/agents/middleware.ts +++ b/libs/langchain/src/agents/middleware.ts @@ -6,21 +6,81 @@ import type { InferInteropZodInput, InferInteropZodOutput, } from "@langchain/core/utils/types"; -import type { AIMessage, ToolMessage } from "@langchain/core/messages"; +import { + createMiddleware as coreCreateMiddleware, + type AgentBuiltInState, + type AgentMiddleware, + type JumpToTarget, + type ModelRequest as CoreModelRequest, + type ToolCallRequest as CoreToolCallRequest, + type MiddlewareResult, +} from "@langchain/core/middleware"; import type { Command } from "@langchain/langgraph"; +import type { AIMessage, ToolMessage } from "@langchain/core/messages"; +import type { ClientTool, ServerTool } from "@langchain/core/tools"; +import type { Runtime } from "./types.js"; + +/** + * Configuration for modifying a model call at runtime. + * All fields are optional and only provided fields will override defaults. + * + * @template TState - The agent's state type, must extend Record. Defaults to Record. + * @template TContext - The runtime context type for accessing metadata and control flow. Defaults to unknown. + */ +export interface ModelRequest< + TState extends Record = Record, + TContext = unknown +> extends CoreModelRequest { + /** + * The runtime context containing metadata, signal, writer, interrupt, etc. + */ + runtime: Runtime; +} -import type { JumpToTarget } from "./constants.js"; -import type { ClientTool, ServerTool } from "./tools.js"; -import type { Runtime, AgentBuiltInState } from "./runtime.js"; -import type { - AgentMiddleware, - MiddlewareResult, - ToolCallRequest, - ToolCallHandler, -} from "./middleware/types.js"; -import type { ModelRequest } from "./nodes/types.js"; /** - * Creates a middleware instance with automatic schema inference. + * Represents a tool call request for the wrapToolCall hook. + * Contains the tool call information along with the agent's current state and runtime. + */ +export interface ToolCallRequest< + TState extends Record = Record, + TContext = unknown +> extends CoreToolCallRequest { + /** + * The runtime context containing metadata, signal, writer, interrupt, etc. + */ + runtime: Runtime; +} + +/** + * Handler function type for wrapping tool calls. + * Takes a tool call and returns the tool result or a command. + */ +export type ToolCallHandler< + Command, + TState extends Record = Record, + TContext = unknown +> = ( + request: ToolCallRequest +) => Promise | ToolMessage | Command; + +/** + * Wrapper function type for the wrapToolCall hook. + * Allows middleware to intercept and modify tool execution. + */ +export type ToolCallWrapper< + Command, + TState extends Record = Record, + TContext = unknown +> = ( + request: ToolCallRequest, + handler: ToolCallHandler +) => Promise | ToolMessage | Command; + +/** + * Creates a middleware instance with automatic schema inference and LangGraph Runtime support. + * + * This is a typed wrapper around the core createMiddleware that provides proper type inference + * for the LangGraph Runtime type, including properties like `interrupt`, `writer`, and `signal`. * * @param config - Middleware configuration * @param config.name - The name of the middleware @@ -36,18 +96,17 @@ import type { ModelRequest } from "./nodes/types.js"; * * @example * ```ts - * const authMiddleware = createMiddleware({ - * name: "AuthMiddleware", - * stateSchema: z.object({ - * isAuthenticated: z.boolean().default(false), - * }), - * contextSchema: z.object({ - * userId: z.string(), - * }), - * beforeModel: async (state, runtime, controls) => { - * if (!state.isAuthenticated) { - * return controls.terminate(new Error("Not authenticated")); - * } + * import { createMiddleware } from "langchain"; + * import { z } from "zod"; + * + * const hitlMiddleware = createMiddleware({ + * name: "HumanInTheLoop", + * beforeModel: async (state, runtime) => { + * const userInput = runtime.interrupt?.({ + * type: "review", + * data: state.messages + * }); + * return { approved: userInput === "yes" }; * }, * }); * ``` @@ -65,19 +124,11 @@ export function createMiddleware< */ name: string; /** - * The schema of the middleware state. Middleware state is persisted between multiple invocations. It can be either: - * - A Zod object - * - A Zod optional object - * - A Zod default object - * - Undefined + * The schema of the middleware state. Middleware state is persisted between multiple invocations. */ stateSchema?: TSchema; /** - * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. It can be either: - * - A Zod object - * - A Zod optional object - * - A Zod default object - * - Undefined + * The schema of the middleware context. Middleware context is read-only and not persisted between multiple invocations. */ contextSchema?: TContextSchema; /** @@ -101,52 +152,7 @@ export function createMiddleware< */ tools?: (ClientTool | ServerTool)[]; /** - * Wraps tool execution with custom logic. This allows you to: - * - Modify tool call parameters before execution - * - Handle errors and retry with different parameters - * - Post-process tool results - * - Implement caching, logging, authentication, or other cross-cutting concerns - * - Return Command objects for advanced control flow - * - * The handler receives a ToolCallRequest containing the tool call, state, and runtime, - * along with a handler function to execute the actual tool. - * - * @param request - The tool call request containing toolCall, state, and runtime. - * @param handler - The function that executes the tool. Call this with a ToolCall to get the result. - * @returns The tool result as a ToolMessage or a Command for advanced control flow. - * - * @example - * ```ts - * wrapToolCall: async (request, handler) => { - * console.log(`Calling tool: ${request.tool.name}`); - * console.log(`Tool description: ${request.tool.description}`); - * - * try { - * // Execute the tool - * const result = await handler(request.toolCall); - * console.log(`Tool ${request.tool.name} succeeded`); - * return result; - * } catch (error) { - * console.error(`Tool ${request.tool.name} failed:`, error); - * // Could return a custom error message or retry - * throw error; - * } - * } - * ``` - * - * @example Authentication - * ```ts - * wrapToolCall: async (request, handler) => { - * // Check if user is authorized for this tool - * if (!request.runtime.context.isAuthorized(request.tool.name)) { - * return new ToolMessage({ - * content: "Unauthorized to call this tool", - * tool_call_id: request.toolCall.id, - * }); - * } - * return handler(request.toolCall); - * } - * ``` + * Wraps tool execution with custom logic. */ wrapToolCall?: ( request: ToolCallRequest< @@ -160,37 +166,21 @@ export function createMiddleware< ? Partial> : never >, - handler: ToolCallHandler + handler: ToolCallHandler< + Command, + (TSchema extends InteropZodObject ? InferInteropZodInput : {}) & + AgentBuiltInState, + TContextSchema extends InteropZodObject + ? InferInteropZodOutput + : TContextSchema extends InteropZodDefault + ? InferInteropZodOutput + : TContextSchema extends InteropZodOptional + ? Partial> + : never + > ) => Promise | ToolMessage | Command; /** - * Wraps the model invocation with custom logic. This allows you to: - * - Modify the request before calling the model - * - Handle errors and retry with different parameters - * - Post-process the response - * - Implement custom caching, logging, or other cross-cutting concerns - * - * The request parameter contains: model, messages, systemPrompt, tools, state, and runtime. - * - * @param request - The model request containing all the parameters needed. - * @param handler - The function that invokes the model. Call this with a ModelRequest to get the response. - * @returns The response from the model (or a modified version). - * - * @example - * ```ts - * wrapModelCall: async (request, handler) => { - * // Modify request before calling - * const modifiedRequest = { ...request, systemPrompt: "You are helpful" }; - * - * try { - * // Call the model - * return await handler(modifiedRequest); - * } catch (error) { - * // Handle errors and retry with fallback - * const fallbackRequest = { ...request, model: fallbackModel }; - * return await handler(fallbackRequest); - * } - * } - * ``` + * Wraps the model invocation with custom logic. */ wrapModelCall?: ( request: ModelRequest< @@ -221,12 +211,7 @@ export function createMiddleware< ) => Promise | AIMessage ) => Promise | AIMessage; /** - * The function to run before the agent execution starts. This function is called once at the start of the agent invocation. - * It allows to modify the state of the agent before any model calls or tool executions. - * - * @param state - The middleware state - * @param runtime - The middleware runtime - * @returns The modified middleware state or undefined to pass through + * The function to run before the agent execution starts. */ beforeAgent?: ( state: (TSchema extends InteropZodObject @@ -258,12 +243,7 @@ export function createMiddleware< > >; /** - * The function to run before the model call. This function is called before the model is invoked and before the `wrapModelCall` hook. - * It allows to modify the state of the agent. - * - * @param state - The middleware state - * @param runtime - The middleware runtime - * @returns The modified middleware state or undefined to pass through + * The function to run before the model call. */ beforeModel?: ( state: (TSchema extends InteropZodObject @@ -295,12 +275,7 @@ export function createMiddleware< > >; /** - * The function to run after the model call. This function is called after the model is invoked and before any tools are called. - * It allows to modify the state of the agent after the model is invoked, e.g. to update tool call parameters. - * - * @param state - The middleware state - * @param runtime - The middleware runtime - * @returns The modified middleware state or undefined to pass through + * The function to run after the model call. */ afterModel?: ( state: (TSchema extends InteropZodObject @@ -332,12 +307,7 @@ export function createMiddleware< > >; /** - * The function to run after the agent execution completes. This function is called once at the end of the agent invocation. - * It allows to modify the final state of the agent after all model calls and tool executions are complete. - * - * @param state - The middleware state - * @param runtime - The middleware runtime - * @returns The modified middleware state or undefined to pass through + * The function to run after the agent execution completes. */ afterAgent?: ( state: (TSchema extends InteropZodObject @@ -368,99 +338,9 @@ export function createMiddleware< TSchema extends InteropZodObject ? InferInteropZodInput : {} > >; -}): AgentMiddleware { - const middleware: AgentMiddleware = { - name: config.name, - stateSchema: config.stateSchema, - contextSchema: config.contextSchema, - beforeAgentJumpTo: config.beforeAgentJumpTo, - beforeModelJumpTo: config.beforeModelJumpTo, - afterModelJumpTo: config.afterModelJumpTo, - afterAgentJumpTo: config.afterAgentJumpTo, - tools: config.tools ?? [], - }; - - if (config.wrapToolCall) { - middleware.wrapToolCall = async (request, handler) => - Promise.resolve(config.wrapToolCall!(request, handler)); - } - - if (config.wrapModelCall) { - middleware.wrapModelCall = async (request, handler) => - Promise.resolve(config.wrapModelCall!(request, handler)); - } - - if (config.beforeAgent) { - middleware.beforeAgent = async (state, runtime) => - Promise.resolve( - config.beforeAgent!( - state, - runtime as Runtime< - TContextSchema extends InteropZodObject - ? InferInteropZodOutput - : TContextSchema extends InteropZodDefault - ? InferInteropZodOutput - : TContextSchema extends InteropZodOptional - ? Partial> - : never - > - ) - ); - } - - if (config.beforeModel) { - middleware.beforeModel = async (state, runtime) => - Promise.resolve( - config.beforeModel!( - state, - runtime as Runtime< - TContextSchema extends InteropZodObject - ? InferInteropZodOutput - : TContextSchema extends InteropZodDefault - ? InferInteropZodOutput - : TContextSchema extends InteropZodOptional - ? Partial> - : never - > - ) - ); - } - - if (config.afterModel) { - middleware.afterModel = async (state, runtime) => - Promise.resolve( - config.afterModel!( - state, - runtime as Runtime< - TContextSchema extends InteropZodObject - ? InferInteropZodOutput - : TContextSchema extends InteropZodDefault - ? InferInteropZodOutput - : TContextSchema extends InteropZodOptional - ? Partial> - : never - > - ) - ); - } - - if (config.afterAgent) { - middleware.afterAgent = async (state, runtime) => - Promise.resolve( - config.afterAgent!( - state, - runtime as Runtime< - TContextSchema extends InteropZodObject - ? InferInteropZodOutput - : TContextSchema extends InteropZodDefault - ? InferInteropZodOutput - : TContextSchema extends InteropZodOptional - ? Partial> - : never - > - ) - ); - } - - return middleware; +}): AgentMiddleware { + return coreCreateMiddleware(config) as AgentMiddleware< + TSchema, + TContextSchema + >; } diff --git a/libs/langchain/src/agents/middleware/callLimit.ts b/libs/langchain/src/agents/middleware/callLimit.ts index 3db359137771..e12a42dd2009 100644 --- a/libs/langchain/src/agents/middleware/callLimit.ts +++ b/libs/langchain/src/agents/middleware/callLimit.ts @@ -1,8 +1,10 @@ import { z } from "zod/v3"; import { AIMessage } from "@langchain/core/messages"; import { InferInteropZodInput } from "@langchain/core/utils/types"; - -import { createMiddleware } from "../middleware.js"; +import { + createMiddleware, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; const DEFAULT_EXIT_BEHAVIOR = "end"; diff --git a/libs/langchain/src/agents/middleware/contextEditing.ts b/libs/langchain/src/agents/middleware/contextEditing.ts index 0c43a6d4ecad..b466cd1cf3f1 100644 --- a/libs/langchain/src/agents/middleware/contextEditing.ts +++ b/libs/langchain/src/agents/middleware/contextEditing.ts @@ -14,9 +14,12 @@ import { ToolMessage, SystemMessage, } from "@langchain/core/messages"; +import { + createMiddleware, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; import { countTokensApproximately } from "./utils.js"; -import { createMiddleware } from "../middleware.js"; const DEFAULT_TOOL_PLACEHOLDER = "[cleared]"; diff --git a/libs/langchain/src/agents/middleware/dynamicSystemPrompt.ts b/libs/langchain/src/agents/middleware/dynamicSystemPrompt.ts index 36c5bd7fad59..4c0d4d7446cd 100644 --- a/libs/langchain/src/agents/middleware/dynamicSystemPrompt.ts +++ b/libs/langchain/src/agents/middleware/dynamicSystemPrompt.ts @@ -1,5 +1,10 @@ -import { createMiddleware } from "../middleware.js"; -import type { Runtime, AgentBuiltInState } from "../runtime.js"; +import { + createMiddleware, + type AgentMiddleware as _, + type AgentBuiltInState, +} from "@langchain/core/middleware"; + +import type { Runtime } from "../types.js"; export type DynamicSystemPromptMiddlewareConfig = ( state: AgentBuiltInState, diff --git a/libs/langchain/src/agents/middleware/hitl.ts b/libs/langchain/src/agents/middleware/hitl.ts index 4002f30726d2..6f115637224c 100644 --- a/libs/langchain/src/agents/middleware/hitl.ts +++ b/libs/langchain/src/agents/middleware/hitl.ts @@ -1,14 +1,18 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { z } from "zod/v3"; import { AIMessage, ToolMessage, ToolCall } from "@langchain/core/messages"; +import { + createMiddleware, + type AgentBuiltInState, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; import { InferInteropZodInput, interopParse, } from "@langchain/core/utils/types"; import { interrupt } from "@langchain/langgraph"; -import { createMiddleware } from "../middleware.js"; -import type { AgentBuiltInState, Runtime } from "../runtime.js"; +import type { Runtime } from "../types.js"; const DescriptionFunctionSchema = z .function() diff --git a/libs/langchain/src/agents/middleware/index.ts b/libs/langchain/src/agents/middleware/index.ts index 6e9da2cc4ecb..bd778173eff0 100644 --- a/libs/langchain/src/agents/middleware/index.ts +++ b/libs/langchain/src/agents/middleware/index.ts @@ -3,10 +3,6 @@ export { type SummarizationMiddlewareConfig, } from "./summarization.js"; export * from "./hitl.js"; -export { - anthropicPromptCachingMiddleware, - type PromptCachingMiddlewareConfig, -} from "./promptCaching.js"; export { dynamicSystemPromptMiddleware, type DynamicSystemPromptMiddlewareConfig, @@ -37,5 +33,4 @@ export { type ModelCallLimitMiddlewareConfig, } from "./callLimit.js"; export { modelFallbackMiddleware } from "./modelFallback.js"; -export { type AgentMiddleware } from "./types.js"; export { countTokensApproximately } from "./utils.js"; diff --git a/libs/langchain/src/agents/middleware/llmToolSelector.ts b/libs/langchain/src/agents/middleware/llmToolSelector.ts index 139b615148a0..c296fb7c3331 100644 --- a/libs/langchain/src/agents/middleware/llmToolSelector.ts +++ b/libs/langchain/src/agents/middleware/llmToolSelector.ts @@ -3,11 +3,11 @@ import { BaseLanguageModel } from "@langchain/core/language_models/base"; import type { InferInteropZodInput } from "@langchain/core/utils/types"; import { HumanMessage } from "@langchain/core/messages"; import type { StructuredToolInterface } from "@langchain/core/tools"; +import { createMiddleware } from "@langchain/core/middleware"; -import { createMiddleware } from "../middleware.js"; import { initChatModel } from "../../chat_models/universal.js"; -import type { Runtime } from "../runtime.js"; import type { ModelRequest } from "../nodes/types.js"; +import type { Runtime } from "../types.js"; const DEFAULT_SYSTEM_PROMPT = "Your goal is to select the most relevant tools for answering the user's query."; diff --git a/libs/langchain/src/agents/middleware/modelFallback.ts b/libs/langchain/src/agents/middleware/modelFallback.ts index 8cfba8c3de01..a9b5c817dc87 100644 --- a/libs/langchain/src/agents/middleware/modelFallback.ts +++ b/libs/langchain/src/agents/middleware/modelFallback.ts @@ -1,7 +1,9 @@ import type { LanguageModelLike } from "@langchain/core/language_models/base"; import { initChatModel } from "../../chat_models/universal.js"; -import type { AgentMiddleware } from "./types.js"; -import { createMiddleware } from "../middleware.js"; +import { + createMiddleware, + type AgentMiddleware, +} from "@langchain/core/middleware"; /** * Middleware that provides automatic model fallback on errors. diff --git a/libs/langchain/src/agents/middleware/piiRedaction.ts b/libs/langchain/src/agents/middleware/piiRedaction.ts index d5a2c2e59ba4..a9c04190046a 100644 --- a/libs/langchain/src/agents/middleware/piiRedaction.ts +++ b/libs/langchain/src/agents/middleware/piiRedaction.ts @@ -8,8 +8,7 @@ import { SystemMessage, } from "@langchain/core/messages"; import type { InferInteropZodInput } from "@langchain/core/utils/types"; - -import { createMiddleware } from "../middleware.js"; +import { createMiddleware } from "@langchain/core/middleware"; /** * Type for the redaction map that stores original values by ID diff --git a/libs/langchain/src/agents/middleware/planning.ts b/libs/langchain/src/agents/middleware/planning.ts index b40654ed0a1a..a7e38fd44852 100644 --- a/libs/langchain/src/agents/middleware/planning.ts +++ b/libs/langchain/src/agents/middleware/planning.ts @@ -2,8 +2,10 @@ import { z } from "zod/v3"; import { Command } from "@langchain/langgraph"; import { tool } from "@langchain/core/tools"; import { ToolMessage } from "@langchain/core/messages"; - -import { createMiddleware } from "../../index.js"; +import { + createMiddleware, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; /** * Description for the write_todos tool diff --git a/libs/langchain/src/agents/middleware/summarization.ts b/libs/langchain/src/agents/middleware/summarization.ts index 56fac21f4c26..25aee6a060f2 100644 --- a/libs/langchain/src/agents/middleware/summarization.ts +++ b/libs/langchain/src/agents/middleware/summarization.ts @@ -15,7 +15,10 @@ import { InferInteropZodInput, } from "@langchain/core/utils/types"; import { REMOVE_ALL_MESSAGES } from "@langchain/langgraph"; -import { createMiddleware } from "../middleware.js"; +import { + createMiddleware, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; import { countTokensApproximately } from "./utils.js"; import { hasToolCalls } from "../utils.js"; diff --git a/libs/langchain/src/agents/middleware/tests/promptCaching.int.test.ts b/libs/langchain/src/agents/middleware/tests/promptCaching.int.test.ts index 976c51bfa0b0..05709e279f1c 100644 --- a/libs/langchain/src/agents/middleware/tests/promptCaching.int.test.ts +++ b/libs/langchain/src/agents/middleware/tests/promptCaching.int.test.ts @@ -5,19 +5,30 @@ import { z } from "zod"; import { HumanMessage, AIMessage } from "@langchain/core/messages"; import { ChatAnthropic, + promptCachingMiddleware, type AnthropicInput, // @ts-expect-error - instances is mocked instances, } from "@langchain/anthropic"; -import { anthropicPromptCachingMiddleware } from "../promptCaching.js"; import { createAgent } from "../../index.js"; +/** + * Cast the promptCachingMiddleware to `any` to avoid the following error: + * > Type instantiation is excessively deep and possibly infinite. + * + * This is because the actual `promptCachingMiddleware` is implemented within + * the `@langchain/anthropic` package and tesed in here. To avoid circular dependencies, + * we have to run the unit and integration tests here as we need `createAgent`. + */ +const anthropicPromptCachingMiddleware = promptCachingMiddleware as any; + /** * Mock the Anthropic module to return a ChatAnthropicMock instance */ vi.mock("@langchain/anthropic", async (origModule) => { - const { ChatAnthropic } = (await origModule()) as any; + const { ChatAnthropic, promptCachingMiddleware } = + (await origModule()) as any; const instances: ChatAnthropicMock[] = []; class ChatAnthropicMock extends ChatAnthropic { anthropicResponse: MockInstance; @@ -50,6 +61,7 @@ vi.mock("@langchain/anthropic", async (origModule) => { } } return { + promptCachingMiddleware, ChatAnthropic: ChatAnthropicMock, instances, }; @@ -90,7 +102,7 @@ const messages = [ new HumanMessage("What is the capital of France?"), ]; -describe("anthropicPromptCachingMiddleware", () => { +describe("promptCachingMiddleware", () => { it("should allow middleware to update model, messages and systemPrompt", async () => { const model = new ChatAnthropic({ model: "claude-opus-4-20250514", diff --git a/libs/langchain/src/agents/middleware/tests/promptCaching.test.ts b/libs/langchain/src/agents/middleware/tests/promptCaching.test.ts index 6a0baee321a7..2b9f613ceb83 100644 --- a/libs/langchain/src/agents/middleware/tests/promptCaching.test.ts +++ b/libs/langchain/src/agents/middleware/tests/promptCaching.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, it, @@ -13,10 +14,20 @@ import { } from "@langchain/core/messages"; import type { LanguageModelLike } from "@langchain/core/language_models/base"; import { ChatOpenAI } from "@langchain/openai"; +import { promptCachingMiddleware } from "@langchain/anthropic"; -import { anthropicPromptCachingMiddleware } from "../promptCaching.js"; import { createAgent } from "../../index.js"; +/** + * Cast the promptCachingMiddleware to `any` to avoid the following error: + * > Type instantiation is excessively deep and possibly infinite. + * + * This is because the actual `promptCachingMiddleware` is implemented within + * the `@langchain/anthropic` package and tesed in here. To avoid circular dependencies, + * we have to run the unit and integration tests here as we need `createAgent`. + */ +const anthropicPromptCachingMiddleware = promptCachingMiddleware as any; + function createMockModel(name = "ChatAnthropic", modelType = "anthropic") { // Mock Anthropic model const invokeCallback = vi @@ -37,7 +48,7 @@ function createMockModel(name = "ChatAnthropic", modelType = "anthropic") { const consoleWarn = vi.spyOn(console, "warn"); -describe("anthropicPromptCachingMiddleware", () => { +describe("promptCachingMiddleware", () => { beforeEach(() => { vi.clearAllMocks(); }); diff --git a/libs/langchain/src/agents/middleware/toolCallLimit.ts b/libs/langchain/src/agents/middleware/toolCallLimit.ts index 59f410db14b9..f09749c9c61b 100644 --- a/libs/langchain/src/agents/middleware/toolCallLimit.ts +++ b/libs/langchain/src/agents/middleware/toolCallLimit.ts @@ -1,14 +1,15 @@ /** * Tool call limit middleware for agents. */ - +import { + createMiddleware, + type AgentBuiltInState, + type AgentMiddleware as _, +} from "@langchain/core/middleware"; import { AIMessage, BaseMessage, HumanMessage } from "@langchain/core/messages"; import { z } from "zod/v3"; import type { InferInteropZodInput } from "@langchain/core/utils/types"; -import { createMiddleware } from "../middleware.js"; -import type { AgentBuiltInState } from "../runtime.js"; - /** * Count tool calls in a list of messages. * diff --git a/libs/langchain/src/agents/nodes/AfterAgentNode.ts b/libs/langchain/src/agents/nodes/AfterAgentNode.ts index 94c145a76945..f0b1188e0b1c 100644 --- a/libs/langchain/src/agents/nodes/AfterAgentNode.ts +++ b/libs/langchain/src/agents/nodes/AfterAgentNode.ts @@ -1,8 +1,12 @@ -import { z } from "zod/v3"; import { RunnableConfig } from "@langchain/core/runnables"; +import type { + AgentMiddleware, + MiddlewareResult, + AgentBuiltInState, +} from "@langchain/core/middleware"; + import { MiddlewareNode, MiddlewareNodeOptions } from "./middleware.js"; -import type { AgentMiddleware, MiddlewareResult } from "../middleware/types.js"; -import type { AgentBuiltInState, Runtime } from "../runtime.js"; +import type { Runtime } from "../types.js"; /** * Node for executing a single middleware's afterAgent hook. @@ -14,10 +18,7 @@ export class AfterAgentNode< lc_namespace = ["langchain", "agents", "afterAgentNodes"]; constructor( - public middleware: AgentMiddleware< - z.ZodObject, - z.ZodObject - >, + public middleware: AgentMiddleware, options: MiddlewareNodeOptions ) { super( @@ -35,7 +36,7 @@ export class AfterAgentNode< runHook(state: TStateSchema, runtime: Runtime) { return this.middleware.afterAgent!( state as Record & AgentBuiltInState, - runtime as Runtime + runtime ) as Promise>; } } diff --git a/libs/langchain/src/agents/nodes/AfterModelNode.ts b/libs/langchain/src/agents/nodes/AfterModelNode.ts index 7871c9f60945..eda9efd8bead 100644 --- a/libs/langchain/src/agents/nodes/AfterModelNode.ts +++ b/libs/langchain/src/agents/nodes/AfterModelNode.ts @@ -1,8 +1,11 @@ -import { z } from "zod/v3"; import { RunnableConfig } from "@langchain/core/runnables"; import { MiddlewareNode, MiddlewareNodeOptions } from "./middleware.js"; -import type { AgentMiddleware, MiddlewareResult } from "../middleware/types.js"; -import type { AgentBuiltInState, Runtime } from "../runtime.js"; +import type { + AgentMiddleware, + MiddlewareResult, + AgentBuiltInState, +} from "@langchain/core/middleware"; +import type { Runtime } from "../types.js"; /** * Node for executing a single middleware's afterModel hook. @@ -14,10 +17,7 @@ export class AfterModelNode< lc_namespace = ["langchain", "agents", "afterModelNodes"]; constructor( - public middleware: AgentMiddleware< - z.ZodObject, - z.ZodObject - >, + public middleware: AgentMiddleware, options: MiddlewareNodeOptions ) { super( @@ -35,7 +35,7 @@ export class AfterModelNode< runHook(state: TStateSchema, runtime: Runtime) { return this.middleware.afterModel!( state as Record & AgentBuiltInState, - runtime as Runtime + runtime ) as Promise>; } } diff --git a/libs/langchain/src/agents/nodes/AgentNode.ts b/libs/langchain/src/agents/nodes/AgentNode.ts index 32559deee044..325ef00deea9 100644 --- a/libs/langchain/src/agents/nodes/AgentNode.ts +++ b/libs/langchain/src/agents/nodes/AgentNode.ts @@ -11,6 +11,8 @@ import { interopParse, } from "@langchain/core/utils/types"; import type { ToolCall } from "@langchain/core/messages/tool"; +import type { ClientTool, ServerTool } from "@langchain/core/tools"; +import type { AgentMiddleware, PrivateState } from "@langchain/core/middleware"; import { initChatModel } from "../../chat_models/universal.js"; import { MultipleStructuredOutputsError } from "../errors.js"; @@ -25,13 +27,9 @@ import { } from "../utils.js"; import { mergeAbortSignals } from "../nodes/utils.js"; import { CreateAgentParams } from "../types.js"; -import type { InternalAgentState, Runtime, PrivateState } from "../runtime.js"; -import type { - AgentMiddleware, - AnyAnnotationRoot, -} from "../middleware/types.js"; +import type { InternalAgentState } from "../runtime.js"; import type { ModelRequest } from "./types.js"; -import type { ClientTool, ServerTool } from "../tools.js"; +import type { Runtime, AnyAnnotationRoot } from "../types.js"; import { withAgentName } from "../withAgentName.js"; import { ToolStrategy, diff --git a/libs/langchain/src/agents/nodes/BeforeAgentNode.ts b/libs/langchain/src/agents/nodes/BeforeAgentNode.ts index fdb2cb924cbb..eb5299676f63 100644 --- a/libs/langchain/src/agents/nodes/BeforeAgentNode.ts +++ b/libs/langchain/src/agents/nodes/BeforeAgentNode.ts @@ -1,8 +1,11 @@ -import { z } from "zod/v3"; import { RunnableConfig } from "@langchain/core/runnables"; import { MiddlewareNode, type MiddlewareNodeOptions } from "./middleware.js"; -import type { AgentMiddleware, MiddlewareResult } from "../middleware/types.js"; -import type { AgentBuiltInState, Runtime } from "../runtime.js"; +import type { + AgentMiddleware, + MiddlewareResult, + AgentBuiltInState, +} from "@langchain/core/middleware"; +import type { Runtime } from "../types.js"; /** * Node for executing a single middleware's beforeAgent hook. @@ -14,10 +17,7 @@ export class BeforeAgentNode< lc_namespace = ["langchain", "agents", "beforeAgentNodes"]; constructor( - public middleware: AgentMiddleware< - z.ZodObject, - z.ZodObject - >, + public middleware: AgentMiddleware, options: MiddlewareNodeOptions ) { super( @@ -35,7 +35,7 @@ export class BeforeAgentNode< runHook(state: TStateSchema, runtime: Runtime) { return this.middleware.beforeAgent!( state as Record & AgentBuiltInState, - runtime as Runtime + runtime ) as Promise>; } } diff --git a/libs/langchain/src/agents/nodes/BeforeModelNode.ts b/libs/langchain/src/agents/nodes/BeforeModelNode.ts index 105fd34ac760..d660eef14ff7 100644 --- a/libs/langchain/src/agents/nodes/BeforeModelNode.ts +++ b/libs/langchain/src/agents/nodes/BeforeModelNode.ts @@ -1,8 +1,11 @@ -import { z } from "zod/v3"; import { RunnableConfig } from "@langchain/core/runnables"; import { MiddlewareNode, type MiddlewareNodeOptions } from "./middleware.js"; -import type { AgentMiddleware, MiddlewareResult } from "../middleware/types.js"; -import type { AgentBuiltInState, Runtime } from "../runtime.js"; +import type { + AgentMiddleware, + MiddlewareResult, + AgentBuiltInState, +} from "@langchain/core/middleware"; +import type { Runtime } from "../types.js"; /** * Node for executing a single middleware's beforeModel hook. @@ -14,10 +17,7 @@ export class BeforeModelNode< lc_namespace = ["langchain", "agents", "beforeModelNodes"]; constructor( - public middleware: AgentMiddleware< - z.ZodObject, - z.ZodObject - >, + public middleware: AgentMiddleware, options: MiddlewareNodeOptions ) { super( @@ -35,7 +35,7 @@ export class BeforeModelNode< runHook(state: TStateSchema, runtime: Runtime) { return this.middleware.beforeModel!( state as Record & AgentBuiltInState, - runtime as Runtime + runtime ) as Promise>; } } diff --git a/libs/langchain/src/agents/nodes/ToolNode.ts b/libs/langchain/src/agents/nodes/ToolNode.ts index 667fd12fc2ae..447e11e713ce 100644 --- a/libs/langchain/src/agents/nodes/ToolNode.ts +++ b/libs/langchain/src/agents/nodes/ToolNode.ts @@ -7,7 +7,6 @@ import { StructuredToolInterface, ToolInputParsingException, } from "@langchain/core/tools"; -import type { ToolCall } from "@langchain/core/messages/tool"; import type { InteropZodObject } from "@langchain/core/utils/types"; import { isCommand, @@ -16,17 +15,14 @@ import { isGraphInterrupt, type LangGraphRunnableConfig, } from "@langchain/langgraph"; +import type { PrivateState, ToolCall } from "@langchain/core/middleware"; +import type { ToolCallWrapper, ToolCallRequest } from "../middleware.js"; import { RunnableCallable } from "../RunnableCallable.js"; import { PreHookAnnotation } from "../annotation.js"; import { mergeAbortSignals } from "./utils.js"; import { ToolInvocationError } from "../errors.js"; -import type { PrivateState } from "../runtime.js"; -import type { - ToAnnotationRoot, - AnyAnnotationRoot, - ToolCallWrapper, -} from "../middleware/types.js"; +import type { ToAnnotationRoot, AnyAnnotationRoot } from "../types.js"; export interface ToolNodeOptions { /** @@ -68,7 +64,7 @@ export interface ToolNodeOptions { * Allows middleware to intercept and modify tool calls before execution. * The wrapper receives the tool call request and a handler function to execute the tool. */ - wrapToolCall?: ToolCallWrapper; + wrapToolCall?: ToolCallWrapper; /** * Optional function to get the private state (threadLevelCallCount, runModelCallCount). * Used to provide runtime metadata to wrapToolCall middleware. @@ -180,7 +176,7 @@ export class ToolNode< | ((error: unknown, toolCall: ToolCall) => ToolMessage | undefined) = defaultHandleToolErrors; - wrapToolCall?: ToolCallWrapper; + wrapToolCall?: ToolCallWrapper; getPrivateState?: () => PrivateState; @@ -364,13 +360,17 @@ export class ToolNode< throw new Error(`Tool "${call.name}" not found.`); } - const request = { + const request: ToolCallRequest< + ToAnnotationRoot["State"] & PreHookAnnotation["State"] + > = { toolCall: call, tool, state, runtime, }; - return await this.wrapToolCall(request, baseHandler); + return await this.wrapToolCall(request, ({ toolCall }) => + baseHandler(toolCall) + ); } catch (e: unknown) { /** * Handle middleware errors @@ -434,7 +434,7 @@ export class ToolNode< outputs = await Promise.all( aiMessage.tool_calls ?.filter((call) => call.id == null || !toolMessageIds.has(call.id)) - .map((call) => this.runTool(call, config, state)) ?? [] + .map((call) => this.runTool(call as ToolCall, config, state)) ?? [] ); } diff --git a/libs/langchain/src/agents/nodes/middleware.ts b/libs/langchain/src/agents/nodes/middleware.ts index 54facba95b83..90bb5bdb54e6 100644 --- a/libs/langchain/src/agents/nodes/middleware.ts +++ b/libs/langchain/src/agents/nodes/middleware.ts @@ -2,12 +2,16 @@ import { z } from "zod/v3"; import { LangGraphRunnableConfig, Command } from "@langchain/langgraph"; import { interopParse } from "@langchain/core/utils/types"; +import type { + JumpToTarget, + PrivateState, + AgentMiddleware, + MiddlewareResult, +} from "@langchain/core/middleware"; import { RunnableCallable, RunnableCallableArgs } from "../RunnableCallable.js"; -import type { JumpToTarget } from "../constants.js"; -import type { Runtime, PrivateState } from "../runtime.js"; -import type { AgentMiddleware, MiddlewareResult } from "../middleware/types.js"; import { derivePrivateState, parseJumpToTarget } from "./utils.js"; +import type { Runtime } from "../types.js"; /** * Named class for context objects to provide better error messages diff --git a/libs/langchain/src/agents/nodes/types.ts b/libs/langchain/src/agents/nodes/types.ts deleted file mode 100644 index 1cf9035eaedd..000000000000 --- a/libs/langchain/src/agents/nodes/types.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { LanguageModelLike } from "@langchain/core/language_models/base"; -import type { BaseMessage } from "@langchain/core/messages"; -import type { ServerTool, ClientTool } from "../tools.js"; -import type { Runtime, AgentBuiltInState } from "../runtime.js"; - -/** - * Configuration for modifying a model call at runtime. - * All fields are optional and only provided fields will override defaults. - * - * @template TState - The agent's state type, must extend Record. Defaults to Record. - * @template TContext - The runtime context type for accessing metadata and control flow. Defaults to unknown. - */ -export interface ModelRequest< - TState extends Record = Record, - TContext = unknown -> { - /** - * The model to use for this step. - */ - model: LanguageModelLike; - /** - * The messages to send to the model. - */ - messages: BaseMessage[]; - /** - * The system message for this step. - */ - systemPrompt?: string; - /** - * Tool choice configuration (model-specific format). - * Can be one of: - * - `"auto"`: means the model can pick between generating a message or calling one or more tools. - * - `"none"`: means the model will not call any tool and instead generates a message. - * - `"required"`: means the model must call one or more tools. - * - `{ type: "function", function: { name: string } }`: The model will use the specified function. - */ - toolChoice?: - | "auto" - | "none" - | "required" - | { type: "function"; function: { name: string } }; - - /** - * The tools to make available for this step. - */ - tools: (ServerTool | ClientTool)[]; - - /** - * The current agent state (includes both middleware state and built-in state). - */ - state: TState & AgentBuiltInState; - - /** - * The runtime context containing metadata, signal, writer, interrupt, etc. - */ - runtime: Runtime; -} diff --git a/libs/langchain/src/agents/nodes/utils.ts b/libs/langchain/src/agents/nodes/utils.ts index 0a4d82401c6c..ffe99d0ebae0 100644 --- a/libs/langchain/src/agents/nodes/utils.ts +++ b/libs/langchain/src/agents/nodes/utils.ts @@ -1,15 +1,14 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { z } from "zod/v3"; +import { z, type ZodIssue } from "zod/v3"; import { type BaseMessage } from "@langchain/core/messages"; import { interopSafeParseAsync, interopZodObjectMakeFieldsOptional, } from "@langchain/core/utils/types"; -import { type ZodIssue } from "zod/v3"; +import type { AgentMiddleware } from "@langchain/core/middleware"; import { END } from "@langchain/langgraph"; import type { JumpTo } from "../types.js"; -import type { AgentMiddleware } from "../middleware/types.js"; /** * Helper function to initialize middleware state defaults. diff --git a/libs/langchain/src/agents/runtime.ts b/libs/langchain/src/agents/runtime.ts index ed0dd821ed70..d8bc4c2c7535 100644 --- a/libs/langchain/src/agents/runtime.ts +++ b/libs/langchain/src/agents/runtime.ts @@ -1,99 +1,14 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { InteropZodOptional } from "@langchain/core/utils/types"; import type { InteropZodDefault } from "@langchain/core/utils/types"; import type { - Runtime as LangGraphRuntime, - PregelOptions, -} from "@langchain/langgraph"; + PrivateState, + WithMaybeContext, +} from "@langchain/core/middleware"; +import type { PregelOptions } from "@langchain/langgraph"; import type { BaseMessage } from "@langchain/core/messages"; import type { ResponseFormatUndefined } from "./responses.js"; -/** - * Type for the agent's built-in state properties. - */ -export type AgentBuiltInState = { - /** - * Array of messages representing the conversation history. - * - * This includes all messages exchanged during the agent's execution: - * - Human messages: Input from the user - * - AI messages: Responses from the language model - * - Tool messages: Results from tool executions - * - System messages: System-level instructions or information - * - * Messages are accumulated throughout the agent's lifecycle and can be - * accessed or modified by middleware hooks during execution. - */ - messages: BaseMessage[]; - /** - * Structured response data returned by the agent when a `responseFormat` is configured. - * - * This property is only populated when you provide a `responseFormat` schema - * (as Zod or JSON schema) to the agent configuration. The agent will format - * its final output to match the specified schema and store it in this property. - * - * Note: The type is specified as `Record` because TypeScript cannot - * infer the actual response format type in contexts like middleware, where the agent's - * generic type parameters are not accessible. You may need to cast this to your specific - * response type when accessing it. - */ - structuredResponse?: Record; -}; - -/** - * Type helper to check if TContext is an optional Zod schema - */ -type IsOptionalZodObject = T extends InteropZodOptional ? true : false; -type IsDefaultZodObject = T extends InteropZodDefault ? true : false; - -export type WithMaybeContext = undefined extends TContext - ? { readonly context?: TContext } - : IsOptionalZodObject extends true - ? { readonly context?: TContext } - : IsDefaultZodObject extends true - ? { readonly context?: TContext } - : { readonly context: TContext }; - -/** - * Runtime information available to middleware (readonly). - */ -export type Runtime = Partial< - Omit, "context" | "configurable"> -> & - WithMaybeContext & - PrivateState & { - configurable?: { - thread_id?: string; - [key: string]: unknown; - }; - }; - -export interface RunLevelPrivateState { - /** - * The number of times the model has been called at the run level. - * This includes multiple agent invocations. - */ - runModelCallCount: number; -} -export interface ThreadLevelPrivateState { - /** - * The number of times the model has been called at the thread level. - * This includes multiple agent invocations within different environments - * using the same thread. - */ - threadLevelCallCount: number; -} - -/** - * As private state we consider all information we want to track within - * the lifecycle of the agent, without exposing it to the user. These informations - * are propagated to the user as _readonly_ runtime properties. - */ -export interface PrivateState - extends ThreadLevelPrivateState, - RunLevelPrivateState {} - export type InternalAgentState< StructuredResponseType extends Record | undefined = Record< string, diff --git a/libs/langchain/src/agents/tests/graph.test.ts b/libs/langchain/src/agents/tests/graph.test.ts index 49d88c77f652..26ea55a474d4 100644 --- a/libs/langchain/src/agents/tests/graph.test.ts +++ b/libs/langchain/src/agents/tests/graph.test.ts @@ -1,8 +1,8 @@ import fs from "node:fs"; import { describe, it, expect, afterAll } from "vitest"; import { tool } from "@langchain/core/tools"; +import type { JumpToTarget } from "@langchain/core/middleware"; import { createAgent, createMiddleware } from "../index.js"; -import type { JumpToTarget } from "../constants.js"; // Strategic test cases covering meaningful middleware interaction patterns // rather than exhaustive combinations which would result in 13,122 test cases diff --git a/libs/langchain/src/agents/tests/middleware.test-d.ts b/libs/langchain/src/agents/tests/middleware.test-d.ts index 9e9c0eb0a698..1e985036836a 100644 --- a/libs/langchain/src/agents/tests/middleware.test-d.ts +++ b/libs/langchain/src/agents/tests/middleware.test-d.ts @@ -1,10 +1,8 @@ import { describe, it, expectTypeOf } from "vitest"; import { z } from "zod/v3"; import { HumanMessage, BaseMessage, AIMessage } from "@langchain/core/messages"; -import { tool } from "@langchain/core/tools"; - +import { tool, ServerTool, ClientTool } from "@langchain/core/tools"; import { createAgent, createMiddleware } from "../index.js"; -import type { ServerTool, ClientTool } from "../tools.js"; describe("middleware types", () => { it("a middleware can define a state schema which is propagated to the result", async () => { diff --git a/libs/langchain/src/agents/tests/middleware.test.ts b/libs/langchain/src/agents/tests/middleware.test.ts index 6f5033603b31..43311514cbfd 100644 --- a/libs/langchain/src/agents/tests/middleware.test.ts +++ b/libs/langchain/src/agents/tests/middleware.test.ts @@ -864,6 +864,252 @@ describe("middleware", () => { expect(toolBMock).toBeCalled(); }); + it("should allow middleware to redirect tool call and transform arguments in wrapModelCall", async () => { + // Tool A: searches by user ID + const searchByUserIdMock = vi.fn( + async ({ userId, limit }: { userId: string; limit: number }) => + `Searched for user ${userId} with limit ${limit}` + ); + const searchByUserId = tool(searchByUserIdMock, { + name: "search_by_user_id", + description: "Search by user ID", + schema: z.object({ + userId: z.string(), + limit: z.number(), + }), + }); + + // Tool B: searches by username (different schema) + const searchByUsernameMock = vi.fn( + async ({ + username, + maxResults, + }: { + username: string; + maxResults: number; + }) => `Searched for username ${username} with max ${maxResults}` + ); + const searchByUsername = tool(searchByUsernameMock, { + name: "search_by_username", + description: "Search by username", + schema: z.object({ + username: z.string(), + maxResults: z.number(), + }), + }); + + let capturedOriginalCall: ToolCall | undefined; + let capturedModifiedCall: ToolCall | undefined; + + // Middleware that redirects and transforms the call + const transformMiddleware = createMiddleware({ + name: "TransformMiddleware", + wrapModelCall: async (request, handler) => { + const response = await handler(request); + + // Redirect search_by_user_id to search_by_username with transformed args + if (response.tool_calls && response.tool_calls.length > 0) { + const toolCall = response.tool_calls[0]; + capturedOriginalCall = toolCall; + + if (toolCall.name === "search_by_user_id") { + // Transform arguments from userId schema to username schema + const modifiedToolCall = { + ...toolCall, + name: "search_by_username", + args: { + username: `user_${toolCall.args.userId}`, // Transform userId to username format + maxResults: (toolCall.args.limit as number) * 2, // Transform limit to maxResults + }, + }; + + capturedModifiedCall = modifiedToolCall; + + return new AIMessage({ + ...response, + content: response.content, + tool_calls: [modifiedToolCall], + }); + } + } + + return response; + }, + }); + + // Model tries to call search_by_user_id + const model = new FakeToolCallingChatModel({ + responses: [ + new AIMessage({ + content: "", + tool_calls: [ + { + id: "call_1", + name: "search_by_user_id", + args: { userId: "12345", limit: 10 }, + }, + ], + }), + new AIMessage("Search complete"), + ], + }); + + const agent = createAgent({ + model, + tools: [searchByUserId, searchByUsername], + middleware: [transformMiddleware], + }); + + const result = await agent.invoke({ + messages: [{ role: "user", content: "Search for user 12345" }], + }); + + // Verify the original call was captured + expect(capturedOriginalCall).toEqual({ + id: "call_1", + name: "search_by_user_id", + args: { userId: "12345", limit: 10 }, + }); + + // Verify the modified call was created with transformed args + expect(capturedModifiedCall).toEqual({ + id: "call_1", + name: "search_by_username", + args: { username: "user_12345", maxResults: 20 }, + }); + + // Verify search_by_username was executed with transformed arguments + expect(searchByUsernameMock).toHaveBeenCalledWith( + { + username: "user_12345", + maxResults: 20, + }, + expect.any(Object) + ); + + // Verify search_by_user_id was NOT executed + expect(searchByUserIdMock).not.toHaveBeenCalled(); + + // Verify the tool message contains the correct result + const toolMessage = result.messages.find((m) => + ToolMessage.isInstance(m) + ) as ToolMessage; + expect(toolMessage).toBeDefined(); + expect(toolMessage.content).toBe( + "Searched for username user_12345 with max 20" + ); + expect(toolMessage.name).toBe("search_by_username"); + }); + + it("should allow middleware to modify tool arguments before handler execution in wrapToolCall", async () => { + /** + * Test demonstrates modifying tool arguments BEFORE calling the handler + * This is different from wrapModelCall - here we intercept the actual tool execution + */ + + const calculatorMock = vi.fn( + async ({ + a, + b, + operation, + }: { + a: number; + b: number; + operation: string; + }) => `Performed ${operation} on ${a} and ${b}` + ); + const calculator = tool(calculatorMock, { + name: "calculator", + description: "Perform calculations", + schema: z.object({ + a: z.number(), + b: z.number(), + operation: z.string(), + }), + }); + + let capturedOriginalArgs: any; + let capturedModifiedArgs: any; + + // Middleware that modifies arguments BEFORE the tool executes + const argTransformMiddleware = createMiddleware({ + name: "ArgTransformMiddleware", + wrapToolCall: async (request, handler) => { + // Capture original arguments + capturedOriginalArgs = { ...request.toolCall.args }; + + // Modify the tool call arguments before passing to handler + if (request.tool.name === "calculator") { + // Double both numbers before executing + const modifiedRequest = { + ...request, + toolCall: { + ...request.toolCall, + args: { + a: (request.toolCall.args.a as number) * 2, + b: (request.toolCall.args.b as number) * 2, + operation: request.toolCall.args.operation, + }, + }, + }; + + capturedModifiedArgs = { ...modifiedRequest.toolCall.args }; + + // Call handler with modified arguments + return handler(modifiedRequest); + } + + return handler(request); + }, + }); + + const model = new FakeToolCallingModel({ + toolCalls: [ + [ + { + name: "calculator", + args: { a: 5, b: 10, operation: "add" }, + id: "1", + }, + ], + ], + }); + + const agent = createAgent({ + model, + tools: [calculator], + middleware: [argTransformMiddleware], + }); + + await agent.invoke({ + messages: [new HumanMessage("Add 5 and 10")], + }); + + // Verify original arguments were captured + expect(capturedOriginalArgs).toEqual({ + a: 5, + b: 10, + operation: "add", + }); + + // Verify modified arguments were created + expect(capturedModifiedArgs).toEqual({ + a: 10, // doubled + b: 20, // doubled + operation: "add", + }); + + // Verify the tool was called with MODIFIED arguments + expect(calculatorMock).toHaveBeenCalledWith( + { + a: 10, + b: 20, + operation: "add", + }, + expect.any(Object) + ); + }); + it("should support async operations in middleware", async () => { /** * Test verifies middleware can perform async operations @@ -1021,7 +1267,7 @@ describe("middleware", () => { */ (request.toolCall.args as any).location += "O"; - const result = (await handler(request.toolCall)) as ToolMessage; + const result = (await handler(request)) as ToolMessage; toolExecutions.push(`after:${request.toolCall.name}`); /** @@ -1097,7 +1343,7 @@ describe("middleware", () => { name: "AuthMiddleware", wrapToolCall: async (request, handler) => { executionOrder.push("auth_before"); - const result = await handler(request.toolCall); + const result = await handler(request); executionOrder.push("auth_after"); return result; }, @@ -1108,7 +1354,7 @@ describe("middleware", () => { name: "CacheMiddleware", wrapToolCall: async (request, handler) => { executionOrder.push("cache_before"); - const result = await handler(request.toolCall); + const result = await handler(request); executionOrder.push("cache_after"); return result; }, @@ -1160,7 +1406,7 @@ describe("middleware", () => { name: "ErrorHandlerMiddleware", wrapToolCall: async (request, handler) => { try { - return await handler(request.toolCall); + return await handler(request); } catch (error) { return new ToolMessage({ content: `Error handled by middleware: ${error}`, @@ -1213,7 +1459,7 @@ describe("middleware", () => { }), wrapToolCall: async (request, handler) => { capturedState = request.state; - return handler(request.toolCall); + return handler(request); }, }); @@ -1292,9 +1538,10 @@ describe("middleware", () => { // Middleware that returns invalid type const invalidMiddleware = createMiddleware({ name: "InvalidReturnMiddleware", + // @ts-expect-error - test invalid return type wrapToolCall: async () => { // Return invalid type (string instead of ToolMessage or Command) - return "invalid return value" as any; + return "invalid return value"; }, }); @@ -1333,7 +1580,7 @@ describe("middleware", () => { name: "CommandMiddleware", wrapToolCall: async (request, handler) => { // Execute tool normally - await handler(request.toolCall); + await handler(request); // Return a Command instead of ToolMessage return new Command({ @@ -1389,7 +1636,7 @@ describe("middleware", () => { name: "TrackingMiddleware", wrapToolCall: async (request, handler) => { toolCalls.push(request.tool.name as string); - return handler(request.toolCall); + return handler(request); }, }); @@ -1460,7 +1707,7 @@ describe("middleware", () => { events.push("before_tool"); // Capture the tool call to verify it was modified capturedToolCallInWrapTool = request.toolCall; - const result = await handler(request.toolCall); + const result = await handler(request); events.push("after_tool"); return result; }, @@ -1520,7 +1767,7 @@ describe("middleware", () => { tool_call_id: request.toolCall.id!, }); } - return handler(request.toolCall); + return handler(request); }, }); @@ -1577,7 +1824,7 @@ describe("middleware", () => { name: "MetricsMiddleware", wrapToolCall: async (request, handler) => { const startTime = Date.now(); - const result = await handler(request.toolCall); + const result = await handler(request); const duration = Date.now() - startTime; metrics.push({ @@ -1635,7 +1882,7 @@ describe("middleware", () => { wrapToolCall: async (request, handler) => { for (let attempt = 0; attempt < maxRetries; attempt++) { try { - return await handler(request.toolCall); + return await handler(request); } catch (error) { if (attempt === maxRetries - 1) { throw error; @@ -1702,7 +1949,7 @@ describe("middleware", () => { } // Execute and cache - const result = (await handler(request.toolCall)) as ToolMessage; + const result = (await handler(request)) as ToolMessage; cache.set(cacheKey, result); return result; }, @@ -1764,7 +2011,7 @@ describe("middleware", () => { const redactionMiddleware = createMiddleware({ name: "RedactionMiddleware", wrapToolCall: async (request, handler) => { - const result = (await handler(request.toolCall)) as ToolMessage; + const result = (await handler(request)) as ToolMessage; // Redact private tool results if ((request.tool.name as string).includes("private")) { @@ -1827,7 +2074,7 @@ describe("middleware", () => { name: "Layer1", wrapToolCall: async (request, handler) => { executionFlow.push("layer1_before"); - const result = await handler(request.toolCall); + const result = await handler(request); executionFlow.push("layer1_after"); return result; }, @@ -1837,7 +2084,7 @@ describe("middleware", () => { name: "Layer2", wrapToolCall: async (request, handler) => { executionFlow.push("layer2_before"); - const result = await handler(request.toolCall); + const result = await handler(request); executionFlow.push("layer2_after"); return result; }, @@ -1847,7 +2094,7 @@ describe("middleware", () => { name: "Layer3", wrapToolCall: async (request, handler) => { executionFlow.push("layer3_before"); - const result = await handler(request.toolCall); + const result = await handler(request); executionFlow.push("layer3_after"); return result; }, diff --git a/libs/langchain/src/agents/tests/types.test-d.ts b/libs/langchain/src/agents/tests/types.test-d.ts index de5f185dd48e..3b8bc0811569 100644 --- a/libs/langchain/src/agents/tests/types.test-d.ts +++ b/libs/langchain/src/agents/tests/types.test-d.ts @@ -2,9 +2,9 @@ import { describe, it, expectTypeOf } from "vitest"; import { z } from "zod/v3"; import { tool } from "@langchain/core/tools"; import type { BaseStore } from "@langchain/langgraph"; +import type { WithMaybeContext } from "@langchain/core/middleware"; -import { createAgent } from "../index.js"; -import type { Runtime, WithMaybeContext } from "../runtime.js"; +import { createAgent, type Runtime } from "../index.js"; describe("WithMaybeContext", () => { it("should work with string prompt", async () => { diff --git a/libs/langchain/src/agents/tools.ts b/libs/langchain/src/agents/tools.ts deleted file mode 100644 index fbc6a4e3d76b..000000000000 --- a/libs/langchain/src/agents/tools.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { - StructuredToolInterface, - DynamicTool, -} from "@langchain/core/tools"; -import type { RunnableToolLike } from "@langchain/core/runnables"; - -export type ServerTool = Record; -export type ClientTool = - | StructuredToolInterface - | DynamicTool - | RunnableToolLike; diff --git a/libs/langchain/src/agents/types.ts b/libs/langchain/src/agents/types.ts index ee2e6484a434..52dc3f7751d8 100644 --- a/libs/langchain/src/agents/types.ts +++ b/libs/langchain/src/agents/types.ts @@ -2,8 +2,22 @@ import type { InteropZodObject, InteropZodType, + InferInteropZodInput, } from "@langchain/core/utils/types"; -import type { START, END, StateGraph } from "@langchain/langgraph"; +import type { + AnnotationRoot, + START, + END, + StateGraph, + Runtime as LangGraphRuntime, +} from "@langchain/langgraph"; +import type { InteropZodToStateDefinition } from "@langchain/langgraph/zod"; +import type { ServerTool, ClientTool } from "@langchain/core/tools"; +import type { + AgentMiddleware, + JumpToTarget, + BaseRuntime, +} from "@langchain/core/middleware"; import type { LanguageModelLike } from "@langchain/core/language_models/base"; import type { BaseMessage } from "@langchain/core/messages"; @@ -21,9 +35,6 @@ import type { JsonSchemaFormat, ResponseFormatUndefined, } from "./responses.js"; -import type { AgentMiddleware, AnyAnnotationRoot } from "./middleware/types.js"; -import type { ServerTool, ClientTool } from "./tools.js"; -import type { JumpToTarget } from "./constants.js"; export type N = typeof START | "model_request" | "tools"; @@ -62,32 +73,6 @@ export type UserInput = { messages: Messages; }; -/** - * Information about a tool call that has been executed. - */ -export interface ToolCall { - /** - * The ID of the tool call. - */ - id: string; - /** - * The name of the tool that was called. - */ - name: string; - /** - * The arguments that were passed to the tool. - */ - args: Record; - /** - * The result of the tool call. - */ - result?: unknown; - /** - * An optional error message if the tool call failed. - */ - error?: string; -} - /** * Information about a tool result from a tool execution. */ @@ -307,7 +292,7 @@ export type CreateAgentParams< * * @see {@link https://docs.langchain.com/oss/javascript/langchain/middleware | Middleware} */ - middleware?: readonly AgentMiddleware[]; + middleware?: readonly AgentMiddleware[]; /** * An optional name for the agent. @@ -371,3 +356,28 @@ export type WithStateGraphNodes< > ? StateGraph : never; + +export type AnyAnnotationRoot = AnnotationRoot; + +export type ToAnnotationRoot = + A extends AnyAnnotationRoot + ? A + : A extends InteropZodObject + ? AnnotationRoot> + : never; + +/** + * Helper type to extract input type from context schema (with optional defaults) + */ +export type InferContextInput< + ContextSchema extends AnyAnnotationRoot | InteropZodObject +> = ContextSchema extends InteropZodObject + ? InferInteropZodInput + : ContextSchema extends AnyAnnotationRoot + ? ToAnnotationRoot["State"] + : {}; + +/** + * Export Runtime with LangGraph primitives + */ +export type Runtime = BaseRuntime; diff --git a/libs/langchain/src/agents/utils.ts b/libs/langchain/src/agents/utils.ts index 37e9b69f3a29..d5d589f494f3 100644 --- a/libs/langchain/src/agents/utils.ts +++ b/libs/langchain/src/agents/utils.ts @@ -7,7 +7,8 @@ import { MessageContent, ToolMessage, } from "@langchain/core/messages"; -import { MessagesAnnotation, isCommand } from "@langchain/langgraph"; +import type { ClientTool, ServerTool } from "@langchain/core/tools"; +import { MessagesAnnotation, isCommand, Command } from "@langchain/langgraph"; import { BaseChatModel, type BaseChatModelCallOptions, @@ -24,18 +25,19 @@ import { RunnableSequence, RunnableBinding, } from "@langchain/core/runnables"; +import type { + AgentBuiltInState, + AgentMiddleware, +} from "@langchain/core/middleware"; import { isBaseChatModel, isConfigurableModel } from "./model.js"; -import type { ClientTool, ServerTool } from "./tools.js"; import { MultipleToolsBoundError } from "./errors.js"; import { PROMPT_RUNNABLE_NAME } from "./constants.js"; -import type { AgentBuiltInState } from "./runtime.js"; import type { ToolCallWrapper, ToolCallHandler, - AgentMiddleware, ToolCallRequest, -} from "./middleware/types.js"; +} from "./middleware.js"; const NAME_PATTERN = /(.*?)<\/name>/s; const CONTENT_PATTERN = /(.*?)<\/content>/s; @@ -456,8 +458,8 @@ export async function bindTools( * ``` */ function chainToolCallHandlers( - handlers: ToolCallWrapper[] -): ToolCallWrapper | undefined { + handlers: ToolCallWrapper[] +): ToolCallWrapper | undefined { if (handlers.length === 0) { return undefined; } @@ -468,12 +470,12 @@ function chainToolCallHandlers( // Compose two handlers where outer wraps inner function composeTwo( - outer: ToolCallWrapper, - inner: ToolCallWrapper - ): ToolCallWrapper { + outer: ToolCallWrapper, + inner: ToolCallWrapper + ): ToolCallWrapper { return async (request, handler) => { // Create a wrapper that calls inner with the base handler - const innerHandler: ToolCallHandler = async () => + const innerHandler: ToolCallHandler = async () => inner(request, async (tc) => handler(tc)); // Call outer with the wrapped inner as its handler @@ -510,7 +512,10 @@ export function wrapToolCall(middleware: readonly AgentMiddleware[]) { /** * Wrap with error handling and validation */ - const wrappedHandler: ToolCallWrapper = async (request, handler) => { + const wrappedHandler: ToolCallWrapper = async ( + request, + handler + ) => { try { const result = await originalHandler( request as ToolCallRequest, diff --git a/libs/langchain/tsconfig.json b/libs/langchain/tsconfig.json index 8c69a82c22c2..fec93b3970ce 100644 --- a/libs/langchain/tsconfig.json +++ b/libs/langchain/tsconfig.json @@ -18,6 +18,9 @@ "allowJs": true, "strict": true }, - "include": ["src/**/*"], + "include": [ + "src/**/*", + "../providers/langchain-anthropic/src/promptCaching.ts" + ], "exclude": ["node_modules", "dist", "docs"] } diff --git a/libs/providers/langchain-anthropic/README.md b/libs/providers/langchain-anthropic/README.md index fd4f0f6b9a58..eb59dbeaa3a2 100644 --- a/libs/providers/langchain-anthropic/README.md +++ b/libs/providers/langchain-anthropic/README.md @@ -75,6 +75,58 @@ const response = await model.stream({ }); ``` +## Middleware + +This package exports middleware that can be used with [`createAgent`](https://docs.langchain.com/oss/javascript/langchain/agents) to extend agent functionality. + +### Anthropic Prompt Caching + +Reduce API costs by caching repetitive prompt prefixes with Anthropic models. This middleware is perfect for: + +- Applications with long, repeated system prompts +- Agents that reuse the same context across invocations +- Reducing API costs for high-volume deployments + +> **Note:** Learn more about [Anthropic Prompt Caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#cache-limitations) strategies and limitations. + +#### Usage + +```typescript +import { createAgent } from "langchain"; +import { promptCachingMiddleware } from "@langchain/anthropic"; +import { HumanMessage } from "@langchain/core/messages"; + +const LONG_PROMPT = ` +You are a helpful assistant with extensive knowledge. + +`; + +const agent = createAgent({ + model: "anthropic:claude-sonnet-4-latest", + systemPrompt: LONG_PROMPT, + middleware: [promptCachingMiddleware({ ttl: "5m" })], +}); + +// First call: cache is created +await agent.invoke({ + messages: [new HumanMessage("Hi, my name is Bob")], +}); + +// Second call: cache hit, system prompt is reused from cache +const result = await agent.invoke({ + messages: [new HumanMessage("What's my name?")], +}); +``` + +#### Configuration Options + +| Parameter | Description | Default | +| -------------------------- | ------------------------------------------------------------------- | -------- | +| `enableCaching` | Whether to enable prompt caching | `true` | +| `ttl` | Cache time-to-live (`"5m"` or `"1h"`) | `"5m"` | +| `minMessagesToCache` | Minimum number of messages before caching starts | `3` | +| `unsupportedModelBehavior` | Behavior for non-Anthropic models (`"ignore"`, `"warn"`, `"raise"`) | `"warn"` | + ## Development To develop the Anthropic package, you'll need to follow these instructions: @@ -103,8 +155,8 @@ Test files should live within a `tests/` file in the `src/` folder. Unit tests s end in `.int.test.ts`: ```bash -$ pnpm test -$ pnpm test:int +pnpm test +pnpm test:int ``` ### Lint & Format @@ -124,5 +176,5 @@ If you add a new file to be exported, either import & re-export from `src/index. After running `pnpm build`, publish a new version with: ```bash -$ npm publish +npm publish ``` diff --git a/libs/providers/langchain-anthropic/package.json b/libs/providers/langchain-anthropic/package.json index 2a9f9a5ba3f0..f14782e9e3b0 100644 --- a/libs/providers/langchain-anthropic/package.json +++ b/libs/providers/langchain-anthropic/package.json @@ -30,7 +30,8 @@ "format:check": "prettier --config .prettierrc --check \"src\"" }, "dependencies": { - "@anthropic-ai/sdk": "^0.65.0" + "@anthropic-ai/sdk": "^0.65.0", + "zod": "^3.25.76 || ^4" }, "peerDependencies": { "@langchain/core": "^1.0.0-alpha.6" @@ -50,8 +51,7 @@ "release-it-pnpm": "^4.6.6", "rimraf": "^5.0.1", "typescript": "~5.8.3", - "vitest": "^3.2.4", - "zod": "3.25.76" + "vitest": "^3.2.4" }, "publishConfig": { "access": "public" @@ -89,4 +89,4 @@ "files": [ "dist/" ] -} \ No newline at end of file +} diff --git a/libs/providers/langchain-anthropic/src/index.ts b/libs/providers/langchain-anthropic/src/index.ts index 8d6d08229f4b..a39781c76554 100644 --- a/libs/providers/langchain-anthropic/src/index.ts +++ b/libs/providers/langchain-anthropic/src/index.ts @@ -1,3 +1,4 @@ export * from "./chat_models.js"; export { convertPromptToAnthropic } from "./utils/prompts.js"; export { type ChatAnthropicContentBlock } from "./types.js"; +export * from "./middleware.js"; diff --git a/libs/langchain/src/agents/middleware/promptCaching.ts b/libs/providers/langchain-anthropic/src/middleware.ts similarity index 95% rename from libs/langchain/src/agents/middleware/promptCaching.ts rename to libs/providers/langchain-anthropic/src/middleware.ts index 98fb3820c1c9..ce1a38a7e752 100644 --- a/libs/langchain/src/agents/middleware/promptCaching.ts +++ b/libs/providers/langchain-anthropic/src/middleware.ts @@ -1,9 +1,13 @@ import { z } from "zod/v3"; import { ContentBlock } from "@langchain/core/messages"; +import { createMiddleware } from "@langchain/core/middleware"; import { InferInteropZodInput } from "@langchain/core/utils/types"; -import { ConfigurableModel } from "../../chat_models/universal.js"; -import { createMiddleware } from "../middleware.js"; +interface ConfigurableModel { + _defaultConfig?: { + modelProvider: string; + }; +} const DEFAULT_ENABLE_CACHING = true; const DEFAULT_TTL = "5m"; @@ -80,12 +84,12 @@ class PromptCachingMiddlewareError extends Error { * Basic usage with default settings * ```typescript * import { createAgent } from "langchain"; - * import { anthropicPromptCachingMiddleware } from "langchain"; + * import { promptCachingMiddleware } from "langchain"; * * const agent = createAgent({ * model: "anthropic:claude-3-5-sonnet", * middleware: [ - * anthropicPromptCachingMiddleware() + * promptCachingMiddleware() * ] * }); * ``` @@ -93,7 +97,7 @@ class PromptCachingMiddlewareError extends Error { * @example * Custom configuration for longer conversations * ```typescript - * const cachingMiddleware = anthropicPromptCachingMiddleware({ + * const cachingMiddleware = promptCachingMiddleware({ * ttl: "1h", // Cache for 1 hour instead of default 5 minutes * minMessagesToCache: 5 // Only cache after 5 messages * }); @@ -111,7 +115,7 @@ class PromptCachingMiddlewareError extends Error { * const agent = createAgent({ * model: "anthropic:claude-3-5-sonnet", * middleware: [ - * anthropicPromptCachingMiddleware({ + * promptCachingMiddleware({ * enableCaching: true, * ttl: "5m" * }) @@ -144,7 +148,7 @@ class PromptCachingMiddlewareError extends Error { * `, * tools: [searchKnowledgeBase, createTicket, checkOrderStatus], * middleware: [ - * anthropicPromptCachingMiddleware({ + * promptCachingMiddleware({ * ttl: "1h", // Long TTL for stable system prompt * minMessagesToCache: 1 // Cache immediately due to large system prompt * }) @@ -164,9 +168,9 @@ class PromptCachingMiddlewareError extends Error { * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching} Anthropic's prompt caching documentation * @public */ -export function anthropicPromptCachingMiddleware( +export function promptCachingMiddleware( middlewareOptions?: PromptCachingMiddlewareConfig -) { +): AgentMiddleware { return createMiddleware({ name: "PromptCachingMiddleware", contextSchema, diff --git a/libs/providers/langchain-anthropic/tsconfig.json b/libs/providers/langchain-anthropic/tsconfig.json index 5bf2c7b56562..8c69a82c22c2 100644 --- a/libs/providers/langchain-anthropic/tsconfig.json +++ b/libs/providers/langchain-anthropic/tsconfig.json @@ -3,8 +3,8 @@ "compilerOptions": { "outDir": "../dist", "rootDir": "./src", - "target": "ES2021", - "lib": ["ES2021", "ES2022.Object", "DOM"], + "target": "ES2022", + "lib": ["ES2022", "ES2022.Object", "DOM"], "module": "ES2020", "moduleResolution": "bundler", "esModuleInterop": true, diff --git a/libs/providers/langchain-azure-cosmosdb/package.json b/libs/providers/langchain-azure-cosmosdb/package.json index bb4dfd9d06b9..4794d5d2ea8d 100644 --- a/libs/providers/langchain-azure-cosmosdb/package.json +++ b/libs/providers/langchain-azure-cosmosdb/package.json @@ -31,7 +31,7 @@ "dependencies": { "@azure/cosmos": "^4.2.0", "@azure/identity": "^4.5.0", - "mongodb": "^6.17.0" + "mongodb": "^6.20.0" }, "peerDependencies": { "@langchain/core": ">=0.2.21 <0.4.0" diff --git a/libs/providers/langchain-mongodb/package.json b/libs/providers/langchain-mongodb/package.json index b7deddc7c2f5..d8330f5f1c57 100644 --- a/libs/providers/langchain-mongodb/package.json +++ b/libs/providers/langchain-mongodb/package.json @@ -26,7 +26,7 @@ "format:check": "prettier --config .prettierrc --check \"src\"" }, "dependencies": { - "mongodb": "^6.17.0" + "mongodb": "^6.20.0" }, "peerDependencies": { "@langchain/core": ">=0.2.21 <0.4.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e4846a0ee9f..50ea5be2ddc0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,7 +54,7 @@ importers: version: 3.858.0 '@azure/identity': specifier: ^4.2.1 - version: 4.13.0 + version: 4.10.2 '@browserbasehq/stagehand': specifier: ^1.3.0 version: 1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76) @@ -150,7 +150,7 @@ importers: version: link:../libs/providers/langchain-groq '@langchain/langgraph': specifier: next - version: 1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) + version: 1.0.0-alpha.4(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) '@langchain/mistralai': specifier: workspace:* version: link:../libs/providers/langchain-mistralai @@ -309,7 +309,7 @@ importers: version: link:../libs/langchain langsmith: specifier: ^0.3.64 - version: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + version: 0.3.64(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) lorem-ipsum: specifier: ^2.0.8 version: 2.0.8 @@ -467,22 +467,22 @@ importers: dependencies: '@eslint/js': specifier: ^9.34.0 - version: 9.36.0 + version: 9.35.0 '@types/node': specifier: ^24.3.0 - version: 24.6.1 + version: 24.3.1 eslint-config-prettier: specifier: ^10.1.8 - version: 10.1.8(eslint@9.36.0(jiti@2.5.1)) + version: 10.1.8(eslint@9.35.0(jiti@2.5.1)) eslint-plugin-import: specifier: ^2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint@9.36.0(jiti@2.5.1)) + version: 2.32.0(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1)) eslint-plugin-no-instanceof: specifier: ^1.0.1 version: 1.0.1 eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.5.4(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.36.0(jiti@2.5.1)))(eslint@9.36.0(jiti@2.5.1))(prettier@3.6.2) + version: 5.5.4(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.35.0(jiti@2.5.1)))(eslint@9.35.0(jiti@2.5.1))(prettier@3.6.2) globals: specifier: ^16.4.0 version: 16.4.0 @@ -491,14 +491,14 @@ importers: version: 3.6.2 typescript-eslint: specifier: ^8.40.0 - version: 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) + version: 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) devDependencies: eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) typescript: specifier: ^5.9.2 - version: 5.9.3 + version: 5.9.2 internal/net-mocks: dependencies: @@ -526,7 +526,7 @@ importers: version: 1.0.4 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^3.6.1 version: 3.6.2 @@ -545,7 +545,7 @@ importers: version: link:../eslint eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^3.6.1 version: 3.6.2 @@ -575,7 +575,7 @@ importers: version: 16.6.1 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) fast-glob: specifier: ^3.3.2 version: 3.3.3 @@ -602,7 +602,7 @@ importers: dependencies: '@langchain/langgraph': specifier: next - version: 1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) + version: 1.0.0-alpha.4(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) '@langchain/langgraph-checkpoint': specifier: ^0.1.1 version: 0.1.1(@langchain/core@libs+langchain-core) @@ -657,10 +657,10 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) openai: specifier: ^5.1.0 - version: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + version: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) peggy: specifier: ^3.0.2 version: 3.0.2 @@ -697,7 +697,7 @@ importers: optionalDependencies: langsmith: specifier: ^0.3.64 - version: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + version: 0.3.64(@opentelemetry/api@1.9.0)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) libs/langchain-classic: dependencies: @@ -730,7 +730,7 @@ importers: version: 2.8.1 zod: specifier: ^3.25.76 || ^4 - version: 3.25.76 + version: 4.1.11 devDependencies: '@aws-sdk/dsql-signer': specifier: ^3.858.0 @@ -740,7 +740,7 @@ importers: version: 4.13.0 '@browserbasehq/stagehand': specifier: ^1.3.0 - version: 1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76) + version: 1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11))(utf-8-validate@6.0.5)(zod@4.1.11) '@clickhouse/client': specifier: ^0.2.5 version: 0.2.10 @@ -827,7 +827,7 @@ importers: version: link:../providers/langchain-groq '@langchain/langgraph': specifier: 1.0.0-alpha.5 - version: 1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) + version: 1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@4.1.11))(zod@4.1.11) '@langchain/mistralai': specifier: workspace:* version: link:../providers/langchain-mistralai @@ -866,7 +866,7 @@ importers: version: 0.1.0(@langchain/core@libs+langchain-core) '@layerup/layerup-security': specifier: ^1.5.12 - version: 1.6.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + version: 1.6.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) '@opensearch-project/opensearch': specifier: ^2.2.0 version: 2.13.0 @@ -935,7 +935,7 @@ importers: version: 1.0.0-rc.12 chromadb: specifier: ^1.5.3 - version: 1.10.5(@google/generative-ai@0.7.1)(cohere-ai@7.18.0(encoding@0.1.13))(encoding@0.1.13)(ollama@0.5.16)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + version: 1.10.5(@google/generative-ai@0.7.1)(cohere-ai@7.18.0(encoding@0.1.13))(encoding@0.1.13)(ollama@0.5.16)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11)) cohere-ai: specifier: ^7.14.0 version: 7.18.0(encoding@0.1.13) @@ -980,19 +980,19 @@ importers: version: 2.0.8 lunary: specifier: ^0.8.8 - version: 0.8.8(@anthropic-ai/sdk@0.65.0(zod@3.25.76))(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0) + version: 0.8.8(@anthropic-ai/sdk@0.65.0(zod@4.1.11))(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11))(react@19.0.0) mariadb: specifier: ^3.4.0 version: 3.4.5 mem0ai: specifier: ^2.1.8 - version: 2.1.36(@anthropic-ai/sdk@0.65.0(zod@3.25.76))(@cloudflare/workers-types@4.20250801.0)(@google/genai@1.12.0(@modelcontextprotocol/sdk@1.19.1)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5))(@langchain/core@libs+langchain-core)(@mistralai/mistralai@1.7.5(zod@3.25.76))(@qdrant/js-client-rest@1.15.0(typescript@5.8.3))(@supabase/supabase-js@2.53.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@types/jest@29.5.14)(@types/pg@8.15.5)(@types/sqlite3@3.1.11)(cloudflare@4.5.0(encoding@0.1.13))(encoding@0.1.13)(groq-sdk@0.19.0(encoding@0.1.13))(neo4j-driver@5.28.1)(ollama@0.5.16)(pg@8.16.3)(redis@4.7.1)(sqlite3@5.1.7)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + version: 2.1.36(@anthropic-ai/sdk@0.65.0(zod@4.1.11))(@cloudflare/workers-types@4.20250801.0)(@google/genai@1.12.0(@modelcontextprotocol/sdk@1.19.1)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5))(@langchain/core@libs+langchain-core)(@mistralai/mistralai@1.7.5(zod@4.1.11))(@qdrant/js-client-rest@1.15.0(typescript@5.8.3))(@supabase/supabase-js@2.53.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@types/jest@29.5.14)(@types/pg@8.15.5)(@types/sqlite3@3.1.11)(cloudflare@4.5.0(encoding@0.1.13))(encoding@0.1.13)(groq-sdk@0.19.0(encoding@0.1.13))(neo4j-driver@5.28.1)(ollama@0.5.16)(pg@8.16.3)(redis@4.7.1)(sqlite3@5.1.7)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5)) mongodb: - specifier: ^6.17.0 + specifier: ^6.20.0 version: 6.20.0(@aws-sdk/credential-providers@3.858.0)(socks@2.8.6) openai: specifier: ^5.1.0 - version: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + version: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) peggy: specifier: ^3.0.2 version: 3.0.2 @@ -1052,11 +1052,11 @@ importers: version: 3.8.0(encoding@0.1.13) zod-to-json-schema: specifier: ^3.24.6 - version: 3.24.6(zod@3.25.76) + version: 3.24.6(zod@4.1.11) optionalDependencies: langsmith: specifier: ^0.3.64 - version: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + version: 0.3.64(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11)) libs/langchain-community: dependencies: @@ -1129,7 +1129,7 @@ importers: version: 1.5.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@browserbasehq/stagehand': specifier: ^1.0.0 - version: 1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76) + version: 1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76) '@clickhouse/client': specifier: ^0.2.5 version: 0.2.10 @@ -1150,7 +1150,7 @@ importers: version: 4.0.6 '@getzep/zep-cloud': specifier: ^1.0.6 - version: 1.0.12(@langchain/core@libs+langchain-core)(encoding@0.1.13)(langchain@0.3.30(1037dd7ffc4b4df883b20cb3da1eaf84)) + version: 1.0.12(@langchain/core@libs+langchain-core)(encoding@0.1.13)(langchain@0.3.30(5a003b2f9a341c53c0717933ef05322e)) '@getzep/zep-js': specifier: ^0.9.0 version: 0.9.0 @@ -1411,7 +1411,7 @@ importers: version: 3.0.2(ts-toolbelt@9.6.0) eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) faiss-node: specifier: ^0.5.1 version: 0.5.1 @@ -1420,7 +1420,7 @@ importers: version: 4.5.3 firebase-admin: specifier: ^11.9.0 || ^12.0.0 || ^13.0.0 - version: 13.5.0(encoding@0.1.13) + version: 12.7.0(encoding@0.1.13) google-auth-library: specifier: ^9.10.0 version: 9.15.1(encoding@0.1.13) @@ -1471,7 +1471,7 @@ importers: version: 4.17.21 lunary: specifier: ^0.7.10 - version: 0.7.15(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0) + version: 0.7.15(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0) mammoth: specifier: ^1.6.0 version: 1.9.1 @@ -1482,7 +1482,7 @@ importers: specifier: ^2.1.8 version: 2.1.36(@anthropic-ai/sdk@0.65.0(zod@3.25.76))(@cloudflare/workers-types@4.20250801.0)(@google/genai@1.12.0(@modelcontextprotocol/sdk@1.19.1)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5))(@langchain/core@libs+langchain-core)(@mistralai/mistralai@1.7.5(zod@3.25.76))(@qdrant/js-client-rest@1.15.0(typescript@5.8.3))(@supabase/supabase-js@2.53.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@types/jest@29.5.14)(@types/pg@8.15.5)(@types/sqlite3@3.1.11)(cloudflare@4.5.0(encoding@0.1.13))(encoding@0.1.13)(groq-sdk@0.19.0(encoding@0.1.13))(neo4j-driver@5.28.1)(ollama@0.5.16)(pg@8.16.3)(redis@4.7.1)(sqlite3@5.1.7)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5)) mongodb: - specifier: ^6.17.0 + specifier: ^6.20.0 version: 6.20.0(@aws-sdk/credential-providers@3.858.0)(socks@2.8.6) mysql2: specifier: ^3.9.8 @@ -1501,7 +1501,7 @@ importers: version: 4.2.0 openai: specifier: '*' - version: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + version: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) pdf-parse: specifier: 1.1.1 version: 1.1.1 @@ -1597,7 +1597,7 @@ importers: version: 1.0.20 langsmith: specifier: ^0.3.64 - version: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + version: 0.3.64(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) mustache: specifier: ^4.2.0 version: 4.2.0 @@ -1634,7 +1634,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) ml-matrix: specifier: ^6.10.4 version: 6.12.1 @@ -1685,7 +1685,7 @@ importers: version: 5.0.10 rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-morph: specifier: ^21.0.1 version: 21.0.1 @@ -1722,7 +1722,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@18.19.121)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@18.19.121)(typescript@5.8.3)) @@ -1771,7 +1771,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -1786,7 +1786,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -1820,7 +1820,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -1832,7 +1832,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -1844,11 +1844,14 @@ importers: dependencies: '@anthropic-ai/sdk': specifier: ^0.65.0 - version: 0.65.0(zod@3.25.76) + version: 0.65.0(zod@4.1.11) + zod: + specifier: ^3.25.76 || ^4 + version: 4.1.11 devDependencies: '@anthropic-ai/vertex-sdk': specifier: ^0.11.5 - version: 0.11.5(zod@3.25.76) + version: 0.11.5(zod@4.1.11) '@langchain/core': specifier: workspace:* version: link:../../langchain-core @@ -1872,7 +1875,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -1891,9 +1894,6 @@ importers: vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.6.1)(jiti@2.5.1)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1) - zod: - specifier: 3.25.76 - version: 3.25.76 libs/providers/langchain-aws: dependencies: @@ -1939,7 +1939,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -1951,7 +1951,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -1969,9 +1969,9 @@ importers: version: 4.5.0 '@azure/identity': specifier: ^4.5.0 - version: 4.13.0 + version: 4.10.2 mongodb: - specifier: ^6.17.0 + specifier: ^6.20.0 version: 6.20.0(@aws-sdk/credential-providers@3.858.0)(socks@2.8.6) devDependencies: '@langchain/core': @@ -1997,7 +1997,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2009,7 +2009,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2021,7 +2021,7 @@ importers: dependencies: '@azure/identity': specifier: ^4.2.1 - version: 4.13.0 + version: 4.10.2 uuid: specifier: ^10.0.0 version: 10.0.0 @@ -2049,7 +2049,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2061,7 +2061,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2101,7 +2101,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2113,7 +2113,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2162,7 +2162,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2180,7 +2180,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2226,7 +2226,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2238,7 +2238,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2278,7 +2278,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2290,7 +2290,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2330,7 +2330,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2342,7 +2342,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2379,7 +2379,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2391,7 +2391,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2446,7 +2446,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2467,7 +2467,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 testcontainers: specifier: ^10.23.0 version: 10.28.0 @@ -2513,7 +2513,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2531,7 +2531,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2574,7 +2574,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2592,7 +2592,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2641,7 +2641,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) hnswlib-node: specifier: ^3.0.0 version: 3.0.0 @@ -2662,7 +2662,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2708,7 +2708,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2726,7 +2726,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2772,7 +2772,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2790,7 +2790,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2836,7 +2836,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) jest: specifier: ^29.5.0 version: 29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)) @@ -2854,7 +2854,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 ts-jest: specifier: ^29.1.0 version: 29.4.0(@babel/core@7.28.0)(@jest/transform@30.0.5)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@30.0.5)(jest@29.7.0(@types/node@24.6.1)(ts-node@10.9.2(@swc/core@1.13.3(@swc/helpers@0.5.17))(@types/node@24.6.1)(typescript@5.8.3)))(typescript@5.8.3) @@ -2900,7 +2900,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -2912,7 +2912,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -2921,7 +2921,7 @@ importers: version: 3.2.4(@types/debug@4.1.12)(@types/node@24.6.1)(jiti@2.5.1)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1) zod: specifier: ^4.0.14 - version: 4.1.11 + version: 4.1.5 libs/providers/langchain-mcp-adapters: dependencies: @@ -2946,7 +2946,7 @@ importers: version: link:../../../internal/eslint '@langchain/langgraph': specifier: next - version: 1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) + version: 1.0.0-alpha.4(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76) '@langchain/openai': specifier: workspace:* version: link:../langchain-openai @@ -3044,7 +3044,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3056,7 +3056,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3096,7 +3096,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3108,7 +3108,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3119,7 +3119,7 @@ importers: libs/providers/langchain-mongodb: dependencies: mongodb: - specifier: ^6.17.0 + specifier: ^6.20.0 version: 6.20.0(@aws-sdk/credential-providers@3.858.0)(socks@2.8.6) devDependencies: '@langchain/core': @@ -3151,7 +3151,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3163,7 +3163,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 testcontainers: specifier: ^10.25.0 version: 10.28.0 @@ -3212,7 +3212,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3224,7 +3224,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3267,7 +3267,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3279,7 +3279,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3304,7 +3304,7 @@ importers: devDependencies: '@azure/identity': specifier: ^4.2.1 - version: 4.13.0 + version: 4.10.2 '@cfworker/json-schema': specifier: ^4.1.1 version: 4.1.1 @@ -3331,7 +3331,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3401,7 +3401,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) langchain: specifier: workspace:* version: link:../../langchain @@ -3456,7 +3456,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3468,7 +3468,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3508,7 +3508,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3554,7 +3554,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3603,7 +3603,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) langchain: specifier: workspace:* version: link:../../langchain @@ -3618,7 +3618,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3658,7 +3658,7 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 @@ -3670,7 +3670,7 @@ importers: version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.6.1)(magicast@0.3.5)) rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -3703,13 +3703,13 @@ importers: version: 3.14.0 eslint: specifier: ^9.34.0 - version: 9.36.0(jiti@2.5.1) + version: 9.35.0(jiti@2.5.1) prettier: specifier: ^2.8.3 version: 2.8.8 rollup: specifier: ^4.5.2 - version: 4.52.4 + version: 4.46.2 typescript: specifier: ~5.8.3 version: 5.8.3 @@ -4056,6 +4056,10 @@ packages: resolution: {integrity: sha512-JsTh4twb6FcwP7rJwxQiNZQ/LGtuF6gmciaxY9Rnp6/A325Lhsw/SH4R2ArpT0yCvozbZpweIwdPfUkXVBtp5w==} engines: {node: '>=20.0.0'} + '@azure/identity@4.10.2': + resolution: {integrity: sha512-Uth4vz0j+fkXCkbvutChUj03PDCokjbC6Wk9JT8hHEUtpy/EurNKAseb3+gO6Zi9VYBvwt61pgbzn1ovk942Qg==} + engines: {node: '>=20.0.0'} + '@azure/identity@4.13.0': resolution: {integrity: sha512-uWC0fssc+hs1TGGVkkghiaFkkS7NkTxfnCH+Hdg+yTehTpMcehpok4PgUKKdyCH+9ldu6FhiHRv84Ntqj1vVcw==} engines: {node: '>=20.0.0'} @@ -5430,6 +5434,12 @@ packages: cpu: [x64] os: [win32] + '@eslint-community/eslint-utils@4.7.0': + resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@eslint-community/eslint-utils@4.9.0': resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5456,6 +5466,10 @@ packages: resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.35.0': + resolution: {integrity: sha512-30iXE9whjlILfWobBkNerJo+TXYsgVM5ERQwMcMKCHckHflCmf7wXDAHlARoWnh0s1U72WqlbeyE7iAcCzuCPw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.36.0': resolution: {integrity: sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -6083,6 +6097,9 @@ packages: resolution: {integrity: sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + '@jridgewell/gen-mapping@0.3.12': + resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -6090,12 +6107,21 @@ packages: resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} + '@jridgewell/source-map@0.3.10': + resolution: {integrity: sha512-0pPkgz9dY+bijgistcTTJ5mR+ocqRXLuhXHYdzoMmmoJ2C9S46RCm2GMUbatPEUK9Yjy26IrAy8D/M00lLkv+Q==} + '@jridgewell/source-map@0.3.11': resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} + '@jridgewell/sourcemap-codec@1.5.4': + resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} + '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/trace-mapping@0.3.29': + resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} + '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} @@ -6253,6 +6279,17 @@ packages: react-dom: optional: true + '@langchain/langgraph@1.0.0-alpha.4': + resolution: {integrity: sha512-TI0SYmEiZziyyB9LmapY5OZhd92A/cO4Du1CmxIf5Ri7yhhzR+od3zvvdt1GvchOxD2YtXP4Er8nZOkK70WGQw==} + engines: {node: '>=18'} + peerDependencies: + '@langchain/core': workspace:* + zod: ^3.25.32 || ^4.1.0 + zod-to-json-schema: ^3.x + peerDependenciesMeta: + zod-to-json-schema: + optional: true + '@langchain/langgraph@1.0.0-alpha.5': resolution: {integrity: sha512-Sg0LZ/zb0osMT+2/poTRH6GbmzSYxPVzZPXikjryCFMCw52HGbq0sLEXFsaqfs+1HCcDs1Ob6IPw8IucE5pM9Q==} engines: {node: '>=18'} @@ -7377,51 +7414,101 @@ packages: rollup: optional: true + '@rollup/rollup-android-arm-eabi@4.46.2': + resolution: {integrity: sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==} + cpu: [arm] + os: [android] + '@rollup/rollup-android-arm-eabi@4.52.4': resolution: {integrity: sha512-BTm2qKNnWIQ5auf4deoetINJm2JzvihvGb9R6K/ETwKLql/Bb3Eg2H1FBp1gUb4YGbydMA3jcmQTR73q7J+GAA==} cpu: [arm] os: [android] + '@rollup/rollup-android-arm64@4.46.2': + resolution: {integrity: sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==} + cpu: [arm64] + os: [android] + '@rollup/rollup-android-arm64@4.52.4': resolution: {integrity: sha512-P9LDQiC5vpgGFgz7GSM6dKPCiqR3XYN1WwJKA4/BUVDjHpYsf3iBEmVz62uyq20NGYbiGPR5cNHI7T1HqxNs2w==} cpu: [arm64] os: [android] + '@rollup/rollup-darwin-arm64@4.46.2': + resolution: {integrity: sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==} + cpu: [arm64] + os: [darwin] + '@rollup/rollup-darwin-arm64@4.52.4': resolution: {integrity: sha512-QRWSW+bVccAvZF6cbNZBJwAehmvG9NwfWHwMy4GbWi/BQIA/laTIktebT2ipVjNncqE6GLPxOok5hsECgAxGZg==} cpu: [arm64] os: [darwin] + '@rollup/rollup-darwin-x64@4.46.2': + resolution: {integrity: sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==} + cpu: [x64] + os: [darwin] + '@rollup/rollup-darwin-x64@4.52.4': resolution: {integrity: sha512-hZgP05pResAkRJxL1b+7yxCnXPGsXU0fG9Yfd6dUaoGk+FhdPKCJ5L1Sumyxn8kvw8Qi5PvQ8ulenUbRjzeCTw==} cpu: [x64] os: [darwin] + '@rollup/rollup-freebsd-arm64@4.46.2': + resolution: {integrity: sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==} + cpu: [arm64] + os: [freebsd] + '@rollup/rollup-freebsd-arm64@4.52.4': resolution: {integrity: sha512-xmc30VshuBNUd58Xk4TKAEcRZHaXlV+tCxIXELiE9sQuK3kG8ZFgSPi57UBJt8/ogfhAF5Oz4ZSUBN77weM+mQ==} cpu: [arm64] os: [freebsd] + '@rollup/rollup-freebsd-x64@4.46.2': + resolution: {integrity: sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==} + cpu: [x64] + os: [freebsd] + '@rollup/rollup-freebsd-x64@4.52.4': resolution: {integrity: sha512-WdSLpZFjOEqNZGmHflxyifolwAiZmDQzuOzIq9L27ButpCVpD7KzTRtEG1I0wMPFyiyUdOO+4t8GvrnBLQSwpw==} cpu: [x64] os: [freebsd] + '@rollup/rollup-linux-arm-gnueabihf@4.46.2': + resolution: {integrity: sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-gnueabihf@4.52.4': resolution: {integrity: sha512-xRiOu9Of1FZ4SxVbB0iEDXc4ddIcjCv2aj03dmW8UrZIW7aIQ9jVJdLBIhxBI+MaTnGAKyvMwPwQnoOEvP7FgQ==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.46.2': + resolution: {integrity: sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.52.4': resolution: {integrity: sha512-FbhM2p9TJAmEIEhIgzR4soUcsW49e9veAQCziwbR+XWB2zqJ12b4i/+hel9yLiD8pLncDH4fKIPIbt5238341Q==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.46.2': + resolution: {integrity: sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.52.4': resolution: {integrity: sha512-4n4gVwhPHR9q/g8lKCyz0yuaD0MvDf7dV4f9tHt0C73Mp8h38UCtSCSE6R9iBlTbXlmA8CjpsZoujhszefqueg==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-musl@4.46.2': + resolution: {integrity: sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-musl@4.52.4': resolution: {integrity: sha512-u0n17nGA0nvi/11gcZKsjkLj1QIpAuPFQbR48Subo7SmZJnGxDpspyw2kbpuoQnyK+9pwf3pAoEXerJs/8Mi9g==} cpu: [arm64] @@ -7432,31 +7519,66 @@ packages: cpu: [loong64] os: [linux] + '@rollup/rollup-linux-loongarch64-gnu@4.46.2': + resolution: {integrity: sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.46.2': + resolution: {integrity: sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==} + cpu: [ppc64] + os: [linux] + '@rollup/rollup-linux-ppc64-gnu@4.52.4': resolution: {integrity: sha512-teSACug1GyZHmPDv14VNbvZFX779UqWTsd7KtTM9JIZRDI5NUwYSIS30kzI8m06gOPB//jtpqlhmraQ68b5X2g==} cpu: [ppc64] os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.46.2': + resolution: {integrity: sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.52.4': resolution: {integrity: sha512-/MOEW3aHjjs1p4Pw1Xk4+3egRevx8Ji9N6HUIA1Ifh8Q+cg9dremvFCUbOX2Zebz80BwJIgCBUemjqhU5XI5Eg==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-riscv64-musl@4.46.2': + resolution: {integrity: sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-riscv64-musl@4.52.4': resolution: {integrity: sha512-1HHmsRyh845QDpEWzOFtMCph5Ts+9+yllCrREuBR/vg2RogAQGGBRC8lDPrPOMnrdOJ+mt1WLMOC2Kao/UwcvA==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.46.2': + resolution: {integrity: sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==} + cpu: [s390x] + os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.52.4': resolution: {integrity: sha512-seoeZp4L/6D1MUyjWkOMRU6/iLmCU2EjbMTyAG4oIOs1/I82Y5lTeaxW0KBfkUdHAWN7j25bpkt0rjnOgAcQcA==} cpu: [s390x] os: [linux] + '@rollup/rollup-linux-x64-gnu@4.46.2': + resolution: {integrity: sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-gnu@4.52.4': resolution: {integrity: sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-musl@4.46.2': + resolution: {integrity: sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-musl@4.52.4': resolution: {integrity: sha512-dtBZYjDmCQ9hW+WgEkaffvRRCKm767wWhxsFW3Lw86VXz/uJRuD438/XvbZT//B96Vs8oTA8Q4A0AfHbrxP9zw==} cpu: [x64] @@ -7467,11 +7589,21 @@ packages: cpu: [arm64] os: [openharmony] + '@rollup/rollup-win32-arm64-msvc@4.46.2': + resolution: {integrity: sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==} + cpu: [arm64] + os: [win32] + '@rollup/rollup-win32-arm64-msvc@4.52.4': resolution: {integrity: sha512-8GKr640PdFNXwzIE0IrkMWUNUomILLkfeHjXBi/nUvFlpZP+FA8BKGKpacjW6OUUHaNI6sUURxR2U2g78FOHWQ==} cpu: [arm64] os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.46.2': + resolution: {integrity: sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==} + cpu: [ia32] + os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.52.4': resolution: {integrity: sha512-AIy/jdJ7WtJ/F6EcfOb2GjR9UweO0n43jNObQMb6oGxkYTfLcnN7vYYpG+CN3lLxrQkzWnMOoNSHTW54pgbVxw==} cpu: [ia32] @@ -7482,6 +7614,11 @@ packages: cpu: [x64] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.46.2': + resolution: {integrity: sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==} + cpu: [x64] + os: [win32] + '@rollup/rollup-win32-x64-msvc@4.52.4': resolution: {integrity: sha512-bf9PtUa0u8IXDVxzRToFQKsNCRz9qLYfR/MpECxl4mRoWYjAeFjgxj1XdZr2M/GNVpT05p+LgQOHopYDlUu6/w==} cpu: [x64] @@ -8197,9 +8334,18 @@ packages: '@types/node@20.19.9': resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} + '@types/node@22.17.0': + resolution: {integrity: sha512-bbAKTCqX5aNVryi7qXVMi+OkB3w/OyblodicMbvE38blyAz7GxXf6XYhklokijuPwwVg9sDLKRxt0ZHXQwZVfQ==} + '@types/node@22.18.8': resolution: {integrity: sha512-pAZSHMiagDR7cARo/cch1f3rXy0AEXwsVsVH09FcyeJVAzCnGgmYis7P3JidtTUjyadhTeSo8TgRPswstghDaw==} + '@types/node@24.1.0': + resolution: {integrity: sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==} + + '@types/node@24.3.1': + resolution: {integrity: sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==} + '@types/node@24.6.1': resolution: {integrity: sha512-ljvjjs3DNXummeIaooB4cLBKg2U6SPI6Hjra/9rRIy7CpM0HpLtG9HptkMKAb4HYWy5S7HUvJEuWgr/y0U8SHw==} @@ -8309,6 +8455,14 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} + '@typescript-eslint/eslint-plugin@8.43.0': + resolution: {integrity: sha512-8tg+gt7ENL7KewsKMKDHXR1vm8tt9eMxjJBYINf6swonlWgkYn5NwyIgXpbbDxTNU5DgpDFfj95prcTq2clIQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.43.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/eslint-plugin@8.45.0': resolution: {integrity: sha512-HC3y9CVuevvWCl/oyZuI47dOeDF9ztdMEfMH8/DW/Mhwa9cCLnK1oD7JoTVGW/u7kFzNZUKUoyJEqkaJh5y3Wg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8317,6 +8471,13 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/parser@8.43.0': + resolution: {integrity: sha512-B7RIQiTsCBBmY+yW4+ILd6mF5h1FUwJsVvpqkrgpszYifetQ2Ke+Z4u6aZh0CblkUGIdR59iYVyXqqZGkZ3aBw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/parser@8.45.0': resolution: {integrity: sha512-TGf22kon8KW+DeKaUmOibKWktRY8b2NSAZNdtWh798COm1NWx8+xJ6iFBtk3IvLdv6+LGLJLRlyhrhEDZWargQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8324,22 +8485,45 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/project-service@8.43.0': + resolution: {integrity: sha512-htB/+D/BIGoNTQYffZw4uM4NzzuolCoaA/BusuSIcC8YjmBYQioew5VUZAYdAETPjeed0hqCaW7EHg+Robq8uw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/project-service@8.45.0': resolution: {integrity: sha512-3pcVHwMG/iA8afdGLMuTibGR7pDsn9RjDev6CCB+naRsSYs2pns5QbinF4Xqw6YC/Sj3lMrm/Im0eMfaa61WUg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/scope-manager@8.43.0': + resolution: {integrity: sha512-daSWlQ87ZhsjrbMLvpuuMAt3y4ba57AuvadcR7f3nl8eS3BjRc8L9VLxFLk92RL5xdXOg6IQ+qKjjqNEimGuAg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/scope-manager@8.45.0': resolution: {integrity: sha512-clmm8XSNj/1dGvJeO6VGH7EUSeA0FMs+5au/u3lrA3KfG8iJ4u8ym9/j2tTEoacAffdW1TVUzXO30W1JTJS7dA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/tsconfig-utils@8.43.0': + resolution: {integrity: sha512-ALC2prjZcj2YqqL5X/bwWQmHA2em6/94GcbB/KKu5SX3EBDOsqztmmX1kMkvAJHzxk7TazKzJfFiEIagNV3qEA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/tsconfig-utils@8.45.0': resolution: {integrity: sha512-aFdr+c37sc+jqNMGhH+ajxPXwjv9UtFZk79k8pLoJ6p4y0snmYpPA52GuWHgt2ZF4gRRW6odsEj41uZLojDt5w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/type-utils@8.43.0': + resolution: {integrity: sha512-qaH1uLBpBuBBuRf8c1mLJ6swOfzCXryhKND04Igr4pckzSEW9JX5Aw9AgW00kwfjWJF0kk0ps9ExKTfvXfw4Qg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/type-utils@8.45.0': resolution: {integrity: sha512-bpjepLlHceKgyMEPglAeULX1vixJDgaKocp0RVJ5u4wLJIMNuKtUXIczpJCPcn2waII0yuvks/5m5/h3ZQKs0A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8347,16 +8531,33 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/types@8.43.0': + resolution: {integrity: sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/types@8.45.0': resolution: {integrity: sha512-WugXLuOIq67BMgQInIxxnsSyRLFxdkJEJu8r4ngLR56q/4Q5LrbfkFRH27vMTjxEK8Pyz7QfzuZe/G15qQnVRA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@8.43.0': + resolution: {integrity: sha512-7Vv6zlAhPb+cvEpP06WXXy/ZByph9iL6BQRBDj4kmBsW98AqEeQHlj/13X+sZOrKSo9/rNKH4Ul4f6EICREFdw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/typescript-estree@8.45.0': resolution: {integrity: sha512-GfE1NfVbLam6XQ0LcERKwdTTPlLvHvXXhOeUGC1OXi4eQBoyy1iVsW+uzJ/J9jtCz6/7GCQ9MtrQ0fml/jWCnA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/utils@8.43.0': + resolution: {integrity: sha512-S1/tEmkUeeswxd0GGcnwuVQPFWo8NzZTOMxCvw8BX7OMxnNae+i8Tm7REQen/SwUIPoPqfKn7EaZ+YLpiB3k9g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/utils@8.45.0': resolution: {integrity: sha512-bxi1ht+tLYg4+XV2knz/F7RVhU0k6VrSMc9sb8DQ6fyCTrGQLHfo7lDtN0QJjZjKkLA2ThrKuCdHEvLReqtIGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8364,6 +8565,10 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/visitor-keys@8.43.0': + resolution: {integrity: sha512-T+S1KqRD4sg/bHfLwrpF/K3gQLBM1n7Rp7OjjikjTEssI2YJzQpi5WXoynOaQ93ERIuq3O8RBTOUYDKszUCEHw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.45.0': resolution: {integrity: sha512-qsaFBA3e09MIDAGFUrTk+dzqtfv1XPVz8t8d1f0ybTzrCY7BKiMC5cjrl1O/P7UmHsNyW90EYSkU/ZWpmXelag==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -9923,6 +10128,15 @@ packages: supports-color: optional: true + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -10463,6 +10677,16 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@9.35.0: + resolution: {integrity: sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + eslint@9.36.0: resolution: {integrity: sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -12303,6 +12527,23 @@ packages: typeorm: optional: true + langsmith@0.3.64: + resolution: {integrity: sha512-67yccwrREK5pgVX7PktkUImbNT4bQpSPH7SETSPYZ+X42OpGGAABU4s+pNV/55/ke+INrmpXXlKxfMpZOCrzQA==} + peerDependencies: + '@opentelemetry/api': '*' + '@opentelemetry/exporter-trace-otlp-proto': '*' + '@opentelemetry/sdk-trace-base': '*' + openai: '*' + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@opentelemetry/exporter-trace-otlp-proto': + optional: true + '@opentelemetry/sdk-trace-base': + optional: true + openai: + optional: true + langsmith@0.3.74: resolution: {integrity: sha512-ZuW3Qawz8w88XcuCRH91yTp6lsdGuwzRqZ5J0Hf5q/AjMz7DwcSv0MkE6V5W+8hFMI850QZN2Wlxwm3R9lHlZg==} peerDependencies: @@ -13148,6 +13389,9 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + nwsapi@2.2.21: + resolution: {integrity: sha512-o6nIY3qwiSXl7/LuOU0Dmuctd34Yay0yeuZRLFmDPrrdHpXKFndPj3hM+YEPVHYC5fx2otBx4Ilc/gyYSAUaIA==} + nwsapi@2.2.22: resolution: {integrity: sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==} @@ -13295,6 +13539,18 @@ packages: zod: optional: true + openai@5.11.0: + resolution: {integrity: sha512-+AuTc5pVjlnTuA9zvn8rA/k+1RluPIx9AD4eDcnutv6JNwHHZxIhkFy+tmMKCvmMFDQzfA/r1ujvPWB19DQkYg==} + hasBin: true + peerDependencies: + ws: ^8.18.0 + zod: ^3.23.8 + peerDependenciesMeta: + ws: + optional: true + zod: + optional: true + openai@5.12.2: resolution: {integrity: sha512-xqzHHQch5Tws5PcKR2xsZGX9xtch+JQFz5zb14dGqlshmmDAFBFEWmeIpf7wVqWV+w7Emj7jRgkNJakyKE0tYQ==} hasBin: true @@ -14306,6 +14562,11 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true + rollup@4.46.2: + resolution: {integrity: sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + rollup@4.52.4: resolution: {integrity: sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -14919,6 +15180,11 @@ packages: uglify-js: optional: true + terser@5.43.1: + resolution: {integrity: sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==} + engines: {node: '>=10'} + hasBin: true + terser@5.44.0: resolution: {integrity: sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==} engines: {node: '>=10'} @@ -15341,6 +15607,13 @@ packages: typeorm-aurora-data-api-driver: optional: true + typescript-eslint@8.43.0: + resolution: {integrity: sha512-FyRGJKUGvcFekRRcBKFBlAhnp4Ng8rhe8tuvvkR9OiU0gfd4vyvTRQHEckO6VDlH57jbeUQem2IpqPq9kLJH+w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + typescript-eslint@8.45.0: resolution: {integrity: sha512-qzDmZw/Z5beNLUrXfd0HIW6MzIaAV5WNDxmMs9/3ojGOpYavofgNAAD/nC6tGV2PczIi0iw8vot2eAe/sBn7zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -15361,6 +15634,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} + engines: {node: '>=14.17'} + hasBin: true + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -15429,9 +15707,15 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + undici-types@7.13.0: resolution: {integrity: sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==} + undici-types@7.8.0: + resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==} + undici@5.29.0: resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} engines: {node: '>=14.0'} @@ -16044,6 +16328,9 @@ packages: zod@4.1.11: resolution: {integrity: sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg==} + zod@4.1.5: + resolution: {integrity: sha512-rcUUZqlLJgBC33IT3PNMgsCq6TzLQEG/Ei/KTCU0PedSWRMAXoOUN+4t/0H+Q8bdnLPdqUYnvboJT0bn/229qg==} + snapshots: '@ampproject/remapping@2.3.0': @@ -16074,9 +16361,15 @@ snapshots: optionalDependencies: zod: 3.25.76 - '@anthropic-ai/vertex-sdk@0.11.5(zod@3.25.76)': + '@anthropic-ai/sdk@0.65.0(zod@4.1.11)': dependencies: - '@anthropic-ai/sdk': 0.65.0(zod@3.25.76) + json-schema-to-ts: 3.1.1 + optionalDependencies: + zod: 4.1.11 + + '@anthropic-ai/vertex-sdk@0.11.5(zod@4.1.11)': + dependencies: + '@anthropic-ai/sdk': 0.65.0(zod@4.1.11) google-auth-library: 9.15.1(encoding@0.1.13) transitivePeerDependencies: - encoding @@ -17237,6 +17530,22 @@ snapshots: transitivePeerDependencies: - supports-color + '@azure/identity@4.10.2': + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-auth': 1.10.0 + '@azure/core-client': 1.10.0 + '@azure/core-rest-pipeline': 1.22.0 + '@azure/core-tracing': 1.3.0 + '@azure/core-util': 1.13.0 + '@azure/logger': 1.3.0 + '@azure/msal-browser': 4.18.0 + '@azure/msal-node': 3.6.4 + open: 10.2.0 + tslib: 2.8.1 + transitivePeerDependencies: + - supports-color + '@azure/identity@4.13.0': dependencies: '@azure/abort-controller': 2.1.2 @@ -17382,8 +17691,8 @@ snapshots: dependencies: '@babel/parser': 7.28.0 '@babel/types': 7.28.2 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/gen-mapping': 0.3.12 + '@jridgewell/trace-mapping': 0.3.29 jsesc: 3.1.0 '@babel/helper-annotate-as-pure@7.27.3': @@ -18214,6 +18523,22 @@ snapshots: transitivePeerDependencies: - encoding + '@browserbasehq/stagehand@1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76)': + dependencies: + '@anthropic-ai/sdk': 0.27.3(encoding@0.1.13) + '@browserbasehq/sdk': 2.6.0(encoding@0.1.13) + '@playwright/test': 1.54.2 + deepmerge: 4.3.1 + dotenv: 16.6.1 + openai: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + zod: 3.25.76 + zod-to-json-schema: 3.24.6(zod@3.25.76) + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@browserbasehq/stagehand@1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(utf-8-validate@6.0.5)(zod@3.25.76)': dependencies: '@anthropic-ai/sdk': 0.27.3(encoding@0.1.13) @@ -18230,6 +18555,22 @@ snapshots: - encoding - utf-8-validate + '@browserbasehq/stagehand@1.14.0(@playwright/test@1.54.2)(bufferutil@4.0.9)(deepmerge@4.3.1)(dotenv@16.6.1)(encoding@0.1.13)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11))(utf-8-validate@6.0.5)(zod@4.1.11)': + dependencies: + '@anthropic-ai/sdk': 0.27.3(encoding@0.1.13) + '@browserbasehq/sdk': 2.6.0(encoding@0.1.13) + '@playwright/test': 1.54.2 + deepmerge: 4.3.1 + dotenv: 16.6.1 + openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + zod: 4.1.11 + zod-to-json-schema: 3.24.6(zod@4.1.11) + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@bufbuild/protobuf@2.6.2': {} '@bytecodealliance/componentize-js@0.18.4': @@ -18699,6 +19040,16 @@ snapshots: '@esbuild/win32-x64@0.25.8': optional: true + '@eslint-community/eslint-utils@4.7.0(eslint@9.35.0(jiti@2.5.1))': + dependencies: + eslint: 9.35.0(jiti@2.5.1) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/eslint-utils@4.9.0(eslint@9.35.0(jiti@2.5.1))': + dependencies: + eslint: 9.35.0(jiti@2.5.1) + eslint-visitor-keys: 3.4.3 + '@eslint-community/eslint-utils@4.9.0(eslint@9.36.0(jiti@2.5.1))': dependencies: eslint: 9.36.0(jiti@2.5.1) @@ -18734,6 +19085,8 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/js@9.35.0': {} + '@eslint/js@9.36.0': {} '@eslint/object-schema@2.1.6': {} @@ -18866,7 +19219,7 @@ snapshots: transitivePeerDependencies: - debug - '@getzep/zep-cloud@1.0.12(@langchain/core@libs+langchain-core)(encoding@0.1.13)(langchain@0.3.30(1037dd7ffc4b4df883b20cb3da1eaf84))': + '@getzep/zep-cloud@1.0.12(@langchain/core@libs+langchain-core)(encoding@0.1.13)(langchain@0.3.30(5a003b2f9a341c53c0717933ef05322e))': dependencies: form-data: 4.0.0 node-fetch: 2.7.0(encoding@0.1.13) @@ -18875,7 +19228,7 @@ snapshots: zod: 3.25.76 optionalDependencies: '@langchain/core': link:libs/langchain-core - langchain: 0.3.30(1037dd7ffc4b4df883b20cb3da1eaf84) + langchain: 0.3.30(5a003b2f9a341c53c0717933ef05322e) transitivePeerDependencies: - encoding @@ -19589,7 +19942,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/trace-mapping': 0.3.29 '@types/node': 24.6.1 chalk: 4.1.2 collect-v8-coverage: 1.0.2 @@ -19650,7 +20003,7 @@ snapshots: dependencies: '@babel/core': 7.28.0 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/trace-mapping': 0.3.29 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 @@ -19705,6 +20058,11 @@ snapshots: '@types/yargs': 17.0.33 chalk: 4.1.2 + '@jridgewell/gen-mapping@0.3.12': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -19712,13 +20070,25 @@ snapshots: '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/source-map@0.3.10': + dependencies: + '@jridgewell/gen-mapping': 0.3.12 + '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/source-map@0.3.11': dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/sourcemap-codec@1.5.4': {} + '@jridgewell/sourcemap-codec@1.5.5': {} + '@jridgewell/trace-mapping@0.3.29': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 @@ -19727,7 +20097,7 @@ snapshots: '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/sourcemap-codec': 1.5.4 '@js-sdsl/ordered-map@4.4.2': {} @@ -19877,7 +20247,7 @@ snapshots: react: 19.0.0 react-dom: 18.3.1(react@19.0.0) - '@langchain/langgraph@1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76)': + '@langchain/langgraph@1.0.0-alpha.4(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@3.25.76))(zod@3.25.76)': dependencies: '@langchain/core': link:libs/langchain-core '@langchain/langgraph-checkpoint': 0.1.1(@langchain/core@libs+langchain-core) @@ -19890,6 +20260,19 @@ snapshots: - react - react-dom + '@langchain/langgraph@1.0.0-alpha.5(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0)(zod-to-json-schema@3.24.6(zod@4.1.11))(zod@4.1.11)': + dependencies: + '@langchain/core': link:libs/langchain-core + '@langchain/langgraph-checkpoint': 0.1.1(@langchain/core@libs+langchain-core) + '@langchain/langgraph-sdk': 0.1.9(@langchain/core@libs+langchain-core)(react-dom@18.3.1(react@19.0.0))(react@19.0.0) + uuid: 10.0.0 + zod: 4.1.11 + optionalDependencies: + zod-to-json-schema: 3.24.6(zod@4.1.11) + transitivePeerDependencies: + - react + - react-dom + '@langchain/mistralai@0.2.3(@langchain/core@libs+langchain-core)(zod@3.25.76)': dependencies: '@langchain/core': link:libs/langchain-core @@ -19966,6 +20349,16 @@ snapshots: - ws - zod + '@layerup/layerup-security@1.6.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11)': + dependencies: + axios: 1.11.0(debug@4.4.3) + openai: 4.104.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) + transitivePeerDependencies: + - debug + - encoding + - ws + - zod + '@leichtgewicht/ip-codec@2.0.5': {} '@libp2p/interface@1.7.0': @@ -20074,6 +20467,11 @@ snapshots: zod: 3.25.76 zod-to-json-schema: 3.24.6(zod@3.25.76) + '@mistralai/mistralai@1.7.5(zod@4.1.11)': + dependencies: + zod: 4.1.11 + zod-to-json-schema: 3.24.6(zod@4.1.11) + '@mixedbread-ai/sdk@2.2.11(encoding@0.1.13)': dependencies: form-data: 4.0.0 @@ -20676,7 +21074,7 @@ snapshots: '@opensearch-project/opensearch@2.13.0': dependencies: aws4: 1.13.2 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 hpagent: 1.2.0 json11: 2.0.2 ms: 2.1.3 @@ -21023,69 +21421,129 @@ snapshots: optionalDependencies: rollup: 3.29.5 + '@rollup/rollup-android-arm-eabi@4.46.2': + optional: true + '@rollup/rollup-android-arm-eabi@4.52.4': optional: true + '@rollup/rollup-android-arm64@4.46.2': + optional: true + '@rollup/rollup-android-arm64@4.52.4': optional: true + '@rollup/rollup-darwin-arm64@4.46.2': + optional: true + '@rollup/rollup-darwin-arm64@4.52.4': optional: true + '@rollup/rollup-darwin-x64@4.46.2': + optional: true + '@rollup/rollup-darwin-x64@4.52.4': optional: true + '@rollup/rollup-freebsd-arm64@4.46.2': + optional: true + '@rollup/rollup-freebsd-arm64@4.52.4': optional: true + '@rollup/rollup-freebsd-x64@4.46.2': + optional: true + '@rollup/rollup-freebsd-x64@4.52.4': optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.46.2': + optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.52.4': optional: true + '@rollup/rollup-linux-arm-musleabihf@4.46.2': + optional: true + '@rollup/rollup-linux-arm-musleabihf@4.52.4': optional: true + '@rollup/rollup-linux-arm64-gnu@4.46.2': + optional: true + '@rollup/rollup-linux-arm64-gnu@4.52.4': optional: true + '@rollup/rollup-linux-arm64-musl@4.46.2': + optional: true + '@rollup/rollup-linux-arm64-musl@4.52.4': optional: true '@rollup/rollup-linux-loong64-gnu@4.52.4': optional: true + '@rollup/rollup-linux-loongarch64-gnu@4.46.2': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.46.2': + optional: true + '@rollup/rollup-linux-ppc64-gnu@4.52.4': optional: true + '@rollup/rollup-linux-riscv64-gnu@4.46.2': + optional: true + '@rollup/rollup-linux-riscv64-gnu@4.52.4': optional: true + '@rollup/rollup-linux-riscv64-musl@4.46.2': + optional: true + '@rollup/rollup-linux-riscv64-musl@4.52.4': optional: true + '@rollup/rollup-linux-s390x-gnu@4.46.2': + optional: true + '@rollup/rollup-linux-s390x-gnu@4.52.4': optional: true + '@rollup/rollup-linux-x64-gnu@4.46.2': + optional: true + '@rollup/rollup-linux-x64-gnu@4.52.4': optional: true + '@rollup/rollup-linux-x64-musl@4.46.2': + optional: true + '@rollup/rollup-linux-x64-musl@4.52.4': optional: true '@rollup/rollup-openharmony-arm64@4.52.4': optional: true + '@rollup/rollup-win32-arm64-msvc@4.46.2': + optional: true + '@rollup/rollup-win32-arm64-msvc@4.52.4': optional: true + '@rollup/rollup-win32-ia32-msvc@4.46.2': + optional: true + '@rollup/rollup-win32-ia32-msvc@4.52.4': optional: true '@rollup/rollup-win32-x64-gnu@4.52.4': optional: true + '@rollup/rollup-win32-x64-msvc@4.46.2': + optional: true + '@rollup/rollup-win32-x64-msvc@4.52.4': optional: true @@ -21800,7 +22258,7 @@ snapshots: '@types/better-sqlite3@7.6.13': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 '@types/body-parser@1.19.6': dependencies: @@ -21939,7 +22397,7 @@ snapshots: '@types/jsonwebtoken@9.0.10': dependencies: '@types/ms': 2.1.0 - '@types/node': 24.6.1 + '@types/node': 22.17.0 '@types/lodash@4.17.20': {} @@ -21968,10 +22426,22 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/node@22.17.0': + dependencies: + undici-types: 6.21.0 + '@types/node@22.18.8': dependencies: undici-types: 6.21.0 + '@types/node@24.1.0': + dependencies: + undici-types: 7.8.0 + + '@types/node@24.3.1': + dependencies: + undici-types: 7.10.0 + '@types/node@24.6.1': dependencies: undici-types: 7.13.0 @@ -21986,11 +22456,11 @@ snapshots: '@types/pdf-parse@1.1.5': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 '@types/pg-copy-streams@1.2.5': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 '@types/pg': 8.15.5 '@types/pg@8.11.6': @@ -22001,7 +22471,7 @@ snapshots: '@types/pg@8.15.5': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 pg-protocol: 1.10.3 pg-types: 2.2.0 @@ -22009,7 +22479,7 @@ snapshots: '@types/prompts@2.4.9': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 kleur: 3.0.3 '@types/qs@6.14.0': {} @@ -22079,7 +22549,7 @@ snapshots: '@types/word-extractor@1.0.6': dependencies: - '@types/node': 24.6.1 + '@types/node': 22.17.0 '@types/ws@8.18.1': dependencies: @@ -22096,6 +22566,23 @@ snapshots: '@types/node': 24.6.1 optional: true + '@typescript-eslint/eslint-plugin@8.43.0(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/scope-manager': 8.43.0 + '@typescript-eslint/type-utils': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/utils': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.43.0 + eslint: 9.35.0(jiti@2.5.1) + graphemer: 1.4.0 + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/eslint-plugin@8.45.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3))(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -22113,20 +22600,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.45.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3)': + '@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.45.0 - '@typescript-eslint/type-utils': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - '@typescript-eslint/utils': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.45.0 - eslint: 9.36.0(jiti@2.5.1) - graphemer: 1.4.0 - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + '@typescript-eslint/scope-manager': 8.43.0 + '@typescript-eslint/types': 8.43.0 + '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.43.0 + debug: 4.4.3(supports-color@8.1.1) + eslint: 9.35.0(jiti@2.5.1) + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -22142,15 +22624,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3)': + '@typescript-eslint/project-service@8.43.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/scope-manager': 8.45.0 + '@typescript-eslint/tsconfig-utils': 8.43.0(typescript@5.9.2) '@typescript-eslint/types': 8.45.0 - '@typescript-eslint/typescript-estree': 8.45.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.45.0 debug: 4.4.3(supports-color@8.1.1) - eslint: 9.36.0(jiti@2.5.1) - typescript: 5.9.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -22163,27 +22642,35 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.45.0(typescript@5.9.3)': + '@typescript-eslint/scope-manager@8.43.0': dependencies: - '@typescript-eslint/tsconfig-utils': 8.45.0(typescript@5.9.3) - '@typescript-eslint/types': 8.45.0 - debug: 4.4.3(supports-color@8.1.1) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color + '@typescript-eslint/types': 8.43.0 + '@typescript-eslint/visitor-keys': 8.43.0 '@typescript-eslint/scope-manager@8.45.0': dependencies: '@typescript-eslint/types': 8.45.0 '@typescript-eslint/visitor-keys': 8.45.0 + '@typescript-eslint/tsconfig-utils@8.43.0(typescript@5.9.2)': + dependencies: + typescript: 5.9.2 + '@typescript-eslint/tsconfig-utils@8.45.0(typescript@5.8.3)': dependencies: typescript: 5.8.3 - '@typescript-eslint/tsconfig-utils@8.45.0(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - typescript: 5.9.3 + '@typescript-eslint/types': 8.43.0 + '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + debug: 4.4.3(supports-color@8.1.1) + eslint: 9.35.0(jiti@2.5.1) + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color '@typescript-eslint/type-utils@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3)': dependencies: @@ -22197,20 +22684,26 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3)': + '@typescript-eslint/types@8.43.0': {} + + '@typescript-eslint/types@8.45.0': {} + + '@typescript-eslint/typescript-estree@8.43.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/types': 8.45.0 - '@typescript-eslint/typescript-estree': 8.45.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) + '@typescript-eslint/project-service': 8.43.0(typescript@5.9.2) + '@typescript-eslint/tsconfig-utils': 8.43.0(typescript@5.9.2) + '@typescript-eslint/types': 8.43.0 + '@typescript-eslint/visitor-keys': 8.43.0 debug: 4.4.3(supports-color@8.1.1) - eslint: 9.36.0(jiti@2.5.1) - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.7.2 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.45.0': {} - '@typescript-eslint/typescript-estree@8.45.0(typescript@5.8.3)': dependencies: '@typescript-eslint/project-service': 8.45.0(typescript@5.8.3) @@ -22227,19 +22720,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.45.0(typescript@5.9.3)': + '@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.45.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.45.0(typescript@5.9.3) - '@typescript-eslint/types': 8.45.0 - '@typescript-eslint/visitor-keys': 8.45.0 - debug: 4.4.3(supports-color@8.1.1) - fast-glob: 3.3.3 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.7.2 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + '@eslint-community/eslint-utils': 4.7.0(eslint@9.35.0(jiti@2.5.1)) + '@typescript-eslint/scope-manager': 8.43.0 + '@typescript-eslint/types': 8.43.0 + '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) + eslint: 9.35.0(jiti@2.5.1) + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -22254,16 +22742,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3)': + '@typescript-eslint/visitor-keys@8.43.0': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0(jiti@2.5.1)) - '@typescript-eslint/scope-manager': 8.45.0 - '@typescript-eslint/types': 8.45.0 - '@typescript-eslint/typescript-estree': 8.45.0(typescript@5.9.3) - eslint: 9.36.0(jiti@2.5.1) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color + '@typescript-eslint/types': 8.43.0 + eslint-visitor-keys: 4.2.1 '@typescript-eslint/visitor-keys@8.45.0': dependencies: @@ -22950,6 +23432,14 @@ snapshots: transitivePeerDependencies: - debug + axios@1.11.0(debug@4.4.1): + dependencies: + follow-redirects: 1.15.11(debug@4.4.1) + form-data: 4.0.4 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + axios@1.11.0(debug@4.4.3): dependencies: follow-redirects: 1.15.11(debug@4.4.3) @@ -23675,6 +24165,18 @@ snapshots: transitivePeerDependencies: - encoding + chromadb@1.10.5(@google/generative-ai@0.7.1)(cohere-ai@7.18.0(encoding@0.1.13))(encoding@0.1.13)(ollama@0.5.16)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11)): + dependencies: + cliui: 8.0.1 + isomorphic-fetch: 3.0.0(encoding@0.1.13) + optionalDependencies: + '@google/generative-ai': 0.7.1 + cohere-ai: 7.18.0(encoding@0.1.13) + ollama: 0.5.16 + openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) + transitivePeerDependencies: + - encoding + chromadb@3.0.14: dependencies: semver: 7.7.2 @@ -24132,7 +24634,7 @@ snapshots: dependencies: cipher-base: 1.0.6 inherits: 2.0.4 - ripemd160: 2.0.2 + ripemd160: 2.0.1 sha.js: 2.4.12 create-hash@1.2.0: @@ -24328,6 +24830,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.4.1: + dependencies: + ms: 2.1.3 + debug@4.4.3(supports-color@8.1.1): dependencies: ms: 2.1.3 @@ -24950,9 +25456,9 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-prettier@10.1.8(eslint@9.36.0(jiti@2.5.1)): + eslint-config-prettier@10.1.8(eslint@9.35.0(jiti@2.5.1)): dependencies: - eslint: 9.36.0(jiti@2.5.1) + eslint: 9.35.0(jiti@2.5.1) eslint-import-resolver-node@0.3.9: dependencies: @@ -24962,17 +25468,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.5.1)): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.35.0(jiti@2.5.1)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - eslint: 9.36.0(jiti@2.5.1) + '@typescript-eslint/parser': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + eslint: 9.35.0(jiti@2.5.1) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint@9.36.0(jiti@2.5.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -24981,9 +25487,9 @@ snapshots: array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.36.0(jiti@2.5.1) + eslint: 9.35.0(jiti@2.5.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.5.1)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.35.0(jiti@2.5.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -24995,7 +25501,7 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) + '@typescript-eslint/parser': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -25003,15 +25509,15 @@ snapshots: eslint-plugin-no-instanceof@1.0.1: {} - eslint-plugin-prettier@5.5.4(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.36.0(jiti@2.5.1)))(eslint@9.36.0(jiti@2.5.1))(prettier@3.6.2): + eslint-plugin-prettier@5.5.4(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.35.0(jiti@2.5.1)))(eslint@9.35.0(jiti@2.5.1))(prettier@3.6.2): dependencies: - eslint: 9.36.0(jiti@2.5.1) + eslint: 9.35.0(jiti@2.5.1) prettier: 3.6.2 prettier-linter-helpers: 1.0.0 synckit: 0.11.11 optionalDependencies: '@types/eslint': 9.6.1 - eslint-config-prettier: 10.1.8(eslint@9.36.0(jiti@2.5.1)) + eslint-config-prettier: 10.1.8(eslint@9.35.0(jiti@2.5.1)) eslint-scope@5.1.1: dependencies: @@ -25027,6 +25533,48 @@ snapshots: eslint-visitor-keys@4.2.1: {} + eslint@9.35.0(jiti@2.5.1): + dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.35.0(jiti@2.5.1)) + '@eslint-community/regexpp': 4.12.1 + '@eslint/config-array': 0.21.0 + '@eslint/config-helpers': 0.3.1 + '@eslint/core': 0.15.2 + '@eslint/eslintrc': 3.3.1 + '@eslint/js': 9.35.0 + '@eslint/plugin-kit': 0.3.5 + '@humanfs/node': 0.16.7 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.1 + escape-string-regexp: 4.0.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + optionalDependencies: + jiti: 2.5.1 + transitivePeerDependencies: + - supports-color + eslint@9.36.0(jiti@2.5.1): dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0(jiti@2.5.1)) @@ -25526,7 +26074,7 @@ snapshots: '@fastify/busboy': 3.1.1 '@firebase/database-compat': 1.0.8 '@firebase/database-types': 1.0.5 - '@types/node': 22.18.8 + '@types/node': 22.17.0 farmhash-modern: 1.1.0 jsonwebtoken: 9.0.2 jwks-rsa: 3.2.0 @@ -25578,6 +26126,10 @@ snapshots: fn.name@1.1.0: {} + follow-redirects@1.15.11(debug@4.4.1): + optionalDependencies: + debug: 4.4.1 + follow-redirects@1.15.11(debug@4.4.3): optionalDependencies: debug: 4.4.3(supports-color@8.1.1) @@ -26248,9 +26800,9 @@ snapshots: '@types/debug': 4.1.12 '@types/node': 18.19.121 '@types/tough-cookie': 4.0.5 - axios: 1.11.0(debug@4.4.3) + axios: 1.11.0(debug@4.4.1) camelcase: 6.3.0 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 dotenv: 16.6.1 extend: 3.0.2 file-type: 16.5.4 @@ -26391,7 +26943,7 @@ snapshots: dependencies: '@ioredis/commands': 1.3.0 cluster-key-slot: 1.1.2 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -27004,7 +27556,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 24.6.1 + '@types/node': 22.17.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -27355,7 +27907,7 @@ snapshots: http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.22 + nwsapi: 2.2.21 parse5: 7.3.0 rrweb-cssom: 0.6.0 saxes: 6.0.0 @@ -27548,7 +28100,7 @@ snapshots: ky@1.8.2: {} - langchain@0.3.30(1037dd7ffc4b4df883b20cb3da1eaf84): + langchain@0.3.30(5a003b2f9a341c53c0717933ef05322e): dependencies: '@langchain/core': link:libs/langchain-core '@langchain/openai': 0.6.3(@langchain/core@libs+langchain-core)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5)) @@ -27556,7 +28108,7 @@ snapshots: js-tiktoken: 1.0.20 js-yaml: 4.1.0 jsonpointer: 5.0.1 - langsmith: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) + langsmith: 0.3.74(@opentelemetry/api@1.9.0)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)) openapi-types: 12.1.3 p-retry: 4.6.2 uuid: 10.0.0 @@ -27587,7 +28139,21 @@ snapshots: - ws optional: true - langsmith@0.3.74(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)): + langsmith@0.3.64(@opentelemetry/api@1.9.0)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)): + dependencies: + '@types/uuid': 10.0.0 + chalk: 4.1.2 + console-table-printer: 2.14.6 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.2 + uuid: 10.0.0 + optionalDependencies: + '@opentelemetry/api': 1.9.0 + openai: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + optional: true + + langsmith@0.3.64(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)): dependencies: '@types/uuid': 10.0.0 chalk: 4.1.2 @@ -27600,6 +28166,34 @@ snapshots: '@opentelemetry/api': 1.9.0 openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + langsmith@0.3.64(@opentelemetry/api@1.9.0)(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11)): + dependencies: + '@types/uuid': 10.0.0 + chalk: 4.1.2 + console-table-printer: 2.14.6 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.2 + uuid: 10.0.0 + optionalDependencies: + '@opentelemetry/api': 1.9.0 + openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) + optional: true + + langsmith@0.3.74(@opentelemetry/api@1.9.0)(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76)): + dependencies: + '@types/uuid': 10.0.0 + chalk: 4.1.2 + console-table-printer: 2.14.6 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.2 + uuid: 10.0.0 + optionalDependencies: + '@opentelemetry/api': 1.9.0 + openai: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + optional: true + latest-version@7.0.0: dependencies: package-json: 8.1.1 @@ -27844,11 +28438,11 @@ snapshots: lru.min@1.1.2: {} - lunary@0.7.15(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0): + lunary@0.7.15(openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0): dependencies: unctx: 2.4.1 optionalDependencies: - openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + openai: 5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) react: 19.0.0 lunary@0.8.8(@anthropic-ai/sdk@0.65.0(zod@3.25.76))(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76))(react@19.0.0): @@ -27859,13 +28453,21 @@ snapshots: openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) react: 19.0.0 + lunary@0.8.8(@anthropic-ai/sdk@0.65.0(zod@4.1.11))(openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11))(react@19.0.0): + dependencies: + unctx: 2.4.1 + optionalDependencies: + '@anthropic-ai/sdk': 0.65.0(zod@4.1.11) + openai: 5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11) + react: 19.0.0 + macos-release@3.4.0: {} magic-bytes.js@1.12.1: {} magic-string@0.30.17: dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/sourcemap-codec': 1.5.4 magicast@0.3.5: dependencies: @@ -27930,7 +28532,7 @@ snapshots: mariadb@3.4.5: dependencies: '@types/geojson': 7946.0.16 - '@types/node': 24.6.1 + '@types/node': 24.1.0 denque: 2.1.0 iconv-lite: 0.6.3 lru-cache: 10.4.3 @@ -27995,6 +28597,34 @@ snapshots: - encoding - ws + mem0ai@2.1.36(@anthropic-ai/sdk@0.65.0(zod@4.1.11))(@cloudflare/workers-types@4.20250801.0)(@google/genai@1.12.0(@modelcontextprotocol/sdk@1.19.1)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5))(@langchain/core@libs+langchain-core)(@mistralai/mistralai@1.7.5(zod@4.1.11))(@qdrant/js-client-rest@1.15.0(typescript@5.8.3))(@supabase/supabase-js@2.53.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@types/jest@29.5.14)(@types/pg@8.15.5)(@types/sqlite3@3.1.11)(cloudflare@4.5.0(encoding@0.1.13))(encoding@0.1.13)(groq-sdk@0.19.0(encoding@0.1.13))(neo4j-driver@5.28.1)(ollama@0.5.16)(pg@8.16.3)(redis@4.7.1)(sqlite3@5.1.7)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5)): + dependencies: + '@anthropic-ai/sdk': 0.65.0(zod@4.1.11) + '@cloudflare/workers-types': 4.20250801.0 + '@google/genai': 1.12.0(@modelcontextprotocol/sdk@1.19.1)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@langchain/core': link:libs/langchain-core + '@mistralai/mistralai': 1.7.5(zod@4.1.11) + '@qdrant/js-client-rest': 1.15.0(typescript@5.8.3) + '@supabase/supabase-js': 2.53.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@types/jest': 29.5.14 + '@types/pg': 8.15.5 + '@types/sqlite3': 3.1.11 + axios: 1.7.7 + cloudflare: 4.5.0(encoding@0.1.13) + groq-sdk: 0.19.0(encoding@0.1.13) + neo4j-driver: 5.28.1 + ollama: 0.5.16 + openai: 4.104.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76) + pg: 8.16.3 + redis: 4.7.1 + sqlite3: 5.1.7 + uuid: 9.0.1 + zod: 3.25.76 + transitivePeerDependencies: + - debug + - encoding + - ws + memory-pager@1.5.0: {} memory-stream@1.0.0: @@ -28444,7 +29074,10 @@ snapshots: dependencies: boolbase: 1.0.0 - nwsapi@2.2.22: {} + nwsapi@2.2.21: {} + + nwsapi@2.2.22: + optional: true nypm@0.5.4: dependencies: @@ -28645,11 +29278,36 @@ snapshots: transitivePeerDependencies: - encoding + openai@4.104.0(encoding@0.1.13)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11): + dependencies: + '@types/node': 18.19.121 + '@types/node-fetch': 2.6.13 + abort-controller: 3.0.0 + agentkeepalive: 4.6.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0(encoding@0.1.13) + optionalDependencies: + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + zod: 4.1.11 + transitivePeerDependencies: + - encoding + + openai@5.11.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76): + optionalDependencies: + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + zod: 3.25.76 + openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.25.76): optionalDependencies: ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) zod: 3.25.76 + openai@5.12.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@4.1.11): + optionalDependencies: + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@6.0.5) + zod: 4.1.11 + openapi-types@12.1.3: {} option@0.2.4: {} @@ -29916,6 +30574,32 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + rollup@4.46.2: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.46.2 + '@rollup/rollup-android-arm64': 4.46.2 + '@rollup/rollup-darwin-arm64': 4.46.2 + '@rollup/rollup-darwin-x64': 4.46.2 + '@rollup/rollup-freebsd-arm64': 4.46.2 + '@rollup/rollup-freebsd-x64': 4.46.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.46.2 + '@rollup/rollup-linux-arm-musleabihf': 4.46.2 + '@rollup/rollup-linux-arm64-gnu': 4.46.2 + '@rollup/rollup-linux-arm64-musl': 4.46.2 + '@rollup/rollup-linux-loongarch64-gnu': 4.46.2 + '@rollup/rollup-linux-ppc64-gnu': 4.46.2 + '@rollup/rollup-linux-riscv64-gnu': 4.46.2 + '@rollup/rollup-linux-riscv64-musl': 4.46.2 + '@rollup/rollup-linux-s390x-gnu': 4.46.2 + '@rollup/rollup-linux-x64-gnu': 4.46.2 + '@rollup/rollup-linux-x64-musl': 4.46.2 + '@rollup/rollup-win32-arm64-msvc': 4.46.2 + '@rollup/rollup-win32-ia32-msvc': 4.46.2 + '@rollup/rollup-win32-x64-msvc': 4.46.2 + fsevents: 2.3.3 + rollup@4.52.4: dependencies: '@types/estree': 1.0.8 @@ -30671,16 +31355,23 @@ snapshots: terser-webpack-plugin@5.3.14(@swc/core@1.13.3(@swc/helpers@0.5.17))(esbuild@0.25.8)(webpack@5.101.0(@swc/core@1.13.3(@swc/helpers@0.5.17))): dependencies: - '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/trace-mapping': 0.3.29 jest-worker: 27.5.1 schema-utils: 4.3.2 serialize-javascript: 6.0.2 - terser: 5.44.0 + terser: 5.43.1 webpack: 5.101.0(@swc/core@1.13.3(@swc/helpers@0.5.17))(esbuild@0.25.8) optionalDependencies: '@swc/core': 1.13.3(@swc/helpers@0.5.17) esbuild: 0.25.8 + terser@5.43.1: + dependencies: + '@jridgewell/source-map': 0.3.10 + acorn: 8.15.0 + commander: 2.20.3 + source-map-support: 0.5.21 + terser@5.44.0: dependencies: '@jridgewell/source-map': 0.3.11 @@ -30707,7 +31398,7 @@ snapshots: archiver: 7.0.1 async-lock: 1.4.1 byline: 5.0.0 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 docker-compose: 0.24.8 dockerode: 4.0.7 get-port: 7.1.0 @@ -30834,9 +31525,9 @@ snapshots: dependencies: typescript: 5.8.3 - ts-api-utils@2.1.0(typescript@5.9.3): + ts-api-utils@2.1.0(typescript@5.9.2): dependencies: - typescript: 5.9.3 + typescript: 5.9.2 ts-error@1.0.6: {} @@ -30972,7 +31663,7 @@ snapshots: ansis: 4.1.0 cac: 6.7.14 chokidar: 4.0.3 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 @@ -31154,6 +31845,17 @@ snapshots: - babel-plugin-macros - supports-color + typescript-eslint@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2): + dependencies: + '@typescript-eslint/eslint-plugin': 8.43.0(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/parser': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) + eslint: 9.35.0(jiti@2.5.1) + typescript: 5.9.2 + transitivePeerDependencies: + - supports-color + typescript-eslint@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3): dependencies: '@typescript-eslint/eslint-plugin': 8.45.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3))(eslint@9.36.0(jiti@2.5.1))(typescript@5.8.3) @@ -31165,23 +31867,14 @@ snapshots: transitivePeerDependencies: - supports-color - typescript-eslint@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.45.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3))(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.45.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.45.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.3) - eslint: 9.36.0(jiti@2.5.1) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - typescript-event-target@1.1.1: {} typescript@5.6.1-rc: {} typescript@5.8.3: {} + typescript@5.9.2: {} + typescript@5.9.3: {} typesense@1.8.2(@babel/runtime@7.28.2): @@ -31252,8 +31945,12 @@ snapshots: undici-types@6.21.0: {} + undici-types@7.10.0: {} + undici-types@7.13.0: {} + undici-types@7.8.0: {} + undici@5.29.0: dependencies: '@fastify/busboy': 2.1.1 @@ -31556,7 +32253,7 @@ snapshots: '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 chai: 5.2.1 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 expect-type: 1.2.2 magic-string: 0.30.17 pathe: 2.0.3 @@ -31599,7 +32296,7 @@ snapshots: '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 chai: 5.2.1 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 expect-type: 1.2.2 magic-string: 0.30.17 pathe: 2.0.3 @@ -31642,7 +32339,7 @@ snapshots: '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 chai: 5.2.1 - debug: 4.4.3(supports-color@8.1.1) + debug: 4.4.1 expect-type: 1.2.2 magic-string: 0.30.17 pathe: 2.0.3 @@ -32067,8 +32764,14 @@ snapshots: dependencies: zod: 3.25.76 + zod-to-json-schema@3.24.6(zod@4.1.11): + dependencies: + zod: 4.1.11 + zod@3.23.8: {} zod@3.25.76: {} zod@4.1.11: {} + + zod@4.1.5: {}