From 346f8fe191a96eab5903b9a9f5a1e7e5ea1e3ee2 Mon Sep 17 00:00:00 2001 From: liuk Date: Sat, 1 Feb 2025 17:52:44 +0800 Subject: [PATCH 001/319] fix: Autocomplete not working when lookup is selected --- .../autocomplete/AutocompleteLookupListener.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteLookupListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteLookupListener.kt index 6477f5403..2f2fa593b 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteLookupListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteLookupListener.kt @@ -29,18 +29,18 @@ class AutocompleteLookupListener(project: Project) : LookupManagerListener { newLookup.addLookupListener( object : LookupListener { override fun lookupShown(event: LookupEvent) { - super.lookupShown(event) + isLookupShown.set(false) ApplicationManager.getApplication().invokeLater { - isLookupShown.set(false) event.lookup.editor.project?.service()?.hideCompletions(newEditor) } } override fun lookupCanceled(event: LookupEvent) { - super.lookupCanceled(event) - ApplicationManager.getApplication().invokeLater { - isLookupShown.set(true) - } + isLookupShown.set(true) + } + + override fun itemSelected(event: LookupEvent) { + isLookupShown.set(true) } }) } From 3ee6c3b1687857faa732fe8f45f38abd7406dd2a Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Wed, 5 Feb 2025 18:11:38 +0100 Subject: [PATCH 002/319] update completion logic to handle midline insertions more accurately in completionProvider.ts --- .../vscode/src/autocomplete/completionProvider.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index f7ddf82f5..aca4c5478 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -41,8 +41,7 @@ interface VsCodeCompletionInput { } export class ContinueCompletionProvider - implements vscode.InlineCompletionItemProvider -{ + implements vscode.InlineCompletionItemProvider { private onError(e: any) { const options = ["Documentation"]; if (e.message.includes("Ollama may not be installed")) { @@ -280,14 +279,8 @@ export class ContinueCompletionProvider document.lineAt(startPos).range.end, ); } else if ( - //diffPatternMatches(diffs, ["+", "-"]) || - //diffPatternMatches(diffs, ["-", "+"]) - diffs.every((diff, index) => - index % 2 === 0 ? diff.added : diff.removed - ) || - diffs.every((diff, index) => - index % 2 === 0 ? diff.removed : diff.added - ) + diffPatternMatches(diffs, ["+", "-"]) || + diffPatternMatches(diffs, ["-", "+"]) ) { // We are midline and the model just inserted without repeating to the end of the line // We want to move the cursor to the end of the line @@ -310,7 +303,7 @@ export class ContinueCompletionProvider } else { // If the first part of the diff isn't an insertion, then the model is // probably rewriting other parts of the line - return undefined; + // return undefined; - Let's assume it's simply an insertion } } } else { From c6cd7188eac21e073a49e856238f271518b2e7b7 Mon Sep 17 00:00:00 2001 From: Luke Lashley Date: Fri, 7 Feb 2025 10:59:37 -0500 Subject: [PATCH 003/319] Fix two bugs introduced by previous updates --- core/llm/llms/Gemini.ts | 78 +++++++++++++++++++------------- core/llm/llms/VertexAI.ts | 93 +++------------------------------------ core/llm/toolSupport.ts | 5 +++ 3 files changed, 59 insertions(+), 117 deletions(-) diff --git a/core/llm/llms/Gemini.ts b/core/llm/llms/Gemini.ts index 4c0fb189b..5c9cf0a4e 100644 --- a/core/llm/llms/Gemini.ts +++ b/core/llm/llms/Gemini.ts @@ -135,21 +135,11 @@ class Gemini extends BaseLLM { }; } - private async *streamChatGemini( + public prepareBody( messages: ChatMessage[], - signal: AbortSignal, options: CompletionOptions, - ): AsyncGenerator { - const apiURL = new URL( - `models/${options.model}:streamGenerateContent?key=${this.apiKey}`, - this.apiBase, - ); - // This feels hacky to repeat code from above function but was the quickest - // way to ensure system message re-formatting isn't done if user has specified v1 - const apiBase = this.apiBase || Gemini.defaultOptions.apiBase!; // Determine if it's a v1 API call based on apiBase - const isV1API = apiBase.includes("/v1/"); - - // Convert chat messages to contents + isV1API: boolean, + ): GeminiChatRequestBody { const body: GeminiChatRequestBody = { contents: messages .filter((msg) => !(msg.role === "system" && isV1API)) @@ -253,7 +243,7 @@ class Gemini extends BaseLLM { } // Helper function to recursively clean JSON Schema objects const cleanJsonSchema = (schema: any): any => { - if (!schema || typeof schema !== 'object') return schema; + if (!schema || typeof schema !== "object") return schema; if (Array.isArray(schema)) { return schema.map(cleanJsonSchema); @@ -273,7 +263,7 @@ class Gemini extends BaseLLM { ...acc, [key]: cleanJsonSchema(value), }), - {} + {}, ); } @@ -304,15 +294,14 @@ class Gemini extends BaseLLM { } } } + return body; + } - const response = await this.fetch(apiURL, { - method: "POST", - body: JSON.stringify(body), - signal, - }); - + public async *processGeminiResponse( + stream: AsyncIterable, + ): AsyncGenerator { let buffer = ""; - for await (const chunk of streamResponse(response)) { + for await (const chunk of stream) { buffer += chunk; if (buffer.startsWith("[")) { buffer = buffer.slice(1); @@ -349,8 +338,8 @@ class Gemini extends BaseLLM { // Process all parts first to maintain order const processedParts: Array<{ - type: 'content' | 'tool' | 'toolCall', - data: any + type: "content" | "tool" | "toolCall"; + data: any; }> = []; for (const part of content.parts) { @@ -366,7 +355,7 @@ class Gemini extends BaseLLM { } else if ("functionCall" in part) { // Queue function call processedParts.push({ - type: 'toolCall', + type: "toolCall", data: { type: "function", id: "", // Not supported by gemini @@ -377,17 +366,17 @@ class Gemini extends BaseLLM { ? part.functionCall.args : JSON.stringify(part.functionCall.args), }, - } + }, }); } else if ("functionResponse" in part) { // Queue function response processedParts.push({ - type: 'tool', + type: "tool", data: { role: "tool", content: part.functionResponse.response.output as string, toolCallId: part.functionResponse.name, - } + }, }); } else { console.warn("Unsupported gemini part type received", part); @@ -404,13 +393,13 @@ class Gemini extends BaseLLM { // Then process tool calls and responses in order for (const part of processedParts) { - if (part.type === 'toolCall') { + if (part.type === "toolCall") { yield { role: "assistant", content: "", toolCalls: [part.data], }; - } else if (part.type === 'tool') { + } else if (part.type === "tool") { yield part.data; } } @@ -426,6 +415,35 @@ class Gemini extends BaseLLM { } } } + + private async *streamChatGemini( + messages: ChatMessage[], + signal: AbortSignal, + options: CompletionOptions, + ): AsyncGenerator { + const apiURL = new URL( + `models/${options.model}:streamGenerateContent?key=${this.apiKey}`, + this.apiBase, + ); + // This feels hacky to repeat code from above function but was the quickest + // way to ensure system message re-formatting isn't done if user has specified v1 + const apiBase = this.apiBase || Gemini.defaultOptions.apiBase!; // Determine if it's a v1 API call based on apiBase + const isV1API = apiBase.includes("/v1/"); + + // Convert chat messages to contents + const body = this.prepareBody(messages, options, isV1API); + + const response = await this.fetch(apiURL, { + method: "POST", + body: JSON.stringify(body), + signal, + }); + for await (const message of this.processGeminiResponse( + streamResponse(response), + )) { + yield message; + } + } private async *streamChatBison( messages: ChatMessage[], signal: AbortSignal, diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index 8d20c3212..fc6c53fae 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -143,97 +143,16 @@ class VertexAI extends BaseLLM { `publishers/google/models/${options.model}:streamGenerateContent`, this.apiBase, ); - // This feels hacky to repeat code from above function but was the quickest - // way to ensure system message re-formatting isn't done if user has specified v1 - const isV1API = this.apiBase.includes("/v1/"); - const contents = messages - .map((msg) => { - if (msg.role === "system" && !isV1API) { - return null; // Don't include system message in contents - } - if (msg.role === "tool") { - return null; - } - - return { - role: msg.role === "assistant" ? "model" : "user", - parts: - typeof msg.content === "string" - ? [{ text: msg.content }] - : msg.content.map(this.geminiInstance.continuePartToGeminiPart), - }; - }) - .filter((c) => c !== null); - - const body = { - ...this.geminiInstance.convertArgs(options), - contents, - // if this.systemMessage is defined, reformat it for Gemini API - ...(this.systemMessage && - !isV1API && { - systemInstruction: { parts: [{ text: this.systemMessage }] }, - }), - }; + const body = this.geminiInstance.prepareBody(messages, options, false); const response = await this.fetch(apiURL, { method: "POST", body: JSON.stringify(body), }); - - let buffer = ""; - for await (const chunk of streamResponse(response)) { - buffer += chunk; - if (buffer.startsWith("[")) { - buffer = buffer.slice(1); - } - if (buffer.endsWith("]")) { - buffer = buffer.slice(0, -1); - } - if (buffer.startsWith(",")) { - buffer = buffer.slice(1); - } - - const parts = buffer.split("\n,"); - - let foundIncomplete = false; - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - let data; - try { - data = JSON.parse(part); - } catch (e) { - foundIncomplete = true; - continue; // yo! - } - if (data.error) { - throw new Error(data.error.message); - } - // Check for existence of each level before accessing the final 'text' property - if (data?.candidates?.[0]?.content?.parts?.[0]?.text) { - // Incrementally stream the content to make it smoother - const content = data.candidates[0].content.parts[0].text; - const words = content.split(/(\s+)/); - const delaySeconds = Math.min(4.0 / (words.length + 1), 0.1); - while (words.length > 0) { - const wordsToYield = Math.min(3, words.length); - yield { - role: "assistant", - content: words.splice(0, wordsToYield).join(""), - }; - await delay(delaySeconds); - } - } else { - // Handle the case where the expected data structure is not found - if (data?.candidates?.[0]?.finishReason !== "STOP") { - console.warn("Unexpected response format:", data); - } - } - } - if (foundIncomplete) { - buffer = parts[parts.length - 1]; - } else { - buffer = ""; - } + for await (const message of this.geminiInstance.processGeminiResponse( + streamResponse(response), + )) { + yield message; } } @@ -445,7 +364,7 @@ class VertexAI extends BaseLLM { } const resp = await this.fetch( - new URL(this.apiBase + `/publishers/google/models/${this.model}:predict`), + new URL(this.apiBase + `publishers/google/models/${this.model}:predict`), { method: "POST", body: JSON.stringify({ diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index dd8f72fb0..bee55f7e3 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -21,6 +21,11 @@ export const PROVIDER_TOOL_SUPPORT: Record< // All gemini models support function calling return model.toLowerCase().includes("gemini"); }, + vertexai: (model) => { + // All gemini models except flash 2.0 lite support function calling + return model.toLowerCase().includes("gemini") && !model.toLowerCase().includes("lite");; + }, + // https://ollama.com/search?c=tools ollama: (model) => { if ( From be2c9cb92d6b4bd8774b141377ef26480b7756bc Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Fri, 7 Feb 2025 22:44:20 +0100 Subject: [PATCH 004/319] Create processSingleLineCompletion pure function with unit tests --- .../util/completionTestUtils.test.ts | 62 ++++++++++++ core/autocomplete/util/completionTestUtils.ts | 63 ++++++++++++ .../util/processSingleLineCompletion.test.ts | 97 +++++++++++++++++++ .../util/processSingleLineCompletion.ts | 92 ++++++++++++++++++ .../src/autocomplete/completionProvider.ts | 83 ++++------------ 5 files changed, 331 insertions(+), 66 deletions(-) create mode 100644 core/autocomplete/util/completionTestUtils.test.ts create mode 100644 core/autocomplete/util/completionTestUtils.ts create mode 100644 core/autocomplete/util/processSingleLineCompletion.test.ts create mode 100644 core/autocomplete/util/processSingleLineCompletion.ts diff --git a/core/autocomplete/util/completionTestUtils.test.ts b/core/autocomplete/util/completionTestUtils.test.ts new file mode 100644 index 000000000..7ef76eba0 --- /dev/null +++ b/core/autocomplete/util/completionTestUtils.test.ts @@ -0,0 +1,62 @@ +import { processTestCase, type CompletionTestCase } from './completionTestUtils'; + +describe('processTestCase utility', () => { + it('processes simple console.log completion', () => { + const testCase: CompletionTestCase = { + original: 'console.log(|cur||till|)', + completion: '"foo,", bar', + }; + + expect(processTestCase(testCase)).toEqual({ + input: { + lastLineOfCompletionText: '"foo,", bar', + currentText: ')', + cursorPosition: 'console.log('.length, + }, + expectedResult: { + completionText: '"foo,", bar', + }, + }); + }); + + it('processes simple console.log completion with overwriting', () => { + const testCase: CompletionTestCase = { + original: 'console.log(|cur|)|till|', + completion: '"foo,", bar);', + }; + + expect(processTestCase(testCase)).toEqual({ + input: { + lastLineOfCompletionText: '"foo,", bar);', + currentText: ')', + cursorPosition: 'console.log('.length, + }, + expectedResult: { + completionText: '"foo,", bar);', + range: { + start: 'console.log('.length, + end: 'console.log()'.length + }, + }, + }); + }); + + it('partially applying completion', () => { + const testCase: CompletionTestCase = { + original: '|cur||till|fetch("https://example.com");', + completion: 'await fetch("https://example.com");', + appliedCompletion: 'await ' + }; + + expect(processTestCase(testCase)).toEqual({ + input: { + lastLineOfCompletionText: 'await fetch("https://example.com");', + currentText: 'fetch("https://example.com");', + cursorPosition: 0, + }, + expectedResult: { + completionText: 'await ' + }, + }); + }); +}); diff --git a/core/autocomplete/util/completionTestUtils.ts b/core/autocomplete/util/completionTestUtils.ts new file mode 100644 index 000000000..4ca10d739 --- /dev/null +++ b/core/autocomplete/util/completionTestUtils.ts @@ -0,0 +1,63 @@ +export interface CompletionTestCase { + original: string; // Text with |cur| and |till| markers + completion: string; // Text to insert/overwrite + appliedCompletion?: string | null; + cursorMarker?: string; + tillMarker?: string; +} + +export interface ProcessedTestCase { + input: { + lastLineOfCompletionText: string; + currentText: string; + cursorPosition: number; + }; + expectedResult: { + completionText: string; + range?: { + start: number; + end: number; + }; + }; +} + +export function processTestCase({ + original, + completion, + appliedCompletion = null, + cursorMarker = '|cur|', + tillMarker = '|till|', +}: CompletionTestCase): ProcessedTestCase { + // Validate cursor marker + if (!original.includes(cursorMarker)) { + throw new Error('Cursor marker not found in original text'); + } + + const cursorPos = original.indexOf(cursorMarker); + original = original.replace(cursorMarker, ''); + + let tillPos = original.indexOf(tillMarker); + if (tillPos < 0) { + tillPos = cursorPos; + } else { + original = original.replace(tillMarker, '') + } + + // Calculate currentText based on what's between cursor and till marker + const currentText = original.substring(cursorPos); + + return { + input: { + lastLineOfCompletionText: completion, + currentText, + cursorPosition: cursorPos, + }, + expectedResult: { + completionText: appliedCompletion || completion, + range: cursorPos === tillPos ? undefined : { + start: cursorPos, + end: tillPos, + }, + }, + }; +} \ No newline at end of file diff --git a/core/autocomplete/util/processSingleLineCompletion.test.ts b/core/autocomplete/util/processSingleLineCompletion.test.ts new file mode 100644 index 000000000..7384ab949 --- /dev/null +++ b/core/autocomplete/util/processSingleLineCompletion.test.ts @@ -0,0 +1,97 @@ +import { processTestCase } from './completionTestUtils'; +import { processSingleLineCompletion } from './processSingleLineCompletion'; + +describe('processSingleLineCompletion', () => { + + it('should handle simple end of line completion', () => { + const testCase = processTestCase({ + original: 'console.log(|cur|', + completion: '"Hello, world!")', + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + + it('should handle midline insert repeating the end of line', () => { + const testCase = processTestCase({ + original: 'console.log(|cur|);|till|', + completion: '"Hello, world!");', + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + + it('should handle midline insert repeating the end of line plus adding a semicolon', () => { + const testCase = processTestCase({ + original: 'console.log(|cur|)|till|', + completion: '"Hello, world!");', + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + + it('should handle simple midline insert', () => { + const testCase = processTestCase({ + original: 'console.log(|cur|)', + completion: '"Hello, world!"', + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + + it('should handle complex dif with addition in the beginning', () => { + const testCase = processTestCase({ + original: 'console.log(|cur||till|, "param1", )', // TODO + completion: '"Hello world!", "param1", param1);', + appliedCompletion: '"Hello world!"' + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + + it('should handle simple insertion even with random equality', () => { + const testCase = processTestCase({ + original: 'print(f"Foobar length: |cur||till|")', + completion: '{len(foobar)}', + }); + + const result = processSingleLineCompletion( + testCase.input.lastLineOfCompletionText, + testCase.input.currentText, + testCase.input.cursorPosition + ); + + expect(result).toEqual(testCase.expectedResult); + }); + +}); diff --git a/core/autocomplete/util/processSingleLineCompletion.ts b/core/autocomplete/util/processSingleLineCompletion.ts new file mode 100644 index 000000000..cc9da95d0 --- /dev/null +++ b/core/autocomplete/util/processSingleLineCompletion.ts @@ -0,0 +1,92 @@ +import * as Diff from "diff" + +interface SingleLineCompletionResult { + completionText: string; + range?: { + start: number; + end: number; + }; +} + + +interface DiffType { + count?: number; + added?: boolean; + removed?: boolean; + value: string; +} + + +function diffPatternMatches( + diffs: DiffType[], + pattern: DiffPartType[], +): boolean { + if (diffs.length !== pattern.length) { + return false; + } + + for (let i = 0; i < diffs.length; i++) { + const diff = diffs[i]; + const diffPartType: DiffPartType = + !diff.added && !diff.removed ? "=" : diff.added ? "+" : "-"; + + if (diffPartType !== pattern[i]) { + return false; + } + } + + return true; +} + +type DiffPartType = "+" | "-" | "="; + +export function processSingleLineCompletion( + lastLineOfCompletionText: string, + currentText: string, + cursorPosition: number +): SingleLineCompletionResult | undefined { + const diffs: DiffType[] = Diff.diffWords(currentText, lastLineOfCompletionText); + + if (diffPatternMatches(diffs, ["+"])) { + // Just insert, we're already at the end of the line + return { + completionText: lastLineOfCompletionText, + }; + } + + if ( + diffPatternMatches(diffs, ["+", "="]) || + diffPatternMatches(diffs, ["+", "=", "+"]) + ) { + // The model repeated the text after the cursor to the end of the line + return { + completionText: lastLineOfCompletionText, + range: { + start: cursorPosition, + end: currentText.length + cursorPosition, + }, + }; + } + + if ( + diffPatternMatches(diffs, ["+", "-"]) || + diffPatternMatches(diffs, ["-", "+"]) + ) { + // We are midline and the model just inserted without repeating to the end of the line + return { + completionText: lastLineOfCompletionText, + }; + } + + // For any other diff pattern, just use the first added part if available + if (diffs[0]?.added) { + return { + completionText: diffs[0].value, + }; + } + + // Default case: treat as simple insertion + return { + completionText: lastLineOfCompletionText, + }; +} diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index aca4c5478..7a1816256 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -24,8 +24,7 @@ import { import type { TabAutocompleteModel } from "../util/loadAutocompleteModel"; import { startLocalOllama } from "core/util/ollamaHelper"; import type { IDE } from "core"; - -const Diff = require("diff"); +import { processSingleLineCompletion } from "core/autocomplete/util/processSingleLineCompletion"; interface DiffType { count: number; @@ -258,54 +257,29 @@ export class ContinueCompletionProvider const isSingleLineCompletion = outcome.completion.split("\n").length <= 1; if (isSingleLineCompletion) { - const lastLineOfCompletionText = completionText.split("\n").pop(); + const lastLineOfCompletionText = completionText.split("\n").pop() || ""; const currentText = document .lineAt(startPos) .text.substring(startPos.character); - const diffs: DiffType[] = Diff.diffWords( - currentText, + + const result = processSingleLineCompletion( lastLineOfCompletionText, + currentText, + startPos.character ); - if (diffPatternMatches(diffs, ["+"])) { - // Just insert, we're already at the end of the line - } else if ( - diffPatternMatches(diffs, ["+", "="]) || - diffPatternMatches(diffs, ["+", "=", "+"]) - ) { - // The model repeated the text after the cursor to the end of the line - range = new vscode.Range( - startPos, - document.lineAt(startPos).range.end, - ); - } else if ( - diffPatternMatches(diffs, ["+", "-"]) || - diffPatternMatches(diffs, ["-", "+"]) - ) { - // We are midline and the model just inserted without repeating to the end of the line - // We want to move the cursor to the end of the line - // range = new vscode.Range( - // startPos, - // document.lineAt(startPos).range.end, - // ); - // // Find the last removed part of the diff - // const lastRemovedIndex = findLastIndex( - // diffs, - // (diff) => diff.removed === true, - // ); - // const lastRemovedContent = diffs[lastRemovedIndex].value; - // completionText += lastRemovedContent; - } else { - // Diff is too complicated, just insert the first added part of the diff - // This is the safe way to ensure that it is displayed - if (diffs[0]?.added) { - completionText = diffs[0].value; - } else { - // If the first part of the diff isn't an insertion, then the model is - // probably rewriting other parts of the line - // return undefined; - Let's assume it's simply an insertion - } + if (result === undefined) { + return undefined; } + + completionText = result.completionText; + if (result.range) { + range = new vscode.Range( + new vscode.Position(startPos.line, result.range.start), + new vscode.Position(startPos.line, result.range.end) + ); + } + } else { // Extend the range to the end of the line for multiline completions range = new vscode.Range(startPos, document.lineAt(startPos).range.end); @@ -352,26 +326,3 @@ export class ContinueCompletionProvider return true; } } - -type DiffPartType = "+" | "-" | "="; - -function diffPatternMatches( - diffs: DiffType[], - pattern: DiffPartType[], -): boolean { - if (diffs.length !== pattern.length) { - return false; - } - - for (let i = 0; i < diffs.length; i++) { - const diff = diffs[i]; - const diffPartType: DiffPartType = - !diff.added && !diff.removed ? "=" : diff.added ? "+" : "-"; - - if (diffPartType !== pattern[i]) { - return false; - } - } - - return true; -} From 4cc1cdd68adb9582b90bb596eb7a063f0d4705b9 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Sat, 8 Feb 2025 00:00:06 +0100 Subject: [PATCH 005/319] fix formatting issues --- .../util/completionTestUtils.test.ts | 53 ++++++++++--------- core/autocomplete/util/completionTestUtils.ts | 10 ++-- .../util/processSingleLineCompletion.test.ts | 44 +++++++-------- .../util/processSingleLineCompletion.ts | 2 +- .../src/autocomplete/completionProvider.ts | 11 +--- 5 files changed, 58 insertions(+), 62 deletions(-) diff --git a/core/autocomplete/util/completionTestUtils.test.ts b/core/autocomplete/util/completionTestUtils.test.ts index 7ef76eba0..bdf4e209a 100644 --- a/core/autocomplete/util/completionTestUtils.test.ts +++ b/core/autocomplete/util/completionTestUtils.test.ts @@ -1,61 +1,64 @@ -import { processTestCase, type CompletionTestCase } from './completionTestUtils'; +import { + processTestCase, + type CompletionTestCase, +} from "./completionTestUtils"; -describe('processTestCase utility', () => { - it('processes simple console.log completion', () => { +describe("processTestCase utility", () => { + it("processes simple console.log completion", () => { const testCase: CompletionTestCase = { - original: 'console.log(|cur||till|)', - completion: '"foo,", bar', + original: "console.log(|cur||till|)", + completion: "\"foo,\", bar", }; expect(processTestCase(testCase)).toEqual({ input: { - lastLineOfCompletionText: '"foo,", bar', - currentText: ')', - cursorPosition: 'console.log('.length, + lastLineOfCompletionText: "\"foo,\", bar", + currentText: ")", + cursorPosition: "console.log(".length, }, expectedResult: { - completionText: '"foo,", bar', + completionText: "\"foo,\", bar", }, }); }); - it('processes simple console.log completion with overwriting', () => { + it("processes simple console.log completion with overwriting", () => { const testCase: CompletionTestCase = { - original: 'console.log(|cur|)|till|', - completion: '"foo,", bar);', + original: "console.log(|cur|)|till|", + completion: "\"foo,\", bar);", }; expect(processTestCase(testCase)).toEqual({ input: { - lastLineOfCompletionText: '"foo,", bar);', - currentText: ')', - cursorPosition: 'console.log('.length, + lastLineOfCompletionText: "\"foo,\", bar);", + currentText: ")", + cursorPosition: "console.log(".length, }, expectedResult: { - completionText: '"foo,", bar);', + completionText: "\"foo,\", bar);", range: { - start: 'console.log('.length, - end: 'console.log()'.length + start: "console.log(".length, + end: "console.log()".length, }, }, }); }); - it('partially applying completion', () => { + it("partially applying completion", () => { const testCase: CompletionTestCase = { - original: '|cur||till|fetch("https://example.com");', - completion: 'await fetch("https://example.com");', - appliedCompletion: 'await ' + original: "|cur||till|fetch(\"https://example.com\");", + completion: "await fetch(\"https://example.com\");", + appliedCompletion: "await ", }; expect(processTestCase(testCase)).toEqual({ input: { - lastLineOfCompletionText: 'await fetch("https://example.com");', - currentText: 'fetch("https://example.com");', + lastLineOfCompletionText: "await fetch(\"https://example.com\");", + currentText: "fetch(\"https://example.com\");", cursorPosition: 0, }, expectedResult: { - completionText: 'await ' + completionText: "await ", }, }); }); diff --git a/core/autocomplete/util/completionTestUtils.ts b/core/autocomplete/util/completionTestUtils.ts index 4ca10d739..414b15627 100644 --- a/core/autocomplete/util/completionTestUtils.ts +++ b/core/autocomplete/util/completionTestUtils.ts @@ -25,22 +25,22 @@ export function processTestCase({ original, completion, appliedCompletion = null, - cursorMarker = '|cur|', - tillMarker = '|till|', + cursorMarker = "|cur|", + tillMarker = "|till|", }: CompletionTestCase): ProcessedTestCase { // Validate cursor marker if (!original.includes(cursorMarker)) { - throw new Error('Cursor marker not found in original text'); + throw new Error("Cursor marker not found in original text"); } const cursorPos = original.indexOf(cursorMarker); - original = original.replace(cursorMarker, ''); + original = original.replace(cursorMarker, ""); let tillPos = original.indexOf(tillMarker); if (tillPos < 0) { tillPos = cursorPos; } else { - original = original.replace(tillMarker, '') + original = original.replace(tillMarker, "") } // Calculate currentText based on what's between cursor and till marker diff --git a/core/autocomplete/util/processSingleLineCompletion.test.ts b/core/autocomplete/util/processSingleLineCompletion.test.ts index 7384ab949..8081ac20c 100644 --- a/core/autocomplete/util/processSingleLineCompletion.test.ts +++ b/core/autocomplete/util/processSingleLineCompletion.test.ts @@ -1,12 +1,12 @@ -import { processTestCase } from './completionTestUtils'; -import { processSingleLineCompletion } from './processSingleLineCompletion'; +import { processTestCase } from "./completionTestUtils"; +import { processSingleLineCompletion } from "./processSingleLineCompletion"; -describe('processSingleLineCompletion', () => { +describe("processSingleLineCompletion", () => { - it('should handle simple end of line completion', () => { + it("should handle simple end of line completion", () => { const testCase = processTestCase({ - original: 'console.log(|cur|', - completion: '"Hello, world!")', + original: "console.log(|cur|", + completion: "\"Hello, world!\")", }); const result = processSingleLineCompletion( @@ -18,10 +18,10 @@ describe('processSingleLineCompletion', () => { expect(result).toEqual(testCase.expectedResult); }); - it('should handle midline insert repeating the end of line', () => { + it("should handle midline insert repeating the end of line", () => { const testCase = processTestCase({ - original: 'console.log(|cur|);|till|', - completion: '"Hello, world!");', + original: "console.log(|cur|);|till|", + completion: "\"Hello, world!\");", }); const result = processSingleLineCompletion( @@ -33,10 +33,10 @@ describe('processSingleLineCompletion', () => { expect(result).toEqual(testCase.expectedResult); }); - it('should handle midline insert repeating the end of line plus adding a semicolon', () => { + it("should handle midline insert repeating the end of line plus adding a semicolon", () => { const testCase = processTestCase({ - original: 'console.log(|cur|)|till|', - completion: '"Hello, world!");', + original: "console.log(|cur|)|till|", + completion: "\"Hello, world!\");", }); const result = processSingleLineCompletion( @@ -48,10 +48,10 @@ describe('processSingleLineCompletion', () => { expect(result).toEqual(testCase.expectedResult); }); - it('should handle simple midline insert', () => { + it("should handle simple midline insert", () => { const testCase = processTestCase({ - original: 'console.log(|cur|)', - completion: '"Hello, world!"', + original: "console.log(|cur|)", + completion: "\"Hello, world!\"", }); const result = processSingleLineCompletion( @@ -63,11 +63,11 @@ describe('processSingleLineCompletion', () => { expect(result).toEqual(testCase.expectedResult); }); - it('should handle complex dif with addition in the beginning', () => { + it("should handle complex dif with addition in the beginning", () => { const testCase = processTestCase({ - original: 'console.log(|cur||till|, "param1", )', // TODO - completion: '"Hello world!", "param1", param1);', - appliedCompletion: '"Hello world!"' + original: "console.log(|cur||till|, \"param1\", )", // TODO + completion: "\"Hello world!\", \"param1\", param1);", + appliedCompletion: "\"Hello world!\"" }); const result = processSingleLineCompletion( @@ -79,10 +79,10 @@ describe('processSingleLineCompletion', () => { expect(result).toEqual(testCase.expectedResult); }); - it('should handle simple insertion even with random equality', () => { + it("should handle simple insertion even with random equality", () => { const testCase = processTestCase({ - original: 'print(f"Foobar length: |cur||till|")', - completion: '{len(foobar)}', + original: "print(f\"Foobar length: |cur||till|\")", + completion: "{len(foobar)}", }); const result = processSingleLineCompletion( diff --git a/core/autocomplete/util/processSingleLineCompletion.ts b/core/autocomplete/util/processSingleLineCompletion.ts index cc9da95d0..3dc093411 100644 --- a/core/autocomplete/util/processSingleLineCompletion.ts +++ b/core/autocomplete/util/processSingleLineCompletion.ts @@ -1,4 +1,4 @@ -import * as Diff from "diff" +import * as Diff from "diff"; interface SingleLineCompletionResult { completionText: string; diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index 7a1816256..ded488fff 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -1,9 +1,11 @@ import { CompletionProvider } from "core/autocomplete/CompletionProvider"; +import { processSingleLineCompletion } from "core/autocomplete/util/processSingleLineCompletion"; import { type AutocompleteInput, type AutocompleteOutcome, } from "core/autocomplete/util/types"; import { ConfigHandler } from "core/config/ConfigHandler"; +import { startLocalOllama } from "core/util/ollamaHelper"; import * as URI from "uri-js"; import { v4 as uuidv4 } from "uuid"; import * as vscode from "vscode"; @@ -22,16 +24,7 @@ import { } from "./statusBar"; import type { TabAutocompleteModel } from "../util/loadAutocompleteModel"; -import { startLocalOllama } from "core/util/ollamaHelper"; import type { IDE } from "core"; -import { processSingleLineCompletion } from "core/autocomplete/util/processSingleLineCompletion"; - -interface DiffType { - count: number; - added: boolean; - removed: boolean; - value: string; -} interface VsCodeCompletionInput { document: vscode.TextDocument; From 6e8f4d86cd3ae1a84bada2a72be2f6e6688dfa00 Mon Sep 17 00:00:00 2001 From: Riddhimaan-Senapati <114703025+Riddhimaan-Senapati@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:28:52 -0500 Subject: [PATCH 006/319] added new gemini models to config_schema.json --- extensions/vscode/config_schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index d9dab076b..642335557 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -937,7 +937,10 @@ "gemini-1.5-flash", "gemini-1.5-flash-8b", "gemini-2.0-flash-exp", - "gemini-2.0-flash" + "gemini-2.0-flash", + "gemini-2.0-flash-thinking-exp-01-21", + "gemini-2.0-pro-exp-02-05", + "gemini-2.0-flash-lite-preview-02-05" ] } } From 3c36b4dc378ddd8c5c5c2cc234e9a605d776d928 Mon Sep 17 00:00:00 2001 From: Ingo Eichhorst Date: Sun, 16 Feb 2025 22:31:10 +0100 Subject: [PATCH 007/319] feat: add unified diff instant apply --- core/edit/lazy/applyCodeBlock.ts | 12 + core/edit/lazy/unifiedDiffApply.test.ts | 412 ++++++++++++++++++++++++ core/edit/lazy/unifiedDiffApply.ts | 152 +++++++++ docs/docs/edit/how-to-use-it.md | 7 + 4 files changed, 583 insertions(+) create mode 100644 core/edit/lazy/unifiedDiffApply.test.ts create mode 100644 core/edit/lazy/unifiedDiffApply.ts diff --git a/core/edit/lazy/applyCodeBlock.ts b/core/edit/lazy/applyCodeBlock.ts index 924d1c282..8a311a4fe 100644 --- a/core/edit/lazy/applyCodeBlock.ts +++ b/core/edit/lazy/applyCodeBlock.ts @@ -5,6 +5,7 @@ import { getUriFileExtension } from "../../util/uri"; import { deterministicApplyLazyEdit } from "./deterministic"; import { streamLazyApply } from "./streamLazyApply"; +import { isUnifiedDiffFormat, applyUnifiedDiff } from "./unifiedDiffApply"; function canUseInstantApply(filename: string) { const fileExtension = getUriFileExtension(filename); @@ -32,5 +33,16 @@ export async function applyCodeBlock( } } + // If the code block is a diff + if (isUnifiedDiffFormat(newFile)) { + try { + const diffLines = applyUnifiedDiff(oldFile, newFile); + const diffGenerator = generateLines(diffLines!); + return [true, diffGenerator]; + } catch (e) { + console.error("Failed to apply unified diff", e); + } + } + return [false, streamLazyApply(oldFile, filename, newFile, llm, fastLlm)]; } diff --git a/core/edit/lazy/unifiedDiffApply.test.ts b/core/edit/lazy/unifiedDiffApply.test.ts new file mode 100644 index 000000000..c7a5a8370 --- /dev/null +++ b/core/edit/lazy/unifiedDiffApply.test.ts @@ -0,0 +1,412 @@ +import { applyUnifiedDiff, isUnifiedDiffFormat } from "./unifiedDiffApply"; + +describe("isUnifiedDiffFormat", () => { + it("should return true for valid unified diff format", () => { + const validDiff = `--- original.txt ++++ modified.txt +@@ -1,3 +1,4 @@ + line1 +-line2 ++newline2 ++newline3 + line3`; + expect(isUnifiedDiffFormat(validDiff)).toBe(true); + }); + + it("should return false for empty diff", () => { + expect(isUnifiedDiffFormat("")).toBe(false); + }); + + it("should return false for diff without hunk header", () => { + const invalidDiff = `--- original.txt ++++ modified.txt ++line1 +-line2 ++line3`; + expect(isUnifiedDiffFormat(invalidDiff)).toBe(false); + }); + + it("should return false for diff without valid content", () => { + const invalidDiff = `--- original.txt ++++ modified.txt +@@ -1,3 +1,4 @@`; + expect(isUnifiedDiffFormat(invalidDiff)).toBe(false); + }); + + it("should return true even without file headers if hunk headers exist", () => { + const diffWithoutFileHeaders = `@@ -1,3 +1,4 @@ + line1 +-line2 ++newline2 ++newline3 + line3`; + expect(isUnifiedDiffFormat(diffWithoutFileHeaders)).toBe(true); + }); + + it("should return true in case of empty lines", () => { + const diffWithoutFileHeaders = `@@ -1,3 +1,4 @@ + line1 +-line2 ++newline2 + line3`; + expect(isUnifiedDiffFormat(diffWithoutFileHeaders)).toBe(true); + }); +}); + +describe("applyUnifiedDiff", () => { + it("should correctly apply a add line of unified diff", () => { + const sourceCode = `func main() { + scanner := bufio.NewScanner(os.Stdin) + fmt.Println("Calculator started! Available operations:") + fmt.Println(" + : Addition") + fmt.Println(" - : Subtraction") + fmt.Println(" * : Multiplication") + fmt.Println(" / : Division") + fmt.Println(" ^ : Power") + fmt.Println(" √ : Square root (use only one number)") +} +// End of file`; + + const diffText = `--- original.go ++++ updated.go +@@ -30,6 +30,7 @@ + fmt.Println(" / : Division") + fmt.Println(" ^ : Power") + fmt.Println(" √ : Square root (use only one number)") ++ fmt.Println(" log: Logarithm (use 'log base number')") + }`; + + const result = applyUnifiedDiff(sourceCode, diffText); + + const expected = [ + { type: "same", line: "func main() {" }, + { type: "same", line: " scanner := bufio.NewScanner(os.Stdin)" }, + { type: "same", line: " fmt.Println(\"Calculator started! Available operations:\")" }, + { type: "same", line: " fmt.Println(\" + : Addition\")" }, + { type: "same", line: " fmt.Println(\" - : Subtraction\")" }, + { type: "same", line: " fmt.Println(\" * : Multiplication\")" }, + { type: "same", line: " fmt.Println(\" / : Division\")" }, + { type: "same", line: " fmt.Println(\" ^ : Power\")" }, + { type: "same", line: " fmt.Println(\" √ : Square root (use only one number)\")" }, + { type: "new", line: " fmt.Println(\" log: Logarithm (use 'log base number')\")" }, + { type: "same", line: "}" }, + { type: "same", line: "// End of file" } + ]; + + expect(result).toEqual(expected); + }); + + it("should correctly apply multiple insertions and deletions", () => { + const sourceCode = `package main +import "fmt" +func main() { + fmt.Println("Hello") + fmt.Println("World") +}`; + + const diffText = `--- original.go ++++ updated.go +@@ -1,8 +1,11 @@ + package main + +-import "fmt" ++import ( ++ "fmt" ++ "time" ++) + + func main() { +- fmt.Println("Hello") ++ fmt.Printf("The time is: %v\\n", time.Now()) +- fmt.Println("World") ++ fmt.Println("Goodbye!") + }`; + const result = applyUnifiedDiff(sourceCode, diffText); + + const expected = [ + { type: "same", line: "package main" }, + { type: "same", line: "" }, + { type: "old", line: "import \"fmt\"" }, + { type: "new", line: "import (" }, + { type: "new", line: " \"fmt\"" }, + { type: "new", line: " \"time\"" }, + { type: "new", line: ")" }, + { type: "same", line: "" }, + { type: "same", line: "func main() {" }, + { type: "old", line: " fmt.Println(\"Hello\")" }, + { type: "new", line: " fmt.Printf(\"The time is: %v\\n\", time.Now())" }, + { type: "old", line: " fmt.Println(\"World\")" }, + { type: "new", line: " fmt.Println(\"Goodbye!\")" }, + { type: "same", line: "}" } + ]; + + expect(result).toEqual(expected); + }); + + it("should correctly apply multiple diff blocks", () => { + const sourceCode = `package main +import ( + "bufio" + "fmt" + "math" + "os" + "strconv" + "strings" + "testing" +) +func main() { + scanner := bufio.NewScanner(os.Stdin) + fmt.Println("Calculator started! Available operations:") + fmt.Println(" + : Addition") + fmt.Println(" - : Subtraction") + fmt.Println(" * : Multiplication") + fmt.Println(" / : Division") + fmt.Println(" ^ : Power") + fmt.Println(" √ : Square root (use only one number)") + for { + fmt.Print("Enter calculation (e.g., 5 + 3 or √ 16) or 'q' to quit: ") + scanner.Scan() + input := scanner.Text() + if strings.ToLower(input) == "q" { + fmt.Println("Goodbye!") + break + } + result, err := calculate(input) + if err != nil { + fmt.Printf("Error: %v\n", err) + continue + } + fmt.Printf("Result: %v\n", result) + } +} +func calculate(input string) (float64, error) { + parts := strings.Fields(input) + if len(parts) < 2 { + return 0, fmt.Errorf("invalid input format: please use 'number operator number' or '√ number'") + } + if parts[0] == "√" { + if len(parts) != 2 { + return 0, fmt.Errorf("square root operation requires exactly one number") + } + num, err := strconv.ParseFloat(parts[1], 64) + if err != nil { + return 0, fmt.Errorf("invalid number for square root: %v", err) + } + if num < 0 { + return 0, fmt.Errorf("cannot calculate square root of a negative number") + } + return math.Sqrt(num), nil + } + if len(parts) != 3 { + return 0, fmt.Errorf("invalid input format: please use 'number operator number'") + } + num1, err := strconv.ParseFloat(parts[0], 64) + if err != nil { + return 0, fmt.Errorf("invalid first number: %v", err) + } + operator := parts[1] + num2, err := strconv.ParseFloat(parts[2], 64) + if err != nil { + return 0, fmt.Errorf("invalid second number: %v", err) + } + switch operator { + case "+": + return num1 + num2, nil + case "-": + return num1 - num2, nil + case "*": + return num1 * num2, nil + case "/": + if num2 == 0 { + return 0, fmt.Errorf("division by zero is not allowed") + } + return num1 / num2, nil + case "^": + return math.Pow(num1, num2), nil + default: + return 0, fmt.Errorf("invalid operator: must be +, -, *, /, ^, or √") + } +} +func TestCalculate(t *testing.T) { + tests := []struct { + input string + expected float64 + hasError bool + }{ + {"2 + 3", 5, false}, + {"10 - 5", 5, false}, + {"4 * 3", 12, false}, + {"15 / 3", 5, false}, + {"2 ^ 3", 8, false}, + {"√ 16", 4, false}, + {"2 + a", 0, true}, + {"15 / 0", 0, true}, + {"√ -4", 0, true}, + {"3 $ 4", 0, true}, + {"", 0, true}, + {"1", 0, true}, + {"1 +", 0, true}, + {"+ 1", 0, true}, + {"√ 2 3", 0, true}, + } + for _, test := range tests { + result, err := calculate(test.input) + if test.hasError && err == nil { + t.Errorf("Expected error for input '%s', but got none", test.input) + continue + } + if !test.hasError && err != nil { + t.Errorf("Unexpected error for input '%s': %v", test.input, err) + continue + } + if !test.hasError && result != test.expected { + t.Errorf("For input '%s': expected %f, but got %f", test.input, test.expected, result) + } + } +} +func TestSpecialCases(t *testing.T) { + result, err := calculate("2.5 + 2.5") + if err != nil { + t.Errorf("Unexpected error for floating point addition: %v", err) + } + if result != 5.0 { + t.Errorf("Floating point addition failed: expected 5.0, got %f", result) + } + result, err = calculate("2.5 ^ 2") + if err != nil { + t.Errorf("Unexpected error for power operation: %v", err) + } + expected := 6.25 + if math.Abs(result-expected) > 0.0001 { + t.Errorf("Power operation failed: expected %f, got %f", expected, result) + } + result, err = calculate("√ 2") + if err != nil { + t.Errorf("Unexpected error for square root: %v", err) + } + expected = math.Sqrt(2) + if math.Abs(result-expected) > 0.0001 { + t.Errorf("Square root operation failed: expected %f, got %f", expected, result) + } +} +func TestLargeNumbers(t *testing.T) { + result, err := calculate("1000000000 + 1000000000") + if err != nil { + t.Errorf("Unexpected error for adding large numbers: %v", err) + } + if result != 2000000000 { + t.Errorf("Adding large numbers failed: expected 2000000000, got %f", result) + } + result, err = calculate("1000000 * 1000000") + if err != nil { + t.Errorf("Unexpected error for multiplying large numbers: %v", err) + } + if result != 1000000000000 { + t.Errorf("Multiplying large numbers failed: expected 1000000000000, got %f", result) + } + result, err = calculate("2 ^ 30") + if err != nil { + t.Errorf("Unexpected error for large exponent operation: %v", err) + } + expected := math.Pow(2, 30) + if result != expected { + t.Errorf("Power operation with large exponent failed: expected %f, got %f", expected, result) + } + result, err = calculate("1000000000000 / 1000000") + if err != nil { + t.Errorf("Unexpected error for dividing large numbers: %v", err) + } + if result != 1000000 { + t.Errorf("Dividing large numbers failed: expected 1000000, got %f", result) + } +}`; + + const diffText = `--- original.go ++++ updated.go +@@ -30,6 +30,7 @@ + fmt.Println(" / : Division") + fmt.Println(" ^ : Power") + fmt.Println(" √ : Square root (use only one number)") ++ fmt.Println(" log: Logarithm (use 'log base number')") ++ fmt.Println(" Base must be > 0 and != 1, number must be > 0") + for { + fmt.Print("Enter calculation (e.g., 5 + 3 or √ 16) or 'q' to quit: ") +@@ -73,6 +74,8 @@ + } + return math.Sqrt(num), nil + } ++ ++ // Handle logarithmic operations ++ if parts[0] == "log" { ++ if len(parts) != 3 { ++ return 0, fmt.Errorf("logarithm operation requires exactly two arguments: 'log base number'") ++ } ++ base, err := strconv.ParseFloat(parts[1], 64) ++ if err != nil || base <= 0 || base == 1 { ++ return 0, fmt.Errorf("invalid base for logarithm: must be > 0 and != 1") ++ } ++ num, err := strconv.ParseFloat(parts[2], 64) ++ if err != nil || num <= 0 { ++ return 0, fmt.Errorf("invalid number for logarithm: must be > 0") ++ } ++ return math.Log(num) / math.Log(base), nil ++ } ++ + if len(parts) != 3 { + return 0, fmt.Errorf("invalid input format: please use 'number operator number'") +@@ -155,6 +158,15 @@ + } + } + } ++ ++func TestLogarithmicCases(t *testing.T) { ++ tests := []struct { ++ input string ++ expected float64 ++ hasError bool ++ }{ ++ {"log 2 8", 3, false}, ++ {"log 10 100", 2, false}, ++ {"log 10 -5", 0, true}, ++ {"log 1 100", 0, true}, ++ {"log 0.5 0.25", 2, false}, ++ }`; + const result = applyUnifiedDiff(sourceCode, diffText); + + expect(result[0].line).toEqual("package main"); + // 1st block + expect(result[21].line).toEqual(" fmt.Println(\" log: Logarithm (use 'log base number')\")"); + expect(result[22].line).toEqual(" fmt.Println(\" Base must be > 0 and != 1, number must be > 0\")"); + // 2nd block + expect(result[60]).toEqual({type: "same", line: "\t}"}); + expect(result[61]).toEqual({type: "new", line: "\t"}); + expect(result[62]).toEqual({type: "new", line: "\t// Handle logarithmic operations"}); + expect(result[77]).toEqual({type: "new", line: ""}); + expect(result[78]).toEqual({type: "same", line: "\tif len(parts) != 3 {"}); + // 3rd block + expect(result[145]).toEqual({type: "same", line: "}"}); + expect(result[146]).toEqual({type: "new", line: ""}); + expect(result[147]).toEqual({type: "new", line: "func TestLogarithmicCases(t *testing.T) {"}); + expect(result[158]).toEqual({type: "new", line: "\t}"}); + expect(result[159]).toEqual({type: "same", line: ""}); + expect(result[160]).toEqual({type: "same", line: "func TestSpecialCases(t *testing.T) {"}); + + }); + + it("should throw error when hunk cannot be matched to source", () => { + const sourceCode = `line1 +line2 +line3`; + + const diffText = `--- a.txt ++++ b.txt +@@ -1,3 +1,4 @@ +missing1 +-missing2 ++newline2 +missing3`; + + expect(() => applyUnifiedDiff(sourceCode, diffText)) + .toThrow("Hunk could not be applied cleanly to source code."); + }); +}); diff --git a/core/edit/lazy/unifiedDiffApply.ts b/core/edit/lazy/unifiedDiffApply.ts new file mode 100644 index 000000000..c5768f1d4 --- /dev/null +++ b/core/edit/lazy/unifiedDiffApply.ts @@ -0,0 +1,152 @@ +import { DiffLine } from "../../index"; + +/** + * Checks if a string matches unified diff format by validating: + * 1. Has at least one hunk header (@@ -n,m +n,m @@) + * 2. Contains valid diff content lines (starting with +, -, or space) which are not header lines + */ +export function isUnifiedDiffFormat(diff: string): boolean { + const lines = diff.trim().split("\n"); + + if (lines.length < 3) {return false;} + + let hasHunkHeader = false; + let hasValidContent = false; + + for (const line of lines) { + if (line.startsWith("---") || line.startsWith("+++")) { + // ignore file headers - they are not required or useful + } else if (line.match(/^@@ -\d+,?\d* \+\d+,?\d* @@/)) { + hasHunkHeader = true; + } else if (line.match(/^[+ -]/) || line === "") { + hasValidContent = true; + } + } + + return hasHunkHeader && hasValidContent; +} + +function extractBeforeLines(hunkLines: string[]): string[] { + return hunkLines + .filter((line) => line.startsWith("-") || !line.startsWith("+")) + .map((line) => line.substring(1)); +} + +/** + * Applies a unified diff to source code and returns an array of DiffLine objects. + * Each DiffLine contains a type ("same", "new", or "old") and the line content. + * + * @throws Error if the diff cannot be cleanly applied to the source + */ +export function applyUnifiedDiff(sourceCode: string, unifiedDiffText: string): DiffLine[] { + const sourceLines = sourceCode.split(/\r?\n/); + const hunks = parseUnifiedDiff(unifiedDiffText); + const diffResult: DiffLine[] = []; + let currentPos = 0; // pointer in sourceLines + + for (const hunk of hunks) { + const hunkBeforeLines = extractBeforeLines(hunk.lines); + const hunkStart = findHunkInSource(sourceLines, hunkBeforeLines, currentPos); + if (hunkStart === -1) { + // All hunks must be found in the source code. If not, throw an error. + throw new Error("Hunk could not be applied cleanly to source code."); + } + + // Emit any unchanged lines that come before this hunk. + for (let i = currentPos; i < hunkStart; i++) { + diffResult.push({ type: "same", line: sourceLines[i] }); + } + let hunkSourcePos = hunkStart; + + for (const dline of hunk.lines) { + const srcLine = sourceLines[hunkSourcePos]; + if (dline.startsWith("+")) { + // Insertion: output new line (strip the '+' marker) + diffResult.push({ type: "new", line: dline.substring(1) }); + } else if (dline.startsWith("-")) { + // Removal: output the removed (old) line and advance the pointer. + diffResult.push({ type: "old", line: srcLine }); + hunkSourcePos++; + } else { + // Context line: use the source line (in case the diff’s context has a minor whitespace error) + // and advance the pointer. + diffResult.push({ type: "same", line: srcLine }); + hunkSourcePos++; + } + } + currentPos = hunkSourcePos; + } + + for (let i = currentPos; i < sourceLines.length; i++) { + diffResult.push({ type: "same", line: sourceLines[i] }); + } + return diffResult; +} + +interface Hunk { + lines: string[]; +} + +/** + * Parses a unified diff string into an array of hunks. + * It skips the file header lines (starting with "---" or "+++") and hunk header lines (starting with "@@"), + * then collects the remaining lines (which may start with '+' or '-' or have no prefix). + */ +function parseUnifiedDiff(diffText: string): Hunk[] { + const lines = diffText.split(/\r?\n/); + const hunks: Hunk[] = []; + let currentHunk: Hunk | null = null; + + for (const line of lines) { + if (line.startsWith("---") || line.startsWith("+++")) { + // Skip file header lines. + continue; + } + if (line.startsWith("@@")) { + if (currentHunk) { + hunks.push(currentHunk); + } + currentHunk = { lines: [] }; + continue; + } + currentHunk?.lines.push(line); + } + if (currentHunk) { + hunks.push(currentHunk); + } + return hunks; +} + +/** + * Searches for an occurrence of the block of lines (the “before” block) in sourceLines, + * starting at startIndex. Comparison is done by checking if the lines are exactly equal, + * or if their trimmed versions are equal. + * + * Returns the index in sourceLines where the block begins, or -1 if no match is found. + */ +function findHunkInSource(sourceLines: string[], hunkBeforeLines: string[], startIndex: number): number { + for (let i = startIndex; i <= sourceLines.length - hunkBeforeLines.length; i++) { + let match = true; + for (let j = 0; j < hunkBeforeLines.length; j++) { + const sl = sourceLines[i + j]; + const hl = hunkBeforeLines[j]; + if (!linesMatch(sl, hl)) { + match = false; + break; + } + } + if (match) { + return i; + } + } + return -1; +} + +/** + * Returns true if the two lines are either exactly equal or equal after trimming whitespace and tabs. + */ +function linesMatch(a: string, b: string): boolean { + const trimmedA = a.replace(/^\s+/, ""); + const trimmedB = b.replace(/^\s+/, ""); + return trimmedA === trimmedB; +} diff --git a/docs/docs/edit/how-to-use-it.md b/docs/docs/edit/how-to-use-it.md index 850c34b60..19f8e0ccd 100644 --- a/docs/docs/edit/how-to-use-it.md +++ b/docs/docs/edit/how-to-use-it.md @@ -35,3 +35,10 @@ You can navigate through each proposed change, accepting or rejecting them using You can also accept or reject all changes at once using cmd/ctrl + shift + enter (to accept) or cmd/ctrl + shift + delete/backspace (to reject). If you want to request a new suggestion for the same highlighted code section, you can use cmd/ctrl + i to re-prompt the model. + +## Instant Diff Apply + +If you have large files (exeeding the output token of your model) the edit apply will delete all lines that exceed the model window. To mitigate you can instead of applying the changes directly, ask the chat LLM to "generate a unified diff". +The resulting diff (if the LLM has not made a mistake) can be instantly applied, changing only the lines that need to change. + +Explainer Video: https://youtu.be/b7Xxsot4gyw \ No newline at end of file From f23d825d4d7ec10ad56d27961c55b8c98465db04 Mon Sep 17 00:00:00 2001 From: Luke Lashley Date: Tue, 18 Feb 2025 15:23:47 -0500 Subject: [PATCH 008/319] some extra embedding improvements --- core/llm/llms/VertexAI.ts | 9 ++++++++- extensions/vscode/config_schema.json | 6 +++--- packages/llm-info/src/providers/vertexai.ts | 12 ++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index fc6c53fae..9f52d3c6c 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -16,7 +16,7 @@ class VertexAI extends BaseLLM { declare geminiInstance: Gemini; static defaultOptions: Partial | undefined = { - maxEmbeddingBatchSize: 5, + maxEmbeddingBatchSize: 250, region: "us-central1", }; @@ -35,6 +35,13 @@ class VertexAI extends BaseLLM { } constructor(_options: LLMOptions) { + if (_options.region !== "us-central1") { + // Any region outside of us-central1 has a max batch size of 5. + _options.maxEmbeddingBatchSize = Math.min( + _options.maxEmbeddingBatchSize ?? 5, + 5, + ); + } super(_options); this.apiBase ??= VertexAI.getDefaultApiBaseFrom(_options); this.vertexProvider = diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index d9dab076b..104933472 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -2857,11 +2857,11 @@ "description": "The name of your VertexAI project" }, "region": { - "description": "The region your VertexAI model is hosted in - typically central1", - "default": "central1" + "description": "The region your VertexAI model is hosted in - typically us-central1", + "default": "us-central1" }, "model": { - "default": "text-embedding-004" + "default": "text-embedding-005" } }, "required": ["projectId", "model", "region"] diff --git a/packages/llm-info/src/providers/vertexai.ts b/packages/llm-info/src/providers/vertexai.ts index e9514bc25..6f7d24657 100644 --- a/packages/llm-info/src/providers/vertexai.ts +++ b/packages/llm-info/src/providers/vertexai.ts @@ -21,17 +21,17 @@ export const Gemini: ModelProvider = { }, // embed { - model: "text-embedding-004", + model: "text-embedding-005", displayName: "Vertex Text Embedding", recommendedFor: ["embed"], }, //autocomplete { - model: "code-gecko", - displayName: "VertexAI Code Gecko", - recommendedFor: ["autocomplete"], - maxCompletionTokens: 64, - } + model: "code-gecko", + displayName: "VertexAI Code Gecko", + recommendedFor: ["autocomplete"], + maxCompletionTokens: 64, + }, ], id: "gemini", displayName: "Gemini", From 74991cc333b6c565e5c885ee53b485b9bd51d33c Mon Sep 17 00:00:00 2001 From: Luke Lashley Date: Tue, 18 Feb 2025 15:49:08 -0500 Subject: [PATCH 009/319] fix docs --- docs/docs/customize/model-providers/top-level/vertexai.md | 4 ++-- .../current/customize/model-providers/top-level/vertexai.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/customize/model-providers/top-level/vertexai.md b/docs/docs/customize/model-providers/top-level/vertexai.md index 50958cae0..f22fe7a9d 100644 --- a/docs/docs/customize/model-providers/top-level/vertexai.md +++ b/docs/docs/customize/model-providers/top-level/vertexai.md @@ -45,13 +45,13 @@ We recommend configuring **Codestral** or **code-gecko** as your autocomplete mo ## Embeddings model -We recommend configuring **text-embedding-004** as your embeddings model. +We recommend configuring **text-embedding-005** as your embeddings model. ```json title="config.json" { "embeddingsProvider": { "provider": "vertexai", - "model": "text-embedding-004", + "model": "text-embedding-005", "projectId": "[PROJECT_ID]", "region": "us-central1" } diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md index daf966d9e..974ac69b8 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/top-level/vertexai.md @@ -45,13 +45,13 @@ We recommend configuring **Codestral** or **code-gecko** as your autocomplete mo ## Embeddings model -We recommend configuring **text-embedding-004** as your embeddings model. +We recommend configuring **text-embedding-005** as your embeddings model. ```json title="config.json" { "embeddingsProvider": { "provider": "vertexai", - "model": "text-embedding-004", + "model": "text-embedding-005", "projectId": "[PROJECT_ID]", "region": "us-central1" } From 4136ff5226423d5a332ecfa07392542647461d30 Mon Sep 17 00:00:00 2001 From: Luke Lashley Date: Tue, 18 Feb 2025 16:05:00 -0500 Subject: [PATCH 010/319] Chunk user's queries --- core/indexing/LanceDbIndex.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index d11feb1d1..149aca512 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -14,6 +14,7 @@ import { import { getLanceDbPath, migrate } from "../util/paths.js"; import { chunkDocument, shouldChunk } from "./chunk/chunk.js"; +import { basicChunker } from "./chunk/basic.js"; import { DatabaseConnection, SqliteDb, tagToString } from "./refreshIndex.js"; import { CodebaseIndex, @@ -436,7 +437,23 @@ export class LanceDbIndex implements CodebaseIndex { tags: BranchAndDir[], filterDirectory: string | undefined, ): Promise { - const [vector] = await this.embeddingsProvider.embed([query]); + const chunks = []; + for await (const chunk of basicChunker( + query, + this.embeddingsProvider.maxEmbeddingChunkSize, + )) { + chunks.push(chunk); + } + let vector = null; + try { + [vector] = await this.embeddingsProvider.embed( + chunks.map((c) => c.content), + ); + } catch (err) { + // If we fail to chunk, we just use what was happening before. + [vector] = await this.embeddingsProvider.embed([query]); + } + const db = await lance.connect(getLanceDbPath()); let allResults = []; From 2869cf50781317eddf55dde8248a247953f53d99 Mon Sep 17 00:00:00 2001 From: lkyu <67578466+lkyu-ly@users.noreply.github.com> Date: Thu, 20 Feb 2025 01:07:24 +0800 Subject: [PATCH 011/319] Update domain in docusaurus.config.js Change site url from `continue.dev` to `docs.continue.dev` so as to generate a correct sitemap. --- docs/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index c97113a0a..0ca029806 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -19,7 +19,7 @@ const config = { favicon: "img/favicon.ico", // Set the production url of your site here - url: "https://continue.dev", + url: "https://docs.continue.dev", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: "/", From 3e85ea05e9a71341f04fdaaf12bdf5ce580d1c09 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Feb 2025 11:28:26 -0500 Subject: [PATCH 012/319] Fix codestral --- core/llm/llms/VertexAI.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index 9f52d3c6c..0e0910330 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -263,7 +263,9 @@ class VertexAI extends BaseLLM { }); for await (const chunk of streamSse(response)) { - yield chunk.choices[0].delta.content; + if (chunk.choices?.[0].delta) { + yield chunk.choices[0].delta.content; + } } } @@ -358,7 +360,7 @@ class VertexAI extends BaseLLM { } supportsFim(): boolean { - return ["code-gecko", "codestral-latest"].includes(this.model); + return this.model.includes("code-gecko") || this.model.includes("codestral"); } protected async _embed(chunks: string[]): Promise { From 4e392852319c888eaa744c35acf4e49c1ca9a818 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 20 Feb 2025 11:29:31 -0500 Subject: [PATCH 013/319] format --- core/llm/llms/VertexAI.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index 0e0910330..8ef09d107 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -360,7 +360,9 @@ class VertexAI extends BaseLLM { } supportsFim(): boolean { - return this.model.includes("code-gecko") || this.model.includes("codestral"); + return ( + this.model.includes("code-gecko") || this.model.includes("codestral") + ); } protected async _embed(chunks: string[]): Promise { From 17dbfe6bfd38f67b7cb535da00fa626cdaf4f690 Mon Sep 17 00:00:00 2001 From: Aplulu Date: Fri, 21 Feb 2025 02:49:36 +0900 Subject: [PATCH 014/319] fix: Resolve proxy error when adding Azure OpenAI model --- packages/openai-adapters/src/apis/AzureOpenAI.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/openai-adapters/src/apis/AzureOpenAI.ts b/packages/openai-adapters/src/apis/AzureOpenAI.ts index 2b02af69d..fc9fbdda8 100644 --- a/packages/openai-adapters/src/apis/AzureOpenAI.ts +++ b/packages/openai-adapters/src/apis/AzureOpenAI.ts @@ -40,8 +40,10 @@ export class AzureOpenAIApi implements BaseLlmApi { if (PROXY) { const url = new URL(PROXY); proxyOptions = { - host: url.hostname, - port: Number(url.port), + host: (url.protocol ? url.protocol + "//" : "") + url.hostname, + port: Number(url.port || 80), + username: url.username, + password: url.password, }; } From ad73f4eaa58bfde4d710d8a276d08db6ea4891d1 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Fri, 21 Feb 2025 17:59:56 +0100 Subject: [PATCH 015/319] modify condition to ignore non-file URIs in RecentlyEditedTracker --- extensions/vscode/src/autocomplete/recentlyEdited.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/vscode/src/autocomplete/recentlyEdited.ts b/extensions/vscode/src/autocomplete/recentlyEdited.ts index 69b9b4d0f..d32f362dd 100644 --- a/extensions/vscode/src/autocomplete/recentlyEdited.ts +++ b/extensions/vscode/src/autocomplete/recentlyEdited.ts @@ -47,7 +47,7 @@ export class RecentlyEditedTracker { editedRange: Omit, ): Promise { - if (editedRange.uri.scheme === "output") { + if (editedRange.uri.scheme !== "file") { return; } @@ -83,7 +83,6 @@ export class RecentlyEditedTracker { RecentlyEditedTracker.maxRecentlyEditedRanges, ); } - } private insertDocument(uri: vscode.Uri): void { From 15e93dd5d0dc3b5dcd00504833beacbddbfe44f3 Mon Sep 17 00:00:00 2001 From: Ingo Eichhorst Date: Sun, 23 Feb 2025 13:16:50 +0100 Subject: [PATCH 016/319] fix: fixed misallignment in tests caused by linter --- core/edit/lazy/unifiedDiffApply.test.ts | 31 ++++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/core/edit/lazy/unifiedDiffApply.test.ts b/core/edit/lazy/unifiedDiffApply.test.ts index c7a5a8370..f0eae9b64 100644 --- a/core/edit/lazy/unifiedDiffApply.test.ts +++ b/core/edit/lazy/unifiedDiffApply.test.ts @@ -46,8 +46,10 @@ describe("isUnifiedDiffFormat", () => { it("should return true in case of empty lines", () => { const diffWithoutFileHeaders = `@@ -1,3 +1,4 @@ line1 + -line2 +newline2 + line3`; expect(isUnifiedDiffFormat(diffWithoutFileHeaders)).toBe(true); }); @@ -98,7 +100,9 @@ describe("applyUnifiedDiff", () => { it("should correctly apply multiple insertions and deletions", () => { const sourceCode = `package main + import "fmt" + func main() { fmt.Println("Hello") fmt.Println("World") @@ -375,22 +379,21 @@ func TestLargeNumbers(t *testing.T) { expect(result[0].line).toEqual("package main"); // 1st block - expect(result[21].line).toEqual(" fmt.Println(\" log: Logarithm (use 'log base number')\")"); - expect(result[22].line).toEqual(" fmt.Println(\" Base must be > 0 and != 1, number must be > 0\")"); + expect(result[18].line).toEqual("\tfmt.Println(\" √ : Square root (use only one number)\")"); + expect(result[19].line).toEqual(" fmt.Println(\" log: Logarithm (use 'log base number')\")"); + expect(result[20].line).toEqual(" fmt.Println(\" Base must be > 0 and != 1, number must be > 0\")"); // 2nd block - expect(result[60]).toEqual({type: "same", line: "\t}"}); - expect(result[61]).toEqual({type: "new", line: "\t"}); - expect(result[62]).toEqual({type: "new", line: "\t// Handle logarithmic operations"}); - expect(result[77]).toEqual({type: "new", line: ""}); - expect(result[78]).toEqual({type: "same", line: "\tif len(parts) != 3 {"}); + expect(result[56]).toEqual({type: "same", line: "\t}"}); + expect(result[57]).toEqual({type: "new", line: "\t"}); + expect(result[58]).toEqual({type: "new", line: "\t// Handle logarithmic operations"}); + expect(result[73]).toEqual({type: "new", line: ""}); + expect(result[74]).toEqual({type: "same", line: "\tif len(parts) != 3 {"}); // 3rd block - expect(result[145]).toEqual({type: "same", line: "}"}); - expect(result[146]).toEqual({type: "new", line: ""}); - expect(result[147]).toEqual({type: "new", line: "func TestLogarithmicCases(t *testing.T) {"}); - expect(result[158]).toEqual({type: "new", line: "\t}"}); - expect(result[159]).toEqual({type: "same", line: ""}); - expect(result[160]).toEqual({type: "same", line: "func TestSpecialCases(t *testing.T) {"}); - + expect(result[140]).toEqual({type: "same", line: "}"}); + expect(result[141]).toEqual({type: "new", line: ""}); + expect(result[142]).toEqual({type: "new", line: "func TestLogarithmicCases(t *testing.T) {"}); + expect(result[153]).toEqual({type: "new", line: "\t}"}); + expect(result[154]).toEqual({type: "same", line: "func TestSpecialCases(t *testing.T) {"}); }); it("should throw error when hunk cannot be matched to source", () => { From 1a58c582ce45b12b17dba2126e0a7efac498afe4 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 24 Feb 2025 18:52:47 -0800 Subject: [PATCH 017/319] add schema: v1 --- core/config/yaml/convertFromJson.ts | 3 ++- core/config/yaml/default.ts | 2 ++ extensions/vscode/e2e/test-continue-yaml/config.yaml | 1 + packages/config-yaml/test/packages/test-org/assistant.yaml | 1 + .../config-yaml/test/packages/test-org/claude35sonnet.yaml | 1 + packages/config-yaml/test/packages/test-org/docs.yaml | 1 + packages/config-yaml/test/packages/test-org/gemini.yaml | 1 + packages/config-yaml/test/packages/test-org/rules.yaml | 1 + 8 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/config/yaml/convertFromJson.ts b/core/config/yaml/convertFromJson.ts index a989d2631..a27f3f1d2 100644 --- a/core/config/yaml/convertFromJson.ts +++ b/core/config/yaml/convertFromJson.ts @@ -1,4 +1,4 @@ -import { ModelConfig, AssistantUnrolled } from "@continuedev/config-yaml"; +import { AssistantUnrolled, ModelConfig } from "@continuedev/config-yaml"; import { SerializedContinueConfig } from "../.."; @@ -8,6 +8,7 @@ export function convertConfigJsonToConfigYaml( return { name: "Local Config", version: "1.0.0", + schema: "v1", models: [ ...configJson.models.map( (model): ModelConfig => ({ diff --git a/core/config/yaml/default.ts b/core/config/yaml/default.ts index c9ca4dc8e..22d7d0685 100644 --- a/core/config/yaml/default.ts +++ b/core/config/yaml/default.ts @@ -6,6 +6,7 @@ export const defaultConfigYaml: AssistantUnrolled = { context: [], name: "Local Config", version: "1.0.0", + schema: "v1", }; export const defaultConfigYamlJetBrains: AssistantUnrolled = { @@ -13,4 +14,5 @@ export const defaultConfigYamlJetBrains: AssistantUnrolled = { context: [], name: "Local Config", version: "1.0.0", + schema: "v1", }; diff --git a/extensions/vscode/e2e/test-continue-yaml/config.yaml b/extensions/vscode/e2e/test-continue-yaml/config.yaml index 5de426a94..b905443e2 100644 --- a/extensions/vscode/e2e/test-continue-yaml/config.yaml +++ b/extensions/vscode/e2e/test-continue-yaml/config.yaml @@ -1,5 +1,6 @@ name: Test Config version: 0.0.1 +schema: v1 rules: - TEST_SYS_MSG diff --git a/packages/config-yaml/test/packages/test-org/assistant.yaml b/packages/config-yaml/test/packages/test-org/assistant.yaml index 9099af2de..1aaea6a9d 100644 --- a/packages/config-yaml/test/packages/test-org/assistant.yaml +++ b/packages/config-yaml/test/packages/test-org/assistant.yaml @@ -1,5 +1,6 @@ name: Assistant version: 0.0.1 +schema: v1 docs: - uses: test-org/docs diff --git a/packages/config-yaml/test/packages/test-org/claude35sonnet.yaml b/packages/config-yaml/test/packages/test-org/claude35sonnet.yaml index 0eda292d4..049f01f6e 100644 --- a/packages/config-yaml/test/packages/test-org/claude35sonnet.yaml +++ b/packages/config-yaml/test/packages/test-org/claude35sonnet.yaml @@ -1,5 +1,6 @@ name: Claude 3.5 sonnet latest version: 0.0.1 +schema: v1 models: - name: claude-3-5-sonnet-latest diff --git a/packages/config-yaml/test/packages/test-org/docs.yaml b/packages/config-yaml/test/packages/test-org/docs.yaml index 10fa5b631..db2060d9b 100644 --- a/packages/config-yaml/test/packages/test-org/docs.yaml +++ b/packages/config-yaml/test/packages/test-org/docs.yaml @@ -1,5 +1,6 @@ name: Docs version: 0.0.1 +schema: v1 docs: - name: Python diff --git a/packages/config-yaml/test/packages/test-org/gemini.yaml b/packages/config-yaml/test/packages/test-org/gemini.yaml index 6e4ea01b0..516098a35 100644 --- a/packages/config-yaml/test/packages/test-org/gemini.yaml +++ b/packages/config-yaml/test/packages/test-org/gemini.yaml @@ -1,5 +1,6 @@ name: Gemini version: 0.0.1 +schema: v1 models: - name: gemini diff --git a/packages/config-yaml/test/packages/test-org/rules.yaml b/packages/config-yaml/test/packages/test-org/rules.yaml index 4099af2a3..b021f7f25 100644 --- a/packages/config-yaml/test/packages/test-org/rules.yaml +++ b/packages/config-yaml/test/packages/test-org/rules.yaml @@ -1,5 +1,6 @@ name: Rules version: 0.0.1 +schema: v1 rules: - Be kind From ba446bd6335498ae6f07021894874c50b0b95a87 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 24 Feb 2025 19:23:03 -0800 Subject: [PATCH 018/319] add schema in config.yaml docs --- docs/docs/yaml-migration.md | 1 + docs/docs/yaml-reference.md | 38 +++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/docs/docs/yaml-migration.md b/docs/docs/yaml-migration.md index cc603ce1c..91dec946d 100644 --- a/docs/docs/yaml-migration.md +++ b/docs/docs/yaml-migration.md @@ -23,6 +23,7 @@ Give your configuration a `name` and a `version`: ```yaml title="config.yaml" name: my-configuration version: 0.0.1 +schema: v1 ``` ### Models diff --git a/docs/docs/yaml-reference.md b/docs/docs/yaml-reference.md index 427d3e865..d40292e2e 100644 --- a/docs/docs/yaml-reference.md +++ b/docs/docs/yaml-reference.md @@ -264,6 +264,7 @@ Putting it all together, here's a complete example of a `config.yaml` configurat ```yaml title="config.yaml" name: MyProject version: 0.0.1 +schema: v1 models: - name: GPT-4 @@ -331,6 +332,7 @@ a `config.yaml` configuration file using anchors: --- name: MyProject version: 0.0.1 +schema: v1 model_defaults: &model_defaults provider: openai @@ -338,26 +340,26 @@ model_defaults: &model_defaults apiBase: https://api.example.com/llm models: -- name: mistral - <<: *model_defaults - model: mistral-7b-instruct - roles: - - chat - - edit + - name: mistral + <<: *model_defaults + model: mistral-7b-instruct + roles: + - chat + - edit -- name: qwen2.5-coder-7b-instruct - <<: *model_defaults - model: qwen2.5-coder-7b-instruct - roles: - - chat - - edit + - name: qwen2.5-coder-7b-instruct + <<: *model_defaults + model: qwen2.5-coder-7b-instruct + roles: + - chat + - edit -- name: qwen2.5-coder-7b - <<: *model_defaults - model: qwen2.5-coder-7b - useLegacyCompletionsEndpoint: false - roles: - - autocomplete + - name: qwen2.5-coder-7b + <<: *model_defaults + model: qwen2.5-coder-7b + useLegacyCompletionsEndpoint: false + roles: + - autocomplete ``` ### Fully deprecated settings From 4219a206f2407d170cf75d7abb6a86e0561bc4b8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 25 Feb 2025 15:27:20 -0500 Subject: [PATCH 019/319] When inserting streaming diffs, don't mess up for blank lines There was code of unclear purpose that bailed out early when totalDeletedContent == "" - but "" could either be [].join("\n") or: [""].join("\n") in the latter case, we *do* need to a deletion block. Since the deletionBuffer.length == 0 case is otherwise handled, the code is removed as unnecessary and harmful. --- extensions/vscode/src/diff/vertical/handler.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/extensions/vscode/src/diff/vertical/handler.ts b/extensions/vscode/src/diff/vertical/handler.ts index ced48e03d..5e3bcd45f 100644 --- a/extensions/vscode/src/diff/vertical/handler.ts +++ b/extensions/vscode/src/diff/vertical/handler.ts @@ -86,17 +86,8 @@ export class VerticalDiffHandler implements vscode.Disposable { } private async insertDeletionBuffer() { - // Don't remove trailing whitespace line const totalDeletedContent = this.deletionBuffer.join("\n"); - if ( - totalDeletedContent === "" && - this.currentLineIndex >= this.endLine + this.newLinesAdded && - this.insertedInCurrentBlock === 0 - ) { - return; - } - if (this.deletionBuffer.length || this.insertedInCurrentBlock > 0) { const blocks = this.editorToVerticalDiffCodeLens.get(this.fileUri) || []; From 43bdea273dd9c345420976c597f7af8865f46f8f Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 25 Feb 2025 13:43:16 -0500 Subject: [PATCH 020/319] Fix typo: meyersDiff => myersDiff --- extensions/vscode/src/diff/vertical/handler.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/vscode/src/diff/vertical/handler.ts b/extensions/vscode/src/diff/vertical/handler.ts index 5e3bcd45f..982df41c3 100644 --- a/extensions/vscode/src/diff/vertical/handler.ts +++ b/extensions/vscode/src/diff/vertical/handler.ts @@ -350,7 +350,7 @@ export class VerticalDiffHandler implements vscode.Disposable { // Clear deletion buffer await this.insertDeletionBuffer(); - await this.reapplyWithMeyersDiff(diffLines); + await this.reapplyWithMyersDiff(diffLines); this.options.onStatusUpdate( "done", @@ -473,10 +473,10 @@ export class VerticalDiffHandler implements vscode.Disposable { /** * This method is used to apply diff decorations after the intiial stream. * This is to handle scenarios where we miscalculate the original diff blocks, - * and decide to follow up with a deterministic algorithm like Meyers Diff once + * and decide to follow up with a deterministic algorithm like Myers Diff once * we have received all of the diff lines. */ - async reapplyWithMeyersDiff(diffLines: DiffLine[]) { + async reapplyWithMyersDiff(diffLines: DiffLine[]) { // Diff is messed up without this delay. await new Promise((resolve) => setTimeout(resolve, 100)); @@ -507,11 +507,11 @@ export class VerticalDiffHandler implements vscode.Disposable { const diffs = myersDiff(oldFileContent, newFileContent); - const meyersDiffLines = diffs.map((diff) => diff.line).join("\n"); + const myersDiffLines = diffs.map((diff) => diff.line).join("\n"); // Then, we insert our diff lines await this.editor.edit((editBuilder) => { - editBuilder.replace(this.range, meyersDiffLines), + editBuilder.replace(this.range, myersDiffLines), { undoStopAfter: false, undoStopBefore: false, From 698633815fa2d41c3bdb2358f430a89124e567f8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 25 Feb 2025 15:12:48 -0500 Subject: [PATCH 021/319] reapplyWithMyersDiff(): don't skip trailing blank lines myersDiff inherits the jsdiff behavior for trailing \n, so would consider "foo\n" => "foo" a changed single line, rather than a change from "foo", "" to "foo" - this would result in a trailing blank line in the highlighted region silently vanishing from the buffer. Adding \n to the inputs so that lines are \n terminated rather than separated fixes this. To make myersDiff logically consistent, pass ignoreNewlineAtEof: true to jsdiff. (This is actually not needed for this bug fix.) --- core/diff/myers.test.ts | 12 ++++++++++++ core/diff/myers.ts | 12 ++++++++++-- core/package-lock.json | 11 ++++++----- core/package.json | 2 +- extensions/vscode/src/diff/vertical/handler.ts | 9 +++++++-- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/core/diff/myers.test.ts b/core/diff/myers.test.ts index 2b47fa548..4148424a6 100644 --- a/core/diff/myers.test.ts +++ b/core/diff/myers.test.ts @@ -29,4 +29,16 @@ describe("Test myers diff function", () => { { type: "same", line: "E" }, ]); }); + + test("should ignore newline differences at end", () => { + const linesA = "A\nB\nC\n"; + const linesB = "A\nB\nC"; + + const diffLines = myersDiff(linesA, linesB); + expect(diffLines).toEqual([ + { type: "same", line: "A" }, + { type: "same", line: "B" }, + { type: "same", line: "C" }, + ]); + }); }); diff --git a/core/diff/myers.ts b/core/diff/myers.ts index 22a2fc4e3..41f250195 100644 --- a/core/diff/myers.ts +++ b/core/diff/myers.ts @@ -10,7 +10,7 @@ export function convertMyersChangeToDiffLines(change: Change): DiffLine[] { : "same"; const lines = change.value.split("\n"); - // `diff` package is always adding an extra new line at the end of the array + // Ignore the \n at the end of the final line, if there is one if (lines[lines.length - 1] === "") { lines.pop(); } @@ -18,8 +18,16 @@ export function convertMyersChangeToDiffLines(change: Change): DiffLine[] { return lines.map((line) => ({ type, line })); } +// The interpretation of lines in oldContent and newContent is the same as jsdiff +// Lines are separated by \n, with the exception that a trailing \n does *not* +// represent an empty line. +// +// The default for jsdiff is that "foo" and "foo\n" are *different* single-line +// contents, but we can't represent that: to avoid a diff +// [ { type: "old", line: "foo" }, { type: "new", line: "foo" } ], we +// pass ignoreNewlineAtEof: true. export function myersDiff(oldContent: string, newContent: string): DiffLine[] { - const theirFormat = diffLines(oldContent, newContent); + const theirFormat = diffLines(oldContent, newContent, { ignoreNewlineAtEof: true }); const ourFormat = theirFormat.flatMap(convertMyersChangeToDiffLines); return ourFormat; diff --git a/core/package-lock.json b/core/package-lock.json index b6285e5e2..6f82ed7e9 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -78,7 +78,7 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", - "@types/diff": "^5.2.2", + "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", "@types/jquery": "^3.5.29", @@ -5257,10 +5257,11 @@ "peer": true }, "node_modules/@types/diff": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.3.tgz", - "integrity": "sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==", - "dev": true + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-7.0.1.tgz", + "integrity": "sha512-R/BHQFripuhW6XPXy05hIvXJQdQ4540KnTvEFHSLjXfHYM41liOLKgIJEyYYiQe796xpaMHfe4Uj/p7Uvng2vA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/follow-redirects": { "version": "1.14.4", diff --git a/core/package.json b/core/package.json index 37a5b8a3e..82f635960 100644 --- a/core/package.json +++ b/core/package.json @@ -17,7 +17,7 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", - "@types/diff": "^5.2.2", + "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", "@types/jquery": "^3.5.29", diff --git a/extensions/vscode/src/diff/vertical/handler.ts b/extensions/vscode/src/diff/vertical/handler.ts index 982df41c3..2e90de6e6 100644 --- a/extensions/vscode/src/diff/vertical/handler.ts +++ b/extensions/vscode/src/diff/vertical/handler.ts @@ -495,15 +495,20 @@ export class VerticalDiffHandler implements vscode.Disposable { this.clearDecorations(); // Then, get our old/new file content based on the original lines + // We need the input to be "newline terminated" rather than + // newline separated, because myersDiff() would consider + // ["A"] => "A" and ["A", ""] => "A\n" to be the same single line. + // "A\n" and "A\n\n" are unambiguous. + // const oldFileContent = diffLines .filter((line) => line.type === "same" || line.type === "old") .map((line) => line.line) - .join("\n"); + .join("\n") + "\n"; const newFileContent = diffLines .filter((line) => line.type === "same" || line.type === "new") .map((line) => line.line) - .join("\n"); + .join("\n") + "\n"; const diffs = myersDiff(oldFileContent, newFileContent); From b02e6ba660b493fcd62742dfb2010c90b88a2656 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 27 Feb 2025 11:47:20 -0800 Subject: [PATCH 022/319] fix markdown patch --- .../markdown/utils/patchNestedMarkdown.ts | 68 ++++--------------- 1 file changed, 13 insertions(+), 55 deletions(-) diff --git a/gui/src/components/markdown/utils/patchNestedMarkdown.ts b/gui/src/components/markdown/utils/patchNestedMarkdown.ts index 29b305b26..b8be69ae7 100644 --- a/gui/src/components/markdown/utils/patchNestedMarkdown.ts +++ b/gui/src/components/markdown/utils/patchNestedMarkdown.ts @@ -8,9 +8,8 @@ // TODO support github-specific markdown as well, edge case */ - export const patchNestedMarkdown = (source: string): string => { - if (!source.match(/```(md|markdown)/)) return source; // For performance + if (!source.match(/```(\w+\.(md|markdown))/)) return source; // For performance // const start = Date.now(); let nestCount = 0; const lines = source.split("\n"); @@ -28,9 +27,18 @@ export const patchNestedMarkdown = (source: string): string => { } } else { // Enter the markdown block, start tracking nesting - if (line.startsWith("```md") || line.startsWith("```markdown")) { - nestCount = 1; - lines[i] = lines[i].replace(/```(md|markdown)/, "~~~"); // Replace backticks with tildes + if (line.startsWith("```")) { + const header = line.replaceAll("`", ""); + const file = header.split(" ")[0]; + + if (file) { + const ext = file.split(".").at(-1); + debugger; + if (ext === "md" || ext === "markdown") { + nestCount = 1; + lines[i] = lines[i].replaceAll("`", "~"); // Replace backticks with tildes + } + } } } } @@ -38,53 +46,3 @@ export const patchNestedMarkdown = (source: string): string => { // console.log(`patched in ${Date.now() - start}ms`); return out; }; - -// This version tries to detect if a codeblock without a language specified is a starter codeblock -// It tries again if didn't come back to root nesting, without checking for that ^ -// I didn't use for performance and also because the root nest check doesn't make sense mid-generation - -// export const patchNestedMarkdown = (source: string): string => { -// const start = Date.now(); - -// let attempts = 0; - -// while (attempts <= 2) { -// let nestCount = 0; -// const lines = source.split("\n"); -// const trimmedLines = lines.map((l) => l.trim()); -// for (let i = 0; i < trimmedLines.length; i++) { -// const line = trimmedLines[i]; -// if (nestCount) { -// if (line.match(/^`+$/)) { -// if (attempts === 0 && i !== lines.length && lines[i + 1] !== "") { -// nestCount++; -// continue; -// } -// if (nestCount === 1) lines[i] = "~~~"; -// nestCount--; -// } else if (line.startsWith("```")) { -// // Going into a nested codeblock -// nestCount++; -// } -// } else { -// // Enter the markdown block, start tracking nesting -// if (line.startsWith("```md") || line.startsWith("```markdown")) { -// nestCount = 1; -// lines[i] = lines[i].replace(/^```(md|markdown)/, "~~~"); // Replace backticks with tildes -// } -// } -// } -// if (nestCount === 0) { -// console.log( -// `patch successful in ${Date.now() - start} ms with ${attempts} attempts`, -// ); -// return lines.join("\n"); -// } -// attempts++; -// } - -// console.log( -// `patch failed in ${Date.now() - start} ms with ${attempts} attempts`, -// ); -// return source; -// }; From e2e8e3990a40fe4ff49d8ce6ac21f1a85e1f5b62 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 27 Feb 2025 11:49:01 -0800 Subject: [PATCH 023/319] cleanup --- gui/src/components/markdown/utils/patchNestedMarkdown.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/gui/src/components/markdown/utils/patchNestedMarkdown.ts b/gui/src/components/markdown/utils/patchNestedMarkdown.ts index b8be69ae7..10d5af1b2 100644 --- a/gui/src/components/markdown/utils/patchNestedMarkdown.ts +++ b/gui/src/components/markdown/utils/patchNestedMarkdown.ts @@ -33,7 +33,6 @@ export const patchNestedMarkdown = (source: string): string => { if (file) { const ext = file.split(".").at(-1); - debugger; if (ext === "md" || ext === "markdown") { nestCount = 1; lines[i] = lines[i].replaceAll("`", "~"); // Replace backticks with tildes From f013c9e01998113e070b0556f693559b3a66e0ee Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Fri, 28 Feb 2025 11:29:06 +0100 Subject: [PATCH 024/319] Add documentation for processTestCase function in completionTestUtils.ts --- core/autocomplete/util/completionTestUtils.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/autocomplete/util/completionTestUtils.ts b/core/autocomplete/util/completionTestUtils.ts index 414b15627..a686d59e8 100644 --- a/core/autocomplete/util/completionTestUtils.ts +++ b/core/autocomplete/util/completionTestUtils.ts @@ -21,6 +21,34 @@ export interface ProcessedTestCase { }; } +/** + * Transforms human-readable test case into input and expected results. + * + * - `original`: Your original text with |cur| marking where the cursor is before completion, + * and |till| marking where the cursor should be after accepting completion (and this is + * the end of the actual applied completion) + * - `completion`: LLM completion output + * - `appliedCompletion` (optional): part of the LLM completion output that is actually applied + * (written between |cur| and |till| in the original) + * + * For example, you have this line: + * + * console.log(""); + * + * and expect it to be completed this way: + * + * console.log("foo: ", bar); + * + * with your completion coming from LLM being: `'foo: ", bar);'` + * + * Your input to this function should be: + * - original: `'console.log("|cur|"|till|);'` + * - completion: `'foo: ", bar);'` + * - appliedCompletion: `'foo: ", bar'` + * + * Output: input and expected output of {@link core/autocomplete/util/processSingleLineCompletion/processSingleLineCompletion|processSingleLineCompletion()} + * + */ export function processTestCase({ original, completion, From 47a47dac42ee8e025b21d0950bc190dc3206a9fc Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 28 Feb 2025 14:54:23 -0800 Subject: [PATCH 025/319] docs note --- docs/docs/json-reference.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/json-reference.md b/docs/docs/json-reference.md index ba21ccb65..11e92a183 100644 --- a/docs/docs/json-reference.md +++ b/docs/docs/json-reference.md @@ -36,6 +36,7 @@ Each model has specific configuration options tailored to its provider and funct - `engine`: Engine for Azure OpenAI requests. - `capabilities`: Override auto-detected capabilities: - `uploadImage`: Boolean indicating if the model supports image uploads. + - `tools`: Boolean indicating if the model supports tool calls. _(AWS Only)_ From 9bcec293830e8eebfdf918af1b552faade97ed12 Mon Sep 17 00:00:00 2001 From: mq200 Date: Fri, 28 Feb 2025 15:12:10 -0800 Subject: [PATCH 026/319] add watsonx reranker integration --- core/config/load.ts | 9 ++- core/context/allRerankers.ts | 2 + core/control-plane/schema.ts | 4 +- core/llm/llms/WatsonX.ts | 114 +++++++++++++++++++-------- extensions/vscode/config_schema.json | 1 + extensions/vscode/package-lock.json | 4 +- packages/config-types/src/index.ts | 4 +- 7 files changed, 100 insertions(+), 38 deletions(-) diff --git a/core/config/load.ts b/core/config/load.ts index 1d29124d6..b1afacab0 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -512,7 +512,11 @@ async function intermediateToFinalConfig( model: "rerank-2", ...params, }; - return new rerankerClass(llmOptions); + return new rerankerClass(llmOptions, (url: string | URL, init: any) => + fetchwithRequestOptions(url, init, { + ...params?.requestOptions, + }), + ); } return null; } @@ -991,5 +995,6 @@ export { finalToBrowserConfig, intermediateToFinalConfig, loadContinueConfigFromJson, - type BrowserSerializedContinueConfig, + type BrowserSerializedContinueConfig }; + diff --git a/core/context/allRerankers.ts b/core/context/allRerankers.ts index 56aa13474..944a77dbc 100644 --- a/core/context/allRerankers.ts +++ b/core/context/allRerankers.ts @@ -5,12 +5,14 @@ import HuggingFaceTEI from "../llm/llms/HuggingFaceTEI"; import { LLMReranker } from "../llm/llms/llm"; import ContinueProxy from "../llm/llms/stubs/ContinueProxy"; import Voyage from "../llm/llms/Voyage"; +import WatsonX from "../llm/llms/WatsonX"; export const AllRerankers: { [key: string]: any } = { cohere: Cohere, bedrock: Bedrock, llm: LLMReranker, voyage: Voyage, + watsonx: WatsonX, "free-trial": FreeTrial, "huggingface-tei": HuggingFaceTEI, "continue-proxy": ContinueProxy, diff --git a/core/control-plane/schema.ts b/core/control-plane/schema.ts index 9fcdd2219..d29316d5e 100644 --- a/core/control-plane/schema.ts +++ b/core/control-plane/schema.ts @@ -19,6 +19,7 @@ const modelDescriptionSchema = z.object({ "nebius", "siliconflow", "scaleway", + "watsonx" ]), model: z.string(), apiKey: z.string().optional(), @@ -88,6 +89,7 @@ const embeddingsProviderSchema = z.object({ "nebius", "siliconflow", "scaleway", + "watsonx" ]), apiBase: z.string().optional(), apiKey: z.string().optional(), @@ -109,7 +111,7 @@ const embeddingsProviderSchema = z.object({ }); const rerankerSchema = z.object({ - name: z.enum(["cohere", "voyage", "llm"]), + name: z.enum(["cohere", "voyage", "llm", "watsonx"]), params: z.record(z.any()).optional(), }); diff --git a/core/llm/llms/WatsonX.ts b/core/llm/llms/WatsonX.ts index 17c8b1d4b..48b98d399 100644 --- a/core/llm/llms/WatsonX.ts +++ b/core/llm/llms/WatsonX.ts @@ -1,4 +1,4 @@ -import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; +import { ChatMessage, Chunk, CompletionOptions, LLMOptions } from "../../index.js"; import { renderChatMessage } from "../../util/messageContent.js"; import { BaseLLM } from "../index.js"; import { streamResponse } from "../stream.js"; @@ -138,6 +138,26 @@ class WatsonX extends BaseLLM { }; } + protected async getOrFetchWatsonxToken() { + var now = new Date().getTime() / 1000; + if ( + watsonxToken === undefined || + now > watsonxToken.expiration || + watsonxToken.token === undefined + ) { + watsonxToken = await this.getBearerToken(); + } else { + console.log( + `Reusing token (expires in ${ + (watsonxToken.expiration - now) / 60 + } mins)`, + ); + } + if (watsonxToken.token === undefined) { + throw new Error("Something went wrong. Check your credentials, please."); + } + } + protected async _complete( prompt: string, signal: AbortSignal, @@ -174,23 +194,8 @@ class WatsonX extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { - var now = new Date().getTime() / 1000; - if ( - watsonxToken === undefined || - now > watsonxToken.expiration || - watsonxToken.token === undefined - ) { - watsonxToken = await this.getBearerToken(); - } else { - console.log( - `Reusing token (expires in ${ - (watsonxToken.expiration - now) / 60 - } mins)`, - ); - } - if (watsonxToken.token === undefined) { - throw new Error("Something went wrong. Check your credentials, please."); - } + await this.getOrFetchWatsonxToken(); + const stopSequences = options.stop?.slice(0, 6) ?? (options.model?.includes("granite") ? ["Question:"] : []); @@ -267,20 +272,8 @@ class WatsonX extends BaseLLM { } protected async _embed(chunks: string[]): Promise { - var now = new Date().getTime() / 1000; - if ( - watsonxToken === undefined || - now > watsonxToken.expiration || - watsonxToken.token === undefined - ) { - watsonxToken = await this.getBearerToken(); - } else { - console.log( - `Reusing token (expires in ${ - (watsonxToken.expiration - now) / 60 - } mins)`, - ); - } + await this.getOrFetchWatsonxToken(); + const payload: any = { inputs: chunks, parameters: { @@ -318,6 +311,63 @@ class WatsonX extends BaseLLM { } return embeddings.map((e: any) => e.embedding); } + + + async rerank(query: string, chunks: Chunk[]): Promise { + if (!query || !chunks.length) { + throw new Error("Query and chunks must not be empty"); + } + try { + await this.getOrFetchWatsonxToken(); + const payload: any = { + inputs: chunks.map((chunk) => ({ text: chunk.content })), + query: query, + parameters: { + truncate_input_tokens: 500, + return_options: { + top_n: chunks.length + }, + }, + model_id: this.model, + project_id: this.projectId, + }; + const headers = { + "Content-Type": "application/json", + Authorization: `${ + watsonxToken.expiration === -1 ? "ZenApiKey" : "Bearer" + } ${watsonxToken.token}`, + }; + const resp = await this.fetch( + new URL( + `${this.apiBase}/ml/v1/text/rerank?version=${this.apiVersion}`, + ), + { + method: "POST", + body: JSON.stringify(payload), + headers: headers, + }, + ); + + if (!resp.ok) { + throw new Error(`Failed to rerank chunks: ${await resp.text()}`); + } + const data = await resp.json(); + const ranking = data.results; + + if (!ranking) { + throw new Error("Empty response received from Watsonx"); + } + + // Sort results by index to maintain original order + return ranking + .sort((a: any, b: any) => a.index - b.index) + .map((result: any) => result.score); + + } catch (error) { + console.error("Error in WatsonxReranker.rerank:", error); + throw error; + } + } } export default WatsonX; diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index de90cf347..2becae999 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -2843,6 +2843,7 @@ "bedrock", "cohere", "voyage", + "watsonx", "llm", "free-trial", "huggingface-tei" diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 6cf41cadf..9b61f1900 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.0", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.0", + "version": "1.1.2", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index 8a0806d7b..e60b8e79b 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -58,6 +58,7 @@ export const modelDescriptionSchema = z.object({ "continue-proxy", "nebius", "scaleway", + "watsonx" ]), model: z.string(), apiKey: z.string().optional(), @@ -111,6 +112,7 @@ export const embeddingsProviderSchema = z.object({ "continue-proxy", "nebius", "scaleway", + "watsonx" ]), apiBase: z.string().optional(), apiKey: z.string().optional(), @@ -173,7 +175,7 @@ export const contextProviderSchema = z.object({ export type ContextProvider = z.infer; export const rerankerSchema = z.object({ - name: z.enum(["cohere", "voyage", "llm", "continue-proxy"]), + name: z.enum(["cohere", "voyage", "watsonx", "llm", "continue-proxy"]), params: z.record(z.any()).optional(), }); export type Reranker = z.infer; From 44d91ece03f4801c839d19badcd93291bc642f6a Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Sat, 1 Mar 2025 14:13:29 +0100 Subject: [PATCH 027/319] add `ThinkingChatMessage` interface and handle thinking chunks in `BaseLLM` and `Anthropic` classes --- core/index.d.ts | 51 ++++++++++++++++++++++---------------- core/llm/index.ts | 20 +++++++++++++++ core/llm/llms/Anthropic.ts | 21 +++++++++------- 3 files changed, 61 insertions(+), 31 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index 7cbf0e25b..e69fa8ee2 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -43,13 +43,13 @@ export interface IndexingProgressUpdate { desc: string; shouldClearIndexes?: boolean; status: - | "loading" - | "indexing" - | "done" - | "failed" - | "paused" - | "disabled" - | "cancelled"; + | "loading" + | "indexing" + | "done" + | "failed" + | "paused" + | "disabled" + | "cancelled"; debugInfo?: string; } @@ -353,6 +353,12 @@ export interface UserChatMessage { content: MessageContent; } +export interface ThinkingChatMessage { + role: "thinking"; + content: MessageContent; + toolCalls?: ToolCallDelta[]; +} + export interface AssistantChatMessage { role: "assistant"; content: MessageContent; @@ -367,6 +373,7 @@ export interface SystemChatMessage { export type ChatMessage = | UserChatMessage | AssistantChatMessage + | ThinkingChatMessage | SystemChatMessage | ToolResultChatMessage; @@ -675,10 +682,10 @@ export interface IDE { getCurrentFile(): Promise< | undefined | { - isUntitled: boolean; - path: string; - contents: string; - } + isUntitled: boolean; + path: string; + contents: string; + } >; getLastFileSaveTimestamp?(): number; @@ -862,11 +869,11 @@ export interface CustomCommand { export interface Prediction { type: "content"; content: - | string - | { - type: "text"; - text: string; - }[]; + | string + | { + type: "text"; + text: string; + }[]; } export interface ToolExtras { @@ -1204,9 +1211,9 @@ export interface Config { embeddingsProvider?: EmbeddingsProviderDescription | ILLM; /** The model that Continue will use for tab autocompletions. */ tabAutocompleteModel?: - | CustomLLM - | ModelDescription - | (CustomLLM | ModelDescription)[]; + | CustomLLM + | ModelDescription + | (CustomLLM | ModelDescription)[]; /** Options for tab autocomplete */ tabAutocompleteOptions?: Partial; /** UI styles customization */ @@ -1298,9 +1305,9 @@ export type PackageDetailsSuccess = PackageDetails & { export type PackageDocsResult = { packageInfo: ParsedPackageInfo; } & ( - | { error: string; details?: never } - | { details: PackageDetailsSuccess; error?: never } -); + | { error: string; details?: never } + | { details: PackageDetailsSuccess; error?: never } + ); export interface TerminalOptions { reuseTerminal?: boolean; diff --git a/core/llm/index.ts b/core/llm/index.ts index ccbad6699..b08d8b214 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -762,6 +762,7 @@ export abstract class BaseLLM implements ILLM { } } + let thinking = ""; let completion = ""; try { @@ -812,6 +813,13 @@ export abstract class BaseLLM implements ILLM { )) { completion += chunk.content; yield chunk; + completion += chunk.content; + yield chunk; + } + + if (chunk.role === "thinking") { + thinking += chunk.content; + } } } } @@ -823,6 +831,18 @@ export abstract class BaseLLM implements ILLM { this._logTokensGenerated(completionOptions.model, prompt, completion); if (logEnabled && this.writeLog) { + if (thinking) { + await this.writeLog(`Thinking:\n${thinking}\n\n`); + } + /* + TODO: According to: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking + During tool use, you must pass thinking and redacted_thinking blocks back to the API, + and you must include the complete unmodified block back to the API. This is critical + for maintaining the model's reasoning flow and conversation integrity. + + On the other hand, adding thinking and redacted_thinking blocks are ignored on subsequent + requests when not using tools, so it's the simplest option to always add to history. + */ await this.writeLog(`Completion:\n${completion}\n\n`); } diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index dcd13d38e..bdbd67639 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -32,9 +32,9 @@ class Anthropic extends BaseLLM { })), tool_choice: options.toolChoice ? { - type: "tool", - name: options.toolChoice.function.name, - } + type: "tool", + name: options.toolChoice.function.name, + } : undefined, }; @@ -174,12 +174,12 @@ class Anthropic extends BaseLLM { messages: msgs, system: shouldCacheSystemMessage ? [ - { - type: "text", - text: this.systemMessage, - cache_control: { type: "ephemeral" }, - }, - ] + { + type: "text", + text: this.systemMessage, + cache_control: { type: "ephemeral" }, + }, + ] : systemMessage, }), signal, @@ -223,6 +223,9 @@ class Anthropic extends BaseLLM { case "text_delta": yield { role: "assistant", content: value.delta.text }; break; + case "thinking_delta": + yield { role: "thinking", content: value.delta.thinking }; + break; case "input_json_delta": if (!lastToolUseId || !lastToolUseName) { throw new Error("No tool use found"); From 037545fd77e2439afaf09408c12fd7a25dec35a9 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 10:52:38 -0800 Subject: [PATCH 028/319] stale-issue-helper dry run --- .github/workflows/stale-issue-helper.yaml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/stale-issue-helper.yaml diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml new file mode 100644 index 000000000..c6d4c415a --- /dev/null +++ b/.github/workflows/stale-issue-helper.yaml @@ -0,0 +1,25 @@ +name: "Label stale issues and PRs" +on: + schedule: + - cron: "*/5 * * * *" + +jobs: + stale: + runs-on: ubuntu-latest + strategy: + matrix: + assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa] + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: "This issue hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?" + stale-pr-message: "This PR hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?" + days-before-stale: 180 + days-before-close: -1 + days-before-pr-close: -1 + stale-issue-label: "stale" + stale-pr-label: "stale" + debug-only: true + exempt-issue-labels: "needs-triage,no-stale" + exempt-pr-labels: "no-stale,no-stale" + exempt-assignees: ${{ toJSON(fromJSON('["sestinj", "Patrick-Erichsen", "tomasz-stefaniak", "RomneyDa"]').filter(user => user != matrix.assignee)) }} From 3acbc68df82ebfd03ffbd13fdb317cf3c0e0f6df Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 10:53:22 -0800 Subject: [PATCH 029/319] run on push --- .github/workflows/stale-issue-helper.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index c6d4c415a..11c651cd7 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -1,7 +1,10 @@ name: "Label stale issues and PRs" on: + push: + branches: + - nate/stale-issue-helper schedule: - - cron: "*/5 * * * *" + - cron: "30 1 * * *" jobs: stale: From 17e5eb912f640f9cf19ef3d52ed8cfdd72e49a7b Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 11:12:09 -0800 Subject: [PATCH 030/319] use excluded-assignees --- .github/workflows/stale-issue-helper.yaml | 16 +++++++++++++- scripts/getExcludedAssignees.js | 27 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 scripts/getExcludedAssignees.js diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 11c651cd7..4bfc83dee 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -13,6 +13,20 @@ jobs: matrix: assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa] steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + + - name: Compute excluded assignees + id: excluded-assignees + run: | + node ./scripts/getExcludedAssignees.js sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa ${{ matrix.assignee }} + + echo "excluded_assignees=$result" >> $GITHUB_OUTPUT + - uses: actions/stale@v9 with: stale-issue-message: "This issue hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?" @@ -25,4 +39,4 @@ jobs: debug-only: true exempt-issue-labels: "needs-triage,no-stale" exempt-pr-labels: "no-stale,no-stale" - exempt-assignees: ${{ toJSON(fromJSON('["sestinj", "Patrick-Erichsen", "tomasz-stefaniak", "RomneyDa"]').filter(user => user != matrix.assignee)) }} + exempt-assignees: ${{ steps.excluded-assignees.outputs.excluded_assignees }} diff --git a/scripts/getExcludedAssignees.js b/scripts/getExcludedAssignees.js new file mode 100644 index 000000000..e6ac5904c --- /dev/null +++ b/scripts/getExcludedAssignees.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +function removeStringFromList(list, stringToRemove) { + return list.filter((item) => item !== stringToRemove); +} + +function main() { + // Get command line arguments + const args = process.argv.slice(2); + + if (args.length < 2) { + console.error( + "Usage: node script.js ", + ); + process.exit(1); + } + + const list = args[0].split(","); + const stringToRemove = args[1]; + + const result = removeStringFromList(list, stringToRemove); + + // Output the result as comma-separated values + console.log(result.join(",")); +} + +main(); From 22c296867638ff5a149c96a2ae7a128516f8f8c5 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 11:17:55 -0800 Subject: [PATCH 031/319] include only assigned --- .github/workflows/stale-issue-helper.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 4bfc83dee..f2780530f 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -40,3 +40,4 @@ jobs: exempt-issue-labels: "needs-triage,no-stale" exempt-pr-labels: "no-stale,no-stale" exempt-assignees: ${{ steps.excluded-assignees.outputs.excluded_assignees }} + include-only-assigned: true From a6160ce3433427ba5258645290b028a3291540e5 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 11:20:05 -0800 Subject: [PATCH 032/319] fx --- .github/workflows/stale-issue-helper.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index f2780530f..2c5a00b19 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -23,8 +23,9 @@ jobs: - name: Compute excluded assignees id: excluded-assignees run: | - node ./scripts/getExcludedAssignees.js sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa ${{ matrix.assignee }} + result=$(node ./scripts/getExcludedAssignees.js sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa ${{ matrix.assignee }}) + echo "Result: $result" echo "excluded_assignees=$result" >> $GITHUB_OUTPUT - uses: actions/stale@v9 From 0b78baf289283ab73359980d29a3648064220538 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 11:26:54 -0800 Subject: [PATCH 033/319] env --- .github/workflows/stale-issue-helper.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 2c5a00b19..6b8747e8a 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -9,9 +9,11 @@ on: jobs: stale: runs-on: ubuntu-latest + env: + TEAM_MEMBERS: "sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa" strategy: matrix: - assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa] + assignee: ${{ env.TEAM_MEMBERS }} steps: - uses: actions/checkout@v4 @@ -23,7 +25,7 @@ jobs: - name: Compute excluded assignees id: excluded-assignees run: | - result=$(node ./scripts/getExcludedAssignees.js sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa ${{ matrix.assignee }}) + result=$(node ./scripts/getExcludedAssignees.js ${{ env.TEAM_MEMBERS }} ${{ matrix.assignee }}) echo "Result: $result" echo "excluded_assignees=$result" >> $GITHUB_OUTPUT @@ -39,6 +41,6 @@ jobs: stale-pr-label: "stale" debug-only: true exempt-issue-labels: "needs-triage,no-stale" - exempt-pr-labels: "no-stale,no-stale" + exempt-pr-labels: "no-stale" exempt-assignees: ${{ steps.excluded-assignees.outputs.excluded_assignees }} include-only-assigned: true From db35636b71c05e787efc1af35ece6cfd993dd759 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 1 Mar 2025 11:28:02 -0800 Subject: [PATCH 034/319] fix --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 6b8747e8a..891908f7c 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -13,7 +13,7 @@ jobs: TEAM_MEMBERS: "sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa" strategy: matrix: - assignee: ${{ env.TEAM_MEMBERS }} + assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa] steps: - uses: actions/checkout@v4 From 2376ed817a15187ea1e8f2f2545881b4d2788aa4 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sun, 2 Mar 2025 15:51:37 -0800 Subject: [PATCH 035/319] handle URI query params --- core/core.ts | 20 ++++++---- core/index.d.ts | 3 +- core/protocol/coreWebview.ts | 5 ++- extensions/vscode/package.json | 1 + .../vscode/src/extension/VsCodeExtension.ts | 39 ++++++++++++++++++- .../vscode/src/stubs/WorkOsAuthProvider.ts | 13 +++---- extensions/vscode/src/stubs/uriHandler.ts | 10 +++++ gui/src/components/TabBar/TabBar.tsx | 4 -- 8 files changed, 73 insertions(+), 22 deletions(-) create mode 100644 extensions/vscode/src/stubs/uriHandler.ts diff --git a/core/core.ts b/core/core.ts index 6d78ca855..c5b5a064a 100644 --- a/core/core.ts +++ b/core/core.ts @@ -950,15 +950,21 @@ export class Core { }); // - on("didChangeSelectedProfile", (msg) => { - void this.configHandler.setSelectedProfile(msg.data.id); - void this.configHandler.reloadConfig(); + on("didChangeSelectedProfile", async (msg) => { + await this.configHandler.setSelectedProfile(msg.data.id); + await this.configHandler.reloadConfig(); }); - on("didChangeSelectedOrg", (msg) => { - void this.configHandler.setSelectedOrgId(msg.data.id); - void this.configHandler.reloadConfig(); - void this.configHandler.loadAssistantsForSelectedOrg(); + on("didChangeSelectedOrg", async (msg) => { + await this.configHandler.setSelectedOrgId(msg.data.id); + await this.configHandler.loadAssistantsForSelectedOrg(); + if (msg.data.profileId) { + this.invoke("didChangeSelectedProfile", { + id: msg.data.profileId, + }); + } else { + await this.configHandler.reloadConfig(); + } }); on("didChangeControlPlaneSessionInfo", async (msg) => { diff --git a/core/index.d.ts b/core/index.d.ts index 7cbf0e25b..f34a7fbc9 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -920,8 +920,9 @@ export interface BaseCompletionOptions { } export interface ModelCapability { - uploadImage?: boolean; tools?: boolean; + uploadImage?: boolean; + outputImage?: boolean; } export interface ModelDescription { diff --git a/core/protocol/coreWebview.ts b/core/protocol/coreWebview.ts index 67b5919a4..5e71e5f11 100644 --- a/core/protocol/coreWebview.ts +++ b/core/protocol/coreWebview.ts @@ -5,7 +5,10 @@ import { ToWebviewFromIdeOrCoreProtocol } from "./webview.js"; export type ToCoreFromWebviewProtocol = ToCoreFromIdeOrWebviewProtocol & { didChangeSelectedProfile: [{ id: string | null }, void]; - didChangeSelectedOrg: [{ id: string | null }, void]; + didChangeSelectedOrg: [ + { id: string | null; profileId?: string | null }, + void, + ]; }; export type ToWebviewFromCoreProtocol = ToWebviewFromIdeOrCoreProtocol & { didChangeAvailableProfiles: [ diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 366da7ff5..9ee40b4a0 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -52,6 +52,7 @@ "llama" ], "activationEvents": [ + "onUri", "onStartupFinished", "onView:continueGUIView" ], diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index 8953c91a0..814f6be97 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -28,6 +28,7 @@ import { registerAllPromptFilesCompletionProviders } from "../lang-server/prompt import EditDecorationManager from "../quickEdit/EditDecorationManager"; import { QuickEdit } from "../quickEdit/QuickEditQuickPick"; import { setupRemoteConfigSync } from "../stubs/activation"; +import { UriEventHandler } from "../stubs/uriHandler"; import { getControlPlaneSessionInfo, WorkOsAuthProvider, @@ -55,10 +56,11 @@ export class VsCodeExtension { private battery: Battery; private workOsAuthProvider: WorkOsAuthProvider; private fileSearch: FileSearch; + private uriHandler = new UriEventHandler(); constructor(context: vscode.ExtensionContext) { // Register auth provider - this.workOsAuthProvider = new WorkOsAuthProvider(context); + this.workOsAuthProvider = new WorkOsAuthProvider(context, this.uriHandler); this.workOsAuthProvider.refreshSessions(); context.subscriptions.push(this.workOsAuthProvider); @@ -193,6 +195,41 @@ export class VsCodeExtension { ), ); + // Handle uri events + this.uriHandler.event((uri) => { + const queryParams = new URLSearchParams(uri.query); + let profileId = queryParams.get("profile_id"); + let orgId = queryParams.get("org_id"); + + if (orgId) { + if (orgId === "null") { + orgId = null; + } + // In case org id is passed with profile id + // Make sure org is updated before profile is set + if (profileId) { + if (profileId === "null") { + profileId = null; + } + this.core.invoke("didChangeSelectedOrg", { + id: orgId, + profileId, + }); + } else { + this.core.invoke("didChangeSelectedOrg", { + id: orgId, + }); + } + } else if (profileId) { + if (profileId === "null") { + profileId = null; + } + this.core.invoke("didChangeSelectedProfile", { + id: profileId, + }); + } + }); + // Battery this.battery = new Battery(); context.subscriptions.push(this.battery); diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts index 8f0e00c8c..30151d565 100644 --- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts +++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts @@ -15,13 +15,13 @@ import { ExtensionContext, ProgressLocation, Uri, - UriHandler, window, workspace, } from "vscode"; import { PromiseAdapter, promiseFromEvent } from "./promiseUtils"; import { SecretStorage } from "./SecretStorage"; +import { UriEventHandler } from "./uriHandler"; const AUTH_NAME = "Continue"; @@ -35,11 +35,6 @@ const controlPlaneEnv = getControlPlaneEnvSync( const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`; -class UriEventHandler extends EventEmitter implements UriHandler { - public handleUri(uri: Uri) { - this.fire(uri); - } -} // Function to generate a random string of specified length function generateRandomString(length: number): string { const possibleCharacters = @@ -83,13 +78,15 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { string, { promise: Promise; cancel: EventEmitter } >(); - private _uriHandler = new UriEventHandler(); private static EXPIRATION_TIME_MS = 1000 * 60 * 15; // 15 minutes private secretStorage: SecretStorage; - constructor(private readonly context: ExtensionContext) { + constructor( + private readonly context: ExtensionContext, + private readonly _uriHandler: UriEventHandler, + ) { this._disposable = Disposable.from( authentication.registerAuthenticationProvider( controlPlaneEnv.AUTH_TYPE, diff --git a/extensions/vscode/src/stubs/uriHandler.ts b/extensions/vscode/src/stubs/uriHandler.ts new file mode 100644 index 000000000..cc324f856 --- /dev/null +++ b/extensions/vscode/src/stubs/uriHandler.ts @@ -0,0 +1,10 @@ +import * as vscode from "vscode"; + +export class UriEventHandler + extends vscode.EventEmitter + implements vscode.UriHandler +{ + public handleUri(uri: vscode.Uri) { + this.fire(uri); + } +} diff --git a/gui/src/components/TabBar/TabBar.tsx b/gui/src/components/TabBar/TabBar.tsx index 859f6e90c..3b87a23c6 100644 --- a/gui/src/components/TabBar/TabBar.tsx +++ b/gui/src/components/TabBar/TabBar.tsx @@ -155,10 +155,6 @@ export function TabBar() { ); const tabs = useSelector((state: RootState) => state.tabs.tabs); - useEffect(() => { - console.log("session", currentSession); - }, [currentSession.id]); - // Simple UUID generator for our needs const generateId = useCallback(() => { return Date.now().toString(36) + Math.random().toString(36).substring(2); From b6bfb222f94b2528d33579cdff67be011dda8e55 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 19:53:47 -0800 Subject: [PATCH 036/319] auto close --- .github/workflows/stale-issue-helper.yaml | 31 +++-------------------- scripts/getExcludedAssignees.js | 27 -------------------- 2 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 scripts/getExcludedAssignees.js diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 891908f7c..e05e45c40 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -9,38 +9,15 @@ on: jobs: stale: runs-on: ubuntu-latest - env: - TEAM_MEMBERS: "sestinj,Patrick-Erichsen,tomasz-stefaniak,RomneyDa" - strategy: - matrix: - assignee: [sestinj, Patrick-Erichsen, tomasz-stefaniak, RomneyDa] steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Compute excluded assignees - id: excluded-assignees - run: | - result=$(node ./scripts/getExcludedAssignees.js ${{ env.TEAM_MEMBERS }} ${{ matrix.assignee }}) - - echo "Result: $result" - echo "excluded_assignees=$result" >> $GITHUB_OUTPUT - - uses: actions/stale@v9 with: - stale-issue-message: "This issue hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?" - stale-pr-message: "This PR hasn't been updated in a while. @${{ matrix.assignee }} can you take a look?" - days-before-stale: 180 - days-before-close: -1 - days-before-pr-close: -1 + close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we will glady take another look." + stale-issue-message: "It looks like this issue hasn't been updated in 90 days. If there's still no activity after 120 days, it will be closed." + days-before-stale: 90 + days-before-close: 120 stale-issue-label: "stale" stale-pr-label: "stale" debug-only: true exempt-issue-labels: "needs-triage,no-stale" exempt-pr-labels: "no-stale" - exempt-assignees: ${{ steps.excluded-assignees.outputs.excluded_assignees }} - include-only-assigned: true diff --git a/scripts/getExcludedAssignees.js b/scripts/getExcludedAssignees.js deleted file mode 100644 index e6ac5904c..000000000 --- a/scripts/getExcludedAssignees.js +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node - -function removeStringFromList(list, stringToRemove) { - return list.filter((item) => item !== stringToRemove); -} - -function main() { - // Get command line arguments - const args = process.argv.slice(2); - - if (args.length < 2) { - console.error( - "Usage: node script.js ", - ); - process.exit(1); - } - - const list = args[0].split(","); - const stringToRemove = args[1]; - - const result = removeStringFromList(list, stringToRemove); - - // Output the result as comma-separated values - console.log(result.join(",")); -} - -main(); From 2f71a8edf0e8ef9c686ee8db6a41b3cbf7c22051 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 19:55:14 -0800 Subject: [PATCH 037/319] don't close/mark prs stale --- .github/workflows/stale-issue-helper.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index e05e45c40..2e0f0fdcd 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -16,6 +16,8 @@ jobs: stale-issue-message: "It looks like this issue hasn't been updated in 90 days. If there's still no activity after 120 days, it will be closed." days-before-stale: 90 days-before-close: 120 + days-before-pr-stale: -1 + days-before-pr-close: -1 stale-issue-label: "stale" stale-pr-label: "stale" debug-only: true From 567d2f146e6addffd44b849648c39a1b8e0bbd4d Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:00:59 -0800 Subject: [PATCH 038/319] update messages --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 2e0f0fdcd..b5f32c704 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/stale@v9 with: close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we will glady take another look." - stale-issue-message: "It looks like this issue hasn't been updated in 90 days. If there's still no activity after 120 days, it will be closed." + stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." days-before-stale: 90 days-before-close: 120 days-before-pr-stale: -1 From d0b7d1a0e0b4f15562f70a2d6443f6dc83040a09 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:09:58 -0800 Subject: [PATCH 039/319] first round: close issues before 90 days --- .github/workflows/stale-issue-helper.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index b5f32c704..70159939e 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -14,12 +14,11 @@ jobs: with: close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we will glady take another look." stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." - days-before-stale: 90 - days-before-close: 120 + days-before-stale: -1 + days-before-close: 90 days-before-pr-stale: -1 days-before-pr-close: -1 stale-issue-label: "stale" stale-pr-label: "stale" - debug-only: true - exempt-issue-labels: "needs-triage,no-stale" + exempt-issue-labels: "needs-triage,no-stale,high,highest" exempt-pr-labels: "no-stale" From d4e46a946bd8551659aec1cd26c4645fa3e76225 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:18:40 -0800 Subject: [PATCH 040/319] update msg --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 70159939e..4e6e39d3d 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/stale@v9 with: - close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we will glady take another look." + close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we'll gladly take another look!" stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." days-before-stale: -1 days-before-close: 90 From dd9ac81b44213f27eff617c9e70bded6454a39c9 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:19:51 -0800 Subject: [PATCH 041/319] mark stale --- .github/workflows/stale-issue-helper.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 4e6e39d3d..30e1ad773 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -13,8 +13,8 @@ jobs: - uses: actions/stale@v9 with: close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we'll gladly take another look!" - stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." - days-before-stale: -1 + # stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." + days-before-stale: 90 days-before-close: 90 days-before-pr-stale: -1 days-before-pr-close: -1 From d9d79b259ee4969d409b7497362d7038f8b4fc2d Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:22:52 -0800 Subject: [PATCH 042/319] mark stale --- .github/workflows/stale-issue-helper.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 30e1ad773..9df56ba06 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/stale@v9 with: - close-issue-message: "This issue was closed because it hasn't been updated for 120 days. If it's still important, please reopen + comment and we'll gladly take another look!" - # stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after 120 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." + close-issue-message: "This issue was closed because it hasn't been updated for 100 days. If it's still important, please reopen + comment and we'll gladly take another look!" + stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." days-before-stale: 90 - days-before-close: 90 + days-before-close: 100 days-before-pr-stale: -1 days-before-pr-close: -1 stale-issue-label: "stale" From 899c9f5349dd5a5bc97a8177ffbc75715b364ac8 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:24:07 -0800 Subject: [PATCH 043/319] permissions --- .github/workflows/stale-issue-helper.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 9df56ba06..f4f9d46c7 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -8,6 +8,9 @@ on: jobs: stale: + permissions: + issues: write + pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/stale@v9 From 8ac5f1dc213d56cac004459d516cdca7abbfaaae Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:37:54 -0800 Subject: [PATCH 044/319] update name --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index f4f9d46c7..6f4ddd0b3 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -1,4 +1,4 @@ -name: "Label stale issues and PRs" +name: "Label and close stale issues" on: push: branches: From dbfebd5a734fbb661d6e7009e3d31030c6de8445 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:40:28 -0800 Subject: [PATCH 045/319] update close --- .github/workflows/stale-issue-helper.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 6f4ddd0b3..ce58d0933 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/stale@v9 with: - close-issue-message: "This issue was closed because it hasn't been updated for 100 days. If it's still important, please reopen + comment and we'll gladly take another look!" + close-issue-message: "This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!" stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue." days-before-stale: 90 - days-before-close: 100 + days-before-close: 10 days-before-pr-stale: -1 days-before-pr-close: -1 stale-issue-label: "stale" From 937b74f380d5b49f57c71f5cce19f9bf843443ee Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:44:09 -0800 Subject: [PATCH 046/319] update title --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index ce58d0933..38e2a0226 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -1,4 +1,4 @@ -name: "Label and close stale issues" +name: "Label / close stale issues" on: push: branches: From 3fd2685a610cbaf26c624165ee72bbec0551bf7c Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:47:06 -0800 Subject: [PATCH 047/319] increase ops --- .github/workflows/stale-issue-helper.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 38e2a0226..c37a3aa1b 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -21,6 +21,7 @@ jobs: days-before-close: 10 days-before-pr-stale: -1 days-before-pr-close: -1 + operations-per-run: 100 stale-issue-label: "stale" stale-pr-label: "stale" exempt-issue-labels: "needs-triage,no-stale,high,highest" From 75387a18a0cbf710c117f066feaec83d0b36c635 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 20:48:47 -0800 Subject: [PATCH 048/319] increase ops --- .github/workflows/stale-issue-helper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index c37a3aa1b..8f10ebcb5 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -21,7 +21,7 @@ jobs: days-before-close: 10 days-before-pr-stale: -1 days-before-pr-close: -1 - operations-per-run: 100 + operations-per-run: 2000 stale-issue-label: "stale" stale-pr-label: "stale" exempt-issue-labels: "needs-triage,no-stale,high,highest" From 58b5ad94cca789be64e91dad6f5b958d532d501c Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 2 Mar 2025 21:01:19 -0800 Subject: [PATCH 049/319] remove push trigger --- .github/workflows/stale-issue-helper.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/stale-issue-helper.yaml b/.github/workflows/stale-issue-helper.yaml index 8f10ebcb5..067f4c60f 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -1,8 +1,5 @@ name: "Label / close stale issues" on: - push: - branches: - - nate/stale-issue-helper schedule: - cron: "30 1 * * *" @@ -21,7 +18,7 @@ jobs: days-before-close: 10 days-before-pr-stale: -1 days-before-pr-close: -1 - operations-per-run: 2000 + operations-per-run: 1000 stale-issue-label: "stale" stale-pr-label: "stale" exempt-issue-labels: "needs-triage,no-stale,high,highest" From e997f40b16c782c8d3d62618f00aa61d5c0898d7 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sun, 2 Mar 2025 22:39:35 -0800 Subject: [PATCH 050/319] clean up --- core/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index f34a7fbc9..7cbf0e25b 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -920,9 +920,8 @@ export interface BaseCompletionOptions { } export interface ModelCapability { - tools?: boolean; uploadImage?: boolean; - outputImage?: boolean; + tools?: boolean; } export interface ModelDescription { From 8c330cb23ff1044fb836def561c6fa7489ca46f6 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Mon, 3 Mar 2025 09:03:00 +0100 Subject: [PATCH 051/319] correct type errors --- core/index.d.ts | 2 +- core/llm/countTokens.ts | 12 +++++++----- core/llm/index.ts | 18 +++++++++--------- core/llm/llms/Ollama.ts | 30 +++++++++++++++--------------- core/util/messageContent.ts | 2 ++ 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index e69fa8ee2..6dd5a3c94 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -308,7 +308,7 @@ export interface CompletionOptions extends BaseCompletionOptions { model: string; } -export type ChatMessageRole = "user" | "assistant" | "system" | "tool"; +export type ChatMessageRole = "user" | "assistant" | "thinking" | "system" | "tool"; export type TextMessagePart = { type: "text"; diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index dfbd2da5d..a05889c52 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -27,9 +27,9 @@ class LlamaEncoding implements Encoding { } class NonWorkerAsyncEncoder implements AsyncEncoder { - constructor(private readonly encoding: Encoding) {} + constructor(private readonly encoding: Encoding) { } - async close(): Promise {} + async close(): Promise { } async encode(text: string): Promise { return this.encoding.encode(text); @@ -366,6 +366,7 @@ function chatMessageIsEmpty(message: ChatMessage): boolean { message.content.trim() === "" && !message.toolCalls ); + case "thinking": case "tool": return false; } @@ -383,8 +384,8 @@ function compileChatMessages( ): ChatMessage[] { let msgsCopy = msgs ? msgs - .map((msg) => ({ ...msg })) - .filter((msg) => !chatMessageIsEmpty(msg) && msg.role !== "system") + .map((msg) => ({ ...msg })) + .filter((msg) => !chatMessageIsEmpty(msg) && msg.role !== "system") : []; msgsCopy = addSpaceToAnyEmptyMessages(msgsCopy); @@ -469,5 +470,6 @@ export { pruneLinesFromTop, pruneRawPromptFromTop, pruneStringFromBottom, - pruneStringFromTop, + pruneStringFromTop }; + diff --git a/core/llm/index.ts b/core/llm/index.ts index b08d8b214..a692d0bc0 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -181,11 +181,11 @@ export abstract class BaseLLM implements ILLM { options.completionOptions?.maxTokens ?? (llmInfo?.maxCompletionTokens ? Math.min( - llmInfo.maxCompletionTokens, - // Even if the model has a large maxTokens, we don't want to use that every time, - // because it takes away from the context length - this.contextLength / 4, - ) + llmInfo.maxCompletionTokens, + // Even if the model has a large maxTokens, we don't want to use that every time, + // because it takes away from the context length + this.contextLength / 4, + ) : DEFAULT_MAX_TOKENS), }; this.requestOptions = options.requestOptions; @@ -811,8 +811,8 @@ export abstract class BaseLLM implements ILLM { signal, completionOptions, )) { - completion += chunk.content; - yield chunk; + + if (chunk.role === "assistant") { completion += chunk.content; yield chunk; } @@ -912,7 +912,7 @@ export abstract class BaseLLM implements ILLM { ); } - protected async *_streamComplete( + protected async * _streamComplete( prompt: string, signal: AbortSignal, options: CompletionOptions, @@ -920,7 +920,7 @@ export abstract class BaseLLM implements ILLM { throw new Error("Not implemented"); } - protected async *_streamChat( + protected async * _streamChat( messages: ChatMessage[], signal: AbortSignal, options: CompletionOptions, diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index ee822eb27..7d581b750 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -1,12 +1,12 @@ import { JSONSchema7, JSONSchema7Object } from "json-schema"; -import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; +import { ChatMessage, ChatMessageRole, CompletionOptions, LLMOptions } from "../../index.js"; import { renderChatMessage } from "../../util/messageContent.js"; import { BaseLLM } from "../index.js"; import { streamResponse } from "../stream.js"; type OllamaChatMessage = { - role: "tool" | "user" | "assistant" | "system"; + role: ChatMessageRole; content: string; images?: string[] | null; tool_calls?: { @@ -82,10 +82,10 @@ type OllamaBaseResponse = { model: string; created_at: string; } & ( - | { + | { done: false; } - | { + | { done: true; done_reason: string; total_duration: number; // Time spent generating the response in nanoseconds @@ -96,7 +96,7 @@ type OllamaBaseResponse = { eval_duration: number; // Time spent generating the response in nanoseconds context: number[]; // An encoding of the conversation used in this response; can be sent in the next request to keep conversational memory } -); + ); type OllamaErrorResponse = { error: string; @@ -105,14 +105,14 @@ type OllamaErrorResponse = { type OllamaRawResponse = | OllamaErrorResponse | (OllamaBaseResponse & { - response: string; // the generated response - }); + response: string; // the generated response + }); type OllamaChatResponse = | OllamaErrorResponse | (OllamaBaseResponse & { - message: OllamaChatMessage; - }); + message: OllamaChatMessage; + }); interface OllamaTool { type: "function"; @@ -142,7 +142,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } @@ -331,7 +331,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } @@ -396,7 +396,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } @@ -482,7 +482,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } @@ -523,7 +523,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } @@ -549,7 +549,7 @@ class Ollama extends BaseLLM { const headers: Record = { "Content-Type": "application/json", }; - + if (this.apiKey) { headers.Authorization = `Bearer ${this.apiKey}`; } diff --git a/core/util/messageContent.ts b/core/util/messageContent.ts index 89462a1bf..57bc2896e 100644 --- a/core/util/messageContent.ts +++ b/core/util/messageContent.ts @@ -21,6 +21,7 @@ export function renderChatMessage(message: ChatMessage): string { switch (message.role) { case "user": case "assistant": + case "thinking": case "system": return stripImages(message.content); case "tool": @@ -36,6 +37,7 @@ export function normalizeToMessageParts(message: ChatMessage): MessagePart[] { switch (message.role) { case "user": case "assistant": + case "thinking": case "system": return Array.isArray(message.content) ? message.content From 753b3bc938944882d8523053458f3de2c21d08b4 Mon Sep 17 00:00:00 2001 From: Simon Chauvin <34301767+chauvinSimon@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:29:17 +0100 Subject: [PATCH 052/319] Update codebase.mdx - fix yaml against LanceError To prevent the popup of VSCode Error: `Error getting context items from codebase: Error: lance error: LanceError(IO): k must be positive ...` --- docs/docs/customize/deep-dives/codebase.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/customize/deep-dives/codebase.mdx b/docs/docs/customize/deep-dives/codebase.mdx index 24256672e..409ecd080 100644 --- a/docs/docs/customize/deep-dives/codebase.mdx +++ b/docs/docs/customize/deep-dives/codebase.mdx @@ -49,8 +49,8 @@ There are a few options that let you configure the behavior of the `@codebase` c context: - provider: codebase params: - nRetrieve: 25, - nFinal: 5, + nRetrieve: 25 + nFinal: 5 useReranking: true ``` From 7d047ca1ebed4b74b285052b985a86b2f815ffa6 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Mon, 3 Mar 2025 22:56:16 +0100 Subject: [PATCH 053/319] Add reasoning and reasoningBudgetTokens to BaseCompletionOptions and update Bedrock to handle reasoning for Anthropic Claude models --- core/index.d.ts | 2 + core/llm/llms/Bedrock.ts | 260 +++++++++++++++++++++++++++------------ 2 files changed, 181 insertions(+), 81 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index 6dd5a3c94..67fda2e98 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -924,6 +924,8 @@ export interface BaseCompletionOptions { prediction?: Prediction; tools?: Tool[]; toolChoice?: ToolChoice; + reasoning?: boolean; + reasoningBudgetTokens?: number; } export interface ModelCapability { diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index aa15997ad..db3232c77 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -2,6 +2,7 @@ import { BedrockRuntimeClient, ConverseStreamCommand, InvokeModelCommand, + InvokeModelWithResponseStreamCommand, } from "@aws-sdk/client-bedrock-runtime"; import { fromIni } from "@aws-sdk/credential-providers"; @@ -10,6 +11,7 @@ import { Chunk, CompletionOptions, LLMOptions, + MessageContent, } from "../../index.js"; import { renderChatMessage } from "../../util/messageContent.js"; import { BaseLLM } from "../index.js"; @@ -86,9 +88,9 @@ class Bedrock extends BaseLLM { }); let config_headers = - this.requestOptions && this.requestOptions.headers - ? this.requestOptions.headers - : {}; + this.requestOptions && this.requestOptions.headers + ? this.requestOptions.headers + : {}; // AWS SigV4 requires strict canonicalization of headers. // DO NOT USE "_" in your header name. It will return an error like below. // "The request signature we calculated does not match the signature you provided." @@ -106,85 +108,120 @@ class Bedrock extends BaseLLM { }, ); - const input = this._generateConverseInput(messages, { ...options, stream: true }); - const command = new ConverseStreamCommand(input); - - let response; - try { - response = await client.send(command, { abortSignal: signal }); - } catch (error: unknown) { - const message = error instanceof Error ? error.message : "Unknown error"; - throw new Error(`Failed to communicate with Bedrock API: ${message}`); - } - - if (!response?.stream) { - throw new Error("No stream received from Bedrock API"); - } - - try { - for await (const chunk of response.stream) { - - console.log(chunk); - - if (chunk.contentBlockDelta?.delta) { - - // Handle text content - if (chunk.contentBlockDelta.delta.text) { - yield { role: "assistant", content: chunk.contentBlockDelta.delta.text }; - continue; - } - - if (chunk.contentBlockDelta.delta.toolUse?.input && this._currentToolResponse) { - // Append the new input to the existing string - if (this._currentToolResponse.input === undefined) { - this._currentToolResponse.input = ""; - } - this._currentToolResponse.input += chunk.contentBlockDelta.delta.toolUse.input; - continue; - } - } - - if (chunk.contentBlockStart?.start) { - const toolUse = chunk.contentBlockStart.start.toolUse; - if (toolUse?.toolUseId && toolUse?.name) { - this._currentToolResponse = { - toolUseId: toolUse.toolUseId, - name: toolUse.name, - input: "" - }; - } - continue; - } - - if (chunk.contentBlockStop) { - if (this._currentToolResponse) { - yield { - role: "assistant", - content: "", - toolCalls: [{ - id: this._currentToolResponse.toolUseId, - type: "function", - function: { - name: this._currentToolResponse.name, - arguments: this._currentToolResponse.input + if (options.reasoning && options.model.includes("anthropic.claude")) { + const input = this._generateInvokeInput(messages, options); + const command = new InvokeModelWithResponseStreamCommand(input); + try { + const response = await client.send(command, { abortSignal: signal }); + if (response.body) { + for await (const chunk of response.body) { + if (chunk.chunk?.bytes) { + const chunkData = JSON.parse(new TextDecoder().decode(chunk.chunk.bytes)); + if (chunkData?.delta?.text) { + yield { + role: "assistant", + content: chunkData.delta.text, + }; + } else { + if (chunkData?.delta?.thinking) { + yield { + role: "thinking", + content: chunkData.delta.thinking, + }; } - }], - }; - this._currentToolResponse = null; + } + //TODO: Handle tool use once the thinking blocks (with redacted_thinking) are properly added to the history + } } - continue; } + } catch (e) { + console.error("Error while invoke Bedrock model"); + console.error(e); + throw e; } - } catch (error: unknown) { - this._currentToolResponse = null; - if (error instanceof Error) { - if ("code" in error) { - // AWS SDK specific errors - throw new Error(`AWS Bedrock stream error (${(error as any).code}): ${error.message}`); + + } else { + + const input = this._generateConverseInput(messages, { ...options, stream: true }); + const command = new ConverseStreamCommand(input); + + let response; + try { + response = await client.send(command, { abortSignal: signal }); + } catch (error: unknown) { + const message = error instanceof Error ? error.message : "Unknown error"; + throw new Error(`Failed to communicate with Bedrock API: ${message}`); + } + + if (!response?.stream) { + throw new Error("No stream received from Bedrock API"); + } + + try { + for await (const chunk of response.stream) { + + console.log(chunk); + + if (chunk.contentBlockDelta?.delta) { + + // Handle text content + if (chunk.contentBlockDelta.delta.text) { + yield { role: "assistant", content: chunk.contentBlockDelta.delta.text }; + continue; + } + + if (chunk.contentBlockDelta.delta.toolUse?.input && this._currentToolResponse) { + // Append the new input to the existing string + if (this._currentToolResponse.input === undefined) { + this._currentToolResponse.input = ""; + } + this._currentToolResponse.input += chunk.contentBlockDelta.delta.toolUse.input; + continue; + } + } + + if (chunk.contentBlockStart?.start) { + const toolUse = chunk.contentBlockStart.start.toolUse; + if (toolUse?.toolUseId && toolUse?.name) { + this._currentToolResponse = { + toolUseId: toolUse.toolUseId, + name: toolUse.name, + input: "" + }; + } + continue; + } + + if (chunk.contentBlockStop) { + if (this._currentToolResponse) { + yield { + role: "assistant", + content: "", + toolCalls: [{ + id: this._currentToolResponse.toolUseId, + type: "function", + function: { + name: this._currentToolResponse.name, + arguments: this._currentToolResponse.input + } + }], + }; + this._currentToolResponse = null; + } + continue; + } } - throw new Error(`Error processing Bedrock stream: ${error.message}`); + } catch (error: unknown) { + this._currentToolResponse = null; + if (error instanceof Error) { + if ("code" in error) { + // AWS SDK specific errors + throw new Error(`AWS Bedrock stream error (${(error as any).code}): ${error.message}`); + } + throw new Error(`Error processing Bedrock stream: ${error.message}`); + } + throw new Error("Error processing Bedrock stream: Unknown error occurred"); } - throw new Error("Error processing Bedrock stream: Unknown error occurred"); } } @@ -265,11 +302,11 @@ class Bedrock extends BaseLLM { return { role: "assistant", content: message.toolCalls.map((toolCall) => ({ - toolUse: { - toolUseId: toolCall.id, - name: toolCall.function?.name, - input: JSON.parse(toolCall.function?.arguments || "{}"), - } + toolUse: { + toolUseId: toolCall.id, + name: toolCall.function?.name, + input: JSON.parse(toolCall.function?.arguments || "{}"), + } })) }; } @@ -326,6 +363,67 @@ class Bedrock extends BaseLLM { .filter(Boolean); } + private _generateInvokeInput( + messages: ChatMessage[], + options: CompletionOptions, + ): any { + const convertedMessages = this._convertMessagesForInvoke(messages); + + return { + modelId: options.model, + contentType: "application/json", + accept: "application/json", + body: JSON.stringify({ + anthropic_version: "bedrock-2023-05-31", + temperature: options.temperature, + system: this.systemMessage, + max_tokens: options.maxTokens, + top_p: options.topP, + stop_sequences: options.stop + ?.filter((stop) => stop.trim() !== "") + .slice(0, 4), + thinking: options.reasoning ? { + type: "enabled", + budget_tokens: options.reasoningBudgetTokens || 1024 + } : undefined, + messages: convertedMessages + }) + } + } + + private _convertMessagesForInvoke(messages: ChatMessage[]): any[] { + return messages + .filter((message) => message.role !== "system") + .map((message) => ({ + role: message.role, + content: this._convertMessageContentForInvoke(message.content), + })); + } + + private _convertMessageContentForInvoke(messageContent: MessageContent): any[] { + if (typeof messageContent === "string") { + return [{ type: "text", text: messageContent }]; + } + return messageContent + .map((part) => { + if (part.type === "text") { + return { type: "text", text: part.text }; + } + if (part.type === "imageUrl" && part.imageUrl) { + return { + type: "image", + source: { + type: "base64", + media_type: "image/jpeg", + data: Buffer.from(part.imageUrl.url.split(",")[1], "base64"), + }, + }; + } + return null; + }) + .filter(Boolean); + } + private async _getCredentials() { try { return await fromIni({ From 892f89e0e23f9ef1cac2eef40d82c25ba8abc153 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 3 Mar 2025 16:08:15 -0800 Subject: [PATCH 054/319] use URI.resolve --- core/util/uri.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/core/util/uri.ts b/core/util/uri.ts index 13d7956ac..a5a84d3b4 100644 --- a/core/util/uri.ts +++ b/core/util/uri.ts @@ -116,19 +116,30 @@ export function getLastNUriRelativePathParts( } export function joinPathsToUri(uri: string, ...pathSegments: string[]) { - const components = URI.parse(uri); + let baseUri = uri; + if (baseUri.at(-1) !== "/") { + baseUri += "/"; + } const segments = pathSegments.map((segment) => pathToUriPathSegment(segment)); - components.path = `${components.path}/${segments.join("/")}`; - return URI.serialize(components); + return URI.resolve(baseUri, segments.join("/")); } +// const components = URI.parse(uri); +// return URI.serialize(components); +// components.path = `${components.path}/${segments.join("/")}`; + export function joinEncodedUriPathSegmentToUri( uri: string, pathSegment: string, ) { - const components = URI.parse(uri); - components.path = `${components.path}/${pathSegment}`; - return URI.serialize(components); + let baseUri = uri; + if (baseUri.at(-1) !== "/") { + baseUri += "/"; + } + return URI.resolve(baseUri, pathSegment); + // const components = URI.parse(uri); + // components.path = `${components.path}/${pathSegment}`; + // return URI.serialize(components); } export function getShortestUniqueRelativeUriPaths( From a8d9a312a6efb935edca0de7cd8e77fb6d9a2660 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 3 Mar 2025 16:12:30 -0800 Subject: [PATCH 055/319] cleanup --- core/util/uri.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/util/uri.ts b/core/util/uri.ts index a5a84d3b4..e180a0a69 100644 --- a/core/util/uri.ts +++ b/core/util/uri.ts @@ -124,10 +124,6 @@ export function joinPathsToUri(uri: string, ...pathSegments: string[]) { return URI.resolve(baseUri, segments.join("/")); } -// const components = URI.parse(uri); -// return URI.serialize(components); -// components.path = `${components.path}/${segments.join("/")}`; - export function joinEncodedUriPathSegmentToUri( uri: string, pathSegment: string, @@ -137,9 +133,6 @@ export function joinEncodedUriPathSegmentToUri( baseUri += "/"; } return URI.resolve(baseUri, pathSegment); - // const components = URI.parse(uri); - // components.path = `${components.path}/${pathSegment}`; - // return URI.serialize(components); } export function getShortestUniqueRelativeUriPaths( From 523b1e4cc62db53ee573f38ff46b446c1ca0f1d3 Mon Sep 17 00:00:00 2001 From: mq200 Date: Mon, 3 Mar 2025 19:54:45 -0800 Subject: [PATCH 056/319] update docs --- core/llm/llms/WatsonX.ts | 25 ++++++++------ .../model-providers/more/watsonx.mdx | 34 +++++++++++++++++++ 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/core/llm/llms/WatsonX.ts b/core/llm/llms/WatsonX.ts index 48b98d399..561f4f2d9 100644 --- a/core/llm/llms/WatsonX.ts +++ b/core/llm/llms/WatsonX.ts @@ -138,7 +138,7 @@ class WatsonX extends BaseLLM { }; } - protected async getOrFetchWatsonxToken() { + protected async updateWatsonxToken() { var now = new Date().getTime() / 1000; if ( watsonxToken === undefined || @@ -194,7 +194,7 @@ class WatsonX extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { - await this.getOrFetchWatsonxToken(); + await this.updateWatsonxToken(); const stopSequences = options.stop?.slice(0, 6) ?? @@ -272,7 +272,7 @@ class WatsonX extends BaseLLM { } protected async _embed(chunks: string[]): Promise { - await this.getOrFetchWatsonxToken(); + await this.updateWatsonxToken(); const payload: any = { inputs: chunks, @@ -318,7 +318,15 @@ class WatsonX extends BaseLLM { throw new Error("Query and chunks must not be empty"); } try { - await this.getOrFetchWatsonxToken(); + await this.updateWatsonxToken(); + + const headers = { + "Content-Type": "application/json", + Authorization: `${ + watsonxToken.expiration === -1 ? "ZenApiKey" : "Bearer" + } ${watsonxToken.token}`, + }; + const payload: any = { inputs: chunks.map((chunk) => ({ text: chunk.content })), query: query, @@ -331,20 +339,15 @@ class WatsonX extends BaseLLM { model_id: this.model, project_id: this.projectId, }; - const headers = { - "Content-Type": "application/json", - Authorization: `${ - watsonxToken.expiration === -1 ? "ZenApiKey" : "Bearer" - } ${watsonxToken.token}`, - }; + const resp = await this.fetch( new URL( `${this.apiBase}/ml/v1/text/rerank?version=${this.apiVersion}`, ), { method: "POST", - body: JSON.stringify(payload), headers: headers, + body: JSON.stringify(payload), }, ); diff --git a/docs/docs/customize/model-providers/more/watsonx.mdx b/docs/docs/customize/model-providers/more/watsonx.mdx index 0854e0cd6..f2360788f 100644 --- a/docs/docs/customize/model-providers/more/watsonx.mdx +++ b/docs/docs/customize/model-providers/more/watsonx.mdx @@ -244,3 +244,37 @@ To view the list of available embeddings models, visit [this page](https://datap ``` + + +## Reranker + + + + ```yaml title="config.yaml" + models: + - name: Watsonx Reranker + provider: watsonx + model: cross-encoder/ms-marco-minilm-l-12-v2 + apiBase: https://us-south.ml.cloud.ibm.com + projectId: PROJECT_ID + apiKey: API_KEY/ZENAPI_KEY/USERNAME:PASSWORD + apiVersion: 2024-03-14 + ``` + + + ```json title="config.json" + { + "reranker": { + "name": "watsonx", + "params": { + "model": "cross-encoder/ms-marco-minilm-l-12-v2", + "apiBase": "watsonx endpoint e.g. https://us-south.ml.cloud.ibm.com", + "projectId": "PROJECT_ID", + "apiKey": "API_KEY/ZENAPI_KEY/USERNAME:PASSWORD", + "apiVersion": "2024-03-14" + } + } + } + ``` + + From ef66c22127b68300f59ef01387438f49385e8d43 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Tue, 4 Mar 2025 09:54:05 +0100 Subject: [PATCH 057/319] add reasoning option to Anthropic class constructor --- core/llm/llms/Anthropic.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index bdbd67639..a7b055c27 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -30,6 +30,10 @@ class Anthropic extends BaseLLM { description: tool.function.description, input_schema: tool.function.parameters, })), + thinking: options.reasoning ? { + type: "enabled", + budget_tokens: options.reasoningBudgetTokens, + } : undefined, tool_choice: options.toolChoice ? { type: "tool", From a2e4bdbccfb311e7d021d4e65542de9d63236764 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Tue, 4 Mar 2025 10:36:48 +0100 Subject: [PATCH 058/319] Update bedrock and use ConverseStream for Anthropic --- core/llm/llms/Bedrock.ts | 293 ++--- core/package-lock.json | 1761 ++++++++++++++++++++++++++- core/package.json | 2 +- extensions/vscode/package-lock.json | 4 +- 4 files changed, 1822 insertions(+), 238 deletions(-) diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index db3232c77..a9b05c437 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -1,8 +1,7 @@ import { BedrockRuntimeClient, ConverseStreamCommand, - InvokeModelCommand, - InvokeModelWithResponseStreamCommand, + InvokeModelCommand } from "@aws-sdk/client-bedrock-runtime"; import { fromIni } from "@aws-sdk/credential-providers"; @@ -10,8 +9,7 @@ import { ChatMessage, Chunk, CompletionOptions, - LLMOptions, - MessageContent, + LLMOptions } from "../../index.js"; import { renderChatMessage } from "../../util/messageContent.js"; import { BaseLLM } from "../index.js"; @@ -108,121 +106,93 @@ class Bedrock extends BaseLLM { }, ); - if (options.reasoning && options.model.includes("anthropic.claude")) { - const input = this._generateInvokeInput(messages, options); - const command = new InvokeModelWithResponseStreamCommand(input); - try { - const response = await client.send(command, { abortSignal: signal }); - if (response.body) { - for await (const chunk of response.body) { - if (chunk.chunk?.bytes) { - const chunkData = JSON.parse(new TextDecoder().decode(chunk.chunk.bytes)); - if (chunkData?.delta?.text) { - yield { - role: "assistant", - content: chunkData.delta.text, - }; - } else { - if (chunkData?.delta?.thinking) { - yield { - role: "thinking", - content: chunkData.delta.thinking, - }; - } - } - //TODO: Handle tool use once the thinking blocks (with redacted_thinking) are properly added to the history - } - } - } - } catch (e) { - console.error("Error while invoke Bedrock model"); - console.error(e); - throw e; - } + const input = this._generateConverseInput(messages, { ...options, stream: true }); + const command = new ConverseStreamCommand(input); - } else { - - const input = this._generateConverseInput(messages, { ...options, stream: true }); - const command = new ConverseStreamCommand(input); - - let response; - try { - response = await client.send(command, { abortSignal: signal }); - } catch (error: unknown) { - const message = error instanceof Error ? error.message : "Unknown error"; - throw new Error(`Failed to communicate with Bedrock API: ${message}`); - } - - if (!response?.stream) { - throw new Error("No stream received from Bedrock API"); - } - - try { - for await (const chunk of response.stream) { - - console.log(chunk); - - if (chunk.contentBlockDelta?.delta) { - - // Handle text content - if (chunk.contentBlockDelta.delta.text) { - yield { role: "assistant", content: chunk.contentBlockDelta.delta.text }; - continue; - } - - if (chunk.contentBlockDelta.delta.toolUse?.input && this._currentToolResponse) { - // Append the new input to the existing string - if (this._currentToolResponse.input === undefined) { - this._currentToolResponse.input = ""; - } - this._currentToolResponse.input += chunk.contentBlockDelta.delta.toolUse.input; - continue; - } - } - - if (chunk.contentBlockStart?.start) { - const toolUse = chunk.contentBlockStart.start.toolUse; - if (toolUse?.toolUseId && toolUse?.name) { - this._currentToolResponse = { - toolUseId: toolUse.toolUseId, - name: toolUse.name, - input: "" - }; - } - continue; - } - - if (chunk.contentBlockStop) { - if (this._currentToolResponse) { - yield { - role: "assistant", - content: "", - toolCalls: [{ - id: this._currentToolResponse.toolUseId, - type: "function", - function: { - name: this._currentToolResponse.name, - arguments: this._currentToolResponse.input - } - }], - }; - this._currentToolResponse = null; - } - continue; - } - } - } catch (error: unknown) { - this._currentToolResponse = null; - if (error instanceof Error) { - if ("code" in error) { - // AWS SDK specific errors - throw new Error(`AWS Bedrock stream error (${(error as any).code}): ${error.message}`); - } - throw new Error(`Error processing Bedrock stream: ${error.message}`); - } - throw new Error("Error processing Bedrock stream: Unknown error occurred"); - } + let response; + try { + response = await client.send(command, { abortSignal: signal }); + } catch (error: unknown) { + const message = error instanceof Error ? error.message : "Unknown error"; + throw new Error(`Failed to communicate with Bedrock API: ${message}`); } + + if (!response?.stream) { + throw new Error("No stream received from Bedrock API"); + } + + try { + for await (const chunk of response.stream) { + + console.log(chunk); + + if (chunk.contentBlockDelta?.delta) { + + // Handle text content + if (chunk.contentBlockDelta.delta.text) { + yield { role: "assistant", content: chunk.contentBlockDelta.delta.text }; + continue; + } + + // Handle text content + if (chunk.contentBlockDelta.delta.reasoningContent?.text) { + yield { role: "thinking", content: chunk.contentBlockDelta.delta.reasoningContent.text }; + continue; + } + + if (chunk.contentBlockDelta.delta.toolUse?.input && this._currentToolResponse) { + // Append the new input to the existing string + if (this._currentToolResponse.input === undefined) { + this._currentToolResponse.input = ""; + } + this._currentToolResponse.input += chunk.contentBlockDelta.delta.toolUse.input; + continue; + } + } + + if (chunk.contentBlockStart?.start) { + const toolUse = chunk.contentBlockStart.start.toolUse; + if (toolUse?.toolUseId && toolUse?.name) { + this._currentToolResponse = { + toolUseId: toolUse.toolUseId, + name: toolUse.name, + input: "" + }; + } + continue; + } + + if (chunk.contentBlockStop) { + if (this._currentToolResponse) { + yield { + role: "assistant", + content: "", + toolCalls: [{ + id: this._currentToolResponse.toolUseId, + type: "function", + function: { + name: this._currentToolResponse.name, + arguments: this._currentToolResponse.input + } + }], + }; + this._currentToolResponse = null; + } + continue; + } + } + } catch (error: unknown) { + this._currentToolResponse = null; + if (error instanceof Error) { + if ("code" in error) { + // AWS SDK specific errors + throw new Error(`AWS Bedrock stream error (${(error as any).code}): ${error.message}`); + } + throw new Error(`Error processing Bedrock stream: ${error.message}`); + } + throw new Error("Error processing Bedrock stream: Unknown error occurred"); + } + } /** @@ -238,20 +208,22 @@ class Bedrock extends BaseLLM { const convertedMessages = this._convertMessages(messages); const supportsTools = PROVIDER_TOOL_SUPPORT.bedrock?.(options.model || "") ?? false; + const tools = (supportsTools && options.tools?.map(tool => ({ + toolSpec: { + name: tool.function.name, + description: tool.function.description, + inputSchema: { + json: tool.function.parameters + } + } + }))) || null + return { modelId: options.model, messages: convertedMessages, system: this.systemMessage ? [{ text: this.systemMessage }] : undefined, - toolConfig: supportsTools && options.tools ? { - tools: options.tools.map(tool => ({ - toolSpec: { - name: tool.function.name, - description: tool.function.description, - inputSchema: { - json: tool.function.parameters - } - } - })) + toolConfig: tools && tools.length ? { + tools } : undefined, inferenceConfig: { maxTokens: options.maxTokens, @@ -269,6 +241,12 @@ class Bedrock extends BaseLLM { ?.filter((stop) => stop.trim() !== "") .slice(0, 4), }, + additionalModelRequestFields: { + "thinking": options.reasoning ? { + "type": "enabled", + "budget_tokens": options.reasoningBudgetTokens + } : undefined, + } }; } @@ -363,67 +341,6 @@ class Bedrock extends BaseLLM { .filter(Boolean); } - private _generateInvokeInput( - messages: ChatMessage[], - options: CompletionOptions, - ): any { - const convertedMessages = this._convertMessagesForInvoke(messages); - - return { - modelId: options.model, - contentType: "application/json", - accept: "application/json", - body: JSON.stringify({ - anthropic_version: "bedrock-2023-05-31", - temperature: options.temperature, - system: this.systemMessage, - max_tokens: options.maxTokens, - top_p: options.topP, - stop_sequences: options.stop - ?.filter((stop) => stop.trim() !== "") - .slice(0, 4), - thinking: options.reasoning ? { - type: "enabled", - budget_tokens: options.reasoningBudgetTokens || 1024 - } : undefined, - messages: convertedMessages - }) - } - } - - private _convertMessagesForInvoke(messages: ChatMessage[]): any[] { - return messages - .filter((message) => message.role !== "system") - .map((message) => ({ - role: message.role, - content: this._convertMessageContentForInvoke(message.content), - })); - } - - private _convertMessageContentForInvoke(messageContent: MessageContent): any[] { - if (typeof messageContent === "string") { - return [{ type: "text", text: messageContent }]; - } - return messageContent - .map((part) => { - if (part.type === "text") { - return { type: "text", text: part.text }; - } - if (part.type === "imageUrl" && part.imageUrl) { - return { - type: "image", - source: { - type: "base64", - media_type: "image/jpeg", - data: Buffer.from(part.imageUrl.url.split(",")[1], "base64"), - }, - }; - } - return null; - }) - .filter(Boolean); - } - private async _getCredentials() { try { return await fromIni({ diff --git a/core/package-lock.json b/core/package-lock.json index abe4271f8..aaa3fbf29 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.13", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-bedrock-runtime": "^3.620.1", + "@aws-sdk/client-bedrock-runtime": "^3.758", "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", @@ -288,60 +288,998 @@ } }, "node_modules/@aws-sdk/client-bedrock-runtime": { - "version": "3.706.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.706.0.tgz", - "integrity": "sha512-Wxzv0VgC1JFDFEnnmCCpKCXYpe+CfANY+ljY7HBSF2zJDasBHKpM4z28sN5nuffJgsBbkIDWltWbNnXKP/cONA==", + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.758.0.tgz", + "integrity": "sha512-T7s+fULUxN3AcJP+lgoUKLawzVEtyCTi+5Ga+wrHnqEPwAsM/wg7VctsZfow1fCgARLT/lzmP2LTCi8ycRnQWg==", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.699.0", - "@aws-sdk/client-sts": "3.699.0", - "@aws-sdk/core": "3.696.0", - "@aws-sdk/credential-provider-node": "3.699.0", - "@aws-sdk/middleware-host-header": "3.696.0", - "@aws-sdk/middleware-logger": "3.696.0", - "@aws-sdk/middleware-recursion-detection": "3.696.0", - "@aws-sdk/middleware-user-agent": "3.696.0", - "@aws-sdk/region-config-resolver": "3.696.0", - "@aws-sdk/types": "3.696.0", - "@aws-sdk/util-endpoints": "3.696.0", - "@aws-sdk/util-user-agent-browser": "3.696.0", - "@aws-sdk/util-user-agent-node": "3.696.0", - "@smithy/config-resolver": "^3.0.12", - "@smithy/core": "^2.5.3", - "@smithy/eventstream-serde-browser": "^3.0.13", - "@smithy/eventstream-serde-config-resolver": "^3.0.10", - "@smithy/eventstream-serde-node": "^3.0.12", - "@smithy/fetch-http-handler": "^4.1.1", - "@smithy/hash-node": "^3.0.10", - "@smithy/invalid-dependency": "^3.0.10", - "@smithy/middleware-content-length": "^3.0.12", - "@smithy/middleware-endpoint": "^3.2.3", - "@smithy/middleware-retry": "^3.0.27", - "@smithy/middleware-serde": "^3.0.10", - "@smithy/middleware-stack": "^3.0.10", - "@smithy/node-config-provider": "^3.1.11", - "@smithy/node-http-handler": "^3.3.1", - "@smithy/protocol-http": "^4.1.7", - "@smithy/smithy-client": "^3.4.4", - "@smithy/types": "^3.7.1", - "@smithy/url-parser": "^3.0.10", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.27", - "@smithy/util-defaults-mode-node": "^3.0.27", - "@smithy/util-endpoints": "^2.1.6", - "@smithy/util-middleware": "^3.0.10", - "@smithy/util-retry": "^3.0.10", - "@smithy/util-stream": "^3.3.1", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/eventstream-serde-browser": "^4.0.1", + "@smithy/eventstream-serde-config-resolver": "^4.0.1", + "@smithy/eventstream-serde-node": "^4.0.1", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "@types/uuid": "^9.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/client-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.758.0.tgz", + "integrity": "sha512-BoGO6IIWrLyLxQG6txJw6RT2urmbtlwfggapNCrNPyYjlXpzTSJhBYjndg7TpDATFd0SXL0zm8y/tXsUXNkdYQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", + "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.758.0.tgz", + "integrity": "sha512-N27eFoRrO6MeUNumtNHDW9WOiwfd59LPXPqDrIa3kWL/s+fOKFHb9xIcF++bAwtcZnAxKkgpDCUP+INNZskE+w==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.758.0.tgz", + "integrity": "sha512-Xt9/U8qUCiw1hihztWkNeIR+arg6P+yda10OuCHX6kFVx3auTlU7+hCqs3UxqniGU4dguHuftf3mRpi5/GJ33Q==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.758.0.tgz", + "integrity": "sha512-cymSKMcP5d+OsgetoIZ5QCe1wnp2Q/tq+uIxVdh9MbfdBBEnl9Ecq6dH6VlYS89sp4QKuxHxkWXVnbXU3Q19Aw==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.758.0.tgz", + "integrity": "sha512-+DaMv63wiq7pJrhIQzZYMn4hSarKiizDoJRvyR7WGhnn0oQ/getX9Z0VNCV3i7lIFoLNTb7WMmQ9k7+z/uD5EQ==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.758.0.tgz", + "integrity": "sha512-AzcY74QTPqcbXWVgjpPZ3HOmxQZYPROIBz2YINF0OQk0MhezDWV/O7Xec+K1+MPGQO3qS6EDrUUlnPLjsqieHA==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.758.0.tgz", + "integrity": "sha512-x0FYJqcOLUCv8GLLFDYMXRAQKGjoM+L0BG4BiHYZRDf24yQWFCAZsCQAYKo6XZYh2qznbsW6f//qpyJ5b0QVKQ==", + "dependencies": { + "@aws-sdk/client-sso": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/token-providers": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.758.0.tgz", + "integrity": "sha512-XGguXhBqiCXMXRxcfCAVPlMbm3VyJTou79r/3mxWddHWF0XbhaQiBIbUz6vobVTD25YQRbWSmSch7VA8kI5Lrw==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", + "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", + "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", + "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", + "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", + "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/token-providers": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.758.0.tgz", + "integrity": "sha512-ckptN1tNrIfQUaGWm/ayW1ddG+imbKN7HHhjFdS4VfItsP0QQOB0+Ov+tpgb4MoNR4JaUghMIVStjIeHN2ks1w==", + "dependencies": { + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/types": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", + "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", + "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", + "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", + "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/abort-controller": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", + "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/config-resolver": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", + "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/core": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", + "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", + "dependencies": { + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", + "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-codec": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.1.tgz", + "integrity": "sha512-Q2bCAAR6zXNVtJgifsU16ZjKGqdw/DyecKNgIgi7dlqw04fqDu0mnq+JmGphqheypVc64CYq3azSuCpAdFk2+A==", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-browser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.1.tgz", + "integrity": "sha512-HbIybmz5rhNg+zxKiyVAnvdM3vkzjE6ccrJ620iPL8IXcJEntd3hnBl+ktMwIy12Te/kyrSbUb8UCdnUT4QEdA==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.0.1.tgz", + "integrity": "sha512-lSipaiq3rmHguHa3QFF4YcCM3VJOrY9oq2sow3qlhFY+nBSTF/nrO82MUQRPrxHQXA58J5G1UnU2WuJfi465BA==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-node": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.1.tgz", + "integrity": "sha512-o4CoOI6oYGYJ4zXo34U8X9szDe3oGjmHgsMGiZM0j4vtNoT+h80TLnkUcrLZR3+E6HIxqW+G+9WHAVfl0GXK0Q==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-universal": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.1.tgz", + "integrity": "sha512-Z94uZp0tGJuxds3iEAZBqGU2QiaBHP4YytLUjwZWx+oUeohCsLyUm33yp4MMBmhkuPqSbQCXq5hDet6JGUgHWA==", + "dependencies": { + "@smithy/eventstream-codec": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", + "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/hash-node": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", + "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", + "dependencies": { + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/invalid-dependency": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", + "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-content-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", + "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", + "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-retry": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", + "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", + "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", + "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", + "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", + "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", + "dependencies": { + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/property-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", + "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/protocol-http": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", + "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/querystring-builder": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", + "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", + "dependencies": { + "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/querystring-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", + "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/service-error-classification": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", + "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", + "dependencies": { + "@smithy/types": "^4.1.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", + "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/signature-v4": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", + "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/smithy-client": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", + "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", + "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/url-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", + "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", + "dependencies": { + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", + "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", + "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", + "dependencies": { + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-endpoints": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", + "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-middleware": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", + "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-retry": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", + "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", + "dependencies": { + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-stream": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", + "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", + "dependencies": { + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@aws-sdk/client-cognito-identity": { @@ -855,6 +1793,735 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/nested-clients": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.758.0.tgz", + "integrity": "sha512-YZ5s7PSvyF3Mt2h1EQulCG93uybprNGbBkPmVuy/HMMfbFTt4iL3SbKjxqvOZelm86epFfj7pvK7FliI2WOEcg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/core": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", + "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", + "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", + "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", + "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", + "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", + "dependencies": { + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", + "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/types": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", + "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", + "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", + "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", + "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", + "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/abort-controller": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", + "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/config-resolver": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", + "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/core": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", + "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", + "dependencies": { + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/credential-provider-imds": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", + "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/fetch-http-handler": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", + "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/hash-node": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", + "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", + "dependencies": { + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/invalid-dependency": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", + "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-content-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", + "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", + "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-endpoint": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", + "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-retry": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", + "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-serde": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", + "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-stack": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", + "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-config-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", + "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", + "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", + "dependencies": { + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/property-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", + "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/protocol-http": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", + "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/querystring-builder": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", + "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", + "dependencies": { + "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/querystring-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", + "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/service-error-classification": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", + "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", + "dependencies": { + "@smithy/types": "^4.1.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", + "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/signature-v4": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", + "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/smithy-client": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", + "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", + "dependencies": { + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", + "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/url-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", + "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", + "dependencies": { + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-config-provider": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", + "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", + "dependencies": { + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", + "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", + "dependencies": { + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-endpoints": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", + "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", + "dependencies": { + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-middleware": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", + "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", + "dependencies": { + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-retry": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", + "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", + "dependencies": { + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-stream": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", + "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", + "dependencies": { + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@aws-sdk/region-config-resolver": { "version": "3.696.0", "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.696.0.tgz", diff --git a/core/package.json b/core/package.json index a88bf0cf1..f2f523a72 100644 --- a/core/package.json +++ b/core/package.json @@ -42,7 +42,7 @@ "ts-jest": "^29.1.1" }, "dependencies": { - "@aws-sdk/client-bedrock-runtime": "^3.620.1", + "@aws-sdk/client-bedrock-runtime": "^3.758", "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 9b61f1900..cbcebc34e 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", From a15d1165c90699b09f3ea3ceaf7b33f246d73603 Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Tue, 4 Mar 2025 17:57:10 +0100 Subject: [PATCH 059/319] Adding thinking blocks and handle redacted_thinking --- core/index.d.ts | 2 ++ core/llm/index.ts | 1 + core/llm/llms/Anthropic.ts | 25 +++++++++++++++++++++++++ extensions/vscode/package-lock.json | 4 ++-- gui/src/redux/slices/sessionSlice.ts | 22 ++++++++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index 6dd5a3c94..8a86db6be 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -356,6 +356,8 @@ export interface UserChatMessage { export interface ThinkingChatMessage { role: "thinking"; content: MessageContent; + signature?: string; + redactedThinking?: string; toolCalls?: ToolCallDelta[]; } diff --git a/core/llm/index.ts b/core/llm/index.ts index a692d0bc0..e9724d8d4 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -819,6 +819,7 @@ export abstract class BaseLLM implements ILLM { if (chunk.role === "thinking") { thinking += chunk.content; + yield chunk; } } } diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index bdbd67639..0e0ec15bb 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -63,6 +63,23 @@ class Anthropic extends BaseLLM { input: JSON.parse(toolCall.function?.arguments || "{}"), })), }; + } else if (message.role === "thinking" && !message.redactedThinking) { + return { + role: "assistant", + content: [{ + type: "thinking", + thinking: message.content, + signature: message.signature + }] + }; + } else if (message.role === "thinking" && message.redactedThinking) { + return { + role: "assistant", + content: [{ + type: "redacted_thinking", + data: message.redactedThinking + }] + }; } if (typeof message.content === "string") { @@ -216,6 +233,11 @@ class Anthropic extends BaseLLM { lastToolUseId = value.content_block.id; lastToolUseName = value.content_block.name; } + // handle redacted thinking + if (value.content_block.type === "redacted_thinking") { + console.log("redacted thinking", value.content_block.data); + yield { role: "thinking", content: "", redactedThinking: value.content_block.data }; + } break; case "content_block_delta": // https://docs.anthropic.com/en/api/messages-streaming#delta-types @@ -226,6 +248,9 @@ class Anthropic extends BaseLLM { case "thinking_delta": yield { role: "thinking", content: value.delta.thinking }; break; + case "signature_delta": + yield { role: "thinking", content: "", signature: value.delta.signature }; + break; case "input_json_delta": if (!lastToolUseId || !lastToolUseName) { throw new Error("No tool use found"); diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 9b61f1900..cbcebc34e 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts index be4d3aa77..04bb7ab19 100644 --- a/gui/src/redux/slices/sessionSlice.ts +++ b/gui/src/redux/slices/sessionSlice.ts @@ -294,6 +294,7 @@ export const sessionSlice = createSlice({ state.streamAborter = new AbortController(); }, streamUpdate: (state, action: PayloadAction) => { + if (state.history.length) { function toolCallDeltaToState( toolCallDelta: ToolCallDelta, @@ -319,6 +320,22 @@ export const sessionSlice = createSlice({ for (const message of action.payload) { const lastItem = state.history[state.history.length - 1]; const lastMessage = lastItem.message; + + if (message.role === "thinking" && message.redactedThinking) { + console.log("add redacted_thinking blocks"); + + state.history.push({ + message: { + role: "thinking", + content: "internal reasoning is hidden due to safety reasons", + redactedThinking: message.redactedThinking, + id: uuidv4(), + }, + contextItems: [], + }) + continue; + } + if ( lastMessage.role !== message.role || // This is for when a tool call comes immediately before/after tool call @@ -382,6 +399,11 @@ export const sessionSlice = createSlice({ // was already rendered from parts to string lastMessage.content += messageContent; } + } else if (message.role === "thinking" && message.signature) { + if (lastMessage.role === "thinking") { + console.log("add signature", message.signature); + lastMessage.signature = message.signature; + } } else if ( message.role === "assistant" && message.toolCalls?.[0] && From 19c8da156f75c01bb587814d1d197f509a7fcaba Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 4 Mar 2025 09:55:11 -0800 Subject: [PATCH 060/319] yaml model capabilities --- core/config/yaml/models.ts | 20 +++++++++++++++++++- packages/config-yaml/src/schemas/models.ts | 9 +++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index c6916b010..a0dccd46a 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -35,8 +35,10 @@ async function modelConfigToBaseLLM( return undefined; } + const { capabilities, ...rest } = model; + let options: LLMOptions = { - ...model, + ...rest, completionOptions: { ...(model.defaultCompletionOptions ?? {}), model: model.model, @@ -51,6 +53,22 @@ async function modelConfigToBaseLLM( promptTemplates: model.promptTemplates, }; + // Model capabilities - need to be undefined if not found + // To fallback to our autodetection + if (capabilities?.find((c) => c === "tool_use")) { + options.capabilities = { + ...options.capabilities, + tools: true, + }; + } + + if (capabilities?.find((c) => c === "image_input")) { + options.capabilities = { + ...options.capabilities, + uploadImage: true, + }; + } + if (model.embedOptions?.maxBatchSize) { options.maxEmbeddingBatchSize = model.embedOptions.maxBatchSize; } diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 1fd6247a6..ff3f6bec3 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -31,6 +31,14 @@ export const modelRolesSchema = z.enum([ ]); export type ModelRole = z.infer; +// TODO consider just using array of strings for model capabilities +// To allow more dynamic string parsing +export const modelCapabilitySchema = z.union([ + z.literal("tool_use"), + z.literal("image_input"), +]); +export type ModelCapability = z.infer; + export const completionOptionsSchema = z.object({ contextLength: z.number().optional(), maxTokens: z.number().optional(), @@ -61,6 +69,7 @@ const baseModelFields = { apiKey: z.string().optional(), apiBase: z.string().optional(), roles: modelRolesSchema.array().optional(), + capabilities: modelCapabilitySchema.array().optional(), defaultCompletionOptions: completionOptionsSchema.optional(), requestOptions: requestOptionsSchema.optional(), embedOptions: embedOptionsSchema.optional(), From 84066e35f3b5ac7515aee64af63a977f09432b8e Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 4 Mar 2025 09:59:30 -0800 Subject: [PATCH 061/319] yaml example --- docs/docs/yaml-reference.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/docs/yaml-reference.md b/docs/docs/yaml-reference.md index 9de133cd7..5a4263ef3 100644 --- a/docs/docs/yaml-reference.md +++ b/docs/docs/yaml-reference.md @@ -134,6 +134,7 @@ The `models` section defines the language models used in your configuration. Mod - `provider` (**required**): The provider of the model (e.g., `openai`, `ollama`). - `model` (**required**): The specific model name (e.g., `gpt-4`, `starcoder`). - `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used. +- `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. Supported capabilities include `tool_use` and `image_input`. - `embedOptions`: If the model includes role `embed`, these settings apply for embeddings: - `maxChunkSize`: Maximum tokens per document chunk. Minimum is 128 tokens. @@ -187,6 +188,17 @@ models: model: codestral-latest roles: - autocomplete + + - name: My Model - OpenAI-Compatible + provider: openai + apiBase: http://my-endpoint/v1 + model: my-custom-model + capabilities: + - tool_use + - image_input + roles: + - chat + - edit ``` --- From c707feb5bd787d1feb54e8b2ac9cfc68985fdac0 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 4 Mar 2025 11:11:27 -0800 Subject: [PATCH 062/319] bump and release new config yaml version --- packages/config-yaml/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 9433fbc30..9163700c4 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.52", + "version": "1.0.53", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", From 93193606654d001ff0d98b1c40677ff8aa6a4d88 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 4 Mar 2025 14:06:07 -0800 Subject: [PATCH 063/319] blocktype param --- docs/docs/customize/deep-dives/development-data.md | 2 +- docs/docs/customize/deep-dives/docs.mdx | 2 +- docs/docs/customize/deep-dives/prompt-files.md | 2 +- docs/docs/customize/deep-dives/rules.md | 2 +- docs/docs/customize/tools.mdx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/customize/deep-dives/development-data.md b/docs/docs/customize/deep-dives/development-data.md index 976c02833..da9f5136c 100644 --- a/docs/docs/customize/deep-dives/development-data.md +++ b/docs/docs/customize/deep-dives/development-data.md @@ -14,7 +14,7 @@ You can read more about how development data is generated as a byproduct of LLM- You can also configure custom destinations for your data, including remote HTTP endpoints and local file directories. -For hub assistants, data destinations are configured in `data` blocks. Visit the hub to [explore example data blocks](https://hub.continue.dev/explore/data) or [create your own](https://hub.continue.dev/new?type=block&block=data). +For hub assistants, data destinations are configured in `data` blocks. Visit the hub to [explore example data blocks](https://hub.continue.dev/explore/data) or [create your own](https://hub.continue.dev/new?type=block&blockType=data). See more details about adding `data` blocks to your configuration files in the [YAML specification](../../yaml-reference.md#data) diff --git a/docs/docs/customize/deep-dives/docs.mdx b/docs/docs/customize/deep-dives/docs.mdx index 7a5be2263..4a2aac376 100644 --- a/docs/docs/customize/deep-dives/docs.mdx +++ b/docs/docs/customize/deep-dives/docs.mdx @@ -64,7 +64,7 @@ Pre-indexed docs are only available in VS Code because the VS Code extension shi ### Hub `docs` Blocks -@Docs uses [`docs` blocks](../../hub/blocks/block-types.md#docs) in Assistants from the hub. Visit the hub to [explore `docs` blocks](https://hub.continue.dev/explore/docs) or [create your own](https://hub.continue.dev/new?type=block&block=docs). +@Docs uses [`docs` blocks](../../hub/blocks/block-types.md#docs) in Assistants from the hub. Visit the hub to [explore `docs` blocks](https://hub.continue.dev/explore/docs) or [create your own](https://hub.continue.dev/new?type=block&blockType=docs). ### Through the `@Docs` Context Provider diff --git a/docs/docs/customize/deep-dives/prompt-files.md b/docs/docs/customize/deep-dives/prompt-files.md index 1ab90e94a..f5c834c17 100644 --- a/docs/docs/customize/deep-dives/prompt-files.md +++ b/docs/docs/customize/deep-dives/prompt-files.md @@ -4,7 +4,7 @@ title: Prompt files Prompt files provide a convenient way to standardize common patterns and share a collection of LLM prompts with your team. They make it easy to build and use these prompts. -On the [hub](../../hub/introduction.md), prompt files are stored within [prompt blocks](../../hub/blocks/block-types.md#prompts), which show up as [slash commands](../slash-commands.mdx) in Chat. Visit the hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&block=rules). +On the [hub](../../hub/introduction.md), prompt files are stored within [prompt blocks](../../hub/blocks/block-types.md#prompts), which show up as [slash commands](../slash-commands.mdx) in Chat. Visit the hub to [explore prompts](https://hub.continue.dev/explore/prompts) or [create your own](https://hub.continue.dev/new?type=block&blockType=rules). Prompt files can also be stored within your project's root directory as `.prompt` files. See below. diff --git a/docs/docs/customize/deep-dives/rules.md b/docs/docs/customize/deep-dives/rules.md index eac9137ce..59f816c15 100644 --- a/docs/docs/customize/deep-dives/rules.md +++ b/docs/docs/customize/deep-dives/rules.md @@ -9,7 +9,7 @@ Rules are used to provide instructions to **chat** models. They are inserted int ## Hub `rules` blocks -Rules can be added to an Assistant on the Continue Hub. Explore available rules [here](https://hub.continue.dev/explore/rules), or [create your own](https://hub.continue.dev/new?type=block&block=rules) in the Hub. +Rules can be added to an Assistant on the Continue Hub. Explore available rules [here](https://hub.continue.dev/explore/rules), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub. ## `.continuerules` diff --git a/docs/docs/customize/tools.mdx b/docs/docs/customize/tools.mdx index 45280697e..1aad549f1 100644 --- a/docs/docs/customize/tools.mdx +++ b/docs/docs/customize/tools.mdx @@ -30,7 +30,7 @@ Currently custom tools can be configured using the [Model Context Protocol](http MCP Servers can be added to hub Assistants using `mcpServers` blocks. You can explore available MCP server blocks [here](https://hub.continue.dev/explore/mcp). -To set up your own MCP server, read the [MCP quickstart](https://modelcontextprotocol.io/quickstart) and then [create an `mcpServers` block](https://hub.continue.dev/new?type=block&block=mcpServers) or add the following to your [config file](../customize/deep-dives/configuration.md): +To set up your own MCP server, read the [MCP quickstart](https://modelcontextprotocol.io/quickstart) and then [create an `mcpServers` block](https://hub.continue.dev/new?type=block&blockType=mcpServers) or add the following to your [config file](../customize/deep-dives/configuration.md): From e740278ce59e94bfdddd734a4e056aba1e283334 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Tue, 4 Mar 2025 20:03:32 -0800 Subject: [PATCH 064/319] fix-stdout-terminal --- core/tools/implementations/runTerminalCommand.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index ccb79f290..9196cca2a 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -1,8 +1,8 @@ import childProcess from "node:child_process"; import util from "node:util"; -import { ToolImpl } from "."; import { fileURLToPath } from "node:url"; +import { ToolImpl } from "."; const asyncExec = util.promisify(childProcess.exec); @@ -26,7 +26,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { { name: "Terminal", description: "Terminal command output", - content: error.stderr ?? error.toString(), + content: error.stderr || error.stdout || error.toString(), }, ]; } From e51a185148386d1c3169e11523fb06d246998eab Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Wed, 5 Mar 2025 07:43:05 +0100 Subject: [PATCH 065/319] revert package changes --- core/llm/llms/Bedrock.ts | 4 +- core/package-lock.json | 1761 +-------------------------- core/package.json | 2 +- extensions/vscode/package-lock.json | 4 +- 4 files changed, 52 insertions(+), 1719 deletions(-) diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index a9b05c437..de5b50fea 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -135,8 +135,8 @@ class Bedrock extends BaseLLM { } // Handle text content - if (chunk.contentBlockDelta.delta.reasoningContent?.text) { - yield { role: "thinking", content: chunk.contentBlockDelta.delta.reasoningContent.text }; + if ((chunk.contentBlockDelta.delta as any).reasoningContent?.text) { + yield { role: "thinking", content: (chunk.contentBlockDelta.delta as any).reasoningContent.text }; continue; } diff --git a/core/package-lock.json b/core/package-lock.json index aaa3fbf29..abe4271f8 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.13", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-bedrock-runtime": "^3.758", + "@aws-sdk/client-bedrock-runtime": "^3.620.1", "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", @@ -288,998 +288,60 @@ } }, "node_modules/@aws-sdk/client-bedrock-runtime": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.758.0.tgz", - "integrity": "sha512-T7s+fULUxN3AcJP+lgoUKLawzVEtyCTi+5Ga+wrHnqEPwAsM/wg7VctsZfow1fCgARLT/lzmP2LTCi8ycRnQWg==", + "version": "3.706.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.706.0.tgz", + "integrity": "sha512-Wxzv0VgC1JFDFEnnmCCpKCXYpe+CfANY+ljY7HBSF2zJDasBHKpM4z28sN5nuffJgsBbkIDWltWbNnXKP/cONA==", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/credential-provider-node": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/eventstream-serde-browser": "^4.0.1", - "@smithy/eventstream-serde-config-resolver": "^4.0.1", - "@smithy/eventstream-serde-node": "^4.0.1", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/client-sso-oidc": "3.699.0", + "@aws-sdk/client-sts": "3.699.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.699.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/eventstream-serde-browser": "^3.0.13", + "@smithy/eventstream-serde-config-resolver": "^3.0.10", + "@smithy/eventstream-serde-node": "^3.0.12", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-stream": "^3.3.1", + "@smithy/util-utf8": "^3.0.0", "@types/uuid": "^9.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/client-sso": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.758.0.tgz", - "integrity": "sha512-BoGO6IIWrLyLxQG6txJw6RT2urmbtlwfggapNCrNPyYjlXpzTSJhBYjndg7TpDATFd0SXL0zm8y/tXsUXNkdYQ==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", - "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.758.0.tgz", - "integrity": "sha512-N27eFoRrO6MeUNumtNHDW9WOiwfd59LPXPqDrIa3kWL/s+fOKFHb9xIcF++bAwtcZnAxKkgpDCUP+INNZskE+w==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.758.0.tgz", - "integrity": "sha512-Xt9/U8qUCiw1hihztWkNeIR+arg6P+yda10OuCHX6kFVx3auTlU7+hCqs3UxqniGU4dguHuftf3mRpi5/GJ33Q==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.758.0.tgz", - "integrity": "sha512-cymSKMcP5d+OsgetoIZ5QCe1wnp2Q/tq+uIxVdh9MbfdBBEnl9Ecq6dH6VlYS89sp4QKuxHxkWXVnbXU3Q19Aw==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/credential-provider-env": "3.758.0", - "@aws-sdk/credential-provider-http": "3.758.0", - "@aws-sdk/credential-provider-process": "3.758.0", - "@aws-sdk/credential-provider-sso": "3.758.0", - "@aws-sdk/credential-provider-web-identity": "3.758.0", - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.758.0.tgz", - "integrity": "sha512-+DaMv63wiq7pJrhIQzZYMn4hSarKiizDoJRvyR7WGhnn0oQ/getX9Z0VNCV3i7lIFoLNTb7WMmQ9k7+z/uD5EQ==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.758.0", - "@aws-sdk/credential-provider-http": "3.758.0", - "@aws-sdk/credential-provider-ini": "3.758.0", - "@aws-sdk/credential-provider-process": "3.758.0", - "@aws-sdk/credential-provider-sso": "3.758.0", - "@aws-sdk/credential-provider-web-identity": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.758.0.tgz", - "integrity": "sha512-AzcY74QTPqcbXWVgjpPZ3HOmxQZYPROIBz2YINF0OQk0MhezDWV/O7Xec+K1+MPGQO3qS6EDrUUlnPLjsqieHA==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.758.0.tgz", - "integrity": "sha512-x0FYJqcOLUCv8GLLFDYMXRAQKGjoM+L0BG4BiHYZRDf24yQWFCAZsCQAYKo6XZYh2qznbsW6f//qpyJ5b0QVKQ==", - "dependencies": { - "@aws-sdk/client-sso": "3.758.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/token-providers": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.758.0.tgz", - "integrity": "sha512-XGguXhBqiCXMXRxcfCAVPlMbm3VyJTou79r/3mxWddHWF0XbhaQiBIbUz6vobVTD25YQRbWSmSch7VA8kI5Lrw==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", - "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-logger": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", - "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", - "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", - "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@smithy/core": "^3.1.5", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", - "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/token-providers": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.758.0.tgz", - "integrity": "sha512-ckptN1tNrIfQUaGWm/ayW1ddG+imbKN7HHhjFdS4VfItsP0QQOB0+Ov+tpgb4MoNR4JaUghMIVStjIeHN2ks1w==", - "dependencies": { - "@aws-sdk/nested-clients": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/types": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", - "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-endpoints": { - "version": "3.743.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", - "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "@smithy/util-endpoints": "^3.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", - "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", - "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/abort-controller": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", - "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/config-resolver": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", - "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", - "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", - "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/credential-provider-imds": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", - "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-codec": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.1.tgz", - "integrity": "sha512-Q2bCAAR6zXNVtJgifsU16ZjKGqdw/DyecKNgIgi7dlqw04fqDu0mnq+JmGphqheypVc64CYq3azSuCpAdFk2+A==", - "dependencies": { - "@aws-crypto/crc32": "5.2.0", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-browser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.1.tgz", - "integrity": "sha512-HbIybmz5rhNg+zxKiyVAnvdM3vkzjE6ccrJ620iPL8IXcJEntd3hnBl+ktMwIy12Te/kyrSbUb8UCdnUT4QEdA==", - "dependencies": { - "@smithy/eventstream-serde-universal": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-config-resolver": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.0.1.tgz", - "integrity": "sha512-lSipaiq3rmHguHa3QFF4YcCM3VJOrY9oq2sow3qlhFY+nBSTF/nrO82MUQRPrxHQXA58J5G1UnU2WuJfi465BA==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-node": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.1.tgz", - "integrity": "sha512-o4CoOI6oYGYJ4zXo34U8X9szDe3oGjmHgsMGiZM0j4vtNoT+h80TLnkUcrLZR3+E6HIxqW+G+9WHAVfl0GXK0Q==", - "dependencies": { - "@smithy/eventstream-serde-universal": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/eventstream-serde-universal": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.1.tgz", - "integrity": "sha512-Z94uZp0tGJuxds3iEAZBqGU2QiaBHP4YytLUjwZWx+oUeohCsLyUm33yp4MMBmhkuPqSbQCXq5hDet6JGUgHWA==", - "dependencies": { - "@smithy/eventstream-codec": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", - "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", - "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/hash-node": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", - "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", - "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/invalid-dependency": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", - "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", - "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-content-length": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", - "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", - "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", - "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", - "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-retry": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", - "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/service-error-classification": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", - "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", - "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", - "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", - "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", - "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", - "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", - "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", - "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/querystring-builder": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", - "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", - "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-uri-escape": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/querystring-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", - "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/service-error-classification": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", - "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", - "dependencies": { - "@smithy/types": "^4.1.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", - "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", - "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/smithy-client": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", - "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", - "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/types": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", - "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", - "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", - "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-base64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", - "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", - "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", - "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-body-length-node": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", - "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-buffer-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", - "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", - "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", - "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", - "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", - "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", - "dependencies": { - "@smithy/config-resolver": "^4.0.1", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-endpoints": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", - "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", - "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", - "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-retry": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", - "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", - "dependencies": { - "@smithy/service-error-classification": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-stream": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", - "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", - "dependencies": { - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", - "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", - "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", - "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "node": ">=16.0.0" } }, "node_modules/@aws-sdk/client-cognito-identity": { @@ -1793,735 +855,6 @@ "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/nested-clients": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.758.0.tgz", - "integrity": "sha512-YZ5s7PSvyF3Mt2h1EQulCG93uybprNGbBkPmVuy/HMMfbFTt4iL3SbKjxqvOZelm86epFfj7pvK7FliI2WOEcg==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.758.0", - "@aws-sdk/middleware-host-header": "3.734.0", - "@aws-sdk/middleware-logger": "3.734.0", - "@aws-sdk/middleware-recursion-detection": "3.734.0", - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/region-config-resolver": "3.734.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@aws-sdk/util-user-agent-browser": "3.734.0", - "@aws-sdk/util-user-agent-node": "3.758.0", - "@smithy/config-resolver": "^4.0.1", - "@smithy/core": "^3.1.5", - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/hash-node": "^4.0.1", - "@smithy/invalid-dependency": "^4.0.1", - "@smithy/middleware-content-length": "^4.0.1", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-retry": "^4.0.7", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/protocol-http": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.7", - "@smithy/util-defaults-mode-node": "^4.0.7", - "@smithy/util-endpoints": "^3.0.1", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/core": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", - "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/core": "^3.1.5", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/signature-v4": "^5.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", - "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-logger": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", - "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", - "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", - "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", - "dependencies": { - "@aws-sdk/core": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@aws-sdk/util-endpoints": "3.743.0", - "@smithy/core": "^3.1.5", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", - "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/types": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", - "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-endpoints": { - "version": "3.743.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", - "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "@smithy/util-endpoints": "^3.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.734.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", - "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", - "dependencies": { - "@aws-sdk/types": "3.734.0", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.758.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", - "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.758.0", - "@aws-sdk/types": "3.734.0", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/abort-controller": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", - "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/config-resolver": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", - "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", - "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", - "dependencies": { - "@smithy/middleware-serde": "^4.0.2", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-stream": "^4.1.2", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/credential-provider-imds": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", - "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/fetch-http-handler": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", - "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", - "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/hash-node": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", - "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", - "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/invalid-dependency": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", - "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", - "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-content-length": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", - "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", - "dependencies": { - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-endpoint": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", - "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", - "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-serde": "^4.0.2", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "@smithy/url-parser": "^4.0.1", - "@smithy/util-middleware": "^4.0.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-retry": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", - "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/service-error-classification": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-retry": "^4.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-serde": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", - "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/middleware-stack": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", - "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-config-provider": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", - "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", - "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/shared-ini-file-loader": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", - "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", - "dependencies": { - "@smithy/abort-controller": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/querystring-builder": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/property-provider": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", - "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/protocol-http": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", - "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/querystring-builder": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", - "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", - "dependencies": { - "@smithy/types": "^4.1.0", - "@smithy/util-uri-escape": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/querystring-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", - "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/service-error-classification": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", - "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", - "dependencies": { - "@smithy/types": "^4.1.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", - "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/signature-v4": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", - "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.1", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/smithy-client": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", - "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", - "dependencies": { - "@smithy/core": "^3.1.5", - "@smithy/middleware-endpoint": "^4.0.6", - "@smithy/middleware-stack": "^4.0.1", - "@smithy/protocol-http": "^5.0.1", - "@smithy/types": "^4.1.0", - "@smithy/util-stream": "^4.1.2", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/types": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", - "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/url-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", - "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", - "dependencies": { - "@smithy/querystring-parser": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-base64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", - "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", - "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", - "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-body-length-node": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", - "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-buffer-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", - "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", - "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", - "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", - "dependencies": { - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", - "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", - "dependencies": { - "@smithy/config-resolver": "^4.0.1", - "@smithy/credential-provider-imds": "^4.0.1", - "@smithy/node-config-provider": "^4.0.1", - "@smithy/property-provider": "^4.0.1", - "@smithy/smithy-client": "^4.1.6", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-endpoints": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", - "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", - "dependencies": { - "@smithy/node-config-provider": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", - "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-middleware": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", - "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", - "dependencies": { - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-retry": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", - "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", - "dependencies": { - "@smithy/service-error-classification": "^4.0.1", - "@smithy/types": "^4.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-stream": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", - "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", - "dependencies": { - "@smithy/fetch-http-handler": "^5.0.1", - "@smithy/node-http-handler": "^4.0.3", - "@smithy/types": "^4.1.0", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", - "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", - "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", - "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@aws-sdk/region-config-resolver": { "version": "3.696.0", "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.696.0.tgz", diff --git a/core/package.json b/core/package.json index f2f523a72..a88bf0cf1 100644 --- a/core/package.json +++ b/core/package.json @@ -42,7 +42,7 @@ "ts-jest": "^29.1.1" }, "dependencies": { - "@aws-sdk/client-bedrock-runtime": "^3.758", + "@aws-sdk/client-bedrock-runtime": "^3.620.1", "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index cbcebc34e..9b61f1900 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.3", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.3", + "version": "1.1.2", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", From 93602e367b37f4be6d8c55d43819be95692c655e Mon Sep 17 00:00:00 2001 From: ferenci84 Date: Wed, 5 Mar 2025 11:41:55 +0100 Subject: [PATCH 066/319] Add ThinkingBlockPeek component and integrate it in Chat.tsx --- .../mainInput/ThinkingBlockPeek.tsx | 100 ++++++++++++++++++ gui/src/pages/gui/Chat.tsx | 11 +- 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 gui/src/components/mainInput/ThinkingBlockPeek.tsx diff --git a/gui/src/components/mainInput/ThinkingBlockPeek.tsx b/gui/src/components/mainInput/ThinkingBlockPeek.tsx new file mode 100644 index 000000000..969b67606 --- /dev/null +++ b/gui/src/components/mainInput/ThinkingBlockPeek.tsx @@ -0,0 +1,100 @@ +// src/components/ThinkingBlockPeek.tsx +import { + ChevronDownIcon, + ChevronRightIcon, + LightBulbIcon, +} from "@heroicons/react/24/outline"; +import { ChatHistoryItem } from "core"; +import { useState } from "react"; +import styled from "styled-components"; +import { lightGray, vscBackground } from ".."; +import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview"; + +const MarkdownWrapper = styled.div` + & > div > *:first-child { + margin-top: 0 !important; + } +`; + +interface ThinkingBlockPeekProps { + content: string; + redactedThinking?: string; + index: number; + prevItem: ChatHistoryItem | null; + signature?: string; +} + +function ThinkingBlockPeek({ + content, + redactedThinking, + index, + prevItem, + signature, +}: ThinkingBlockPeekProps) { + const [open, setOpen] = useState(false); + + const duplicateRedactedThinkingBlock = + prevItem && + prevItem.message.role === "thinking" && + redactedThinking && + prevItem.message.redactedThinking; + + return duplicateRedactedThinkingBlock ? null : ( +
+
+
setOpen((prev) => !prev)} + data-testid="thinking-block-peek" + > +
+ + +
+ + + {redactedThinking ? "Redacted Thinking" : "AI Reasoning"} + +
+ +
+ {redactedThinking ? ( +
+ Thinking content redacted due to safety reasons. +
+ ) : ( + <> + + + + + )} +
+
+
+ ); +} + +export default ThinkingBlockPeek; diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 51c164799..a5fb7481a 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -7,7 +7,7 @@ import { import { Editor, JSONContent } from "@tiptap/react"; import { InputModifiers, RangeInFileWithContents, ToolCallState } from "core"; import { streamResponse } from "core/llm/stream"; -import { stripImages } from "core/util/messageContent"; +import { renderChatMessage, stripImages } from "core/util/messageContent"; import { usePostHog } from "posthog-js/react"; import { useCallback, useContext, useEffect, useRef, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; @@ -28,6 +28,7 @@ import ChatIndexingPeeks from "../../components/indexing/ChatIndexingPeeks"; import ContinueInputBox from "../../components/mainInput/ContinueInputBox"; import { NewSessionButton } from "../../components/mainInput/NewSessionButton"; import resolveEditorContent from "../../components/mainInput/resolveInput"; +import ThinkingBlockPeek from "../../components/mainInput/ThinkingBlockPeek"; import { TutorialCard } from "../../components/mainInput/TutorialCard"; import AssistantSelect from "../../components/modelSelection/platform/AssistantSelect"; import { @@ -448,6 +449,14 @@ export function Chat() { ); })} + ) : item.message.role === "thinking" ? ( + 0 ? history[index - 1] : null} + signature={item.message.signature} + /> ) : (
Date: Wed, 5 Mar 2025 11:47:53 +0100 Subject: [PATCH 067/319] Fix invalid mime type in Jetbrains IDE connection.url.toString() contains values like: jar:file:/Users/some.username/Library/Application%20Support/JetBrains/IntelliJIdea2024.3/plugins/continue-intellij-extension/lib/instrumented-continue-intellij-extension-1.0.2.jar!/webview/index.html if user has "js" in his home folder name then index.html will be treated as text/javascript and continue dev sidebar will output html source code instead of working app --- .../factories/CustomhandlerFactory.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories/CustomhandlerFactory.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories/CustomhandlerFactory.kt index 1c683253d..489ef9006 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories/CustomhandlerFactory.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories/CustomhandlerFactory.kt @@ -111,7 +111,10 @@ class OpenedConnection(private val connection: URLConnection?) : ) { try { if (connection != null) { - val url = connection.url.toString() + val fullUrl = connection.url.toString() + // Extract only the resource path after the JAR prefix to prevent incorrect mime type matching + // (e.g., if a user's home folder contains "js" in the path) + val url = fullUrl.substringAfterLast("jar!/", fullUrl) when { url.contains("css") -> cefResponse.mimeType = "text/css" url.contains("js") -> cefResponse.mimeType = "text/javascript" From 02908229ad95b4667fed421b3215dbc10ec787c3 Mon Sep 17 00:00:00 2001 From: "nghi.vo" Date: Thu, 6 Mar 2025 03:03:20 +0700 Subject: [PATCH 068/319] Fix vllm setup, json.data is an array and is accessed as such. Also add autodetect behaviour in case multiple model deployement is supported in the future --- core/llm/llms/Vllm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/llm/llms/Vllm.ts b/core/llm/llms/Vllm.ts index c9308d771..7273a67f6 100644 --- a/core/llm/llms/Vllm.ts +++ b/core/llm/llms/Vllm.ts @@ -6,7 +6,10 @@ class Vllm extends OpenAI { static providerName = "vllm"; constructor(options: LLMOptions) { super(options); - this._setupCompletionOptions(); + + if (options.model === "AUTODETECT") { + this._setupCompletionOptions(); + } } private _setupCompletionOptions() { @@ -22,7 +25,7 @@ class Vllm extends OpenAI { return; } const json = await response.json(); - const data = json.data; + const data = json.data[0]; this.model = data.id; this.contextLength = Number.parseInt(data.max_model_len); }); From 85804ff9e54adf30f1a4b23b3003b39338a82065 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 5 Mar 2025 13:13:30 -0800 Subject: [PATCH 069/319] feat: smaller headings, use assistant name --- extensions/vscode/package-lock.json | 4 +- gui/src/components/PageHeader.tsx | 10 +- .../markdown/StyledMarkdownPreview.tsx | 24 +++ .../platform/AssistantSelect.tsx | 9 +- .../platform/AssistantSelectOptions.tsx | 9 +- .../modelSelection/platform/utils.ts | 6 - gui/src/pages/More/More.tsx | 2 +- gui/src/pages/config/index.tsx | 182 ++++++++++-------- gui/src/pages/history/index.tsx | 2 +- 9 files changed, 141 insertions(+), 107 deletions(-) delete mode 100644 gui/src/components/modelSelection/platform/utils.ts diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index cbcebc34e..ed46978a0 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.3", + "version": "1.1.4", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index 22755926e..bc759df2b 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -4,15 +4,23 @@ export interface PageHeaderProps { onTitleClick?: () => void; title?: string; rightContent?: React.ReactNode; + showBorder?: boolean; // Added this prop } export default function PageHeader({ onTitleClick, title, rightContent, + showBorder, }: PageHeaderProps) { return ( -
+
{title && (
` + h1 { + font-size: 1.25em; + } + + h2 { + font-size: 1.15em; + } + + h3 { + font-size: 1.05em; + } + + h4 { + font-size: 1em; + } + + h5 { + font-size: 0.95em; + } + + h6 { + font-size: 0.9em; + } + pre { white-space: ${(props) => props.whiteSpace}; background-color: ${vscEditorBackground}; diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 629f0fe14..a4dde488d 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -10,7 +10,6 @@ import { getFontSize, isMetaEquivalentKeyPressed } from "../../../util"; import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition"; import AssistantIcon from "./AssistantIcon"; import { AssistantSelectOptions } from "./AssistantSelectOptions"; -import { getProfileDisplayText } from "./utils"; function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) { return ( @@ -18,9 +17,7 @@ function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) {
- - {getProfileDisplayText(props.selectedProfile)} - + {props.selectedProfile.title}
); @@ -29,7 +26,7 @@ function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) { export default function AssistantSelect() { const dispatch = useAppDispatch(); const buttonRef = useRef(null); - const { selectedProfile, selectedOrganization, profiles } = useAuth(); + const { selectedProfile, selectedOrganization } = useAuth(); const ideMessenger = useContext(IdeMessengerContext); useEffect(() => { @@ -87,7 +84,7 @@ export default function AssistantSelect() { - + { if (buttonRef.current) { diff --git a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx index c0b7e6071..cd8d5cd5c 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx @@ -11,7 +11,6 @@ import { getFontSize, getMetaKeyLabel, isLocalProfile } from "../../../util"; import { ROUTES } from "../../../util/navigation"; import AssistantIcon from "./AssistantIcon"; import { Divider, Option, OptionDiv } from "./shared"; -import { getProfileDisplayText } from "./utils"; interface AssistantSelectOptionsProps { onClose: () => void; @@ -49,8 +48,8 @@ export function AssistantSelectOptions({ } return ( -
-
+
+
{profiles.map((profile, idx) => { return (