diff --git a/backend/package.json b/backend/package.json index a4ec905ed..1746aee22 100644 --- a/backend/package.json +++ b/backend/package.json @@ -31,6 +31,9 @@ "@aws-sdk/s3-request-presigner": "^3.958.0", "@electric-sql/pglite": "^0.3.14", "@faker-js/faker": "^10.1.0", + "@langchain/aws": "^1.2.0", + "@langchain/core": "^1.1.15", + "@langchain/openai": "^1.2.2", "@nestjs/common": "11.1.9", "@nestjs/config": "4.0.2", "@nestjs/core": "11.1.9", @@ -71,6 +74,7 @@ "json2csv": "^5.0.7", "jsonwebtoken": "^9.0.3", "knex": "3.1.0", + "langchain": "^1.2.10", "lru-cache": "^11.2.4", "nanoid": "5.1.6", "nodemailer": "^7.0.11", diff --git a/backend/src/ai-core/ai-core.module.ts b/backend/src/ai-core/ai-core.module.ts new file mode 100644 index 000000000..d9fae60fb --- /dev/null +++ b/backend/src/ai-core/ai-core.module.ts @@ -0,0 +1,21 @@ +import { Global, Module } from '@nestjs/common'; +import { LangchainOpenAIProvider } from './providers/langchain-openai.provider.js'; +import { LangchainBedrockProvider } from './providers/langchain-bedrock.provider.js'; +import { AICoreService } from './services/ai-core.service.js'; + +export const AI_CORE_SERVICE = 'AI_CORE_SERVICE'; + +@Global() +@Module({ + providers: [ + LangchainOpenAIProvider, + LangchainBedrockProvider, + AICoreService, + { + provide: AI_CORE_SERVICE, + useExisting: AICoreService, + }, + ], + exports: [AICoreService, AI_CORE_SERVICE, LangchainOpenAIProvider, LangchainBedrockProvider], +}) +export class AICoreModule {} diff --git a/backend/src/ai-core/index.ts b/backend/src/ai-core/index.ts new file mode 100644 index 000000000..f6e9ba1ce --- /dev/null +++ b/backend/src/ai-core/index.ts @@ -0,0 +1,6 @@ +export * from './ai-core.module.js'; +export * from './interfaces/index.js'; +export * from './providers/index.js'; +export * from './services/index.js'; +export * from './tools/index.js'; +export * from './utils/index.js'; diff --git a/backend/src/ai-core/interfaces/ai-provider.interface.ts b/backend/src/ai-core/interfaces/ai-provider.interface.ts new file mode 100644 index 000000000..669ba9ada --- /dev/null +++ b/backend/src/ai-core/interfaces/ai-provider.interface.ts @@ -0,0 +1,81 @@ +import { BaseMessage } from '@langchain/core/messages'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; + +export interface AIProviderConfig { + modelId?: string; + temperature?: number; + maxTokens?: number; + streaming?: boolean; + previousResponseId?: string; // For conversation continuation (OpenAI Responses API) +} + +export interface AIToolDefinition { + name: string; + description: string; + parameters: Record; +} + +export interface AIToolCall { + id: string; + name: string; + arguments: Record; +} + +export interface AIToolResult { + toolCallId: string; + result: string; +} + +export interface AIStreamChunk { + type: 'text' | 'tool_call' | 'tool_result' | 'done'; + content?: string; + toolCall?: AIToolCall; + responseId?: string; +} + +export interface AICompletionResult { + content: string; + toolCalls?: AIToolCall[]; + responseId?: string; +} + +export interface IAIProvider { + generateCompletion(prompt: string, config?: AIProviderConfig): Promise; + + generateChatCompletion(messages: BaseMessage[], config?: AIProviderConfig): Promise; + + generateStreamingCompletion( + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise>; + + generateWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise; + + generateStreamingWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise>; + + continueWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise; + + continueStreamingWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise>; + + getProviderName(): string; + + getDefaultModelId(): string; +} diff --git a/backend/src/ai-core/interfaces/ai-service.interface.ts b/backend/src/ai-core/interfaces/ai-service.interface.ts new file mode 100644 index 000000000..8f6149acc --- /dev/null +++ b/backend/src/ai-core/interfaces/ai-service.interface.ts @@ -0,0 +1,81 @@ +import { BaseMessage } from '@langchain/core/messages'; +import { + AICompletionResult, + AIProviderConfig, + AIStreamChunk, + AIToolDefinition, + AIToolResult, +} from './ai-provider.interface.js'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; + +export enum AIProviderType { + OPENAI = 'openai', + BEDROCK = 'bedrock', +} + +export interface IAIService { + + complete(prompt: string, config?: AIProviderConfig): Promise; + + completeWithProvider(provider: AIProviderType, prompt: string, config?: AIProviderConfig): Promise; + + chat(messages: BaseMessage[], config?: AIProviderConfig): Promise; + + chatWithProvider( + provider: AIProviderType, + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise; + + streamChat(messages: BaseMessage[], config?: AIProviderConfig): Promise>; + + streamChatWithProvider( + provider: AIProviderType, + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise>; + + chatWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise; + + chatWithToolsAndProvider( + provider: AIProviderType, + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise; + + streamChatWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise>; + + streamChatWithToolsAndProvider( + provider: AIProviderType, + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise>; + + continueAfterToolCall( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise; + + continueStreamingAfterToolCall( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise>; + + getDefaultProvider(): AIProviderType; + + setDefaultProvider(provider: AIProviderType): void; +} diff --git a/backend/src/ai-core/interfaces/index.ts b/backend/src/ai-core/interfaces/index.ts new file mode 100644 index 000000000..e97324421 --- /dev/null +++ b/backend/src/ai-core/interfaces/index.ts @@ -0,0 +1,2 @@ +export * from './ai-provider.interface.js'; +export * from './ai-service.interface.js'; diff --git a/backend/src/ai-core/providers/index.ts b/backend/src/ai-core/providers/index.ts new file mode 100644 index 000000000..e6527c1f5 --- /dev/null +++ b/backend/src/ai-core/providers/index.ts @@ -0,0 +1,2 @@ +export * from './langchain-openai.provider.js'; +export * from './langchain-bedrock.provider.js'; diff --git a/backend/src/ai-core/providers/langchain-bedrock.provider.ts b/backend/src/ai-core/providers/langchain-bedrock.provider.ts new file mode 100644 index 000000000..983f06bb3 --- /dev/null +++ b/backend/src/ai-core/providers/langchain-bedrock.provider.ts @@ -0,0 +1,249 @@ +import { Injectable } from '@nestjs/common'; +import { ChatBedrockConverse } from '@langchain/aws'; +import { BaseMessage, AIMessage, AIMessageChunk, HumanMessage, ToolMessage } from '@langchain/core/messages'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; +import { tool } from '@langchain/core/tools'; +import { z } from 'zod'; +import { + IAIProvider, + AIProviderConfig, + AICompletionResult, + AIStreamChunk, + AIToolDefinition, + AIToolResult, + AIToolCall, +} from '../interfaces/ai-provider.interface.js'; + +@Injectable() +export class LangchainBedrockProvider implements IAIProvider { + private readonly defaultModelId = 'global.anthropic.claude-sonnet-4-5-20250929-v1:0'; + + private createModel(config?: AIProviderConfig): ChatBedrockConverse { + return new ChatBedrockConverse({ + model: config?.modelId || this.defaultModelId, + temperature: config?.temperature ?? 0.7, + maxTokens: config?.maxTokens ?? 4096, + streaming: config?.streaming ?? false, + }); + } + + private convertToolsToLangchain(tools: AIToolDefinition[]) { + return tools.map((toolDef) => { + const schemaProperties: Record = {}; + const properties = (toolDef.parameters as { properties?: Record }) + .properties; + const required = (toolDef.parameters as { required?: string[] }).required || []; + + if (properties) { + for (const [key, value] of Object.entries(properties)) { + let zodType: z.ZodTypeAny; + switch (value.type) { + case 'string': + zodType = z.string().describe(value.description || ''); + break; + case 'number': + zodType = z.number().describe(value.description || ''); + break; + case 'boolean': + zodType = z.boolean().describe(value.description || ''); + break; + case 'array': + zodType = z.array(z.any()).describe(value.description || ''); + break; + case 'object': + zodType = z.record(z.string(), z.any()).describe(value.description || ''); + break; + default: + zodType = z.any().describe(value.description || ''); + } + schemaProperties[key] = required.includes(key) ? zodType : zodType.optional(); + } + } + + return tool(async (_input) => '', { + name: toolDef.name, + description: toolDef.description, + schema: z.object(schemaProperties), + }); + }); + } + + private extractToolCalls(message: AIMessage): AIToolCall[] { + if (!message.tool_calls || message.tool_calls.length === 0) { + return []; + } + + return message.tool_calls.map((toolCall) => ({ + id: toolCall.id || '', + name: toolCall.name, + arguments: toolCall.args as Record, + })); + } + + public async generateCompletion(prompt: string, config?: AIProviderConfig): Promise { + const model = this.createModel(config); + const response = await model.invoke([new HumanMessage(prompt)]); + return typeof response.content === 'string' ? response.content : JSON.stringify(response.content); + } + + public async generateChatCompletion(messages: BaseMessage[], config?: AIProviderConfig): Promise { + const model = this.createModel(config); + const response = await model.invoke(messages); + + return { + content: typeof response.content === 'string' ? response.content : JSON.stringify(response.content), + toolCalls: this.extractToolCalls(response), + responseId: response.id, + }; + } + + public async generateStreamingCompletion( + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise> { + const model = this.createModel({ ...config, streaming: true }); + const stream = await model.stream(messages); + + return this.transformToAIStreamChunks(stream); + } + + public async generateWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + const model = this.createModel(config); + const langchainTools = this.convertToolsToLangchain(tools); + const modelWithTools = model.bindTools(langchainTools); + const response = await modelWithTools.invoke(messages); + + return { + content: typeof response.content === 'string' ? response.content : JSON.stringify(response.content), + toolCalls: this.extractToolCalls(response), + responseId: response.id, + }; + } + + public async generateStreamingWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + const model = this.createModel({ ...config, streaming: true }); + const langchainTools = this.convertToolsToLangchain(tools); + const modelWithTools = model.bindTools(langchainTools); + const stream = await modelWithTools.stream(messages); + + return this.transformToAIStreamChunks(stream); + } + + public async continueWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + const toolMessages = toolResults.map( + (result) => + new ToolMessage({ + tool_call_id: result.toolCallId, + content: result.result, + }), + ); + + const allMessages = [...messages, ...toolMessages]; + return this.generateWithTools(allMessages, tools, config); + } + + public async continueStreamingWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + const toolMessages = toolResults.map( + (result) => + new ToolMessage({ + tool_call_id: result.toolCallId, + content: result.result, + }), + ); + + const allMessages = [...messages, ...toolMessages]; + return this.generateStreamingWithTools(allMessages, tools, config); + } + + public getProviderName(): string { + return 'Amazon Bedrock'; + } + + public getDefaultModelId(): string { + return this.defaultModelId; + } + + private async transformToAIStreamChunks( + stream: AsyncIterable, + ): Promise> { + async function* generateChunks(): AsyncGenerator { + let currentToolCalls: Map = new Map(); + + for await (const chunk of stream) { + if (chunk.tool_call_chunks && chunk.tool_call_chunks.length > 0) { + for (const toolCallChunk of chunk.tool_call_chunks) { + const index = toolCallChunk.index ?? 0; + + if (!currentToolCalls.has(index)) { + currentToolCalls.set(index, { + id: toolCallChunk.id || '', + name: toolCallChunk.name || '', + arguments: {}, + }); + } + + const currentCall = currentToolCalls.get(index)!; + + if (toolCallChunk.id) { + currentCall.id = toolCallChunk.id; + } + if (toolCallChunk.name) { + currentCall.name = toolCallChunk.name; + } + if (toolCallChunk.args) { + try { + const parsedArgs = JSON.parse(toolCallChunk.args); + currentCall.arguments = { ...currentCall.arguments, ...parsedArgs }; + } catch { + // Accumulate partial JSON - will be parsed when complete + } + } + } + } + + if (chunk.content) { + const content = typeof chunk.content === 'string' ? chunk.content : JSON.stringify(chunk.content); + if (content) { + yield { + type: 'text', + content, + responseId: chunk.id, + }; + } + } + } + + for (const toolCall of currentToolCalls.values()) { + if (toolCall.name) { + yield { + type: 'tool_call', + toolCall, + }; + } + } + + yield { type: 'done' }; + } + + const generator = generateChunks(); + return IterableReadableStream.fromAsyncGenerator(generator); + } +} diff --git a/backend/src/ai-core/providers/langchain-openai.provider.ts b/backend/src/ai-core/providers/langchain-openai.provider.ts new file mode 100644 index 000000000..9ef01f362 --- /dev/null +++ b/backend/src/ai-core/providers/langchain-openai.provider.ts @@ -0,0 +1,375 @@ +import { Injectable } from '@nestjs/common'; +import { ChatOpenAI } from '@langchain/openai'; +import { BaseMessage, AIMessage, AIMessageChunk, HumanMessage, ToolMessage } from '@langchain/core/messages'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; +import { tool } from '@langchain/core/tools'; +import { z } from 'zod'; +import OpenAI from 'openai'; +import { + IAIProvider, + AIProviderConfig, + AICompletionResult, + AIStreamChunk, + AIToolDefinition, + AIToolResult, + AIToolCall, +} from '../interfaces/ai-provider.interface.js'; +import { getOptionalEnvVariable, getRequiredEnvVariable } from '../../helpers/app/get-requeired-env-variable.js'; + +@Injectable() +export class LangchainOpenAIProvider implements IAIProvider { + private readonly defaultModelId = 'gpt-4o'; + private readonly responsesApiModel = 'gpt-4o'; + private openaiClient: OpenAI; + + constructor() { + const apiKey = getOptionalEnvVariable('OPENAI_API_KEY'); + this.openaiClient = new OpenAI({ apiKey }); + } + + private createModel(config?: AIProviderConfig): ChatOpenAI { + const apiKey = getRequiredEnvVariable('OPENAI_API_KEY'); + return new ChatOpenAI({ + openAIApiKey: apiKey, + modelName: config?.modelId || this.defaultModelId, + temperature: config?.temperature ?? 0.7, + maxTokens: config?.maxTokens, + streaming: config?.streaming ?? false, + }); + } + + private convertToolsToLangchain(tools: AIToolDefinition[]) { + return tools.map((toolDef) => { + const schemaProperties: Record = {}; + const properties = (toolDef.parameters as { properties?: Record }) + .properties; + const required = (toolDef.parameters as { required?: string[] }).required || []; + + if (properties) { + for (const [key, value] of Object.entries(properties)) { + let zodType: z.ZodTypeAny; + switch (value.type) { + case 'string': + zodType = z.string().describe(value.description || ''); + break; + case 'number': + zodType = z.number().describe(value.description || ''); + break; + case 'boolean': + zodType = z.boolean().describe(value.description || ''); + break; + case 'array': + zodType = z.array(z.any()).describe(value.description || ''); + break; + case 'object': + zodType = z.record(z.string(), z.any()).describe(value.description || ''); + break; + default: + zodType = z.any().describe(value.description || ''); + } + schemaProperties[key] = required.includes(key) ? zodType : zodType.optional(); + } + } + + return tool(async (_input) => '', { + name: toolDef.name, + description: toolDef.description, + schema: z.object(schemaProperties), + }); + }); + } + + private extractToolCalls(message: AIMessage): AIToolCall[] { + if (!message.tool_calls || message.tool_calls.length === 0) { + return []; + } + + return message.tool_calls.map((toolCall) => ({ + id: toolCall.id || '', + name: toolCall.name, + arguments: toolCall.args as Record, + })); + } + + public async generateCompletion(prompt: string, config?: AIProviderConfig): Promise { + const model = this.createModel(config); + const response = await model.invoke([new HumanMessage(prompt)]); + return typeof response.content === 'string' ? response.content : JSON.stringify(response.content); + } + + public async generateChatCompletion(messages: BaseMessage[], config?: AIProviderConfig): Promise { + const model = this.createModel(config); + const response = await model.invoke(messages); + + return { + content: typeof response.content === 'string' ? response.content : JSON.stringify(response.content), + toolCalls: this.extractToolCalls(response), + responseId: response.id, + }; + } + + public async generateStreamingCompletion( + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise> { + const model = this.createModel({ ...config, streaming: true }); + const stream = await model.stream(messages); + + return this.transformToAIStreamChunks(stream); + } + + public async generateWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + const model = this.createModel(config); + const langchainTools = this.convertToolsToLangchain(tools); + const modelWithTools = model.bindTools(langchainTools); + const response = await modelWithTools.invoke(messages); + + return { + content: typeof response.content === 'string' ? response.content : JSON.stringify(response.content), + toolCalls: this.extractToolCalls(response), + responseId: response.id, + }; + } + + public async generateStreamingWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + return this.streamWithResponsesApi(messages, tools, config || {}); + } + + private async streamWithResponsesApi( + messages: BaseMessage[], + tools: AIToolDefinition[], + config: AIProviderConfig, + ): Promise> { + const systemMessage = messages.find((m) => m._getType() === 'system'); + const systemPrompt = systemMessage ? (systemMessage.content as string) : ''; + + const openaiTools = this.convertToolsToOpenAIFormat(tools); + + const input = this.buildResponsesApiInput(messages); + + const stream = await this.openaiClient.responses.create({ + model: config.modelId || this.responsesApiModel, + input: input, + instructions: systemPrompt, + tools: openaiTools, + tool_choice: 'auto', + stream: true, + previous_response_id: config.previousResponseId, + }); + + return this.transformResponsesApiStream(stream); + } + + private buildResponsesApiInput(messages: BaseMessage[]): string | OpenAI.Responses.ResponseInputItem[] { + const toolMessages = messages.filter((m) => m._getType() === 'tool'); + + if (toolMessages.length > 0) { + const inputItems: OpenAI.Responses.ResponseInputItem[] = []; + + for (const msg of toolMessages) { + const toolMsg = msg as ToolMessage; + inputItems.push({ + type: 'function_call_output', + call_id: toolMsg.tool_call_id, + output: typeof toolMsg.content === 'string' ? toolMsg.content : JSON.stringify(toolMsg.content), + }); + } + + return inputItems; + } + + const humanMessage = messages.find((m) => m._getType() === 'human'); + const userMessage = humanMessage ? (humanMessage.content as string) : ''; + return userMessage; + } + + private convertToolsToOpenAIFormat(tools: AIToolDefinition[]): OpenAI.Responses.FunctionTool[] { + return tools.map((toolDef) => ({ + type: 'function' as const, + name: toolDef.name, + description: toolDef.description, + parameters: toolDef.parameters as OpenAI.FunctionParameters, + strict: false, + })); + } + + private async transformResponsesApiStream( + stream: AsyncIterable, + ): Promise> { + async function* generateChunks(): AsyncGenerator { + let currentResponseId: string | null = null; + + for await (const event of stream) { + if (event.type === 'response.created') { + currentResponseId = event.response.id; + } + + if (event.type === 'response.output_text.delta') { + yield { + type: 'text', + content: event.delta, + responseId: currentResponseId || undefined, + }; + } + if (event.type === 'response.output_item.done' && event.item?.type === 'function_call') { + const item = event.item; + let parsedArgs: Record = {}; + try { + parsedArgs = JSON.parse(item.arguments || '{}'); + } catch { + // Failed to parse arguments + } + + const toolCall: AIToolCall = { + id: item.call_id || item.id || '', + name: item.name || '', + arguments: parsedArgs, + }; + + yield { + type: 'tool_call', + toolCall, + responseId: currentResponseId || undefined, + }; + } + } + + yield { type: 'done', responseId: currentResponseId || undefined }; + } + + const generator = generateChunks(); + return IterableReadableStream.fromAsyncGenerator(generator); + } + + public async continueWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + const toolMessages = toolResults.map( + (result) => + new ToolMessage({ + tool_call_id: result.toolCallId, + content: result.result, + }), + ); + + const allMessages = [...messages, ...toolMessages]; + return this.generateWithTools(allMessages, tools, config); + } + + public async continueStreamingWithToolResults( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + const toolMessages = toolResults.map( + (result) => + new ToolMessage({ + tool_call_id: result.toolCallId, + content: result.result, + }), + ); + + const allMessages = [...messages, ...toolMessages]; + return this.generateStreamingWithTools(allMessages, tools, config); + } + + public getProviderName(): string { + return 'OpenAI'; + } + + public getDefaultModelId(): string { + return this.defaultModelId; + } + + private async transformToAIStreamChunks( + stream: AsyncIterable, + ): Promise> { + async function* generateChunks(): AsyncGenerator { + const currentToolCalls: Map = new Map(); + + try { + for await (const chunk of stream) { + if (chunk.tool_call_chunks && chunk.tool_call_chunks.length > 0) { + for (const toolCallChunk of chunk.tool_call_chunks) { + const index = toolCallChunk.index ?? 0; + + if (!currentToolCalls.has(index)) { + currentToolCalls.set(index, { + id: toolCallChunk.id || '', + name: toolCallChunk.name || '', + argsString: '', + }); + } + + const currentCall = currentToolCalls.get(index)!; + + if (toolCallChunk.id) { + currentCall.id = toolCallChunk.id; + } + if (toolCallChunk.name) { + currentCall.name = toolCallChunk.name; + } + if (toolCallChunk.args) { + currentCall.argsString += toolCallChunk.args; + } + } + } + + if (chunk.content) { + const content = typeof chunk.content === 'string' ? chunk.content : JSON.stringify(chunk.content); + if (content) { + yield { + type: 'text', + content, + responseId: chunk.id, + }; + } + } + } + } catch (streamError) { + throw streamError; + } + + for (const [index, toolCallData] of currentToolCalls.entries()) { + if (toolCallData.name) { + let parsedArgs: Record = {}; + if (toolCallData.argsString) { + try { + parsedArgs = JSON.parse(toolCallData.argsString); + } catch { + // Failed to parse args + } + } + + const toolCall: AIToolCall = { + id: toolCallData.id, + name: toolCallData.name, + arguments: parsedArgs, + }; + + yield { + type: 'tool_call', + toolCall, + }; + } + } + + yield { type: 'done' }; + } + + const generator = generateChunks(); + return IterableReadableStream.fromAsyncGenerator(generator); + } +} diff --git a/backend/src/ai-core/services/ai-core.service.ts b/backend/src/ai-core/services/ai-core.service.ts new file mode 100644 index 000000000..b301ce449 --- /dev/null +++ b/backend/src/ai-core/services/ai-core.service.ts @@ -0,0 +1,150 @@ +import { Injectable } from '@nestjs/common'; +import { BaseMessage } from '@langchain/core/messages'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; +import { IAIService, AIProviderType } from '../interfaces/ai-service.interface.js'; +import { + AIProviderConfig, + AICompletionResult, + AIStreamChunk, + AIToolDefinition, + AIToolResult, + IAIProvider, +} from '../interfaces/ai-provider.interface.js'; +import { LangchainOpenAIProvider } from '../providers/langchain-openai.provider.js'; +import { LangchainBedrockProvider } from '../providers/langchain-bedrock.provider.js'; + +@Injectable() +export class AICoreService implements IAIService { + private defaultProvider: AIProviderType = AIProviderType.OPENAI; + + constructor( + private readonly openAIProvider: LangchainOpenAIProvider, + private readonly bedrockProvider: LangchainBedrockProvider, + ) {} + + private getProvider(type?: AIProviderType): IAIProvider { + const providerType = type || this.defaultProvider; + switch (providerType) { + case AIProviderType.OPENAI: + return this.openAIProvider; + case AIProviderType.BEDROCK: + return this.bedrockProvider; + default: + throw new Error(`Unknown provider type: ${providerType}`); + } + } + + public async complete(prompt: string, config?: AIProviderConfig): Promise { + return this.getProvider().generateCompletion(prompt, config); + } + + public async completeWithProvider( + provider: AIProviderType, + prompt: string, + config?: AIProviderConfig, + ): Promise { + return this.getProvider(provider).generateCompletion(prompt, config); + } + + public async chat(messages: BaseMessage[], config?: AIProviderConfig): Promise { + return this.getProvider().generateChatCompletion(messages, config); + } + + public async chatWithProvider( + provider: AIProviderType, + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise { + return this.getProvider(provider).generateChatCompletion(messages, config); + } + + public async streamChat( + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise> { + return this.getProvider().generateStreamingCompletion(messages, config); + } + + public async streamChatWithProvider( + provider: AIProviderType, + messages: BaseMessage[], + config?: AIProviderConfig, + ): Promise> { + return this.getProvider(provider).generateStreamingCompletion(messages, config); + } + + public async chatWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + return this.getProvider().generateWithTools(messages, tools, config); + } + + public async chatWithToolsAndProvider( + provider: AIProviderType, + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + return this.getProvider(provider).generateWithTools(messages, tools, config); + } + + public async streamChatWithTools( + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + return this.getProvider().generateStreamingWithTools(messages, tools, config); + } + + public async streamChatWithToolsAndProvider( + provider: AIProviderType, + messages: BaseMessage[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + return this.getProvider(provider).generateStreamingWithTools(messages, tools, config); + } + + public async continueAfterToolCall( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise { + return this.getProvider().continueWithToolResults(messages, toolResults, tools, config); + } + + public async continueStreamingAfterToolCall( + messages: BaseMessage[], + toolResults: AIToolResult[], + tools: AIToolDefinition[], + config?: AIProviderConfig, + ): Promise> { + return this.getProvider().continueStreamingWithToolResults(messages, toolResults, tools, config); + } + + public getDefaultProvider(): AIProviderType { + return this.defaultProvider; + } + + public setDefaultProvider(provider: AIProviderType): void { + this.defaultProvider = provider; + } + + public getAvailableProviders(): Array<{ type: AIProviderType; name: string; defaultModel: string }> { + return [ + { + type: AIProviderType.OPENAI, + name: this.openAIProvider.getProviderName(), + defaultModel: this.openAIProvider.getDefaultModelId(), + }, + { + type: AIProviderType.BEDROCK, + name: this.bedrockProvider.getProviderName(), + defaultModel: this.bedrockProvider.getDefaultModelId(), + }, + ]; + } +} diff --git a/backend/src/ai-core/services/index.ts b/backend/src/ai-core/services/index.ts new file mode 100644 index 000000000..f616c0631 --- /dev/null +++ b/backend/src/ai-core/services/index.ts @@ -0,0 +1 @@ +export * from './ai-core.service.js'; diff --git a/backend/src/ai-core/tools/database-tools.ts b/backend/src/ai-core/tools/database-tools.ts new file mode 100644 index 000000000..9b718f2ca --- /dev/null +++ b/backend/src/ai-core/tools/database-tools.ts @@ -0,0 +1,89 @@ +import { AIToolDefinition } from '../interfaces/ai-provider.interface.js'; + +export function createDatabaseTools(isMongoDB: boolean): AIToolDefinition[] { + const getTableStructureTool: AIToolDefinition = { + name: 'getTableStructure', + description: + 'Returns the structure of the specified table and related information including foreign keys and referenced tables.', + parameters: { + type: 'object', + properties: { + tableName: { + type: 'string', + description: 'The name of the table to get the structure for.', + }, + }, + required: ['tableName'], + additionalProperties: false, + }, + }; + + const executeRawSqlTool: AIToolDefinition = { + name: 'executeRawSql', + description: + 'Executes a raw SQL query and returns the results. Only SELECT queries are allowed. Do not drop the database or any data from the database.', + parameters: { + type: 'object', + properties: { + query: { + type: 'string', + description: + 'The SQL query to execute. Table and column names should be properly escaped. Only SELECT statements are allowed.', + }, + }, + required: ['query'], + additionalProperties: false, + }, + }; + + const executeAggregationPipelineTool: AIToolDefinition = { + name: 'executeAggregationPipeline', + description: + 'Executes a MongoDB aggregation pipeline and returns the results. Do not drop the database or any data from the database.', + parameters: { + type: 'object', + properties: { + pipeline: { + type: 'string', + description: 'The MongoDB aggregation pipeline to execute as a JSON string.', + }, + }, + required: ['pipeline'], + additionalProperties: false, + }, + }; + + const tools: AIToolDefinition[] = [getTableStructureTool]; + + if (isMongoDB) { + tools.push(executeAggregationPipelineTool); + } else { + tools.push(executeRawSqlTool); + } + + return tools; +} + +export function createTableAnalysisTools(): AIToolDefinition[] { + return [ + { + name: 'analyzeTableSchema', + description: 'Analyzes a table schema and returns recommendations for display settings and widgets.', + parameters: { + type: 'object', + properties: { + tableName: { + type: 'string', + description: 'The name of the table to analyze.', + }, + columns: { + type: 'array', + description: 'Array of column definitions with name, type, and constraints.', + }, + }, + required: ['tableName', 'columns'], + additionalProperties: false, + }, + }, + ]; +} diff --git a/backend/src/ai-core/tools/index.ts b/backend/src/ai-core/tools/index.ts new file mode 100644 index 000000000..e0ddfbc73 --- /dev/null +++ b/backend/src/ai-core/tools/index.ts @@ -0,0 +1,3 @@ +export * from './database-tools.js'; +export * from './prompts.js'; +export * from './query-validators.js'; diff --git a/backend/src/ai-core/tools/prompts.ts b/backend/src/ai-core/tools/prompts.ts new file mode 100644 index 000000000..9e8a9b13b --- /dev/null +++ b/backend/src/ai-core/tools/prompts.ts @@ -0,0 +1,118 @@ +import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js'; + +export function createDatabaseQuerySystemPrompt( + tableName: string, + databaseType: ConnectionTypesEnum, + schema?: string, +): string { + const currentDatetime = new Date().toISOString(); + const dbTypeReadable = convertDbTypeToReadableString(databaseType); + + return `You are an AI assistant helping with database queries. +Database type: ${dbTypeReadable} +Table name: "${tableName}". +${schema ? `Schema: "${schema}".` : ''} +Current date and time: ${currentDatetime} + +Please follow these steps EXACTLY: +1. First, always use the getTableStructure tool to analyze the table schema and understand available columns +2. If the question requires data from related tables, note their relationships +3. Generate an appropriate query that answers the user's question precisely +4. Keep queries read-only for safety (SELECT only) +5. ALWAYS call the executeRawSql or executeAggregationPipeline tool with the generated query to get the actual data +6. After receiving query results, explain them to the user in a clear, conversational way +7. Include explanations of your approach when helpful + +IMPORTANT: +- You MUST execute your generated queries using the appropriate tool - this is required for every question +- After generating a SQL query, immediately call executeRawSql with that query +- For MongoDB databases, call executeAggregationPipeline with the aggregation pipeline +- The user cannot see the query results until you execute it with the appropriate tool +- Always provide your answers in a conversational, human-friendly format +- Use mermaid syntax for any diagrams or charts. Clients can render mermaid diagrams. +- Use markdown formatting for tables + +Remember that all responses should be clear and user-friendly, explaining technical details when necessary.`; +} + +export function createTableSettingsSystemPrompt(widgetTypes: string[]): string { + return `You are a database administration assistant. Analyze the following database tables and generate optimal settings for displaying and managing them in a web admin panel. + +For each table, provide: +1. display_name: A human-readable name for the table +2. search_fields: Columns that should be searchable (text fields like name, email, title) +3. readonly_fields: Columns that should not be editable (like auto_increment, timestamps) +4. columns_view: All columns in preferred display order +5. widgets: For each column, suggest the best widget type from: ${widgetTypes.join(', ')} + +Available widget types and when to use them: +- Password: for password fields +- Boolean: for boolean/bit columns +- Date: for date columns +- Time: for time-only columns +- DateTime: for datetime/timestamp columns +- JSON: for JSON/JSONB columns +- Textarea: for long text fields (description, content, etc.) +- String: for short text fields (name, title, etc.) +- Readonly: for auto-generated fields +- Number: for numeric columns +- Select: for columns with limited options +- UUID: for UUID columns +- Enum: for enum columns +- Foreign_key: for foreign key columns +- File: for file path columns +- Image: for image URL columns +- URL: for URL columns +- Code: for code snippets +- Phone: for phone number columns +- Country: for country columns +- Color: for color columns (hex values) +- Range: for range values +- Timezone: for timezone columns + +Respond ONLY with valid JSON in this exact format (no markdown, no explanations): +{ + "tables": [ + { + "table_name": "table_name", + "display_name": "Human Readable Name", + "search_fields": ["name", "email"], + "readonly_fields": ["id", "created_at"], + "columns_view": ["id", "name", "email", "created_at"], + "widgets": [ + { + "field_name": "column_name", + "widget_type": "String", + "name": "Column Display Name", + "description": "Description of what this column contains" + } + ] + } + ] +}`; +} + +export function convertDbTypeToReadableString(dataType: ConnectionTypesEnum): string { + switch (dataType) { + case ConnectionTypesEnum.postgres: + case ConnectionTypesEnum.agent_postgres: + return 'PostgreSQL'; + case ConnectionTypesEnum.mysql: + case ConnectionTypesEnum.agent_mysql: + return 'MySQL'; + case ConnectionTypesEnum.mongodb: + case ConnectionTypesEnum.agent_mongodb: + return 'MongoDB'; + case ConnectionTypesEnum.mssql: + case ConnectionTypesEnum.agent_mssql: + return 'Microsoft SQL Server'; + case ConnectionTypesEnum.oracledb: + case ConnectionTypesEnum.agent_oracledb: + return 'Oracle DB'; + case ConnectionTypesEnum.ibmdb2: + case ConnectionTypesEnum.agent_ibmdb2: + return 'IBM DB2'; + default: + return 'Unknown Database'; + } +} diff --git a/backend/src/ai-core/tools/query-validators.ts b/backend/src/ai-core/tools/query-validators.ts new file mode 100644 index 000000000..82406698f --- /dev/null +++ b/backend/src/ai-core/tools/query-validators.ts @@ -0,0 +1,111 @@ +import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js'; + +export function isValidSQLQuery(query: string): boolean { + const upperCaseQuery = query.toUpperCase(); + const forbiddenKeywords = ['DROP', 'DELETE', 'ALTER', 'TRUNCATE', 'INSERT', 'UPDATE']; + + if (forbiddenKeywords.some((keyword) => upperCaseQuery.includes(keyword))) { + return false; + } + + const cleanedQuery = query.trim().replace(/;$/, ''); + + const sqlInjectionPatterns = [/--/, /\/\*/, /\*\//]; + + if (sqlInjectionPatterns.some((pattern) => pattern.test(cleanedQuery))) { + return false; + } + + if (cleanedQuery.split(';').length > 1) { + return false; + } + + const selectPattern = /^\s*SELECT\s+[\s\S]+\s+FROM\s+/i; + if (!selectPattern.test(cleanedQuery)) { + return false; + } + + return true; +} + +export function isValidMongoDbCommand(command: string): boolean { + const upperCaseCommand = command.toUpperCase(); + const forbiddenKeywords = ['DROP', 'REMOVE', 'UPDATE', 'INSERT', 'DELETE']; + + if (forbiddenKeywords.some((keyword) => upperCaseCommand.includes(keyword))) { + return false; + } + + const injectionPatterns = [/\/\*/, /\*\//]; + + if (injectionPatterns.some((pattern) => pattern.test(command))) { + return false; + } + + return true; +} + +export function wrapQueryWithLimit(query: string, databaseType: ConnectionTypesEnum, limit: number = 1000): string { + const queryWithoutSemicolon = query.replace(/;$/, ''); + + switch (databaseType) { + case ConnectionTypesEnum.postgres: + case ConnectionTypesEnum.agent_postgres: + case ConnectionTypesEnum.mysql: + case ConnectionTypesEnum.agent_mysql: + case ConnectionTypesEnum.mssql: + case ConnectionTypesEnum.agent_mssql: + return `SELECT * FROM (${queryWithoutSemicolon}) AS ai_query LIMIT ${limit}`; + case ConnectionTypesEnum.ibmdb2: + case ConnectionTypesEnum.agent_ibmdb2: + return `SELECT * FROM (${queryWithoutSemicolon}) AS ai_query FETCH FIRST ${limit} ROWS ONLY`; + case ConnectionTypesEnum.oracledb: + case ConnectionTypesEnum.agent_oracledb: + return `SELECT * FROM (${queryWithoutSemicolon}) WHERE ROWNUM <= ${limit}`; + default: + throw new Error('Unsupported database type'); + } +} + +export function sanitizeJsonString(jsonStr: string): string { + try { + JSON.parse(jsonStr); + return jsonStr; + } catch (_e) { + const startBrace = jsonStr.indexOf('{'); + if (startBrace === -1) { + return '{}'; + } + + const endBrace = jsonStr.lastIndexOf('}'); + if (endBrace === -1 || endBrace <= startBrace) { + return '{}'; + } + + let possibleJson = jsonStr.substring(startBrace, endBrace + 1); + + possibleJson = possibleJson.replace(/,\s*}/g, '}'); + possibleJson = possibleJson.replace(/,\s*]/g, ']'); + + try { + JSON.parse(possibleJson); + return possibleJson; + } catch (_parseErr) { + console.error('Could not sanitize JSON, returning empty object'); + return '{}'; + } + } +} + +export function cleanAIJsonResponse(response: string): string { + let cleanedResponse = response.trim(); + if (cleanedResponse.startsWith('```json')) { + cleanedResponse = cleanedResponse.slice(7); + } else if (cleanedResponse.startsWith('```')) { + cleanedResponse = cleanedResponse.slice(3); + } + if (cleanedResponse.endsWith('```')) { + cleanedResponse = cleanedResponse.slice(0, -3); + } + return cleanedResponse.trim(); +} diff --git a/backend/src/ai-core/utils/index.ts b/backend/src/ai-core/utils/index.ts new file mode 100644 index 000000000..e4be3d96f --- /dev/null +++ b/backend/src/ai-core/utils/index.ts @@ -0,0 +1 @@ +export * from './message-builder.js'; diff --git a/backend/src/ai-core/utils/message-builder.ts b/backend/src/ai-core/utils/message-builder.ts new file mode 100644 index 000000000..a3f14882e --- /dev/null +++ b/backend/src/ai-core/utils/message-builder.ts @@ -0,0 +1,71 @@ +import { HumanMessage, SystemMessage, AIMessage, ToolMessage, BaseMessage } from '@langchain/core/messages'; +import { AIToolCall } from '../interfaces/ai-provider.interface.js'; + +export class MessageBuilder { + private messages: BaseMessage[] = []; + + public system(content: string): MessageBuilder { + this.messages.push(new SystemMessage(content)); + return this; + } + + public human(content: string): MessageBuilder { + this.messages.push(new HumanMessage(content)); + return this; + } + + public ai(content: string, toolCalls?: AIToolCall[]): MessageBuilder { + const message = new AIMessage({ + content, + tool_calls: toolCalls?.map((tc) => ({ + id: tc.id, + name: tc.name, + args: tc.arguments, + })), + }); + this.messages.push(message); + return this; + } + + public toolResult(toolCallId: string, result: string): MessageBuilder { + this.messages.push( + new ToolMessage({ + tool_call_id: toolCallId, + content: result, + }), + ); + return this; + } + + public toolResults(results: Array<{ toolCallId: string; result: string }>): MessageBuilder { + for (const result of results) { + this.toolResult(result.toolCallId, result.result); + } + return this; + } + + public build(): BaseMessage[] { + return this.messages; + } + + public clear(): MessageBuilder { + this.messages = []; + return this; + } + + public get length(): number { + return this.messages.length; + } + + public static fromMessages(messages: BaseMessage[]): MessageBuilder { + const builder = new MessageBuilder(); + builder.messages = [...messages]; + return builder; + } +} + +export function createSimpleMessages(systemPrompt: string, userMessage: string): BaseMessage[] { + return new MessageBuilder().system(systemPrompt).human(userMessage).build(); +} + +export { HumanMessage, SystemMessage, AIMessage, ToolMessage, BaseMessage }; diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index 1ff4787d0..6b3bcce73 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -3,6 +3,7 @@ import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; import { ScheduleModule } from '@nestjs/schedule'; import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler'; import { AppController } from './app.controller.js'; +import { AICoreModule } from './ai-core/ai-core.module.js'; import { GlobalDatabaseContext } from './common/application/global-database-context.js'; import { BaseType, UseCaseType } from './common/data-injection.tokens.js'; import { AIModule } from './entities/ai/ai.module.js'; @@ -58,6 +59,7 @@ import { DashboardWidgetModule } from './entities/visualizations/dashboard-widge }, ], }), + AICoreModule, ConnectionModule, ConnectionPropertiesModule, ConversionModule, diff --git a/backend/src/entities/ai/ai.module.ts b/backend/src/entities/ai/ai.module.ts index 0c3ba74c0..121bef06f 100644 --- a/backend/src/entities/ai/ai.module.ts +++ b/backend/src/entities/ai/ai.module.ts @@ -1,21 +1,14 @@ -import { - Global, - MiddlewareConsumer, - Module, - NestModule, - RequestMethod, -} from "@nestjs/common"; -import { TypeOrmModule } from "@nestjs/typeorm"; -import { AuthMiddleware } from "../../authorization/auth.middleware.js"; -import { GlobalDatabaseContext } from "../../common/application/global-database-context.js"; -import { BaseType, UseCaseType } from "../../common/data-injection.tokens.js"; -import { LogOutEntity } from "../log-out/log-out.entity.js"; -import { UserEntity } from "../user/user.entity.js"; -import { AiService } from "./ai.service.js"; -import { AmazonBedrockAiProvider } from "./amazon-bedrock/amazon-bedrock.ai.provider.js"; -import { RequestAISettingsAndWidgetsCreationUseCase } from "./use-cases/request-ai-settings-and-widgets-creation.use.case.js"; -import { RequestInfoFromTableWithAIUseCaseV4 } from "./use-cases/request-info-from-table-with-ai-v4.use.case.js"; -import { UserAIRequestsControllerV2 } from "./user-ai-requests-v2.controller.js"; +import { Global, MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { AuthMiddleware } from '../../authorization/auth.middleware.js'; +import { GlobalDatabaseContext } from '../../common/application/global-database-context.js'; +import { BaseType, UseCaseType } from '../../common/data-injection.tokens.js'; +import { LogOutEntity } from '../log-out/log-out.entity.js'; +import { UserEntity } from '../user/user.entity.js'; +import { AiService } from './ai.service.js'; +import { RequestAISettingsAndWidgetsCreationUseCase } from './use-cases/request-ai-settings-and-widgets-creation.use.case.js'; +import { RequestInfoFromTableWithAIUseCaseV5 } from './use-cases/request-info-from-table-with-ai-v5.use.case.js'; +import { UserAIRequestsControllerV2 } from './user-ai-requests-v2.controller.js'; @Global() @Module({ @@ -27,16 +20,15 @@ import { UserAIRequestsControllerV2 } from "./user-ai-requests-v2.controller.js" }, { provide: UseCaseType.REQUEST_INFO_FROM_TABLE_WITH_AI_V2, - useClass: RequestInfoFromTableWithAIUseCaseV4, + useClass: RequestInfoFromTableWithAIUseCaseV5, }, { provide: UseCaseType.REQUEST_AI_SETTINGS_AND_WIDGETS_CREATION, useClass: RequestAISettingsAndWidgetsCreationUseCase, }, - AmazonBedrockAiProvider, AiService, ], - exports: [AiService, AmazonBedrockAiProvider], + exports: [AiService], controllers: [UserAIRequestsControllerV2], }) export class AIModule implements NestModule { @@ -44,8 +36,8 @@ export class AIModule implements NestModule { consumer .apply(AuthMiddleware) .forRoutes( - { path: "/ai/v2/request/:connectionId", method: RequestMethod.POST }, - { path: "/ai/v2/setup/:connectionId", method: RequestMethod.GET }, + { path: '/ai/v2/request/:connectionId', method: RequestMethod.POST }, + { path: '/ai/v2/setup/:connectionId', method: RequestMethod.GET }, ); } } diff --git a/backend/src/entities/ai/ai.service.ts b/backend/src/entities/ai/ai.service.ts index c6465bf7f..a2187465c 100644 --- a/backend/src/entities/ai/ai.service.ts +++ b/backend/src/entities/ai/ai.service.ts @@ -3,8 +3,8 @@ import { WidgetTypeEnum } from '../../enums/widget-type.enum.js'; import { checkFieldAutoincrement } from '../../helpers/check-field-autoincrement.js'; import { TableWidgetEntity } from '../widget/table-widget.entity.js'; import { TableInformation } from './ai-data-entities/types/ai-module-types.js'; -import { AmazonBedrockAiProvider } from './amazon-bedrock/amazon-bedrock.ai.provider.js'; import { TableSettingsEntity } from '../table-settings/common-table-settings/table-settings.entity.js'; +import { AICoreService, AIProviderType, cleanAIJsonResponse } from '../../ai-core/index.js'; interface AIGeneratedTableSettings { table_name: string; @@ -26,13 +26,15 @@ interface AIResponse { @Injectable() export class AiService { - constructor(protected readonly aiProvider: AmazonBedrockAiProvider) {} + constructor(protected readonly aiCoreService: AICoreService) {} public async generateNewTableSettingsWithAI( tablesInformation: Array, ): Promise> { const prompt = this.buildPrompt(tablesInformation); - const aiResponse = await this.aiProvider.generateResponse(prompt); + const aiResponse = await this.aiCoreService.completeWithProvider(AIProviderType.BEDROCK, prompt, { + temperature: 0.3, + }); const parsedResponse = this.parseAIResponse(aiResponse); return this.buildTableSettingsEntities(parsedResponse, tablesInformation); } @@ -123,16 +125,7 @@ Respond ONLY with valid JSON in this exact format (no markdown, no explanations) } private parseAIResponse(aiResponse: string): AIResponse { - let cleanedResponse = aiResponse.trim(); - if (cleanedResponse.startsWith('```json')) { - cleanedResponse = cleanedResponse.slice(7); - } else if (cleanedResponse.startsWith('```')) { - cleanedResponse = cleanedResponse.slice(3); - } - if (cleanedResponse.endsWith('```')) { - cleanedResponse = cleanedResponse.slice(0, -3); - } - cleanedResponse = cleanedResponse.trim(); + const cleanedResponse = cleanAIJsonResponse(aiResponse); try { return JSON.parse(cleanedResponse) as AIResponse; diff --git a/backend/src/entities/ai/use-cases/request-info-from-table-with-ai-v5.use.case.ts b/backend/src/entities/ai/use-cases/request-info-from-table-with-ai-v5.use.case.ts new file mode 100644 index 000000000..f1ed45800 --- /dev/null +++ b/backend/src/entities/ai/use-cases/request-info-from-table-with-ai-v5.use.case.ts @@ -0,0 +1,344 @@ +import { BadRequestException, Inject, Injectable, NotFoundException, Scope } from '@nestjs/common'; +import { getDataAccessObject } from '@rocketadmin/shared-code/dist/src/data-access-layer/shared/create-data-access-object.js'; +import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js'; +import { IDataAccessObject } from '@rocketadmin/shared-code/dist/src/shared/interfaces/data-access-object.interface.js'; +import { IDataAccessObjectAgent } from '@rocketadmin/shared-code/dist/src/shared/interfaces/data-access-object-agent.interface.js'; +import Sentry from '@sentry/minimal'; +import { Response } from 'express'; +import { BaseMessage } from '@langchain/core/messages'; +import AbstractUseCase from '../../../common/abstract-use.case.js'; +import { IGlobalDatabaseContext } from '../../../common/application/global-database-context.interface.js'; +import { BaseType } from '../../../common/data-injection.tokens.js'; +import { Messages } from '../../../exceptions/text/messages.js'; +import { slackPostMessage } from '../../../helpers/index.js'; +import { isConnectionTypeAgent } from '../../../helpers/is-connection-entity-agent.js'; +import { ConnectionEntity } from '../../connection/connection.entity.js'; +import { AiResponsesToUserEntity } from '../ai-data-entities/ai-reponses-to-user/ai-responses-to-user.entity.js'; +import { IRequestInfoFromTableV2 } from '../ai-use-cases.interface.js'; +import { RequestInfoFromTableDSV2 } from '../application/data-structures/request-info-from-table.ds.js'; +import { + AICoreService, + AIToolDefinition, + AIToolCall, + MessageBuilder, + createDatabaseTools, + createDatabaseQuerySystemPrompt, + isValidSQLQuery, + isValidMongoDbCommand, + wrapQueryWithLimit, +} from '../../../ai-core/index.js'; + +@Injectable({ scope: Scope.REQUEST }) +export class RequestInfoFromTableWithAIUseCaseV5 + extends AbstractUseCase + implements IRequestInfoFromTableV2 +{ + private readonly maxDepth: number = 5; + + constructor( + @Inject(BaseType.GLOBAL_DB_CONTEXT) + protected _dbContext: IGlobalDatabaseContext, + private readonly aiCoreService: AICoreService, + ) { + super(); + } + + public async implementation(inputData: RequestInfoFromTableDSV2): Promise { + const { connectionId, tableName, user_message, master_password, user_id, response, ai_thread_id } = inputData; + + this.setupResponseHeaders(response); + + const { foundConnection, dataAccessObject, isMongoDb, userEmail } = await this.setupConnection( + connectionId, + master_password, + user_id, + ); + + const tools = createDatabaseTools(isMongoDb); + + const systemPrompt = createDatabaseQuerySystemPrompt( + tableName, + foundConnection.type as ConnectionTypesEnum, + foundConnection.schema, + ); + + let threadIdForHeader: string | null = null; + let foundUserAiResponse: AiResponsesToUserEntity | null = null; + let previousResponseId: string | null = null; + + if (ai_thread_id) { + foundUserAiResponse = await this._dbContext.aiResponsesToUserRepository.findResponseByIdAndUserId( + ai_thread_id, + user_id, + ); + if (foundUserAiResponse) { + threadIdForHeader = foundUserAiResponse.id; + previousResponseId = foundUserAiResponse.ai_response_id; + } + } + + if (!foundUserAiResponse) { + const newAiResponse = new AiResponsesToUserEntity(); + newAiResponse.ai_response_id = null; + newAiResponse.user_id = user_id; + foundUserAiResponse = await this._dbContext.aiResponsesToUserRepository.save(newAiResponse); + threadIdForHeader = foundUserAiResponse.id; + } + + if (threadIdForHeader) { + response.setHeader('X-AI-Thread-ID', threadIdForHeader); + } + + const messages = new MessageBuilder().system(systemPrompt).human(user_message).build(); + + try { + const lastResponseId = await this.processWithToolLoop( + messages, + tools, + response, + dataAccessObject, + tableName, + userEmail, + foundConnection, + previousResponseId, + ); + + if (foundUserAiResponse && lastResponseId) { + foundUserAiResponse.ai_response_id = lastResponseId; + await this._dbContext.aiResponsesToUserRepository.save(foundUserAiResponse); + } + response.end(); + } catch (error) { + await slackPostMessage(error?.message); + Sentry.captureException(error); + if (!response.headersSent) { + response.status(500).send({ error: 'An error occurred while processing your request.' }); + } + } + } + + private async processWithToolLoop( + messages: BaseMessage[], + tools: AIToolDefinition[], + response: Response, + dataAccessObject: IDataAccessObject | IDataAccessObjectAgent, + inputTableName: string, + userEmail: string, + foundConnection: ConnectionEntity, + previousResponseId: string | null = null, + ): Promise { + let currentMessages = [...messages]; + let lastResponseId: string | null = previousResponseId; + let depth = 0; + + while (depth < this.maxDepth) { + try { + const config = lastResponseId ? { previousResponseId: lastResponseId } : undefined; + + const stream = await this.aiCoreService.streamChatWithTools(currentMessages, tools, config); + + let accumulatedContent = ''; + let pendingToolCalls: AIToolCall[] = []; + + for await (const chunk of stream) { + if (chunk.type === 'text' && chunk.content) { + response.write(chunk.content); + accumulatedContent += chunk.content; + } + + if (chunk.type === 'tool_call' && chunk.toolCall) { + pendingToolCalls.push(chunk.toolCall); + } + + if (chunk.responseId) { + lastResponseId = chunk.responseId; + } + + if (chunk.type === 'done') { + // Stream complete + } + } + + if (pendingToolCalls.length === 0) { + break; + } + + const toolResults = await this.executeToolCalls( + pendingToolCalls, + dataAccessObject, + inputTableName, + userEmail, + foundConnection, + ); + + const toolMessageBuilder = new MessageBuilder(); + for (const result of toolResults) { + toolMessageBuilder.toolResult(result.toolCallId, result.result); + } + currentMessages = toolMessageBuilder.build(); + + depth++; + } catch (loopError) { + throw loopError; + } + } + + if (depth >= this.maxDepth) { + response.write( + '\n\nYour question is too complex to process at this time. Please try simplifying it or breaking it down into smaller parts.', + ); + } + + return lastResponseId; + } + + private async executeToolCalls( + toolCalls: AIToolCall[], + dataAccessObject: IDataAccessObject | IDataAccessObjectAgent, + inputTableName: string, + userEmail: string, + foundConnection: ConnectionEntity, + ): Promise> { + const results: Array<{ toolCallId: string; result: string }> = []; + + for (const toolCall of toolCalls) { + let result: string; + + try { + switch (toolCall.name) { + case 'getTableStructure': { + const tableName = (toolCall.arguments.tableName as string) || inputTableName; + const structureInfo = await this.getTableStructureInfo( + dataAccessObject, + tableName, + userEmail, + foundConnection, + ); + result = JSON.stringify(structureInfo); + break; + } + + case 'executeRawSql': { + const query = toolCall.arguments.query as string; + if (!query) { + throw new Error('Missing required function argument "query"'); + } + if (!isValidSQLQuery(query)) { + throw new Error( + 'Invalid SQL query. Please ensure it is a read-only SELECT statement without any forbidden keywords.', + ); + } + const wrappedQuery = wrapQueryWithLimit(query, foundConnection.type as ConnectionTypesEnum); + const queryResult = await dataAccessObject.executeRawQuery(wrappedQuery, inputTableName, userEmail); + result = JSON.stringify(queryResult); + break; + } + + case 'executeAggregationPipeline': { + const pipeline = toolCall.arguments.pipeline as string; + if (!pipeline) { + throw new Error('Missing required function argument "pipeline"'); + } + if (!isValidMongoDbCommand(pipeline)) { + throw new Error( + 'Invalid MongoDB command. Please ensure it is a read-only aggregation pipeline without any forbidden keywords.', + ); + } + const pipelineResult = await dataAccessObject.executeRawQuery(pipeline, inputTableName, userEmail); + result = JSON.stringify(pipelineResult); + break; + } + + default: + result = JSON.stringify({ error: `Unknown tool: ${toolCall.name}` }); + } + } catch (error) { + result = JSON.stringify({ error: error.message }); + } + + results.push({ toolCallId: toolCall.id, result }); + } + + return results; + } + + private async getTableStructureInfo( + dao: IDataAccessObject | IDataAccessObjectAgent, + tableName: string, + userEmail: string, + foundConnection: ConnectionEntity, + ) { + const [tableStructure, tableForeignKeys, referencedTableNamesAndColumns] = await Promise.all([ + dao.getTableStructure(tableName, userEmail), + dao.getTableForeignKeys(tableName, userEmail), + dao.getReferencedTableNamesAndColumns(tableName, userEmail), + ]); + + const referencedTablesStructures = []; + const structurePromises = referencedTableNamesAndColumns.flatMap((referencedTable) => + referencedTable.referenced_by.map((table) => + dao.getTableStructure(table.table_name, userEmail).then((structure) => ({ + tableName: table.table_name, + structure, + })), + ), + ); + referencedTablesStructures.push(...(await Promise.all(structurePromises))); + + const foreignTablesStructures = []; + const foreignTablesStructurePromises = tableForeignKeys.flatMap((foreignKey) => + dao.getTableStructure(foreignKey.referenced_table_name, userEmail).then((structure) => ({ + tableName: foreignKey.referenced_table_name, + structure, + })), + ); + foreignTablesStructures.push(...(await Promise.all(foreignTablesStructurePromises))); + + return { + tableStructure, + tableName, + schema: foundConnection.schema || null, + tableForeignKeys, + referencedTableNamesAndColumns, + referencedTablesStructures, + foreignTablesStructures, + }; + } + + private setupResponseHeaders(response: Response): void { + response.setHeader('Content-Type', 'text/event-stream'); + response.setHeader('Cache-Control', 'no-cache'); + response.setHeader('Connection', 'keep-alive'); + response.setHeader('Access-Control-Expose-Headers', 'X-AI-Thread-ID'); + } + + private async setupConnection(connectionId: string, master_password: string, user_id: string) { + const foundConnection = await this._dbContext.connectionRepository.findAndDecryptConnection( + connectionId, + master_password, + ); + + if (!foundConnection) { + throw new NotFoundException(Messages.CONNECTION_NOT_FOUND); + } + + let userEmail: string; + if (isConnectionTypeAgent(foundConnection.type)) { + userEmail = await this._dbContext.userRepository.getUserEmailOrReturnNull(user_id); + } + + const connectionProperties = + await this._dbContext.connectionPropertiesRepository.findConnectionProperties(connectionId); + + if (connectionProperties && !connectionProperties.allow_ai_requests) { + throw new BadRequestException(Messages.AI_REQUESTS_NOT_ALLOWED); + } + + const dataAccessObject = getDataAccessObject(foundConnection); + const databaseType = foundConnection.type; + const isMongoDb = + databaseType === ConnectionTypesEnum.mongodb || databaseType === ConnectionTypesEnum.agent_mongodb; + + return { foundConnection, dataAccessObject, databaseType, isMongoDb, userEmail }; + } +} diff --git a/backend/src/entities/ai/user-ai-requests-v2.controller.ts b/backend/src/entities/ai/user-ai-requests-v2.controller.ts index 7e5ffce6e..f28789cbb 100644 --- a/backend/src/entities/ai/user-ai-requests-v2.controller.ts +++ b/backend/src/entities/ai/user-ai-requests-v2.controller.ts @@ -9,37 +9,27 @@ import { Res, UseGuards, UseInterceptors, -} from "@nestjs/common"; -import { - ApiBearerAuth, - ApiBody, - ApiOperation, - ApiQuery, - ApiResponse, - ApiTags, -} from "@nestjs/swagger"; -import { Response } from "express"; -import { UseCaseType } from "../../common/data-injection.tokens.js"; -import { MasterPassword } from "../../decorators/master-password.decorator.js"; -import { QueryTableName } from "../../decorators/query-table-name.decorator.js"; -import { SlugUuid } from "../../decorators/slug-uuid.decorator.js"; -import { UserId } from "../../decorators/user-id.decorator.js"; -import { InTransactionEnum } from "../../enums/in-transaction.enum.js"; -import { ConnectionEditGuard } from "../../guards/connection-edit.guard.js"; -import { TableReadGuard } from "../../guards/table-read.guard.js"; -import { ValidationHelper } from "../../helpers/validators/validation-helper.js"; -import { SentryInterceptor } from "../../interceptors/sentry.interceptor.js"; -import { - IAISettingsAndWidgetsCreation, - IRequestInfoFromTableV2, -} from "./ai-use-cases.interface.js"; -import { RequestInfoFromTableDSV2 } from "./application/data-structures/request-info-from-table.ds.js"; -import { RequestInfoFromTableBodyDTO } from "./application/dto/request-info-from-table-body.dto.js"; +} from '@nestjs/common'; +import { ApiBearerAuth, ApiBody, ApiOperation, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { Response } from 'express'; +import { UseCaseType } from '../../common/data-injection.tokens.js'; +import { MasterPassword } from '../../decorators/master-password.decorator.js'; +import { QueryTableName } from '../../decorators/query-table-name.decorator.js'; +import { SlugUuid } from '../../decorators/slug-uuid.decorator.js'; +import { UserId } from '../../decorators/user-id.decorator.js'; +import { InTransactionEnum } from '../../enums/in-transaction.enum.js'; +import { ConnectionEditGuard } from '../../guards/connection-edit.guard.js'; +import { TableReadGuard } from '../../guards/table-read.guard.js'; +import { ValidationHelper } from '../../helpers/validators/validation-helper.js'; +import { SentryInterceptor } from '../../interceptors/sentry.interceptor.js'; +import { IAISettingsAndWidgetsCreation, IRequestInfoFromTableV2 } from './ai-use-cases.interface.js'; +import { RequestInfoFromTableDSV2 } from './application/data-structures/request-info-from-table.ds.js'; +import { RequestInfoFromTableBodyDTO } from './application/dto/request-info-from-table-body.dto.js'; @UseInterceptors(SentryInterceptor) @Controller() @ApiBearerAuth() -@ApiTags("ai v2") +@ApiTags('ai v2') @Injectable() export class UserAIRequestsControllerV2 { constructor( @@ -50,20 +40,20 @@ export class UserAIRequestsControllerV2 { ) {} @ApiOperation({ - summary: "Request info from table in connection with AI (Version 2)", + summary: 'Request info from table in connection with AI (Version 2)', }) @ApiResponse({ status: 201, - description: "Returned info.", + description: 'Returned info.', }) @UseGuards(TableReadGuard) @ApiBody({ type: RequestInfoFromTableBodyDTO }) - @ApiQuery({ name: "tableName", required: true, type: String }) - @ApiQuery({ name: "threadId", required: false, type: String }) - @Post("/ai/v2/request/:connectionId") + @ApiQuery({ name: 'tableName', required: true, type: String }) + @ApiQuery({ name: 'threadId', required: false, type: String }) + @Post('/ai/v2/request/:connectionId') public async requestInfoFromTableWithAI( - @SlugUuid("connectionId") connectionId: string, - @Query("threadId") threadId: string, + @SlugUuid('connectionId') connectionId: string, + @Query('threadId') threadId: string, @QueryTableName() tableName: string, @MasterPassword() masterPassword: string, @UserId() userId: string, @@ -72,11 +62,9 @@ export class UserAIRequestsControllerV2 { ): Promise { if (threadId) { if (!ValidationHelper.isValidUUID(threadId)) { - response - .status(400) - .send({ - error: "Invalid threadId format. It should be a valid UUID.", - }); + response.status(400).send({ + error: 'Invalid threadId format. It should be a valid UUID.', + }); return; } } @@ -89,23 +77,20 @@ export class UserAIRequestsControllerV2 { response, ai_thread_id: threadId || null, }; - return await this.requestInfoFromTableWithAIUseCase.execute( - inputData, - InTransactionEnum.OFF, - ); + return await this.requestInfoFromTableWithAIUseCase.execute(inputData, InTransactionEnum.OFF); } @ApiOperation({ - summary: "Request AI settings and widgets creation for connection", + summary: 'Request AI settings and widgets creation for connection', }) @ApiResponse({ status: 200, - description: "AI settings and widgets creation job has been queued.", + description: 'AI settings and widgets creation job has been queued.', }) @UseGuards(ConnectionEditGuard) - @Get("/ai/v2/setup/:connectionId") + @Get('/ai/v2/setup/:connectionId') public async requestAISettingsAndWidgetsCreation( - @SlugUuid("connectionId") connectionId: string, + @SlugUuid('connectionId') connectionId: string, @MasterPassword() masterPassword: string, @UserId() userId: string, ): Promise { @@ -114,9 +99,6 @@ export class UserAIRequestsControllerV2 { masterPwd: masterPassword, cognitoUserName: userId, }; - return await this.requestAISettingsAndWidgetsCreationUseCase.execute( - connectionData, - InTransactionEnum.OFF, - ); + return await this.requestAISettingsAndWidgetsCreationUseCase.execute(connectionData, InTransactionEnum.OFF); } } diff --git a/backend/src/entities/table-settings/common-table-settings/use-cases/update-table-settings.use.case.ts b/backend/src/entities/table-settings/common-table-settings/use-cases/update-table-settings.use.case.ts index f39e57873..6d6410895 100644 --- a/backend/src/entities/table-settings/common-table-settings/use-cases/update-table-settings.use.case.ts +++ b/backend/src/entities/table-settings/common-table-settings/use-cases/update-table-settings.use.case.ts @@ -16,52 +16,52 @@ import { buildValidateTableSettingsDS } from '@rocketadmin/shared-code/dist/src/ @Injectable({ scope: Scope.REQUEST }) export class UpdateTableSettingsUseCase - extends AbstractUseCase - implements IUpdateTableSettings + extends AbstractUseCase + implements IUpdateTableSettings { - constructor( - @Inject(BaseType.GLOBAL_DB_CONTEXT) - protected _dbContext: IGlobalDatabaseContext, - ) { - super(); - } + constructor( + @Inject(BaseType.GLOBAL_DB_CONTEXT) + protected _dbContext: IGlobalDatabaseContext, + ) { + super(); + } - protected async implementation(inputData: CreateTableSettingsDs): Promise { - const { connection_id, masterPwd, table_name } = inputData; - const foundConnection = await this._dbContext.connectionRepository.findAndDecryptConnection( - connection_id, - masterPwd, - ); - const dao = getDataAccessObject(foundConnection); - const tableSettingsDs: ValidateTableSettingsDS = buildValidateTableSettingsDS(inputData); - const errors: Array = await dao.validateSettings(tableSettingsDs, table_name, undefined); - if (errors.length > 0) { - throw new HttpException( - { - message: toPrettyErrorsMsg(errors), - }, - HttpStatus.BAD_REQUEST, - ); - } - const settingsToUpdate = await this._dbContext.tableSettingsRepository.findTableSettings(connection_id, table_name); - if (!settingsToUpdate) { - throw new HttpException( - { - message: Messages.TABLE_SETTINGS_NOT_FOUND, - }, - HttpStatus.BAD_REQUEST, - ); - } - const updateTableSettings = buildNewTableSettingsEntity(inputData, foundConnection); - for (const key in updateTableSettings) { - // eslint-disable-next-line security/detect-object-injection - if (updateTableSettings[key] === undefined) { - // eslint-disable-next-line security/detect-object-injection - delete updateTableSettings[key]; - } - } - const updated = Object.assign(settingsToUpdate, updateTableSettings); - const savedTableSettings = await this._dbContext.tableSettingsRepository.saveNewOrUpdatedSettings(updated); - return buildFoundTableSettingsDs(savedTableSettings); - } + protected async implementation(inputData: CreateTableSettingsDs): Promise { + const { connection_id, masterPwd, table_name } = inputData; + const foundConnection = await this._dbContext.connectionRepository.findAndDecryptConnection( + connection_id, + masterPwd, + ); + const dao = getDataAccessObject(foundConnection); + const tableSettingsDs: ValidateTableSettingsDS = buildValidateTableSettingsDS(inputData); + const errors: Array = await dao.validateSettings(tableSettingsDs, table_name, undefined); + if (errors.length > 0) { + throw new HttpException( + { + message: toPrettyErrorsMsg(errors), + }, + HttpStatus.BAD_REQUEST, + ); + } + const settingsToUpdate = await this._dbContext.tableSettingsRepository.findTableSettings(connection_id, table_name); + if (!settingsToUpdate) { + throw new HttpException( + { + message: Messages.TABLE_SETTINGS_NOT_FOUND, + }, + HttpStatus.BAD_REQUEST, + ); + } + const updateTableSettings = buildNewTableSettingsEntity(inputData, foundConnection); + for (const key in updateTableSettings) { + // eslint-disable-next-line security/detect-object-injection + if (updateTableSettings[key] === undefined) { + // eslint-disable-next-line security/detect-object-injection + delete updateTableSettings[key]; + } + } + const updated = Object.assign(settingsToUpdate, updateTableSettings); + const savedTableSettings = await this._dbContext.tableSettingsRepository.saveNewOrUpdatedSettings(updated); + return buildFoundTableSettingsDs(savedTableSettings); + } } diff --git a/backend/src/helpers/app/get-requeired-env-variable.ts b/backend/src/helpers/app/get-requeired-env-variable.ts index 65bd492e9..a01ac6f05 100644 --- a/backend/src/helpers/app/get-requeired-env-variable.ts +++ b/backend/src/helpers/app/get-requeired-env-variable.ts @@ -6,3 +6,8 @@ export function getRequiredEnvVariable(variableName: string): string { } return variableValue; } + +export function getOptionalEnvVariable(variableName: string): string | undefined { + // eslint-disable-next-line security/detect-object-injection + return process.env[variableName]; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9dc86f22f..f8d5593a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -235,6 +235,56 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-bedrock-agent-runtime@npm:^3.755.0": + version: 3.969.0 + resolution: "@aws-sdk/client-bedrock-agent-runtime@npm:3.969.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/credential-provider-node": 3.969.0 + "@aws-sdk/middleware-host-header": 3.969.0 + "@aws-sdk/middleware-logger": 3.969.0 + "@aws-sdk/middleware-recursion-detection": 3.969.0 + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/region-config-resolver": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@aws-sdk/util-user-agent-browser": 3.969.0 + "@aws-sdk/util-user-agent-node": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.20.5 + "@smithy/eventstream-serde-browser": ^4.2.8 + "@smithy/eventstream-serde-config-resolver": ^4.3.8 + "@smithy/eventstream-serde-node": ^4.2.8 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-retry": ^4.4.22 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.21 + "@smithy/util-defaults-mode-node": ^4.2.24 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 148102d9b16d49fa1a3f0ebc6dd94279509c7d7789ccd4e9aa7ce13e47f627e06ad9aac8dcb33eeed97842565bf8af8ae500790c56c66da4f20965a9c2c05f71 + languageName: node + linkType: hard + "@aws-sdk/client-bedrock-runtime@npm:^3.954.0": version: 3.958.0 resolution: "@aws-sdk/client-bedrock-runtime@npm:3.958.0" @@ -290,6 +340,61 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-bedrock-runtime@npm:^3.966.0": + version: 3.969.0 + resolution: "@aws-sdk/client-bedrock-runtime@npm:3.969.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/credential-provider-node": 3.969.0 + "@aws-sdk/eventstream-handler-node": 3.969.0 + "@aws-sdk/middleware-eventstream": 3.969.0 + "@aws-sdk/middleware-host-header": 3.969.0 + "@aws-sdk/middleware-logger": 3.969.0 + "@aws-sdk/middleware-recursion-detection": 3.969.0 + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/middleware-websocket": 3.969.0 + "@aws-sdk/region-config-resolver": 3.969.0 + "@aws-sdk/token-providers": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@aws-sdk/util-user-agent-browser": 3.969.0 + "@aws-sdk/util-user-agent-node": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.20.5 + "@smithy/eventstream-serde-browser": ^4.2.8 + "@smithy/eventstream-serde-config-resolver": ^4.3.8 + "@smithy/eventstream-serde-node": ^4.2.8 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-retry": ^4.4.22 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.21 + "@smithy/util-defaults-mode-node": ^4.2.24 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-stream": ^4.5.10 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: b834cfeecfe84aae1257f41696a76ea54478ba103b54d47c57e70c5eb827acd0cd21fca4767524c47e0290fee1646533ad8489bd06523b8281c3256ca734f4b3 + languageName: node + linkType: hard + "@aws-sdk/client-dynamodb@npm:^3.952.0": version: 3.958.0 resolution: "@aws-sdk/client-dynamodb@npm:3.958.0" @@ -340,6 +445,53 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-kendra@npm:^3.750.0": + version: 3.969.0 + resolution: "@aws-sdk/client-kendra@npm:3.969.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/credential-provider-node": 3.969.0 + "@aws-sdk/middleware-host-header": 3.969.0 + "@aws-sdk/middleware-logger": 3.969.0 + "@aws-sdk/middleware-recursion-detection": 3.969.0 + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/region-config-resolver": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@aws-sdk/util-user-agent-browser": 3.969.0 + "@aws-sdk/util-user-agent-node": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.20.5 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-retry": ^4.4.22 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.21 + "@smithy/util-defaults-mode-node": ^4.2.24 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 2defc7814e8a8021259ef0716fe4f269fdd92a09a7a4ebb609eeec590543051bb3c0433aecdd67acf0bd74c0d63e9e4f5e142355d4b879cefd41c8a4d835425b + languageName: node + linkType: hard + "@aws-sdk/client-s3@npm:^3.958.0": version: 3.958.0 resolution: "@aws-sdk/client-s3@npm:3.958.0" @@ -497,6 +649,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/client-sso@npm:3.969.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/middleware-host-header": 3.969.0 + "@aws-sdk/middleware-logger": 3.969.0 + "@aws-sdk/middleware-recursion-detection": 3.969.0 + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/region-config-resolver": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@aws-sdk/util-user-agent-browser": 3.969.0 + "@aws-sdk/util-user-agent-node": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.20.5 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-retry": ^4.4.22 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.21 + "@smithy/util-defaults-mode-node": ^4.2.24 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 46d86d52a326c1ff97ae466f55c204ce9bd3fdc1940ad2f4abc7b9909bf9d4ff2bd1335d6e56180ba0c99eade4f51154bd03b49125a8e47c6cadbf21e697afa2 + languageName: node + linkType: hard + "@aws-sdk/core@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/core@npm:3.957.0" @@ -518,6 +716,27 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/core@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/core@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@aws-sdk/xml-builder": 3.969.0 + "@smithy/core": ^3.20.5 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/signature-v4": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 94682a2c72d89bc4450a1895e3a3fb7af5e5ae318dd722f35917463ffafa58539c91e5f7df485c867c5fcb6d0bf1465bc726f795e0cae652fb0b660d0709d266 + languageName: node + linkType: hard + "@aws-sdk/crc64-nvme@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/crc64-nvme@npm:3.957.0" @@ -541,6 +760,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-env@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 7f4c572b60351b4d2bb8b753c0a1abbacecb81bdac857a097d86e8725cd6d58381629a7f45a8d1d7503f974df496b5d5f0f562f368454166a5478d3d5dd5eac0 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-http@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/credential-provider-http@npm:3.957.0" @@ -559,6 +791,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-http@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-http@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/util-stream": ^4.5.10 + tslib: ^2.6.2 + checksum: 99e80847506a78268ee86597315418b218a3d083f62a8b49bc2c54575db4c21a17b26add6c42e16a681821eb3f7875fc619470a5ba4e06f31feb7c94a4635806 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-ini@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/credential-provider-ini@npm:3.958.0" @@ -581,6 +831,28 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-ini@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/credential-provider-env": 3.969.0 + "@aws-sdk/credential-provider-http": 3.969.0 + "@aws-sdk/credential-provider-login": 3.969.0 + "@aws-sdk/credential-provider-process": 3.969.0 + "@aws-sdk/credential-provider-sso": 3.969.0 + "@aws-sdk/credential-provider-web-identity": 3.969.0 + "@aws-sdk/nested-clients": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/credential-provider-imds": ^4.2.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: b487707aad2ca40311089d64f108fa87c6e3c896ac4b8fc4fb4badd54e6430ab747d67a63760ff73231bb48dc06527b2e55fed57d4bea99cb89f1ee94a8d1b78 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-login@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/credential-provider-login@npm:3.958.0" @@ -597,6 +869,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-login@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-login@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/nested-clients": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 1c5ce1f69b928d08b192d06f7e5f2efe7427e7f75e25d26e8a672fdbf432547853b1cb287754b4abd9a59db63b4988e46695ca5296e3a0eae1ead244924897da + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/credential-provider-node@npm:3.958.0" @@ -617,6 +905,26 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-node@npm:3.969.0, @aws-sdk/credential-provider-node@npm:^3.750.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.969.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.969.0 + "@aws-sdk/credential-provider-http": 3.969.0 + "@aws-sdk/credential-provider-ini": 3.969.0 + "@aws-sdk/credential-provider-process": 3.969.0 + "@aws-sdk/credential-provider-sso": 3.969.0 + "@aws-sdk/credential-provider-web-identity": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/credential-provider-imds": ^4.2.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 83585cb3c38a3fda7b8f90c15cd981d0bd15a72c0adf473b9b639630a4fa7e1e272004f99afc7df58c1325146e3aaba3db678a09e4f1eebfe8603d9650e43224 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-process@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/credential-provider-process@npm:3.957.0" @@ -631,6 +939,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-process@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: d8795f271d008cc139fb8bf8ec536f90b3cec9528fd078cb03bab093af154b7158ebe3f43a86a7b6214937bb44678f7d76a8b2f429a2c172a3ccf602748cee64 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-sso@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.958.0" @@ -647,6 +969,22 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-sso@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.969.0" + dependencies: + "@aws-sdk/client-sso": 3.969.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/token-providers": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: b6be5d87a0e6cae79dea0e61ac1ebca01c2d85f891c8e0256bf39fea982c57e67074233190d3abeb03a0ff677d444bb0c80b64efd9ef41e33fc3437450245046 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-web-identity@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.958.0" @@ -662,6 +1000,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-web-identity@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/nested-clients": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: f9b1dae637bf94b67aa7845008ee1825eea793cdb68bc92429a2594044ea8c71d9cb7e2a5a0f0344a35349e865e44f597a87b5d801e25f5001a293dd6005ab04 + languageName: node + linkType: hard + "@aws-sdk/dynamodb-codec@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/dynamodb-codec@npm:3.957.0" @@ -700,6 +1053,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/eventstream-handler-node@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/eventstream-handler-node@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/eventstream-codec": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: c32e2726c118718aa9abfd050d6ad4e0575d5d7e3a4330623719c27c59d2ba08433bd6e6f0b8597f6d0903bc78aec46b82c7aa09079f4de6723d1a099800b2ad + languageName: node + linkType: hard + "@aws-sdk/lib-dynamodb@npm:^3.952.0, @aws-sdk/lib-dynamodb@npm:^3.953.0": version: 3.958.0 resolution: "@aws-sdk/lib-dynamodb@npm:3.958.0" @@ -757,6 +1122,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-eventstream@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-eventstream@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: cea21a3e4a503a068e0f0886d3296f59abb3f339a4939795575ea09016bcf67bf3f7a7466fddeadb6babbe2fe16d86c6868228ca2a20c220f6e60171956100ba + languageName: node + linkType: hard + "@aws-sdk/middleware-expect-continue@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/middleware-expect-continue@npm:3.957.0" @@ -803,6 +1180,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-host-header@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: df1393fefc626203606638b5dd022abbe351e1efbf8253092d818ba2ce1049cf34a921ae34b69e7d73684cf14d3fd87e1b9df66744644e77ae7f28aa511886cf + languageName: node + linkType: hard + "@aws-sdk/middleware-location-constraint@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/middleware-location-constraint@npm:3.957.0" @@ -825,6 +1214,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-logger@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-logger@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 1fb00f1fb1531dfdee083a545b449c70556c51a827a4aa02e78c619b05613f28e56b75d7b4d4236f1b674abccff0f53daa3fe7fb351ee430af16ac9d63887ce9 + languageName: node + linkType: hard + "@aws-sdk/middleware-recursion-detection@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.957.0" @@ -838,6 +1238,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-recursion-detection@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@aws/lambda-invoke-store": ^0.2.2 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: b2d262e4c9506ce22ce48eac4624ef938863444de1f1916214a5be53fead188557e2b30d1c43b763b2f32eefe50a6f8e85e3adecdd84c560592fdd052adc2147 + languageName: node + linkType: hard + "@aws-sdk/middleware-sdk-s3@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/middleware-sdk-s3@npm:3.957.0" @@ -886,6 +1299,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-user-agent@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@smithy/core": ^3.20.5 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 6f393e2e2ef948eb4f9e0193d9c664fd629cd228ca30a5f2439d119f23c49b8211b90cb7eaddd7f723a3e53c04572544d538716fdd8e92bf9287d5e086a09347 + languageName: node + linkType: hard + "@aws-sdk/middleware-websocket@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/middleware-websocket@npm:3.957.0" @@ -904,6 +1332,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-websocket@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/middleware-websocket@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-format-url": 3.969.0 + "@smithy/eventstream-codec": ^4.2.8 + "@smithy/eventstream-serde-browser": ^4.2.8 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/protocol-http": ^5.3.8 + "@smithy/signature-v4": ^5.3.8 + "@smithy/types": ^4.12.0 + "@smithy/util-hex-encoding": ^4.2.0 + tslib: ^2.6.2 + checksum: a43395a6ad8483670a4db2e972102aacfb073bc815b20f7d4670b8015dd6e61d7ffdb9b0d269eb4dd5ac9e8a6ce702ef6363ccb3fe2c4127ab0457732eb314cf + languageName: node + linkType: hard + "@aws-sdk/nested-clients@npm:3.958.0": version: 3.958.0 resolution: "@aws-sdk/nested-clients@npm:3.958.0" @@ -950,6 +1396,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/nested-clients@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/nested-clients@npm:3.969.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.969.0 + "@aws-sdk/middleware-host-header": 3.969.0 + "@aws-sdk/middleware-logger": 3.969.0 + "@aws-sdk/middleware-recursion-detection": 3.969.0 + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/region-config-resolver": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@aws-sdk/util-endpoints": 3.969.0 + "@aws-sdk/util-user-agent-browser": 3.969.0 + "@aws-sdk/util-user-agent-node": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/core": ^3.20.5 + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/hash-node": ^4.2.8 + "@smithy/invalid-dependency": ^4.2.8 + "@smithy/middleware-content-length": ^4.2.8 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-retry": ^4.4.22 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-body-length-node": ^4.2.1 + "@smithy/util-defaults-mode-browser": ^4.3.21 + "@smithy/util-defaults-mode-node": ^4.2.24 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 1ed1614292be8c3b18e46ef049d9f1264216c3178a2e418360b0e014e126b17c7afb0460827eafb3453f2b0e81438a245c37933392f5f14240de349e272e6592 + languageName: node + linkType: hard + "@aws-sdk/region-config-resolver@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/region-config-resolver@npm:3.957.0" @@ -963,6 +1455,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/region-config-resolver@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/region-config-resolver@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/config-resolver": ^4.4.6 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: a17431e666d123d1d201b1e10511168bb2d89b0ed37b2b37d57c5268fcf011dd49908bc5a6da46ab1e2521c2274c6a931f2f7ccc765eaac0d93d8c63aa123a4f + languageName: node + linkType: hard + "@aws-sdk/s3-request-presigner@npm:^3.958.0": version: 3.958.0 resolution: "@aws-sdk/s3-request-presigner@npm:3.958.0" @@ -1008,6 +1513,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/token-providers@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/token-providers@npm:3.969.0" + dependencies: + "@aws-sdk/core": 3.969.0 + "@aws-sdk/nested-clients": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 38ec6288c045d00e840e036ebc55cd549fc56fc4ed18c37f75bebb8c6ecf660ed8915e56074ba2d4c333c772a9c39d8bd15496c429873753ebd4105cd0460c09 + languageName: node + linkType: hard + "@aws-sdk/types@npm:3.957.0, @aws-sdk/types@npm:^3.222.0": version: 3.957.0 resolution: "@aws-sdk/types@npm:3.957.0" @@ -1018,6 +1538,16 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/types@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/types@npm:3.969.0" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 6f0bd040b260b1a4086ca4bfc06485b1a1812eab5a447641fdb66788b3fb9a989081b3874f763bcf4b9fb81ecef4239aab0d31431ddde9ced8498305b3165901 + languageName: node + linkType: hard + "@aws-sdk/util-arn-parser@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/util-arn-parser@npm:3.957.0" @@ -1051,6 +1581,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-endpoints@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/util-endpoints@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-endpoints": ^3.2.8 + tslib: ^2.6.2 + checksum: ca03191cea0bf8760e138dea0a05a883f11b5835422d3df74cef7a0a8e54f3ee245ceac6cd254500164e36884ea767885b1d7fed63bf903028a5f3cdbc580cc0 + languageName: node + linkType: hard + "@aws-sdk/util-format-url@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/util-format-url@npm:3.957.0" @@ -1063,6 +1606,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-format-url@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/util-format-url@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/querystring-builder": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 633de5dcb9fec7a3251dc4e7e68174a525236d738e8e9207d55f2d88a50319bfb86fe9574ac517f14d81d36be8311b316da691bae1a4a10bb81a2bb20cf0ba32 + languageName: node + linkType: hard + "@aws-sdk/util-locate-window@npm:^3.0.0": version: 3.957.0 resolution: "@aws-sdk/util-locate-window@npm:3.957.0" @@ -1084,6 +1639,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-browser@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.969.0" + dependencies: + "@aws-sdk/types": 3.969.0 + "@smithy/types": ^4.12.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: 607ab52d5eeeeee336adcb00ef0b54a89708996d9e23c5b92f883de150a7a6282bbc4e4103ff21d2d3dc64c0cee9ba16c6e96ff45e67bb2bf27f8e1246721ff8 + languageName: node + linkType: hard + "@aws-sdk/util-user-agent-node@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.957.0" @@ -1102,6 +1669,24 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-node@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.969.0" + dependencies: + "@aws-sdk/middleware-user-agent": 3.969.0 + "@aws-sdk/types": 3.969.0 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + peerDependencies: + aws-crt: ">=1.0.0" + peerDependenciesMeta: + aws-crt: + optional: true + checksum: 1764dd8e2be8c23e552be105c1d41810f8057a48dc7d908434ebca840cb938256a41582aaa1906361b31ee3ecf15ecfb8b6e93a9fb75e51145fe5cbaa06b8eaf + languageName: node + linkType: hard + "@aws-sdk/xml-builder@npm:3.957.0": version: 3.957.0 resolution: "@aws-sdk/xml-builder@npm:3.957.0" @@ -1113,6 +1698,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/xml-builder@npm:3.969.0": + version: 3.969.0 + resolution: "@aws-sdk/xml-builder@npm:3.969.0" + dependencies: + "@smithy/types": ^4.12.0 + fast-xml-parser: 5.2.5 + tslib: ^2.6.2 + checksum: 1310b5f686aadc53a376fe0e22672feab09072932a572c071a6af49ab765c861ae5bea52f41e45b7c74c151537511ecbabf6639aaf9ff1d8dc77bbe328831c9a + languageName: node + linkType: hard + "@aws/lambda-invoke-store@npm:^0.2.2": version: 0.2.2 resolution: "@aws/lambda-invoke-store@npm:0.2.2" @@ -1444,6 +2040,13 @@ __metadata: languageName: node linkType: hard +"@cfworker/json-schema@npm:^4.0.2": + version: 4.1.1 + resolution: "@cfworker/json-schema@npm:4.1.1" + checksum: 35b5b246eff7bc75a17befb6e6d56475ab9261279c5d727610dc6827cce557d11db353cca3c06b8272f3974eb2ac508a7bbae3accd3d6c8402dfe0aafbfea0aa + languageName: node + linkType: hard + "@clickhouse/client-common@npm:1.15.0": version: 1.15.0 resolution: "@clickhouse/client-common@npm:1.15.0" @@ -2227,6 +2830,102 @@ __metadata: languageName: node linkType: hard +"@langchain/aws@npm:^1.2.0": + version: 1.2.0 + resolution: "@langchain/aws@npm:1.2.0" + dependencies: + "@aws-sdk/client-bedrock-agent-runtime": ^3.755.0 + "@aws-sdk/client-bedrock-runtime": ^3.966.0 + "@aws-sdk/client-kendra": ^3.750.0 + "@aws-sdk/credential-provider-node": ^3.750.0 + peerDependencies: + "@langchain/core": ^1.0.0 + checksum: 6bd369147097f84983f8f41a6d8c6bd1d0959355fd007fbb940d6070b43ca8027772102c3958343c2cd4bb4f58e125440f3e80f728aa2782126ce44220447736 + languageName: node + linkType: hard + +"@langchain/core@npm:^1.1.15": + version: 1.1.15 + resolution: "@langchain/core@npm:1.1.15" + dependencies: + "@cfworker/json-schema": ^4.0.2 + ansi-styles: ^5.0.0 + camelcase: 6 + decamelize: 1.2.0 + js-tiktoken: ^1.0.12 + langsmith: ">=0.4.0 <1.0.0" + mustache: ^4.2.0 + p-queue: ^6.6.2 + uuid: ^10.0.0 + zod: ^3.25.76 || ^4 + checksum: 8a1c50afe5ecfc9d6f57d83dcd599847317ff1d4e64b19af10d3d87c6d021e3537532b62d7a96f51467ed52cc7ad34fd48721401d12b017590da4c9560e4497a + languageName: node + linkType: hard + +"@langchain/langgraph-checkpoint@npm:^1.0.0": + version: 1.0.0 + resolution: "@langchain/langgraph-checkpoint@npm:1.0.0" + dependencies: + uuid: ^10.0.0 + peerDependencies: + "@langchain/core": ^1.0.1 + checksum: 0e85633bd7975230b61ba709e30da7b74e542efe4b37f105b17ef0e1dde658d24851fa37d0850442e8aa934c6bf0cb3e85cfa98d9064e406ff9f3888ebfc3505 + languageName: node + linkType: hard + +"@langchain/langgraph-sdk@npm:~1.5.0": + version: 1.5.3 + resolution: "@langchain/langgraph-sdk@npm:1.5.3" + dependencies: + p-queue: ^9.0.1 + p-retry: ^7.1.1 + uuid: ^13.0.0 + peerDependencies: + "@langchain/core": ^1.0.1 + react: ^18 || ^19 + react-dom: ^18 || ^19 + peerDependenciesMeta: + "@langchain/core": + optional: true + react: + optional: true + react-dom: + optional: true + checksum: e662eb80feda767910e577cc29cc7d78dec432a89c01e6fce3a343307d4530516004d86652bedbdd421203cf166e355cda5139ac56c9772fdcb6d8f74a9afc95 + languageName: node + linkType: hard + +"@langchain/langgraph@npm:^1.0.0": + version: 1.0.15 + resolution: "@langchain/langgraph@npm:1.0.15" + dependencies: + "@langchain/langgraph-checkpoint": ^1.0.0 + "@langchain/langgraph-sdk": ~1.5.0 + uuid: ^10.0.0 + peerDependencies: + "@langchain/core": ^1.0.1 + zod: ^3.25.32 || ^4.1.0 + zod-to-json-schema: ^3.x + peerDependenciesMeta: + zod-to-json-schema: + optional: true + checksum: e5d4a30ff312172a75d53047b233ba4c746bfb43f7635b63672f31fd31e4ff39016c6c2c492ef6e2fc7c7b3fd679b3af95e07ac6dc2d4806302d0939033e7401 + languageName: node + linkType: hard + +"@langchain/openai@npm:^1.2.2": + version: 1.2.2 + resolution: "@langchain/openai@npm:1.2.2" + dependencies: + js-tiktoken: ^1.0.12 + openai: ^6.10.0 + zod: ^3.25.76 || ^4 + peerDependencies: + "@langchain/core": ^1.0.0 + checksum: 3a984a062fc090634c1e51d3eda7087c9ac5d7310d801a312e69ec00daebf9b2ed4fb20fe059eff918a34ad42746cd65c2a3a1169cb9d2827478779c774e8795 + languageName: node + linkType: hard + "@lukeed/csprng@npm:^1.0.0": version: 1.1.0 resolution: "@lukeed/csprng@npm:1.1.0" @@ -3525,6 +4224,16 @@ __metadata: languageName: node linkType: hard +"@smithy/abort-controller@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/abort-controller@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: ae5c37f677e54c2808d1014d64bc9592b0120dec4e972475c15c67ff201f99613ebbe66937051ad2e4396b0d94a1034e6712e8cc0213142f252a9200f4c5ac37 + languageName: node + linkType: hard + "@smithy/chunked-blob-reader-native@npm:^4.2.1": version: 4.2.1 resolution: "@smithy/chunked-blob-reader-native@npm:4.2.1" @@ -3558,6 +4267,20 @@ __metadata: languageName: node linkType: hard +"@smithy/config-resolver@npm:^4.4.6": + version: 4.4.6 + resolution: "@smithy/config-resolver@npm:4.4.6" + dependencies: + "@smithy/node-config-provider": ^4.3.8 + "@smithy/types": ^4.12.0 + "@smithy/util-config-provider": ^4.2.0 + "@smithy/util-endpoints": ^3.2.8 + "@smithy/util-middleware": ^4.2.8 + tslib: ^2.6.2 + checksum: ffb98899d0343a16692e0bab514719b88d3f97a696489eabaa1c7e52d534083dac440e51dbf8cadf7193e9fabddd7244e77e32d03f905a1469c3d8113fa02a6c + languageName: node + linkType: hard + "@smithy/core@npm:^3.20.0": version: 3.20.0 resolution: "@smithy/core@npm:3.20.0" @@ -3576,6 +4299,24 @@ __metadata: languageName: node linkType: hard +"@smithy/core@npm:^3.20.5": + version: 3.20.5 + resolution: "@smithy/core@npm:3.20.5" + dependencies: + "@smithy/middleware-serde": ^4.2.9 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-body-length-browser": ^4.2.0 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-stream": ^4.5.10 + "@smithy/util-utf8": ^4.2.0 + "@smithy/uuid": ^1.1.0 + tslib: ^2.6.2 + checksum: 8d0343f98383fffbb6e0147205af5d3620f483e00ad423f8731f84d4cd60b73d09f3521a18d4369c7e30227f49dc7773b406cfffe7d8268540866eb83b89ea93 + languageName: node + linkType: hard + "@smithy/credential-provider-imds@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/credential-provider-imds@npm:4.2.7" @@ -3589,6 +4330,19 @@ __metadata: languageName: node linkType: hard +"@smithy/credential-provider-imds@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/credential-provider-imds@npm:4.2.8" + dependencies: + "@smithy/node-config-provider": ^4.3.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + tslib: ^2.6.2 + checksum: 954bb2abdfda69b6b17386bf0270a8b7730d0d9fc3699cd2574b65bf17ad112b9be6711177d2fcad9fd694bd790b97541298210c7d9dba4736d9fa56fe75f167 + languageName: node + linkType: hard + "@smithy/eventstream-codec@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/eventstream-codec@npm:4.2.7" @@ -3601,6 +4355,18 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-codec@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/eventstream-codec@npm:4.2.8" + dependencies: + "@aws-crypto/crc32": 5.2.0 + "@smithy/types": ^4.12.0 + "@smithy/util-hex-encoding": ^4.2.0 + tslib: ^2.6.2 + checksum: ef010dbb65eb6b24a7a89eaaba993b045f0aaae16660e5e99aa9f000019b40d00de51004be63f2a17e05a5ad4c99192d2ba2bfa11e13c0807f3e2006f8411dea + languageName: node + linkType: hard + "@smithy/eventstream-serde-browser@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/eventstream-serde-browser@npm:4.2.7" @@ -3612,6 +4378,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-browser@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/eventstream-serde-browser@npm:4.2.8" + dependencies: + "@smithy/eventstream-serde-universal": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 0d69fef4485ba86e3381d1e47465b1dfe60f6fe34a1fed7ccb359c965cc4b92c99d7c5ed70cb0d26b19d8fc3b8c49db0a140578deef152930534b20d730751d6 + languageName: node + linkType: hard + "@smithy/eventstream-serde-config-resolver@npm:^4.3.7": version: 4.3.7 resolution: "@smithy/eventstream-serde-config-resolver@npm:4.3.7" @@ -3622,14 +4399,35 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-config-resolver@npm:^4.3.8": + version: 4.3.8 + resolution: "@smithy/eventstream-serde-config-resolver@npm:4.3.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 849544e1212d98469ca3d6e73919a9ff5bc2eaf903226193ad0857d03c11129a03ddbf4177673059c6a97af015cb0f32530018e42a430b1c5e639d95174f64e8 + languageName: node + linkType: hard + "@smithy/eventstream-serde-node@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/eventstream-serde-node@npm:4.2.7" dependencies: - "@smithy/eventstream-serde-universal": ^4.2.7 - "@smithy/types": ^4.11.0 + "@smithy/eventstream-serde-universal": ^4.2.7 + "@smithy/types": ^4.11.0 + tslib: ^2.6.2 + checksum: 12ebbe494ba2446fbfd7b4491dfdc22297656ac7292cbda7985a01f72d1ae28918749e835ded7a723d32075f69e3cc412ac4f4588d1df53b2b583699b3aecb21 + languageName: node + linkType: hard + +"@smithy/eventstream-serde-node@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/eventstream-serde-node@npm:4.2.8" + dependencies: + "@smithy/eventstream-serde-universal": ^4.2.8 + "@smithy/types": ^4.12.0 tslib: ^2.6.2 - checksum: 12ebbe494ba2446fbfd7b4491dfdc22297656ac7292cbda7985a01f72d1ae28918749e835ded7a723d32075f69e3cc412ac4f4588d1df53b2b583699b3aecb21 + checksum: d95a5317be7452129259d491c0c7d35f90440c8b67a6006476152182cefd1e5e96d4e090419fb850afb7ec763940134c351cbc6d6b46c03e9c6331e1e7f79ba4 languageName: node linkType: hard @@ -3644,6 +4442,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-universal@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/eventstream-serde-universal@npm:4.2.8" + dependencies: + "@smithy/eventstream-codec": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 3d49d9f24e4c1f91fd23439388e93cbd94579632dfc16353e519971fca8eb5e48fec29d0cf88007ccca5f45f9943f80de21a1f7f17f1d9bf5cc28d40078a98e1 + languageName: node + linkType: hard + "@smithy/fetch-http-handler@npm:^5.3.8": version: 5.3.8 resolution: "@smithy/fetch-http-handler@npm:5.3.8" @@ -3657,6 +4466,19 @@ __metadata: languageName: node linkType: hard +"@smithy/fetch-http-handler@npm:^5.3.9": + version: 5.3.9 + resolution: "@smithy/fetch-http-handler@npm:5.3.9" + dependencies: + "@smithy/protocol-http": ^5.3.8 + "@smithy/querystring-builder": ^4.2.8 + "@smithy/types": ^4.12.0 + "@smithy/util-base64": ^4.3.0 + tslib: ^2.6.2 + checksum: de73fa72fb059a1b52771b8b4ab1ed541c1164f5e4ee6e7a6e6110c08081949e81236108698b2c91d61a8bbd5104bc0d05a93624a44d411f313c6342f0d01b74 + languageName: node + linkType: hard + "@smithy/hash-blob-browser@npm:^4.2.8": version: 4.2.8 resolution: "@smithy/hash-blob-browser@npm:4.2.8" @@ -3681,6 +4503,18 @@ __metadata: languageName: node linkType: hard +"@smithy/hash-node@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/hash-node@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + "@smithy/util-buffer-from": ^4.2.0 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 93916922b88e19c98b75b6c75b639e53c63ff62fb302f578d6b07fa9c1feb091b892949c3590600f708e2277395bff9d97386527990fbf74ec37056d035d3880 + languageName: node + linkType: hard + "@smithy/hash-stream-node@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/hash-stream-node@npm:4.2.7" @@ -3702,6 +4536,16 @@ __metadata: languageName: node linkType: hard +"@smithy/invalid-dependency@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/invalid-dependency@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 966e4b7fb233db2db150087f552230cb3b2b3169632eaff9bf57b7f3221505d46ad20c7568172e4d76c04bc0c8f89ecf099875a1547e861426236ce2be6a90ea + languageName: node + linkType: hard + "@smithy/is-array-buffer@npm:^2.2.0": version: 2.2.0 resolution: "@smithy/is-array-buffer@npm:2.2.0" @@ -3742,6 +4586,17 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-content-length@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/middleware-content-length@npm:4.2.8" + dependencies: + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: cda46f45ba40d70ac46a75822b33ca23c25973735e7d2e7cd932366c8227be1d2ce348582562a10293ea287d75b094305ae89afc1fa540d1b0e4c03a116e901d + languageName: node + linkType: hard + "@smithy/middleware-endpoint@npm:^4.4.1": version: 4.4.1 resolution: "@smithy/middleware-endpoint@npm:4.4.1" @@ -3758,6 +4613,22 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-endpoint@npm:^4.4.6": + version: 4.4.6 + resolution: "@smithy/middleware-endpoint@npm:4.4.6" + dependencies: + "@smithy/core": ^3.20.5 + "@smithy/middleware-serde": ^4.2.9 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + "@smithy/url-parser": ^4.2.8 + "@smithy/util-middleware": ^4.2.8 + tslib: ^2.6.2 + checksum: 404182c0640ed2f0e950da07712d108ee88ccee785b97715587786ffe04ed46fd573506842396aa41de69b20174b4c4dcbe8658c2898261fa4dd837f53861104 + languageName: node + linkType: hard + "@smithy/middleware-retry@npm:^4.4.17": version: 4.4.17 resolution: "@smithy/middleware-retry@npm:4.4.17" @@ -3775,6 +4646,23 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-retry@npm:^4.4.22": + version: 4.4.22 + resolution: "@smithy/middleware-retry@npm:4.4.22" + dependencies: + "@smithy/node-config-provider": ^4.3.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/service-error-classification": ^4.2.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-retry": ^4.2.8 + "@smithy/uuid": ^1.1.0 + tslib: ^2.6.2 + checksum: 8fe2b8beff19dc3f2321fa47d83cef845c691a008a786e2c770bd1479b2753cf6424f36d7564c4e4e7ce5cd0415f8e5fded50710b7ce8390f533f884e1c42ed3 + languageName: node + linkType: hard + "@smithy/middleware-serde@npm:^4.2.8": version: 4.2.8 resolution: "@smithy/middleware-serde@npm:4.2.8" @@ -3786,6 +4674,17 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-serde@npm:^4.2.9": + version: 4.2.9 + resolution: "@smithy/middleware-serde@npm:4.2.9" + dependencies: + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 85217b475e95446d9b448ea89b8ed0ddce3ccc3275dffb723dfd667edcaf461b250b7051d8bcee7a446b8924ab4b4d03d043d35bd48f39b5a78bc516bd9dd646 + languageName: node + linkType: hard + "@smithy/middleware-stack@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/middleware-stack@npm:4.2.7" @@ -3796,6 +4695,16 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-stack@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/middleware-stack@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 45de485d2f5234a0eb6b84ecd7b961bbd4c1952626a750611fc237be87855f30f8a883f8d26ca2c84ff3adf8a81f53bf8b10a014ffa050ae06ac6bae9d6317c7 + languageName: node + linkType: hard + "@smithy/node-config-provider@npm:^4.3.7": version: 4.3.7 resolution: "@smithy/node-config-provider@npm:4.3.7" @@ -3808,6 +4717,18 @@ __metadata: languageName: node linkType: hard +"@smithy/node-config-provider@npm:^4.3.8": + version: 4.3.8 + resolution: "@smithy/node-config-provider@npm:4.3.8" + dependencies: + "@smithy/property-provider": ^4.2.8 + "@smithy/shared-ini-file-loader": ^4.4.3 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 98682d2c0235f041e7545ab7c5e9432a0d6307461042c21aa5cff2be5cebe5402a35de6a559c1a5a3b884c940d5d52679618552b422e393953ba2dc8a00e0fbb + languageName: node + linkType: hard + "@smithy/node-http-handler@npm:^4.4.7": version: 4.4.7 resolution: "@smithy/node-http-handler@npm:4.4.7" @@ -3821,6 +4742,19 @@ __metadata: languageName: node linkType: hard +"@smithy/node-http-handler@npm:^4.4.8": + version: 4.4.8 + resolution: "@smithy/node-http-handler@npm:4.4.8" + dependencies: + "@smithy/abort-controller": ^4.2.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/querystring-builder": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: ef328ede589ef1438de83450f7569a7e9ecf575aa0cb8153129e4a97f3b5cc67a2e0dee1058e7135c42307cd755ecbfb95c9b7b827b60068dd9479af90087e79 + languageName: node + linkType: hard + "@smithy/property-provider@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/property-provider@npm:4.2.7" @@ -3831,6 +4765,16 @@ __metadata: languageName: node linkType: hard +"@smithy/property-provider@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/property-provider@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 6a19b5e44ceb37a85999796dfa73ce7d82653c1db0cfe332786e202b7333f988dc5e65902c0492dc37d48f4c48ccf35fc4fa92cdf1ca9e8f24d2d1d6206e3dd5 + languageName: node + linkType: hard + "@smithy/protocol-http@npm:^5.3.7": version: 5.3.7 resolution: "@smithy/protocol-http@npm:5.3.7" @@ -3841,6 +4785,16 @@ __metadata: languageName: node linkType: hard +"@smithy/protocol-http@npm:^5.3.8": + version: 5.3.8 + resolution: "@smithy/protocol-http@npm:5.3.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 4371cbb493109edde1177bfd84b2d4d7887fbf821085df3c9251ba99f635e355f967c4dea32f02aaac52edabb408e946a3452bd7723d724827d56e7f2292614d + languageName: node + linkType: hard + "@smithy/querystring-builder@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/querystring-builder@npm:4.2.7" @@ -3852,6 +4806,17 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-builder@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/querystring-builder@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + "@smithy/util-uri-escape": ^4.2.0 + tslib: ^2.6.2 + checksum: 7bface9bf3586625392d1861318c93d356d2353fa79ff024df55ac0b71d0bfc77a43eae91a3eda01e7bd68538c382229d0b1841e95f27d75bfb0dc9d76441933 + languageName: node + linkType: hard + "@smithy/querystring-parser@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/querystring-parser@npm:4.2.7" @@ -3862,6 +4827,16 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-parser@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/querystring-parser@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: a7c89eb63321fc8c4ed5a4b1bbb88f1254e128ab86e7d5aa666a2a2b7889489ccbc3efb7f73c34567b6dad8356b5cecb2a512ff0fd5a19266eb187ffe9868d86 + languageName: node + linkType: hard + "@smithy/service-error-classification@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/service-error-classification@npm:4.2.7" @@ -3871,6 +4846,15 @@ __metadata: languageName: node linkType: hard +"@smithy/service-error-classification@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/service-error-classification@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + checksum: bf7dc438050d6fd9f563e4479a680fa284df6d2acddd305c27f5c0cb5dd94aa17b5ede42074100072be97f6cd04bda7e3ffb1e9535ececac7ebb9a11aa982c46 + languageName: node + linkType: hard + "@smithy/shared-ini-file-loader@npm:^4.4.2": version: 4.4.2 resolution: "@smithy/shared-ini-file-loader@npm:4.4.2" @@ -3881,6 +4865,16 @@ __metadata: languageName: node linkType: hard +"@smithy/shared-ini-file-loader@npm:^4.4.3": + version: 4.4.3 + resolution: "@smithy/shared-ini-file-loader@npm:4.4.3" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: bda50324b855b8994029a47d256a70bb25f886759d5826e88479bb169f17d8d6c44570b762ea15b38fb29818ea6294fddc15027552efd9e2ef81c5465430afd2 + languageName: node + linkType: hard + "@smithy/signature-v4@npm:^5.3.7": version: 5.3.7 resolution: "@smithy/signature-v4@npm:5.3.7" @@ -3897,6 +4891,22 @@ __metadata: languageName: node linkType: hard +"@smithy/signature-v4@npm:^5.3.8": + version: 5.3.8 + resolution: "@smithy/signature-v4@npm:5.3.8" + dependencies: + "@smithy/is-array-buffer": ^4.2.0 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + "@smithy/util-hex-encoding": ^4.2.0 + "@smithy/util-middleware": ^4.2.8 + "@smithy/util-uri-escape": ^4.2.0 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 651073b25020d314a2dcca81fbfe2baa6522ec5be7bf930c1cfea1e24a1b7babe6da6dcf37c3faa0e69c1b994d3f3fb9d501e1dba787ed4e098f8cebf8b9809d + languageName: node + linkType: hard + "@smithy/smithy-client@npm:^4.10.2": version: 4.10.2 resolution: "@smithy/smithy-client@npm:4.10.2" @@ -3912,6 +4922,21 @@ __metadata: languageName: node linkType: hard +"@smithy/smithy-client@npm:^4.10.7": + version: 4.10.7 + resolution: "@smithy/smithy-client@npm:4.10.7" + dependencies: + "@smithy/core": ^3.20.5 + "@smithy/middleware-endpoint": ^4.4.6 + "@smithy/middleware-stack": ^4.2.8 + "@smithy/protocol-http": ^5.3.8 + "@smithy/types": ^4.12.0 + "@smithy/util-stream": ^4.5.10 + tslib: ^2.6.2 + checksum: cde3a8f63db56f0edbee629d050e61c55b937dce6bb971c91d642336e6526c48448dc5186907c3ce59f0999144aff2fee4f76181397d16683f6b51661178a26c + languageName: node + linkType: hard + "@smithy/types@npm:^4.11.0": version: 4.11.0 resolution: "@smithy/types@npm:4.11.0" @@ -3921,6 +4946,15 @@ __metadata: languageName: node linkType: hard +"@smithy/types@npm:^4.12.0": + version: 4.12.0 + resolution: "@smithy/types@npm:4.12.0" + dependencies: + tslib: ^2.6.2 + checksum: bd74ef4dba3683f75531650c8dbba018b05fae70e69f0f427136aef3df13a525521a85053b676a5985a11d8273d06eb12bec867c4221eb5a5b2b4eb6a3706dc4 + languageName: node + linkType: hard + "@smithy/url-parser@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/url-parser@npm:4.2.7" @@ -3932,6 +4966,17 @@ __metadata: languageName: node linkType: hard +"@smithy/url-parser@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/url-parser@npm:4.2.8" + dependencies: + "@smithy/querystring-parser": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: f354e69cc629084bbb7ed1759f2970d96e2c462d2849402057e86aeaa18b32d13f7e24b5244ecddac398b6504fe3705b8ee2696a68df662a556ae20566d68f38 + languageName: node + linkType: hard + "@smithy/util-base64@npm:^4.3.0": version: 4.3.0 resolution: "@smithy/util-base64@npm:4.3.0" @@ -4002,6 +5047,18 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-browser@npm:^4.3.21": + version: 4.3.21 + resolution: "@smithy/util-defaults-mode-browser@npm:4.3.21" + dependencies: + "@smithy/property-provider": ^4.2.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: 89e8158d571fd5070feb2eb0c2200120fb5fe672b5f92f4995237cd5067a5fffcc038cf6c535dd8fd24dd638a30a0e277530cb2a7453a881fb1c47b96d258a13 + languageName: node + linkType: hard + "@smithy/util-defaults-mode-node@npm:^4.2.19": version: 4.2.19 resolution: "@smithy/util-defaults-mode-node@npm:4.2.19" @@ -4017,6 +5074,21 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-node@npm:^4.2.24": + version: 4.2.24 + resolution: "@smithy/util-defaults-mode-node@npm:4.2.24" + dependencies: + "@smithy/config-resolver": ^4.4.6 + "@smithy/credential-provider-imds": ^4.2.8 + "@smithy/node-config-provider": ^4.3.8 + "@smithy/property-provider": ^4.2.8 + "@smithy/smithy-client": ^4.10.7 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: d86287d71e09bddc2fc8645e36d74f433b979d913cd6cee7dd1c2a637b731a781352336bd687187f3cccd9c98b5974a74f11ca3b409ae4c3fbac2a8fed30c249 + languageName: node + linkType: hard + "@smithy/util-endpoints@npm:^3.2.7": version: 3.2.7 resolution: "@smithy/util-endpoints@npm:3.2.7" @@ -4028,6 +5100,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-endpoints@npm:^3.2.8": + version: 3.2.8 + resolution: "@smithy/util-endpoints@npm:3.2.8" + dependencies: + "@smithy/node-config-provider": ^4.3.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: d50a189c86b18737e513fa20ce46e3c472d87518e377a04683d7997059270f57c8dec80d5e4e0acb0251cd4b3c9a8d8ed1b9cbdd2ed25ada86ffb59a9cadff5b + languageName: node + linkType: hard + "@smithy/util-hex-encoding@npm:^4.2.0": version: 4.2.0 resolution: "@smithy/util-hex-encoding@npm:4.2.0" @@ -4047,6 +5130,16 @@ __metadata: languageName: node linkType: hard +"@smithy/util-middleware@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/util-middleware@npm:4.2.8" + dependencies: + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: bc6b1f549d5e6faced387b2158c56f8b59937853987dbddd0b49da82cc2e97630d718b30c426fd77ecf882ff151c330428e25e2780407aeefbfcfd3c5e2c9a71 + languageName: node + linkType: hard + "@smithy/util-retry@npm:^4.2.7": version: 4.2.7 resolution: "@smithy/util-retry@npm:4.2.7" @@ -4058,6 +5151,33 @@ __metadata: languageName: node linkType: hard +"@smithy/util-retry@npm:^4.2.8": + version: 4.2.8 + resolution: "@smithy/util-retry@npm:4.2.8" + dependencies: + "@smithy/service-error-classification": ^4.2.8 + "@smithy/types": ^4.12.0 + tslib: ^2.6.2 + checksum: a3c84a496c169c5b3a002c9d98bb53cbd8401a81e17fdb6aaf1d2076ce849901c191dc98d62b3bb7bce8529075505ff6d2fd1fa39b1d1967dd24874a1d67920d + languageName: node + linkType: hard + +"@smithy/util-stream@npm:^4.5.10": + version: 4.5.10 + resolution: "@smithy/util-stream@npm:4.5.10" + dependencies: + "@smithy/fetch-http-handler": ^5.3.9 + "@smithy/node-http-handler": ^4.4.8 + "@smithy/types": ^4.12.0 + "@smithy/util-base64": ^4.3.0 + "@smithy/util-buffer-from": ^4.2.0 + "@smithy/util-hex-encoding": ^4.2.0 + "@smithy/util-utf8": ^4.2.0 + tslib: ^2.6.2 + checksum: 0dc406923b0abdd2de6c6b782a3d3722b5192d453f25ebd2ca9821075223d22179a3f174bfb8372fa05fbdcd32d17e16e9fe80bdd65c41aa07155c7a17028b68 + languageName: node + linkType: hard + "@smithy/util-stream@npm:^4.5.8": version: 4.5.8 resolution: "@smithy/util-stream@npm:4.5.8" @@ -4639,6 +5759,13 @@ __metadata: languageName: node linkType: hard +"@types/uuid@npm:^10.0.0": + version: 10.0.0 + resolution: "@types/uuid@npm:10.0.0" + checksum: e3958f8b0fe551c86c14431f5940c3470127293280830684154b91dc7eb3514aeb79fe3216968833cf79d4d1c67f580f054b5be2cd562bebf4f728913e73e944 + languageName: node + linkType: hard + "@types/uuid@npm:^11.0.0": version: 11.0.0 resolution: "@types/uuid@npm:11.0.0" @@ -5106,6 +6233,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^5.0.0": + version: 5.2.0 + resolution: "ansi-styles@npm:5.2.0" + checksum: d7f4e97ce0623aea6bc0d90dcd28881ee04cba06c570b97fd3391bd7a268eedfd9d5e2dd4fdcbdd82b8105df5faf6f24aaedc08eaf3da898e702db5948f63469 + languageName: node + linkType: hard + "ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0, ansi-styles@npm:^6.2.1": version: 6.2.3 resolution: "ansi-styles@npm:6.2.3" @@ -5294,6 +6428,9 @@ __metadata: "@aws-sdk/s3-request-presigner": ^3.958.0 "@electric-sql/pglite": ^0.3.14 "@faker-js/faker": ^10.1.0 + "@langchain/aws": ^1.2.0 + "@langchain/core": ^1.1.15 + "@langchain/openai": ^1.2.2 "@nestjs/cli": ^11.0.14 "@nestjs/common": 11.1.9 "@nestjs/config": 4.0.2 @@ -5352,6 +6489,7 @@ __metadata: jsonwebtoken: ^9.0.3 knex: 3.1.0 knip: ^5.75.0 + langchain: ^1.2.10 lru-cache: ^11.2.4 nanoid: 5.1.6 nock: ^14.0.10 @@ -5480,7 +6618,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1": +"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -5830,6 +6968,13 @@ __metadata: languageName: node linkType: hard +"camelcase@npm:6": + version: 6.3.0 + resolution: "camelcase@npm:6.3.0" + checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d + languageName: node + linkType: hard + "camelcase@npm:^5.0.0": version: 5.3.1 resolution: "camelcase@npm:5.3.1" @@ -6322,6 +7467,15 @@ __metadata: languageName: node linkType: hard +"console-table-printer@npm:^2.12.1": + version: 2.15.0 + resolution: "console-table-printer@npm:2.15.0" + dependencies: + simple-wcswidth: ^1.1.2 + checksum: a878e446303eabaa86a2fd7f0d956d24252e0837be23249e7ad24daf3f304ce7bf155ca79b25ccd4f380f31fa35e427adc762e49ff29236f82a96c4b1d88551e + languageName: node + linkType: hard + "content-disposition@npm:^1.0.0": version: 1.0.1 resolution: "content-disposition@npm:1.0.1" @@ -6591,7 +7745,7 @@ __metadata: languageName: node linkType: hard -"decamelize@npm:^1.2.0": +"decamelize@npm:1.2.0, decamelize@npm:^1.2.0": version: 1.2.0 resolution: "decamelize@npm:1.2.0" checksum: ad8c51a7e7e0720c70ec2eeb1163b66da03e7616d7b98c9ef43cce2416395e84c1e9548dd94f5f6ffecfee9f8b94251fc57121a8b021f2ff2469b2bae247b8aa @@ -7053,6 +8207,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^4.0.4": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" @@ -8105,6 +9266,13 @@ __metadata: languageName: node linkType: hard +"is-network-error@npm:^1.1.0": + version: 1.3.0 + resolution: "is-network-error@npm:1.3.0" + checksum: 56dc0b8ed9c0bb72202058f172ad0c3121cf68772e8cbba343d3775f6e2ec7877d423cbcea45f4cedcd345de8693de1b52dfe0c6fc15d652c4aa98c2abf0185a + languageName: node + linkType: hard + "is-node-process@npm:^1.2.0": version: 1.2.0 resolution: "is-node-process@npm:1.2.0" @@ -8290,6 +9458,15 @@ __metadata: languageName: node linkType: hard +"js-tiktoken@npm:^1.0.12": + version: 1.0.21 + resolution: "js-tiktoken@npm:1.0.21" + dependencies: + base64-js: ^1.5.1 + checksum: 9d79d31b7c253724141fab00457f1311fe32dfa6c681121538ff88e75ec8d3dc14b311a195ad24f9d31f9f44324f0a4443dd1300505cd965feeb67a9fb68e935 + languageName: node + linkType: hard + "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -8515,6 +9692,49 @@ __metadata: languageName: node linkType: hard +"langchain@npm:^1.2.10": + version: 1.2.10 + resolution: "langchain@npm:1.2.10" + dependencies: + "@langchain/langgraph": ^1.0.0 + "@langchain/langgraph-checkpoint": ^1.0.0 + langsmith: ">=0.4.0 <1.0.0" + uuid: ^10.0.0 + zod: ^3.25.76 || ^4 + peerDependencies: + "@langchain/core": 1.1.15 + checksum: 40d8ce012741265ce85f49910943f0dd0d08fc9b0715246e27b135e09af381fce12e3717f4447e4e5e00907187fa2cf27bfd030e35a3729ea51e71c9e80eac05 + languageName: node + linkType: hard + +"langsmith@npm:>=0.4.0 <1.0.0": + version: 0.4.7 + resolution: "langsmith@npm:0.4.7" + dependencies: + "@types/uuid": ^10.0.0 + chalk: ^4.1.2 + console-table-printer: ^2.12.1 + p-queue: ^6.6.2 + semver: ^7.6.3 + uuid: ^10.0.0 + 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 + checksum: 61739f36dbe441d9e534abefe696802fcaae4054bbd401a6bcb2ee703eec414c34bbd0df6d1deba5e76b27040a89306161b5a58a8f5dd013a39b1d21286bf3c6 + languageName: node + linkType: hard + "libphonenumber-js@npm:^1.11.1": version: 1.12.33 resolution: "libphonenumber-js@npm:1.12.33" @@ -9232,6 +10452,15 @@ __metadata: languageName: node linkType: hard +"mustache@npm:^4.2.0": + version: 4.2.0 + resolution: "mustache@npm:4.2.0" + bin: + mustache: bin/mustache + checksum: 928fcb63e3aa44a562bfe9b59ba202cccbe40a46da50be6f0dd831b495be1dd7e38ca4657f0ecab2c1a89dc7bccba0885eab7ee7c1b215830da765758c7e0506 + languageName: node + linkType: hard + "mute-stream@npm:^2.0.0": version: 2.0.0 resolution: "mute-stream@npm:2.0.0" @@ -9593,6 +10822,23 @@ __metadata: languageName: node linkType: hard +"openai@npm:^6.10.0": + version: 6.16.0 + resolution: "openai@npm:6.16.0" + peerDependencies: + ws: ^8.18.0 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + ws: + optional: true + zod: + optional: true + bin: + openai: bin/cli + checksum: 4f0b61543664c6ba15d808ff050d5e786fe6e53fde4e4b336b43fbaf0eb3c95e15b0c86c09ac312eb87d79c7a1ca0bfee9aa85f537c9636b0cfb361fc1c010b4 + languageName: node + linkType: hard + "openai@npm:^6.14.0": version: 6.15.0 resolution: "openai@npm:6.15.0" @@ -9738,6 +10984,13 @@ __metadata: languageName: node linkType: hard +"p-finally@npm:^1.0.0": + version: 1.0.0 + resolution: "p-finally@npm:1.0.0" + checksum: 93a654c53dc805dd5b5891bab16eb0ea46db8f66c4bfd99336ae929323b1af2b70a8b0654f8f1eae924b2b73d037031366d645f1fd18b3d30cbd15950cc4b1d4 + languageName: node + linkType: hard + "p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" @@ -9782,6 +11035,34 @@ __metadata: languageName: node linkType: hard +"p-queue@npm:^6.6.2": + version: 6.6.2 + resolution: "p-queue@npm:6.6.2" + dependencies: + eventemitter3: ^4.0.4 + p-timeout: ^3.2.0 + checksum: 832642fcc4ab6477b43e6d7c30209ab10952969ed211c6d6f2931be8a4f9935e3578c72e8cce053dc34f2eb6941a408a2c516a54904e989851a1a209cf19761c + languageName: node + linkType: hard + +"p-retry@npm:^7.1.1": + version: 7.1.1 + resolution: "p-retry@npm:7.1.1" + dependencies: + is-network-error: ^1.1.0 + checksum: ae5ac18118e16fcb968095e6aee4ca9f82398f14b061177e00eaa949f6a0752b73afb41680193b56870475213989ef8bb7eacbacde827383b7f460d2de485ff1 + languageName: node + linkType: hard + +"p-timeout@npm:^3.2.0": + version: 3.2.0 + resolution: "p-timeout@npm:3.2.0" + dependencies: + p-finally: ^1.0.0 + checksum: 3dd0eaa048780a6f23e5855df3dd45c7beacff1f820476c1d0d1bcd6648e3298752ba2c877aa1c92f6453c7dd23faaf13d9f5149fc14c0598a142e2c5e8d649c + languageName: node + linkType: hard + "p-timeout@npm:^7.0.0": version: 7.0.1 resolution: "p-timeout@npm:7.0.1" @@ -10686,7 +11967,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.3": version: 7.7.3 resolution: "semver@npm:7.7.3" bin: @@ -10870,6 +12151,13 @@ __metadata: languageName: node linkType: hard +"simple-wcswidth@npm:^1.1.2": + version: 1.1.2 + resolution: "simple-wcswidth@npm:1.1.2" + checksum: 210eea36d28fb8dbadb1dcf5a19e747c1435548ec56bfd86f1c79fb9ddf676b252d84632d3ab9a787251281c499520e63bca1d9f5997cbd66c25996c10e056b1 + languageName: node + linkType: hard + "slash@npm:^5.1.0": version: 5.1.0 resolution: "slash@npm:5.1.0" @@ -11970,6 +13258,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^10.0.0": + version: 10.0.0 + resolution: "uuid@npm:10.0.0" + bin: + uuid: dist/bin/uuid + checksum: 4b81611ade2885d2313ddd8dc865d93d8dccc13ddf901745edca8f86d99bc46d7a330d678e7532e7ebf93ce616679fb19b2e3568873ac0c14c999032acb25869 + languageName: node + linkType: hard + "uuid@npm:^11.1.0": version: 11.1.0 resolution: "uuid@npm:11.1.0" @@ -12446,6 +13743,13 @@ __metadata: languageName: node linkType: hard +"zod@npm:^3.25.76 || ^4": + version: 4.3.5 + resolution: "zod@npm:4.3.5" + checksum: 68691183a91c67c4102db20139f3b5af288c59b4b11eb2239d712aae99dc6c1cecaeebcb0c012b44489771be05fecba21e79f65af4b3163b220239ef0af3ec49 + languageName: node + linkType: hard + "zod@npm:^4.1.11": version: 4.2.1 resolution: "zod@npm:4.2.1"