From 881f8b3139794aca0a6699c3d34ebf8fba01b789 Mon Sep 17 00:00:00 2001 From: Sahil Date: Wed, 23 Apr 2025 17:26:24 +0530 Subject: [PATCH 001/648] perf(llm): Optimize pruneLines functions in countTokens --- core/llm/countTokens.ts | 45 ++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 2fc01f9b8..e6eb73aae 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -157,7 +157,7 @@ function countChatMessageTokens( ): number { // Doing simpler, safer version of what is here: // https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb - // every message follows <|im_start|>{role/name}\n{content}<|end|>\n + // every message follows `{role/name}\n{content}<|end|>\n` const TOKENS_PER_MESSAGE: number = 4; return countTokens(chatMessage.content, modelName) + TOKENS_PER_MESSAGE; } @@ -167,13 +167,27 @@ function pruneLinesFromTop( maxTokens: number, modelName: string, ): string { - let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - while (totalTokens > maxTokens && lines.length > 0) { - totalTokens -= countTokens(lines.shift()!, modelName); + const lineTokens = lines.map((line) => countTokens(line, modelName)); + let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); + let start = 0; + let currentLines = lines.length; + + // Calculate initial token count including newlines + totalTokens += Math.max(0, currentLines - 1); // Add tokens for joining newlines + + // Using indexes instead of array modifications. + // Remove lines from the top until the token count is within the limit. + while (totalTokens > maxTokens && start < currentLines) { + totalTokens -= lineTokens[start]; + // Decrement token count for the removed line and its preceding/joining newline (if not the last line) + if (currentLines - start > 1) { + totalTokens--; + } + start++; } - return lines.join("\n"); + return lines.slice(start).join("\n"); } function pruneLinesFromBottom( @@ -181,13 +195,26 @@ function pruneLinesFromBottom( maxTokens: number, modelName: string, ): string { - let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - while (totalTokens > maxTokens && lines.length > 0) { - totalTokens -= countTokens(lines.pop()!, modelName); + const lineTokens = lines.map((line) => countTokens(line, modelName)); + let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); + let end = lines.length; + + // Calculate initial token count including newlines + totalTokens += Math.max(0, end - 1); // Add tokens for joining newlines + + // Reverse traversal to avoid array modification + // Remove lines from the bottom until the token count is within the limit. + while (totalTokens > maxTokens && end > 0) { + end--; + totalTokens -= lineTokens[end]; + // Decrement token count for the removed line and its following/joining newline (if not the first line) + if (end > 0) { + totalTokens--; + } } - return lines.join("\n"); + return lines.slice(0, end).join("\n"); } function pruneStringFromBottom( From 28cdd1cee25973aa9a8a5cfdcbcc436e0b7f6240 Mon Sep 17 00:00:00 2001 From: Sahil Date: Wed, 23 Apr 2025 17:34:22 +0530 Subject: [PATCH 002/648] perf(llm): Optimize pruneLines functions in countTokens --- core/llm/countTokens.ts | 48 ++++++++++------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index e6eb73aae..5bb4ff198 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -157,7 +157,7 @@ function countChatMessageTokens( ): number { // Doing simpler, safer version of what is here: // https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb - // every message follows `{role/name}\n{content}<|end|>\n` + // every message follows <|im_start|>{role/name}\n{content}<|end|>\n const TOKENS_PER_MESSAGE: number = 4; return countTokens(chatMessage.content, modelName) + TOKENS_PER_MESSAGE; } @@ -167,27 +167,13 @@ function pruneLinesFromTop( maxTokens: number, modelName: string, ): string { + let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - const lineTokens = lines.map((line) => countTokens(line, modelName)); - let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); - let start = 0; - let currentLines = lines.length; - - // Calculate initial token count including newlines - totalTokens += Math.max(0, currentLines - 1); // Add tokens for joining newlines - - // Using indexes instead of array modifications. - // Remove lines from the top until the token count is within the limit. - while (totalTokens > maxTokens && start < currentLines) { - totalTokens -= lineTokens[start]; - // Decrement token count for the removed line and its preceding/joining newline (if not the last line) - if (currentLines - start > 1) { - totalTokens--; - } - start++; + while (totalTokens > maxTokens && lines.length > 0) { + totalTokens -= countTokens(lines.shift()!, modelName); } - return lines.slice(start).join("\n"); + return lines.join("\n"); } function pruneLinesFromBottom( @@ -195,26 +181,13 @@ function pruneLinesFromBottom( maxTokens: number, modelName: string, ): string { + let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - const lineTokens = lines.map((line) => countTokens(line, modelName)); - let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); - let end = lines.length; - - // Calculate initial token count including newlines - totalTokens += Math.max(0, end - 1); // Add tokens for joining newlines - - // Reverse traversal to avoid array modification - // Remove lines from the bottom until the token count is within the limit. - while (totalTokens > maxTokens && end > 0) { - end--; - totalTokens -= lineTokens[end]; - // Decrement token count for the removed line and its following/joining newline (if not the first line) - if (end > 0) { - totalTokens--; - } + while (totalTokens > maxTokens && lines.length > 0) { + totalTokens -= countTokens(lines.pop()!, modelName); } - return lines.slice(0, end).join("\n"); + return lines.join("\n"); } function pruneStringFromBottom( @@ -633,5 +606,6 @@ export { pruneLinesFromTop, pruneRawPromptFromTop, pruneStringFromBottom, - pruneStringFromTop, + pruneStringFromTop }; + From 35b3189538da5891617a79ba9c0badb0bb7dc1bc Mon Sep 17 00:00:00 2001 From: Sahil Date: Wed, 23 Apr 2025 17:39:48 +0530 Subject: [PATCH 003/648] perf(llm): Optimize pruneLines functions in countTokens --- core/llm/countTokens.ts | 45 ++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 5bb4ff198..265a92853 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -167,13 +167,28 @@ function pruneLinesFromTop( maxTokens: number, modelName: string, ): string { - let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - while (totalTokens > maxTokens && lines.length > 0) { - totalTokens -= countTokens(lines.shift()!, modelName); + // Preprocess tokens for all lines and cache them. + const lineTokens = lines.map((line) => countTokens(line, modelName)); + let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); + let start = 0; + let currentLines = lines.length; + + // Calculate initial token count including newlines + totalTokens += Math.max(0, currentLines - 1); // Add tokens for joining newlines + + // Using indexes instead of array modifications. + // Remove lines from the top until the token count is within the limit. + while (totalTokens > maxTokens && start < currentLines) { + totalTokens -= lineTokens[start]; + // Decrement token count for the removed line and its preceding/joining newline (if not the last line) + if (currentLines - start > 1) { + totalTokens--; + } + start++; } - return lines.join("\n"); + return lines.slice(start).join("\n"); } function pruneLinesFromBottom( @@ -181,13 +196,26 @@ function pruneLinesFromBottom( maxTokens: number, modelName: string, ): string { - let totalTokens = countTokens(prompt, modelName); const lines = prompt.split("\n"); - while (totalTokens > maxTokens && lines.length > 0) { - totalTokens -= countTokens(lines.pop()!, modelName); + const lineTokens = lines.map((line) => countTokens(line, modelName)); + let totalTokens = lineTokens.reduce((sum, tokens) => sum + tokens, 0); + let end = lines.length; + + // Calculate initial token count including newlines + totalTokens += Math.max(0, end - 1); // Add tokens for joining newlines + + // Reverse traversal to avoid array modification + // Remove lines from the bottom until the token count is within the limit. + while (totalTokens > maxTokens && end > 0) { + end--; + totalTokens -= lineTokens[end]; + // Decrement token count for the removed line and its following/joining newline (if not the first line) + if (end > 0) { + totalTokens--; + } } - return lines.join("\n"); + return lines.slice(0, end).join("\n"); } function pruneStringFromBottom( @@ -608,4 +636,3 @@ export { pruneStringFromBottom, pruneStringFromTop }; - From 96254ab37861a3c02b4898cec262accb2cad2592 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 1 May 2025 21:50:26 +0530 Subject: [PATCH 004/648] get secrets from /.continue folder --- core/config/yaml/LocalPlatformClient.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/config/yaml/LocalPlatformClient.ts b/core/config/yaml/LocalPlatformClient.ts index 3c8cc33bb..9bcc7e53e 100644 --- a/core/config/yaml/LocalPlatformClient.ts +++ b/core/config/yaml/LocalPlatformClient.ts @@ -17,12 +17,16 @@ export class LocalPlatformClient implements PlatformClient { private readonly ide: IDE, ) {} + /** + * searches for the first valid secret file in order of ~/.continue/.env, /.continue/.env, /.env + */ private async findSecretInEnvFiles( fqsn: FQSN, ): Promise { const secretValue = this.findSecretInLocalEnvFile(fqsn) ?? - (await this.findSecretInWorkspaceEnvFiles(fqsn)); + (await this.findSecretInWorkspaceEnvFiles(fqsn, true)) ?? + (await this.findSecretInWorkspaceEnvFiles(fqsn, false)); if (secretValue) { return { @@ -52,18 +56,24 @@ export class LocalPlatformClient implements PlatformClient { private async findSecretInWorkspaceEnvFiles( fqsn: FQSN, + insideContinue: boolean, ): Promise { try { const workspaceDirs = await this.ide.getWorkspaceDirs(); for (const folder of workspaceDirs) { - const envFilePath = joinPathsToUri(folder, ".env"); + const envFilePath = joinPathsToUri( + folder, + insideContinue ? ".continue" : "", + ".env", + ); try { const fileExists = await this.ide.fileExists(envFilePath); if (fileExists) { const envContent = await this.ide.readFile(envFilePath); const env = dotenv.parse(envContent); if (fqsn.secretName in env) { + console.log('debug1 secretname', fqsn.secretName, 'envfilepath', envFilePath); return env[fqsn.secretName]; } } From b072c5fee401a5ffc8f5dc437570c6d8b7a5b049 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 2 May 2025 12:07:15 -0700 Subject: [PATCH 005/648] WIP: message abort controllers --- core/core.ts | 94 ++++++++++++++++++------------------ core/edit/streamDiffLines.ts | 9 +++- core/llm/streamChat.ts | 62 +++++++++++------------- 3 files changed, 80 insertions(+), 85 deletions(-) diff --git a/core/core.ts b/core/core.ts index e5c9eeab0..36b4a399c 100644 --- a/core/core.ts +++ b/core/core.ts @@ -35,7 +35,6 @@ import { TTS } from "./util/tts"; import { ContextItemWithId, - DiffLine, IdeSettings, ModelDescription, RangeInFile, @@ -63,43 +62,6 @@ import { llmStreamChat } from "./llm/streamChat"; import type { FromCoreProtocol, ToCoreProtocol } from "./protocol"; import type { IMessenger, Message } from "./protocol/messenger"; -async function* streamDiffLinesGenerator( - configHandler: ConfigHandler, - abortedMessageIds: Set, - msg: Message, -): AsyncGenerator { - const data = msg.data; - - const { config } = await configHandler.loadConfig(); - if (!config) { - throw new Error("Failed to load config"); - } - - const llm = config.selectedModelByRole.chat; - - if (!llm) { - throw new Error("No chat model selected"); - } - - for await (const diffLine of streamDiffLines({ - highlighted: data.highlighted, - prefix: data.prefix, - suffix: data.suffix, - llm, - rules: config.rules, - input: data.input, - language: data.language, - onlyOneInsertion: false, - overridePrompt: undefined, - })) { - if (abortedMessageIds.has(msg.messageId)) { - abortedMessageIds.delete(msg.messageId); - break; - } - yield diffLine; - } -} - export class Core { configHandler: ConfigHandler; codebaseIndexerPromise: Promise; @@ -114,7 +76,18 @@ export class Core { this.globalContext.get("indexingPaused") === true, ); - private abortedMessageIds: Set = new Set(); + private messageAbortControllers = new Map(); + private addMessageAbortController(messageId: string): AbortController { + const controller = new AbortController(); + this.messageAbortControllers.set(messageId, controller); + controller.signal.addEventListener("abort", () => { + this.messageAbortControllers.delete(messageId); + }); + return controller; + } + private abortMessage(messageId: string) { + this.messageAbortControllers.get(messageId)?.abort(); + } invoke( messageType: T, @@ -283,7 +256,7 @@ export class Core { }); on("abort", (msg) => { - this.abortedMessageIds.add(msg.messageId); + this.abortMessage(msg.messageId); }); on("ping", (msg) => { @@ -452,15 +425,16 @@ export class Core { } }); - on("llm/streamChat", (msg) => - llmStreamChat( + on("llm/streamChat", (msg) => { + const abortController = this.addMessageAbortController(msg.messageId); + return llmStreamChat( this.configHandler, - this.abortedMessageIds, + abortController, msg, this.ide, this.messenger, - ), - ); + ); + }); on("llm/complete", async (msg) => { const model = (await this.configHandler.loadConfig()).config @@ -514,9 +488,33 @@ export class Core { this.completionProvider.cancel(); }); - on("streamDiffLines", (msg) => - streamDiffLinesGenerator(this.configHandler, this.abortedMessageIds, msg), - ); + on("streamDiffLines", async (msg) => { + const abortController = this.addMessageAbortController(msg.messageId); + + const { config } = await this.configHandler.loadConfig(); + if (!config) { + throw new Error("Failed to load config"); + } + + const llm = config.selectedModelByRole.chat; + if (!llm) { + throw new Error("No chat model selected"); + } + + const { data } = msg; + return streamDiffLines({ + highlighted: data.highlighted, + prefix: data.prefix, + suffix: data.suffix, + llm, + rules: config.rules, + input: data.input, + language: data.language, + onlyOneInsertion: false, + overridePrompt: undefined, + abortController, + }); + }); on("completeOnboarding", this.handleCompleteOnboarding.bind(this)); diff --git a/core/edit/streamDiffLines.ts b/core/edit/streamDiffLines.ts index 320962b7c..bcf74bf80 100644 --- a/core/edit/streamDiffLines.ts +++ b/core/edit/streamDiffLines.ts @@ -67,6 +67,7 @@ export async function* streamDiffLines({ onlyOneInsertion, overridePrompt, rules, + abortController, }: { prefix: string; highlighted: string; @@ -77,6 +78,7 @@ export async function* streamDiffLines({ onlyOneInsertion: boolean; overridePrompt: ChatMessage[] | undefined; rules: RuleWithSource[]; + abortController: AbortController; }): AsyncGenerator { void Telemetry.capture( "inlineEdit", @@ -158,12 +160,12 @@ export async function* streamDiffLines({ const completion = typeof prompt === "string" - ? llm.streamComplete(prompt, new AbortController().signal, { + ? llm.streamComplete(prompt, abortController.signal, { raw: true, prediction, reasoning: false, }) - : llm.streamChat(prompt, new AbortController().signal, { + : llm.streamChat(prompt, abortController.signal, { prediction, reasoning: false, }); @@ -190,6 +192,9 @@ export async function* streamDiffLines({ let seenGreen = false; for await (const diffLine of diffLines) { + if (abortController.signal.aborted) { + break; + } yield diffLine; if (diffLine.type === "new") { seenGreen = true; diff --git a/core/llm/streamChat.ts b/core/llm/streamChat.ts index 223b5b20e..c899e437f 100644 --- a/core/llm/streamChat.ts +++ b/core/llm/streamChat.ts @@ -8,7 +8,7 @@ import { TTS } from "../util/tts"; export async function* llmStreamChat( configHandler: ConfigHandler, - abortedMessageIds: Set, + abortController: AbortController, msg: Message, ide: IDE, messenger: IMessenger, @@ -75,52 +75,44 @@ export async function* llmStreamChat( selectedCode, config, fetch: (url, init) => - fetchwithRequestOptions(url, init, config.requestOptions), + fetchwithRequestOptions( + url, + { + ...init, + signal: abortController.signal, + }, + config.requestOptions, + ), completionOptions, }); - const checkActiveInterval = setInterval(() => { - if (abortedMessageIds.has(msg.messageId)) { - abortedMessageIds.delete(msg.messageId); - clearInterval(checkActiveInterval); + let next = await gen.next(); + while (!next.done) { + if (abortController.signal.aborted) { + next = await gen.return(errorPromptLog); + break; } - }, 100); - try { - let next = await gen.next(); - while (!next.done) { - if (abortedMessageIds.has(msg.messageId)) { - abortedMessageIds.delete(msg.messageId); - next = await gen.return(errorPromptLog); - clearInterval(checkActiveInterval); - break; - } - if (next.value) { - yield { - role: "assistant", - content: next.value, - }; - } - next = await gen.next(); + if (next.value) { + yield { + role: "assistant", + content: next.value, + }; } - if (!next.done) { - throw new Error("Will never happen"); - } - - return next.value; - } catch (e) { - throw e; - } finally { - clearInterval(checkActiveInterval); + next = await gen.next(); } + if (!next.done) { + throw new Error("Will never happen"); + } + + return next.value; } else { const gen = model.streamChat( messages, - new AbortController().signal, + abortController.signal, completionOptions, ); let next = await gen.next(); while (!next.done) { - if (abortedMessageIds.has(msg.messageId)) { - abortedMessageIds.delete(msg.messageId); + if (abortController.signal.aborted) { next = await gen.return(errorPromptLog); break; } From 0e162ec8e2d40cf8497dd8d145e51a8406c0aaed Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 2 May 2025 22:58:18 -0700 Subject: [PATCH 006/648] test: :white_check_mark: retry on failed llm api tests --- core/llm/llm.test.ts | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/core/llm/llm.test.ts b/core/llm/llm.test.ts index d1067a8bc..eb58f77d0 100644 --- a/core/llm/llm.test.ts +++ b/core/llm/llm.test.ts @@ -22,6 +22,20 @@ const COMPLETION_OPTIONS: Partial = { // maxTokens: 5, }; +/** + * Retries a test function if it fails on the first attempt + * @param testFn The test function to run + * @returns A function that will retry once if the test fails + */ +const retryOnce = (testFn: () => Promise) => async () => { + try { + return await testFn(); + } catch (error) { + console.log("Test failed on first attempt, retrying once..."); + return await testFn(); + } +}; + function testLLM( llm: BaseLLM, { @@ -47,7 +61,7 @@ function testLLM( describe(llm.providerName + "/" + llm.model, () => { test( "Stream Chat works", - async () => { + retryOnce(async () => { let total = ""; for await (const chunk of llm.streamChat( [{ role: "user", content: "Hi" }], @@ -58,13 +72,13 @@ function testLLM( expect(total.length).toBeGreaterThan(0); return; - }, + }), timeout, ); test( "Stream Complete works", - async () => { + retryOnce(async () => { let total = ""; for await (const chunk of llm.streamComplete( "Hi", @@ -75,13 +89,13 @@ function testLLM( expect(total.length).toBeGreaterThan(0); return; - }, + }), timeout, ); test( "Complete works", - async () => { + retryOnce(async () => { const completion = await llm.complete( "Hi", new AbortController().signal, @@ -89,14 +103,14 @@ function testLLM( expect(completion.length).toBeGreaterThan(0); return; - }, + }), timeout, ); if (testFim) { test( "FIM works", - async () => { + retryOnce(async () => { let total = ""; for await (const chunk of llm.streamFim( "Hi", @@ -108,7 +122,7 @@ function testLLM( expect(total.length).toBeGreaterThan(0); return; - }, + }), timeout, ); } @@ -116,7 +130,7 @@ function testLLM( if (testToolCall) { test( "Tool Call works", - async () => { + retryOnce(async () => { let args = ""; let isFirstChunk = true; for await (const chunk of llm.streamChat( @@ -175,7 +189,7 @@ function testLLM( const parsedArgs = JSON.parse(args); expect(parsedArgs.name).toBe("Nate"); - }, + }), timeout, ); } From 6c6e0ad33c3065c713e752701dadbe86629e3ea9 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 6 May 2025 17:49:58 +0530 Subject: [PATCH 007/648] replace vsce with @vscode/vsce --- .github/workflows/main.yaml | 2 +- .github/workflows/preview.yaml | 2 +- extensions/vscode/package.json | 1 - extensions/vscode/scripts/package.js | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 29965a305..0c300bf17 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -235,7 +235,7 @@ jobs: - name: Publish to VS Code Marketplace run: | cd extensions/vscode - npx vsce publish --packagePath ../../vsix-artifacts/*.vsix + npx @vscode/vsce publish --packagePath ../../vsix-artifacts/*.vsix env: VSCE_PAT: ${{ secrets.VSCE_TOKEN }} diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 23ea26bf6..19dafeb41 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -232,7 +232,7 @@ jobs: - name: Publish to VS Code Marketplace run: | cd extensions/vscode - npx vsce publish --pre-release --packagePath ../../vsix-artifacts/*.vsix + npx @vscode/vsce publish --pre-release --packagePath ../../vsix-artifacts/*.vsix env: VSCE_PAT: ${{ secrets.VSCE_TOKEN }} diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index c8297eed7..f4b4c0c02 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -657,7 +657,6 @@ "rimraf": "^5.0.5", "typescript": "^5.6.3", "vite": "^4.5.14", - "vsce": "^2.15.0", "vscode-extension-tester": "^8.10.0" }, "dependencies": { diff --git a/extensions/vscode/scripts/package.js b/extensions/vscode/scripts/package.js index 2fd5177eb..6e3783d6c 100644 --- a/extensions/vscode/scripts/package.js +++ b/extensions/vscode/scripts/package.js @@ -19,8 +19,8 @@ if (!fs.existsSync("build")) { const isPreRelease = args.includes("--pre-release"); let command = isPreRelease - ? "npx vsce package --out ./build --pre-release --no-dependencies" // --yarn" - : "npx vsce package --out ./build --no-dependencies"; // --yarn"; + ? "npx @vscode/vsce package --out ./build --pre-release --no-dependencies" // --yarn" + : "npx @vscode/vsce package --out ./build --no-dependencies"; // --yarn"; if (target) { command += ` --target ${target}`; From fe6d55dd1b4f7f4c5af7dbf71eef590d6b38f907 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 7 May 2025 17:30:57 +0530 Subject: [PATCH 008/648] added localplatformclient test --- core/config/yaml/LocalPlatformClient.test.ts | 96 ++++++++++++++++++++ core/config/yaml/LocalPlatformClient.ts | 1 - 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 core/config/yaml/LocalPlatformClient.test.ts diff --git a/core/config/yaml/LocalPlatformClient.test.ts b/core/config/yaml/LocalPlatformClient.test.ts new file mode 100644 index 000000000..da0a80802 --- /dev/null +++ b/core/config/yaml/LocalPlatformClient.test.ts @@ -0,0 +1,96 @@ +import { FQSN, SecretResult, SecretType } from "@continuedev/config-yaml"; +import { testControlPlaneClient, testIde } from "../../test/fixtures"; +import { LocalPlatformClient } from "./LocalPlatformClient"; + +jest.mock("../../util/paths.ts", () => ({ + ...jest.requireActual("../../util/paths"), + getContinueDotEnv: jest.fn(), +})); + +describe("LocalPlatformClient", () => { + const testFQSN: FQSN = { + packageSlugs: [ + { + ownerSlug: "test-owner-slug", + packageSlug: "test-package-slug", + }, + ], + secretName: "TEST_CONTINUE_SECRET_KEY", + }; + const testResolvedFQSN: SecretResult = { + found: true, + fqsn: testFQSN, + secretLocation: { + secretName: testFQSN.secretName, + secretType: SecretType.Organization, + orgSlug: "test-org-slug", + }, + }; + + afterEach(() => jest.restoreAllMocks()); + + test("should not be able to resolve FQSNs if they do not exist", async () => { + testControlPlaneClient.resolveFQSNs = jest.fn(async () => [ + testResolvedFQSN, + ]); + const localPlatformClient = new LocalPlatformClient( + null, + testControlPlaneClient, + testIde, + ); + const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]); + expect(testControlPlaneClient.resolveFQSNs).toHaveBeenCalled(); + expect(resolvedFQSNs).toEqual([testResolvedFQSN]); + }); + + test("should not be able to resolve FQSNs if they do not exist", async () => { + const localPlatformClient = new LocalPlatformClient( + null, + testControlPlaneClient, + testIde, + ); + const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]); + + expect(resolvedFQSNs.length).toBeGreaterThan(0); + expect(resolvedFQSNs[0]?.found).toBe(false); + }); + + describe.only("searches for secrets in local .env files", () => { + const secretValue = Math.floor(Math.random() * 100) + ""; + const envKeyValues = { + TEST_CONTINUE_SECRET_KEY: secretValue, + }; + const getContinueDotEnv = jest.fn(() => envKeyValues); + + beforeEach(async () => { + // const directoryExists = fs.existsSync("./_tests"); + // if (directoryExists) { + // fs.rmSync("./_tests", { force: true, recursive: true }); + // } + // const envFileContent = `TEST_CONTINUE_SECRET_KEY=${secretValue}`; + // fs.writeFileSync("./_tests/.env", envFileContent); + // utilPaths.getContinueDotEnv = getContinueDotEnv + // const spy = jest.spyOn(utilPaths, 'getContinueDotEnv') + // Object.defineProperty(utilPaths, 'getContinueDotEnv', { + // writable: true, + // configurable: true, + // value: spy.mockImplementation(() => envKeyValues), + // }); + // jest.mock(utilPaths, () => ({ + // ...jest.requireActual(utilPaths), + // getContinueDotEnv: jest.fn().mockReturnValue(envKeyValues) + // })) + }); + + test("should be able to get secrets from global ~/.continue/.env files", async () => { + const localPlatformClient = new LocalPlatformClient( + null, + testControlPlaneClient, + testIde, + ); + const resolvedFQSNs = await localPlatformClient.resolveFQSNs([testFQSN]); + expect(getContinueDotEnv).toHaveBeenCalled(); + console.log("resolved->", resolvedFQSNs); + }); + }); +}); diff --git a/core/config/yaml/LocalPlatformClient.ts b/core/config/yaml/LocalPlatformClient.ts index 9bcc7e53e..4fc9f7fd1 100644 --- a/core/config/yaml/LocalPlatformClient.ts +++ b/core/config/yaml/LocalPlatformClient.ts @@ -73,7 +73,6 @@ export class LocalPlatformClient implements PlatformClient { const envContent = await this.ide.readFile(envFilePath); const env = dotenv.parse(envContent); if (fqsn.secretName in env) { - console.log('debug1 secretname', fqsn.secretName, 'envfilepath', envFilePath); return env[fqsn.secretName]; } } From 4cce42b832f1e5ef000594f07c3947fd423da309 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 7 May 2025 22:46:21 +0530 Subject: [PATCH 009/648] prevent markdown table from breaking on formatted nodes --- .../StyledMarkdownPreview/markdown.css | 7 +++++ .../utils/remarkTables.tsx | 26 ++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gui/src/components/StyledMarkdownPreview/markdown.css b/gui/src/components/StyledMarkdownPreview/markdown.css index c2e79b3a6..f975286ba 100644 --- a/gui/src/components/StyledMarkdownPreview/markdown.css +++ b/gui/src/components/StyledMarkdownPreview/markdown.css @@ -1037,3 +1037,10 @@ body[data-color-mode*="light"] { .token.entity { cursor: help; } +/* +.markdown-table th { + background-color: var(--color-fg-muted); +} +.markdown-table td { + background-color: var(--color-fg-subtle); +} */ \ No newline at end of file diff --git a/gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx b/gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx index f22542c2f..e5c1ea2f5 100644 --- a/gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx +++ b/gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx @@ -22,8 +22,11 @@ import { visit } from "unist-util-visit"; */ export function remarkTables() { return (tree: any) => { - visit(tree, "text", (node, index, parent) => { - const { value } = node; + visit(tree, "paragraph", (paragraphNode, index, parentOfParagraphNode) => { + let buffer = ""; + visit(paragraphNode, "text", (textNode) => { + buffer += textNode.value; + }); const tableRegex = /((?:\| *[^|\r\n]+ *)+\|)(?:\r?\n)((?:\|[ :]?-+[ :]?)+\|)((?:(?:\r?\n)(?:\| *[^|\r\n]+ *)+\|)+)/g; @@ -33,7 +36,8 @@ export function remarkTables() { let lastIndex = 0; const newNodes = []; let failed = false; - while ((match = tableRegex.exec(value)) !== null) { + + while ((match = tableRegex.exec(buffer)) !== null) { const fullTableString = match[0]; const headerGroup = match[1]; const separatorGroup = match[2]; @@ -62,6 +66,11 @@ export function remarkTables() { const tableNode = { type: "table", align: alignments, + data: { + hProperties: { + class: "markdown-table", + }, + }, children: [ { type: "tableRow", @@ -77,7 +86,6 @@ export function remarkTables() { type: "tableRow", data: { hProperties: { - class: "markdown-table", key: i, }, }, @@ -95,7 +103,7 @@ export function remarkTables() { if (match.index > lastIndex) { newNodes.push({ type: "text", - value: value.slice(lastIndex, match.index), + value: buffer.slice(lastIndex, match.index), }); } @@ -117,16 +125,16 @@ export function remarkTables() { } // Add any remaining text after the last table - if (lastIndex < value.length) { + if (lastIndex < buffer.length) { newNodes.push({ type: "text", - value: value.slice(lastIndex), + value: buffer.slice(lastIndex), }); } - // Replace the original text node with the new nodes + // Replace the original paragraph node with the new nodes if (newNodes.length > 0) { - parent.children.splice(index, 1, ...newNodes); + parentOfParagraphNode.children.splice(index, 1, ...newNodes); } }); }; From 5db24e4bbc74395ef4314661fb3da30bc6a744ce Mon Sep 17 00:00:00 2001 From: Zhuyi Xue <527862+zyxue@users.noreply.github.com> Date: Thu, 8 May 2025 15:09:39 -0700 Subject: [PATCH 010/648] handle data:[DONE] more robustly although https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#request-body says >stream boolean Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message but what I see is `data:[DONE]` (without space), e.g. ``` curl -q --location 'http://localhost:8080/openai/deployments/gpt-4o/chat/completions?api-version=2023-07-01-preview' \ --header 'Authorization: Bearer ' \ --header 'X-Forwarded-Client-Cert: secret' \ --header 'Content-Type: application/json' \ --data '{ "stream": true, "messages": [ { "role": "user", "content": "hello." } ] }' data:{"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]} data:{"choices":[{"content_filter_results":{},"delta":{"refusal":null,"role":"assistant"},"finish_reason":null,"index":0}],"created":1746741184,"id":"chatcmpl-BV3SqfEtCuk3f8fW5x7azEkELkJZ0","model":"gpt-4o-2024-05-13","object":"chat.completion.chunk","system_fingerprint":"fp_ee1d74bde0"} ... data:{"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"delta":{"content":"?"},"finish_reason":null,"index":0}],"created":1746741184,"id":"chatcmpl-BV3SqfEtCuk3f8fW5x7azEkELkJZ0","model":"gpt-4o-2024-05-13","object":"chat.completion.chunk","system_fingerprint":"fp_ee1d74bde0"} data:{"choices":[{"content_filter_results":{},"delta":{},"finish_reason":"stop","index":0}],"created":1746741184,"id":"chatcmpl-BV3SqfEtCuk3f8fW5x7azEkELkJZ0","model":"gpt-4o-2024-05-13","object":"chat.completion.chunk","system_fingerprint":"fp_ee1d74bde0"} data:[DONE] ``` --- core/llm/stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/stream.ts b/core/llm/stream.ts index 0a014d931..78a4b60e3 100644 --- a/core/llm/stream.ts +++ b/core/llm/stream.ts @@ -58,7 +58,7 @@ function parseDataLine(line: string): any { } function parseSseLine(line: string): { done: boolean; data: any } { - if (line.startsWith("data: [DONE]")) { + if (line.startsWith("data:[DONE]") || line.startsWith("data: [DONE]")) { return { done: true, data: undefined }; } if (line.startsWith("data:")) { From a13df1f6135ce21daadc945d13e41a652a2c2a5d Mon Sep 17 00:00:00 2001 From: Zhuyi Xue <527862+zyxue@users.noreply.github.com> Date: Thu, 8 May 2025 15:17:21 -0700 Subject: [PATCH 011/648] Update stream.ts --- packages/fetch/src/stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fetch/src/stream.ts b/packages/fetch/src/stream.ts index 7f33e377d..f8931868c 100644 --- a/packages/fetch/src/stream.ts +++ b/packages/fetch/src/stream.ts @@ -58,7 +58,7 @@ function parseDataLine(line: string): any { } function parseSseLine(line: string): { done: boolean; data: any } { - if (line.startsWith("data: [DONE]")) { + if (line.startsWith("data:[DONE]") || line.startsWith("data: [DONE]")) { return { done: true, data: undefined }; } if (line.startsWith("data:")) { From ca876694161f4088307c34a77607a22d989d1404 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 9 May 2025 00:00:07 -0700 Subject: [PATCH 012/648] tests for uriToFile --- extensions/intellij/build.gradle.kts | 2 + extensions/intellij/gradle.properties | 2 +- .../ContinuePluginStartupActivity.kt | 1 - .../continue/IdeProtocolClient.kt | 12 +++-- .../continue/IntelliJIde.kt | 23 +++++++++- .../services/ContinuePluginService.kt | 1 - .../unit/IntelliJIDETest.kt | 45 +++++++++++++++++++ 7 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/IntelliJIDETest.kt diff --git a/extensions/intellij/build.gradle.kts b/extensions/intellij/build.gradle.kts index d61966b3a..507f66da7 100644 --- a/extensions/intellij/build.gradle.kts +++ b/extensions/intellij/build.gradle.kts @@ -43,6 +43,7 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion") testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion") + testImplementation("io.mockk:mockk:1.14.2") testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2") testImplementation("com.squareup.okhttp3:logging-interceptor:4.12.0") @@ -63,6 +64,7 @@ dependencies { // Add Log4j 2.x explicitly implementation("org.apache.logging.log4j:log4j-core:2.20.0") implementation("org.apache.logging.log4j:log4j-api:2.20.0") + testImplementation(kotlin("test")) } // Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index e1571f5aa..eee5bae12 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -9,7 +9,7 @@ pluginSinceBuild=223 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType=IC platformVersion=2022.3.3 -#org.gradle.java.home=/opt/homebrew/opt/openjdk@17 +# org.gradle.java.home=/opt/homebrew/opt/openjdk@17 #platformVersion = LATEST-EAP-SNAPSHOT # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt index 500398241..030b7d6f2 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/activities/ContinuePluginStartupActivity.kt @@ -1,6 +1,5 @@ package com.github.continuedev.continueintellijextension.activities -import IntelliJIDE import com.intellij.openapi.fileEditor.FileEditorManagerListener import com.github.continuedev.continueintellijextension.auth.AuthListener import com.github.continuedev.continueintellijextension.auth.ContinueAuthService diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt index c394d5fc9..34e71c927 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IdeProtocolClient.kt @@ -1,10 +1,8 @@ package com.github.continuedev.continueintellijextension.`continue` -import IntelliJIDE import com.github.continuedev.continueintellijextension.* import com.github.continuedev.continueintellijextension.activities.ContinuePluginDisposable import com.github.continuedev.continueintellijextension.activities.showTutorial -import com.github.continuedev.continueintellijextension.auth.AuthListener import com.github.continuedev.continueintellijextension.auth.ContinueAuthService import com.github.continuedev.continueintellijextension.editor.DiffStreamHandler import com.github.continuedev.continueintellijextension.editor.DiffStreamService @@ -518,10 +516,16 @@ class IdeProtocolClient( null ) { response -> try { - val selectedModels = response.castNestedOrNull>("content", "result", "config", "selectedModelByRole") + val selectedModels = response.castNestedOrNull>( + "content", + "result", + "config", + "selectedModelByRole" + ) // If "apply" role model is not found, try "chat" role - val applyCodeBlockModel = selectedModels?.get("apply") ?: selectedModels?.get("chat") + val applyCodeBlockModel = + selectedModels?.get("apply") ?: selectedModels?.get("chat") if (applyCodeBlockModel != null) { continuation.resume(applyCodeBlockModel) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt index afd3f8b1c..8fa0c5389 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt @@ -1,6 +1,7 @@ +package com.github.continuedev.continueintellijextension.`continue` + import com.github.continuedev.continueintellijextension.* import com.github.continuedev.continueintellijextension.constants.getContinueGlobalPath -import com.github.continuedev.continueintellijextension.`continue`.GitService import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.github.continuedev.continueintellijextension.utils.* @@ -108,6 +109,24 @@ class IntelliJIDE( return true } + companion object { + fun uriToFile(uri: String): File { + try { + // Remove query parameters if present + val uriWithoutQuery = if (uri.contains("?")) { + URI(uri.substringBefore("?")) + } else { + URI(uri) + } + + val file = File(uriWithoutQuery) + return file + } catch (e: Exception) { + throw Exception("Invalid URI: $uri ${e.message}") + } + } + } + override suspend fun getIdeSettings(): IdeSettings { val settings = service() @@ -224,7 +243,7 @@ class IntelliJIDE( override suspend fun openUrl(url: String) { withContext(Dispatchers.IO) { - Desktop.browse(java.net.URI(url)) + Desktop.browse(URI(url)) } } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt index ba477ea44..b1c0c33a3 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt @@ -1,6 +1,5 @@ package com.github.continuedev.continueintellijextension.services -import IntelliJIDE import com.github.continuedev.continueintellijextension.`continue`.CoreMessenger import com.github.continuedev.continueintellijextension.`continue`.CoreMessengerManager import com.github.continuedev.continueintellijextension.`continue`.DiffManager diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/IntelliJIDETest.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/IntelliJIDETest.kt new file mode 100644 index 000000000..a4e251c4e --- /dev/null +++ b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/IntelliJIDETest.kt @@ -0,0 +1,45 @@ +package com.github.continuedev.continueintellijextension.unit + +import com.github.continuedev.continueintellijextension.`continue`.IntelliJIDE +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test +import java.io.File +import kotlin.test.assertEquals + +class IntelliJIDETest { + @Test + fun testUriToFile() { + val uri = "file:///path/to/file" + val file = IntelliJIDE.uriToFile(uri) + assertEquals(File("/path/to/file"), file) + } + + @Disabled("Not working") + @Test + fun testUriToFileWithWindowsPath() { + val uri = "file:///C:/path/to/file" + val file = IntelliJIDE.uriToFile(uri) + assertEquals(File("C:/path/to/file"), file) + } + + @Test + fun testUriToFileWithSpaces() { + val uri = "file:///path/to/file%20with%20spaces" + val file = IntelliJIDE.uriToFile(uri) + assertEquals(File("/path/to/file with spaces"), file) + } + + @Test + fun testUriToFileWithSpecialCharacters() { + val uri = "file:///path/to/file%23with%25special%26chars" + val file = IntelliJIDE.uriToFile(uri) + assertEquals(File("/path/to/file#with%special&chars"), file) + } + + @Test + fun testUriToFileWithQueryParams() { + val uri = "file:///path/to/file?param=value" + val file = IntelliJIDE.uriToFile(uri) + assertEquals(File("/path/to/file"), file) + } +} \ No newline at end of file From 2e765d33e2eb9805df005e05da23817187669b69 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 9 May 2025 16:04:17 +0530 Subject: [PATCH 013/648] gitignore iml files iml files are generated during debuggin/running on intellij run commands --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2ca914069..95cd177a9 100644 --- a/.gitignore +++ b/.gitignore @@ -162,5 +162,8 @@ extensions/.continue-debug/ *.vsix +# intellij module library files +*.iml + .continuerules **/.continue/assistants/ \ No newline at end of file From 0d175755531400007dd3c8fd3135ee9ea61979fd Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 9 May 2025 16:05:44 +0530 Subject: [PATCH 014/648] use npx and install cross-env as a dev depenendency the run scripts fail as they use absolute path and expected cross-env to be shell command --- binary/package-lock.json | 22 ++++++++++++++++++- binary/package.json | 1 + .../.run/Start Core Dev Server (CE).run.xml | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/binary/package-lock.json b/binary/package-lock.json index 5e864aaf7..05198ec05 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -31,6 +31,7 @@ "@types/jest": "^29.5.12", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", + "cross-env": "^7.0.3", "esbuild": "0.19.11", "jest": "^29.7.0", "pkg": "^5.8.1", @@ -49,7 +50,7 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.4", + "@continuedev/fetch": "^1.0.6", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "^1.0.19", "@modelcontextprotocol/sdk": "^1.5.0", @@ -3173,6 +3174,25 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", diff --git a/binary/package.json b/binary/package.json index 19dff8a6b..a2abcf3bb 100644 --- a/binary/package.json +++ b/binary/package.json @@ -33,6 +33,7 @@ "@types/jest": "^29.5.12", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", + "cross-env": "^7.0.3", "esbuild": "0.19.11", "jest": "^29.7.0", "pkg": "^5.8.1", diff --git a/extensions/intellij/.run/Start Core Dev Server (CE).run.xml b/extensions/intellij/.run/Start Core Dev Server (CE).run.xml index d6c646ef9..53c668ab2 100644 --- a/extensions/intellij/.run/Start Core Dev Server (CE).run.xml +++ b/extensions/intellij/.run/Start Core Dev Server (CE).run.xml @@ -1,6 +1,6 @@ -